Commit Graph
2421 Commits
Author SHA1 Message Date
Jacopo Cappellato 4c5561546f Based on review from Adam Heath, refactored/simplified the implementation of thread safe code using the parsedScripts object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337046 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 07:50:43 +00:00
Ashish Vijaywargiya b256c3d7cc Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337024 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 04:46:26 +00:00
Ashish Vijaywargiya e0971b304c Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-09 05:28:17 +00:00
Adam Heath 31b721aaa6 FIX: Bare passwords(circa 595296) comparisons were broken; they actually
used the oldFunnyHex encoding, not the fixed correct hex encoding.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335267 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 21:27:25 +00:00
Adrian Crum 1a9c764f4e Minor code cleanup in ObjectType.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334840 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 00:13:35 +00:00
Adrian Crum ae64f8dfc8 FlexibleStringExpander performance improvement - eliminate costly call to UtilValidate.isEmpty(Object).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334575 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 08:59:24 +00:00
Adrian Crum a14a4384ab Refactored FlexibleLocation.java - removed unnecessary synchronized lazy-load code (LocationResolvers don't cost anything to build), and made the class thread-safe. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334426 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 15:02:36 +00:00
Adrian Crum 2044f8779a Small fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334382 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 10:17:44 +00:00
Adrian Crum 38430074c5 Added UTF-8 encoding to UtilPropertiesTests, simplified the code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334370 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 09:53:16 +00:00
Adam Heath f1be0a1e0c FEATURE: Add key-encrypting-key support; this is to bring ofbiz *much*
closer to PCI compliance.  This key handler is *still* not active.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334257 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:37:06 +00:00
Adam Heath a0108243f5 FIX/DEPRECATION: Fix all the HashCrypt deprecated uses. All proper methods in HashCrypt
now follow the same form: (String hashType, ..., String valueToHash).
Some methods also follow a polish notation suffix.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334172 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:45 +00:00
Adam Heath 33101dbaa2 FEATURE/DEPRECATION: Deprecate HashCrypt.cryptPassword; previously,
it would call String.getBytes(), without specifying an encoding.  That
meant that the platform default encoding would be used, which might
change between different installs(if someone changed an environment
variable, for instance).  Now, there are explicit variants to be called.

When creating a new value, use cryptValueUTF8.  If, for some reason,
calling code is doing it's own comparison, it must continue to use
cryptValueBytes(password.getBytes()).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334170 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:26 +00:00
Adam Heath ad75e931eb FEATURE: Add HashCrypt.digestHash64.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334166 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:40:17 +00:00
Adam Heath 08349e57aa OPTIMIZE: Move the oldFunnyHex logic into a single internal helper function.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333665 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:30 +00:00
Adam Heath b767ef1868 OPTIMIZE: Remove cryptPassword(String, String); it is not nescessary to
go thru a deprecation cycle for this, as this method was only recently
added, and has never been officially released.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333664 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:24 +00:00
Adam Heath f9aca541c4 OPTIMIZE: s/getCrypted/getCryptedValue/; this is an internal function
only.  Functions that deal with byte[] should be named as fooBytes.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333663 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:11 +00:00
Adam Heath 3f4d7dfbd8 OPTIMIZE: Move the 3 if/elseif/else bodies into separate functions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:05 +00:00
Adam Heath c8de3a22aa OPTIMIZE: Add a getMessageDigest static helper function.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333661 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:19:58 +00:00
Adam Heath d22dd8d05f OPTIMIZE/FEATURE: Factor getObject into another helper,
getObjectException; the latter doesn't catch any exceptions, and doesn't
log them.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333655 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:13:11 +00:00
Adam Heath 565db82f80 OPTIMIZE: Switch internal getCrypted to take a byte array, and use
String.getBytes(Charset) to fetch the bytes.  Also switches the one case
of getBytes("UTF-8") to the Charset version.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333654 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:13:04 +00:00
Adam Heath 030144565f FEATURE: Add a -digest variant, that uses the deprecated password
digesting code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333622 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:27 +00:00
Adam Heath 9459906808 FEATURE: Improve warning when an oldFunnyHex hash is detected on a
password.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333621 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:21 +00:00
Adam Heath 589ae262f7 FIX: Oops, my bad. Originally, this was never meant to actually be committed
upstream.  However, I decided that it might be generally useful, so
committed it anyways.  I forgot that I needed to add the copyright
header to it.  I suppose I should add a pre-commit hook somehow either
in svn or git.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333619 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:08 +00:00
Erwan de Ferrieres 4aa6dfe81e OFBIZ-4845 Apache Commons Compress is missing for Tika
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331060 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 20:12:46 +00:00
Jacques Le Roux 6900761114 Some improvements in StringUtil class
* Add the possibility to use your own separator, not only "=" which stays the default
* I changed the default separator from "|" in some intermediary methods to null which was the default before my changes in r1212749.
* A new split method based on Pattern.compile(delim).split(str, limit). This allows to create a list of string, splitting only on the nth limit occurrences. This because StringTokenizer is deprecated, though I kept it as main split method
* some formatting also (my own way, more legible I think)

All this can notably be helpful when you deal with non encoded URLs...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330995 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 17:56:01 +00:00
Sascha Rodekamp 374d9aa1d4 Change the RMI and JNDI port in the Test-containers.xml to 1099. Because the jndi servers in jndiservers.xml/jndi.properties are also configured to port 1099. If another port is set in the *-containers.xml the JNDI server could not be reached.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330778 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 11:15:48 +00:00
Adrian Crum ad32a9ebf9 Added a Scriptlet class to the base component - this will be used to simplify scriptlet implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330394 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 16:25:45 +00:00
Adrian Crum 6fdee164ac FlexibleMapAccessor improvement - fixed inconsistent toString() results.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330390 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 16:23:29 +00:00
Adrian Crum 189496613e Improved ObjectType.isEmpty method - removed unnecessary calls to UtilValidate.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330386 13f79535-47bb-0310-9956-ffa450edef68
2012-04-25 16:22:16 +00:00
Adrian Crum 5230635e21 ScriptUtil.java bug fix - removed trailing colon from script names.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329727 13f79535-47bb-0310-9956-ffa450edef68
2012-04-24 13:53:44 +00:00
Jacques Le Roux 922de27729 "Housekeeping of jar files" https://issues.apache.org/jira/browse/OFBIZ-4833
Trying to upgrade javamail (mail.jar) from 1.4 (our version) to 1.4.5 from Oracle I discovered that it's now distributed under BCL license (Binary Code License) which is not an open source license hence can't be committed.
So we are stuck with the 1.4 version wich is ok I guess and users should upgrade by themself...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329565 13f79535-47bb-0310-9956-ffa450edef68
2012-04-24 06:41:52 +00:00
Adrian Crum e72cd93484 Improved support for optional target type in ObjectType.simpleTypeConvert.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1329219 13f79535-47bb-0310-9956-ffa450edef68
2012-04-23 12:54:27 +00:00
Jacques Le Roux 8e549fdc59 "Housekeeping of jar files" https://issues.apache.org/jira/browse/OFBIZ-4833
* Updates httpunit.jar to httpunit-1.7.jar
* Updates wsdl4j-1.5.1.jar to wsdl4j-1.6.2.jar

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328918 13f79535-47bb-0310-9956-ffa450edef68
2012-04-22 18:01:20 +00:00
Jacopo Cappellato ebf04fde84 Synchronized read access to the parsedScript cache to avoid issues with concurrent thread visibility.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328641 13f79535-47bb-0310-9956-ffa450edef68
2012-04-21 12:19:31 +00:00
Jacopo Cappellato 684fce1265 The cache of parsed Groovy scripts was not thread safe; this issue, in instances with several concurrent threads running the same script the first time (i.e. not cached) could cause the same script parsed multiple times and then added to the cache (overriding the previous value); this event was causing the clearing of caches in Freemarker; because of a bug in Freemarker [*] this could cause a deadlock.
The issue is present on all versions of Freemarker but it is less frequent on latest version because of the refactoring of caches happened after release 2.3.10.

[*] https://sourceforge.net/tracker/?func=detail&aid=3519805&group_id=794&atid=100794

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328356 13f79535-47bb-0310-9956-ffa450edef68
2012-04-20 12:53:35 +00:00
Adam Heath 4e165df74b FEATURE: Very simple command-line tool to crypt a password.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327742 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:49:28 +00:00
Adam Heath f092508550 FEATURE: Make use of new HashCrypt cryptPassword functionality.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327741 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:49:22 +00:00
Adam Heath ffd48b19c9 FEATURE: Add unix(glibc)-compatible password hashing, exact same output, with support for salts.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327740 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:49:10 +00:00
Erwan de Ferrieres 39c7dc647e Removing commons-compress-1.1.jar as not used anywhere in OFBiz
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327667 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 20:29:19 +00:00
Sascha Rodekamp e4004ed672 Small code cleanups and refactoring for the Jackrabbit implementation, no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327470 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 12:22:20 +00:00
Jacopo Cappellato 160982d9e7 Enhanced GroovyUtil to support the execution of data preparation methods defined in a Groovy script file (similarly to what is already supported by the ScriptUtil class for JSR223).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326996 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 08:44:43 +00:00
Erwan de Ferrieres 0b7c9aa68b Upgrading to latest ant version: 1.8.3
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326132 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 15:38:17 +00:00
Erwan de Ferrieres 8b8f386f6a Upgrade to tomcat 7.0.27
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326090 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 12:07:15 +00:00
Jacques Le Roux 50cbd9b4f3 Complete r1326064, moreover I forgot to save the others *-containers.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326080 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 09:59:33 +00:00
Jacques Le Roux 86ca2bcd04 Complete r1326064, I forgot to save ofbiz-containers.xml before committing and did not notice
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326072 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 08:49:05 +00:00
Jacques Le Roux 8c481181d5 Adapted by hand from Lon F. Binder "CatalinaContainer Doesn't Respect <distributable/> Node for web.xml files." https://issues.apache.org/jira/browse/OFBIZ-4242
Per the servlet specification, the web.xml file should allow an optional <distributable/> node to indicate that the application is clusterable. Currently, OFBiz does not respect this setting and assumes all applications should be distributed if any cluster configuration is provided in the ofbiz-containers.xml file. As a result, if, for example, the DeltaManager is enable, all applications attempt to cluster and communicate via DeltaManager.

The expected and proper functionality is to check the individual application's web.xml file for the <distributable/> node and only use the DeltaManager if found; otherwise the StandardManager should be used for sessions.

jleroux: replaced some tabs, reformatted, added a comment about <distributable/> in the *-containers.file

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1326064 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 07:30:30 +00:00
Jacopo Cappellato 6558763ed6 Based on a suggestion by Adrian Crum, data preparation scripts can now be implemented with script methods that accept a Map context argument, for example:
def dataPreparationMethod(Map context) {
...
}



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1325750 13f79535-47bb-0310-9956-ffa450edef68
2012-04-13 13:10:59 +00:00
Jacopo Cappellato 6450c4f54d Modified Groovy util methods that prepares the binding to add the ScriptHelper object (to be consistent with the Groovy service engine and event handler and the "Script" JSR223 engine and handler): now Groovy scripts can execute the same exact Grrovy codes that can be executed when they are run thru JSR223.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1325620 13f79535-47bb-0310-9956-ffa450edef68
2012-04-13 05:53:54 +00:00
Jacopo Cappellato 4835731c9c Upgrade to the latest version of JUnit (4.10).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1311221 13f79535-47bb-0310-9956-ffa450edef68
2012-04-09 13:37:18 +00:00
Jacques Le Roux ec788aa471 Adds 1 to all ports in order to be able to run concurrently an OFBiz instance and a test instance on the same machine.
This closes "set different ports for testing in a CI environment (e.g. Jenkins)" https://issues.apache.org/jira/browse/OFBIZ-4794

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1311214 13f79535-47bb-0310-9956-ffa450edef68
2012-04-09 13:08:37 +00:00