Commit Graph
101 Commits
Author SHA1 Message Date
Scott Gray aa6d7bcd67 Catch ClassCastExceptions in <store-value/> operations, these will occur if you have a null GenericValue (perhaps from a lookup that returned no results), set some fields on it and then try to store it. What you actually have at that point is a FastMap created when you set the fields.
Also added use of the utility MethodContext.setErrorReturn(String, SimpleMethod) rather than manually adding errors to the environment context.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@826322 13f79535-47bb-0310-9956-ffa450edef68
2009-10-18 00:34:29 +00:00
Adrian Crum 9ee18d37c5 Updated client code to use the new Delegator factory method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@823633 13f79535-47bb-0310-9956-ffa450edef68
2009-10-09 17:44:24 +00:00
Adrian Crum 7fa08f9079 Replaced GenericDelegator.getGenericDelegator(...) calls with new factory method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821649 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 01:53:50 +00:00
Adrian Crum a4d68934c9 Converted GenericDelegator concrete class references to Delegator interface references.
This commit requires ant clean. Also, external libraries that reference GenericDelegator will need to be updated.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821643 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 00:08:27 +00:00
Adam Heath 5af665e7a4 Based on OFBIZ-891, allow Iterate to handle java.util.Iterator.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@815936 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 19:33:44 +00:00
Adam Heath a88ea227a9 Protect closing of the EntityListIterator inside a finally block.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@814251 13f79535-47bb-0310-9956-ffa450edef68
2009-09-12 23:23:49 +00:00
Adrian Crum 74ea95889c Reverted rev 802567.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@812692 13f79535-47bb-0310-9956-ffa450edef68
2009-09-08 20:56:14 +00:00
Adam Heath 0d2943ef0e Fix a generics warning.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@812319 13f79535-47bb-0310-9956-ffa450edef68
2009-09-08 02:00:55 +00:00
Jacques Le Roux 7befd1d25e no tabs but 4 spaces in code files (*.ftl, *.gro*, *.java, *.xml)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@804935 13f79535-47bb-0310-9956-ffa450edef68
2009-08-17 11:01:25 +00:00
Jacques Le Roux 30e61ba8f8 Same error than in r763199 (and I knew that, sorry)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@804896 13f79535-47bb-0310-9956-ffa450edef68
2009-08-17 08:23:25 +00:00
Jacques Le Roux 4c442ee379 Some fusiness
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@804895 13f79535-47bb-0310-9956-ffa450edef68
2009-08-17 08:20:38 +00:00
Adrian Crum 6786aa4dbc Refactored GenericDelegator:
1. Converted GenericDelegator to an interface. We already have DelegatorInterface, but it isn't being used anywhere. Removed DelegatorInterface.java.

2. Extracted the static, cached data from the GenericDelegator implementation and put it in its own class - DelegatorData. The GenericDelegator implementation holds a reference to the DelegatorData instance. This makes it possible to have per-thread instances of GenericDelegator.

3. Replaced the ThreadLocal variables with regular variables. ThreadLocal variables are no longer needed. Client code doesn't need to be concerned with pushing and popping the GenericDelegator state.

This commit paves the way for the forthcoming ExecutionContext.

User modifications will have to replace GenericDelegator.getGenericDelegator(...) with DelegatorFactory.getGenericDelegator(...). Also, replace the push code with the new setXxx methods, and remove the pop code. If modifications used DelegatorInterface, replace that with GenericDelegator.

Aside from those changes, this commit is backwards compatible.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@802567 13f79535-47bb-0310-9956-ffa450edef68
2009-08-09 18:04:26 +00:00
Adrian Crum e4ee374a66 Conversion from java.util.Calendar to com.ibm.icu.util.Calendar. I didn't convert the Cloud component - I wasn't sure if the Calendar class was being passed through SOAP.
OFBiz users who have modifications or add-ons can make the same substitution to get them to compile.

I'll let the dust settle from this, then I'll add the user-selected calendar capability.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792987 13f79535-47bb-0310-9956-ffa450edef68
2009-07-10 15:39:21 +00:00
David E. Jones 497a7cbf0d Change to handling of error messages in simple-methods called as a service to pass errors through in List/Map and not combine into one big String, add text you can't change, etc; now logs details and passes errors as-is
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792633 13f79535-47bb-0310-9956-ffa450edef68
2009-07-09 18:51:00 +00:00
David E. Jones 49e725e73e Fixed issue discovered and fixed and reported by Ian Tabangay, thanks Ian
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792422 13f79535-47bb-0310-9956-ffa450edef68
2009-07-09 06:50:23 +00:00
Scott Gray dec24b29f2 Sorry for the big commit, got a bit carried away.
Added override and deprecated annotations wherever they were missing
Removed the use of any deprecated classes/methods (except OutputFormat in UtilXml)
A few other random generics and misc. cleanups

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@791212 13f79535-47bb-0310-9956-ffa450edef68
2009-07-05 10:01:19 +00:00
David E. Jones 7e981d3cb3 Added ability to specify an entity-condition as part of a view-entity in order to encapsulate a full query definition in a view-entity
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@790472 13f79535-47bb-0310-9956-ffa450edef68
2009-07-02 06:43:50 +00:00
Adam Heath 0cd05995df Set the line number on the wrapped operation instance.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@790027 13f79535-47bb-0310-9956-ffa450edef68
2009-07-01 02:54:01 +00:00
Adam Heath bc348d0970 Don't need to wrap the containing SimpleMethod, as its operations are
will be wrapped.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@790026 13f79535-47bb-0310-9956-ffa450edef68
2009-07-01 02:41:52 +00:00
Adam Heath dd51c0108b Add a simple initCause helper method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@789400 13f79535-47bb-0310-9956-ffa450edef68
2009-06-29 18:13:19 +00:00
Adam Heath 8dea83e3af Use the new UtilXml.elementAttribute helper, to remove a bunch of
code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@788183 13f79535-47bb-0310-9956-ffa450edef68
2009-06-24 20:59:57 +00:00
Adam Heath 783130b58d Add ability for simple methods to be wrapped with a custom compiled
class.  The resource location from where the simple method was read
is encoded as the classname of the proxy.  This makes debugging
simpler to do.  This feature is turned off by default.

The wrapping code has support for setting the line number, to include
in stack traces.  However, DOM-based xml parsing doesn't record line
numbers, so it's not possible to encode that into the wrapped proxy
class.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@783060 13f79535-47bb-0310-9956-ffa450edef68
2009-06-09 16:19:50 +00:00
Adrian Crum 1fdb04b06e Fixed bug in mini-lang <log> operation - https://issues.apache.org/jira/browse/OFBIZ-2511.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@777947 13f79535-47bb-0310-9956-ffa450edef68
2009-05-23 16:12:26 +00:00
Adrian Crum 28bc332e04 Small change to Scott's UEL improvement - convert NodeList to a java.util.List so that it can be treated like a regular List.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@770990 13f79535-47bb-0310-9956-ffa450edef68
2009-05-02 22:37:08 +00:00
Scott Gray 2b55fa55da OFBIZ-2397
Implement a custom JUEL ELResolver that handles string properties for objects implementing org.w3c.dom.Node 
and org.apache.xerces.dom.NodeImpl. It takes the String and compiles it into an XPathExpression which is 
then evaluated against the base Node. The JUEL evaluation returns either null, a single Node or a NodeList 
depending on the result of the XPath evaluation.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@770915 13f79535-47bb-0310-9956-ffa450edef68
2009-05-02 08:45:22 +00:00
Andrew Zeneski f36c5a9335 No longer requiring the boolean field 'expanded' as part of the API; after dicussing w/ Adrian; the FSE can handle pre-expanded strings
Added new API method findMatchingPermission() which takes a regular expression for the base permission returning the value of all matching permissions (see unit tests)
Fixed missing base permission in SecurityData.xml

JIRA OFBIZ-2381


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@770401 13f79535-47bb-0310-9956-ffa450edef68
2009-04-30 19:14:48 +00:00
Andrew Zeneski b3661fdd45 Integration with new Authz API - JIRA OFBIZ-2381
Note: implemented the same as widgets use of action="" uses old api, without action="" uses new api


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@769965 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 22:10:42 +00:00
Adrian Crum 6e85ea167b Added "NewList" and "NewMap" options to the <set> element type attribute. Now screen widgets and mini-language support the creation of empty Lists and Maps.
Usage:

<set field="theList" type="NewList"/>
<set field="theMap" type="NewMap"/>



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@765284 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 17:44:47 +00:00
Jacques Le Roux b271a279a0 Fix bug introduced with
if( => if (
while( => while (


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763199 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 12:01:06 +00:00
Jacques Le Roux b9c3ddef08 2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty)
Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg)

Of course this effort to remove trailing spaces has no functional implications.

Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135
In the meantime I did some refactoring also in *.java and *.groovy files :
){ => ) {
if( => if (
while( => while (
}else => } else
else{ => else {
switch( => switch (
try{ => try {
}catch => } catch
catch( => catch (
}finally{ => } finally {

So these changes are also in this commit, should not be a problem anyway.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 10:54:51 +00:00
Adam Heath 57f96dac3b Fix lines that *only* have whitespace.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@759238 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 16:57:48 +00:00
Adam Heath f8f895bc32 Fix purely empty whitespace lines, and remove trailing whitespace.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@757074 13f79535-47bb-0310-9956-ffa450edef68
2009-03-21 23:24:13 +00:00
David E. Jones c55d1d2fc2 Changed to support loading with component://, based on patch from Ashish in OFBIZ-2244
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@755618 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 15:36:54 +00:00
Jacques Le Roux 13a934f823 In spirit of Adam's r749341 and following http://java.sun.com/docs/codeconv/html/CodeConventions.doc7.html#489
The idea is also that a lot of code is duplicated and then changed (copy/paste). Hence having a rightly formatted code help to keep it rightly formatted
1st (simple) step : ){ => ) { (I checked all occurrences but of course other pairs of eyeballs are welcome)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@750993 13f79535-47bb-0310-9956-ffa450edef68
2009-03-06 17:31:13 +00:00
Jacques Le Roux 6892c51d50 This file has not been updated during the Simple Method Cleanup Effort. See https://issues.apache.org/jira/browse/OFBIZ-2213
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@748971 13f79535-47bb-0310-9956-ffa450edef68
2009-03-01 07:58:04 +00:00
Jacques Le Roux 572b7683e0 All tabs to 4 spaces in *.groovy, *.java, *.xml : less problems in future with that aspect...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@737003 13f79535-47bb-0310-9956-ffa450edef68
2009-01-23 11:08:47 +00:00
David E. Jones cb3a676f2b Fixed issue with filter-list-by-and operation which wasnt looking for the map attribute, renamed from map-name
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@731880 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 08:52:26 +00:00
David E. Jones 874f02e9da Manual merge of typecheckcleanup200810 branch as of rev 731346 in that branch, resolved all conflicts; with this BigDecimal is not the native type for many entity fields and is used for many calculations; some work is still needed in certain areas of the project but this covers the most critical ones; thanks especially to Scott for his work on this
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@731851 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 07:13:36 +00:00
Jacques Le Roux 94225b1a34 Fix issues with now-timestamp-to-env and sequence-id-to-env : their factories names where missing in org.ofbiz.minilang.method.MethodOperation$Factory file
also
<sequenced-id-to-env(.*)env-name => <sequenced-id$1field
<now-timestamp-to-env(.*)env-name => <now-timestamp$1field
both on *SimpleMethods*.xml, *events*.xml, *formula*.xml, *services*.xml, *tests*.xml (previously I only used *events*.xml, *services*.xml, but I guess it's not a big deal for now)




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@730433 13f79535-47bb-0310-9956-ffa450edef68
2008-12-31 17:47:37 +00:00
Adrian Crum 3d8de29f8a Final work on Unified Expression Language integration. L-values can contain nested expressions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@729759 13f79535-47bb-0310-9956-ffa450edef68
2008-12-28 18:15:20 +00:00
David E. Jones 0d32641db0 Fixed issue where the attribute value was used for two things, so where it means an entity generic value it is now value-field and an actual String or other type of value is just plain value
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@729707 13f79535-47bb-0310-9956-ffa450edef68
2008-12-28 08:40:44 +00:00
David E. Jones 65b455ac9b The last batch of the major changes to make naming in simple-method attributes more consistent and simplify due to simpler tools; again see the Simple Method Cleanup Effort docs page for details on changes; some additional cleanups may be done based on feedback but this should be most of it
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@729704 13f79535-47bb-0310-9956-ffa450edef68
2008-12-28 08:17:47 +00:00
David E. Jones fe8ed88393 More simple-method cleanups
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@728620 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22 06:26:35 +00:00
David E. Jones 71f1d26a4b More cleanup of simple method attributes to make them more consistent, still quite a bit left to go, working through the file and down to order-map-list, more to come soon to get this finished up so we can move on, note that these changes are and will be documented in the Simple Method Cleanup Effort page in the OFBTECH space on docs.ofbiz.org
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@728520 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:51:23 +00:00
Adrian Crum 7f50663b15 Implemented FlexibleMapAccessor.getInstance() in mini language.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@726254 13f79535-47bb-0310-9956-ffa450edef68
2008-12-13 18:46:35 +00:00
Jacques Le Roux 438aaaf492 A patch from Chris Howe "Add createOrStore option to create-value in minilang" (https://issues.apache.org/jira/browse/OFBIZ-893) - OFBIZ-893
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@712480 13f79535-47bb-0310-9956-ffa450edef68
2008-11-09 10:49:03 +00:00
Adrian Crum 2f85064cb5 Log simple method improvement - show source of log message.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@709886 13f79535-47bb-0310-9956-ffa450edef68
2008-11-02 14:51:45 +00:00
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