Jacopo Cappellato
3552f65800
Merged json-integration-refactoring into trunk:
...
* moved the json-lib jar (json-lib-2.2.3-jdk15.jar) from the framework/webapp to the framework/base component
* removed the SQL select Parser.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code
* removed the JSON.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code apart from the JSON Converters (now migrated to json-lib, see next items in this list) some utility methods in UtilIO.java (that have been removed too because they have never been used in OFBiz)
* removed the JavaCC jar and related ant scripts because no more needed after the removal of Parser.jj and JSON.jj
* converted the JSONConverter code that was based on JSON.jj to Jackson
* added a new class org.ofbiz.base.lang.JSON that have been contributed by Adrian Crum that is a facade for simplifying the client code and for hiding the specific JSON library being used
* removed an unused method: ImageManagementServices.toJsonObject(...)
* added TestBooleanConverters to the list of tests
* new unit tests for the new JSON converters
* refactored Ajax code in applications to use the common request json response rather than a custom method
* OFBIZ-5790 Implemented ability to call a service event by passing its input parameters in the request body as JSON data. These classes provide a simple mechanism, based on the request's content type, that can be extended to support other formats (e.g. XML).
This commit resolves OFBIZ-4572, OFBIZ-3365, OFBIZ-5751, OFBIZ-5790
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635901 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 09:06:42 +00:00
Adam Heath
ccb36f2238
Fix cobertura-report when source has been generated(aka, when javacc or
...
jjtree has been used).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605838 13f79535-47bb-0310-9956-ffa450edef68
2014-06-26 16:15:15 +00:00
Adrian Crum
714050ef33
Updated build files to use/require Java 7.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605524 13f79535-47bb-0310-9956-ffa450edef68
2014-06-25 17:59:46 +00:00
Adam Heath
455edd3727
Remove sourcepathref from default-javac; in build.xml that did *not*
...
create a src-dir patternset, the default *empty* src-dir pattern set was
used. Then, when javac would compile src/**/*.jar, it would *also*
compile any *other* java files it happened to find in the folder.
In other words, if there was an unpacked tree, let's say named 'p', and
there was a set of folders in there that eventually had java files, they
would all get compiled.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605223 13f79535-47bb-0310-9956-ffa450edef68
2014-06-24 23:21:05 +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
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
Jacques Le Roux
c66be987ed
This version compiles under all Java version (so far :/ )
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1082475 13f79535-47bb-0310-9956-ffa450edef68
2011-03-17 12:52:27 +00:00
Jacques Le Roux
9c22457c44
Revert partially r1076852 (only http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Planner.java?view=diff&r1=1076852&r2=1076853&pathrev=1076853 )
...
This is preventing some java version to compile (So far at least 1.6.0_14 and 1.6.0_17 fail. It's ok with 1.6.0_23 and 1.6.0_24)
Marco mades this change recently in his warnings effort. But I don't see anything in Eclipse nor while building. So I'm reverting this trivial change
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1081912 13f79535-47bb-0310-9956-ffa450edef68
2011-03-15 19:19:22 +00:00
Marco Risaliti
a808eb8bcc
Remove some warning in ValuesTest (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076860 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:44:27 +00:00
Marco Risaliti
2a0e24a809
Remove some warning in SQLTest (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076857 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:42:59 +00:00
Marco Risaliti
5000fb8e1c
Remove some unused variable in ConditionsTest (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076855 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:41:31 +00:00
Marco Risaliti
b7eb96d443
Remove some warning in Main/Planner/Value (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076853 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:37:01 +00:00
Marco Risaliti
0154f18aa0
Remove some warning in NumberValue (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076852 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:32:41 +00:00
Marco Risaliti
3927aa0273
Remove some warning of javacc classes after upgrade javacc to version 5.0 (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076779 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 20:29:34 +00:00
Marco Risaliti
2eda5a9dca
Remove unused variable/import in SelectTest (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076437 13f79535-47bb-0310-9956-ffa450edef68
2011-03-02 22:22:33 +00:00
Marco Risaliti
7f178509c0
Remove a unused import in SQLSelect (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069111 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 21:13:20 +00:00
Marco Risaliti
1bae5e4464
Remove a unused import in SQLIndex (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069109 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 21:12:36 +00:00
Marco Risaliti
8c5cd799ea
Add a @SuppressWarning("serial") in ParameterizedConditionException (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069108 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 21:11:33 +00:00
Marco Risaliti
0f95781ee0
Remove a unused import in AggregateFunction (OFBIZ-4102)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1069106 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 21:10:03 +00:00
Scott Gray
75b0b1c1e3
Remove unnecessary semicolons
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044917 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 20:43:03 +00:00
Scott Gray
bdd23c22d5
Add missing override annotations
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044913 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 20:41:27 +00:00
Adam Heath
d06f72f7f9
FEATURE: Start of union support; parsing isn't tested yet.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981640 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:44:20 +00:00
Adam Heath
872db5befd
FEATURE: Start of aggregate function support.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981639 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:44:12 +00:00
Adam Heath
550d275781
FEATURE: Add count-all variant that doesn't require a table name.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981638 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:44:05 +00:00
Adam Heath
ca01d94d2a
FEATURE: Add support for CREATE INDEX.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981637 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:44:00 +00:00
Adam Heath
56c7c3391a
FEATURE: ORDER BY now supports any ConstantValue, which includes any
...
function, and also math operations.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981636 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:53 +00:00
Adam Heath
f7ad0f1ea6
Allow external callers to parse individual OrderByItem instances.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981634 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:42 +00:00
Adam Heath
055e49cb5a
FEATURE: Add support for NULLS FIRST/LAST in ORDER BY.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981633 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:36 +00:00
Adam Heath
8ebec8e647
OPTIMIZE: Remove descending and orderingSet booleans, they weren't being used
...
properly.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981632 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:30 +00:00
Adam Heath
5147b48afa
TESTS: Ensure that no more statements has been parsed.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981631 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:25 +00:00
Adam Heath
eebce0b77f
BUG FIX: Fix parsing of -/+ style order by prefixes.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981630 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:19 +00:00
Adam Heath
6772e47dd6
FEATURE: Add basic implementations of the available visitors.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:13 +00:00
Adam Heath
2923612353
OPTIMIZE: Remove unused variable i from Select().
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981628 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:08 +00:00
Adam Heath
f150eecfb9
BUG FIX: CountAll needs to remember the tableName; also implement
...
equals.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981627 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:02 +00:00
Adam Heath
46b66d2bd2
BUG FIX: Fix correct formatting around the operator.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981626 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:55 +00:00
Adam Heath
33809facfe
TESTS: Start adding low-level object unit tests.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981625 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:49 +00:00
Adam Heath
c9f9555c25
No longer use ON in relation settings; instead, use MAP, which makes the
...
sql a little bit simpler.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981624 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:39 +00:00
Adam Heath
1581156412
TESTS: Test reparsing of all statements.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981623 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:33 +00:00
Adam Heath
a9aa86c234
BUG FIX: OFFSET/LIMIT have to be after ORDER BY/GROUP BY.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981622 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:28 +00:00
Adam Heath
1fc630261e
BUG FIX: Fix toString with multiple RELATION, they should not be
...
separated by commas.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981621 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:23 +00:00
Adam Heath
3ade64a656
OPTIMIZE: KeyMap no longer extends Atom, so no longer has any appendTo variants.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981620 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:17 +00:00
Adam Heath
0864fca12f
BUG FIX: Fix multiple keymaps in a relation, wasn't separated by AND.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981619 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:11 +00:00
Adam Heath
bc6a4b7870
Introduce a new method, getDefaultName(), so that null alias logic
...
doesn't happen in the constructor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981618 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:06 +00:00
Adam Heath
f8e091775c
FEATURE: Make public wrappers around several internal methods.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981617 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:42:00 +00:00
Adam Heath
3929451368
FEATURE: Create a new StaticValue function, based on the contents of
...
FieldDef.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981616 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:55 +00:00
Adam Heath
81a56ac59c
REFACTOR: Move FieldAll call to a new function, SelectField.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981615 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:50 +00:00
Adam Heath
e544bd6be0
REFACTOR: Optimize select AS support, so it is only required in one place.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981614 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:44 +00:00
Adam Heath
806332cc89
REFACTOR: Optimize FieldDef, so that the FieldDef object instantiation only
...
happens in one place.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981613 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:39 +00:00
Adam Heath
b98105c65f
REFACTOR: Abstract out FieldAll so it can be called externally.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981612 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:34 +00:00
Adam Heath
54c6cb0f16
FEATURE: Add static valueOf methods.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981611 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:41:28 +00:00