Commit Graph
154 Commits
Author SHA1 Message Date
Adrian Crum 6a2d61bb07 First pass at overhauled Mini-language <set> element.
1. The schema has been updated to reflect the new syntax.

2. The updated element will log warnings for incorrect syntax. Validation logging can be turned off by changing the minilang.properties validation.level property to none.

3. The element will auto-correct the XML source file if the minilang.properties autocorrect property is set to true.

4. Code has been cleaned up and simplified.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330422 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 17:09:15 +00:00
Adrian Crum 5b1f84472e Added Mini-language auto-correcting capability.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330418 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 17:02:26 +00:00
Adrian Crum c99e22ef50 Modified MiniLangUtil.isConstantPlusExpressionAttribute to allow concatenated expressions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330396 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 16:27:13 +00:00
Adrian Crum 322d294a15 MiniLangValidate.java bug fix - validation was failing for constant attributes that contained only spaces.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329221 13f79535-47bb-0310-9956-ffa450edef68
2012-04-23 12:57:06 +00:00
Adrian Crum 0d60d510f5 Added <continue> and <break> elements to Mini-language looping elements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329034 13f79535-47bb-0310-9956-ffa450edef68
2012-04-23 02:31:53 +00:00
Adrian Crum addea69c51 Build out Mini-language exception handling.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329032 13f79535-47bb-0310-9956-ffa450edef68
2012-04-23 02:29:28 +00:00
Adrian Crum 1a2a55e4be Removed Mini-language elements that were deprecated in a previous release and are no longer used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328809 13f79535-47bb-0310-9956-ffa450edef68
2012-04-22 07:43:44 +00:00
Adrian Crum a871ca4fac Some Mini-language validation code and other files in preparation for the syntax overhaul. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328302 13f79535-47bb-0310-9956-ffa450edef68
2012-04-20 10:26:38 +00:00
Adrian Crum 500a2b4ec4 Added exception handling to the mini-language API. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328222 13f79535-47bb-0310-9956-ffa450edef68
2012-04-20 06:53:41 +00:00
Adrian Crum b64a9d940f Mini-language code format cleanup. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327981 13f79535-47bb-0310-9956-ffa450edef68
2012-04-19 15:09:03 +00:00
Jacopo Cappellato dc4edc748e CVE-2012-1621: Removed the Webslinger component and all the framework dependencies on it; the reasons for this
* no active committer was maintaining the webslinger component
* the component was experimental and not really used by OFBiz
* the component was really big (lot of jars etc...) and we are trying to slim down the OFBiz framework and keep only the essential/useful features
* this fixes a security issue reported to the OFBiz PMC

The only Webslinger feature used by the OFBiz framework was the "service debug mode" (enabled by default with the property servicedispatcher.servicedebugmode): I have considered to keep it but it was impossible because it relied on Webslinger legacy code (in the org.webslinger.invoker.* package) that was never contributed as a source file to the OFBiz project; I have tried to review the source file from an external Webslinger repo but I couldn't find them; the only site about Webslinger I could find is this:
http://www.webslinger.org/Downloads
but the svn resources mentioned there are broken. The fact that the OFBiz frameework was dependent (for a feature useful only in development mode) on an external project that doesn't publish its source code (at least in an easy to find location) convinced me that it was better to clean up the dependency completely; on the bright side OFBiz should now use less memory.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1301866 13f79535-47bb-0310-9956-ffa450edef68
2012-03-17 05:35:45 +00:00
Adrian Crum 057bd2595e Fixed a static field that was initialized to the wrong class name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300847 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 08:47:00 +00:00
Jacopo Cappellato f18d49458f First pass in the direction of the implementation of a more flexible mechanism to plugin different scripting technologies and in the same time being able to get rid of a lot of framework related custom code to support them.
In particular these chenges should make it easier to implement JSR-223 (even if I think that we should still treat Groovy in a special way).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296762 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 07:24:47 +00:00
Hans Bakker cc8c924b89 make <property-to-field/> in minilanguage first look in the newly created SystemProperty entity to be able to override the system properties defined in the properties files
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238993 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:14:53 +00:00
Hans Bakker f484f7b9d0 revert r1238954 some local changes were added
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238991 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:13:21 +00:00
Hans Bakker 204b9eb01a Wrong commit reverted in r1238991
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238954 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 07:22:12 +00:00
Sascha Rodekamp 242ba72077 Wrong errorMessage output from minilang event (https://issues.apache.org/jira/browse/OFBIZ-3461) A patch from Dimitri Unruh: when a service returns an errormessagelist to a simple method event, the message list is formatted just as a string.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1214212 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 12:31:19 +00:00
Sascha Rodekamp 2dd668708f FIX: IO stream objects are not closed (https://issues.apache.org/jira/browse/OFBIZ-4420) A patch from Dimitri Unruh: Some methods are creating an IO stream object without closing it, so it could result on a descriptor leak.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1171393 13f79535-47bb-0310-9956-ffa450edef68
2011-09-16 06:04:21 +00:00
Adrian Crum aa531f10af Improved mini-language <set> operation: now supports groovy: syntax in the from-field attribute.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1164712 13f79535-47bb-0310-9956-ffa450edef68
2011-09-02 20:55:15 +00:00
Scott Gray d54894f913 Just realized I missed sending the error message list along to the service. (It pays to review your own commits)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1159971 13f79535-47bb-0310-9956-ffa450edef68
2011-08-21 12:09:47 +00:00
Scott Gray de7bf9ddf9 Replace code with a call to ModelService.makeValid(...) which does the same thing
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1159969 13f79535-47bb-0310-9956-ffa450edef68
2011-08-21 12:03:43 +00:00
Erwan de Ferrieres 15c1cc682c Wrong attribute was used
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1136831 13f79535-47bb-0310-9956-ffa450edef68
2011-06-17 10:01:52 +00:00
Marco Risaliti 097cb92c09 Remove some warning in ContextAccessor (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1075527 13f79535-47bb-0310-9956-ffa450edef68
2011-02-28 20:59:37 +00:00
Marco Risaliti 2d7c4c5595 Remove some warning in EmptyCondition (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1075526 13f79535-47bb-0310-9956-ffa450edef68
2011-02-28 20:58:18 +00:00
Marco Risaliti 22eff3dbc9 Remove some warning in Iterate (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1075525 13f79535-47bb-0310-9956-ffa450edef68
2011-02-28 20:56:03 +00:00
Marco Risaliti 01c0bfb1e1 Remove some warning in CallBsh (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1075524 13f79535-47bb-0310-9956-ffa450edef68
2011-02-28 20:51:20 +00:00
Sascha Rodekamp 40f52ad764 Improvement - if-regexp conditions in Minilang and Screens not thread safe (https://issues.apache.org/jira/browse/OFBIZ-4107). I added another getTestPattern Method to support case insensitive tests. The case insensitive testPattern is needed from the UtilHttp.checkURLforSpiders.
Thanks Martin & Dimitri for your effort.

Orig. Msg.:

The Perl5Matcher Perl5Compiler are not thread safe, as mentioned in their documentation: http://jakarta.apache.org/oro/api/org/apache/oro/text/regex/Perl5Compiler.html
A separate instance should be used per thread.

The concrete issue occurred in our system in the createCommContentDataResource service. The service tries to save emails to the database after they have been sent. It failed because of the described issue. This caused the whole email service (sendMailFromScreen) to be rescheduled. So customers got emails twice.

The Perl5Matcher and Perl5Compiler instances are assigned to static fields in the org.ofbiz.minilang.method.ifops.IfRegexp class. So every thread will use the same instance. No synchronization is done currently. Changing the fields to be non-static will not work either, as SimpleMethods are cached. So all calls to the same simple method use the same IfRegexp instance.

We fixed the problem by moving the instantiation of the Perl5Matcher and Perl5Compiler to the exec() method in IfRegexp.

Other classes are most likely affected, too: org.ofbiz.entity.condition.EntityComparisonOperator, org.ofbiz.minilang.method.conditional.RegexpCondition, org.ofbiz.minilang.operation.Regexp, org.ofbiz.widget.menu.ModelMenuCondition$IfRegexp, org.ofbiz.widget.screen.ModelScreenCondition$IfRegexp, org.ofbiz.widget.tree.ModelTreeCondition$IfRegexp


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1075322 13f79535-47bb-0310-9956-ffa450edef68
2011-02-28 13:43:23 +00:00
Marco Risaliti e7f8caeed3 Add a @SuppressWarning("serial") in FlexibleMessage (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069085 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 20:51:42 +00:00
Marco Risaliti a0079f6740 Add a @SuppressWarning("serial") in MiniLangException (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069083 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 20:51:03 +00:00
Scott Gray 47f43a302a Remove unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044931 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 21:31:27 +00:00
Adrian Crum ba90a21a73 Log element in mini-language now prints source file line number.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@980657 13f79535-47bb-0310-9956-ffa450edef68
2010-07-30 06:26:35 +00:00
Jacques Le Roux 595c88d634 A patch from Shubham Dubey "Using number value with calcop operator does not work as thought" (https://issues.apache.org/jira/browse/OFBIZ-3821) - OFBIZ-3821
For instance if you use

<calcop operator="multiply" field="parameters.numberSpecified">
    <number value="${uomConversion.conversionFactor}"/>

and have a value > 1000 in conversionFactor you will get 1,000 for number value. It works well if you replace by

<calcop operator="multiply">
    <calcop operator="get" field="parameters.numberSpecified"/>
    <calcop operator="get" field="uomConversion.conversionFactor"/>

The problem exists in trunk and certainly R10.04 (not tested) maybe in previous release though I don't think so, it looks like something introduced with UEL



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@955568 13f79535-47bb-0310-9956-ffa450edef68
2010-06-17 12:26:16 +00:00
Scott Gray 839e98de6a Fix problem where inlined simple map processors weren't being given the locale correctly, reported by Saad Hage on the user list
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@939966 13f79535-47bb-0310-9956-ffa450edef68
2010-05-01 10:07:41 +00:00
Andrew Zeneski d78152f6c8 implemented <script> tag in minilang that works exactly the same way as the screen widget version
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@934510 13f79535-47bb-0310-9956-ffa450edef68
2010-04-15 18:32:35 +00:00
Adam Heath 6122265c29 s/ServiceRegistry/ServiceLoader/
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@921085 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 19:52:50 +00:00
Bilgin Ismet Ibryam 7479c4d912 Don't return the default message "The action was performed successfully" when call-service element is used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@917467 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01 11:16:25 +00:00
Adrian Crum cddeb581b9 Partially revert my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@904971 13f79535-47bb-0310-9956-ffa450edef68
2010-01-31 04:00:57 +00:00
Adrian Crum 988097907e Based on advice from Adam Heath, made FlexibleMapAccessor and UelUtil methods syntactically correct. Methods that read Maps take read-only Map arguments, and methods that write Maps take writable Map arguments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@904962 13f79535-47bb-0310-9956-ffa450edef68
2010-01-31 03:24:58 +00:00
David E. Jones dd572e0d75 Change based on recent dev list discussion so that break-on-error acts more like an ignore error type of thing; when combined with require-new-transaction=true this will effectively result in no issues from the called service bubbling up to the calling service; with this change manually clearing out the error message and response code is no longer necessary
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@903567 13f79535-47bb-0310-9956-ffa450edef68
2010-01-27 08:48:55 +00:00
Scott Gray ed3cfedd24 Fix bug reported by Mridul Pathak, the minilang iterate tag was unable to iterate over a Set
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@901880 13f79535-47bb-0310-9956-ffa450edef68
2010-01-21 22:02:14 +00:00
Adam Heath b17eb127ec Fix trailing whitespace, and mixed tab/space at the beginning of lines.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@899812 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 21:00:23 +00:00
Jacopo Cappellato 8c8cc267a6 Based on feedback from Adam Heath and Adrian Crum, the loop operation now breaks the execution of the method if the count variable is negative.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@899689 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 16:33:51 +00:00
Jacopo Cappellato aabb21bb83 Based on suggestion by Adam Heath, the warning message is logged only if the count is negative; if the count is zero the next for loop will be skipped and the method will return true as well, but without warning message.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@899557 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 08:14:39 +00:00
Jacopo Cappellato 7b0ce29fc8 Looping on a variable/counter with initial value 0 was causing the simple method to stop and return.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@899116 13f79535-47bb-0310-9956-ffa450edef68
2010-01-14 08:46:04 +00:00
Scott Gray e1cbfb28ed Added the ability to include all tests from a given simple method document in a test suite by only specifying the location and not the method name. All simple methods with a method name beginning with "test" will be included and will be executed in the order present in the document. Example usage:
<test-case case-name="auto-accounting-transaction-tests">
        <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml"/>
    </test-case>
Basically just mimics the behavior of the junit-test-suite tag but for simple method tests

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@893662 13f79535-47bb-0310-9956-ffa450edef68
2009-12-24 00:40:19 +00:00
Marco Risaliti 70200c8a4f Internazionalization of an error messages of MiniLang (OFBIZ-3360)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@891929 13f79535-47bb-0310-9956-ffa450edef68
2009-12-17 21:41:00 +00:00
Jacques Le Roux 2777b83223 Fix r885091 where isNotEmpty has been used by error instead of isEmpty
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@885092 13f79535-47bb-0310-9956-ffa450edef68
2009-11-28 13:59:45 +00:00
Jacques Le Roux 5d4b9b5982 More uses of isEmpty(expr) instead of (expr == null) || (expr.size() == 0
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@885091 13f79535-47bb-0310-9956-ffa450edef68
2009-11-28 13:31:52 +00:00
Jacques Le Roux c72b29cb1f Use UtilValidate.isNotEmpty methods instead of (obj != null) || (obj.length > 0) and (obj != null) || (obj.size > 0)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@883549 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:41:34 +00:00
Jacques Le Roux e839974fe7 Use UtilValidate.isEmpty methods instead of (obj == null) || (obj.length == 0)
Complete r883507


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@883508 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 21:48:18 +00:00