Commit Graph
1398 Commits
Author SHA1 Message Date
Adrian Crum ef710ed02f Some work on ComponentLoaderConfig.java:
1. Thread safety
2. Optimization
3. Code cleanup
4. Improved error handling

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676970 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:12:17 +00:00
Adrian Crum c2de699ca6 Fixed some bugs in startup code (https://issues.apache.org/jira/browse/OFBIZ-6268):
1. Class path loading was ignoring component settings, so class paths for disabled components were being loaded.
2. Configuration files were parsed twice.
3. Potential problem with unloading a loader that failed loading.

I was unable to test Cobertura because the necessary class (org.ofbiz.base.config.CoberturaInstrumenter) isn't being compiled for some reason.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676746 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 13:52:27 +00:00
Adrian Crum cd4f6cdbb3 Fixed a bug in UtilMisc.java where the List returned by the availableLocales() method included an empty Locale - causing errors in FreeMarker templates.
https://issues.apache.org/jira/browse/OFBIZ-6309

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676674 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 06:10:01 +00:00
Nicolas Malin 5f6c13b369 correct String conversion to Set on StringUtil that not respect the field order, thanks to Francis Douet to raise it on the issue (OFBIZ-6299 Field order is not correct in the auto-complete for look-ups.)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1675998 13f79535-47bb-0310-9956-ffa450edef68
2015-04-25 07:00:42 +00:00
Adrian Crum a2fc70daff A small change to the behavior of the UtilProperties.createProperties() method: if the file is not found, return null instead of throwing an exception.
https://issues.apache.org/jira/browse/OFBIZ-6261

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674453 13f79535-47bb-0310-9956-ffa450edef68
2015-04-18 08:30:03 +00:00
Adrian Crum a1bb4ff6bc Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674064 13f79535-47bb-0310-9956-ffa450edef68
2015-04-16 13:05:55 +00:00
Adrian Crum f315f0d5be Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1669537 13f79535-47bb-0310-9956-ffa450edef68
2015-03-27 10:04:14 +00:00
Deepak Dixit bdba71d230 OFBIZ-6183: Update ComponentConfig code to allow empty mount point, as if need to mount website on root then mount-point should be "" instead of "/".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668236 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 11:14:55 +00:00
Jacopo Cappellato f69e599355 Upgrade to latest bug fix release of Freemarker: 2.3.22
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1666949 13f79535-47bb-0310-9956-ffa450edef68
2015-03-16 10:31:13 +00:00
Jacopo Cappellato 34beacd425 Relaxing default behavior of canonicalization in order to allow mixed and multiple encodings: with this change, in these cases, instead of throwing an error it will simply log a worning message.
This should fix, at least as a temporary solution, the recent issues happening after the upgrade to the new ESAPI.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1659224 13f79535-47bb-0310-9956-ffa450edef68
2015-02-12 11:17:46 +00:00
Adrian Crum 14e3b15252 Some small fixups for some of my previous commits.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1650347 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 17:53:59 +00:00
Adrian Crum 7c9aa8e489 Some optimizations for URL lookups.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649979 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 00:24:28 +00:00
Adrian Crum b85eb53598 Removed an unused method from UtilURL.java, added some JavaDocs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649971 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 23:22:56 +00:00
Adrian Crum 1df97ce20c Fixed a bug in FlexibleLocation.java where the optional locationresolvers.properties file was not being loaded due to static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649934 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:21:28 +00:00
Adrian Crum c201d5f6f3 Small change to Debug.java - to avoid static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649933 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:19:56 +00:00
Adrian Crum 38c358671f A new method for UtilProperties.java - to be used in upcoming changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649931 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:18:43 +00:00
Adrian Crum b20c4adfbc Make sure InputStream is closed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649701 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 01:05:29 +00:00
Adrian Crum a02828a34e Improvement: Remove unnecessary resource check from UtilURL.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649696 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 23:58:06 +00:00
Adrian Crum ffc11dc5a3 Some code cleanup in UtilProperties.java:
1. Removed redundant cache.
2. Removed unnecessary synchronized block.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649686 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 22:54:42 +00:00
Adrian Crum 184fe56ac1 Improvement: Enable XML validation for properties files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649675 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 21:46:54 +00:00
Adrian Crum e64fbd6c9f Improvement: Replace library-specific concrete class with library-agnostic factory method call in UtilXml.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649674 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 21:43:46 +00:00
Adrian Crum 66adcd9de2 Fix Web Tools FindGeneric screen so it can display byte-array field types.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649615 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 19:15:24 +00:00
Ashish Vijaywargiya cbbdc011d3 Applied patch from jira issue - OFBIZ-3464 - Added check if the creditcard number string is numeric in validation method isCreditcard in UtilValidate.
Thanks Nils for creating the issue and providing the patch for the same. Thanks Divesh for your help in verification. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649393 13f79535-47bb-0310-9956-ffa450edef68
2015-01-04 19:53:29 +00:00
Jacopo Cappellato 9ce782f90b Removed a bunch of dependencies of Owasp Esapi classes after I realized (by studying the Esapi source files and the integration in OFBiz) that we were using a small part of that product; this made it possible to upgrade to the latest release of Owasp Esapi (2.1.0) without having to include a bunch of jars.
I had to comment out two lines in the unit tests because they were failing after the upgrade; still investigating on this.
This commit resolves OFBIZ-5343.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648747 13f79535-47bb-0310-9956-ffa450edef68
2014-12-31 17:31:16 +00:00
Jacopo Cappellato a5879b6f8f Moved code dependent on OWASP ESAPI and utilities for codec tasks from StringUtil to a new UtilCodec class: now the UtilCodec class is the only class dependent on OWASP ESAPI.
The DefaultEncoder from OWASP ESAPI, used internally by UtilCodec is now built with the default constructor that also adds the JavascriptCodec to the list of codecs used to canonicalize and validate the input.
Renamed the UrlEncoder class to UrlCodec in order to better describe its behavior.
Misc minor cleanups.
Added to the list of tests of the base component a series of Junit test classes that were missing.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648403 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 18:24:57 +00:00
Jacopo Cappellato b969e376ed A series of cleanup to the integration with OWASP ESAPI. Isolated dependencies on the external OWASP ESAPI jar into the StringUtil class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648298 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 09:24:46 +00:00
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