You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/09/20 19:46:24 UTC
svn commit: r1173274 [11/13] - in /ofbiz/branches/jackrabbit20100709: ./
applications/accounting/config/ applications/accounting/entitydef/
applications/accounting/script/org/ofbiz/accounting/invoice/
applications/accounting/script/org/ofbiz/accounting...
Modified: ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Tue Sep 20 17:46:13 2011
@@ -165,9 +165,7 @@ public class ModelFormField {
String positionStr = fieldElement.getAttribute("position");
try {
- if (UtilValidate.isNotEmpty(positionStr)) {
- position = Integer.valueOf(positionStr);
- }
+ if (UtilValidate.isNotEmpty(positionStr)) position = Integer.valueOf(positionStr);
} catch (Exception e) {
Debug.logError(
e,
@@ -179,167 +177,97 @@ public class ModelFormField {
List<? extends Element> subElements = UtilXml.childElementList(fieldElement);
for (Element subElement : subElements) {
String subElementName = subElement.getTagName();
- if (Debug.verboseOn())
- Debug.logVerbose("Processing field " + this.name + " with type info tag " + subElementName, module);
+ if (Debug.verboseOn()) Debug.logVerbose("Processing field " + this.name + " with type info tag " + subElementName, module);
if (UtilValidate.isEmpty(subElementName)) {
this.fieldInfo = null;
this.induceFieldInfo(null); //no defaultFieldType specified here, will default to edit
- } else if ("display".equals(subElementName)) {
- this.fieldInfo = new DisplayField(subElement, this);
- } else if ("display-entity".equals(subElementName)) {
- this.fieldInfo = new DisplayEntityField(subElement, this);
- } else if ("hyperlink".equals(subElementName)) {
- this.fieldInfo = new HyperlinkField(subElement, this);
- } else if ("text".equals(subElementName)) {
- this.fieldInfo = new TextField(subElement, this);
- } else if ("textarea".equals(subElementName)) {
- this.fieldInfo = new TextareaField(subElement, this);
- } else if ("date-time".equals(subElementName)) {
- this.fieldInfo = new DateTimeField(subElement, this);
- } else if ("drop-down".equals(subElementName)) {
- this.fieldInfo = new DropDownField(subElement, this);
- } else if ("check".equals(subElementName)) {
- this.fieldInfo = new CheckField(subElement, this);
- } else if ("radio".equals(subElementName)) {
- this.fieldInfo = new RadioField(subElement, this);
- } else if ("submit".equals(subElementName)) {
- this.fieldInfo = new SubmitField(subElement, this);
- } else if ("reset".equals(subElementName)) {
- this.fieldInfo = new ResetField(subElement, this);
- } else if ("hidden".equals(subElementName)) {
- this.fieldInfo = new HiddenField(subElement, this);
- } else if ("ignored".equals(subElementName)) {
- this.fieldInfo = new IgnoredField(subElement, this);
- } else if ("text-find".equals(subElementName)) {
- this.fieldInfo = new TextFindField(subElement, this);
- } else if ("date-find".equals(subElementName)) {
- this.fieldInfo = new DateFindField(subElement, this);
- } else if ("range-find".equals(subElementName)) {
- this.fieldInfo = new RangeFindField(subElement, this);
- } else if ("lookup".equals(subElementName)) {
- this.fieldInfo = new LookupField(subElement, this);
- } else if ("file".equals(subElementName)) {
- this.fieldInfo = new FileField(subElement, this);
- } else if ("password".equals(subElementName)) {
- this.fieldInfo = new PasswordField(subElement, this);
- } else if ("image".equals(subElementName)) {
- this.fieldInfo = new ImageField(subElement, this);
- } else if ("container".equals(subElementName)) {
- this.fieldInfo = new ContainerField(subElement, this);
- } else if ("on-field-event-update-area".equals(subElementName)) {
- addOnEventUpdateArea(new UpdateArea(subElement));
- } else {
- throw new IllegalArgumentException("The field sub-element with name " + subElementName + " is not supported");
- }
+ } else if ("display".equals(subElementName)) this.fieldInfo = new DisplayField(subElement, this);
+ else if ("display-entity".equals(subElementName)) this.fieldInfo = new DisplayEntityField(subElement, this);
+ else if ("hyperlink".equals(subElementName)) this.fieldInfo = new HyperlinkField(subElement, this);
+ else if ("text".equals(subElementName)) this.fieldInfo = new TextField(subElement, this);
+ else if ("textarea".equals(subElementName)) this.fieldInfo = new TextareaField(subElement, this);
+ else if ("date-time".equals(subElementName)) this.fieldInfo = new DateTimeField(subElement, this);
+ else if ("drop-down".equals(subElementName)) this.fieldInfo = new DropDownField(subElement, this);
+ else if ("check".equals(subElementName)) this.fieldInfo = new CheckField(subElement, this);
+ else if ("radio".equals(subElementName)) this.fieldInfo = new RadioField(subElement, this);
+ else if ("submit".equals(subElementName)) this.fieldInfo = new SubmitField(subElement, this);
+ else if ("reset".equals(subElementName)) this.fieldInfo = new ResetField(subElement, this);
+ else if ("hidden".equals(subElementName)) this.fieldInfo = new HiddenField(subElement, this);
+ else if ("ignored".equals(subElementName)) this.fieldInfo = new IgnoredField(subElement, this);
+ else if ("text-find".equals(subElementName)) this.fieldInfo = new TextFindField(subElement, this);
+ else if ("date-find".equals(subElementName)) this.fieldInfo = new DateFindField(subElement, this);
+ else if ("range-find".equals(subElementName)) this.fieldInfo = new RangeFindField(subElement, this);
+ else if ("lookup".equals(subElementName)) this.fieldInfo = new LookupField(subElement, this);
+ else if ("file".equals(subElementName)) this.fieldInfo = new FileField(subElement, this);
+ else if ("password".equals(subElementName)) this.fieldInfo = new PasswordField(subElement, this);
+ else if ("image".equals(subElementName)) this.fieldInfo = new ImageField(subElement, this);
+ else if ("container".equals(subElementName)) this.fieldInfo = new ContainerField(subElement, this);
+ else if ("on-field-event-update-area".equals(subElementName)) addOnEventUpdateArea(new UpdateArea(subElement));
+ else throw new IllegalArgumentException("The field sub-element with name " + subElementName + " is not supported");
}
}
public void addOnEventUpdateArea(UpdateArea updateArea) {
// Event types are sorted as a convenience for the rendering classes
Debug.logInfo(this.modelForm.getName() + ":" + this.name + " adding UpdateArea type " + updateArea.getEventType(), module);
- if ("change".equals(updateArea.getEventType())) {
- addOnChangeUpdateArea(updateArea);
- } else if ("click".equals(updateArea.getEventType())) {
- addOnClickUpdateArea(updateArea);
- }
+ if ("change".equals(updateArea.getEventType())) addOnChangeUpdateArea(updateArea);
+ else if ("click".equals(updateArea.getEventType())) addOnClickUpdateArea(updateArea);
}
protected void addOnChangeUpdateArea(UpdateArea updateArea) {
- if (onChangeUpdateAreas == null) {
- onChangeUpdateAreas = FastList.newInstance();
- }
+ if (onChangeUpdateAreas == null) onChangeUpdateAreas = FastList.newInstance();
onChangeUpdateAreas.add(updateArea);
Debug.logInfo(this.modelForm.getName() + ":" + this.name + " onChangeUpdateAreas size = " + onChangeUpdateAreas.size(), module);
}
protected void addOnClickUpdateArea(UpdateArea updateArea) {
- if (onClickUpdateAreas == null) {
- onClickUpdateAreas = FastList.newInstance();
- }
+ if (onClickUpdateAreas == null) onClickUpdateAreas = FastList.newInstance();
onClickUpdateAreas.add(updateArea);
}
public void mergeOverrideModelFormField(ModelFormField overrideFormField) {
- if (overrideFormField == null)
- return;
+ if (overrideFormField == null) return;
+
// incorporate updates for values that are not empty in the overrideFormField
- if (UtilValidate.isNotEmpty(overrideFormField.name))
- this.name = overrideFormField.name;
- if (overrideFormField.mapAcsr != null && !overrideFormField.mapAcsr.isEmpty()) {
- //Debug.logInfo("overriding mapAcsr, old=" + (this.mapAcsr==null?"null":this.mapAcsr.getOriginalName()) + ", new=" + overrideFormField.mapAcsr.getOriginalName(), module);
- this.mapAcsr = overrideFormField.mapAcsr;
- }
- if (UtilValidate.isNotEmpty(overrideFormField.entityName))
- this.entityName = overrideFormField.entityName;
- if (UtilValidate.isNotEmpty(overrideFormField.serviceName))
- this.serviceName = overrideFormField.serviceName;
- if (overrideFormField.entryAcsr != null && !overrideFormField.entryAcsr.isEmpty())
- this.entryAcsr = overrideFormField.entryAcsr;
- if (UtilValidate.isNotEmpty(overrideFormField.parameterName))
- this.parameterName = overrideFormField.parameterName;
- if (UtilValidate.isNotEmpty(overrideFormField.fieldName))
- this.fieldName = overrideFormField.fieldName;
- if (UtilValidate.isNotEmpty(overrideFormField.attributeName))
- this.attributeName = overrideFormField.attributeName;
- if (overrideFormField.title != null && !overrideFormField.title.isEmpty()) // title="" can be used to override the original value
- this.title = overrideFormField.title;
- if (overrideFormField.tooltip != null && !overrideFormField.tooltip.isEmpty())
- this.tooltip = overrideFormField.tooltip;
- if (overrideFormField.requiredField != null)
- this.requiredField = overrideFormField.requiredField;
- if (overrideFormField.sortField != null)
- this.sortField = overrideFormField.sortField;
- if (UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle))
- this.titleAreaStyle = overrideFormField.titleAreaStyle;
- if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle))
- this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
- if (UtilValidate.isNotEmpty(overrideFormField.titleStyle))
- this.titleStyle = overrideFormField.titleStyle;
- if (UtilValidate.isNotEmpty(overrideFormField.widgetStyle))
- this.widgetStyle = overrideFormField.widgetStyle;
- if (overrideFormField.position != null)
- this.position = overrideFormField.position;
- if (UtilValidate.isNotEmpty(overrideFormField.redWhen))
- this.redWhen = overrideFormField.redWhen;
- if (UtilValidate.isNotEmpty(overrideFormField.event))
- this.event = overrideFormField.event;
- if (overrideFormField.action != null && !overrideFormField.action.isEmpty())
- this.action = overrideFormField.action;
- if (overrideFormField.useWhen != null && !overrideFormField.useWhen.isEmpty())
- this.useWhen = overrideFormField.useWhen;
- if (overrideFormField.fieldInfo != null) {
- this.setFieldInfo(overrideFormField.fieldInfo);
- }
- if (overrideFormField.fieldInfo != null) {
- this.setHeaderLink(overrideFormField.headerLink);
- }
- if (UtilValidate.isNotEmpty(overrideFormField.idName)) {
- this.idName = overrideFormField.idName;
- }
- if (overrideFormField.onChangeUpdateAreas != null) {
- this.onChangeUpdateAreas = overrideFormField.onChangeUpdateAreas;
- }
- if (overrideFormField.onClickUpdateAreas != null) {
- this.onClickUpdateAreas = overrideFormField.onClickUpdateAreas;
- }
+ if (UtilValidate.isNotEmpty(overrideFormField.name)) this.name = overrideFormField.name;
+ if (UtilValidate.isNotEmpty(overrideFormField.mapAcsr)) this.mapAcsr = overrideFormField.mapAcsr; //Debug.logInfo("overriding mapAcsr, old=" + (this.mapAcsr==null?"null":this.mapAcsr.getOriginalName()) + ", new=" + overrideFormField.mapAcsr.getOriginalName(), module);
+ if (UtilValidate.isNotEmpty(overrideFormField.entityName)) this.entityName = overrideFormField.entityName;
+ if (UtilValidate.isNotEmpty(overrideFormField.serviceName)) this.serviceName = overrideFormField.serviceName;
+ if (UtilValidate.isNotEmpty(overrideFormField.entryAcsr)) this.entryAcsr = overrideFormField.entryAcsr;
+ if (UtilValidate.isNotEmpty(overrideFormField.parameterName)) this.parameterName = overrideFormField.parameterName;
+ if (UtilValidate.isNotEmpty(overrideFormField.fieldName)) this.fieldName = overrideFormField.fieldName;
+ if (UtilValidate.isNotEmpty(overrideFormField.attributeName)) this.attributeName = overrideFormField.attributeName;
+ if (UtilValidate.isNotEmpty(overrideFormField.title)) this.title = overrideFormField.title; // title="" can be used to override the original value
+ if (UtilValidate.isNotEmpty(overrideFormField.tooltip)) this.tooltip = overrideFormField.tooltip;
+ if (overrideFormField.requiredField != null) this.requiredField = overrideFormField.requiredField;
+ if (overrideFormField.sortField != null) this.sortField = overrideFormField.sortField;
+ if (UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle)) this.titleAreaStyle = overrideFormField.titleAreaStyle;
+ if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle)) this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
+ if (UtilValidate.isNotEmpty(overrideFormField.titleStyle)) this.titleStyle = overrideFormField.titleStyle;
+ if (UtilValidate.isNotEmpty(overrideFormField.widgetStyle)) this.widgetStyle = overrideFormField.widgetStyle;
+ if (overrideFormField.position != null) this.position = overrideFormField.position;
+ if (UtilValidate.isNotEmpty(overrideFormField.redWhen)) this.redWhen = overrideFormField.redWhen;
+ if (UtilValidate.isNotEmpty(overrideFormField.event)) this.event = overrideFormField.event;
+ if (UtilValidate.isNotEmpty(overrideFormField.action)) this.action = overrideFormField.action;
+ if (UtilValidate.isNotEmpty(overrideFormField.useWhen))this.useWhen = overrideFormField.useWhen;
+ if (overrideFormField.fieldInfo != null) this.setFieldInfo(overrideFormField.fieldInfo);
+ if (overrideFormField.headerLink != null) this.setHeaderLink(overrideFormField.headerLink);
+ if (UtilValidate.isNotEmpty(overrideFormField.idName)) this.idName = overrideFormField.idName;
+ if (overrideFormField.onChangeUpdateAreas != null) this.onChangeUpdateAreas = overrideFormField.onChangeUpdateAreas;
+ if (overrideFormField.onClickUpdateAreas != null) this.onClickUpdateAreas = overrideFormField.onClickUpdateAreas;
this.encodeOutput = overrideFormField.encodeOutput;
}
public boolean induceFieldInfo(String defaultFieldType) {
- if (this.induceFieldInfoFromEntityField(defaultFieldType)) {
- return true;
- }
- if (this.induceFieldInfoFromServiceParam(defaultFieldType)) {
- return true;
- }
+ if (this.induceFieldInfoFromEntityField(defaultFieldType)) return true;
+ if (this.induceFieldInfoFromServiceParam(defaultFieldType)) return true;
return false;
}
public boolean induceFieldInfoFromServiceParam(String defaultFieldType) {
- if (UtilValidate.isEmpty(this.getServiceName()) || UtilValidate.isEmpty(this.getAttributeName())) {
- return false;
- }
+ if (UtilValidate.isEmpty(this.getServiceName()) || UtilValidate.isEmpty(this.getAttributeName())) return false;
+
DispatchContext dispatchContext = this.getModelForm().dispatchContext;
try {
ModelService modelService = dispatchContext.getModelService(this.getServiceName());
@@ -365,9 +293,7 @@ public class ModelFormField {
}
public boolean induceFieldInfoFromServiceParam(ModelService modelService, ModelParam modelParam, String defaultFieldType) {
- if (modelService == null || modelParam == null) {
- return false;
- }
+ if (modelService == null || modelParam == null) return false;
this.serviceName = modelService.name;
this.attributeName = modelParam.name;
@@ -430,9 +356,8 @@ public class ModelFormField {
}
public boolean induceFieldInfoFromEntityField(String defaultFieldType) {
- if (UtilValidate.isEmpty(this.getEntityName()) || UtilValidate.isEmpty(this.getFieldName())) {
- return false;
- }
+ if (UtilValidate.isEmpty(this.getEntityName()) || UtilValidate.isEmpty(this.getFieldName())) return false;
+
ModelReader entityModelReader = this.getModelForm().entityModelReader;
try {
ModelEntity modelEntity = entityModelReader.getModelEntity(this.getEntityName());
@@ -451,9 +376,7 @@ public class ModelFormField {
}
public boolean induceFieldInfoFromEntityField(ModelEntity modelEntity, ModelField modelField, String defaultFieldType) {
- if (modelEntity == null || modelField == null) {
- return false;
- }
+ if (modelEntity == null || modelField == null) return false;
this.entityName = modelEntity.getEntityName();
this.fieldName = modelField.getName();
@@ -620,8 +543,7 @@ public class ModelFormField {
* @param fieldInfo
*/
public void setFieldInfo(FieldInfo fieldInfo) {
- if (fieldInfo == null)
- return;
+ if (fieldInfo == null) return;
// field info is a little different, check source for priority
if (this.fieldInfo == null || (fieldInfo.getFieldSource() <= this.fieldInfo.getFieldSource())) {
@@ -638,27 +560,18 @@ public class ModelFormField {
* @return returns the name of the Service Attribute
*/
public String getAttributeName() {
- if (UtilValidate.isNotEmpty(this.attributeName)) {
- return this.attributeName;
- } else {
- return this.name;
- }
+ if (UtilValidate.isNotEmpty(this.attributeName)) return this.attributeName;
+ return this.name;
}
public String getEntityName() {
- if (UtilValidate.isNotEmpty(this.entityName)) {
- return this.entityName;
- } else {
- return this.modelForm.getDefaultEntityName();
- }
+ if (UtilValidate.isNotEmpty(this.entityName)) return this.entityName;
+ return this.modelForm.getDefaultEntityName();
}
public String getEntryName() {
- if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
- return this.entryAcsr.getOriginalName();
- } else {
- return this.name;
- }
+ if (UtilValidate.isNotEmpty(this.entryAcsr)) return this.entryAcsr.getOriginalName();
+ return this.name;
}
/**
@@ -713,7 +626,7 @@ public class ModelFormField {
dataMapIsContext = true;
}
Object retVal = null;
- if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
+ if (UtilValidate.isNotEmpty(this.entryAcsr)) {
//Debug.logInfo("Getting entry, using entryAcsr for field " + this.getName() + " of form " + this.modelForm.getName(), module);
if (dataMap instanceof GenericEntity) {
GenericEntity genEnt = (GenericEntity) dataMap;
@@ -735,11 +648,8 @@ public class ModelFormField {
if (dataMapIsContext && retVal == null && !Boolean.FALSE.equals(useRequestParameters)) {
Map<String, ? extends Object> parameters = UtilGenerics.checkMap(context.get("parameters"));
if (parameters != null) {
- if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
- retVal = this.entryAcsr.get(parameters);
- } else {
- retVal = parameters.get(this.name);
- }
+ if (UtilValidate.isNotEmpty(this.entryAcsr)) retVal = this.entryAcsr.get(parameters);
+ else retVal = parameters.get(this.name);
}
}
@@ -771,29 +681,24 @@ public class ModelFormField {
if (this.getEncodeOutput() && returnValue != null) {
StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
- if (simpleEncoder != null) {
- returnValue = simpleEncoder.encode(returnValue);
- }
+ if (simpleEncoder != null) returnValue = simpleEncoder.encode(returnValue);
}
return returnValue;
}
public Map<String, ? extends Object> getMap(Map<String, ? extends Object> context) {
- if (this.mapAcsr == null || this.mapAcsr.isEmpty()) {
- //Debug.logInfo("Getting Map from default of the form because of no mapAcsr for field " + this.getName(), module);
- return this.modelForm.getDefaultMap(context);
- } else {
- // Debug.logInfo("Getting Map from mapAcsr for field " + this.getName() + ", map-name=" + mapAcsr.getOriginalName() + ", context type=" + context.getClass().toString(), module);
- Map<String, ? extends Object> result = null;
- try {
- result = mapAcsr.get(context);
- } catch (java.lang.ClassCastException e) {
- String errMsg = "Got an unexpected object type (not a Map) for map-name [" + mapAcsr.getOriginalName() + "] in field with name [" + this.getName() + "]: " + e.getMessage();
- Debug.logError(errMsg, module);
- throw new ClassCastException(errMsg);
- }
- return result;
+ if (UtilValidate.isEmpty(this.mapAcsr)) return this.modelForm.getDefaultMap(context); //Debug.logInfo("Getting Map from default of the form because of no mapAcsr for field " + this.getName(), module);
+
+ // Debug.logInfo("Getting Map from mapAcsr for field " + this.getName() + ", map-name=" + mapAcsr.getOriginalName() + ", context type=" + context.getClass().toString(), module);
+ Map<String, ? extends Object> result = null;
+ try {
+ result = mapAcsr.get(context);
+ } catch (java.lang.ClassCastException e) {
+ String errMsg = "Got an unexpected object type (not a Map) for map-name [" + mapAcsr.getOriginalName() + "] in field with name [" + this.getName() + "]: " + e.getMessage();
+ Debug.logError(errMsg, module);
+ throw new ClassCastException(errMsg);
}
+ return result;
}
/**
@@ -804,11 +709,8 @@ public class ModelFormField {
* @return return the name of the Entity Field that corresponds with this field
*/
public String getFieldName() {
- if (UtilValidate.isNotEmpty(this.fieldName)) {
- return this.fieldName;
- } else {
+ if (UtilValidate.isNotEmpty(this.fieldName)) return this.fieldName;
return this.name;
- }
}
/** Get the name of the Map in the form context that contains the entry,
@@ -820,11 +722,8 @@ public class ModelFormField {
* @return returns the name of the Map in the form context that contains the entry
*/
public String getMapName() {
- if (this.mapAcsr != null && !this.mapAcsr.isEmpty()) {
- return this.mapAcsr.getOriginalName();
- } else {
- return this.modelForm.getDefaultMapName();
- }
+ if (UtilValidate.isNotEmpty(this.mapAcsr)) return this.mapAcsr.getOriginalName();
+ return this.modelForm.getDefaultMapName();
}
public String getName() {
@@ -839,11 +738,8 @@ public class ModelFormField {
*/
public String getParameterName(Map<String, ? extends Object> context) {
String baseName;
- if (UtilValidate.isNotEmpty(this.parameterName)) {
- baseName = this.parameterName;
- } else {
- baseName = this.name;
- }
+ if (UtilValidate.isNotEmpty(this.parameterName)) baseName = this.parameterName;
+ else baseName = this.name;
Integer itemIndex = (Integer) context.get("itemIndex");
if (itemIndex != null && "multi".equals(this.modelForm.getType())) {
@@ -854,11 +750,8 @@ public class ModelFormField {
}
public int getPosition() {
- if (this.position == null) {
- return 1;
- } else {
- return position.intValue();
- }
+ if (this.position == null) return 1;
+ return position.intValue();
}
public String getRedWhen() {
@@ -871,11 +764,8 @@ public class ModelFormField {
}
public String getAction(Map<String, ? extends Object> context) {
- if (this.action != null && !this.action.isEmpty()) {
- return action.expandString(context);
- } else {
- return null;
- }
+ if (UtilValidate.isNotEmpty(this.action)) return action.expandString(context);
+ return null;
}
/**
@@ -892,9 +782,7 @@ public class ModelFormField {
String redCondition = this.redWhen;
- if ("never".equals(redCondition)) {
- return false;
- }
+ if ("never".equals(redCondition)) return false;
// for performance resaons we check this first, most fields will be eliminated here and the valueOfs will not be necessary
if (UtilValidate.isEmpty(redCondition) || "by-name".equals(redCondition)) {
@@ -994,113 +882,84 @@ public class ModelFormField {
}
public String getServiceName() {
- if (UtilValidate.isNotEmpty(this.serviceName)) {
- return this.serviceName;
- } else {
- return this.modelForm.getDefaultServiceName();
- }
+ if (UtilValidate.isNotEmpty(this.serviceName)) return this.serviceName;
+ return this.modelForm.getDefaultServiceName();
}
public String getTitle(Map<String, Object> context) {
- if (this.title != null && !this.title.isEmpty()) {
- return title.expandString(context);
- } else {
- // create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
- if (UtilValidate.isEmpty(this.name)) {
- // this should never happen, ie name is required
- return "";
- }
+ if (UtilValidate.isNotEmpty(this.title)) return title.expandString(context);
+
+ // create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
+ if (UtilValidate.isEmpty(this.name)) return ""; // this should never happen, ie name is required
- // search for a localized label for the field's name
- Map<String, String> uiLabelMap = UtilGenerics.checkMap(context.get("uiLabelMap"));
- if (uiLabelMap != null) {
- String titleFieldName = "FormFieldTitle_" + this.name;
- String localizedName = uiLabelMap.get(titleFieldName);
- if (!localizedName.equals(titleFieldName)) {
- return localizedName;
- }
- } else {
- Debug.logWarning("Could not find uiLabelMap in context while rendering form " + this.modelForm.getName(), module);
+ // search for a localized label for the field's name
+ Map<String, String> uiLabelMap = UtilGenerics.checkMap(context.get("uiLabelMap"));
+ if (uiLabelMap != null) {
+ String titleFieldName = "FormFieldTitle_" + this.name;
+ String localizedName = uiLabelMap.get(titleFieldName);
+ if (!localizedName.equals(titleFieldName)) {
+ return localizedName;
}
+ } else {
+ Debug.logWarning("Could not find uiLabelMap in context while rendering form " + this.modelForm.getName(), module);
+ }
- // create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
- StringBuilder autoTitlewriter = new StringBuilder();
+ // create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
+ StringBuilder autoTitlewriter = new StringBuilder();
- // always use upper case first letter...
- autoTitlewriter.append(Character.toUpperCase(this.name.charAt(0)));
+ // always use upper case first letter...
+ autoTitlewriter.append(Character.toUpperCase(this.name.charAt(0)));
- // just put spaces before the upper case letters
- for (int i = 1; i < this.name.length(); i++) {
- char curChar = this.name.charAt(i);
- if (Character.isUpperCase(curChar)) {
- autoTitlewriter.append(' ');
- }
- autoTitlewriter.append(curChar);
+ // just put spaces before the upper case letters
+ for (int i = 1; i < this.name.length(); i++) {
+ char curChar = this.name.charAt(i);
+ if (Character.isUpperCase(curChar)) {
+ autoTitlewriter.append(' ');
}
-
- return autoTitlewriter.toString();
+ autoTitlewriter.append(curChar);
}
+
+ return autoTitlewriter.toString();
}
public String getTitleAreaStyle() {
- if (UtilValidate.isNotEmpty(this.titleAreaStyle)) {
- return this.titleAreaStyle;
- } else {
- return this.modelForm.getDefaultTitleAreaStyle();
- }
+ if (UtilValidate.isNotEmpty(this.titleAreaStyle)) return this.titleAreaStyle;
+ return this.modelForm.getDefaultTitleAreaStyle();
}
public String getTitleStyle() {
- if (UtilValidate.isNotEmpty(this.titleStyle)) {
- return this.titleStyle;
- } else {
- return this.modelForm.getDefaultTitleStyle();
- }
+ if (UtilValidate.isNotEmpty(this.titleStyle)) return this.titleStyle;
+ return this.modelForm.getDefaultTitleStyle();
}
public String getRequiredFieldStyle() {
- if (UtilValidate.isNotEmpty(this.requiredFieldStyle)) {
- return this.requiredFieldStyle;
- } else {
- return this.modelForm.getDefaultRequiredFieldStyle();
- }
+ if (UtilValidate.isNotEmpty(this.requiredFieldStyle)) return this.requiredFieldStyle;
+ return this.modelForm.getDefaultRequiredFieldStyle();
}
public String getSortFieldStyle() {
- if (UtilValidate.isNotEmpty(this.sortFieldStyle)) {
- return this.sortFieldStyle;
- }
+ if (UtilValidate.isNotEmpty(this.sortFieldStyle)) return this.sortFieldStyle;
return this.modelForm.getDefaultSortFieldStyle();
}
public String getSortFieldStyleAsc() {
- if (UtilValidate.isNotEmpty(this.sortFieldAscStyle)) {
- return this.sortFieldAscStyle;
- }
+ if (UtilValidate.isNotEmpty(this.sortFieldAscStyle)) return this.sortFieldAscStyle;
return this.modelForm.getDefaultSortFieldAscStyle();
}
public String getSortFieldStyleDesc() {
- if (UtilValidate.isNotEmpty(this.sortFieldDescStyle)) {
- return this.sortFieldDescStyle;
- }
+ if (UtilValidate.isNotEmpty(this.sortFieldDescStyle)) return this.sortFieldDescStyle;
return this.modelForm.getDefaultSortFieldDescStyle();
}
public String getTooltip(Map<String, Object> context) {
- if (tooltip != null && !tooltip.isEmpty()) {
- return tooltip.expandString(context);
- } else {
- return "";
- }
+ if (UtilValidate.isNotEmpty(tooltip)) return tooltip.expandString(context);
+ return "";
}
public String getUseWhen(Map<String, Object> context) {
- if (this.useWhen != null && !this.useWhen.isEmpty()) {
- return this.useWhen.expandString(context);
- } else {
- return "";
- }
+ if (UtilValidate.isNotEmpty(this.useWhen)) return this.useWhen.expandString(context);
+ return "";
}
public boolean getEncodeOutput() {
@@ -1108,11 +967,8 @@ public class ModelFormField {
}
public String getIdName() {
- if (UtilValidate.isNotEmpty(idName)) {
- return idName;
- } else {
- return this.modelForm.getName() + "_" + this.getFieldName();
- }
+ if (UtilValidate.isNotEmpty(idName)) return idName;
+ return this.modelForm.getName() + "_" + this.getFieldName();
}
public String getCurrentContainerId(Map<String, Object> context) {
@@ -1155,30 +1011,28 @@ public class ModelFormField {
public boolean shouldUse(Map<String, Object> context) {
String useWhenStr = this.getUseWhen(context);
- if (UtilValidate.isEmpty(useWhenStr)) {
- return true;
- } else {
- try {
- Interpreter bsh = this.modelForm.getBshInterpreter(context);
- Object retVal = bsh.eval(StringUtil.convertOperatorSubstitutions(useWhenStr));
- boolean condTrue = false;
- // retVal should be a Boolean, if not something weird is up...
- if (retVal instanceof Boolean) {
- Boolean boolVal = (Boolean) retVal;
- condTrue = boolVal.booleanValue();
- } else {
- throw new IllegalArgumentException("Return value from use-when condition eval was not a Boolean: "
- + (retVal != null ? retVal.getClass().getName() : "null") + " [" + retVal + "] on the field " + this.name + " of form " + this.modelForm.getName());
- }
-
- return condTrue;
- } catch (EvalError e) {
- String errMsg = "Error evaluating BeanShell use-when condition [" + useWhenStr + "] on the field "
- + this.name + " of form " + this.modelForm.getName() + ": " + e.toString();
- Debug.logError(e, errMsg, module);
- //Debug.logError("For use-when eval error context is: " + context, module);
- throw new IllegalArgumentException(errMsg);
- }
+ if (UtilValidate.isEmpty(useWhenStr)) return true;
+
+ try {
+ Interpreter bsh = this.modelForm.getBshInterpreter(context);
+ Object retVal = bsh.eval(StringUtil.convertOperatorSubstitutions(useWhenStr));
+ boolean condTrue = false;
+ // retVal should be a Boolean, if not something weird is up...
+ if (retVal instanceof Boolean) {
+ Boolean boolVal = (Boolean) retVal;
+ condTrue = boolVal.booleanValue();
+ } else {
+ throw new IllegalArgumentException("Return value from use-when condition eval was not a Boolean: "
+ + (retVal != null ? retVal.getClass().getName() : "null") + " [" + retVal + "] on the field " + this.name + " of form " + this.modelForm.getName());
+ }
+
+ return condTrue;
+ } catch (EvalError e) {
+ String errMsg = "Error evaluating BeanShell use-when condition [" + useWhenStr + "] on the field "
+ + this.name + " of form " + this.modelForm.getName() + ": " + e.toString();
+ Debug.logError(e, errMsg, module);
+ //Debug.logError("For use-when eval error context is: " + context, module);
+ throw new IllegalArgumentException(errMsg);
}
}
@@ -1193,27 +1047,18 @@ public class ModelFormField {
}
public String getWidgetAreaStyle() {
- if (UtilValidate.isNotEmpty(this.widgetAreaStyle)) {
- return this.widgetAreaStyle;
- } else {
- return this.modelForm.getDefaultWidgetAreaStyle();
- }
+ if (UtilValidate.isNotEmpty(this.widgetAreaStyle)) return this.widgetAreaStyle;
+ return this.modelForm.getDefaultWidgetAreaStyle();
}
public String getWidgetStyle() {
- if (UtilValidate.isNotEmpty(this.widgetStyle)) {
- return this.widgetStyle;
- } else {
- return this.modelForm.getDefaultWidgetStyle();
- }
+ if (UtilValidate.isNotEmpty(this.widgetStyle)) return this.widgetStyle;
+ return this.modelForm.getDefaultWidgetStyle();
}
public String getTooltipStyle() {
- if (UtilValidate.isNotEmpty(this.tooltipStyle)) {
- return this.tooltipStyle;
- } else {
- return this.modelForm.getDefaultTooltipStyle();
- }
+ if (UtilValidate.isNotEmpty(this.tooltipStyle)) return this.tooltipStyle;
+ return this.modelForm.getDefaultTooltipStyle();
}
/**
@@ -1556,13 +1401,9 @@ public class ModelFormField {
}
public static String getDescriptionForOptionKey(String key, List<OptionValue> allOptionValues) {
- if (UtilValidate.isEmpty(key)) {
- return "";
- }
+ if (UtilValidate.isEmpty(key)) return "";
- if (UtilValidate.isEmpty(allOptionValues)) {
- return key;
- }
+ if (UtilValidate.isEmpty(allOptionValues)) return key;
for (OptionValue optionValue: allOptionValues) {
if (key.equals(optionValue.getKey())) {
@@ -1731,12 +1572,8 @@ public class ModelFormField {
}
public String getKeyFieldName() {
- if (UtilValidate.isNotEmpty(this.keyFieldName)) {
- return this.keyFieldName;
- } else {
- // get the modelFormField fieldName
- return this.fieldInfo.getModelFormField().getFieldName();
- }
+ if (UtilValidate.isNotEmpty(this.keyFieldName)) return this.keyFieldName;
+ return this.fieldInfo.getModelFormField().getFieldName(); // get the modelFormField fieldName
}
@Override
@@ -2118,26 +1955,16 @@ public class ModelFormField {
}
public String getImageLocation(Map<String, Object> context){
- if (this.imageLocation != null) {
- return this.imageLocation.expandString(context);
- } else {
- return "";
- }
+ if (this.imageLocation != null) return this.imageLocation.expandString(context);
+ return "";
}
public String getDescription(Map<String, Object> context) {
String retVal = null;
- if (this.description != null && !this.description.isEmpty()) {
- retVal = this.description.expandString(context);
- if (retVal != null && this.getModelFormField().getEncodeOutput()) {
- StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
- if (simpleEncoder != null) {
- retVal = simpleEncoder.encode(retVal);
- }
- }
- } else {
- retVal = this.modelFormField.getEntry(context);
- }
+ // Don't replace by UtilValidate.isNotEmpty: this.description is a FlexibleStringExpander and issues occur
+ if (UtilValidate.isNotEmpty(this.description)) retVal = this.description.expandString(context);
+ else retVal = this.modelFormField.getEntry(context);
+
if (UtilValidate.isEmpty(retVal)) {
retVal = this.getDefaultValue(context);
} else if ("currency".equals(type)) {
@@ -2145,9 +1972,7 @@ public class ModelFormField {
Locale locale = (Locale) context.get("locale");
if (locale == null) locale = Locale.getDefault();
String isoCode = null;
- if (this.currency != null && !this.currency.isEmpty()) {
- isoCode = this.currency.expandString(context);
- }
+ if (UtilValidate.isNotEmpty(this.currency)) isoCode = this.currency.expandString(context);
try {
BigDecimal parsedRetVal = (BigDecimal) ObjectType.simpleTypeConvert(retVal, "BigDecimal", null, null, locale, true);
@@ -2219,6 +2044,13 @@ public class ModelFormField {
throw new IllegalArgumentException(errMsg);
}
}
+ // Don't replace by UtilValidate.isNotEmpty: this.description is a FlexibleStringExpander and issues occur
+ if (UtilValidate.isNotEmpty(this.description) && retVal != null && this.getModelFormField().getEncodeOutput()) {
+ StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
+ if (simpleEncoder != null) {
+ retVal = simpleEncoder.encode(retVal);
+ }
+ }
return retVal;
}
@@ -2308,6 +2140,7 @@ public class ModelFormField {
this.cache = !"false".equals(element.getAttribute("cache"));
this.size = element.getAttribute("size");
+ // Don't replace by UtilValidate.isNotEmpty: this.description is a FlexibleStringExpander and issues occur
if (this.description == null || this.description.isEmpty()) {
this.setDescription("${description}");
}
@@ -2325,9 +2158,8 @@ public class ModelFormField {
// rather than using the context to expand the string, lookup the given entity and use it to expand the string
GenericValue value = null;
String fieldKey = this.keyFieldName;
- if (UtilValidate.isEmpty(fieldKey)) {
- fieldKey = this.modelFormField.fieldName;
- }
+ if (UtilValidate.isEmpty(fieldKey)) fieldKey = this.modelFormField.fieldName;
+
Delegator delegator = WidgetWorker.getDelegator(context);
String fieldValue = modelFormField.getEntry(context);
try {
@@ -2348,12 +2180,8 @@ public class ModelFormField {
retVal = this.description.expandString(localContext, locale);
}
// try to get the entry for the field if description doesn't expand to anything
- if (UtilValidate.isEmpty(retVal)) {
- retVal = fieldValue;
- }
- if (UtilValidate.isEmpty(retVal)) {
- retVal = "";
- }
+ if (UtilValidate.isEmpty(retVal)) retVal = fieldValue;
+ if (UtilValidate.isEmpty(retVal)) retVal = "";
return retVal;
}
@@ -2432,10 +2260,9 @@ public class ModelFormField {
public String getConfirmation(Map<String, Object> context) {
String message = getConfirmationMsg(context);
- if (UtilValidate.isNotEmpty(message)) {
- return message;
- }
- else if (getRequestConfirmation()) {
+ if (UtilValidate.isNotEmpty(message)) return message;
+
+ if (getRequestConfirmation()) {
String defaultMessage = UtilProperties.getPropertyValue("general", "default.confirmation.message", "${uiLabelMap.CommonConfirm}");
setConfirmationMsg(defaultMessage);
return getConfirmationMsg(context);
@@ -2452,11 +2279,8 @@ public class ModelFormField {
}
public String getTargetType() {
- if (UtilValidate.isNotEmpty(this.targetType)) {
- return this.targetType;
- } else {
- return HyperlinkField.DEFAULT_TARGET_TYPE;
- }
+ if (UtilValidate.isNotEmpty(this.targetType)) return this.targetType;
+ return HyperlinkField.DEFAULT_TARGET_TYPE;
}
public String getTargetWindow(Map<String, Object> context) {
@@ -2601,11 +2425,8 @@ public class ModelFormField {
}
public String getTargetType() {
- if (UtilValidate.isNotEmpty(this.targetType)) {
- return this.targetType;
- } else {
- return HyperlinkField.DEFAULT_TARGET_TYPE;
- }
+ if (UtilValidate.isNotEmpty(this.targetType)) return this.targetType;
+ return HyperlinkField.DEFAULT_TARGET_TYPE;
}
public String getDescription(Map<String, Object> context) {
@@ -2668,10 +2489,9 @@ public class ModelFormField {
public String getConfirmation(Map<String, Object> context) {
String message = getConfirmationMsg(context);
- if (UtilValidate.isNotEmpty(message)) {
- return message;
- }
- else if (getRequestConfirmation()) {
+ if (UtilValidate.isNotEmpty(message)) return message;
+
+ if (getRequestConfirmation()) {
String defaultMessage = UtilProperties.getPropertyValue("general", "default.confirmation.message", "${uiLabelMap.CommonConfirm}");
setConfirmationMsg(defaultMessage);
return getConfirmationMsg(context);
@@ -3128,12 +2948,8 @@ public class ModelFormField {
inputMethod = element.getAttribute("input-method");
clock = element.getAttribute("clock");
mask = element.getAttribute("mask");
- if (UtilValidate.isNotEmpty(element.getAttribute("step"))) {
- this.setStep(element.getAttribute("step"));
- }
- else {
- this.setStep("1");
- }
+ if (UtilValidate.isNotEmpty(element.getAttribute("step"))) this.setStep(element.getAttribute("step"));
+ else this.setStep("1");
}
@Override
@@ -3201,17 +3017,11 @@ public class ModelFormField {
* @return Default value string for date-time
*/
public String getDefaultDateTimeString(Map<String, Object> context) {
- if (this.defaultValue != null && !this.defaultValue.isEmpty()) {
- return this.getDefaultValue(context);
- }
+ if (UtilValidate.isNotEmpty(this.defaultValue)) return this.getDefaultValue(context);
- if ("date".equals(this.type)) {
- return (new java.sql.Date(System.currentTimeMillis())).toString();
- } else if ("time".equals(this.type)) {
- return (new java.sql.Time(System.currentTimeMillis())).toString();
- } else {
- return UtilDateTime.nowTimestamp().toString();
- }
+ if ("date".equals(this.type)) return (new java.sql.Date(System.currentTimeMillis())).toString();
+ else if ("time".equals(this.type)) return (new java.sql.Time(System.currentTimeMillis())).toString();
+ else return UtilDateTime.nowTimestamp().toString();
}
}
@@ -3290,18 +3100,13 @@ public class ModelFormField {
}
public String getCurrent() {
- if (UtilValidate.isEmpty(this.current)) {
- return "first-in-list";
- } else {
- return this.current;
- }
+ if (UtilValidate.isEmpty(this.current)) return "first-in-list";
+ return this.current;
}
public String getCurrentDescription(Map<String, Object> context) {
- if (this.currentDescription == null)
- return null;
- else
- return this.currentDescription.expandString(context);
+ if (this.currentDescription == null) return null;
+ return this.currentDescription.expandString(context);
}
public void setAllowEmpty(boolean b) {
@@ -3351,11 +3156,8 @@ public class ModelFormField {
*/
public String getParameterNameOther(Map<String, Object> context) {
String baseName;
- if (UtilValidate.isNotEmpty(this.modelFormField.parameterName)) {
- baseName = this.modelFormField.parameterName;
- } else {
- baseName = this.modelFormField.name;
- }
+ if (UtilValidate.isNotEmpty(this.modelFormField.parameterName)) baseName = this.modelFormField.parameterName;
+ else baseName = this.modelFormField.name;
baseName += "_OTHER";
Integer itemIndex = (Integer) context.get("itemIndex");
@@ -3419,11 +3221,8 @@ public class ModelFormField {
public Boolean isAllChecked(Map<String, Object> context) {
String allCheckedStr = this.allChecked.expandString(context);
- if (UtilValidate.isNotEmpty(allCheckedStr)) {
- return Boolean.valueOf("true".equals(allCheckedStr));
- } else {
- return null;
- }
+ if (UtilValidate.isNotEmpty(allCheckedStr)) return Boolean.valueOf("true".equals(allCheckedStr));
+ else return null;
}
}
@@ -3478,9 +3277,7 @@ public class ModelFormField {
public String getConfirmation(Map<String, Object> context) {
String message = getConfirmationMsg(context);
- if (UtilValidate.isNotEmpty(message)) {
- return message;
- }
+ if (UtilValidate.isNotEmpty(message)) return message;
else if (getRequestConfirmation()) {
String defaultMessage = UtilProperties.getPropertyValue("general", "default.confirmation.message", "${uiLabelMap.CommonConfirm}");
setConfirmationMsg(defaultMessage);
@@ -3566,7 +3363,7 @@ public class ModelFormField {
}
public String getValue(Map<String, Object> context) {
- if (this.value != null && !this.value.isEmpty()) {
+ if (UtilValidate.isNotEmpty(this.value)) {
String valueEnc = this.value.expandString(context);
StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
if (simpleEncoder != null) {
@@ -3961,11 +3758,8 @@ public class ModelFormField {
}
public String getValue(Map<String, Object> context) {
- if (this.value != null && !this.value.isEmpty()) {
- return this.value.expandString(context);
- } else {
- return modelFormField.getEntry(context);
- }
+ if (UtilValidate.isNotEmpty(this.value)) return this.value.expandString(context);
+ return modelFormField.getEntry(context);
}
public void setValue(String string) {
@@ -3973,11 +3767,9 @@ public class ModelFormField {
}
public String getDescription(Map<String, Object> context) {
- if (this.description != null && !this.description.isEmpty()) {
- return this.description.expandString(context);
- } else {
- return "";
- }
+ // Don't replace by UtilValidate.isNotEmpty: this.description is a FlexibleStringExpander and issues occur
+ if (UtilValidate.isNotEmpty(this.description)) return this.description.expandString(context);
+ return "";
}
public void setDescription(String description) {
@@ -3985,11 +3777,8 @@ public class ModelFormField {
}
public String getAlternate(Map<String, Object> context) {
- if (this.alternate != null && !this.alternate.isEmpty()) {
- return this.alternate.expandString(context);
- } else {
- return "";
- }
+ if (UtilValidate.isNotEmpty(this.alternate)) return this.alternate.expandString(context);
+ return "";
}
public void setAlternate(String alternate) {
Modified: ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java (original)
+++ ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java Tue Sep 20 17:46:13 2011
@@ -240,9 +240,9 @@ public class ModelMenuItem {
this.entityName = overrideMenuItem.entityName;
if (UtilValidate.isNotEmpty(overrideMenuItem.parentPortalPageId))
this.parentPortalPageId = overrideMenuItem.parentPortalPageId;
- if (overrideMenuItem.title != null && !overrideMenuItem.title.isEmpty())
+ if (UtilValidate.isNotEmpty(overrideMenuItem.title))
this.title = overrideMenuItem.title;
- if (overrideMenuItem.tooltip != null && !overrideMenuItem.tooltip.isEmpty())
+ if (UtilValidate.isNotEmpty(overrideMenuItem.tooltip))
this.tooltip = overrideMenuItem.tooltip;
if (UtilValidate.isNotEmpty(overrideMenuItem.titleStyle))
this.titleStyle = overrideMenuItem.titleStyle;
@@ -388,7 +388,7 @@ public class ModelMenuItem {
}
public String getTooltip(Map<String, Object> context) {
- if (tooltip != null && !tooltip.isEmpty()) {
+ if (UtilValidate.isNotEmpty(tooltip)) {
return tooltip.expandString(context);
} else {
return "";
Modified: ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl Tue Sep 20 17:46:13 2011
@@ -296,11 +296,17 @@ ${item.description}</span>
<#macro renderSingleFormFieldTitle></#macro>
-<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit>
+<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name viewIndexField viewSizeField viewIndex viewSize useRowSubmit>
<form method="post" action="${linkUrl}"<#if formType=="upload"> enctype="multipart/form-data"</#if><#if targetWindow?has_content> target="${targetWindow}"</#if><#if containerId?has_content> id="${containerId}"</#if> class=<#if containerStyle?has_content>"${containerStyle}"<#else>"basic-form"</#if> onsubmit="javascript:submitFormDisableSubmits(this)"<#if autocomplete?has_content> autocomplete="${autocomplete}"</#if> name="${name}"><#lt/>
<#if useRowSubmit?has_content && useRowSubmit>
<input type="hidden" name="_useRowSubmit" value="Y"/>
+ <#if linkUrl?index_of("VIEW_INDEX") <= 0 && linkUrl?index_of(viewIndexField) <= 0>
+ <input type="hidden" name="${viewIndexField}" value="${viewIndex}"/>
+ </#if>
+ <#if linkUrl?index_of("VIEW_SIZE") <= 0 && linkUrl?index_of(viewSizeField) <= 0>
+ <input type="hidden" name="${viewSizeField}" value="${viewSize}"/>
+ </#if>
</#if>
</#macro>
<#macro renderFormClose focusFieldName formName containerId hasRequiredField>
Modified: ofbiz/branches/jackrabbit20100709/ij.ofbiz
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/ij.ofbiz?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/ij.ofbiz (original)
+++ ofbiz/branches/jackrabbit20100709/ij.ofbiz Tue Sep 20 17:46:13 2011
@@ -23,7 +23,7 @@ HM='-Dderby.system.home=runtime/data/der
PR='-Dij.protocol=jdbc:derby:'
DB='-Dij.database=ofbiz;create=true'
EE='framework/entity/lib/jdbc'
-CP="-cp $EE/derby-10.6.1.0.jar:$EE/derbytools-10.6.1.0.jar"
+CP="-cp $EE/derby-10.8.1.2.jar:$EE/derbytools-10.8.1.2.jar"
# Command
OPTIONS="$CP $HM $PR $DB"
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/data/AssetMaintSeedData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/data/AssetMaintSeedData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/data/AssetMaintSeedData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/data/AssetMaintSeedData.xml Tue Sep 20 17:46:13 2011
@@ -18,5 +18,5 @@ specific language governing permissions
under the License.
-->
<entity-engine-xml>
- <WebSite webSiteId="ASSETMAINT" siteName="Asset Maintenance Application" visualThemeSetId="BACKOFFICE"/>
+
</entity-engine-xml>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/web.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/web.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/web.xml Tue Sep 20 17:46:13 2011
@@ -24,11 +24,6 @@
<description>Asset Management component of the Open For Business Project</description>
<context-param>
- <param-name>webSiteId</param-name>
- <param-value>ASSETMAINT</param-value>
- <description>A unique ID used to look up the WebSite entity</description>
- </context-param>
- <context-param>
<param-name>entityDelegatorName</param-name>
<param-value>default</param-value>
<description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/widget/AssetmaintScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/widget/AssetmaintScreens.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/widget/AssetmaintScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/assetmaint/widget/AssetmaintScreens.xml Tue Sep 20 17:46:13 2011
@@ -126,7 +126,7 @@
<link target="EditFixedAssetMaint" text="${uiLabelMap.AccountingNewFixedAssetMaint}" style="buttontext create">
<parameter param-name="fixedAssetId"/>
</link>
- <link target="printFixedAssetMaint.pdf" text="${uiLabelMap.CommonPrint}" style="buttontext">
+ <link target="printFixedAssetMaint.pdf" target-window="_blank" text="${uiLabelMap.CommonPrint}" style="buttontext">
<parameter param-name="fixedAssetId"/>
<parameter param-name="maintHistSeqId"/>
</link>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/EbayStoreHelpData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/EbayStoreHelpData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/EbayStoreHelpData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/EbayStoreHelpData.xml Tue Sep 20 17:46:13 2011
@@ -24,53 +24,53 @@ under the License.
dataResourceName="eBay Store" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="HELP_EBAY_STORE" contentTypeId="DOCUMENT" contentName="eBay Store" templateDataResourceId="HELP_TEMPL"
dataResourceId="HELP_EBAY_STORE" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_ROOT" contentIdTo="HELP_EBAY_STORE" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_main"/>
+ <ContentAssoc contentId="HELP_ROOT" contentIdTo="HELP_EBAY_STORE" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_main"/>
<DataResource dataResourceId="EBAY_NewEbayAccount" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_NewEbayAccount.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_NewEbayAccount" contentTypeId="DOCUMENT" contentName="EBay store new ebay Account" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_NewEbayAccount" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_NewEbayAccount" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_NewEbayAccount"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_NewEbayAccount" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_NewEbayAccount"/>
<DataResource dataResourceId="EBAY_StoreSetting" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_StoreSetting.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_StoreSetting" contentTypeId="DOCUMENT" contentName="EBay store setting" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_StoreSetting" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_StoreSetting" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_ebayStoreDetail"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_StoreSetting" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_ebayStoreDetail"/>
<DataResource dataResourceId="EBAY_ExpCatToEbay" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_ExportCategoriesToEbay.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_ExpCatToEbay" contentTypeId="DOCUMENT" contentName="EBay export categories to store" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_ExpCatToEbay" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_ExpCatToEbay" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_exportCategoryEbayStore"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_ExpCatToEbay" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_exportCategoryEbayStore"/>
<!-- ebay feedback -->
<DataResource dataResourceId="EBAY_LeaveFeedback" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_LeaveFeedback.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_LeaveFeedback" contentTypeId="DOCUMENT" contentName="EBay Leave Feedback" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_LeaveFeedback" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_LeaveFeedback" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_LeaveFeedback"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_LeaveFeedback" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_LeaveFeedback"/>
<DataResource dataResourceId="EBAY_Feedback" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_Feedback.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_Feedback" contentTypeId="DOCUMENT" contentName="EBay Feedback" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_Feedback" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY" contentIdTo="EBAY_Feedback" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_Feedback"/>
+ <ContentAssoc contentId="HELP_EBAY" contentIdTo="EBAY_Feedback" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_Feedback"/>
<DataResource dataResourceId="EBAY_AutoPref" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_AutoPref.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_AutoPref" contentTypeId="DOCUMENT" contentName="EBay Automation Preferences" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_AutoPref" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_AutoPref" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_AutomationPreferences"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_AutoPref" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_AutomationPreferences"/>
<!-- block out of stock -->
<DataResource dataResourceId="EBAY_BlockItem" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_BlockItemOutStock.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_BlockItem" contentTypeId="DOCUMENT" contentName="Block item that out of stock on eBay" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_BlockItem" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_BlockItem" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_blockItemOutOfStock"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_BlockItem" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_blockItemOutOfStock"/>
<!-- ebay product inventory -->
<DataResource dataResourceId="EBAY_ProdInventory" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_ProductInventory.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_ProdInventory" contentTypeId="DOCUMENT" contentName="handle ebay store inventory by ofbiz inventory" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_ProdInventory" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_ProdInventory" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_ebayStoreInventory"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_ProdInventory" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_ebayStoreInventory"/>
<DataResource dataResourceId="EBAY_reserveProd" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="specialpurpose/ebaystore/data/helpdata/HELP_EBAY_ReserveProduct.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EBAY_reserveProd" contentTypeId="DOCUMENT" contentName="reserve product from ofbiz inventory" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_reserveProd" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
- <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_reserveProd" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_STORE_reserveEbayProductInventory"/>
+ <ContentAssoc contentId="HELP_EBAY_STORE" contentIdTo="EBAY_reserveProd" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAYSTORE_reserveEbayProductInventory"/>
</entity-engine-xml>
Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/lib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 20 17:46:13 2011
@@ -2,4 +2,4 @@
/ofbiz/branches/dojo1.4/specialpurpose/ebaystore/lib:951708-952957
/ofbiz/branches/jquery/specialpurpose/ebaystore/lib:952958-1044489
/ofbiz/branches/multitenant20100310/specialpurpose/ebaystore/lib:921280-927264
-/ofbiz/trunk/specialpurpose/ebaystore/lib:962442-1156267
+/ofbiz/trunk/specialpurpose/ebaystore/lib:962442-1173263
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/config/EcommerceUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/config/EcommerceUiLabels.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/config/EcommerceUiLabels.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/config/EcommerceUiLabels.xml Tue Sep 20 17:46:13 2011
@@ -3903,6 +3903,10 @@
<value xml:lang="de">Ihre Bestellung wird verarbeitet, dies kann einige Minuten dauern...</value>
<value xml:lang="en">Your order is being processed, this may take a moment...</value>
</property>
+ <property key="EcommerceYourNamePhoneAndEmail">
+ <value xml:lang="de">Ihr Name, Telefon und E-Mail</value>
+ <value xml:lang="en">Your Name, Phone Number and E-Mail</value>
+ </property>
<property key="EcommerceYourPinNumber">
<value xml:lang="da">Deres PIN kode</value>
<value xml:lang="de">Ihre Pin-Nummer</value>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoMarketing.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoMarketing.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoMarketing.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoMarketing.xml Tue Sep 20 17:46:13 2011
@@ -47,4 +47,7 @@ under the License.
<TrackingCode trackingCodeId="9011" trackingCodeTypeId="EXTERNAL" description ="Affiliate 2" marketingCampaignId="9002" trackableLifetime="2592000" billableLifetime="2592000"/>
<TrackingCode trackingCodeId="9012" trackingCodeTypeId="EXTERNAL" description ="Affiliate 3" marketingCampaignId="9002" trackableLifetime="2592000" billableLifetime="2592000"/>
+ <!-- Demo WebSiteContactList -->
+ <WebSiteContactList webSiteId="WebStore" contactListId="9000" fromDate="2011-08-16 17:15:20.0"/>
+ <WebSiteContactList webSiteId="WebStore" contactListId="9010" fromDate="2011-08-16 17:15:20.0"/>
</entity-engine-xml>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoOrderTestData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoOrderTestData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoOrderTestData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoOrderTestData.xml Tue Sep 20 17:46:13 2011
@@ -20,7 +20,7 @@ under the License.
<entity-engine-xml>
<!--Demo data for a sales order -->
- <OrderHeader orderId="DEMO10090" orderTypeId="SALES_ORDER" orderName="" salesChannelEnumId="WEB_SALES_CHANNEL" orderDate="2008-04-23 16:49:27.392" entryDate="2008-04-23 16:49:27.392" priority="2" visitId="10002" statusId="ORDER_APPROVED" createdBy="admin" currencyUom="USD" webSiteId="OrderEntry" productStoreId="9000" remainingSubTotal="38.40" grandTotal="50.85" lastUpdatedStamp="2008-04-23 16:49:33.196" lastUpdatedTxStamp="2008-04-23 16:49:33.118" createdStamp="2008-04-23 16:49:27.716" createdTxStamp="2008-04-23 16:49:27.349"/>
+ <OrderHeader orderId="DEMO10090" orderTypeId="SALES_ORDER" orderName="" salesChannelEnumId="WEB_SALES_CHANNEL" orderDate="2008-04-23 16:49:27.392" entryDate="2008-04-23 16:49:27.392" priority="2" visitId="10002" statusId="ORDER_APPROVED" createdBy="admin" currencyUom="USD" webSiteId="OrderEntry" productStoreId="9000" remainingSubTotal="38.40" grandTotal="50.85" invoicePerShipment="Y" lastUpdatedStamp="2008-04-23 16:49:33.196" lastUpdatedTxStamp="2008-04-23 16:49:33.118" createdStamp="2008-04-23 16:49:27.716" createdTxStamp="2008-04-23 16:49:27.349"/>
<OrderItem orderId="DEMO10090" orderItemSeqId="00001" orderItemTypeId="PRODUCT_ORDER_ITEM" productId="GZ-2644" prodCatalogId="DemoCatalog" isPromo="N" quantity="2.0" selectedAmount="0.0" unitPrice="38.4" unitListPrice="48.0" isModifiedPrice="N" itemDescription="Round Gizmo" correspondingPoId="" statusId="ITEM_APPROVED" lastUpdatedStamp="2008-04-23 16:49:33.514" lastUpdatedTxStamp="2008-04-23 16:49:33.484" createdStamp="2008-04-23 16:49:28.128" createdTxStamp="2008-04-23 16:49:27.349"/>
<OrderItemPriceInfo orderItemPriceInfoId="9000" orderId="DEMO10090" orderItemSeqId="00001" productPriceRuleId="9000" productPriceActionSeqId="01" modifyAmount="-9.600" description="[PRODUCT_CATEGORY_IDIsPROMOTIONS] [list:48.0;avgCost:48.0;margin:0.0] [type:PRICE_POL]" lastUpdatedStamp="2008-04-23 16:49:28.682" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.682" createdTxStamp="2008-04-23 16:49:27.349"/>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoProduct.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoProduct.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/data/DemoProduct.xml Tue Sep 20 17:46:13 2011
@@ -710,7 +710,7 @@ under the License.
<ElectronicText dataResourceId="SERV-001-ALT" textData="service-product"/>
<ElectronicText dataResourceId="DRSERV-001-ALTEN" textData="services"/>
<ElectronicText dataResourceId="DRSERV-001-ALTEN" textData="service-product"/>
-
+
<Content contentId="SERV-001-ALT" contentTypeId="DOCUMENT" dataResourceId="SERV-001-ALT" localeString="en"/>
<Content contentId="CSERV-001-ALTEN" contentTypeId="DOCUMENT" dataResourceId="DRSERV-001-ALTEN" localeString="en_US"/>
<Content contentId="SV-1000-ALT" contentTypeId="DOCUMENT" dataResourceId="SV-1000-ALT" localeString="en"/>
@@ -720,6 +720,22 @@ under the License.
<ProductCategoryContent productCategoryId="SERV-001" contentId="SERV-001-ALT" prodCatContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
<ProductContent productId="SV-1000" contentId="SV-1000-ALT" productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+ <!-- test for service product type which is received to- and shipped from inventory-->
+ <Product productId="SV-1001" productTypeId="SERVICE_PRODUCT" primaryProductCategoryId="SERV-001" productName="Laundry service" internalName="Service type product which is received to- and shipped from inventory" description="Service type product which is received to- and shipped from inventory for demonstration use" taxable="Y" chargeShipping="N" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2008-12-02 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2008-12-02 12:00:00.0" lastModifiedByUserLogin="admin"/>
+ <ProductPrice productId="SV-1001" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2011-08-02 12:00:00.0" price="10.99" createdDate="2011-08-02 12:00:00.0" createdByUserLogin="admin"/>
+ <ProductCategoryMember productCategoryId="SERV-001" productId="SV-1001" fromDate="2011-08-02 12:00:00.0"/>
+ <ProductCategoryMember productCategoryId="CATALOG1_SEARCH" productId="SV-1001" fromDate="2011-08-02 12:00:00.0"/>
+ <DataResource dataResourceId="SV-1001-ALT" dataResourceTypeId="LINK" objectInfo="lanudry-service-SV-1001-p"/>
+ <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SV-1001-ALT" localeString="en"/>
+ <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRSV-1001-ALTEN" localeString="en_US"/>
+ <ElectronicText dataResourceId="SV-1001-ALT" textData="service-product"/>
+ <ElectronicText dataResourceId="DRSV-1001-ALTEN" textData="service-product"/>
+
+ <Content contentId="SV-1001-ALT" contentTypeId="DOCUMENT" dataResourceId="SV-1001-ALT" localeString="en"/>
+ <Content contentId="CSV-1001-ALTEN" contentTypeId="DOCUMENT" dataResourceId="DRSV-1001-ALTEN" localeString="en_US"/>
+ <ContentAssoc contentId="SV-1001-ALT" contentIdTo="CSV-1001-ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-08-02 12:00:00.0"/>
+ <ProductContent productId="SV-1001" contentId="SV-1001-ALT" productContentTypeId="ALTERNATIVE_URL" fromDate="2011-08-02 12:00:00.0"/>
+
<ProductFeatureCategory productFeatureCategoryId="8000" description="License Features"/>
<ProductFeatureCategoryAppl productFeatureCategoryId="8000" productCategoryId="CATALOG1_SEARCH" fromDate="2001-05-13 12:00:00.0"/>
@@ -975,6 +991,7 @@ under the License.
<ProductFacility productId="GZ-1000" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="1"/>
<ProductFacility productId="GZ-1001" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="1"/>
<ProductFacility productId="GZ-1004" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="1"/>
+ <ProductFacility productId="SV-1001" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="1"/>
<ProductFacilityLocation productId="GZ-2644" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01"/>
<ProductFacilityLocation productId="GZ-2644" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01" minimumStock="2" moveQuantity="5"/>
@@ -987,6 +1004,7 @@ under the License.
<ProductFacilityLocation productId="GZ-1000" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" minimumStock="5" moveQuantity="20"/>
<ProductFacilityLocation productId="GZ-1001" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL02" minimumStock="5" moveQuantity="20"/>
<ProductFacilityLocation productId="GZ-1004" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL04" minimumStock="5" moveQuantity="20"/>
+ <ProductFacilityLocation productId="SV-1001" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL04" minimumStock="5" moveQuantity="20"/>
<!-- some default inventory quantities, things are a bit underutilized without these... -->
<InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" datetimeReceived="2008-08-01 08:00:00.000"
@@ -1544,4 +1562,16 @@ under the License.
<ContentAssoc contentId="WG-1111-BX4-ALT" contentIdTo="CWG-1111-BX4-ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
<ProductContent productId="WG-1111-BX2" contentId="WG-1111-BX2-ALT" productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
<ProductContent productId="WG-1111-BX4" contentId="WG-1111-BX4-ALT" productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+
+ <!-- Demo product for rental shipping -->
+ <Product productId="RentalShip" productTypeId="ASSET_USAGE_OUT_IN" primaryProductCategoryId="201" productName="Rental Shipping" internalName="Rental Shipping" description="The Product For Test Rental of an asset which is shipped from and returned to inventory" reservMaxPersons="1" taxable="Y" chargeShipping="N" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2011-09-01 12:00:00.0" createdByUserLogin="admin"/>
+ <FixedAsset fixedAssetId="RentalShip" fixedAssetTypeId="PROPERTY" productionCapacity="10"/>
+ <FixedAssetProduct productId="RentalShip" fixedAssetId="RentalShip" fixedAssetProductTypeId="FAPT_USE" fromDate="2011-09-01 12:00:00.0"/>
+ <ProductPrice productId="RentalShip" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2011-09-01 12:00:00.0" price="15.99" createdDate="2011-09-01 12:00:00.0" createdByUserLogin="admin" lastModifiedByUserLogin="admin"/>
+ <ProductPrice productId="RentalShip" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2011-09-01 12:00:00.0" price="15.0" createdDate="2011-09-01 12:00:00.0" createdByUserLogin="admin" lastModifiedByUserLogin="admin"/>
+ <ProductCategoryMember productCategoryId="201" productId="RentalShip" fromDate="2011-09-01 12:00:00.0"/>
+ <ProductFacility productId="RentalShip" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="15"/>
+ <ProductFacilityLocation productId="RentalShip" facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" minimumStock="5" moveQuantity="20"/>
+ <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="InventoryRentalShip" inventoryItemTypeId="NON_SERIAL_INV_ITEM" datetimeReceived="2008-08-01 08:00:00.000" productId="RentalShip" ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"/>
+ <InventoryItemDetail inventoryItemId="InventoryRentalShip" inventoryItemDetailSeqId="0001" effectiveDate="2011-09-01 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10" accountingQuantityDiff="10"/>
</entity-engine-xml>
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy Tue Sep 20 17:46:13 2011
@@ -25,9 +25,32 @@ import org.ofbiz.entity.util.*;
import org.ofbiz.entity.condition.*;
import org.ofbiz.party.contact.ContactMechWorker;
import org.ofbiz.product.store.ProductStoreWorker;
+import org.ofbiz.webapp.website.WebSiteWorker;
import org.ofbiz.accounting.payment.PaymentWorker;
-publicEmailContactLists = delegator.findByAnd("ContactList", [isPublic : "Y", contactMechTypeId : "EMAIL_ADDRESS"], ["contactListName"]);
+/*publicEmailContactLists = delegator.findByAnd("ContactList", [isPublic : "Y", contactMechTypeId : "EMAIL_ADDRESS"], ["contactListName"]);
+context.publicEmailContactLists = publicEmailContactLists;*/
+
+webSiteId = WebSiteWorker.getWebSiteId(request);
+exprList = [];
+exprListThruDate = [];
+exprList.add(EntityCondition.makeCondition("webSiteId", EntityOperator.EQUALS, webSiteId));
+exprListThruDate.add(EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null));
+exprListThruDate.add(EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.nowTimestamp()));
+orCond = EntityCondition.makeCondition(exprListThruDate, EntityOperator.OR);
+exprList.add(orCond);
+topCond = EntityCondition.makeCondition(exprList, EntityOperator.AND);
+webSiteContactList = delegator.findList("WebSiteContactList", topCond, null, null, null, false);
+
+publicEmailContactLists = [];
+webSiteContactList.each { webSiteContactList ->
+ contactList = webSiteContactList.getRelatedOne("ContactList");
+ contactListType = contactList.getRelatedOne("ContactListType");
+ temp = [:];
+ temp.contactList = contactList;
+ temp.contactListType = contactListType;
+ publicEmailContactLists.add(temp);
+}
context.publicEmailContactLists = publicEmailContactLists;
if (userLogin) {
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy Tue Sep 20 17:46:13 2011
@@ -93,7 +93,7 @@ if (shoppingListId) {
price = calcPriceOutMap.price;
totalPrice = price * shoppingListItem.quantity;
// similar code at ShoppingCartItem.java getRentalAdjustment
- if ("ASSET_USAGE".equals(product.productTypeId)) {
+ if ("ASSET_USAGE".equals(product.productTypeId) || "ASSET_USAGE_OUT_IN".equals(product.productTypeId)) {
persons = shoppingListItem.reservPersons ?: 0;
reservNthPPPerc = product.reservNthPPPerc ?: 0;
reserv2ndPPPerc = product.reserv2ndPPPerc ?: 0;
Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/branches/jackrabbit20100709/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Tue Sep 20 17:46:13 2011
@@ -621,7 +621,7 @@ under the License.
<request-map uri="quickcheckout">
<security https="true" auth="true"/>
<event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="cartNotEmpty"/>
- <response name="success" type="view" value="quickcheckout"/>
+ <response name="success" type="view" save-current-view="true" value="quickcheckout"/>
<response name="error" type="view" value="main"/>
</request-map>