Commit Graph
1486 Commits
Author SHA1 Message Date
Jacques Le Roux 69a54d528a Hastily removed at r1340414, needed by macros.xml (taskdefs javacc & jjtree)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340638 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 08:33:05 +00:00
Jacopo Cappellato 79ae52492a Refactored code to use the default BeansWrapper defined by FreemarkerWorker; this is important according to comment from one of the Freemarker committers:
"As of creating new BeansWrapper, be sure you create it only once during the application life-cycle and then reuse the same instance, or else it will have to rebuild the class introspection cache again and again."

Thanks to Adam Heath for the comment.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340631 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 07:49:45 +00:00
Jacques Le Roux e1183b6d16 Following https://issues.apache.org/jira/browse/OFBIZ-4833?focusedCommentId=13275249&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13275249
Moves to Attic:
    framework/base/lib/ant/ant-nodeps-1.8.1.jar => can be removed IMO. It was added with ant 1.8 by Hans, not sure why (no comment about need), seems to contains no needed stuff
    framework/base/lib/javacc can be removed IMO. The Java Compiler Compiler tm (JavaCC tm) - The Java Parser Generator, not used OOTB, was added by Marco, not sure why (no comment about need)
    framework/base/lib/Tidy.jar was used at bottom of eCommerce pages before, no longer needed
    framework/base/lib/ant-trax-1.8.0.jar can be removed IMO. It was added with ant 1.8 by Hans, not sure why (no comment about need), contains XSLT task
    framework/base/lib/commons/commons-vfs-20070730.jar certainly added with Webslinger can be removed now


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340414 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 10:57:40 +00:00
Jacopo Cappellato c60e7870fd Added new method "putIfAbsentAndGet" to UtilCache: it is similar to putIfAbsent but it always return the value even if the value was missing and added to the cache by method.
This can be useful to improve code like:

cache.putIfAbsent("key", "value");
value = cache.get("key"); // if a concurrent thread has cleared the cache the value could be null

into this:

value = cache.putIfAbsentAndGet("key", "value");



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340351 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 06:36:41 +00:00
Jacopo Cappellato 363ce98d69 Made the static variable Debug.dateFormat a private and final field because it is only used locally and DateFormat is not thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340347 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 06:18:07 +00:00
Jacopo Cappellato 4aebe81b8f Based on suggestion from Daniel Dekany (committer/maintainer of the Freemarker's project):
"Since BeansWrapper.getDefaultInstance() returns an instance that is
 shared in the scope of the class-loader that defined the FreeMarker
 classes, and since possibly multiple independently developed
 components in your system use FreeMarker and thus getDefaultInstance
 (and you may don't even know about it), and since the returned
 BeanWrapper can be configured (not read-only), you never know how the
 returned BeanWrapper is configured. So you add a 3rd party component,
 and if you are unlucky, suddenly your other component is broken.
 As of creating new BeansWrapper, be sure you create it only once
 during the application life-cycle and then reuse the same instance, or
 else it will have to rebuild the class introspection cache again and
 again."
 
 I have replaced the usage of the static instance of the BeansWrapper with a newly created object. 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339504 13f79535-47bb-0310-9956-ffa450edef68
2012-05-17 07:25:13 +00:00
Adrian Crum f5fa8dcb5b Added a comment to UtilXml.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339089 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 09:41:07 +00:00
Jacques Le Roux 2da70363b5 Revert all the changes related to CommonEmptyHeader, apart base-catalog.xml and labels in CommonUiLabels.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339081 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 09:27:31 +00:00
Jacques Le Roux d8088bdd77 Deprecates w/out keepSpace versions of UtilXml.createOutputTransformer() and UtilXml.writeXmlDocument()
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338974 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 02:42:09 +00:00
Jacques Le Roux aede4717e1 Fixes and complete r1338831
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338845 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 19:26:39 +00:00
Jacques Le Roux 1c972bf684 Fixes https://issues.apache.org/jira/browse/OFBIZ-4652 "The Label Manager is wrongly overriding CommonEmptyHeader"
* Adds a keepSpace boolean to UtilXml.writeXmlDocument(), this allows to use xsl:preserve-space into UtilXml.createOutputTransformer()
* Uses it into SaveLabelsToXmlFile.saveLabelsToXmlFile()
* Adds some French labels into CommonUiLabels.xml using Labels Manager to test the new functionality 
* Adds the xml:space attribute into the valueType complexType
* Adds the ofbiz-properties.xsd schema into the base-catalog.xml

I got an issue when 1st trying to commit: 
Commit failed (details follow):
While preparing
 'D:\workspace\ofbizClean\framework\common\config\CommonUiLabels.xml' for commit
Inconsistent line ending style

So I forced the EOLs to my locale platform value (Win XP)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338831 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 19:03:26 +00:00
Adrian Crum f09c0db4d1 Change new FlexibleMapAccessor static method to an object method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338372 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:57:25 +00:00
Adrian Crum b4c01f24ff Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338366 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:45:20 +00:00
Adrian Crum 025a75b632 Added a utility method to FlexibleMapAccessor.java to test for nested expressions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338361 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:43:18 +00:00
Jacopo Cappellato 53d6c971e9 Improved implementation of concurrent access to the cache of parsed Groovy scripts to avoid the risk of a NPE in the unlucky event that, between the execution of the cache.putIfAbsent and cache.get methods, the cache entry was removed (e.g. cache cleared/expired).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337789 13f79535-47bb-0310-9956-ffa450edef68
2012-05-13 07:16:18 +00:00
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