Commit Graph
1170 Commits
Author SHA1 Message Date
Jacques Le Roux 642f42886e A temporary workaround for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
Reverts the simple method to use the original schema without namespace. "Duplicates" simple-methods.xsd in simple-methods-ns.xsd as we did, to get the simple-method namespace for compound-widgets.

For myself: when we will do the 3rd more elegant option (no schema duplication), have been changed also:
minilang-catalog.xml
compound-widgets.xsd


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749938 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 16:40:22 +00:00
Jacques Le Roux c8ba932772 Fixes a "typo" in last commit for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
We used targetNamespace (should only be used in schema) instead of xsi:schemaLocation



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749634 13f79535-47bb-0310-9956-ffa450edef68
2016-06-22 05:58:26 +00:00
Jacques Le Roux 89212904bd Completes and finish "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
2016-06-21 11:37:47 +00:00
Jacques Le Roux 4931db1ed9 Completes and finish "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061 by replacing xsd files references in xml files by -ns.xsd files and removing the concerned xsd files
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
2016-06-21 11:14:16 +00:00
Jacques Le Roux 11b4e86332 A patch from Gareth Carter for "connection pooling not working" https://issues.apache.org/jira/browse/OFBIZ-7346
Connection pooling does not seem to work. Connections are created fine but as the close() method is called (outside of transaction) or the transaction is committed the connections are closed to the db server and not returned to the pool.

I believe the issue is with org.apache.commons.dbcp2.PoolableConnectionFactory passivateObject method. This will call rollback() when rollbackOnReturn is set to true even if the transaction is committed. This is because any connection wrappers extending org.apache.commons.dbcp2.DelegatingConnection cache autoCommit status. At some point, this cached autoCommit is different from the underlying connection autoCommit. The rollback() method will throw an exception and the connection is destroyed rather than put back to the pool

Environment this has been tested on:
ofbiz: rev 1725574 and latest trunk (as of 2016-06-14)
db: postgresql 9.1
jdbc driver: postgresql-9.3-1101.jdbc4
os: linux and windows

jleroux: this issue doest not exist with Derby, it's a matter of driver (DBMS actually) see Derby vs Postgres

    https://db.apache.org/derby/docs/10.9/devguide/cdevconcepts29416.html
    https://www.postgresql.org/docs/9.1/static/ecpg-sql-set-autocommit.html

Another solution would be to force Postgres to autocommit but I'd not do that, better not change this DBMS dependent behaviour.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748837 13f79535-47bb-0310-9956-ffa450edef68
2016-06-17 11:51:13 +00:00
Jacques Le Roux 6eaa2239a6 Fixes "The Connection Pool Status feature in webtools is broken" - https://issues.apache.org/jira/browse/OFBIZ-7363
Completes the work I did in r1748689. Actually I worked on different editors and mixed things so not all was committed previously, here they are

Removes now useless commented out line about DebugManagedDataSource (// Useful to debug the usage of connections in the pool). I put more information in the class head while fixing the type warnings

Fixes other type warnings I missed previously

Eventually removes the old comment
        // Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748693 13f79535-47bb-0310-9956-ffa450edef68
2016-06-16 12:13:02 +00:00
Jacques Le Roux e0c49bb75f Fixes "The Connection Pool Status feature in webtools is broken" - https://issues.apache.org/jira/browse/OFBIZ-7363
The Connection Pool Status feature was introduced by OFBIZ-4864 hence 1st in R13.07 where it still work well (see demo), as the connection pooling. But has been broken since, with the pooling.
Fortunately, it's easy to fix and has no implications has long has you don't enable verbose logging (the DebugManagedDataSource only extends ManagedDataSource for verbose logging and to generate the info needed for the Connection Pool Status feature).

I fixed it by using directly the DebugManagedDataSource. It's not an issue as long as you don't set the logging level to verbose which is anyway not something you would do in production. In case you do so and don't want to be disturbed in the log (focusing on something else), it's still easy to comment out the line from DebugManagedDataSource. I also fixed some type warnings while at it.

I also removed this old comment
        // Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748689 13f79535-47bb-0310-9956-ffa450edef68
2016-06-16 11:46:03 +00:00
Jacques Le Roux bd0b57613c A patch from Wai for "EntityUtilProperties" https://issues.apache.org/jira/browse/OFBIZ-7112
OFBiz reads properties from either a properties file or the entity:SystemProperty. The way it worked previously is that OFBiz reads from the entity:SystemProperty first and if there is no value associated with the target propertyname, it would then locate the value from the relevant properties file.
In other words, if there is a database entry for a property, the database entry should override the associated properties file.
The issue is that if a database entry exist but the value is empty, it would look for a value from the properties file.  It should not do so.  If a database entry exists for the propertyname of interest, the value should be taken from the database even if it holds an empty value.

"isExistInDb" is first defined in Map<String, String> getSystemPropertyValue(String, String, Delegator).  This method is call by many other methods.  "isExistInDb" is used to indicate whether the method is returning an empty value for the property that 'exists' in the database rather than as a result of an absent database entry for the property.

The other methods...
  boolean propertyValueEqualsIgnoreCase(String, String, String, Delegator)
  String getPropertyValue(String, String, String, Delegator)
  String getPropertyValue(String, String, Delegator) 
  String getMessage(String, String, Locale, Delegator)
uses the above method and needs to decide whether to use the empty value returned (ie. empty value from an existing property entry in database) or decide if it needs to read from the property file (ie. property entry does not exist in database)

jleroux: this also add systemPropertyValue data in CommonSystemPropertyData.xml

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748560 13f79535-47bb-0310-9956-ffa450edef68
2016-06-15 11:23:54 +00:00
Jacques Le Roux 99de8f8705 A patch from Gareth Carter for "DB connections remain open and unused on startup" https://issues.apache.org/jira/browse/OFBIZ-7344
When ofbiz starts and checks the database, it will leave open connections and they will not get reused.

If you run Check/Update database from webtools, you can see a new connection is created for your selected group

As far as I can tell, the problem lies in DatabaseUtil.getDatabaseMetaData. If the parameter connection is null, a new connection object is created but not closed (like any resource should be!)

jleroux: I was unable to "see a new connection is created for your selected group" when running "Check/Update database from webtools". But I tested with Postgres while and after discussing with Gareth about this.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748543 13f79535-47bb-0310-9956-ffa450edef68
2016-06-15 10:35:18 +00:00
Jacques Le Roux 27b736e3ed No functional changes. While reviewing Wai's patch for OFBIZ-7112 I noticed that he (re)used this pattern introduced earlier:
(resource == null || resource.length() <= 0)
From Java spec. a String, Collection, Map or CharSequence can't have a negative length, so the pattern above can be reduced to 
  (resource == null || resource.length() == 0)
which can be replaced using 
  UtilValidate.isEmpty()
I checked, there are several other occurrences of this pattern (some very old, I guess most were routinely copied from an initial occurrence). I decided to replace all of them, here they are.

I did that already long ago for the 
  (resource == null || resource.length() == 0)
pattern. It remains 4 of them. Three are justified (because of the dependency on base component or because using isEmpty() on Object is disputable for performance reasons). I took care of the remaining one right aways (in SplashScreen.java)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747976 13f79535-47bb-0310-9956-ffa450edef68
2016-06-12 10:43:58 +00:00
Jacques Le Roux ec66e361e1 A big but straightforward commit for "Move minilang scripts from component://componentname/script/org/ofbiz to component://componentname/minilang" - https://issues.apache.org/jira/browse/OFBIZ-7267
I removed duplicate paths were componentname was uselessly repeated after component://componentname/script/org/ofbiz (projectmngr was the only one using there project instead)

I had few typos, easily fixed thanks to the tests. There could be still typos but they are unexpected and anyway no-brainer to fix 

I'm still wondering about specialpurpose/example/minilang/README.txt.
I changed its content to 
  "The minilang directory is for static resources that are interpreted at run time rather than being compiled. This goes on the classpath, but does not get built or put into a JAR file."
not sure it makes any sense, I don't see how this relates to the classpath. 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747712 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 14:04:30 +00:00
Jacques Le Roux 317e53a702 Non functional change, removes an useless private static final var, spotted by chance
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1744397 13f79535-47bb-0310-9956-ffa450edef68
2016-05-18 11:54:36 +00:00
Jacques Le Roux 9d6072b3d8 Changes for "Use SecureRandom instead of Random where appropriate, and randomUUID for externalKey" - https://issues.apache.org/jira/browse/OFBIZ-7028
Because using SecureRandom comes with a cost, I have identified the places where it's reasonable to keep the non secured Random (like tests, internal sequences, etc.).
Ant to use UUID.randomUUID to generate the external link id

Also, though there are no real proven vulnerabilities, I decided to backport as much as possible since it's now public.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741684 13f79535-47bb-0310-9956-ffa450edef68
2016-04-29 18:54:49 +00:00
Jacques Le Roux 4f243ac529 No functional changes, removes duplicate ";"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741674 13f79535-47bb-0310-9956-ffa450edef68
2016-04-29 17:36:31 +00:00
Jacques Le Roux 6455c9382c A sightly modified patch from Wai for "ofbizsetup create product store cause exception, remove use of temp file to load entity data" - https://issues.apache.org/jira/browse/OFBIZ-5949
The exception is caused by foreign key constraint violation between ShipmentCostEstimate and  CarrierShipmentMethod entities.
Currently, when creating a new product store using ofbizsetup component default data associated with the product store is loaded into the database using the following steps.
1. read default data from entity xml file and replace specific items in the read data and write to temp file.
2. use service=parseEntityXmlFile to load the processed file into database.
The issue with this method is that the temp file can present a problem when ofbiz is operating in multitenant mode.
The solution is to modify the relevant services so that no temp file needs generated.

jleroux: I simply used an UtilValidate.isNotEmpty() method in  EntitySaxReader class

I was initially reluctant to these changes because you can no longer load the content of the GlAccountData.xml and ProductStoreData.xml files, or the files themselves, using the import XML feature of webtools. But those files are specific to the setup component, so they should not be missed, they are supposed to be used in this context only.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1740008 13f79535-47bb-0310-9956-ffa450edef68
2016-04-19 21:09:14 +00:00
Jacques Le Roux 92e56e4078 A patch from Gareth Carter for "some files set viewIndex to 1 by default rather than 0" https://issues.apache.org/jira/browse/OFBIZ-6705
Implements a PagedList object (stores list of data items, resultset size, viewSize, viewIndex, lowIndex (called startIndex) and highIndex (called endIndex), also a utils class that returns the PagedList object based on a EntityListIterator, viewSize and viewIndex. 
And implements a queryPagedList method in EntityQuery, used as an example in findOrders service Java implementation

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738900 13f79535-47bb-0310-9956-ffa450edef68
2016-04-13 07:29:11 +00:00
Nicolas Malin f81916c504 correct error when sort a localized field with the order way is present like '-field', '+field', 'field ASC', 'field DESC'
This error raise by james yong on the issue OFBIZ-6987. Thanks to him for the issue and Deepak Dixit to spot the source

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738258 13f79535-47bb-0310-9956-ffa450edef68
2016-04-08 15:16:22 +00:00
Michael Brohl 302195327b Applied patch for OFBIZ-6971: Remove dead imports.
Remove all unnecessary import statements in all java files. Taken from the Refactor ToDo list at https://cwiki.apache.org/confluence/display/OFBIZ/Re-Factor+To-Do+List .

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737636 13f79535-47bb-0310-9956-ffa450edef68
2016-04-04 08:31:08 +00:00
Jacques Le Roux 1e7d539a7a Removes old simple-methods.xsd from the trunk as it's useless now (was replaced by simple-methods-v2.xsd)
Also renames simple-methods-v2.xsd in simple-methods.xsd and replaces simple-methods-v2.xsd references by simple-methods.xsd references everywhere it's needed



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737087 13f79535-47bb-0310-9956-ffa450edef68
2016-03-30 09:13:03 +00:00
Scott Gray 393de88042 Ensure a ModelField is set for rhs EntityConditionValues that don't already have it, such as the EntityFunction classes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1736922 13f79535-47bb-0310-9956-ffa450edef68
2016-03-28 20:13:54 +00:00
Nicolas Malin 2aa9aaf3f4 For screen engine drop-down, sort with the locale the entity-list if the related entity have a default resource defined.
This work also with view entity. Relate issue OFBIZ-3311

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1735741 13f79535-47bb-0310-9956-ffa450edef68
2016-03-19 09:01:40 +00:00
Deepak Dixit 51cb141c5e OFBIZ-6277: Merge changes from r1675521 to Trunk:
Log:
============================================================
new Configuration() is deprecated; instead, the desired
freemarker version should be passed in.  To make it easier to control
the version centrally, add a helper method on FreeMarkerWorker that
wraps the instantiation of the Configuration object.
============================================================


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731380 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 12:01:23 +00:00
Jacques Le Roux 612d0f6cd7 DB2 example based on http://markmail.org/message/ez55yv5m36liliue - OFBIZ-1607
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1730616 13f79535-47bb-0310-9956-ffa450edef68
2016-02-15 21:39:27 +00:00
Jacques Le Roux 340c2b6745 A slightly formatted patch from Gareth Carter for "Add getFieldList method to EntityQuery" https://issues.apache.org/jira/browse/OFBIZ-6848
Improves EntityQuery by adding method getFieldList so we don't have to chain to EntityUtils.getFieldListFromEntityList or getFieldListFromEntityListIterator

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1726184 13f79535-47bb-0310-9956-ffa450edef68
2016-01-22 11:50:49 +00:00
Gil Portenseigne 9a26099c85 Fix compilation error since OFBIZ-6748 improvements in TransactionUtil.java,
Testsuite entity-test successfull

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1717333 13f79535-47bb-0310-9956-ffa450edef68
2015-11-30 21:36:30 +00:00
Deepak Dixit 7da7a18d8a Fixed EntitySaxReader compile time warning related to Freemarker configuration.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1715491 13f79535-47bb-0310-9956-ffa450edef68
2015-11-21 10:04:59 +00:00
Jacques Le Roux b32ea9f89f No functional change, completes r1713985: removes superfluous .properties extension from UtilProperties requests (and yes I checked UspsServicesTests ;))
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714652 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 19:02:25 +00:00
Jacques Le Roux 8dfbe6834c A patch from Pierre Smits for "remove superfluous comment from entity-eca.xsd" https://issues.apache.org/jira/browse/OFBIZ-6724
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714308 13f79535-47bb-0310-9956-ffa450edef68
2015-11-14 12:41:26 +00:00
Jacques Le Roux 0eab108bbb A patch from Pierre Smits for "Remove tenant data from the demo data set" https://issues.apache.org/jira/browse/OFBIZ-5757
The demo data set (in location /framework/entity/data/TenantDemoData.xml) contains elements to load the tenants DEMO1 and DEMO2 into the implemented OFBiz setup.

This data set is intended to be loaded into the master tables when a user wants to explore multity tenancy. However, when a user also wants/needs to load demo data into the tenant DEMO1 or DEMO2 OFBiz also tries to upload the demo setup data for each tenant. This is not allowed as tenants do not have access to tables:
# Tenant
# Tenantdatasource
# etc

jleroux: (based on a Pierre's comment)
With
    ./ant create-tenant
and
    ./ant load-tenant-data-readers

We provide enough tools to explore the opportunity to demonstrate the multi-tenancy aspects of OFBiz. 
Moreover OFBIZ-6720 will be used to rewrite the multi-tenant support page in wiki. We will then see if we should not remove old ant tenant related targets now useless


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714085 13f79535-47bb-0310-9956-ffa450edef68
2015-11-12 16:22:34 +00:00
Adrian Crum d2e8ad8eea Updated documentation, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1709339 13f79535-47bb-0310-9956-ffa450edef68
2015-10-19 00:14:48 +00:00
Jacques Le Roux d6783003f3 A patch from Wei for "The filter-by-date="true" of <entity-condition></entity> in view entity PartyExport does not work" https://issues.apache.org/jira/browse/OFBIZ-6495
I changed ViewEntityCondition.getWhereCondition(), ViewConditionExpr.createCondition() and ViewConditionList.createCondition() which will add additional condition of filtering by date to where clause.

Please test by following steps.

1. Change the code below in GenericDAO
 if (queryTotalTime > 150) {
    Debug.logTiming("Ran query in " + queryTotalTime + " milli-seconds: " + " EntityName: " + modelEntity.getEntityName() + " Sql: " + sql + " where clause:" + whereEntityConditionParams, module);
}
to  
{code:title=GenericDAO.java|borderStyle=solid}
 if (queryTotalTime > 0) {
    Debug.logTiming("Ran query in " + queryTotalTime + " milli-seconds: " + " EntityName: " + modelEntity.getEntityName() + " Sql: " + sql + " where clause:" + whereEntityConditionParams, module);
}
It will always log the sql to the log file.
2. Open https://localhost:8443/partymgr/control/ImportExport
2. Enter a valid partyId for export and click SUBMIT
3. Check ofbiz.log file under runtime folder. You should able to see the query below which contains filter data condition
SELECT
  PRT.PARTY_ID,
  PRT.STATUS_ID,
  PRT.PREFERRED_CURRENCY_UOM_ID,
  GRP.GROUP_NAME,
  PER.FIRST_NAME,
  PER.MIDDLE_NAME,
  PER.LAST_NAME,
  PR.PARTY_ID_FROM,
  CGRP.GROUP_NAME,
  PRL.ROLE_TYPE_ID,
  CM.CONTACT_MECH_TYPE_ID,
  PCP.CONTACT_MECH_PURPOSE_TYPE_ID,
  CM.INFO_STRING,
  TN.COUNTRY_CODE,
  TN.AREA_CODE,
  TN.CONTACT_NUMBER,
  PA.ADDRESS1,
  PA.ADDRESS2,
  PA.CITY,
  PA.STATE_PROVINCE_GEO_ID,
  PA.POSTAL_CODE,
  PA.COUNTRY_GEO_ID,
  PCM.FROM_DATE,
  PCM.THRU_DATE
FROM (((((((((public.PARTY PRT
LEFT OUTER JOIN public.PARTY_GROUP GRP
  ON PRT.PARTY_ID = GRP.PARTY_ID)
LEFT OUTER JOIN public.PERSON PER
  ON PRT.PARTY_ID = PER.PARTY_ID)
LEFT OUTER JOIN public.PARTY_RELATIONSHIP PR
  ON PRT.PARTY_ID = PR.PARTY_ID_TO
  AND ((PR.ROLE_TYPE_ID_FROM = 'ACCOUNT'
  AND PR.PARTY_RELATIONSHIP_TYPE_ID = 'EMPLOYMENT')))
LEFT OUTER JOIN public.PARTY_GROUP CGRP
  ON PR.PARTY_ID_FROM = CGRP.PARTY_ID)
LEFT OUTER JOIN public.PARTY_ROLE PRL
  ON PRT.PARTY_ID = PRL.PARTY_ID)
LEFT OUTER JOIN public.PARTY_CONTACT_MECH PCM
  ON PRT.PARTY_ID = PCM.PARTY_ID
  AND (((PCM.THRU_DATE IS NULL
  OR PCM.THRU_DATE > '2015-06-15 13:21:30.157')
  AND (PCM.FROM_DATE IS NULL
  OR PCM.FROM_DATE <= '2015-06-15 13:21:30.157'))))
LEFT OUTER JOIN public.POSTAL_ADDRESS PA
  ON PCM.CONTACT_MECH_ID = PA.CONTACT_MECH_ID)
LEFT OUTER JOIN public.CONTACT_MECH CM
  ON PCM.CONTACT_MECH_ID = CM.CONTACT_MECH_ID)
LEFT OUTER JOIN public.TELECOM_NUMBER TN
  ON PCM.CONTACT_MECH_ID = TN.CONTACT_MECH_ID)
LEFT OUTER JOIN public.PARTY_CONTACT_MECH_PURPOSE PCP
  ON PCM.CONTACT_MECH_ID = PCP.CONTACT_MECH_ID
  AND (((PCM.THRU_DATE IS NULL
  OR PCM.THRU_DATE > '2015-06-15 13:21:30.157')
  AND (PCM.FROM_DATE IS NULL
  OR PCM.FROM_DATE <= '2015-06-15 13:21:30.157')))
  AND PCM.PARTY_ID = PCP.PARTY_ID
  AND (((PCM.THRU_DATE IS NULL
  OR PCM.THRU_DATE > '2015-06-15 13:21:30.236')
  AND (PCM.FROM_DATE IS NULL
  OR PCM.FROM_DATE <= '2015-06-15 13:21:30.236')))
WHERE (((PRL.ROLE_TYPE_ID = ?
OR PRL.ROLE_TYPE_ID = ?
OR PRL.ROLE_TYPE_ID = ?)
AND (PRT.STATUS_ID <> ?
OR PRT.STATUS_ID IS NULL)
AND PRT.PARTY_ID = ?))
ORDER BY PRT.PARTY_ID ASC


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1708341 13f79535-47bb-0310-9956-ffa450edef68
2015-10-13 11:24:17 +00:00
Arun Patidar 3865ff485d [OFBIZ-6171] Applied patch from Pierre Smits for replacing 'Open for Business' references with 'Apache OFBiz'.Thanks Pierre for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1706589 13f79535-47bb-0310-9956-ffa450edef68
2015-10-03 14:15:21 +00:00
Jacques Le Roux c4f05659be A patch from Martin Becker for "data import - nulling fields impossible" https://issues.apache.org/jira/browse/OFBIZ-293
In my opinion it would be straight forward, if the entity import would treat fields that are mentioned in entity XML files as fields that should be updated always, as the GenericDAO does. The current logic ignores fields, if there is only an empty string as value.

The enhancement brought by the solution of OFBIZ-4949 makes it possible to generally configure an entity-engine-xml file to be interpreted as replacement, so that all NOT mentioned fields are set to NULL instead of leaving the old value while updating the entity.

Nevertheless I think, that the default (update) behavior, the one with fine grained control over which fields are touched, should also give the possibility to set field values to NULL by including them in the XML.

The solution with the lowest impact on existing XML files and the most natural meaning should be to interpret empty string values in the XML as NULL, as it is today. The only difference would be, that they are not longer ignored but set as NULL values in the database. The only drawback I see is, that you're still not able to set "empty string" values as concrete values to the database (no loss of function, because you can't do it today, too).

As far as I can see, there should be no conflict with current existing data files. There are some where for example a parentTypeId is contained with empty string as value. Interpreting it as NULL and setting in database is exactly what is meant by such a definition.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1706316 13f79535-47bb-0310-9956-ffa450edef68
2015-10-01 20:24:17 +00:00
Jacques Le Roux 925c51d691 Referring to the excellent answer at https://stackoverflow.com/questions/14231037/java-safevarargs-annotation-does-a-standard-or-best-practice-exist it's safe to put SafeVarargs annotation here (it's only used to iterate over the elements). I was curious about that
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704771 13f79535-47bb-0310-9956-ffa450edef68
2015-09-23 08:15:50 +00:00
Jacques Le Roux 2a8dadbc91 No functional changes for https://issues.apache.org/jira/browse/OFBIZ-6651
Removes unused methods (not in Java code, FTL templates and Groovy scripts) in GenericValue and EntityUtil classes + misc related comments or logs
Adds log warning to spot possible use cases in templates and scripts of getRelated() and getRelatedOne() methods

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704769 13f79535-47bb-0310-9956-ffa450edef68
2015-09-23 08:03:45 +00:00
Jacques Le Roux 39ab353837 A patch from Martin Becker from a Gareth Carter's idea for "Fix deprecation issues in framework/entity" https://issues.apache.org/jira/browse/OFBIZ-6276
As reported Adam:
It appears that the storeAll() variants are being refactor; basically, the useCache parameter is being removed.  However, this has caused the entity engine to have deprecation with itself.

Gareth suggested:
What about new method that allows passing in an options object
storeAll(List<GenericValue> values, StoreOptions options) ?
You can deprecate the old methods without changes
Moving forward, you would just need to add new values to the StoreOptions class rather than adding new parameters to the existing one
I am not sure about the name StoreOptions though, EntityOptions ?

Martin contributed the implementation and suggested EntityStoreOptions for the new class name.
Ha created a patch which removes the use of deprecated API and the deprecated API itself from Delegator and GenericDelegator.
Introduced the EntityStoreOptions class as mentioned in a comment before to substitute the createDummyFks parameter of storeAll method to avoid ambiguous API after removing the deprecated doCacheClear parameter.
The decryptFieldValue method, just defined deprecated by Jacopo is left there as deprecated. Only the "old" deprecated methods where removed.

Gil Portenseigne supplied a pure svn patch, actually I had conflicting pending changes locally which prevented me to apply Martin's original patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704108 13f79535-47bb-0310-9956-ffa450edef68
2015-09-20 08:37:51 +00:00
Jacques Le Roux d2ab653ea7 A patch from Wei Zhang for "The EntityListIterator must be closed in EntityQuery.query()" https://issues.apache.org/jira/browse/OFBIZ-6615
jleroux: The EntityListIterator at line 453 is now closed (dynamicViewEntity complete list retrieved once, eg: agreementServices.getCommissionForProduct())

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1702548 13f79535-47bb-0310-9956-ffa450edef68
2015-09-11 20:49:42 +00:00
Jacopo Cappellato 6b36022817 Reverted 1530237: the sql type for Postgres for "comments" and "description" fields was changed from VARCHAR(255) to TEXT; the new TEXT type allows strings of any length; however all other types definitions (MySQL, Derby etc...) are using VARCHAR(255) thus limiting the length of "comments" and "description" fields to 255 characters.
By reverting this change we make sure that the Postgres db will be consistent with the other dbs.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1697590 13f79535-47bb-0310-9956-ffa450edef68
2015-08-25 07:46:31 +00:00
Jacques Le Roux 067df90ae1 After r1695126, I found that most of the Java files have svn:eol-style=native. So only 116 Java files were missing svn:eol-style=native. I guess those have been added by committers who are not using the OFBiz svn config file on their machines. So rather than removing svn:eol-style=native, this commits add the property to the files which miss it. Here 116+89=205 files have their svn:eol-style property changed to native.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695129 13f79535-47bb-0310-9956-ffa450edef68
2015-08-10 16:33:23 +00:00
Deepak Dixit aafe193fbd (OFBIZ-6561) Reverted r#1668267 and related changes done in r1674064, 1669537 to fix the cache issue,
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1693701 13f79535-47bb-0310-9956-ffa450edef68
2015-08-01 10:12:39 +00:00
Nicolas Malin 07fdc51217 correct compilation error, missing delegatorBaseName parameter for function GenericDelegator.getEntityNamesByGroup. Issue OFBIZ-6533, thanks Wei Zhang for this alert
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1687679 13f79535-47bb-0310-9956-ffa450edef68
2015-06-26 07:04:55 +00:00
Jacques Le Roux a41d4ac771 OFBIZ-6532 - Adding a new entity-group but no corresponding delegator/group-map is hard to debug
Adds an error message in log just before crash, so it's easy to debug

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1687589 13f79535-47bb-0310-9956-ffa450edef68
2015-06-25 17:24:55 +00:00
Michael Brohl 8568760a60 Applied changes for OFBIZ-6300: Compiler-Error with JDK 1.8 and source compatibility 1.8.
This reintroduces type safety for getFieldentryIterator.

Thanks Martin Becker for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1686570 13f79535-47bb-0310-9956-ffa450edef68
2015-06-20 11:43:30 +00:00
Jacopo Cappellato eb6d01b066 New implementation of the two-way cryptographic services of OFBiz based on Apache Shiro:
* two-way encryption is now delegated to Apache Shiro, with stronger initialization vectors
* the mechanism is backward compatible
* new tools to update the encryption of private keys, useful to upgrade older versions of OFBiz and most of all to replace old keys with new ones (this is critical to implement stronger security practices as requested by PCI) 
* unit tests



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684608 13f79535-47bb-0310-9956-ffa450edef68
2015-06-10 09:01:30 +00:00
Adrian Crum ed1d93be59 Revert rev 1684133 and fix the compiler error properly.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684217 13f79535-47bb-0310-9956-ffa450edef68
2015-06-08 16:14:45 +00:00
Jacques Le Roux 08e14fc292 A patch from Taher Alkhateeb "Upgrade OFBiz to Java JDK 8" https://issues.apache.org/jira/browse/OFBIZ-6458
2nd step: allows Eclipse EJC to compile, fixes a problem with compilation error in eclipse only, it works okay in javac but not in Eclipse EJC

jleroux: this introduces a small "regression" in the code syntax but to allow users to compile with Eclipse EJC.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684133 13f79535-47bb-0310-9956-ffa450edef68
2015-06-08 09:58:50 +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
Adrian Crum 0f2db40ee3 Initial commit of the fix for the dirty cache reads problem - https://issues.apache.org/jira/browse/OFBIZ-5534.
This fixes the PK cache only, the other caches will be fixed after this commit is reviewed.

I didn't include a unit test because Derby deadlocks while testing for this. Actually, the deadlock proves the problem is fixed. I will continue trying to find a way to provide a unit test.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668267 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 13:44:55 +00:00
Adrian Crum 755ee6ae6f Oops, I forgot to include unit tests in my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668261 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 12:51:34 +00:00