Commit Graph
772 Commits
Author SHA1 Message Date
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
Adam Heath 0653d3a7d1 FEATURE: When doing bulk creation of tables, foreign key indices,
and declared indices, do the work in parallel.  Also, when the database
does not support wildcard looking of primary key info, do the per-table
lookup in parallel.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139851 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:07:18 +00:00
Adam Heath 1af60a7143 FEATURE: Add a thread pool to GenericHelper; this is per datasource.
Nothing makes use of this yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139700 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 02:50:49 +00:00
Jacques Le Roux 7a9e80e6ef A patch from Leon "Trivial patch to ModelViewEntity class to make view entity able to handle entity condition between field from one entity and another" https://issues.apache.org/jira/browse/OFBIZ-4321
In view entity definition, we can use <condition-expr> to create a filter condition between field and some value using specific operator. It should be also possible to make condition between field and rel-field through some kind operator. Such as:

<view-entity entity-name="xxx" package-name="xxx">
        ...
        <entity-condition>
            <condition-expr entity-alias="A" field-name="a" operator="equals" rel-entity-alias="B" rel-field-name="b"  />
        </entity-condition>
    </view-entity>

But there's a trivial defect in current ModelViewEntity which prevent this case working.

} else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
                return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
            } else {

In the above code extracted from ModelViewEntity, it does not consider the condition that the relField could be defined when value==null.

JLR:I checked that || should not be used in <<value == null && this.relFieldName>>, it was not obvious to me but is correct

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1137201 13f79535-47bb-0310-9956-ffa450edef68
2011-06-18 15:17:22 +00:00
Erwan de Ferrieres e1c4ec0c5d when sorting on more than 1 criteria, only the last one was used
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1136833 13f79535-47bb-0310-9956-ffa450edef68
2011-06-17 10:06:50 +00:00
Jacques Le Roux e6539dc8fc Closes "JmsTopicListener started twice when distributed-cache-clear is active" reported by Martin Kreidenweis at https://issues.apache.org/jira/browse/OFBIZ-4296
Simply avoid to start a JMS Listener thread from Job Manager when DCC is on. Then set it back to previous value.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1131144 13f79535-47bb-0310-9956-ffa450edef68
2011-06-03 19:05:07 +00:00
Marco Risaliti c44b4beb0f Removed some javadoc warning (wrong param/return) into entity component no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1126715 13f79535-47bb-0310-9956-ffa450edef68
2011-05-23 20:23:32 +00:00
Jacques Le Roux 0bc35e7275 A patch from Martin Kreidenweis "NullPointerException in GenericDelegator during testMode rollback" https://issues.apache.org/jira/browse/OFBIZ-4284
Test mode rollback doesn't work right in GenericDelegator for calls to removeByPrimary() key and removeByValue() when the row to be deleted didn't exist in the first place. It creates a TestOperation with a null value and subsequently fails to create that during rollback.

First, the TestOperation shouldn't be created at all. Second, if null is passed to GenericDelegator.create() it tries to handle this, but fails with a NullPointerException.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1104423 13f79535-47bb-0310-9956-ffa450edef68
2011-05-17 17:25:52 +00:00
Jacques Le Roux 87f0cfbb36 I got caught by this typo on a production cluster:
XmlFileLoader: File file:.....framework/entity/config/entityengine.xml process fatal error. Line: 686. Error message: Invalid byte 2 of 2-byte UTF-8 sequence.

After having manually put back the line modified by an automatically applied patch, I got this  mis-representation. Not sure why, and anyway had no chances to think about it (certainly due to a difference on how UTF-8 was represented on these servers and on my machine - XP with Putty and SSH)

So I remove this weirdness to prevent future possible nervous crises ;o)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1104173 13f79535-47bb-0310-9956-ffa450edef68
2011-05-17 11:54:11 +00:00
Erwan de Ferrieres 07a566932d Upgrading derby to 10.8.1.2 - changelog is here http://db.apache.org/derby/releases/release-10.8.1.2.cgi
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1103767 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 15:27:39 +00:00
Jacques Le Roux 5c8fbb779d Fix the comment of the not-null attribute (field element)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1100729 13f79535-47bb-0310-9956-ffa450edef68
2011-05-08 13:01:30 +00:00
Jacques Le Roux f90dcae786 Add an explicit comment about use-indices-unique="false" which is needed because of Derby bug with null values in a unique index
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1099727 13f79535-47bb-0310-9956-ffa450edef68
2011-05-05 09:09:39 +00:00