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/11 20:41:19 UTC
svn commit: r1557449 - in /ofbiz/branches/release12.04: ./
applications/party/script/org/ofbiz/party/party/
applications/party/webapp/partymgr/WEB-INF/actions/party/
applications/party/webapp/partymgr/party/ framework/common/entitydef/
framework/common...
Author: jleroux
Date: Sat Jan 11 19:41:18 2014
New Revision: 1557449
URL: http://svn.apache.org/r1557449
Log:
"Applied fix from trunk for revision: 1557447 "
------------------------------------------------------------------------
r1557447 | jleroux | 2014-01-11 20:39:23 +0100 (sam. 11 janv. 2014) | 6 lignes
This fixes "Set field in (at least) widget screen does not take into account a locale for (at least) the Float type" https://issues.apache.org/jira/browse/OFBIZ-5453
It actually does more than that. It follows Adrian's proposition of improving the GeoPoint data model.
I did not applies all of Adrian's proposition (see our conversation in the Jira issue). Feel free to apply it completely if you are inclined so.
I will also add an entry in wiki page "Revisions Requiring Data Migration (upgrade ofbiz)" at https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=7045166
------------------------------------------------------------------------
Modified:
ofbiz/branches/release12.04/ (props changed)
ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
ofbiz/branches/release12.04/applications/party/webapp/partymgr/WEB-INF/actions/party/GetGeoLocation.groovy
ofbiz/branches/release12.04/applications/party/webapp/partymgr/party/editGeoLocation.ftl
ofbiz/branches/release12.04/framework/common/entitydef/entitymodel.xml
ofbiz/branches/release12.04/framework/common/webcommon/includes/geolocation.ftl
ofbiz/branches/release12.04/framework/minilang/dtd/simple-methods-v2.xsd
ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java
ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java
ofbiz/branches/release12.04/framework/widget/dtd/widget-form.xsd
ofbiz/branches/release12.04/framework/widget/dtd/widget-screen.xsd
ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
ofbiz/branches/release12.04/specialpurpose/example/widget/example/ExampleScreens.xml
Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1557447
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=1557449&r1=1557448&r2=1557449&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 Sat Jan 11 19:41:18 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" type="Double" locale="en"/>
- <set field="createGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/>
+ <set field="createGeoPointMap.latitude" from-field="parameters.lat"/>
+ <set field="createGeoPointMap.longitude" from-field="parameters.lng"/>
<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" type="Double" locale="en"/>
- <set field="updateGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/>
+ <set field="updateGeoPointMap.latitude" from-field="parameters.lat"/>
+ <set field="updateGeoPointMap.longitude" from-field="parameters.lng"/>
<call-service service-name="updateGeoPoint" in-map-name="updateGeoPointMap"/>
</else>
</if-empty>
Modified: ofbiz/branches/release12.04/applications/party/webapp/partymgr/WEB-INF/actions/party/GetGeoLocation.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/webapp/partymgr/WEB-INF/actions/party/GetGeoLocation.groovy?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/party/webapp/partymgr/WEB-INF/actions/party/GetGeoLocation.groovy (original)
+++ ofbiz/branches/release12.04/applications/party/webapp/partymgr/WEB-INF/actions/party/GetGeoLocation.groovy Sat Jan 11 19:41:18 2014
@@ -23,18 +23,14 @@ import org.ofbiz.base.util.*;
import org.ofbiz.base.util.string.*;
import org.ofbiz.party.contact.ContactHelper;
import org.ofbiz.common.geo.*;
-import java.text.NumberFormat;
if (partyId) {
context.partyId = partyId;
latestGeoPoint = GeoWorker.findLatestGeoPoint(delegator, "PartyAndGeoPoint", "partyId", partyId, null, null);
if (latestGeoPoint) {
context.geoPointId = latestGeoPoint.geoPointId;
- NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH);
- nf.setMinimumFractionDigits(5);
- nf.setMaximumFractionDigits(10);
- context.latitude = nf.format(latestGeoPoint.latitude);
- context.longitude = nf.format(latestGeoPoint.longitude);
+ context.latitude = latestGeoPoint.latitude;
+ context.longitude = latestGeoPoint.longitude;
} else {
context.latitude = 0;
context.longitude = 0;
Modified: ofbiz/branches/release12.04/applications/party/webapp/partymgr/party/editGeoLocation.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/webapp/partymgr/party/editGeoLocation.ftl?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/party/webapp/partymgr/party/editGeoLocation.ftl (original)
+++ ofbiz/branches/release12.04/applications/party/webapp/partymgr/party/editGeoLocation.ftl Sat Jan 11 19:41:18 2014
@@ -121,7 +121,7 @@ under the License.
<div align="center" id="map" style="border:1px solid #979797; background-color:#e5e3df; width:500px; height:450px; margin:2em auto;"><br/></div>
<form action="#" onsubmit="showAddress(this.address.value); return false">
<input type="text" size="50" name="address"/>
- <input type="submit" value="${uiLabelMap.CommonSearch}"/>
+ <input type="submit" value="Search"/>
</form>
<br/><br/>
<form id="updateMapForm" method="post" action="<@o...@ofbizUrl>">
Modified: ofbiz/branches/release12.04/framework/common/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/common/entitydef/entitymodel.xml?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/common/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/release12.04/framework/common/entitydef/entitymodel.xml Sat Jan 11 19:41:18 2014
@@ -280,9 +280,9 @@ under the License.
title="Geographic Location">
<field name="geoPointId" type="id-ne"></field>
<field name="dataSourceId" type="id"></field>
- <field name="latitude" type="floating-point" not-null="true"></field>
- <field name="longitude" type="floating-point" not-null="true"></field>
- <field name="elevation" type="floating-point"></field>
+ <field name="latitude" type="short-varchar" not-null="true"></field>
+ <field name="longitude" type="short-varchar" not-null="true"></field>
+ <field name="elevation" type="short-varchar"></field>
<field name="elevationUomId" type="id"><description>We need an UOM for elevation (feet, meters, etc.)</description></field>
<field name="information" type="comment"><description>To enter any related information</description></field>
<prim-key field="geoPointId"/>
Modified: ofbiz/branches/release12.04/framework/common/webcommon/includes/geolocation.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/common/webcommon/includes/geolocation.ftl?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/common/webcommon/includes/geolocation.ftl (original)
+++ ofbiz/branches/release12.04/framework/common/webcommon/includes/geolocation.ftl Sat Jan 11 19:41:18 2014
@@ -58,13 +58,13 @@ under the License.
var map = new google.maps.Map(document.getElementById("${id}"),
<#if geoChart.points?has_content>
- { center: new google.maps.LatLng(${center.lat?c}, ${center.lon?c}),
+ { center: new google.maps.LatLng(${center.lat}, ${center.lon}),
zoom: ${zoom},
mapTypeId: google.maps.MapTypeId.ROADMAP
});
<#list geoChart.points as point>
var marker_${point_index} = new google.maps.Marker({
- position: new google.maps.LatLng(${point.lat?c}, ${point.lon?c}),
+ position: new google.maps.LatLng(${point.lat}, ${point.lon}),
map: map
});
<#if point.link?has_content>
@@ -78,7 +78,7 @@ under the License.
</#list>
var latlngs = [
<#list geoChart.points as point>
- new google.maps.LatLng(${point.lat?c}, ${point.lon?c})<#if point_has_next>,</#if>
+ new google.maps.LatLng(${point.lat}, ${point.lon})<#if point_has_next>,</#if>
</#list>
];
showAllMarkers(map, latlngs);
@@ -117,7 +117,7 @@ under the License.
map = new OpenLayers.Map("${id}");
map.addLayer(new OpenLayers.Layer.OSM());
var zoom = ${zoom};
- var center= new OpenLayers.LonLat(${center.lon?c},${center.lat?c})
+ var center= new OpenLayers.LonLat(${center.lon},${center.lat})
.transform(new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
);
@@ -125,7 +125,7 @@ under the License.
map.addLayer(markers);
<#if geoChart.points?has_content>
<#list geoChart.points as point>
- markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(${point.lon?c} ,${point.lat?c}).transform(
+ markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(${point.lon} ,${point.lat}).transform(
new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())));
</#list>
</#if>
Modified: ofbiz/branches/release12.04/framework/minilang/dtd/simple-methods-v2.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/minilang/dtd/simple-methods-v2.xsd?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/minilang/dtd/simple-methods-v2.xsd (original)
+++ ofbiz/branches/release12.04/framework/minilang/dtd/simple-methods-v2.xsd Sat Jan 11 19:41:18 2014
@@ -1218,16 +1218,6 @@ under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute type="xs:string" name="locale">
- <xs:annotation>
- <xs:documentation>
- A locale value (eg: en). The locale allows to pass values whose types are locale dependent (like Float, etc.).
- Defaults to the environment locale. Works only if a type which makes sense is also passed.
-
- Optional. Attribute types: constant, ${expression}.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
<xs:attribute name="set-if-null" type="booleanConst">
<xs:annotation>
<xs:documentation>
Modified: ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java (original)
+++ ofbiz/branches/release12.04/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java Sat Jan 11 19:41:18 2014
@@ -195,10 +195,6 @@ public final class MethodContext {
return this.locale;
}
- public void setLocale(Locale locale) {
- this.locale = locale;
- }
-
public int getMethodType() {
return this.methodType;
}
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=1557449&r1=1557448&r2=1557449&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 Sat Jan 11 19:41:18 2014
@@ -20,7 +20,6 @@ package org.ofbiz.minilang.method.envops
import javolution.util.FastList;
import javolution.util.FastMap;
-import java.util.Locale;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.ObjectType;
@@ -77,7 +76,6 @@ public final class SetOperation extends
private final FlexibleStringExpander defaultFse;
private final FlexibleStringExpander formatFse;
- private final FlexibleStringExpander localeFse;
private final FlexibleMapAccessor<Object> fieldFma;
private final FlexibleMapAccessor<Object> fromFma;
private final Scriptlet scriptlet;
@@ -92,7 +90,7 @@ public final class SetOperation extends
if (MiniLangValidate.validationOn()) {
MiniLangValidate.deprecatedAttribute(simpleMethod, element, "from-field", "replace with \"from\"");
MiniLangValidate.deprecatedAttribute(simpleMethod, element, "default-value", "replace with \"default\"");
- MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "format", "type", "set-if-null", "set-if-empty", "locale");
+ MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "format", "type", "set-if-null", "set-if-empty");
MiniLangValidate.requiredAttributes(simpleMethod, element, "field");
MiniLangValidate.requireAnyAttribute(simpleMethod, element, "from-field", "from", "value");
MiniLangValidate.constantPlusExpressionAttributes(simpleMethod, element, "value");
@@ -116,7 +114,6 @@ public final class SetOperation extends
this.valueFse = FlexibleStringExpander.getInstance(element.getAttribute("value"));
this.defaultFse = FlexibleStringExpander.getInstance(element.getAttribute("default"));
this.formatFse = FlexibleStringExpander.getInstance(element.getAttribute("format"));
- this.localeFse = FlexibleStringExpander.getInstance(element.getAttribute("locale"));
this.type = element.getAttribute("type");
Class<?> targetClass = null;
if (!this.type.isEmpty()) {
@@ -144,15 +141,7 @@ public final class SetOperation extends
Debug.logWarning(exc, "Error evaluating scriptlet [" + this.scriptlet + "]: " + exc, module);
}
} else if (!this.fromFma.isEmpty()) {
- Locale localeTemp = null; // FIXME this is a temporary hack waiting for a better geolocation data model, related with OFBIZ-5453
- if (!this.localeFse.isEmpty() && this.type.length() > 0) {
- localeTemp = methodContext.getLocale();
- methodContext.setLocale(new Locale(this.localeFse.expandString(methodContext.getEnvMap())));
- newValue = this.fromFma.get(methodContext.getEnvMap());
- methodContext.setLocale(localeTemp);
- } else {
- newValue = this.fromFma.get(methodContext.getEnvMap());
- }
+ newValue = this.fromFma.get(methodContext.getEnvMap());
if (Debug.verboseOn())
Debug.logVerbose("In screen getting value for field from [" + this.fromFma.toString() + "]: " + newValue, module);
} else if (!this.valueFse.isEmpty()) {
@@ -187,12 +176,7 @@ public final class SetOperation extends
if (targetClass == null) {
targetClass = MiniLangUtil.getObjectClassForConversion(newValue);
}
- 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);
- }
+ 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);
Modified: ofbiz/branches/release12.04/framework/widget/dtd/widget-form.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/dtd/widget-form.xsd?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/branches/release12.04/framework/widget/dtd/widget-form.xsd Sat Jan 11 19:41:18 2014
@@ -1678,16 +1678,6 @@ under the License.
<xs:element name="set" substitutionGroup="AllActions">
<xs:complexType>
<xs:attributeGroup ref="attlist.set"/>
- <xs:attribute type="xs:string" name="locale">
- <xs:annotation>
- <xs:documentation>
- A locale value (eg: en). The locale allows to pass values with types which are locale dependent (like Float, etc.).
- Defaults to the environment locale. Works only if a type which makes sense is also passed.
-
- Optional. Attribute types: constant, ${expression}.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.set">
Modified: ofbiz/branches/release12.04/framework/widget/dtd/widget-screen.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/dtd/widget-screen.xsd?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/widget/dtd/widget-screen.xsd (original)
+++ ofbiz/branches/release12.04/framework/widget/dtd/widget-screen.xsd Sat Jan 11 19:41:18 2014
@@ -332,16 +332,6 @@ under the License.
<xs:element name="set" substitutionGroup="AllActions">
<xs:complexType>
<xs:attributeGroup ref="attlist.set"/>
- <xs:attribute type="xs:string" name="locale">
- <xs:annotation>
- <xs:documentation>
- A locale value (eg: en). The locale allows to pass values with types which are locale dependent (like Float, etc.).
- Defaults to the environment locale. Works only if a type which makes sense is also passed.
-
- Optional. Attribute types: constant, ${expression}.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.set">
Modified: ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java (original)
+++ ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java Sat Jan 11 19:41:18 2014
@@ -33,6 +33,7 @@ import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import javolution.util.FastMap;
+import org.w3c.dom.Element;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -58,7 +59,6 @@ import org.ofbiz.minilang.method.MethodC
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.ModelService;
-import org.w3c.dom.Element;
@SuppressWarnings("serial")
public abstract class ModelWidgetAction implements Serializable {
@@ -123,7 +123,6 @@ public abstract class ModelWidgetAction
protected FlexibleStringExpander valueExdr;
protected FlexibleStringExpander defaultExdr;
protected FlexibleStringExpander globalExdr;
- protected FlexibleStringExpander localeExdr;
protected String type;
protected String toScope;
protected String fromScope;
@@ -135,7 +134,6 @@ public abstract class ModelWidgetAction
this.valueExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("value"));
this.defaultExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("default-value"));
this.globalExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("global"));
- this.localeExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("locale"));
this.type = setElement.getAttribute("type");
this.toScope = setElement.getAttribute("to-scope");
this.fromScope = setElement.getAttribute("from-scope");
@@ -188,11 +186,7 @@ public abstract class ModelWidgetAction
newValue = FastList.newInstance();
} else {
try {
- Locale locale = (Locale) context.get("locale");
- if (!this.localeExdr.isEmpty()) {
- locale = new Locale(this.globalExdr.expandString(context));
- }
- newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), locale, true);
+ newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
} catch (GeneralException e) {
String errMsg = "Could not convert field value for the field: [" + this.field.getOriginalName() + "] to the [" + this.type + "] type for the value [" + newValue + "]: " + e.toString();
Debug.logError(e, errMsg, module);
Modified: ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java (original)
+++ ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java Sat Jan 11 19:41:18 2014
@@ -116,7 +116,6 @@ public abstract class ModelFormAction {
protected FlexibleStringExpander valueExdr;
protected FlexibleStringExpander defaultExdr;
protected FlexibleStringExpander globalExdr;
- protected FlexibleStringExpander localeExdr;
protected String type;
public SetField(ModelForm modelForm, Element setElement) {
@@ -126,7 +125,6 @@ public abstract class ModelFormAction {
this.valueExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("value"));
this.defaultExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("default-value"));
this.globalExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("global"));
- this.localeExdr = FlexibleStringExpander.getInstance(setElement.getAttribute("locale"));
this.type = setElement.getAttribute("type");
if (!this.fromField.isEmpty() && !this.valueExdr.isEmpty()) {
throw new IllegalArgumentException("Cannot specify a from-field [" + setElement.getAttribute("from-field") + "] and a value [" + setElement.getAttribute("value") + "] on the set action in a screen widget");
@@ -159,11 +157,7 @@ public abstract class ModelFormAction {
newValue = FastList.newInstance();
} else {
try {
- Locale locale = (Locale) context.get("locale");
- if (!this.localeExdr.isEmpty()) {
- locale = new Locale(this.globalExdr.expandString(context));
- }
- newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), locale, true);
+ newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
} catch (GeneralException e) {
String errMsg = "Could not convert field value for the field: [" + this.field.getOriginalName() + "] to the [" + this.type + "] type for the value [" + newValue + "]: " + e.toString();
Debug.logError(e, errMsg, module);
Modified: ofbiz/branches/release12.04/specialpurpose/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/example/widget/example/ExampleScreens.xml?rev=1557449&r1=1557448&r2=1557449&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/branches/release12.04/specialpurpose/example/widget/example/ExampleScreens.xml Sat Jan 11 19:41:18 2014
@@ -165,14 +165,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleGeoLocationPointSet1"/>
- <set field="geoPoints[+0].lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1419" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4719" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1319" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4419"/>
+ <set field="geoPoints[0].lon" value="-122.1419"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4719"/>
+ <set field="geoPoints[2].lon" value="-122.1319"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="13"/>
</actions>
<widgets>
@@ -184,14 +184,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleGeoLocationPointSet2"/>
- <set field="geoPoints[+0].lat" value="37.4459" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1489" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4829" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1599" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4769" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1219" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4459"/>
+ <set field="geoPoints[0].lon" value="-122.1489"/>
+ <set field="geoPoints[+1].lat" value="37.4829"/>
+ <set field="geoPoints[1].lon" value="-122.1599"/>
+ <set field="geoPoints[+2].lat" value="37.4769"/>
+ <set field="geoPoints[2].lon" value="-122.1219"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="12"/>
</actions>
<widgets>
@@ -203,14 +203,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleGeoLocationPointSet3"/>
- <set field="geoPoints[+0].lat" value="37.4379" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1119" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4229" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1369" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4379"/>
+ <set field="geoPoints[0].lon" value="-122.1119"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4229"/>
+ <set field="geoPoints[2].lon" value="-122.1369"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="11"/>
</actions>
<widgets>
@@ -239,14 +239,14 @@ under the License.
<widgets>
<section>
<actions>
- <set field="geoPoints[+0].lat" value="37.4459" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1489" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4829" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1599" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4769" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1219" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4459"/>
+ <set field="geoPoints[0].lon" value="-122.1489"/>
+ <set field="geoPoints[+1].lat" value="37.4829"/>
+ <set field="geoPoints[1].lon" value="-122.1599"/>
+ <set field="geoPoints[+2].lat" value="37.4769"/>
+ <set field="geoPoints[2].lon" value="-122.1219"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="12"/>
<set field="geoChart.id" value="chart1"/>
<set field="geoChart.dataSourceId" value="GEOPT_GOOGLE"/>
@@ -263,14 +263,14 @@ under the License.
<section>
<actions>
<set field="geoPoints" value=""/>
- <set field="geoPoints[+0].lat" value="37.4379" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1119" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4229" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1369" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4379"/>
+ <set field="geoPoints[0].lon" value="-122.1119"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4229"/>
+ <set field="geoPoints[2].lon" value="-122.1369"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="11"/>
<set field="geoChart.id" value="chart2"/>
<set field="geoChart.dataSourceId" value="GEOPT_GOOGLE"/>
@@ -353,14 +353,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleOsmGeoLocationPointSet1"/>
- <set field="geoPoints[+0].lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1419" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4719" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1319" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4419"/>
+ <set field="geoPoints[0].lon" value="-122.1419"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4719"/>
+ <set field="geoPoints[2].lon" value="-122.1319"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="13"/>
</actions>
<widgets>
@@ -372,14 +372,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleOsmGeoLocationPointSet2"/>
- <set field="geoPoints[+0].lat" value="37.4459" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1489" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4829" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1599" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4769" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1219" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4459"/>
+ <set field="geoPoints[0].lon" value="-122.1489"/>
+ <set field="geoPoints[+1].lat" value="37.4829"/>
+ <set field="geoPoints[1].lon" value="-122.1599"/>
+ <set field="geoPoints[+2].lat" value="37.4769"/>
+ <set field="geoPoints[2].lon" value="-122.1219"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="12"/>
</actions>
<widgets>
@@ -391,14 +391,14 @@ under the License.
<section>
<actions>
<set field="tabButtonItem" value="ExampleOsmGeoLocationPointSet3"/>
- <set field="geoPoints[+0].lat" value="37.4379" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1119" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4229" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1369" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4379"/>
+ <set field="geoPoints[0].lon" value="-122.1119"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4229"/>
+ <set field="geoPoints[2].lon" value="-122.1369"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="11"/>
</actions>
<widgets>
@@ -427,14 +427,14 @@ under the License.
<widgets>
<section>
<actions>
- <set field="geoPoints[+0].lat" value="37.4459" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1489" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4829" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1599" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4769" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1219" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4459"/>
+ <set field="geoPoints[0].lon" value="-122.1489"/>
+ <set field="geoPoints[+1].lat" value="37.4829"/>
+ <set field="geoPoints[1].lon" value="-122.1599"/>
+ <set field="geoPoints[+2].lat" value="37.4769"/>
+ <set field="geoPoints[2].lon" value="-122.1219"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="12"/>
<set field="geoChart.id" value="chart1"/>
<set field="geoChart.dataSourceId" value="GEOPT_OSM"/>
@@ -451,14 +451,14 @@ under the License.
<section>
<actions>
<set field="geoPoints" value=""/>
- <set field="geoPoints[+0].lat" value="37.4379" type="Float" locale="en"/>
- <set field="geoPoints[0].lon" value="-122.1119" type="Float" locale="en"/>
- <set field="geoPoints[+1].lat" value="37.4819" type="Float" locale="en"/>
- <set field="geoPoints[1].lon" value="-122.1519" type="Float" locale="en"/>
- <set field="geoPoints[+2].lat" value="37.4229" type="Float" locale="en"/>
- <set field="geoPoints[2].lon" value="-122.1369" type="Float" locale="en"/>
- <set field="geoCenter.lat" value="37.4419" type="Float" locale="en"/>
- <set field="geoCenter.lon" value="-122.1419" type="Float" locale="en"/>
+ <set field="geoPoints[+0].lat" value="37.4379"/>
+ <set field="geoPoints[0].lon" value="-122.1119"/>
+ <set field="geoPoints[+1].lat" value="37.4819"/>
+ <set field="geoPoints[1].lon" value="-122.1519"/>
+ <set field="geoPoints[+2].lat" value="37.4229"/>
+ <set field="geoPoints[2].lon" value="-122.1369"/>
+ <set field="geoCenter.lat" value="37.4419"/>
+ <set field="geoCenter.lon" value="-122.1419"/>
<set field="geoCenter.zoom" value="11"/>
<set field="geoChart.id" value="chart2"/>
<set field="geoChart.dataSourceId" value="GEOPT_OSM"/>