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 2007/09/09 12:46:56 UTC
svn commit: r573985 -
/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
Author: jleroux
Date: Sun Sep 9 03:46:56 2007
New Revision: 573985
URL: http://svn.apache.org/viewvc?rev=573985&view=rev
Log:
Applied fix from trunk for revision: 557859
Modified:
ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
Modified: ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=573985&r1=573984&r2=573985&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original)
+++ ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Sun Sep 9 03:46:56 2007
@@ -77,7 +77,6 @@
public static List readSubWidgets(ModelScreen modelScreen, List subElementList) {
List subWidgets = new LinkedList();
-
Iterator subElementIter = subElementList.iterator();
while (subElementIter.hasNext()) {
Element subElement = (Element) subElementIter.next();
@@ -127,7 +126,7 @@
Iterator subWidgetIter = subWidgets.iterator();
while (subWidgetIter.hasNext()) {
ModelScreenWidget subWidget = (ModelScreenWidget) subWidgetIter.next();
- if (Debug.verboseOn()) Debug.logVerbose("Rendering screen " + subWidget.modelScreen.name + " widget " + subWidget.getClass().getName(), module);
+ Debug.logInfo("Rendering screen " + subWidget.modelScreen.name + " widget " + subWidget.getClass().getName(), module);
Map parameters = (Map) context.get("parameters");
boolean insertWidgetBoundaryComments = "true".equals(parameters==null?null:parameters.get("widgetVerbose"));
@@ -850,18 +849,18 @@
GenericDelegator delegator = (GenericDelegator) context.get("delegator");
GenericValue content = null;
String expandedDataResourceId = getDataResourceId(context);
+ String expandedContentId = getContentId(context);
+ if (!(context instanceof MapStack)) {
+ context = MapStack.create(context);
+ }
+
+ // This is an important step to make sure that the current contentId is in the context
+ // as templates that contain "subcontent" elements will expect to find the master
+ // contentId in the context as "contentId".
+ ((MapStack) context).push();
+ context.put("contentId", expandedContentId);
+
if (UtilValidate.isEmpty(expandedDataResourceId)) {
- String expandedContentId = getContentId(context);
- if (!(context instanceof MapStack)) {
- context = MapStack.create(context);
- }
-
- // This is an important step to make sure that the current contentId is in the context
- // as templates that contain "subcontent" elements will expect to find the master
- // contentId in the context as "contentId".
- ((MapStack) context).push();
- context.put("contentId", expandedContentId);
-
if (UtilValidate.isNotEmpty(expandedContentId)) {
content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", expandedContentId));
} else {
@@ -871,16 +870,17 @@
}
if (content != null) {
expandedDataResourceId = content.getString("dataResourceId");
- this.dataResourceId = new FlexibleStringExpander(expandedDataResourceId);
} else {
String errMsg = "Could not find content with contentId [" + expandedContentId + "] ";
Debug.logError(errMsg, module);
throw new RuntimeException(errMsg);
}
}
+
GenericValue dataResource = null;
if (UtilValidate.isNotEmpty(expandedDataResourceId)) {
dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", expandedDataResourceId));
+ this.dataResourceId = new FlexibleStringExpander(expandedDataResourceId);
}
String mimeTypeId = null;