Commit Graph
510 Commits
Author SHA1 Message Date
Adrian Crum f35311f358 Reverting changes to the Mini-language <add-error> element. Too much code depends on the "error_list" name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331811 13f79535-47bb-0310-9956-ffa450edef68
2012-04-28 19:25:48 +00:00
Adrian Crum ade0bf0ccc Overhauled Mini-language <check-errors> and <add-error> elements.
This commit fixes a bug in the <add-error> element. Some of the tests written in Mini-language fail now because errors were previously ignored, but now the error handling works properly.

To assist the developer community with fixing the tests, I added an INFO log message to track down the faulty test code. Run the tests, and then search the log file for "<add-error>".


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331802 13f79535-47bb-0310-9956-ffa450edef68
2012-04-28 18:48:42 +00:00
Adrian Crum ea8b01bcb0 Add security note to Mini-language <script> element.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331418 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 13:10:57 +00:00
Adrian Crum 0a8e59574d Added auto-correct to the Mini-language <script> element.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331394 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 12:46:46 +00:00
Adrian Crum 37bb36e08f Overhauled Mini-language <script> element. Added a "script" attribute so it can be used for small inline scripts (scriptlets).
Removed code that hid script engine exceptions in the error list. If a script engine throws an exception, it should be passed to the calling process, not hidden in an error message list (which might not get checked).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331355 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 11:18:52 +00:00
Adrian Crum b396e98bbe Bug fix in overhauled Mini-language <set> element: support operator substitutions in scriptlets.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331353 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 11:12:43 +00:00
Adrian Crum 9a64e92cc3 Renamed new <call-simple-method> attribute from memory-model to scope.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331259 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 07:15:14 +00:00
Adrian Crum 4b24b8da30 Fixed a bug in my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331247 13f79535-47bb-0310-9956-ffa450edef68
2012-04-27 06:55:10 +00:00
Adrian Crum 28f72c38d3 Added new attribute "memory-model" to the Mini-language <call-simple-method> element. Code cleanup and validation in FieldToResult.java. Improved validation in Now.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331137 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 22:40:22 +00:00
Adrian Crum 897fa0e2bd Small fixup for my previous commit - remove class cast.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330919 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 16:11:44 +00:00
Adrian Crum 750a172e3e Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330908 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 15:36:55 +00:00
Adrian Crum aba59f096d Added a new Mini-language element - <now> - that replaces the <now-timestamp> and <now-date-to-env> elements. It is a drop-in replacement for <now-timestamp>.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330902 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 15:25:03 +00:00
Adrian Crum 06f22df23d Added a Mini-language XML style sheet.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330764 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 10:38:25 +00:00
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 281b4c0954 Mini-language schema <set> element improvements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329585 13f79535-47bb-0310-9956-ffa450edef68
2012-04-24 07:58:57 +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 da1b810c3b Small fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328829 13f79535-47bb-0310-9956-ffa450edef68
2012-04-22 09:24:36 +00:00
Adrian Crum d66f311eb7 Updated all Mini-language xml files to use the new schema.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328827 13f79535-47bb-0310-9956-ffa450edef68
2012-04-22 09:18:24 +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
Erwan de Ferrieres 195ebb9010 missing license header and xml prefix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1244208 13f79535-47bb-0310-9956-ffa450edef68
2012-02-14 20:54:19 +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
Ashish Vijaywargiya e7b7b6168e Applied patch from jira issue - OFBIZ-4355. Update simple-methods.xsd (Missing "not-in" operator in condtion-expr tag).
Thanks Amit for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1154470 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 09:32:23 +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
Jacques Le Roux 66c5dd10a0 A patch from Dukian "Add Traditional Chinese translation for applications, ecommerce, and ofbizsetup" (https://issues.apache.org/jira/browse/OFBIZ-4031) - OFBIZ-4031
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1039574 13f79535-47bb-0310-9956-ffa450edef68
2010-11-26 21:56:14 +00:00
Erwan de Ferrieres 6d59cc8f25 reverting 989475 as it is generating too much backward compatibility issues
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@989772 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 15:41:49 +00:00