Commit Graph
783 Commits
Author SHA1 Message Date
Jacques Le Roux 456eb16137 A modified patch from Patrick Antivackis "Null values are not synchronized in http mode" https://issues.apache.org/jira/browse/OFBIZ-4602
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
2011-12-22 14:14:57 +00:00
Jacques Le Roux 046deacbe0 A patch from Wai https://issues.apache.org/jira/browse/OFBIZ-4620 "fail uploading audio/video files to database"
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
2011-12-14 09:18:04 +00:00
Erwan de Ferrieres 4162e44a47 A patch from Youssef Khaye - OFBIZ-4573 - complex-alias does not allow to do (discountPercent * 100) as stated in xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1205156 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 20:41:14 +00:00
Adrian Crum 0e9a239c4f View entity bug fix provided by Anne Jessel - https://issues.apache.org/jira/browse/OFBIZ-4393.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1201232 13f79535-47bb-0310-9956-ffa450edef68
2011-11-12 09:41:56 +00:00
Erwan de Ferrieres 06e76fec52 Upgrading to latest derby version, release note here: http://db.apache.org/derby/releases/release-10.8.2.2.cgi
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1195187 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 16:10:37 +00:00
Jacques Le Roux c5b1d6ab09 A patch from Leon "trivial update to ModelViewEntity.java" https://issues.apache.org/jira/browse/OFBIZ-4523
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
2011-10-29 21:18:58 +00:00
Hans Bakker d3b0d26077 change info message to verbose
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1185031 13f79535-47bb-0310-9956-ffa450edef68
2011-10-17 07:37:21 +00:00
Sascha Rodekamp 5e41d63234 FIX: A patch from Leon which fixes the dependent State dropdown https://issues.apache.org/jira/browse/OFBIZ-4349
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1179943 13f79535-47bb-0310-9956-ffa450edef68
2011-10-07 06:25:06 +00:00
Jacques Le Roux 69d65781ea A patch from Dimitri Unruh "With no DistributionCacheClear JMS is not working anymore." https://issues.apache.org/jira/browse/OFBIZ-4296
Tested in both case (with and w/out dcc), works fine AFAICT

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1174964 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 19:22:40 +00:00
Erwan de Ferrieres ca8143f679 Resolving OFBIZ-4349 - commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1174308 13f79535-47bb-0310-9956-ffa450edef68
2011-09-22 18:36:25 +00:00
Hans Bakker cea83127a0 correcting the ordering of loading the data for tenants
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1173994 13f79535-47bb-0310-9956-ffa450edef68
2011-09-22 08:28:59 +00:00
Hans Bakker b64da95ceb add 2 new tenant ant commands to load seed/demo data for a specific tenant only: './ant run-install-tenant -DtenantId' and './ant run-install-tenant-all' for all tenants in the tenant enttity
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1172989 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 06:23:02 +00:00
Sascha Rodekamp 46b29a9911 IMPROVEMENT: Replace String concatenation in a loop (https://issues.apache.org/jira/browse/OFBIZ-4418) A patch from Dimitri Unruh.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1170961 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 06:04:29 +00:00
Sascha Rodekamp 16607bb1ac UPDATE: Some improvements with Map iterations (https://issues.apache.org/jira/browse/OFBIZ-4415) A patch from Dimitri Unruh which improves some Map Iterations.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1170525 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 10:52:01 +00:00
Jacques Le Roux e497883d62 VCard.java: replaec an UtilValidate.isNotEmpty() by a simple isEmpty()
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
2011-09-12 14:13:17 +00:00
Jacques Le Roux 2b712efb98 No functional changes, simple code refactoring around UtilValidate.is(Not)Empty()
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
2011-09-11 17:06:11 +00:00
Jacques Le Roux 43aa95aaa3 Closes "SequenceUtil may generate duplicate IDs in Load Balancing mode" https://issues.apache.org/jira/browse/OFBIZ-2353
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
2011-07-08 22:58:35 +00:00
Adam Heath 7109b6c2f0 FEATURE: Do GenericHelper initialization in parallel.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141314 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 23:09:39 +00:00
Adam Heath bce471c3a1 FEATURE: Add some doFooTransaction variants, that allow for the
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
2011-06-29 22:12:02 +00:00
Adam Heath 4bfcf340d2 FEATURE: Reworked Callable helper methods to support wrapping/proxying, so
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
2011-06-29 22:11:54 +00:00
Adam Heath 8c90616645 OPTIMIZE: Move the group helper initialization code out of the loop and
into a separate method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141277 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:11:25 +00:00
Adam Heath 6676048162 WHITESPACE: Do a bunch of whitespace transformative operations.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141276 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:11:20 +00:00
Adam Heath b0cfef6886 FIX: The generics markup of user and session identifiers was not
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
2011-06-29 22:11:11 +00:00
Adam Heath f23be289b5 FIX: In resume(Transaction), there was a block of code commented out
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
2011-06-29 22:11:04 +00:00
Adam Heath 16f038e010 OPTIMIZE: In class TestOperation, instance variables should be first, then
constructors, before any other methods.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141273 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:10:58 +00:00
Adam Heath f7a186ad56 FIX: Fix some generics warnings I recently introduced.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141271 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:10:47 +00:00
Adam Heath 7e99311694 FEATURE: Add field-set feature to entity engine. You can now
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
2011-06-26 19:19:06 +00:00
Adam Heath ce76187cb0 FEATURE: <view-conditon> on <view-link> is now supported.
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
2011-06-26 19:19:00 +00:00
Adam Heath 9213dd110e FIX/OPTIMIZE: Do column-name munging once, and save the
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
2011-06-26 19:15:40 +00:00
Adam Heath c391207fac OPTIMIZE: Switch the database feature detection code to use a loop and a registry
of detectable features.  As a side effect, the output strings are now
aligned.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139918 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:15:34 +00:00
Adam Heath 32f514d948 FIX: Protect against a null return from getFieldDefs().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139888 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:32 +00:00
Adam Heath 0e1df8efa8 FIX: Protect against a null return from getRelations().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139887 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:24 +00:00
Adam Heath 162d94866d FIX: Properly detect if a UNIONED query is being requested.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139886 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:18 +00:00
Adam Heath ecb6e45a0f FIX: Protect against a null return from getFieldAlls().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139885 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:12 +00:00
Adam Heath 23296d0784 FIX: Add the sql excludes to the dynamic view.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139884 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:06 +00:00
Adam Heath 0d8288eb1a FIX: Fix NPE when converting a view to xml that was originally created as
a dynamic-view.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139880 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:40 +00:00
Adam Heath 6b73f3e3ac FEATURE: Start passing ModelFieldTypeReader around(nothing
uses it yet, coming soon).  This will allow view entities to do stuff
with field type definitions.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139879 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:29 +00:00
Adam Heath 421ce3102a OPTIMIZE: Optimize ModelConversion looping logic, so that
it's not walking the map's values; instead, do custom management of a
standard array.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139878 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:22 +00:00
Adam Heath c1264c29bf OPTIMIZE: expandAllAliasAlls: Fetch the entityAlias into a
local variable.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139877 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:16 +00:00
Adam Heath d50418875f OPTIMIZE: ViewConditionExpr.createCondition: Use == for EntityOperator
equality, instead of equals(); slight speedup, and the code looks a bit nicer.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139876 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:10 +00:00
Adam Heath 5a648ab76d OPTIMIZE: Lookup the correct condition operator in the
constructor for view condition classes.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139875 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:04 +00:00
Adam Heath 7d82390c68 OPTIMIZE: Changed a bunch of errors/warnings/exceptions to be more
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
2011-06-26 18:09:57 +00:00
Adam Heath eb657bf2b5 OPTIMIZE: Make a bunch of support classes in ModelView be final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139873 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:50 +00:00
Adam Heath 151fd9e428 FEATURE: Allow for setting the ViewEntityCondition on
ModelViewLink programmatically.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139872 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:44 +00:00
Adam Heath c693076ab6 FIX: Fix NPE in ModelAliasAll.iterator(), when
fieldsToExclude is null.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139871 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:38 +00:00
Adam Heath a4fbfd05ec FIX: EntityFieldValue has a helper method for fetching the
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
2011-06-26 18:09:32 +00:00
Adam Heath f75220c219 FIX: getModelField: when fetching the ModelField, handle the
case of the field being part of a ModelViewEntity.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139869 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:53 +00:00
Adam Heath 939c932983 OPTIMIZE: ViewEntityCondition.createCondition: fetch the lhs
field into a local variable.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139868 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:48 +00:00
Adam Heath 3338c7743d OPTIMIZE: ViewEntityCondition.createCondition: move the
fetching of lhs a little bit earlier.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139867 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:42 +00:00
Adam Heath 8fba300516 FIX: When the rhs was an EntityFieldValue, the wrong model field was being
checked(it was checking the left field).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139856 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:07:44 +00:00