Commit Graph
844 Commits
Author SHA1 Message Date
Jacopo Cappellato 748dd94841 Removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340637 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 08:21:18 +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
Adam Heath abdead8200 Remove errant NOTE for 2008 that was part of a cut-n-waste.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338735 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 14:45:45 +00:00
Adam Heath 6299c90426 Deprecate all Delegator.findByAnd and Delegator.findByAndCache;
introduce a new Delegator.findByAnd variant that takes a boolean cache
parameter.

This change continues the simplication of the delegator api.  There is
no longer a version of a method with a 'Cache' suffix; instead, a single
version now exists that takes a boolean cache parameter.  Also, there
has been a trend to remove several method variants that take different
numbers and types of parameters, instead preferring to fully specify all
parameters; this also continues that trend.

Delegator.findByAnd(String, Map) is replaced with findByAnd(String, Map,
null, false).

Delegator.findByAnd(String, Map, List) is replaced with
findByAnd(String, Map, List, false).

Delegator.findByAnd(String, Object...) is replaced with
findByAnd(String, Map, null, false).  The object array is converted to a
map by using UtilMisc.toMap(Object...).

Delegator.findByAndCache(String, Map) is replaced with findByAnd(String,
Map, null, true).

Delegator.findByAndCache(String, Map, List) is replaced with
findByAnd(String, Map, List, true).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338424 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 21:03:45 +00:00
Adam Heath 9e5f405a4d DEPRECATION: framework: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338403 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:54 +00:00
Adam Heath 321196326a OPTIMIZE: One findByAnd call was calling another findByAnd, instead of
calling findList directly.  This change should speed it up(just
slightly).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338402 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:26 +00:00
Adam Heath 14db0dbfda DEPRECATION: Add new findByAnd variant, that has a boolean useCache
parameter; this is the same similiar pattern that other methods have.

After all code has been modified to use this new method, the older
methods will be deprecated(and eventually replaced).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338400 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:20 +00:00
Jacopo Cappellato cef1cccf82 OFBIZ-4864
* enabled by default the DebugManagedDataSource wrapper around ManagedDataSource
* enhanced the DebugManagedDataSource wrapper to:
** print log messages only at verbose level (instead of always as it was before)
** if possible print additional information about the connection status
** added new method that returns information about the connection pool settings/status
* added new static method to DBCPConnectionFactory to return information about the pools
* new screen in the webtools where information about each pool/helper is shown
The information provided by the screen can be very useful to analyze the status of the connection pools.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338230 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 14:45:43 +00:00
Jacques Le Roux ef02599c23 Removes the ij.script and derbytools-10.8.2.2.jar.
Reasons for this:
 * no active committer was maintaining it
 * it's maintained by the Derby project, see http://db.apache.org/derby/docs/dev/tools/ for details


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338173 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 12:03:58 +00:00
Adam Heath 2b3fdc9379 Deprecate Delegator.findByPrimaryKey and Delegator.findByPrimaryKeyCache.
Ofbiz is moving towards simpler delegator apis; this means all
'fooCache' variants are removed(and their matching 'foo' method), and a
new version of 'foo' added that takes a boolean cache parameter.

Delegator.findByPrimaryKey(String, Map) is replaced with
findOne(String, Map, false).

Delegator.findByPrimaryKeyCache(String, Map) is replaced with
findOne(String, Map, true).

Delegator.findByPrimaryKey(String, Object...) is replaced with
findOne(String, false, Object...).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337688 13f79535-47bb-0310-9956-ffa450edef68
2012-05-12 21:22: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 6cd099d6fd FEATURE: Key-encrypting-key(kek) support is now enabled. To enable
support for this, run:

java org.ofbiz.base.crypto.Main -kek

and paste that value as a new attribute in entityengine.xml, <delegator
key-encrypting-key="$kekText"/>.  Make certain to add that attribute to
*all* delegators that share the same datasources.

ps: That java command should really be added to build.xml.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335268 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 21:27:32 +00:00
Adam Heath 48062a3c41 FIX: There is a problem with tenant kek support, this should fix it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335064 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 15:29:28 +00:00
Hans Bakker 7f14038f90 fix duplicate relation name
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 08:58:06 +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 48a8ed8b34 OPTIMIZE: Move delegatorInfo assignment into the constructor; in all
cases, this will always be configured, so might as well do it early.
This really should be final, but that change will come later.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334256 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:56 +00:00
Adam Heath a1f182fe02 FEATURE: Add SaltedBase64StorageHandler to EntityCrypto; key names are
base-64 crypted({hashType}$text), key values are base64 encoded,
encrypted row values are $salt$encoded.  Note, however, that this code
is not yet active, as it hasn't been added to the list of key handlers.

This new handler is *not* active yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334255 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:50 +00:00
Adam Heath 31f3253361 OPTIMIZE/FEATURE: Move a bunch of code around, into a set of abstract
classes and concrete instances.  This allows for adding new types of key
management blocks, so that enhanced features can be added.  No
functional changes have actually been implemented yet; all existing
systems should behave *exactly* the same.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334254 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:44 +00:00
Adam Heath 53d1aa5762 OPTIMIZE: Remove the use of a few internal variables, and return results
directly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334253 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:37 +00:00
Adam Heath 53492a9a9a OPTIMIZE: Now that safe locking/threading is supported, there is no
longer a need to pre-populate the EntityKeyStore table with 20 random
keys; in reality, these 20 keys were enought to expand the keyMap
HashMap's internal structure, to a size that wouldn't normally be
auto-expanded during production.  And it was this lack of auto-expanding
that was keeping the map from becoming corrupted in very rare
circumstances.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334252 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:31 +00:00
Adam Heath 1db44dbbd7 FEATURE: Use a ConcurrentHashMap to store the keys loaded from the
database; as such, there is no longer any synchronization on the keyMap.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334251 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:25 +00:00
Adam Heath 4e8ed7763d FEATURE: Make EntityCrypto final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334218 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:51 +00:00
Adam Heath b7572e89b8 FEATURE: call UtilObject.getObjectException, and rethrow any exceptions,
so that the exception doesn't get logged multiple times.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334217 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:45 +00:00
Adam Heath 486f43495b FIX: When decrypting a value from the database, throw a useful exception
if the key couldn't be found; previously, an NPE would be thrown.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334215 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:37 +00:00
Adam Heath 2a05c1a04e OPTIMIZE: Rename secretKey variable to key; this makes it just like the
rest of the code.  The key stored in the database is not only just for
decrypting or encrypting, it's just a key.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334214 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:30 +00:00
Adam Heath b69f181a54 OPTIMIZE: Move the 2 similiar blocks of key/value decryption code in
decrypt() into a separate internal helper method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334213 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:24 +00:00
Adam Heath cc85b5e604 OPTIMIZE/FIX: Split the creation and searching of keys in the database
into two separate methods; a find for an old-style hashed key will no
longer create the old-style key.  This commit does not fix the existing
issue when multiplle threads try to encrypt a value with a key that
hasn't been created or loaded from the database yet; that is still to
come.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334212 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:17 +00:00
Adam Heath 2774841b66 OPTIMIZE: Use TransactionUtil.doNewTransaction, instead of suspending it
locally; makes the code simpler to follow.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334211 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:10 +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 ad92b98bd9 FIX: Handle the case of a field being encrypted that is currently null;
this is really just moving the null check into the local toString().

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334171 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:34 +00:00
Adam Heath 4f966b5ef2 OPTIMIZE: s/encHex/encValue/, this is a more accurate variable name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333623 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:33 +00:00
Adam Heath d192773e13 OPTIMIZE: Remove andCacheFieldSets from GenericDelegator; this variable
hasn't been used in like forever, man.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333620 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:14 +00:00
Jacques Le Roux 232dd652be https://issues.apache.org/jira/browse/OFBIZ-4602 "Null values are not synchronized in http mode"
This is not a complete solution and induces more problem than it solves (notably in RuntimeData for jobs), to be continued...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331996 13f79535-47bb-0310-9956-ffa450edef68
2012-04-29 21:02:53 +00:00
Adrian Crum d66f311eb7 Updated all Mini-language xml files to use the new schema.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328827 13f79535-47bb-0310-9956-ffa450edef68
2012-04-22 09:18:24 +00:00
Adam Heath 731a0d461f FEATURE/FIX: <entity-condition> on views are now done correctly. When a
view was previously joined to another view, the conditions on the inner
view were added to the outer-most WHERE clause.  This caused multiple
problems.  One, if the join was optional, the generated sql actually made
it required(because it was in the WHERE, and not in the ON clause).
Second, the outer WHERE may reference a field that was not available *at
all* in the generated nested select(view table).

The fix is to *not* recurse thru all view member entities when finding
conditions, and instead attach them to a new WHERE clause on the
generated inner SELECT(view table).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327735 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:48:40 +00:00
Adam Heath c029432953 FEATURE: Remove synchronization on UtilCache access in
ModelFieldTypeReader.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327734 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:48:33 +00:00
Adam Heath 96b4df930a FIX/FEATURE: When connecting views to their real entities, do a dependency sort, so
that a view that references another view is configured after it's
dependencies.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327733 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:48:26 +00:00
Adam Heath e5c44753c3 FEATURE: Remove synchronization on entity caching; this requires the
non-blocking features I added to UtilCache; without them, you'll get
internal map corruption.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327732 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:48:20 +00:00
Jacques Le Roux 8f45278325 Reverting to 2 changes which slipped in at r1324989 (WIP...)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1324995 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 20:48:56 +00:00
Jacques Le Roux c79283dbfc A patch from Francis ANDRE "unify admin port and key setting: single point of definition in start.properties" https://issues.apache.org/jira/browse/OFBIZ-4793
If someone wants to change the admin password or port, he would have to change currently many files (-- build.xml, various .bat and .sh --). In order to avoid this error-prone pratice, I suggest to centralize the definition of the admin kay and port at 2 single points: the framework/start/src/org/ofbiz/base/start/start.properties and the
framework/start/src/org/ofbiz/base/start/jetty.properties

jleroux: in config.java I also changed 
String adminPortStr = getProp(props, "ofbiz.admin.port", "0");
adminKey = getProp(props, "ofbiz.admin.key", "NA");
to
String adminPortStr = getProp(props, "ofbiz.admin.port", "10523");
adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn");

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1324989 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 20:32:35 +00:00
Jacopo Cappellato 9f817fcd64 Upgrade DBCP from snapshot version of 1.3 to the new release 1.4
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1324685 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 10:24:18 +00:00
Jacques Le Roux 8baaab2b1a A patch from Francis ANDRE "Add missing ConverterLoader to framework/entity/src/META-INF/services/org.ofbiz.base.conversion.ConverterLoader for running FOBiz in debug under Eclipse https://issues.apache.org/jira/browse/OFBIZ-4777
In order to run OFBiz in debug mode under Eclipse with hot class reloading, one needs to add the following Converters to the services framework/entity/src/META-INF/services/org.ofbiz.base.conversion.ConverterLoader because they are added at build time by the build.xml of the framework. Thus, they are missing when running OFBiz as an full Eclipse debug launcher.

org.ofbiz.base.conversion.BooleanConverters
org.ofbiz.base.conversion.CollectionConverters
org.ofbiz.base.conversion.DateTimeConverters
org.ofbiz.base.conversion.JSONConverters
org.ofbiz.base.conversion.MiscConverters
org.ofbiz.base.conversion.NetConverters
org.ofbiz.base.conversion.NumberConverters

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1308085 13f79535-47bb-0310-9956-ffa450edef68
2012-04-01 11:39:34 +00:00
Jacques Le Roux 024a070743 A change from Alexander Reelsen "Xml Deserializer does not support BigDecimal" https://issues.apache.org/jira/browse/OFBIZ-4733
In the last weeks the XML Serializer in trunk was extended to support BigDecimal. Unfortunately deserializing is not supported, which leads to services being broken when running via async as their are persisted in runtime_data... like sending mails, when a bigdecimal is involved

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1302324 13f79535-47bb-0310-9956-ffa450edef68
2012-03-19 08:48:03 +00:00
Hans Bakker 12326f72c1 OFBIZ-4729: defaultValue in EntityUtilProperties.getPropertyValue(String resource, String name, String defaultValue, Delegator delegator) method is forgotten. contributed by Leon
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300815 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 06:15:22 +00:00
David E. Jones d9ff4288bf Fixed bug when there is a view-entity having-condition and no having condition passed to the find method
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300747 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 21:58:37 +00:00
Hans Bakker 859f1c91df OFBIZ-4698: the price service check the currency.uom.id.default property from a system propery. Thanks Chattree for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1245324 13f79535-47bb-0310-9956-ffa450edef68
2012-02-17 06:13:28 +00:00
Jacques Le Roux bb56ad6049 OFBiz SOAP implementation was not handling
* null values in Map
* BigDecimal
* correctly TimeStamp format (we use xsd:dateTime in ModelService.getTypes())
So CXF was not able to unmarshall a List of Maps with those types in them.

It does not introduce any regressions:
* A new specific SOAP null type is introduced using ("nillable","true") and ("xsi:nil","true) attributes. I had also to set the http://www.w3.org/2001/XMLSchema-instance schema on the null node. Because it was impossible to add it in the envelope header, not a big deal anyway.
* I introduced a 'T' in the TimeStamp format. It's is OK, the deserialisation handles it well (we use xsd:dateTime, see  http://www.w3.org/TR/xmlschema-2/#dateTime)/. We don't handle TimeZone...
* BigDecimal was missing and is now correctly handled. I used 10 decimals and half up rounding (ROUND_HALF_UP) 

Also improves the SOAPEventHandler.sendError() method by passing the serviceName in the message

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1243026 13f79535-47bb-0310-9956-ffa450edef68
2012-02-11 10:50:56 +00:00
Hans Bakker 9de0762a42 make it possible that the applicable system settings in general properties can be overridded by settings in the database.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1240016 13f79535-47bb-0310-9956-ffa450edef68
2012-02-03 07:17:00 +00:00
Hans Bakker 57d7af2a63 update of system properties via entity:
- by default leave the values in the entity null
- use findOne method to get SystemProperty by primary key
- add check whether system property's value empty before using properties file
This change to make sure current users of a non tenant installation are not affected.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1239451 13f79535-47bb-0310-9956-ffa450edef68
2012-02-02 03:02:55 +00:00
Hans Bakker c690a5aba5 some missing files in -r1238993
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238998 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:24:36 +00:00