(OFBIZ-9578)
In a recent github mirror, I've found suspicious code.
Branch: master
path: framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java
...
1588 protected final List<String> messages = new LinkedList<String>();
...
1596 protected int updateData(Collection<String> messages) {
1597 if (messages != null && UtilValidate.isNotEmpty(this.messages)) {
1598 messages.addAll(messages);
1599 }
1600 return count;
1601 }
1602 }
In Line 1598, `messages.addAll' should be `this.messages.addAll'?
This might not be an issue but I wanted to report this just in case.
Thanks: JC (jaechang.nam@gmail.com)for report
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805143 13f79535-47bb-0310-9956-ffa450edef68
updating a form
(OFBIZ-9306)
Sometimes ago, I lost an hour because of a space at the end of a field's name in
a form. In creation it does not pass (the field lacks) but when updating the
form it passes and it's hard to find from where comes the problem.
Thanks: Michael for review and spotting a possible NPE in my 1st patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805141 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9577)
When you create a form with an entity or service auto fields, the three previous form field call only "super(fieldSource, modelFormField);" in their constructor or this initialise a TextField with the fieldInfo FieldInfo.TEXT.
I force the field info when the super constructor is called
This missing has been found during investigation on the issue OFBIZ-9577 to improve auto-fields-service with a file upload
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805011 13f79535-47bb-0310-9956-ffa450edef68
String with the given collection and delimiter
(OFBIZ-9397)
The added method UtilMisc.collectionToString(Collection values, String delimiter)
creates a String from the values of a collection, separated with the given
delimiter. This is done in a safe way without a "null" literal.
Thanks: Martin Becker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804970 13f79535-47bb-0310-9956-ffa450edef68
non technical service semaphore exceptions
(OFBIZ-9400)
GenericServicejob.failed(...) logs a stacktrace on every SemaphoreWait and
SemaphoreFail exception. The patch changes this for the non-technical service
semaphore exceptions to a one liner error logging to avoid polluting the logfile
with stacktraces e.g. in a scenario where a service is scheduled in short
intervals and fails expected while the former one is still running.
jleroux: I agree the case Martin describes must be quite annoying, especially in
production!
Thanks: Martin Becker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804962 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9571)
No functional change.
We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html :
<<Using the integer fields in this class (such as ROUND_HALF_UP) to represent
rounding mode is largely obsolete; the enumeration values of the RoundingMode
enum, (such as RoundingMode.HALF_UP) should be used instead.>>
That's an easy global replacement. But it also needs to import the RoundingMode
class. It was 26 files so I decided to rather clean all the imports in all files
with the help of Eclipse.
This is a 1st step. I will need to closely look at 2 special class: UtilNumber
and Calculate.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68
dbWrite(...)
(OFBIZ-9401)
In ServiceSemaphore.dbWrite(...) the transaction is suspended without checking
if there is a transaction in place. This results in logging a warning each time
the TransactionUtil.suspend() method is invoked without a current transaction in
place. The given patch cuts this unnecessary logging by checking if there is an
transaction in place to suspend. If a transaction exists - suspend it.
Thanks: Martin Becker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804940 13f79535-47bb-0310-9956-ffa450edef68
Add a DAO helper class to use a datasource as readonly
This helper is disable by default. To enable it change the helper class on your datasource use in entityengine.xml like
<datasource name="localderby"
helper-class="org.ofbiz.entity.datasource.ReadOnlyHelperDAO"
schema-name="OFBIZ" ...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804826 13f79535-47bb-0310-9956-ffa450edef68
When you want to remove a service we add a new xml element <deprecated/> that you can put on the service definition like this
<service name="oldService" ...>
<deprecated use-instead="newService" since="theReleaseXXX">The reason to move it as deprecated</deprecated>
<implements service="newService"/>
</service>
A deprecated service generate a warning log each time it is called
When you navigate on webtools a deprecated service is strike in the service list and display deprecated reason on the service definition detail page.
Thanks to Scott, Deepak, Taher and Jacques for sharing on this subject
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804786 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9567)
Changes a division with two long variables whose result was casted into a double
Now it performs a proper double division
Thanks: Dennis Balkir (and FB ;))
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804656 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9566)
MainResourceHandler
The protected fields were set to private since the class is not extended
anywhere. If they need to be accessed in the future, getter that return an
unmodifiable version should be implemented (Collections.unmodifiableXXX).
Refactor:
Uses multi exceptions catch (explicitly to not catch, hence somehow swallow,
RuntimeException)
Uses return instead of else when appropriate
Extracts a getLoader() handy method
Removes an useless thrown exception in invalidateDocument()
Removes an useless Document cast
Removes an useless ResourceLoader null initialisation
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804639 13f79535-47bb-0310-9956-ffa450edef68
When reviewing code, Eclipse complains: "Javadoc: Invalid param tag name"
when a param tag name "contains" a colon at end
Weirdly it does not complain about @return. Go figure! But I'll apply the same!
This removes all cases found in trunk. Another way could be to add a space
between the tag and the colon. But that's not how it's recommended to write
http://www.oracle.com/technetwork/articles/java/index-137868.html
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804637 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9563)
Fixes some diamond operators
ComponentContainer.java
deleted multiple unnecessary nullchecks
added nullcheck, because sortedComponentNames could possibly be assigned as
null through the method list()
ContainerConfig.java
deleted multiple unnecessary else-blocks
deleted two initializations to shorten the code and return the value directly
Thanks: Dennis Balkir
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804636 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9562)
Fixes some diamond operators
Implementes equals method to fix potential problems
Implementes hashCode method because I implemented equals method
Implementes timeDiff method to keep the code DRY
Thanks: Dennis Balkir
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804634 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9564)
Implemented method hashCode() because method equals() was implemented
Changed Exception to RuntimeException because no exception was thrown and the
only occurring exception could be a runtimeexception
Thanks: Dennis Balkir
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804556 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-5701)
jleroux: Kieuanhvu's explanation was not totally clear. So I rather provide
Renuka Srishti's at OFBIZ-9428 "getResultsSizeAfterPartialList() return wrong
count with distinct() for View Entity"
Here is the code sample to test the issue:
EntityListIterator productAssocListItr = null;
productAssocListItr = from("ProductAndAssoc").distinct().queryIterator();
productAssocListSize = productAssocListItr.getResultsSizeAfterPartialList();
productAssocListSize will differ from the actual distinct records in the
ProductAndAssoc View Entity.
This issue exists because it gives distinct records on the basis of the
first column in the table.
Thanks: Kieuanhvu for the patch, Renuka Srishti for a clear explanation and a
simple way to test (in a groovy for me)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804319 13f79535-47bb-0310-9956-ffa450edef68
Updated label from remove to expire while removing security group from user login, also added new entity-auto service to expire user login security group record.
Thanks S. Yazied for reporting the issue.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1803561 13f79535-47bb-0310-9956-ffa450edef68
When you call run service with groovy, you need to be sure that all parametes are good for the service call.
This improvement simplify this dsl with an automatic parameters check so you can call directly like that
run service : createProduct, with: context
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802798 13f79535-47bb-0310-9956-ffa450edef68
The warning message generated by OFBiz is a false positive caused by the fact that the way OFBiz performs the check is too simplistic: OFBiz parses for the content of the "()" in the fieldtype mapping and assumes that it is the column size.
However, in MySQL and possibly other database management systems, this is only true for varchar field definitions but not for datetime fields.
The column size for DATETIME(3) is not 3.
We should probably refactor the code in DatabaseUtil to compare the SQL field type from the JDBC driver, if possible to retrieve, (i.e. from the database) with the whole content (without any sting manipulation) of the attribute sql-type of the element field-type-def type (in fieldtype*.xml) i.e. "DATETIME(3)"; if they differ then a warning should be printed.
In this way we will have a more generic, simpler and more reliable tool to spot differences in the database
This is a workaround to fix the warning.
Thanks Jacopo.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802693 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7275)
The issue exists because in role type list there are multiple occurrences of substring "CUSTOMER". The existing check was just checking the occurrence of a substring in the string and found this value more than once in the list so the last option gets selected. Applied equality check to find the exact match.
Thanks Aditi Patidar for reporting and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802690 13f79535-47bb-0310-9956-ffa450edef68
Add a new option presentation none for the lookup element to don't display the link for display the search form bu only use autocompletion.
In the initial path from Pierre Gaudin the presentation name was autocompletion-only but I prefer change it to none because the link is just not preent.
Thanks Pierre Gaudin for this proposal and patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802682 13f79535-47bb-0310-9956-ffa450edef68
Like that :
GenericValue product = from('Product').where(context).queryOne()
This improvement simulate the minilang element <entity-one entity-name=Product value-name=product/> for helping the minilang migration to groovy
Thanks Jacopo to help the conception, Taher for the review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802660 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9399)
Removes the redundant logging done in ServiceSemaphore.waitOrFail() since the
error will be logged by the ServiceEngine anyway.
Thanks: Martin Becker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801380 13f79535-47bb-0310-9956-ffa450edef68
ProductShipmentUomAbbreviation_LEN_in
ProductShipmentUomAbbreviation_WT_g
ProductShipmentUomAbbreviation_WT_kg
ProductShipmentUomAbbreviation_WT_lb
These labels should be written in similer pattern as other labels of "Uom" entity are written in CommonEntityLabels.xml, for example :
ProductShipmentUomAbbreviation_LEN_in will be written as
Uom.abbreviation.LEN_in
<entityName>.<fieldName>.<PrimaryKey>
Thanks Renuka for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801281 13f79535-47bb-0310-9956-ffa450edef68