In order to send over http the values to create, store and remove, Ofbiz is Xml serializing the values. GenericValue xml serialization is managed in GenericEntity.makeXmlElement, unfortunately this method just don't serialized null valued fields.
To solve this issue, I managed null value the same way GenericEntity.setString (which is used for the Xml deserializing). I only managed until case 10, because i'm not sure the setString for the cases 11 to 15 are well managed (not taking care of null value)
jleroux: After looking at GenericEntity.setString and initial commit (http://svn.ofbiz.org/viewcvs?rev=7779&view=rev) I see no reasons to not handling cases under 10 the same way. So I added these cases as well using fall through.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1222241 13f79535-47bb-0310-9956-ffa450edef68
When uploading binary files (eg. image/audio/video) to the database, ofbiz throws a type casting exception because it is trying to type cast HeapByteBuffer to byte[].
I think the problem stems from configuring ofbiz to use java.nio.ByteBuffer and its subclass java.nio.HeapByteBuffer to contain uploaded binary data but no accommodation is made in the code to work with this type of object.
To test this, you need to set content.properties/content.upload.always.local.file=false
an use partymgr/control/viewprofile?partyId=admin and upload an image file.
java.nio.HeapByteBuffer comes from java's rt.jar (make sure your classpath includes this)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1214124 13f79535-47bb-0310-9956-ffa450edef68
Since the relFieldName of ViewConditionExpr object can never be null, so correct comparison "this.relFieldName == null" to "UtilValidate.isEmpty(this.relFieldName)".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1195042 13f79535-47bb-0310-9956-ffa450edef68
ShoppingCart.java: a tabs has been automatically replaced by 8 spaces, fixes it
UtilValidate.java: removes useless parentheses
GeneriDao.java: fixes a wrong UtilValidate.isNotEmpty
ModelFormField.java: revert all UtilValidate.is(Not)Empty() changes though I ddid not find an error there, it must be one because https://localhost:8443/humanres/control/EditResponsibilityTypes is not rendered correctly. I will check again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169754 13f79535-47bb-0310-9956-ffa450edef68
Changes implementation of UtilValidate.isEmpty() for Collection and Map by using isEmpty() instead of c.size() == 0). It's more clear and as efficient. Removes also useless parentheses there.
Makes use of UtilValidate.is(Not)Empty() everywhere it makes senses. This for 2 reasons:
* Make the code more readable by replacing the (!)null/isEmpty pattern.
* Avoid possible NPEs when only isEmpty() was used (after Entity.find... for instance). I found a lot of cases (242 today) where isEmpty() could perhaps be replaced in Framework. But I guess no NPE checks were missing there and anyway it was too much for me to check them all... So I only did the relevant changes in Applications...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169478 13f79535-47bb-0310-9956-ffa450edef68
Pb: If OFBiz is deployed on 2 servers in Load Balancing Mode, SequenceUtil will generate duplicate IDs because synchronization is done at JVM level instead of doing it in DB.
The OFBIZ-2353 SELECT FOR UPDATE solution.patch provides a simple mean to quickly resolve this issue. I did not remove the bank loop (useless since there is a DB contention).
I created a cluster general property. But since, most of the time, when you use a cluster you use also a sole database with a delegator having distributed-cache-clear-enabled set to true, I retrieve this information to automatically use SELECT FOR UPDATE in this case
This has been tested on a cluster with JMeter. BTW I found that UserLoginHistory can throw errors because it does not use a SeqId in PK but only login+fromDate. I guess there are other cases like that but in reality it's unlikely that someone log on 2 diff machines with the same login at the same time (ms), just a JMeter side effect...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1144537 13f79535-47bb-0310-9956-ffa450edef68
transaction timeout to be specified, and deprecate the old ones.
Additionally, the Callable now comes first, as that is groovy
compatible.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141283 13f79535-47bb-0310-9956-ffa450edef68
that calling code can pass the reconstructed objects directly to
Executor instances.
As a nice side effect, these classes show up in exceptions, so you can
know a bit more about the transaction nature of the call stack.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141282 13f79535-47bb-0310-9956-ffa450edef68
correct; someone didn't understand how generics work(if you are casting,
you are most likely doing something wrong; if you are storing Object,
you are most likely doing something wrong).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141275 13f79535-47bb-0310-9956-ffa450edef68
that is supposed to be used on older WebLogic containers. That code was
actually completely broken. I've fixed it based on the embedded url,
but can't test it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141274 13f79535-47bb-0310-9956-ffa450edef68
put different fields into different field sets, and when you select any
field in a particular set, all fields in that set will be fetched. This
also cascades upwards thru views, including alias-all and alias.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139922 13f79535-47bb-0310-9956-ffa450edef68
This allows for LEFT JOINs that have additional filtering applied to
them. FIXME: not implemented on theta- database types.
This feature depends on the following svn commits: 1139856, 1139869,
1139870, 1139879, 1139919.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139921 13f79535-47bb-0310-9956-ffa450edef68
output, instead of doing it each time the sql string is generated. This
solidifies the definition of getColValue() and getColName(). colName is
the identifier used to refer to the column, it's generally what comes
after the AS keyword. colValue is used to the left of AS, and in
CONDITION/ORDER BY/GROUP BY clauses.
This change should allow EntityFieldValue to be rewritten, so it doesn't
have the hack of having to deal with the entityAliasStack. In theory,
it can just call getColName/getColValue(I'm not certain which is the
correct one for this case).
Also, EntityFieldValue should not have that hack at all, it should have
been put into a completely separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139919 13f79535-47bb-0310-9956-ffa450edef68
consistent, and prefix each message with [entityName] so that fixing the
problem in the model definition becomes easier.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139874 13f79535-47bb-0310-9956-ffa450edef68
ModelField; use that instead of fetching the ModelField directly from
the entity. This is a fix for view-conditions, as the EntityFieldValue
has an internal ModelViewEntity that it uses to fetch the field;
fetching the raw fieldName was not correct in these cases.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139870 13f79535-47bb-0310-9956-ffa450edef68