Author: hansbak
Date: Thu Feb 2 03:02:55 2012
New Revision: 1239451
URL:
http://svn.apache.org/viewvc?rev=1239451&view=revLog:
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.
Modified:
ofbiz/trunk/framework/common/data/CommonSystemPropertyData.xml
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java
Modified: ofbiz/trunk/framework/common/data/CommonSystemPropertyData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/data/CommonSystemPropertyData.xml?rev=1239451&r1=1239450&r2=1239451&view=diff==============================================================================
--- ofbiz/trunk/framework/common/data/CommonSystemPropertyData.xml (original)
+++ ofbiz/trunk/framework/common/data/CommonSystemPropertyData.xml Thu Feb 2 03:02:55 2012
@@ -18,6 +18,6 @@
under the License.
-->
<entity-engine-xml>
- <SystemProperty systemPropertyId="currency.uom.id.default" systemPropertyValue="USD" description="The default currency to use for prices, etc"/>
- <SystemProperty systemPropertyId="defaultFromEmailAddress" systemPropertyValue="
[hidden email]" description="general default 'fromEmailAddress' can be overridden in: EmailTemplateSetting"/>
+ <SystemProperty systemPropertyId="currency.uom.id.default" description="The default currency to use for prices, etc"/>
+ <SystemProperty systemPropertyId="defaultFromEmailAddress" description="general default 'fromEmailAddress' can be overridden in: EmailTemplateSetting"/>
</entity-engine-xml>
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java?rev=1239451&r1=1239450&r2=1239451&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java Thu Feb 2 03:02:55 2012
@@ -50,11 +50,12 @@ public class EntityUtilProperties implem
// find system property
try {
- List<GenericValue> systemProperties = delegator.findByAnd("SystemProperty", UtilMisc.toMap("systemPropertyId", name));
- if (UtilValidate.isNotEmpty(systemProperties)) {
- GenericValue systemProperty = EntityUtil.getFirst(systemProperties);
+ GenericValue systemProperty = delegator.findOne("SystemProperty", UtilMisc.toMap("systemPropertyId", name), false);
+ if (UtilValidate.isNotEmpty(systemProperty)) {
String systemPropertyValue = systemProperty.getString("systemPropertyValue");
- return systemPropertyValue;
+ if (UtilValidate.isNotEmpty(systemPropertyValue)) {
+ return systemPropertyValue;
+ }
}
} catch (Exception e) {
Debug.logWarning("Could not get a sytem property for " + name + " : " + e.getMessage(), module);