You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/01/02 12:15:04 UTC
svn commit: r1554789 - in /ofbiz/branches/release12.04: ./
applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java
Author: jleroux
Date: Thu Jan 2 11:15:04 2014
New Revision: 1554789
URL: http://svn.apache.org/r1554789
Log:
"Applied fix from trunk for revision: 1554787"
------------------------------------------------------------------------
r1554787 | jleroux | 2014-01-02 12:14:01 +0100 (jeu. 02 janv. 2014) | 1 ligne
I did not get a chance to test my last editGeoLocation related change, here is the definitive version
------------------------------------------------------------------------
Modified:
ofbiz/branches/release12.04/ (props changed)
ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java
Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1554787
Modified: ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml?rev=1554789&r1=1554788&r2=1554789&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml (original)
+++ ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml Thu Jan 2 11:15:04 2014
@@ -128,8 +128,8 @@ under the License.
<simple-method method-name="editGeoLocation" short-description="Edit GeoLocation">
<if-empty field="parameters.geoPointId">
<set field="createGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/>
- <set field="createGeoPointMap.latitude" from-field="parameters.lat" locale="en"/>
- <set field="createGeoPointMap.longitude" from-field="parameters.lng" locale="en"/>
+ <set field="createGeoPointMap.latitude" from-field="parameters.lat" type="Double" locale="en"/>
+ <set field="createGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/>
<call-service service-name="createGeoPoint" in-map-name="createGeoPointMap">
<result-to-field result-name="geoPointId" field="geoPointId"/>
</call-service>
@@ -143,8 +143,8 @@ under the License.
<else>
<set field="updateGeoPointMap.geoPointId" from-field="parameters.geoPointId"/>
<set field="updateGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/>
- <set field="updateGeoPointMap.latitude" from-field="parameters.lat" locale="en"/>
- <set field="updateGeoPointMap.longitude" from-field="parameters.lng" locale="en"/>
+ <set field="updateGeoPointMap.latitude" from-field="parameters.lat" type="Double" locale="en"/>
+ <set field="updateGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/>
<call-service service-name="updateGeoPoint" in-map-name="updateGeoPointMap"/>
</else>
</if-empty>
Modified: ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java?rev=1554789&r1=1554788&r2=1554789&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java (original)
+++ ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java Thu Jan 2 11:15:04 2014
@@ -187,7 +187,12 @@ public final class SetOperation extends
if (targetClass == null) {
targetClass = MiniLangUtil.getObjectClassForConversion(newValue);
}
- newValue = MiniLangUtil.convertType(newValue, targetClass, methodContext.getLocale(), methodContext.getTimeZone(), format);
+ if (!this.localeFse.isEmpty() && this.type.length() > 0) {// FIXME this is a temporary hack waiting for a better geolocation data model, related with OFBIZ-5453
+ Locale localeTemp = new Locale(this.localeFse.expandString(methodContext.getEnvMap()));
+ newValue = MiniLangUtil.convertType(newValue, targetClass, localeTemp, methodContext.getTimeZone(), format);
+ } else {
+ newValue = MiniLangUtil.convertType(newValue, targetClass, methodContext.getLocale(), methodContext.getTimeZone(), format);
+ }
} catch (Exception e) {
String errMsg = "Could not convert field value for the field: [" + this.fieldFma.toString() + "] to the [" + this.type + "] type for the value [" + newValue + "]: " + e.getMessage();
Debug.logWarning(e, errMsg, module);