Commit Graph
830 Commits
Author SHA1 Message Date
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
Hans Bakker cc8c924b89 make <property-to-field/> in minilanguage first look in the newly created SystemProperty entity to be able to override the system properties defined in the properties files
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238993 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:14:53 +00:00
Hans Bakker f484f7b9d0 revert r1238954 some local changes were added
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238991 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:13:21 +00:00
Hans Bakker 204b9eb01a Wrong commit reverted in r1238991
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238954 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 07:22:12 +00:00
Jacques Le Roux a79e90da46 Closes OFBIZ-4663 ERROR in log file when starting OFBiz, debug-xa-resources is commented in entityengine.xml
Oops... forgot the other files in previous commit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1234015 13f79535-47bb-0310-9956-ffa450edef68
2012-01-20 17:21:41 +00:00
Jacques Le Roux 9d2a060d23 Closes OFBIZ-4663 ERROR in log file when starting OFBiz, debug-xa-resources is commented in entityengine.xml
About the issue I got. I simply forgot to update my XML catalogs after having changed the OFBiz working copy reference name.

Thanks to Paul Piper for his help about this last point, by pointing about XSD reference.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1234014 13f79535-47bb-0310-9956-ffa450edef68
2012-01-20 17:19:47 +00:00
Adrian Crum 13c5b28a17 Fixed a bug in GenericEntity.java where warnings were logged when the value came from a view entity and it tried to generate a property key for localization.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1231584 13f79535-47bb-0310-9956-ffa450edef68
2012-01-14 20:57:25 +00:00
Jacques Le Roux f02692f632 A patch from Philippe Mouawad "Set TransactionUtil#debugResources default value to false and make it configurable" https://issues.apache.org/jira/browse/OFBIZ-4293
debugResources is true which creates a DebugXAResource (that creates an Exception) , it should be false and made an option for debuging

jleroux: see comments in Jira 4282 for more

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226234 13f79535-47bb-0310-9956-ffa450edef68
2012-01-01 11:27:10 +00:00
Jacques Le Roux e5566e66cd A patch from Philippe Mouawad "Remove Synchronized in internalBegin" https://issues.apache.org/jira/browse/OFBIZ-4292
InternalBegin is uselessly synchronized , since it is a static method it is a very big useless Contention Point since not unthread safe instance variable is used

jleroux: see comments in Jira 4282 for more

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226231 13f79535-47bb-0310-9956-ffa450edef68
2012-01-01 10:50:27 +00:00
Jacques Le Roux 7f9eaa2793 This completes "Null values are not synchronized in http mode" https://issues.apache.org/jira/browse/OFBIZ-4602
And I better understand Patrick's answer to the issue now...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226065 13f79535-47bb-0310-9956-ffa450edef68
2011-12-31 11:37:23 +00:00
Jacques Le Roux 7ee4d9c8ec Should close "Null values are not synchronized in http mode" https://issues.apache.org/jira/browse/OFBIZ-4602
I followed Adrian's advice. I tried to create an order with a dropship1 item (like in Jira 4637) and it worked perfectly. I guess, as we were suspecting, using 
  set(name, "");
instead of
  element.setAttribute(name, "null");
had side effects. 

Anyway, as Adrian pointed out, the right returned string should be "[null-field]" and it's now correct/consistent. On the other side (entity sync clients), of course, now "[null-field]" should be handled instead of "" or "null"

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226055 13f79535-47bb-0310-9956-ffa450edef68
2011-12-31 10:13:34 +00:00
Jacques Le Roux 96bf9e337e This reverts r1222241 and should fix "Can not create drop shipment order" https://issues.apache.org/jira/browse/OFBIZ-4637 reported by Sergei Biletnikov and confirmed by mz4wheeler
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1225506 13f79535-47bb-0310-9956-ffa450edef68
2011-12-29 12:28:54 +00:00
Jacques Le Roux 456eb16137 A modified patch from Patrick Antivackis "Null values are not synchronized in http mode" https://issues.apache.org/jira/browse/OFBIZ-4602
In order to send over http the values to create, store and remove, Ofbiz is Xml serializing the values. GenericValue xml serialization is managed in GenericEntity.makeXmlElement, unfortunately this method just don't serialized null valued fields.
To solve this issue, I managed null value the same way GenericEntity.setString (which is used for the Xml deserializing). I only managed until case 10, because i'm not sure the setString for the cases 11 to 15 are well managed (not taking care of null value) 

jleroux: After looking at GenericEntity.setString and initial commit (http://svn.ofbiz.org/viewcvs?rev=7779&view=rev) I see no reasons to not handling cases under 10 the same way. So I added these cases as well using fall through.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1222241 13f79535-47bb-0310-9956-ffa450edef68
2011-12-22 14:14:57 +00:00
Jacques Le Roux 046deacbe0 A patch from Wai https://issues.apache.org/jira/browse/OFBIZ-4620 "fail uploading audio/video files to database"
When uploading binary files (eg. image/audio/video) to the database, ofbiz throws a type casting exception because it is trying to type cast HeapByteBuffer to byte[].

I think the problem stems from configuring ofbiz to use java.nio.ByteBuffer and its subclass java.nio.HeapByteBuffer to contain uploaded binary data but no accommodation is made in the code to work with this type of object.

To test this, you need to set content.properties/content.upload.always.local.file=false
an use partymgr/control/viewprofile?partyId=admin and upload an image file.

java.nio.HeapByteBuffer comes from java's rt.jar (make sure your classpath includes this)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1214124 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 09:18:04 +00:00
Erwan de Ferrieres 4162e44a47 A patch from Youssef Khaye - OFBIZ-4573 - complex-alias does not allow to do (discountPercent * 100) as stated in xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1205156 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 20:41:14 +00:00