You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2008/06/01 03:50:42 UTC
svn commit: r662123 [5/6] - in
/ofbiz/trunk/framework/widget/src/org/ofbiz/widget: ./ fo/ form/ html/
menu/ screen/ text/ tree/ xml/
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Sat May 31 18:50:41 2008
@@ -28,7 +28,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -37,11 +36,14 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilFormatOut;
+import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.UtilXml;
-import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.collections.MapStack;
import org.ofbiz.base.util.string.FlexibleStringExpander;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
import org.ofbiz.widget.ModelWidget;
import org.ofbiz.widget.fo.FoScreenRenderer;
import org.ofbiz.widget.form.FormFactory;
@@ -57,9 +59,6 @@
import org.ofbiz.widget.tree.TreeFactory;
import org.ofbiz.widget.tree.TreeStringRenderer;
import org.ofbiz.widget.xml.XmlFormRenderer;
-import org.ofbiz.entity.GenericDelegator;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.GenericEntityException;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -77,7 +76,7 @@
if (Debug.verboseOn()) Debug.logVerbose("Reading Screen sub-widget with name: " + widgetElement.getNodeName(), module);
}
- public abstract void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException;
+ public abstract void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException;
public abstract String rawString();
@@ -127,7 +126,7 @@
return subWidgets;
}
- public static void renderSubWidgetsString(List subWidgets, Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public static void renderSubWidgetsString(List subWidgets, Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
if (subWidgets == null) {
return;
}
@@ -148,10 +147,10 @@
public static class SectionsRenderer {
protected Map sectionMap;
protected ScreenStringRenderer screenStringRenderer;
- protected Map context;
+ protected Map<String, Object> context;
protected Writer writer;
- public SectionsRenderer(Map sectionMap, Map context, Writer writer, ScreenStringRenderer screenStringRenderer) {
+ public SectionsRenderer(Map sectionMap, Map<String, Object> context, Writer writer, ScreenStringRenderer screenStringRenderer) {
this.sectionMap = sectionMap;
this.context = context;
this.writer = writer;
@@ -159,7 +158,7 @@
}
/** This is a lot like the ScreenRenderer class and returns an empty String so it can be used more easily with FreeMarker */
- public String render(String sectionName) throws GeneralException {
+ public String render(String sectionName) throws GeneralException, IOException {
ModelScreenWidget section = (ModelScreenWidget) this.sectionMap.get(sectionName);
// if no section by that name, write nothing
if (section != null) {
@@ -204,7 +203,7 @@
}
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
// check the condition, if there is one
boolean condTrue = true;
if (this.condition != null) {
@@ -283,7 +282,7 @@
this.subWidgets = ModelScreenWidget.readSubWidgets(this.modelScreen, subElementList);
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
try {
screenStringRenderer.renderContainerBegin(writer, context, this);
@@ -298,15 +297,15 @@
}
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
- public String getAutoUpdateTargetExdr(Map context) {
+ public String getAutoUpdateTargetExdr(Map<String, Object> context) {
return this.autoUpdateTargetExdr.expandString(context);
}
@@ -377,7 +376,7 @@
}
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
boolean collapsed = initiallyCollapsed;
if (this.collapsible) {
String preferenceKey = getPreferenceKey(context) + "_collapsed";
@@ -416,7 +415,7 @@
return this.padded;
}
- public String getPreferenceKey(Map context) {
+ public String getPreferenceKey(Map<String, Object> context) {
String name = this.modelScreen.getName();
if (UtilValidate.isEmpty(name)) {
name = this.idExdr.expandString(context);
@@ -461,7 +460,7 @@
this.shareScopeExdr = new FlexibleStringExpander(includeScreenElement.getAttribute("share-scope"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
// if we are not sharing the scope, protect it using the MapStack
boolean protectScope = !shareScope(context);
if (protectScope) {
@@ -528,15 +527,15 @@
}
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getLocation(Map context) {
+ public String getLocation(Map<String, Object> context) {
return this.locationExdr.expandString(context);
}
- public boolean shareScope(Map context) {
+ public boolean shareScope(Map<String, Object> context) {
String shareScopeString = this.shareScopeExdr.expandString(context);
// defaults to false, so anything but true is false
return "true".equals(shareScopeString);
@@ -566,7 +565,7 @@
}
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
// isolate the scope
if (!(context instanceof MapStack)) {
context = MapStack.create(context);
@@ -621,11 +620,11 @@
contextMs.pop();
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getLocation(Map context) {
+ public String getLocation(Map<String, Object> context) {
return this.locationExdr.expandString(context);
}
@@ -644,7 +643,7 @@
this.subWidgets = ModelScreenWidget.readSubWidgets(this.modelScreen, subElementList);
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
// render sub-widgets
renderSubWidgetsString(this.subWidgets, writer, context, screenStringRenderer);
}
@@ -660,7 +659,7 @@
super(modelScreen, decoratorSectionElement);
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
Map preRenderedContent = (Map) context.get("preRenderedContent");
if (preRenderedContent != null && preRenderedContent.containsKey(this.name)) {
try {
@@ -704,7 +703,7 @@
this.styleExdr = new FlexibleStringExpander(labelElement.getAttribute("style"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
try {
screenStringRenderer.renderLabel(writer, context, this);
} catch (IOException e) {
@@ -714,15 +713,15 @@
}
}
- public String getText(Map context) {
+ public String getText(Map<String, Object> context) {
return this.textExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
@@ -745,7 +744,7 @@
this.shareScopeExdr = new FlexibleStringExpander(formElement.getAttribute("share-scope"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
boolean protectScope = !shareScope(context);
if (protectScope) {
if (!(context instanceof MapStack)) {
@@ -784,7 +783,7 @@
}
}
- public ModelForm getModelForm(Map context) {
+ public ModelForm getModelForm(Map<String, Object> context) {
ModelForm modelForm = null;
String name = this.getName(context);
String location = this.getLocation(context);
@@ -798,15 +797,15 @@
return modelForm;
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getLocation(Map context) {
+ public String getLocation(Map<String, Object> context) {
return this.locationExdr.expandString(context);
}
- public boolean shareScope(Map context) {
+ public boolean shareScope(Map<String, Object> context) {
String shareScopeString = this.shareScopeExdr.expandString(context);
// defaults to false, so anything but true is false
return "true".equals(shareScopeString);
@@ -830,7 +829,7 @@
this.shareScopeExdr = new FlexibleStringExpander(treeElement.getAttribute("share-scope"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
boolean protectScope = !shareScope(context);
if (protectScope) {
if (!(context instanceof MapStack)) {
@@ -891,15 +890,15 @@
}
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getLocation(Map context) {
+ public String getLocation(Map<String, Object> context) {
return this.locationExdr.expandString(context);
}
- public boolean shareScope(Map context) {
+ public boolean shareScope(Map<String, Object> context) {
String shareScopeString = this.shareScopeExdr.expandString(context);
// defaults to false, so anything but true is false
return "true".equals(shareScopeString);
@@ -934,7 +933,7 @@
}
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
ModelScreenWidget subWidget = null;
if (screenStringRenderer instanceof FoScreenRenderer) {
subWidget = (ModelScreenWidget)subWidgets.get("xsl-fo");
@@ -995,7 +994,7 @@
this.border = subContentElement.getAttribute("border");
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
try {
// pushing the contentId on the context as "contentId" is done
// because many times there will be embedded "subcontent" elements
@@ -1064,23 +1063,23 @@
}
- public String getContentId(Map context) {
+ public String getContentId(Map<String, Object> context) {
return this.contentId.expandString(context);
}
- public String getDataResourceId(Map context) {
+ public String getDataResourceId(Map<String, Object> context) {
return this.dataResourceId.expandString(context);
}
- public String getEditRequest(Map context) {
+ public String getEditRequest(Map<String, Object> context) {
return this.editRequest.expandString(context);
}
- public String getEditContainerStyle(Map context) {
+ public String getEditContainerStyle(Map<String, Object> context) {
return this.editContainerStyle.expandString(context);
}
- public String getEnableEditName(Map context) {
+ public String getEnableEditName(Map<String, Object> context) {
return this.enableEditName.expandString(context);
}
@@ -1129,7 +1128,7 @@
this.xmlEscape = "true".equals(subContentElement.getAttribute("xml-escape"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
try {
screenStringRenderer.renderSubContentBegin(writer, context, this);
screenStringRenderer.renderSubContentBody(writer, context, this);
@@ -1141,23 +1140,23 @@
}
}
- public String getContentId(Map context) {
+ public String getContentId(Map<String, Object> context) {
return this.contentId.expandString(context);
}
- public String getMapKey(Map context) {
+ public String getMapKey(Map<String, Object> context) {
return this.mapKey.expandString(context);
}
- public String getEditRequest(Map context) {
+ public String getEditRequest(Map<String, Object> context) {
return this.editRequest.expandString(context);
}
- public String getEditContainerStyle(Map context) {
+ public String getEditContainerStyle(Map<String, Object> context) {
return this.editContainerStyle.expandString(context);
}
- public String getEnableEditName(Map context) {
+ public String getEnableEditName(Map<String, Object> context) {
return this.enableEditName.expandString(context);
}
@@ -1182,7 +1181,7 @@
this.locationExdr = new FlexibleStringExpander(menuElement.getAttribute("location"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws IOException {
// try finding the menuStringRenderer by name in the context in case one was prepared and put there
MenuStringRenderer menuStringRenderer = (MenuStringRenderer) context.get("menuStringRenderer");
// if there was no menuStringRenderer put in place, now try finding the request/response in the context and creating a new one
@@ -1206,19 +1205,11 @@
}
}
- StringBuffer renderBuffer = new StringBuffer();
ModelMenu modelMenu = getModelMenu(context);
- modelMenu.renderMenuString(renderBuffer, context, menuStringRenderer);
- try {
- writer.write(renderBuffer.toString());
- } catch (IOException e) {
- String errMsg = "Error rendering included menu named [" + name + "] at location [" + this.getLocation(context) + "]: " + e.toString();
- Debug.logError(e, errMsg, module);
- throw new RuntimeException(errMsg);
- }
+ modelMenu.renderMenuString(writer, context, menuStringRenderer);
}
- public ModelMenu getModelMenu(Map context) {
+ public ModelMenu getModelMenu(Map<String, Object> context) {
String name = this.getName(context);
String location = this.getLocation(context);
ModelMenu modelMenu = null;
@@ -1232,11 +1223,11 @@
return modelMenu;
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getLocation(Map context) {
+ public String getLocation(Map<String, Object> context) {
return this.locationExdr.expandString(context);
}
@@ -1281,7 +1272,7 @@
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
try {
screenStringRenderer.renderLink(writer, context, this);
} catch (IOException e) {
@@ -1291,27 +1282,27 @@
}
}
- public String getText(Map context) {
+ public String getText(Map<String, Object> context) {
return this.textExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
- public String getTarget(Map context) {
+ public String getTarget(Map<String, Object> context) {
return this.targetExdr.expandString(context);
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getTargetWindow(Map context) {
+ public String getTargetWindow(Map<String, Object> context) {
return this.targetWindowExdr.expandString(context);
}
@@ -1319,7 +1310,7 @@
return this.urlMode;
}
- public String getPrefix(Map context) {
+ public String getPrefix(Map<String, Object> context) {
return this.prefixExdr.expandString(context);
}
@@ -1419,7 +1410,7 @@
setUrlMode(UtilFormatOut.checkEmpty(imageElement.getAttribute("url-mode"), "content"));
}
- public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) {
+ public void renderWidgetString(Writer writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) {
try {
screenStringRenderer.renderImage(writer, context, this);
} catch (IOException e) {
@@ -1429,27 +1420,27 @@
}
}
- public String getSrc(Map context) {
+ public String getSrc(Map<String, Object> context) {
return this.srcExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
- public String getWidth(Map context) {
+ public String getWidth(Map<String, Object> context) {
return this.widthExdr.expandString(context);
}
- public String getHeight(Map context) {
+ public String getHeight(Map<String, Object> context) {
return this.heightExdr.expandString(context);
}
- public String getBorder(Map context) {
+ public String getBorder(Map<String, Object> context) {
return this.borderExdr.expandString(context);
}
@@ -1501,3 +1492,4 @@
+
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenStringRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenStringRenderer.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenStringRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenStringRenderer.java Sat May 31 18:50:41 2008
@@ -25,27 +25,28 @@
import org.ofbiz.base.util.GeneralException;
/**
- * Widget Library - Screen String Renderer interface
+ * Widget Library - Screen String Renderer interface.
*/
public interface ScreenStringRenderer {
- public void renderSectionBegin(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException;
- public void renderSectionEnd(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException;
- public void renderContainerBegin(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException;
- public void renderContainerEnd(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException;
- public void renderContentBegin(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException;
- public void renderContentBody(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException;
- public void renderContentEnd(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException;
- public void renderSubContentBegin(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException;
- public void renderSubContentBody(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException;
- public void renderSubContentEnd(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException;
+ public void renderSectionBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException;
+ public void renderSectionEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException;
+ public void renderContainerBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Container container) throws IOException;
+ public void renderContainerEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Container container) throws IOException;
+ public void renderContentBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException;
+ public void renderContentBody(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException;
+ public void renderContentEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException;
+ public void renderSubContentBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException;
+ public void renderSubContentBody(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException;
+ public void renderSubContentEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException;
- public void renderLabel(Writer writer, Map context, ModelScreenWidget.Label label) throws IOException;
- public void renderLink(Writer writer, Map context, ModelScreenWidget.Link link) throws IOException;
- public void renderImage(Writer writer, Map context, ModelScreenWidget.Image image) throws IOException;
+ public void renderLabel(Writer writer, Map<String, Object> context, ModelScreenWidget.Label label) throws IOException;
+ public void renderLink(Writer writer, Map<String, Object> context, ModelScreenWidget.Link link) throws IOException;
+ public void renderImage(Writer writer, Map<String, Object> context, ModelScreenWidget.Image image) throws IOException;
- public void renderContentFrame(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException;
- public void renderScreenletBegin(Writer writer, Map context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException;
- public void renderScreenletSubWidget(Writer writer, Map context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException;
- public void renderScreenletEnd(Writer writer, Map context, ModelScreenWidget.Screenlet screenlet) throws IOException;
+ public void renderContentFrame(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException;
+ public void renderScreenletBegin(Writer writer, Map<String, Object> context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException;
+ public void renderScreenletSubWidget(Writer writer, Map<String, Object> context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException, IOException;
+ public void renderScreenletEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Screenlet screenlet) throws IOException;
}
+
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java Sat May 31 18:50:41 2008
@@ -18,9 +18,12 @@
*******************************************************************************/
package org.ofbiz.widget.text;
+import java.io.IOException;
+import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -67,43 +70,43 @@
this.response = response;
}
- public void appendWhitespace(StringBuffer buffer) {
+ public void appendWhitespace(Writer writer) throws IOException {
// appending line ends for now, but this could be replaced with a simple space or something
- buffer.append("\r\n");
- //buffer.append(' ');
+ writer.write("\r\n");
+ //writer.write(' ');
}
- private void makeTextString(StringBuffer buffer, String widgetStyle, String text) {
+ private void makeTextString(Writer writer, String widgetStyle, String text) throws IOException {
// TODO: escape characters here
- buffer.append(text);
+ writer.write(text);
}
- public void renderDisplayField(StringBuffer buffer, Map context, DisplayField displayField) {
+ public void renderDisplayField(Writer writer, Map<String, Object> context, DisplayField displayField) throws IOException {
ModelFormField modelFormField = displayField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), displayField.getDescription(context));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), displayField.getDescription(context));
}
- public void renderHyperlinkField(StringBuffer buffer, Map context, HyperlinkField hyperlinkField) {
+ public void renderHyperlinkField(Writer writer, Map<String, Object> context, HyperlinkField hyperlinkField) throws IOException {
ModelFormField modelFormField = hyperlinkField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), hyperlinkField.getDescription(context));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), hyperlinkField.getDescription(context));
}
- public void renderTextField(StringBuffer buffer, Map context, TextField textField) {
+ public void renderTextField(Writer writer, Map<String, Object> context, TextField textField) throws IOException {
ModelFormField modelFormField = textField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context)));
}
- public void renderTextareaField(StringBuffer buffer, Map context, TextareaField textareaField) {
+ public void renderTextareaField(Writer writer, Map<String, Object> context, TextareaField textareaField) throws IOException {
ModelFormField modelFormField = textareaField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textareaField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textareaField.getDefaultValue(context)));
}
- public void renderDateTimeField(StringBuffer buffer, Map context, DateTimeField dateTimeField) {
+ public void renderDateTimeField(Writer writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException {
ModelFormField modelFormField = dateTimeField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)));
}
- public void renderDropDownField(StringBuffer buffer, Map context, DropDownField dropDownField) {
+ public void renderDropDownField(Writer writer, Map<String, Object> context, DropDownField dropDownField) throws IOException {
ModelFormField modelFormField = dropDownField.getModelFormField();
ModelForm modelForm = modelFormField.getModelForm();
String currentValue = modelFormField.getEntry(context);
@@ -112,9 +115,9 @@
if (UtilValidate.isNotEmpty(currentValue) && "first-in-list".equals(dropDownField.getCurrent())) {
String explicitDescription = dropDownField.getCurrentDescription(context);
if (UtilValidate.isNotEmpty(explicitDescription)) {
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), explicitDescription);
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), explicitDescription);
} else {
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), ModelFormField.FieldInfoWithOptions.getDescriptionForOptionKey(currentValue, allOptionValues));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), ModelFormField.FieldInfoWithOptions.getDescriptionForOptionKey(currentValue, allOptionValues));
}
} else {
Iterator optionValueIter = allOptionValues.iterator();
@@ -123,176 +126,176 @@
String noCurrentSelectedKey = dropDownField.getNoCurrentSelectedKey(context);
if ((UtilValidate.isNotEmpty(currentValue) && currentValue.equals(optionValue.getKey()) && "selected".equals(dropDownField.getCurrent())) ||
(UtilValidate.isEmpty(currentValue) && noCurrentSelectedKey != null && noCurrentSelectedKey.equals(optionValue.getKey()))) {
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), optionValue.getDescription());
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), optionValue.getDescription());
break;
}
}
}
}
- public void renderCheckField(StringBuffer buffer, Map context, CheckField checkField) {
+ public void renderCheckField(Writer writer, Map<String, Object> context, CheckField checkField) {
}
- public void renderRadioField(StringBuffer buffer, Map context, RadioField radioField) {
+ public void renderRadioField(Writer writer, Map<String, Object> context, RadioField radioField) {
}
- public void renderSubmitField(StringBuffer buffer, Map context, SubmitField submitField) {
+ public void renderSubmitField(Writer writer, Map<String, Object> context, SubmitField submitField) {
}
- public void renderResetField(StringBuffer buffer, Map context, ResetField resetField) {
+ public void renderResetField(Writer writer, Map<String, Object> context, ResetField resetField) {
}
- public void renderHiddenField(StringBuffer buffer, Map context, HiddenField hiddenField) {
+ public void renderHiddenField(Writer writer, Map<String, Object> context, HiddenField hiddenField) {
}
- public void renderHiddenField(StringBuffer buffer, Map context, ModelFormField modelFormField, String value) {
+ public void renderHiddenField(Writer writer, Map<String, Object> context, ModelFormField modelFormField, String value) {
}
- public void renderIgnoredField(StringBuffer buffer, Map context, IgnoredField ignoredField) {
+ public void renderIgnoredField(Writer writer, Map<String, Object> context, IgnoredField ignoredField) {
}
- public void renderFieldTitle(StringBuffer buffer, Map context, ModelFormField modelFormField) {
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getTitle(context));
+ public void renderFieldTitle(Writer writer, Map<String, Object> context, ModelFormField modelFormField) throws IOException {
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getTitle(context));
}
- public void renderSingleFormFieldTitle(StringBuffer buffer, Map context, ModelFormField modelFormField) {
- renderFieldTitle(buffer, context, modelFormField);
+ public void renderSingleFormFieldTitle(Writer writer, Map<String, Object> context, ModelFormField modelFormField) throws IOException {
+ renderFieldTitle(writer, context, modelFormField);
}
- public void renderFormOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderMultiFormClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderMultiFormClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatListWrapperOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatListWrapperOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatListWrapperClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatListWrapperClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatHeaderRowOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatHeaderRowOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatHeaderRowClose(StringBuffer buffer, Map context, ModelForm modelForm) {
- this.appendWhitespace(buffer);
+ public void renderFormatHeaderRowClose(Writer writer, Map<String, Object> context, ModelForm modelForm) throws IOException {
+ this.appendWhitespace(writer);
}
- public void renderFormatHeaderRowCellOpen(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField, int positionSpan) {
+ public void renderFormatHeaderRowCellOpen(Writer writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField, int positionSpan) {
}
- public void renderFormatHeaderRowCellClose(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
+ public void renderFormatHeaderRowCellClose(Writer writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField) {
}
- public void renderFormatHeaderRowFormCellOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatHeaderRowFormCellOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatHeaderRowFormCellClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatHeaderRowFormCellClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatHeaderRowFormCellTitleSeparator(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField, boolean isLast) {
+ public void renderFormatHeaderRowFormCellTitleSeparator(Writer writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField, boolean isLast) {
}
- public void renderFormatItemRowOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatItemRowOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatItemRowClose(StringBuffer buffer, Map context, ModelForm modelForm) {
- this.appendWhitespace(buffer);
+ public void renderFormatItemRowClose(Writer writer, Map<String, Object> context, ModelForm modelForm) throws IOException {
+ this.appendWhitespace(writer);
}
- public void renderFormatItemRowCellOpen(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField, int positionSpan) {
+ public void renderFormatItemRowCellOpen(Writer writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField, int positionSpan) {
}
- public void renderFormatItemRowCellClose(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
+ public void renderFormatItemRowCellClose(Writer writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField) {
}
- public void renderFormatItemRowFormCellOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatItemRowFormCellOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatItemRowFormCellClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatItemRowFormCellClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatSingleWrapperOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatSingleWrapperOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatSingleWrapperClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatSingleWrapperClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatFieldRowOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatFieldRowOpen(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatFieldRowClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatFieldRowClose(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFormatFieldRowTitleCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField) {
+ public void renderFormatFieldRowTitleCellOpen(Writer writer, Map<String, Object> context, ModelFormField modelFormField) {
}
- public void renderFormatFieldRowTitleCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField) {
+ public void renderFormatFieldRowTitleCellClose(Writer writer, Map<String, Object> context, ModelFormField modelFormField) {
}
- public void renderFormatFieldRowSpacerCell(StringBuffer buffer, Map context, ModelFormField modelFormField) {
+ public void renderFormatFieldRowSpacerCell(Writer writer, Map<String, Object> context, ModelFormField modelFormField) {
}
- public void renderFormatFieldRowWidgetCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) {
+ public void renderFormatFieldRowWidgetCellOpen(Writer writer, Map<String, Object> context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) {
}
- public void renderFormatFieldRowWidgetCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) {
+ public void renderFormatFieldRowWidgetCellClose(Writer writer, Map<String, Object> context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) {
}
- public void renderFormatEmptySpace(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderFormatEmptySpace(Writer writer, Map<String, Object> context, ModelForm modelForm) {
// TODO
}
- public void renderTextFindField(StringBuffer buffer, Map context, TextFindField textFindField) {
+ public void renderTextFindField(Writer writer, Map<String, Object> context, TextFindField textFindField) throws IOException {
ModelFormField modelFormField = textFindField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textFindField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textFindField.getDefaultValue(context)));
}
- public void renderRangeFindField(StringBuffer buffer, Map context, RangeFindField rangeFindField) {
+ public void renderRangeFindField(Writer writer, Map<String, Object> context, RangeFindField rangeFindField) throws IOException {
ModelFormField modelFormField = rangeFindField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, rangeFindField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, rangeFindField.getDefaultValue(context)));
}
- public void renderDateFindField(StringBuffer buffer, Map context, DateFindField dateFindField) {
+ public void renderDateFindField(Writer writer, Map<String, Object> context, DateFindField dateFindField) throws IOException {
ModelFormField modelFormField = dateFindField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateFindField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateFindField.getDefaultValue(context)));
}
- public void renderLookupField(StringBuffer buffer, Map context, LookupField lookupField) {
+ public void renderLookupField(Writer writer, Map<String, Object> context, LookupField lookupField) throws IOException {
ModelFormField modelFormField = lookupField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, lookupField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, lookupField.getDefaultValue(context)));
}
- public void renderNextPrev(StringBuffer buffer, Map context, ModelForm modelForm) {
+ public void renderNextPrev(Writer writer, Map<String, Object> context, ModelForm modelForm) {
}
- public void renderFileField(StringBuffer buffer, Map context, FileField textField) {
+ public void renderFileField(Writer writer, Map<String, Object> context, FileField textField) throws IOException {
ModelFormField modelFormField = textField.getModelFormField();
- this.makeTextString(buffer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context)));
+ this.makeTextString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context)));
}
- public void renderPasswordField(StringBuffer buffer, Map context, PasswordField passwordField) {
+ public void renderPasswordField(Writer writer, Map<String, Object> context, PasswordField passwordField) {
}
- public void renderImageField(StringBuffer buffer, Map context, ImageField imageField) {
+ public void renderImageField(Writer writer, Map<String, Object> context, ImageField imageField) {
// TODO
}
- public void renderFieldGroupOpen(StringBuffer buffer, Map context, ModelForm.FieldGroup fieldGroup) {
+ public void renderFieldGroupOpen(Writer writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) {
// TODO
}
- public void renderFieldGroupClose(StringBuffer buffer, Map context, ModelForm.FieldGroup fieldGroup) {
+ public void renderFieldGroupClose(Writer writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) {
// TODO
}
- public void renderBanner(StringBuffer buffer, Map context, ModelForm.Banner banner) {
+ public void renderBanner(Writer writer, Map<String, Object> context, ModelForm.Banner banner) {
// TODO
}
- public void renderHyperlinkTitle(StringBuffer buffer, Map context, ModelFormField modelFormField, String titleText) {
+ public void renderHyperlinkTitle(Writer writer, Map<String, Object> context, ModelFormField modelFormField, String titleText) {
}
}
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java Sat May 31 18:50:41 2008
@@ -53,20 +53,20 @@
public TextScreenRenderer() {}
- public void renderSectionBegin(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException {
+ public void renderSectionBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
// do nothing, this is just a place holder container for HTML
}
- public void renderSectionEnd(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException {
+ public void renderSectionEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
// do nothing, this is just a place holder container for HTML
}
- public void renderContainerBegin(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException {
+ public void renderContainerBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Container container) throws IOException {
}
- public void renderContainerEnd(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException {
+ public void renderContainerEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Container container) throws IOException {
appendWhitespace(writer);
}
- public void renderLabel(Writer writer, Map context, ModelScreenWidget.Label label) throws IOException {
+ public void renderLabel(Writer writer, Map<String, Object> context, ModelScreenWidget.Label label) throws IOException {
String labelText = label.getText(context);
if (UtilValidate.isEmpty(labelText)) {
// nothing to render
@@ -76,39 +76,39 @@
appendWhitespace(writer);
}
- public void renderLink(Writer writer, Map context, ModelScreenWidget.Link link) throws IOException {
+ public void renderLink(Writer writer, Map<String, Object> context, ModelScreenWidget.Link link) throws IOException {
// TODO: not implemented
}
- public void renderImage(Writer writer, Map context, ModelScreenWidget.Image image) throws IOException {
+ public void renderImage(Writer writer, Map<String, Object> context, ModelScreenWidget.Image image) throws IOException {
// TODO: not implemented
}
- public void renderContentBegin(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ public void renderContentBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException {
// TODO: not implemented
}
- public void renderContentBody(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ public void renderContentBody(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException {
// TODO: not implemented
}
- public void renderContentEnd(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ public void renderContentEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException {
// TODO: not implemented
}
- public void renderContentFrame(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ public void renderContentFrame(Writer writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException {
// TODO: not implemented
}
- public void renderSubContentBegin(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ public void renderSubContentBegin(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException {
// TODO: not implemented
}
- public void renderSubContentBody(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ public void renderSubContentBody(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException {
// TODO: not implemented
}
- public void renderSubContentEnd(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ public void renderSubContentEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException {
// TODO: not implemented
}
@@ -116,13 +116,13 @@
// appending line ends for now, but this could be replaced with a simple space or something
writer.write("\r\n");
}
- public void renderScreenletBegin(Writer writer, Map context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException {
+ public void renderScreenletBegin(Writer writer, Map<String, Object> context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException {
// TODO: not implemented
}
- public void renderScreenletSubWidget(Writer writer, Map context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException {
+ public void renderScreenletSubWidget(Writer writer, Map<String, Object> context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException {
// TODO: not implemented
}
- public void renderScreenletEnd(Writer writer, Map context, ModelScreenWidget.Screenlet screenlet) throws IOException {
+ public void renderScreenletEnd(Writer writer, Map<String, Object> context, ModelScreenWidget.Screenlet screenlet) throws IOException {
// TODO: not implemented
}
}
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Sat May 31 18:50:41 2008
@@ -159,7 +159,7 @@
return rootNodeName;
}
- public String getWrapStyle(Map context) {
+ public String getWrapStyle(Map<String, Object> context) {
return this.defaultWrapStyleExdr.expandString(context);
}
@@ -179,7 +179,7 @@
nodeIndices[i] = val;
}
- public String getExpandCollapseRequest(Map context) {
+ public String getExpandCollapseRequest(Map<String, Object> context) {
String expColReq = this.expandCollapseRequestExdr.expandString(context);
if (UtilValidate.isEmpty(expColReq)) {
HttpServletRequest request = (HttpServletRequest)context.get("request");
@@ -193,7 +193,7 @@
return expColReq;
}
- public String getTrailName(Map context) {
+ public String getTrailName(Map<String, Object> context) {
return this.trailNameExdr.expandString(context);
}
@@ -232,7 +232,7 @@
* different tree elements; implementing your own makes it possible to
* use the same tree definitions for many types of tree UIs
*/
- public void renderTreeString(StringBuffer buf, Map context, TreeStringRenderer treeStringRenderer) throws GeneralException {
+ public void renderTreeString(StringBuffer buf, Map<String, Object> context, TreeStringRenderer treeStringRenderer) throws GeneralException {
Map parameters = (Map) context.get("parameters");
setWidgetBoundaryComments(context);
@@ -389,7 +389,7 @@
}
- public void renderNodeString(Writer writer, Map context,
+ public void renderNodeString(Writer writer, Map<String, Object> context,
TreeStringRenderer treeStringRenderer, int depth, boolean isLast)
throws IOException, GeneralException {
boolean passed = true;
@@ -507,7 +507,7 @@
}
}
- public boolean hasChildren(Map context) {
+ public boolean hasChildren(Map<String, Object> context) {
boolean hasChildren = false;
Long nodeCount = null;
@@ -585,7 +585,7 @@
return hasChildren;
}
- public void getChildren(Map context) {
+ public void getChildren(Map<String, Object> context) {
this.subNodeValues = new ArrayList();
Iterator nodeIter = subNodeList.iterator();
while (nodeIter.hasNext()) {
@@ -687,7 +687,7 @@
return expandCollapseStyle;
}
- public String getWrapStyle(Map context) {
+ public String getWrapStyle(Map<String, Object> context) {
String val = this.wrapStyleExdr.expandString(context);
if (UtilValidate.isEmpty(val)) {
val = this.modelTree.getWrapStyle(context);
@@ -773,7 +773,7 @@
return this.rootNode;
}
- public String getNodeName(Map context) {
+ public String getNodeName(Map<String, Object> context) {
return this.nodeNameExdr.expandString(context);
}
@@ -807,7 +807,7 @@
this.styleExdr = new FlexibleStringExpander(labelElement.getAttribute("style"));
}
- public void renderLabelString(Writer writer, Map context, TreeStringRenderer treeStringRenderer) {
+ public void renderLabelString(Writer writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) {
try {
treeStringRenderer.renderLabel(writer, context, this);
} catch (IOException e) {
@@ -817,15 +817,15 @@
}
}
- public String getText(Map context) {
+ public String getText(Map<String, Object> context) {
return this.textExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
}
@@ -882,7 +882,7 @@
}
- public void renderLinkString(Writer writer, Map context, TreeStringRenderer treeStringRenderer) {
+ public void renderLinkString(Writer writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) {
try {
treeStringRenderer.renderLink(writer, context, this);
} catch (IOException e) {
@@ -892,30 +892,30 @@
}
}
- public String getText(Map context) {
+ public String getText(Map<String, Object> context) {
return this.textExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
- public String getName(Map context) {
+ public String getName(Map<String, Object> context) {
return this.nameExdr.expandString(context);
}
- public String getTitle(Map context) {
+ public String getTitle(Map<String, Object> context) {
return this.titleExdr.expandString(context);
}
- public String getTarget(Map context) {
+ public String getTarget(Map<String, Object> context) {
return this.targetExdr.expandString(context);
}
- public String getTargetWindow(Map context) {
+ public String getTargetWindow(Map<String, Object> context) {
return this.targetWindowExdr.expandString(context);
}
@@ -923,7 +923,7 @@
return this.urlMode;
}
- public String getPrefix(Map context) {
+ public String getPrefix(Map<String, Object> context) {
return this.prefixExdr.expandString(context);
}
@@ -1034,7 +1034,7 @@
}
- public void renderImageString(Writer writer, Map context, TreeStringRenderer treeStringRenderer) {
+ public void renderImageString(Writer writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) {
try {
treeStringRenderer.renderImage(writer, context, this);
} catch (IOException e) {
@@ -1044,27 +1044,27 @@
}
}
- public String getSrc(Map context) {
+ public String getSrc(Map<String, Object> context) {
return this.srcExdr.expandString(context);
}
- public String getId(Map context) {
+ public String getId(Map<String, Object> context) {
return this.idExdr.expandString(context);
}
- public String getStyle(Map context) {
+ public String getStyle(Map<String, Object> context) {
return this.styleExdr.expandString(context);
}
- public String getWidth(Map context) {
+ public String getWidth(Map<String, Object> context) {
return this.widthExdr.expandString(context);
}
- public String getHeight(Map context) {
+ public String getHeight(Map<String, Object> context) {
return this.heightExdr.expandString(context);
}
- public String getBorder(Map context) {
+ public String getBorder(Map<String, Object> context) {
return this.borderExdr.expandString(context);
}
@@ -1103,3 +1103,4 @@
}
}
+
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java Sat May 31 18:50:41 2008
@@ -70,7 +70,7 @@
this.modelTree = this.modelNode.getModelTree();
}
- public abstract void runAction(Map context);
+ public abstract void runAction(Map<String, Object> context);
/*
public static List readSubActions(ModelTree.ModelNode modelNode, Element parentElement) {
@@ -101,7 +101,7 @@
}
*/
- public static void runSubActions(List actions, Map context) {
+ public static void runSubActions(List actions, Map<String, Object> context) {
Iterator actionIter = actions.iterator();
while (actionIter.hasNext()) {
ModelTreeAction action = (ModelTreeAction) actionIter.next();
@@ -129,7 +129,7 @@
}
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
// default to false
boolean global = "true".equals(globalStr);
@@ -180,7 +180,7 @@
this.location = scriptElement.getAttribute("location");
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
if (location.endsWith(".bsh")) {
try {
context.put("_LIST_ITERATOR_", null);
@@ -237,7 +237,7 @@
this.fieldMap = EntityFinderUtil.makeFieldMap(serviceElement);
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
String serviceNameExpanded = this.serviceNameExdr.expandString(context);
if (UtilValidate.isEmpty(serviceNameExpanded)) {
throw new IllegalArgumentException("Service name was empty, expanded from: " + this.serviceNameExdr.getOriginal());
@@ -319,7 +319,7 @@
finder = new PrimaryKeyFinder(entityOneElement);
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
try {
finder.runFind(context, this.modelTree.getDelegator());
} catch (GeneralException e) {
@@ -345,7 +345,7 @@
finder = new ByAndFinder(entityAndElement);
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
try {
context.put(this.listName, null);
finder.runFind(context, this.modelTree.getDelegator());
@@ -379,7 +379,7 @@
finder = new ByConditionFinder(entityConditionElement);
}
- public void runAction(Map context) {
+ public void runAction(Map<String, Object> context) {
try {
context.put(this.listName, null);
finder.runFind(context, this.modelTree.getDelegator());
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java Sat May 31 18:50:41 2008
@@ -61,7 +61,7 @@
this.rootCondition = readCondition(modelTree, firstChildElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
if (rootCondition == null) {
return true;
}
@@ -75,7 +75,7 @@
this.modelTree = modelTree;
}
- public abstract boolean eval(Map context);
+ public abstract boolean eval(Map<String, Object> context);
}
public static List readSubConditions(ModelTree modelTree, Element conditionElement) {
@@ -128,7 +128,7 @@
this.subConditions = readSubConditions(modelTree, condElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
// return false for the first one in the list that is false, basic and algo
Iterator subConditionIter = this.subConditions.iterator();
while (subConditionIter.hasNext()) {
@@ -149,7 +149,7 @@
this.subConditions = readSubConditions(modelTree, condElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
// if more than one is true stop immediately and return false; if all are false return false; if only one is true return true
boolean foundOneTrue = false;
Iterator subConditionIter = this.subConditions.iterator();
@@ -176,7 +176,7 @@
this.subConditions = readSubConditions(modelTree, condElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
// return true for the first one in the list that is true, basic or algo
Iterator subConditionIter = this.subConditions.iterator();
while (subConditionIter.hasNext()) {
@@ -198,7 +198,7 @@
this.subCondition = readCondition(modelTree, firstChildElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
return !this.subCondition.eval(context);
}
}
@@ -213,7 +213,7 @@
this.actionExdr = new FlexibleStringExpander(condElement.getAttribute("action"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
// if no user is logged in, treat as if the user does not have permission
GenericValue userLogin = (GenericValue) context.get("userLogin");
if (userLogin != null) {
@@ -249,7 +249,7 @@
this.classExdr = new FlexibleStringExpander(condElement.getAttribute("class"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
String methodName = this.methodExdr.expandString(context);
String className = this.classExdr.expandString(context);
@@ -315,7 +315,7 @@
this.formatExdr = new FlexibleStringExpander(condElement.getAttribute("format"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
String value = this.valueExdr.expandString(context);
String format = this.formatExdr.expandString(context);
@@ -364,7 +364,7 @@
this.formatExdr = new FlexibleStringExpander(condElement.getAttribute("format"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
String format = this.formatExdr.expandString(context);
Object fieldVal = this.fieldAcsr.get(context);
@@ -407,7 +407,7 @@
this.exprExdr = new FlexibleStringExpander(condElement.getAttribute("expr"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
Object fieldVal = this.fieldAcsr.get(context);
String expr = this.exprExdr.expandString(context);
Pattern pattern = null;
@@ -440,7 +440,7 @@
this.fieldAcsr = new FlexibleMapAccessor(condElement.getAttribute("field-name"));
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
Object fieldVal = this.fieldAcsr.get(context);
return ObjectType.isEmpty(fieldVal);
}
@@ -453,7 +453,7 @@
this.permissionChecker = new EntityPermissionChecker(condElement);
}
- public boolean eval(Map context) {
+ public boolean eval(Map<String, Object> context) {
boolean passed = permissionChecker.runPermissionCheck(context);
return passed;
@@ -462,3 +462,4 @@
}
+
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeStringRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeStringRenderer.java?rev=662123&r1=662122&r2=662123&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeStringRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeStringRenderer.java Sat May 31 18:50:41 2008
@@ -29,11 +29,11 @@
*/
public interface TreeStringRenderer {
- public void renderNodeBegin(Writer writer, Map context, ModelTree.ModelNode node, int depth, boolean isLast) throws IOException;
- public void renderNodeEnd(Writer writer, Map context, ModelTree.ModelNode node) throws IOException;
- public void renderLabel(Writer writer, Map context, ModelTree.ModelNode.Label label) throws IOException;
- public void renderLink(Writer writer, Map context, ModelTree.ModelNode.Link link) throws IOException;
- public void renderImage(Writer writer, Map context, ModelTree.ModelNode.Image image) throws IOException;
- public void renderLastElement(Writer writer, Map context, ModelTree.ModelNode node) throws IOException;
- public ScreenStringRenderer getScreenStringRenderer( Map context);
+ public void renderNodeBegin(Writer writer, Map<String, Object> context, ModelTree.ModelNode node, int depth, boolean isLast) throws IOException;
+ public void renderNodeEnd(Writer writer, Map<String, Object> context, ModelTree.ModelNode node) throws IOException;
+ public void renderLabel(Writer writer, Map<String, Object> context, ModelTree.ModelNode.Label label) throws IOException;
+ public void renderLink(Writer writer, Map<String, Object> context, ModelTree.ModelNode.Link link) throws IOException;
+ public void renderImage(Writer writer, Map<String, Object> context, ModelTree.ModelNode.Image image) throws IOException;
+ public void renderLastElement(Writer writer, Map<String, Object> context, ModelTree.ModelNode node) throws IOException;
+ public ScreenStringRenderer getScreenStringRenderer( Map<String, Object> context);
}