Commit Graph
1364 Commits
Author SHA1 Message Date
Jacopo Cappellato 652ff50044 Two Groovy DSL descriptors for Eclipse and IntelliJ in order to get the autocompletion and similar features while editing Groovy files in OFBiz.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1643183 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 08:16:22 +00:00
Jacopo Cappellato 0e421f293e OFBIZ-5894 When ContentWorker.renderContentAsText is used to render content that have electronicText with empty textData then it renders a string with the "null" value: this commit fix the issue. Thanks to Deepak Dixit for the bug report and fix.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1643088 13f79535-47bb-0310-9956-ffa450edef68
2014-12-03 10:51:52 +00:00
Adrian Crum 871ec276fb Fixed UtilProperties.java bug caused by removal of Javolution - https://issues.apache.org/jira/browse/OFBIZ-5857.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1637064 13f79535-47bb-0310-9956-ffa450edef68
2014-11-06 10:08:40 +00:00
Jacopo Cappellato 66daa32f1a Cleaned up and inproved the code that integrates Groovy in the OFBiz framework:
* Groovy services and Groovy events now use the same util methods from GroovyUtil to parse/execute the scripts
* the script base class is now specified in the base/config/groovy.parameter file rather than in the serviceengine.xml
* the same util methods (DSL) are now available to all Groovy scripts (executed as services, events or widget actions)
* removed a series of unused methods in the GroovyUtil class



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636346 13f79535-47bb-0310-9956-ffa450edef68
2014-11-03 13:15:29 +00:00
Adrian Crum e7794e5824 Finish removing Javolution from the base component.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635910 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 09:55:57 +00:00
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
Adrian Crum d6f7e2aa5a Fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635877 13f79535-47bb-0310-9956-ffa450edef68
2014-10-31 23:08:29 +00:00
Adrian Crum 79dc510f05 Remove Javolution from most of the base component. I didn't do the converters to avoid merge conflicts with the JSON branch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635846 13f79535-47bb-0310-9956-ffa450edef68
2014-10-31 19:29:46 +00:00
Scott Gray 44e2c4fda1 Regex search/replace for delegator.findOne() to EntityQuery.queryOne()
Apologies for the large commit.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635383 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 04:18:05 +00:00
Scott Gray 96cd99914e Remove unnecessary imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1634027 13f79535-47bb-0310-9956-ffa450edef68
2014-10-24 08:28:47 +00:00
Jacopo Cappellato ac7bfdfbed Cleaned up the way the classloaders are setup at startup by removing duplicate logic and responsibilities between the start and base components.
Before this change the following classloader hierarchy was setup:
1) the "application" classloader for the "start" component
2) one "native lib" classloader for the "base" component
3) one "native lib" classloader for the all the other (non "base") framework/application/specialpurpose/hot-deploy components
4) one "web app" classloader for each of the webapplications

After this commit the hierarchy is simplified by merging #2 and #3:
a) the "application" classloader for the "start" component
b) one "native lib" classloader for the all the framework/application/specialpurpose/hot-deploy components (including the "base" component)
c) one "web app" classloader for each of the webapplications

This has been achieved by merging the code that was setting up classloader #2 in the start component (for the "base" component) with the code that was setting up the classloader #3 in the base component: now all the code is in the start component.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1633182 13f79535-47bb-0310-9956-ffa450edef68
2014-10-20 16:13:33 +00:00
Jacopo Cappellato 5e106b124d Upgraded to the latest, now official, release of Freemarker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1631299 13f79535-47bb-0310-9956-ffa450edef68
2014-10-13 06:45:42 +00:00
Scott Gray 827289c9bc Remove dead code
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1631019 13f79535-47bb-0310-9956-ffa450edef68
2014-10-11 04:52:32 +00:00
Jacques Le Roux 6e717f7bd0 A patch from Leon for "HttpClient does not support charset name with quotation mark around" https://issues.apache.org/jira/browse/OFBIZ-5787
In RFC2045 (Section 5.1) there is:
"Content-type: text/plain; charset=us-ascii (Plain text)
Content-type: text/plain; charset="us-ascii"
are completely equivalent".

In current revision, if the 'Content-Type' of http response includes the quotation mark around the charset name, HttpClient throws out unsupported encoding exception.

This patch removes quotation marks from charset name extracted from http response header.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627230 13f79535-47bb-0310-9956-ffa450edef68
2014-09-24 06:40:46 +00:00
Jacopo Cappellato adc41ad5bf Moved the thread pool executor object from GenericDAO to the DatabaseUtil class where it was actually used: this change simplifies the API and allows to shutdown the pool when it is no more needed.
Removed a series of methods that are no more needed after this refactoring or were not used.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627092 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 17:04:20 +00:00
Jacopo Cappellato d4c5b5112a Small code enhancement: use FixedThreadPool to run the "pulse" worker threads.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626993 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 12:59:13 +00:00
Jacopo Cappellato f14003d799 Removed a bunch of never used classes from the base/concurrent package.
Provided better settings for the thread pools to avoid to keep alive threads that are only needed at startup.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626977 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 10:52:29 +00:00
Ashish Vijaywargiya 44bc632d5a Applied patch from jira issue - OFBIZ-1524 - Improve the way CreditCard.cardType field is managed.
Thanks Akash Jain for the contribution. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626425 13f79535-47bb-0310-9956-ffa450edef68
2014-09-20 12:16:37 +00:00
Jacques Le Roux 7241a35012 No functional changes, better JavaDoc only
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1625001 13f79535-47bb-0310-9956-ffa450edef68
2014-09-15 11:47:19 +00:00
Jacques Le Roux 70a364f81c Adds an isFile() method in FileUtil class.
It checks if the specified fileName exists and is a file (not a directory)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624996 13f79535-47bb-0310-9956-ffa450edef68
2014-09-15 11:02:35 +00:00
Jacopo Cappellato 1a71a69ea6 Removed the ClassLoaderContainer: it is no more used.
Moved the portOffset field from ClassLoaderContainer to the Start/Config class.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624700 13f79535-47bb-0310-9956-ffa450edef68
2014-09-13 06:57:02 +00:00
Jacopo Cappellato fa8115dba5 Removed the custom CachedClassLoader and related artifacts in favour of a simpler bootstrap process and a simpler classpath tree; now the classpath tree is made of: bootstrap classloader (primordial+ext) -> system classloader (aka applications or classpath classloader) -> two custom classloaders (one loads the framework/base classes and one loads all the other classes) -> Webapp classloaders (one per web application).
Junit tests are included. The two custom classloaders could be merged into one but this will be addressed in a second phase because it will require some changes to the bootstrap componenr and process.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624549 13f79535-47bb-0310-9956-ffa450edef68
2014-09-12 13:49:17 +00:00
Jacopo Cappellato 189b8a4b34 A series of simplifications, cleanups of old code, and improvements to the code that setup the class paths for the OFBiz classloaders; the former code was setting the same jars (e.g. ofbiz.jar and all the base libs) in both the parent/child classloaders; it was unnecessarily setting the classpath system property when not required/useful.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1623352 13f79535-47bb-0310-9956-ffa450edef68
2014-09-08 10:38:28 +00:00
Jacopo Cappellato 75fe5a9107 Removed the old UtilJ2eeCompat util class that was probably created for compatibility with some old application servers.
UtilJ2eeCompat was used to figure out, by checking the servlet container implementation, if the response should be sent using a Writer or a OutputStream; a Writer was used for Tomcat, Websphere, Jetty, Orion, Jrun, Tradecity and an OutputStream was used for all the other servlet containers.

However accordingly to the Servlet api:

ServletResponse.getWriter():
         Returns a PrintWriter object that can send character text to the client.
ServletResponse.getOutputStream():
         Returns a ServletOutputStream suitable for writing binary data in the response.

Based on this getWriter() should always be used (for html pages) in all the containers, not just Tomcat, Websphere, Jetty, Orion, Jrun, Tradecity.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622976 13f79535-47bb-0310-9956-ffa450edef68
2014-09-07 06:32:25 +00:00
Jacopo Cappellato b324c22bcc Misc cleanups to remove dead code (that could never run or was not used), made a series of fields private and/or final, added some comments, formatting fixes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622409 13f79535-47bb-0310-9956-ffa450edef68
2014-09-04 06:47:31 +00:00
Jacopo Cappellato 6f112e3ea7 Greatly simplified the UtilJ2eeCompat class by removing a series of variables and methods no more in use.
The class was not thread safe and this didn't cause particular issues probably just because all the threads using it were passing ServletContext with the same server info value (because they were associated to the same servlet container); it was however inefficient.
 Now it is thread safe using the DCL pattern which I usually tend to avoid but is useful here.
 However this class should probably go away but before taking a decision I will start a discussion in the dev list.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622193 13f79535-47bb-0310-9956-ffa450edef68
2014-09-03 09:10:04 +00:00
Adrian Crum d81823384d Small code cleanup in UtilCache.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1620249 13f79535-47bb-0310-9956-ffa450edef68
2014-08-25 00:37:24 +00:00
Adrian Crum 227ba5f9db Small improvement to UtilCache - allow a component to specify its own cache settings file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1620244 13f79535-47bb-0310-9956-ffa450edef68
2014-08-25 00:02:45 +00:00
Jacopo Cappellato d8c412302f OFBIZ-5287: Upgrade to Log4j2
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1618831 13f79535-47bb-0310-9956-ffa450edef68
2014-08-19 10:36:01 +00:00
Adam Heath 58c866dfbd Add a simple Future implementation, that returns a constant,
non-changing value.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617811 13f79535-47bb-0310-9956-ffa450edef68
2014-08-13 19:38:18 +00:00
Adam Heath 61a8dabc7e Add a GLOBAL_BATCH thread pool. This is different than GLOBAL_EXECUTOR,
in that:

* BATCH does not block when all the coreThreads are busy, as would
  happen with EXECUTOR.  When all coreThreads are busy, new threads will
  be spawned.
* Scheduled jobs can *not* be submitted.

You can simulate the first problem, by modifying ExecutionPool, and
force-setting the threadCount to 1.  Then, submit something to the pool,
that will then itself submit more items into the pool.  Dead-lock will
occur.

BATCH should be used when it might be posslbe that more items could be
submitted by code you are calling.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617810 13f79535-47bb-0310-9956-ffa450edef68
2014-08-13 19:38:12 +00:00
Adam Heath 2aaa234042 Add a global fork-join thread pool, and switch a bunch of stuff over to
it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617809 13f79535-47bb-0310-9956-ffa450edef68
2014-08-13 19:38:01 +00:00
Adam Heath 111f90c057 Add a helper method for auto adjusting the threadCount.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617808 13f79535-47bb-0310-9956-ffa450edef68
2014-08-13 19:37:49 +00:00
Jacopo Cappellato 066d782950 Misc minor cleanups to log messages.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1616744 13f79535-47bb-0310-9956-ffa450edef68
2014-08-08 13:16:46 +00:00
Jacopo Cappellato 37d586c160 Converted some startup messages from "important" to "info".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1616431 13f79535-47bb-0310-9956-ffa450edef68
2014-08-07 07:52:23 +00:00
Adam Heath e04a063f21 Fix line-ending differences between windows and unix in UtilIO parsing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605837 13f79535-47bb-0310-9956-ffa450edef68
2014-06-26 16:15:09 +00:00
Adam Heath 83b70a5643 Fix reversion introduced in StringUtil in r1330955; string maps using
"|" were being parsed correctly.  This fixes OFBIZ-5667.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605268 13f79535-47bb-0310-9956-ffa450edef68
2014-06-25 05:27:22 +00:00
Jacopo Cappellato 05073f29df Upgrade to the most recent version of Freemarker-2.3-gae: this is not an official release yet but it will be soon; I have committed this work, as discussed in the dev list, in order to get help from the community to test this new improved version of Freemarker and provide feedback to the Freemarker community.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605029 13f79535-47bb-0310-9956-ffa450edef68
2014-06-24 08:33:04 +00:00
Adrian Crum 11d9b19b46 Improved some converters to strip the time-of-day from java.sql.Date values. This will help prevent JDBC drivers from changing the date when stored.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1590301 13f79535-47bb-0310-9956-ffa450edef68
2014-04-26 21:28:07 +00:00
Adrian Crum e23b118575 Fixed a bug in ObjectTypeTests.java: The CachedClassLoader maps the "Date" class name to java.sql.Date, not java.util.Date.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1590299 13f79535-47bb-0310-9956-ffa450edef68
2014-04-26 21:25:25 +00:00
Adrian Crum f2799d6e72 Bug fix in ObjectTypeTests - a java.sql.Date instance created in one time zone is not equal to another instance created in another time zone.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1585959 13f79535-47bb-0310-9956-ffa450edef68
2014-04-09 13:01:18 +00:00
Adrian Crum 0499098732 Modified the String to java.sql.Date conversion. Replace deprecated constructor call with a Calendar implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1585958 13f79535-47bb-0310-9956-ffa450edef68
2014-04-09 12:55:00 +00:00
Adrian Crum 70a4757b4b Fixed a bug in rev 1585033. Reported by Gareth Carter on the dev mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1585574 13f79535-47bb-0310-9956-ffa450edef68
2014-04-07 19:45:02 +00:00
Adrian Crum 9291e24ea4 Fixed a bug in String to java.sql.Date conversion. If the Date object includes time information, then the JDBC driver will adjust the date according to the default time zone - causing the wrong date to be stored in some circumstances.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1585033 13f79535-47bb-0310-9956-ffa450edef68
2014-04-05 09:46:58 +00:00
Adrian Crum 191fd073b0 Fix for quirky user-selected time zone behavior. Changing the time zone in one session did not update other sessions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1583663 13f79535-47bb-0310-9956-ffa450edef68
2014-04-01 13:32:12 +00:00
Jacques Le Roux 849bbb3c29 A patch from Antoine Vittecoq for "Form widget/ FTL pagination, Last does not take to last page" https://issues.apache.org/jira/browse/OFBIZ-5575
This issue in pagination can be tested in https://localhost:8443/partymgr/control/findparty (FTL) & https://localhost:8443/webtools/control/FindUtilCache?VIEW_SIZE_1=2&VIEW_INDEX_1=0 (XML Form).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1579277 13f79535-47bb-0310-9956-ffa450edef68
2014-03-19 16:15:22 +00:00
Jacopo Cappellato 7d8d938a3b Performance optimization for UtilHttp.getFullRequestUrl method: instead of returning a StringBuffer object (synchronized) it now returns a String (immutable); internally it uses a StringBuilder (lighter because not synchronized) within a private context.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1570810 13f79535-47bb-0310-9956-ffa450edef68
2014-02-22 08:32:28 +00:00
Jacopo Cappellato 9f8bb29787 Some minor simplifications to ComponentContainer: removed some unnecessary overloaded methods.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1561757 13f79535-47bb-0310-9956-ffa450edef68
2014-01-27 17:19:52 +00:00
Jacques Le Roux 0757ed8a24 A patch from Gareth Carter for "last index for paging is not calculated correctly" https://issues.apache.org/jira/browse/OFBIZ-5497
The last index (used on the last button) is not calculated correctly in ftl or the renderer classes. It currently users floor which works only for list sizes that are not multiples of the view size. When you have a list size which is a multiple of the view size, it does not subtract 1 for zero based index and therefore the last button goes to the last page + 1

Examples

listSize = 1
viewSize = 10
listSize / viewSize = 0.1
floor(0.1) = 0
This one produces the correct value

listSize = 20
viewSize = 10
listSize / viewSize = 2
floor(2) = 2
Last index should be 1 because of zero based index but never occurs

To reproduce, enter a view with a list and paging functionality, the list size must be a multiple of the view size


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1560176 13f79535-47bb-0310-9956-ffa450edef68
2014-01-21 20:53:29 +00:00
Adrian Crum fe9cd1f776 Added the ability to exclude certain classes from XML serialization/deserialization.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1557427 13f79535-47bb-0310-9956-ffa450edef68
2014-01-11 17:39:38 +00:00