Commit Graph
1372 Commits
Author SHA1 Message Date
Adrian Crum 5f231ec005 Fixed a NPE I introduced in rev 1647606. Reported by Pierre Smits on dev mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648139 13f79535-47bb-0310-9956-ffa450edef68
2014-12-28 00:58:44 +00:00
Adrian Crum 9be5ed5e06 UtilMisc.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Small code cleanup.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647873 13f79535-47bb-0310-9956-ffa450edef68
2014-12-25 05:41:13 +00:00
Adrian Crum fc86aee024 UtilProperties.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Remove class name from static method calls.
3. Remove some @Deprecated annotations.

When they were written, the deprecated methods simulated forthcoming Java 6 functionality - with the intent that they would be replaced with Java 6 equivalents, but the Java 6 functionality behaves differently than the deprecated methods. So, replacing the deprecated methods with Java 6 equivalents would cause undesired behavior.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647866 13f79535-47bb-0310-9956-ffa450edef68
2014-12-25 00:45:18 +00:00
Adrian Crum 06b7bcbb8b UtilDateTime.java improvements:
1. Replace DCL code with lazy-initializer class.
2. Remove class name from static method calls.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647861 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 23:37:06 +00:00
Adrian Crum 6731e764ef Bug fix: Make DateRange.java truly immutable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647839 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 20:21:46 +00:00
Adrian Crum 209a0261fb Remove references to immutability from ComparableRange.java - because its contained objects might be mutable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647838 13f79535-47bb-0310-9956-ffa450edef68
2014-12-24 20:19:42 +00:00
Adrian Crum 7aa7ea5769 Fixed a bug in UtilDateTime.java where SimpleDateFormat instances were not initialized with the locale.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647606 13f79535-47bb-0310-9956-ffa450edef68
2014-12-23 16:21:14 +00:00
Jacopo Cappellato 4384b31ed9 Removed two unnecessary overloaded methods.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647289 13f79535-47bb-0310-9956-ffa450edef68
2014-12-22 11:08:07 +00:00
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