Commit Graph
54 Commits
Author SHA1 Message Date
Adrian Crum ead3169d5c FlexibleStringExpander refactor.
1. Improved parsing logic - the entire expression is pre-parsed now.
2. Factory method stores parsed expressions in the cache.
3. Single null/empty expression instance - saves on memory.
4. Class names and variable names shortened to reduce object size.
5. Small performance improvements.

The expression cache is set up with no limit. We'll have to see if that needs to be changed. Larger installations might need to limit the expression cache size.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@687422 13f79535-47bb-0310-9956-ffa450edef68
2008-08-20 18:50:04 +00:00
Jacques Le Roux e7905f2c8c Fix the anti-pattern
if (* != null && *.size() > 0) { 
where * is a variable name (String or Collection). Rewritten to
    if (UtilValidate.isNotEmpty(*)) {

Done with Eclipse regex replace feature with
search = if \((\w+) *!= *null *&& *(\w+)\.size\(\) *> *0\) *\{
replace = if (UtilValidate.isNotEmpty($1)) {

And of course some hand-work for imports and cleaning. I compiled and tested with ant run-tests

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@686591 13f79535-47bb-0310-9956-ffa450edef68
2008-08-17 07:47:18 +00:00
Adam Heath a9084a6f0d Add license header.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@686256 13f79535-47bb-0310-9956-ffa450edef68
2008-08-15 15:41:20 +00:00
Adam Heath fe7cddc3a2 More use of ServiceRegistry.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@686251 13f79535-47bb-0310-9956-ffa450edef68
2008-08-15 15:29:29 +00:00
Adam Heath 1dfdb73a7a Add the standard license header.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@685782 13f79535-47bb-0310-9956-ffa450edef68
2008-08-14 06:15:53 +00:00
Adam Heath 8caa026db8 Use a factory pattern to load available MethodOperation
implementations.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@685778 13f79535-47bb-0310-9956-ffa450edef68
2008-08-14 05:55:17 +00:00
Adam Heath fdd61ca101 Start using annotations; this will make more sense in the next few
days.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@685447 13f79535-47bb-0310-9956-ffa450edef68
2008-08-13 05:23:26 +00:00
Adrian Crum aff5df07e3 Minilang set-calendar improvement - supply default local and time zone when they aren't available.
There was a problem with the set-calendar operation when it was called from the job scheduler - a NPE was thrown. This commit fixes that.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@683414 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 21:13:09 +00:00
Adam Heath bb6796365f Fix generication of Iterate.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@682395 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 14:16:15 +00:00
Adam Heath cc3c62ffce Generification, enhanced-for, FastMap/FastList changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@682246 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 03:00:54 +00:00
David E. Jones 2ccff0b5d8 An option I've resisted for a while due to limited flexibility when used, but we have a lot of these common cases so this may be worth it; can now define CrUD services and not have to implement them for common cases; the create, update, and delete ExampleItem services now use this entity-auto implementation instead of explicit simple-methods; those are tested and are working, and other variations on create should too but I haven't tested them yet; this also includes various refactorings to expose nderlying tools in simple method code and make it reusable
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@679058 13f79535-47bb-0310-9956-ffa450edef68
2008-07-23 10:24:58 +00:00
Scott Gray 91bb08eff0 minilang's first-from-list operation now sets the field to null if the list is null or empty, previously the field was left unchanged
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@678116 13f79535-47bb-0310-9956-ffa450edef68
2008-07-19 08:10:46 +00:00
Adrian Crum f2651c9d47 Bug fix for set-calendar simple method operation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@673129 13f79535-47bb-0310-9956-ffa450edef68
2008-07-01 16:27:15 +00:00
Adam Heath 1dc13f6105 Number.valueOf changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@672898 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:20:37 +00:00
Scott Gray 45462bffaa A couple more fixes related to the recent minilang changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@667393 13f79535-47bb-0310-9956-ffa450edef68
2008-06-13 07:32:20 +00:00
Scott Gray 5f82669cb4 Fix for bug reported by Vikas Mayur on the dev list
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@667385 13f79535-47bb-0310-9956-ffa450edef68
2008-06-13 06:45:42 +00:00
David E. Jones bd2d32eaba Started effort of cleaning up element and attribute names in simple-methods, there is a lot of work to do here to make things consistent; for more info and a list of all changes see the docs.ofbiz.org Simple Method Cleanup Effort page
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@666069 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 11:31:17 +00:00
Adrian Crum 7da9f667dc Eliminated compiler warnings from most of the screen widget library. No functional changes.
I skipped the tree widget because it is not thread safe and it needs some work.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@662590 13f79535-47bb-0310-9956-ffa450edef68
2008-06-02 22:23:55 +00:00
David E. Jones 3543d6abe3 Changed the way EntityCondition sub-classes work so they use the javolution Reusable class for recycling objects; now all conditions should be created using the factory methods on the EntityCondition object instead of the direct constructors; there is a small variety of classes available there now for ease of use; also changed a bunch of old code to not use the deprecated constructors; note that still need to do a pass similar to this on EntityExpr
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@660780 13f79535-47bb-0310-9956-ffa450edef68
2008-05-28 01:58:46 +00:00
Adrian Crum a3536990f1 Locale and Time Zone refactor and bug fixes.
1. Modified the Start class to initialize the JVM default locale and time zone - configurable through start.properties. Removed calls to UtilDateTime.getDefaultTimeZone() - no longer needed.

2. Changed all calls to ObjectType.simpleTypeConvert(...) that didn't supply the necessary Locale and TimeZone objects. This fixes a lot of localization issues, https://issues.apache.org/jira/browse/OFBIZ-1696 being one of them.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@658045 13f79535-47bb-0310-9956-ffa450edef68
2008-05-19 23:50:14 +00:00
Scott Gray 153653615b Removed the rest of the calls to deprecated GenericDelegator methods, except for the findListIteratorByCondition which takes a DynamicViewEntity as a parameter not sure what to do about that one.
There's still all the bsh files to check though.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@655235 13f79535-47bb-0310-9956-ffa450edef68
2008-05-11 03:29:04 +00:00
Scott Gray b6411d196e Not really sure why but calling simple methods in other files wasn't working with the class loader that was being passed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@653180 13f79535-47bb-0310-9956-ffa450edef68
2008-05-04 05:34:21 +00:00
David E. Jones 329631a4b5 A whole bunch of cleanups to use newer and more consolidated delegator find methods; still lots of deprecation warnings, bots of deprecation warnings but this is a first pass, and things still run as before
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@653029 13f79535-47bb-0310-9956-ffa450edef68
2008-05-03 09:40:51 +00:00
Jacopo Cappellato 0e75a4abb1 Added support for get-related* operations in entity related information for artifact infos.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@639780 13f79535-47bb-0310-9956-ffa450edef68
2008-03-21 19:58:09 +00:00
David E. Jones be576cbf0c A bunch of fixes and refinements, completed first pass of successful full load for all entities/services, and an export of eomodeld forand service and an export for one service
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@633402 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 09:28:48 +00:00
David E. Jones 2bf0afbe4a No real functional changes to operational code, just new stuff for getting meta data about entities, services, etc from the system
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@633325 13f79535-47bb-0310-9956-ffa450edef68
2008-03-03 23:37:14 +00:00
Adrian Crum ef7d6740be Removed the adjuster requirement from the new set-calendar simple method operation. Having thought about it more, I realized the operation could be used just to align a date to a period start or end, without using an adjuster.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@616634 13f79535-47bb-0310-9956-ffa450edef68
2008-01-30 05:33:30 +00:00
Jacques Le Roux 6afa3fa833 A patch from Adrian Crum from an issue initiated by Fabien Carrion "To permit to calculate on a DATE object in minilang" (https://issues.apache.org/jira/browse/OFBIZ-1249) - OFBIZ-1249
I have added the XSD part please check it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@616292 13f79535-47bb-0310-9956-ffa450edef68
2008-01-29 12:55:45 +00:00
Adrian Crum 7d9b622afc Fixed problem with simple method call-service operation, reported by Chris Juettner on the dev mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@610440 13f79535-47bb-0310-9956-ffa450edef68
2008-01-09 16:32:21 +00:00
Adam Heath 2ff7a8a575 Make use of the single-arg variants of makePK/makeValue, removeAll,
and clearCacheLine


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@585803 13f79535-47bb-0310-9956-ffa450edef68
2007-10-18 02:46:57 +00:00
Scott Gray a1b604adf6 Changed all occurances of new BigDecimal("0") to BigDecimal.ZERO and likewise for BigDecimal.ONE
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@576773 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 08:30:58 +00:00
David E. Jones c9414cb886 Small change to correct problem with the last one; when the type conversion fails we don't want to put the original value in, it will cause a service call exception; set to null to just leave out
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@557109 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 01:15:13 +00:00
David E. Jones 7e9e6f515f Changed set-service-fields to add validation errors to a list instead of quiting, then calling method can control what to do with them
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@557102 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 00:46:17 +00:00
Andrew Zeneski b6ee74c3ed fixed to allow events to return 'null'
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@541927 13f79535-47bb-0310-9956-ffa450edef68
2007-05-26 18:51:18 +00:00
David E. Jones ebf8008f07 Applied patch from Joe Eckard to fix error message list handling; small change to use FastList instead of LinkedList; Jira #OFBIZ-792
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@515870 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 00:56:54 +00:00
David E. Jones ed67ae0bd7 Changed EntityDataAssert to throw exceptions so that calling method has more control over it
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@515285 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 20:27:36 +00:00
Jacopo Cappellato d521f0c604 Applied patch from Stefan Huehner (OFBIZ-513) to remove unnecessary import statements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@511254 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 11:49:42 +00:00
Jacopo Cappellato 9557289d93 If the include-user-login attribute for the minilang service call methods is not set or it is true, the user login is put in the context but only if in the context there is not already a user login.
Thanks to David Jones for the review and to Dave Napolitan for bringing this up to my attention.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@505482 13f79535-47bb-0310-9956-ffa450edef68
2007-02-09 20:33:06 +00:00
Alfred Maxwell Byers 9802d2fc81 Added require-new-transaction and transaction-timeout to minilang CallService class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@501646 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 00:09:29 +00:00
Jacques Le Roux a5632fa086 This is hte change of ASL2 headers in java files only.
Seems correct (35827 lines to review ;o).
I just wonder if we should keep the copyright comment in Classpath.java (about MortBay)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@496982 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 10:22:33 +00:00
David E. Jones e9bdbf0d28 Re-applied the patch from Adam Heath in Jira #OFBIZ-401 to update BSF to the Apache version 2.4.0; with JPublish gone this should work much better now
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@486518 13f79535-47bb-0310-9956-ffa450edef68
2006-12-13 06:58:02 +00:00
Jacques Le Roux 9b3b889c7b A patch from Stefan Huehner "Remove unused variables" (https://issues.apache.org/jira/browse/OFBIZ-525).
Issue is not closed : more patches to come

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@483405 13f79535-47bb-0310-9956-ffa450edef68
2006-12-07 10:21:27 +00:00
Jacques Le Roux eb82782d03 A patch from Stefan Huehner "Remove unused variables" (https://issues.apache.org/jira/browse/OFBIZ-525).
Issue is not closed : more patches to come

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@483235 13f79535-47bb-0310-9956-ffa450edef68
2006-12-06 21:18:30 +00:00
Jacopo Cappellato 4c2ba27630 Applied patch from Stefan Huehner (OFBIZ-514) to remove some unnecessary casts.
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@482260 13f79535-47bb-0310-9956-ffa450edef68
2006-12-04 17:41:14 +00:00
David E. Jones 74b7217389 Applied patch from Scott Gray to add while operation; it looks good but I made a small change to the java code in While.java to simplify how the while loop is managed, ie to be more direct; from Jira #OFBIZ-444
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@474048 13f79535-47bb-0310-9956-ffa450edef68
2006-11-12 21:24:52 +00:00
Jacques Le Roux dccc751e54 Changes from a Scott Gray's patch : "Add a while-compare operation to minilang" (https://issues.apache.org/jira/browse/OFBIZ-444)
Thanks Scott

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@473334 13f79535-47bb-0310-9956-ffa450edef68
2006-11-10 13:21:45 +00:00
Jacques Le Roux a309b22b29 Forgot to revert java files to IBM bsf (com.ibm.bsf)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@468683 13f79535-47bb-0310-9956-ffa450edef68
2006-10-28 12:19:52 +00:00
Jacques Le Roux 080680236a A patch from Adam Heath "Upgrade bsf to something a bit more modern" (https://issues.apache.org/jira/browse/OFBIZ-401)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@467304 13f79535-47bb-0310-9956-ffa450edef68
2006-10-24 10:58:36 +00:00
David E. Jones 14908cff1e A small change to put a session variable in the environment for simple methods called as an event
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@464510 13f79535-47bb-0310-9956-ffa450edef68
2006-10-16 14:57:07 +00:00
Jacopo Cappellato 593182a435 Removed author information from all the files of the "minilang" component: keeping this information in source files is discouraged by the ASF (clearer information about the contributors of a file can be derived from the commit logs).
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@454120 13f79535-47bb-0310-9956-ffa450edef68
2006-10-08 10:34:24 +00:00