svn commit: r763511 - in /ofbiz/trunk/framework/widget: config/ src/org/ofbiz/widget/fo/ src/org/ofbiz/widget/form/ src/org/ofbiz/widget/html/ src/org/ofbiz/widget/screen/ src/org/ofbiz/widget/text/ templates/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r763511 - in /ofbiz/trunk/framework/widget: config/ src/org/ofbiz/widget/fo/ src/org/ofbiz/widget/form/ src/org/ofbiz/widget/html/ src/org/ofbiz/widget/screen/ src/org/ofbiz/widget/text/ templates/

jacopoc
Author: jacopoc
Date: Thu Apr  9 04:14:38 2009
New Revision: 763511

URL: http://svn.apache.org/viewvc?rev=763511&view=rev
Log:
A bunch of fixes and enhancements to the new widget renderers based on Freemarker macros.
Converted to new technology the xsl-fo renderer and view handler.
Better handling of platform dependent templates included in screens: the proper one is now choosen according to the name of the renderer; the name is returned by a new method of the widget renderer interface.

Added:
    ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl   (with props)
Modified:
    ofbiz/trunk/framework/widget/config/widget.properties
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenStringRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
    ofbiz/trunk/framework/widget/templates/foScreenMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl

Modified: ofbiz/trunk/framework/widget/config/widget.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/config/widget.properties (original)
+++ ofbiz/trunk/framework/widget/config/widget.properties Thu Apr  9 04:14:38 2009
@@ -33,7 +33,9 @@
 widget.defaultNoConditionFind=N
 
 # Configurations for the Widget View Handlers implemented using the MacroScreenViewHandler
+#
 # html output
+screen.name=html
 screen.screenrenderer=component://widget/templates/htmlScreenMacroLibrary.ftl
 screen.formrenderer=component://widget/templates/htmlFormMacroLibrary.ftl
 screen.menurenderer=component://widget/templates/htmlMenuMacroLibrary.ftl
@@ -42,6 +44,7 @@
 screen.default.contenttype=UTF-8
 screen.default.encoding=none
 # text output
+screentext.name=text
 screentext.screenrenderer=component://widget/templates/textScreenMacroLibrary.ftl
 screentext.formrenderer=component://widget/templates/textFormMacroLibrary.ftl
 screentext.menurenderer=component://widget/templates/textMenuMacroLibrary.ftl
@@ -49,6 +52,7 @@
 screentext.default.contenttype=UTF-8
 screentext.default.encoding=none
 # xml output
+screenxml.name=xml
 screenxml.screenrenderer=component://widget/templates/xmlScreenMacroLibrary.ftl
 screenxml.formrenderer=component://widget/templates/xmlFormMacroLibrary.ftl
 screenxml.menurenderer=component://widget/templates/xmlMenuMacroLibrary.ftl
@@ -57,10 +61,11 @@
 screenxml.default.contenttype=UTF-8
 screenxml.default.encoding=none
 # fo output
-screenfop.screenrenderer=component://widget/templates/xmlScreenMacroLibrary.ftl
-screenfop.formrenderer=component://widget/templates/xmlFormMacroLibrary.ftl
-screenfop.menurenderer=component://widget/templates/xmlMenuMacroLibrary.ftl
-screenfop.treerenderer=component://widget/templates/xmlTreeMacroLibrary.ftl
+screenfop.name=xsl-fo
+screenfop.screenrenderer=component://widget/templates/foScreenMacroLibrary.ftl
+screenfop.formrenderer=component://widget/templates/foFormMacroLibrary.ftl
+screenfop.menurenderer=component://widget/templates/foMenuMacroLibrary.ftl
+screenfop.treerenderer=component://widget/templates/foTreeMacroLibrary.ftl
 screenfop.encoder=xml
 screenfop.default.contenttype=application/pdf
 screenfop.default.encoding=none

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java Thu Apr  9 04:14:38 2009
@@ -46,6 +46,10 @@
         return value;
     }
 
+    public String getRendererName() {
+        return "xsl-fo";
+    }
+
     public void renderSectionBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
         renderBeginningBoundaryComment(writer, section.isMainSection?"Screen":"Section Widget", section);
     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Thu Apr  9 04:14:38 2009
@@ -52,6 +52,7 @@
 import org.ofbiz.webapp.taglib.ContentUrlTag;
 import org.ofbiz.widget.ModelWidget;
 import org.ofbiz.widget.WidgetWorker;
+import org.ofbiz.widget.fo.FoScreenRenderer;
 import org.ofbiz.widget.form.FormStringRenderer;
 import org.ofbiz.widget.form.ModelForm;
 import org.ofbiz.widget.form.ModelFormField;
@@ -77,6 +78,8 @@
 import org.ofbiz.widget.form.ModelFormField.TextareaField;
 import org.ofbiz.widget.screen.ModelScreenWidget;
 
+import javolution.util.FastList;
+
 import freemarker.core.Environment;
 import freemarker.template.Template;
 import freemarker.template.TemplateException;
@@ -1072,11 +1075,29 @@
         if (this.renderPagination) {
             this.renderNextPrev(writer, context, modelForm);
         }
+        List<ModelFormField> childFieldList = modelForm.getFieldList();
+        List<String> columnStyleList = FastList.newInstance();
+        for (ModelFormField childField : childFieldList) {
+            int childFieldType = childField.getFieldInfo().getFieldType();
+            if (childFieldType == ModelFormField.FieldInfo.HIDDEN || childFieldType == ModelFormField.FieldInfo.IGNORED) {
+                continue;
+            }
+            String areaStyle = childField.getTitleAreaStyle();
+            if (UtilValidate.isEmpty(areaStyle)) {
+                areaStyle = "";
+            }
+            columnStyleList.add(areaStyle);
+        }
+        columnStyleList = StringUtil.quoteStrList(columnStyleList);
+        String columnStyleListString = StringUtil.join(columnStyleList, ", ");
+
         StringWriter sr = new StringWriter();
         sr.append("<@renderFormatListWrapperOpen ");
         sr.append(" style=\"");
         sr.append(modelForm.getDefaultTableStyle());
-        sr.append("\" />");
+        sr.append("\" columnStyles=[");
+        sr.append(columnStyleListString);
+        sr.append("] />");
         executeMacro(writer, sr.toString());
 
     }
@@ -1639,6 +1660,7 @@
         String formName = modelFormField.getModelForm().getCurrentFormName(context);
         StringBuilder targetParameterIter = new StringBuilder();
         StringBuilder imgSrc = new StringBuilder();
+        // FIXME: refactor using the StringUtils methods
         List<String> targetParameterList = lookupField.getTargetParameterList();
         targetParameterIter.append("[");
         for (String targetParameter: targetParameterList) {

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java Thu Apr  9 04:14:38 2009
@@ -67,6 +67,10 @@
         return "hsr" + elementId;
     }
 
+    public String getRendererName() {
+        return module;
+    }
+
     public void renderSectionBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
         renderBeginningBoundaryComment(writer, section.isMainSection?"Screen":"Section Widget", section);
     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Thu Apr  9 04:14:38 2009
@@ -47,6 +47,7 @@
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.GenericDelegator;
@@ -73,12 +74,14 @@
     public static final String module = MacroScreenRenderer.class.getName();
     private Template macroLibrary;
     private Environment environment;
+    private String rendererName;
     private int elementId = 999;
 
-    public MacroScreenRenderer(String macroLibraryPath, Appendable writer) throws TemplateException, IOException {
+    public MacroScreenRenderer(String name, String macroLibraryPath, Appendable writer) throws TemplateException, IOException {
         macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath);
         Map<String, Object> input = UtilMisc.toMap("key", null);
         environment = FreeMarkerWorker.renderTemplate(macroLibrary, input, writer);
+        rendererName = name;
     }
 
     private String getNextElementId() {
@@ -100,6 +103,10 @@
         }
     }
 
+    public String getRendererName() {
+        return rendererName;
+    }
+
     public void renderSectionBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
         // TODO: not implemented FIXME
     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java Thu Apr  9 04:14:38 2009
@@ -93,7 +93,7 @@
                 writer = new StandardCompress().getWriter(writer, null);
             }
 
-            ScreenStringRenderer screenStringRenderer = new MacroScreenRenderer(UtilProperties.getPropertyValue("widget", getName() + ".screenrenderer"), writer);
+            ScreenStringRenderer screenStringRenderer = new MacroScreenRenderer(UtilProperties.getPropertyValue("widget", getName() + ".name"), UtilProperties.getPropertyValue("widget", getName() + ".screenrenderer"), writer);
             FormStringRenderer formStringRenderer = new MacroFormRenderer(UtilProperties.getPropertyValue("widget", getName() + ".formrenderer"), writer, request, response);
             // TODO: uncomment these lines when the renderers are implemented
             //TreeStringRenderer treeStringRenderer = new MacroTreeRenderer(UtilProperties.getPropertyValue("widget", getName() + ".treerenderer"), writer);

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=763511&r1=763510&r2=763511&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 Thu Apr  9 04:14:38 2009
@@ -966,20 +966,11 @@
 
         public void renderWidgetString(Appendable writer, Map<String, Object> context, ScreenStringRenderer screenStringRenderer) throws GeneralException, IOException {
             ModelScreenWidget subWidget = null;
-            if (screenStringRenderer instanceof FoScreenRenderer) {
-                subWidget = (ModelScreenWidget)subWidgets.get("xsl-fo");
-                if (subWidget == null) {
-                    // This is here for backward compatibility
-                    Debug.logWarning("In platform-dependent could not find template for xsl-fo, using the one for html.", module);
-                    subWidget = (ModelScreenWidget)subWidgets.get("html");
-                }
-            } else {
-                FormStringRenderer formRenderer = (FormStringRenderer)context.get("formStringRenderer");
-                if (formRenderer instanceof XmlFormRenderer) {
-                    subWidget = (ModelScreenWidget)subWidgets.get("xml");
-                } else {
-                    subWidget = (ModelScreenWidget)subWidgets.get("html");
-                }
+            subWidget = (ModelScreenWidget)subWidgets.get(screenStringRenderer.getRendererName());
+            if (subWidget == null) {
+                // This is here for backward compatibility
+                Debug.logWarning("In platform-dependent could not find template for " + screenStringRenderer.getRendererName() + ", using the one for html.", module);
+                subWidget = (ModelScreenWidget)subWidgets.get("html");
             }
             if (subWidget != null) {
                 subWidget.renderWidgetString(writer, context, screenStringRenderer);

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java Thu Apr  9 04:14:38 2009
@@ -29,12 +29,16 @@
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.webapp.view.AbstractViewHandler;
 import org.ofbiz.webapp.view.ApacheFopWorker;
 import org.ofbiz.webapp.view.ViewHandlerException;
 import org.ofbiz.widget.fo.FoFormRenderer;
 import org.ofbiz.widget.fo.FoScreenRenderer;
-import org.ofbiz.widget.html.HtmlScreenRenderer;;
+import org.ofbiz.widget.form.FormStringRenderer;
+import org.ofbiz.widget.form.MacroFormRenderer;
+import org.ofbiz.widget.html.HtmlScreenRenderer;
 
 /**
  * Uses XSL-FO formatted templates to generate PDF, PCL, POSTSCRIPT etc.  views
@@ -45,7 +49,6 @@
     protected static final String DEFAULT_ERROR_TEMPLATE = "component://common/widget/CommonScreens.xml#FoError";
 
     protected ServletContext servletContext = null;
-    protected FoScreenRenderer foScreenRenderer = new FoScreenRenderer();
 
     /**
      * @see org.ofbiz.webapp.view.ViewHandler#init(javax.servlet.ServletContext)
@@ -62,12 +65,17 @@
         // render and obtain the XSL-FO
         Writer writer = new StringWriter();
         try {
-            ScreenRenderer screens = new ScreenRenderer(writer, null, foScreenRenderer);
+            ScreenStringRenderer screenStringRenderer = new MacroScreenRenderer(UtilProperties.getPropertyValue("widget", getName() + ".name"), UtilProperties.getPropertyValue("widget", getName() + ".screenrenderer"), writer);
+            FormStringRenderer formStringRenderer = new MacroFormRenderer(UtilProperties.getPropertyValue("widget", getName() + ".formrenderer"), writer, request, response);
+            // TODO: uncomment these lines when the renderers are implemented
+            //TreeStringRenderer treeStringRenderer = new MacroTreeRenderer(UtilProperties.getPropertyValue("widget", getName() + ".treerenderer"), writer);
+            //MenuStringRenderer menuStringRenderer = new MacroMenuRenderer(UtilProperties.getPropertyValue("widget", getName() + ".menurenderer"), writer);
+            ScreenRenderer screens = new ScreenRenderer(writer, null, screenStringRenderer);
             screens.populateContextForRequest(request, response, servletContext);
 
             // this is the object used to render forms from their definitions
-            screens.getContext().put("formStringRenderer", new FoFormRenderer(request, response));
-            screens.getContext().put("simpleEncoder", StringUtil.xmlEncoder);
+            screens.getContext().put("formStringRenderer", formStringRenderer);
+            screens.getContext().put("simpleEncoder", StringUtil.getEncoder(UtilProperties.getPropertyValue("widget", getName() + ".encoder")));
             screens.render(page);
         } catch (Exception e) {
             renderError("Problems with the response writer/output stream", e, request, response);
@@ -81,6 +89,9 @@
         }
         if (Debug.verboseOn()) Debug.logVerbose("XSL:FO Screen Output: " + screenOutString, module);
 
+        if (UtilValidate.isEmpty(contentType)) {
+            contentType = UtilProperties.getPropertyValue("widget", getName() + ".default.contenttype");
+        }
         Reader reader = new StringReader(screenOutString);
         StreamSource src = new StreamSource(reader);
         ByteArrayOutputStream out = new ByteArrayOutputStream();

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=763511&r1=763510&r2=763511&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 Thu Apr  9 04:14:38 2009
@@ -27,6 +27,7 @@
  * Widget Library - Screen String Renderer interface.
  */
 public interface ScreenStringRenderer {
+    public String getRendererName();
     public void renderSectionBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException;
     public void renderSectionEnd(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException;
     public void renderContainerBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Container container) throws IOException;

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=763511&r1=763510&r2=763511&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 Thu Apr  9 04:14:38 2009
@@ -35,6 +35,10 @@
 
     public TextScreenRenderer() {}
 
+    public String getRendererName() {
+        return "text";
+    }
+
     public void renderSectionBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
         // do nothing, this is just a place holder container for HTML
     }

Added: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=763511&view=auto
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (added)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Thu Apr  9 04:14:38 2009
@@ -0,0 +1,132 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#macro getFoStyle style>
+    <#assign foStyles = {
+        "listtitlestyle":"font-weight=\"bold\" text-align=\"center\" border=\"solid black\" padding=\"2pt\"",
+        "tabletext":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"",
+        "tabletextright":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"",
+        "tableheadverysmall":"column-width=\"0.3in\"",
+        "tableheadsmall":"column-width=\"0.5in\"",
+        "tableheadmedium":"column-width=\"1.5in\"",
+        "tableheadwide":"column-width=\"3in\"",
+        "head1":"font-size=\"12\" font-weight=\"bold\"",
+        "head2":"font-weight=\"bold\"",
+        "head3":"font-weight=\"bold\" font-style=\"italic\"",
+        "error":"color=\"red\""}/>
+    <#assign foStyle = foStyles[style]?default("")/>
+    ${foStyle?default("")}
+</#macro>
+<#macro makeBlock style text><fo:block<#if style?has_content> <@getFoStyle style/></#if>><#if text?exists>${text?xml}</#if></fo:block></#macro>
+
+
+<#macro renderField text><#if text?exists>${text}</#if></#macro>
+
+<#macro renderDisplayField idName description class alert><@makeBlock class description /></#macro>
+<#macro renderHyperlinkField></#macro>
+
+<#macro renderTextField name className alert value textSize maxlength id event action clientAutocomplete ajaxUrl ajaxEnabled><@makeBlock className value /></#macro>
+
+<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons><@makeBlock className value /></#macro>
+
+<#macro renderDateTimeField name className alert title value size maxlength id dateType shortDateInput timeDropdownParamName defaultDateTimeString calGif localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName><@makeBlock className value /></#macro>
+
+<#macro renderDropDownField name className alert id multiple formName otherFieldName event action size firstInList currentValue explicitDescription allowEmpty options fieldName otherFieldName otherValue otherFieldSize dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars choices autoSelect partialSearch partialChars ignoreCase fullSearch>
+<#if currentValue?has_content && firstInList?has_content>
+<@makeBlock "" explicitDescription />
+<#else>
+<#list options as item>
+<@makeBlock "" item.description />
+</#list>
+</#if>
+</#macro>
+
+<#macro renderCheckField items className alert allChecked currentValue name event action><@makeBlock "" "" /></#macro>
+<#macro renderRadioField items className alert currentValue noCurrentSelectedKey name event ation><@makeBlock "" "" /></#macro>
+
+<#macro renderSubmitField buttonType className alert formName title name event action imgSrc><@makeBlock "" "" /></#macro>
+<#macro renderResetField className alert name title><@makeBlock "" "" /></#macro>
+
+<#macro renderHiddenField name value></#macro>
+<#macro renderIgnoredField></#macro>
+
+<#macro renderFieldTitle style title>${title?default("")}</#macro>
+<#macro renderSingleFormFieldTitle title>${title?default("")}</#macro>
+    
+<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit></#macro>
+<#macro renderFormClose focusFieldName formName></#macro>
+<#macro renderMultiFormClose></#macro>
+    
+<#macro renderFormatListWrapperOpen style columnStyles><fo:table border="solid black"><#list columnStyles as columnStyle><fo:table-column<#if columnStyle?has_content> <@getFoStyle columnStyle/></#if>/></#list></#macro>
+<#macro renderFormatListWrapperClose></fo:table-body></fo:table></#macro>
+
+<#macro renderFormatHeaderRowOpen style><fo:table-header><fo:table-row></#macro>
+<#macro renderFormatHeaderRowClose></fo:table-row></fo:table-header><fo:table-body>
+<#-- FIXME: this is an hack to avoid FOP rendering errors for empty lists (fo:table-body cannot be null) -->
+<fo:table-row><fo:table-cell><fo:block/></fo:table-cell></fo:table-row>
+</#macro>
+<#macro renderFormatHeaderRowCellOpen style positionSpan><fo:table-cell <#if positionSpan?has_content && positionSpan gt 1 >number-columns-spanned="${positionSpan}"</#if><@getFoStyle "listtitlestyle"/>><fo:block></#macro>
+<#macro renderFormatHeaderRowCellClose></fo:block></fo:table-cell></#macro>
+
+<#macro renderFormatHeaderRowFormCellOpen style><fo:table-cell></#macro>
+<#macro renderFormatHeaderRowFormCellClose></fo:table-cell></#macro>
+<#macro renderFormatHeaderRowFormCellTitleSeparator style isLast></#macro>
+    
+<#macro renderFormatItemRowOpen itemIndex altRowStyles evenRowStyle oddRowStyle><fo:table-row></#macro>
+<#macro renderFormatItemRowClose></fo:table-row></#macro>
+<#macro renderFormatItemRowCellOpen style positionSpan><fo:table-cell <#if positionSpan?has_content && positionSpan gt 1 >number-columns-spanned="${positionSpan}"</#if><#if style?has_content><@getFoStyle style/><#else><@getFoStyle "tabletext"/></#if>></#macro>
+<#macro renderFormatItemRowCellClose></fo:table-cell></#macro>
+<#macro renderFormatItemRowFormCellOpen style><fo:table-cell></#macro>
+<#macro renderFormatItemRowFormCellClose></fo:table-cell></#macro>
+
+<#-- TODO: multi columns (position attribute) in single forms are still not implemented -->
+<#macro renderFormatSingleWrapperOpen style><fo:table><fo:table-column column-width="2in"/><fo:table-column/><fo:table-body></#macro>
+<#macro renderFormatSingleWrapperClose></fo:table-body></fo:table></#macro>
+
+<#macro renderFormatFieldRowOpen><fo:table-row></#macro>
+<#macro renderFormatFieldRowClose></fo:table-row></#macro>
+<#macro renderFormatFieldRowTitleCellOpen style><fo:table-cell font-weight="bold" text-align="right" padding="3pt"><fo:block></#macro>
+<#macro renderFormatFieldRowTitleCellClose></fo:block></fo:table-cell></#macro>
+<#macro renderFormatFieldRowSpacerCell></#macro>
+<#macro renderFormatFieldRowWidgetCellOpen positionSpan style><fo:table-cell text-align="left" padding="2pt" padding-left="5pt"></#macro>
+<#macro renderFormatFieldRowWidgetCellClose></fo:table-cell></#macro>
+
+<#macro renderFormatEmptySpace> </#macro>
+
+<#macro renderTextFindField name value defaultOption opEquals opBeginsWith opContains opIsEmpty opNotEqual className alert size maxlength autocomplete titleStyle hideIgnoreCase ignCase ignoreCase><@makeBlock className value /></#macro>
+
+<#macro renderDateFindField className alert name localizedInputTitle value size maxlength dateType formName defaultDateTimeString imgSrc localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan opUpToDay opUpThruDay opIsEmpty><@makeBlock className value /></#macro>
+
+<#macro renderRangeFindField className alert name value size maxlength autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan opGreaterThanEquals value2 defaultOptionThru><@makeBlock className value /></#macro>
+
+<#macro renderLookupField className alert name value size maxlength autocomplete descriptionFieldName formName lookupFieldFormName targetParameterIter imgSrc><<@makeBlock className value /></#macro>
+<#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel></#macro>
+<#macro renderFileField className alert name value size maxlength autocomplete><@makeBlock className value /></#macro>
+<#macro renderPasswordField className alert name value size maxlength id autocomplete><@makeBlock className "" /></#macro>
+<#macro renderImageField value border width height event action><@makeBlock "" "" /></#macro>
+<#macro renderBanner style leftStyle rightStyle leftText text rightText><@makeBlock "" "" /></#macro>
+<#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId collapsible expandToolTip collapseToolTip></#macro>
+<#macro renderFieldGroupClose style id title></#macro>
+
+<#macro renderHyperlinkTitle name title></#macro>
+<#macro renderSortField style title linkUrl ajaxEnabled></#macro>
+<#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
+<#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro>
+<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc linkUrl targetWindow description><@renderField description /></#macro>
+<#macro renderTooltip tooltip tooltipStyle></#macro>
+<#macro renderAsterisks requiredField requiredStyle></#macro>

Propchange: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/widget/templates/foScreenMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foScreenMacroLibrary.ftl?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foScreenMacroLibrary.ftl Thu Apr  9 04:14:38 2009
@@ -16,23 +16,26 @@
 specific language governing permissions and limitations
 under the License.
 -->
-
-<#assign foStyles = {
-    "tabletext":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"",
-    "tabletextright":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"",
-    "tableheadverysmall":"column-width=\"0.3in\"",
-    "tableheadsmall":"column-width=\"0.5in\"",
-    "tableheadmedium":"column-width=\"1.5in\"",
-    "tableheadwide":"column-width=\"3in\"",
-    "head1":"font-size=\"12\" font-weight=\"bold\"",
-    "head2":"font-weight=\"bold\"",
-    "head3":"font-weight=\"bold\" font-style=\"italic\"",
-    "error":"color=\"red\""}/>
+<#macro getFoStyle style>
+    <#assign foStyles = {
+        "tabletext":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"",
+        "tabletextright":"border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"",
+        "tableheadverysmall":"column-width=\"0.3in\"",
+        "tableheadsmall":"column-width=\"0.5in\"",
+        "tableheadmedium":"column-width=\"1.5in\"",
+        "tableheadwide":"column-width=\"3in\"",
+        "head1":"font-size=\"12\" font-weight=\"bold\"",
+        "head2":"font-weight=\"bold\"",
+        "head3":"font-weight=\"bold\" font-style=\"italic\"",
+        "error":"color=\"red\""}/>
+    <#assign foStyle = foStyles[style]?default("")/>
+    ${foStyle?default("")}
+</#macro>
 
 <#macro renderSectionBegin></#macro>
 <#macro renderSectionEnd>
 </#macro>
-<#macro renderContainerBegin containerId style autoUpdateLink autoUpdateInterval><fo:block <#if style?has_content>${foStyles[style]}</#if>></#macro>
+<#macro renderContainerBegin id style autoUpdateLink autoUpdateInterval><fo:block <#if style?has_content><@getFoStyle style/></#if>></#macro>
 <#macro renderContainerEnd></fo:block></#macro>
 <#macro renderContentBegin></#macro>
 <#macro renderContentBody></#macro>
@@ -42,7 +45,7 @@
 <#macro renderSubContentEnd></#macro>
 
 <#macro renderHorizontalSeparator id style><fo:block><fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.1mm" color="black"/></fo:block></#macro>
-<#macro renderLabel text id style><#if text?exists>${text}</#if></#macro>
+<#macro renderLabel text id style><#if text?exists><#if style?has_content><fo:inline <@getFoStyle style/>></#if>${text}<#if style?has_content></fo:inline></#if></#if></#macro>
 <#macro renderLink></#macro>
 <#macro renderImage></#macro>
 

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Apr  9 04:14:38 2009
@@ -156,7 +156,7 @@
 <#macro renderFormClose focusFieldName formName></form><#if focusFieldName?has_content><script language="JavaScript" type="text/javascript">document.${formName}.${focusFieldName}.focus();</script></#if></#macro>
 <#macro renderMultiFormClose></#macro>
 
-<#macro renderFormatListWrapperOpen style>  <table cellspacing="0" class="<#if style?has_content>${style}<#else>basic-table form-widget-table dark-grid</#if>" > </#macro>
+<#macro renderFormatListWrapperOpen style columnStyles>  <table cellspacing="0" class="<#if style?has_content>${style}<#else>basic-table form-widget-table dark-grid</#if>" > </#macro>
 <#macro renderFormatListWrapperClose> </table></#macro>
 
 <#macro renderFormatHeaderRowOpen style>  <tr class="<#if style?has_content>${style}<#else>header-row</#if>"></#macro>
@@ -333,7 +333,7 @@
 </#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete><input type="file" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#macro>
 <#macro renderPasswordField className alert name value size maxlength id autocomplete><input type="password" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/></#macro>
-<#macro renderImageFiel value border width height event action><img<#if value?has_content> src="${value}"</#if><#if border?has_content> border="${border}"</#if><#if width?has_content> width="${width}"</#if><#if height?has_content> height="${height}"</#if><#if event?has_content> ${rp.event?html}="${action}" </#if>/></#macro>
+<#macro renderImageField value border width height event action><img<#if value?has_content> src="${value}"</#if><#if border?has_content> border="${border}"</#if><#if width?has_content> width="${width}"</#if><#if height?has_content> height="${height}"</#if><#if event?has_content> ${rp.event?html}="${action}" </#if>/></#macro>
 <#macro renderBanner style leftStyle rightStyle leftText text rightText>
 <table width="100%">  <tr><#rt/>
 <#if leftText?has_content><td align="left"><#if leftStyle?has_content><div class="${leftStyle}"></#if>${leftText}<#if leftStyle?has_content></div></#if></td><#rt/></#if>

Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=763511&r1=763510&r2=763511&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Thu Apr  9 04:14:38 2009
@@ -54,7 +54,7 @@
 <#macro renderFormClose focusFieldName formName></#macro>
 <#macro renderMultiFormClose></#macro>
 
-<#macro renderFormatListWrapperOpen style></#macro>
+<#macro renderFormatListWrapperOpen style columnStyles></#macro>
 <#macro renderFormatListWrapperClose></#macro>
 
 <#macro renderFormatHeaderRowOpen style></#macro>