Author: nmalin
Date: Fri Jun 12 16:25:30 2015
New Revision: 1685124

URL: http://svn.apache.org/r1685124
Log:
Resynchronise template macro form xml, text, csv and fo from html related to 
issue OFBIZ-6461.
adding unit test that call webtools/control/WebtoolsLayoutDemo with html, text, 
csv, xml and fop render and detect on the stream if an FTl stacktrace is 
present.
The fop test is currently commented because the screenfop failed to generate 
WebtoolsLayoutDemo page.
To support the unit case, the screen engine has been extend to manage 
platform-specific : <text> and <csv>

Added:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/
    
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
   (with props)
    ofbiz/trunk/framework/widget/testdef/
    ofbiz/trunk/framework/widget/testdef/widgettests.xml   (with props)
Modified:
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/trunk/framework/webtools/widget/CommonScreens.xml
    ofbiz/trunk/framework/webtools/widget/Menus.xml
    ofbiz/trunk/framework/webtools/widget/MiscScreens.xml
    ofbiz/trunk/framework/widget/build.xml
    ofbiz/trunk/framework/widget/dtd/widget-screen.xsd
    ofbiz/trunk/framework/widget/ofbiz-component.xml
    
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java
    
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
    ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/csvScreenMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/textScreenMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/xmlScreenMacroLibrary.ftl

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Fri Jun 12 16:25:30 
2015
@@ -12453,6 +12453,22 @@
         <value xml:lang="zh-CN">查看</value>
         <value xml:lang="zh-TW">檢視</value>
     </property>
+    <property key="CommonViewAsCsv">
+        <value xml:lang="en">View as csv</value>
+        <value xml:lang="fr">Voir en csv</value>
+    </property>
+    <property key="CommonViewAsPdf">
+        <value xml:lang="en">View as Pdf</value>
+        <value xml:lang="fr">Voir en Pdf</value>
+    </property>
+    <property key="CommonViewAsText">
+        <value xml:lang="en">View as text</value>
+        <value xml:lang="fr">Voir en texte</value>
+    </property>
+    <property key="CommonViewAsXml">
+        <value xml:lang="en">View as xml</value>
+        <value xml:lang="fr">Voir en xml</value>
+    </property>
     <property key="CommonViewBlocked">
         <value xml:lang="ar">تم حظر الدخول على هذه 
الصفحة</value>
         <value xml:lang="de">Zugriff auf diese Sicht wurde blockiert.</value>

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Fri Jun 12 16:25:30 
2015
@@ -505,6 +505,8 @@ under the License.
                     <html><html-template 
location="component://common/webcommon/includes/simple.ftl"/></html>
                     <xsl-fo><html-template 
location="component://common/webcommon/includes/simple.fo.ftl"/></xsl-fo>
                     <xml><html-template 
location="component://common/webcommon/includes/minimal-decorator.ftl"/></xml>
+                    <text><html-template 
location="component://common/webcommon/includes/minimal-decorator.ftl"/></text>
+                    <csv><html-template 
location="component://common/webcommon/includes/minimal-decorator.ftl"/></csv>
                 </platform-specific>
             </widgets>
         </section>

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml Fri Jun 12 
16:25:30 2015
@@ -5674,6 +5674,14 @@
         <value 
xml:lang="zh">冗长级别会细颗粒地指出应用程序进行情
况的信息,适于调试程序。</value>
         <value 
xml:lang="zh-TW">冗長級別會細顆粒地指出應用程式進行情
況的資訊,適于偵錯程式.</value>
     </property>
+    <property key="WebtoolsViewAsPdfTheHtmlLayoutDemo">
+        <value xml:lang="en">View as Pdf the html layout : testing macro 
template ftl and global render (but not forcing the screen coherence)</value>
+        <value xml:lang="fr">Voir en Pdf la disposition html : permet de 
tester les modèles de macro ftl et le rendu global (mais pas forcement la 
cohérence d'écran)</value>
+    </property>
+    <property key="WebtoolsViewAsTextTheHtmlLayoutDemo">
+        <value xml:lang="en">View as text (xml, csv and text) the html layout 
: testing macro template ftl and global render (but not forcing the screen 
coherence)</value>
+        <value xml:lang="fr">Voir en text (xml, csv, text) la disposition html 
: permet de tester les modèles de macro ftl et le rendu global (mais pas 
forcement la cohérence d'écran)</value>
+    </property>
     <property key="WebtoolsViewComponents">
         <value xml:lang="de">Komponenten ansehen</value>
         <value xml:lang="en">View Components</value>

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml 
(original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml Fri 
Jun 12 16:25:30 2015
@@ -566,7 +566,7 @@ under the License.
             <redirect-parameter name="noConditionFind"/>
         </response>
         <response name="error" type="view" value="FindGeo"/>
-    </request-map>    
+    </request-map>
     <request-map uri="linkGeos">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="linkGeos"/>
@@ -577,11 +577,12 @@ under the License.
         <security https="true" auth="true"/>
         <response name="success" type="view" value="FindUserLogin"/>
     </request-map>
-    
-    <request-map uri="WebtoolsLayoutDemo">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="WebtoolsLayoutDemo"/>
-    </request-map>
+
+    <request-map uri="WebtoolsLayoutDemo"><security https="true" 
auth="true"/><response name="success" type="view" 
value="WebtoolsLayoutDemo"/></request-map>
+    <request-map uri="WebtoolsLayoutDemoFop"><security https="true" 
auth="true"/><response name="success" type="view" 
value="WebtoolsLayoutDemoFop"/></request-map>
+    <request-map uri="WebtoolsLayoutDemoText"><security https="true" 
auth="true"/><response name="success" type="view" 
value="WebtoolsLayoutDemoText"/></request-map>
+    <request-map uri="WebtoolsLayoutDemoXml"><security https="true" 
auth="true"/><response name="success" type="view" 
value="WebtoolsLayoutDemoXml"/></request-map>
+    <request-map uri="WebtoolsLayoutDemoCsv"><security https="true" 
auth="true"/><response name="success" type="view" 
value="WebtoolsLayoutDemoCsv"/></request-map>
 
     <!-- end of request mappings -->
 
@@ -677,8 +678,13 @@ under the License.
     <view-map name="EditGeo" type="screen" 
page="component://webtools/widget/GeoManagementScreens.xml#EditGeo"/>
     <view-map name="LinkGeos" type="screen" 
page="component://webtools/widget/GeoManagementScreens.xml#LinkGeos"/>
     <view-map name="LookupGeo" type="screen" 
page="component://webtools/widget/GeoManagementScreens.xml#LookupGeo"/>
-    
+
+    <!-- Layout Demo -->
     <view-map name="WebtoolsLayoutDemo" 
page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemo" 
type="screen"/>
+    <view-map name="WebtoolsLayoutDemoFop" 
page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoFop" 
type="screenfop" content-type="application/pdf" encoding="none"/>
+    <view-map name="WebtoolsLayoutDemoText" 
page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" 
type="screentext"/>
+    <view-map name="WebtoolsLayoutDemoXml" 
page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" 
content-type="text/xml" type="screenxml"/>
+    <view-map name="WebtoolsLayoutDemoCsv" 
page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" 
content-type="text/csv" type="screencsv"/>
 
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/framework/webtools/widget/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/CommonScreens.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/CommonScreens.xml Fri Jun 12 16:25:30 
2015
@@ -94,6 +94,20 @@ under the License.
         </section>
     </screen>
 
+    <screen name="SimpleDecorator">
+        <section>
+            <actions>
+                <property-map resource="TemporalExpressionUiLabels" 
map-name="uiLabelMap" global="true"/>
+                <property-map resource="WebtoolsUiLabels" 
map-name="uiLabelMap" global="true"/>
+                <property-map resource="SecurityUiLabels" 
map-name="uiLabelMap" global="true"/>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
+            </actions>
+            <widgets>
+                <include-screen name="SimpleDecorator" 
location="component://common/widget/CommonScreens.xml"/>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="CommonEntityDecorator">
         <section>
             <actions>

Modified: ofbiz/trunk/framework/webtools/widget/Menus.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/Menus.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/Menus.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/Menus.xml Fri Jun 12 16:25:30 2015
@@ -296,6 +296,18 @@ under the License.
         </menu-item>
         <menu-item name="Disabled" title="${uiLabelMap.CommonDisabled}" 
widget-style="disabled">
         </menu-item>
+        <menu-item name="Pdf" title="${uiLabelMap.CommonViewAsPdf}">
+            <link target="${demoTargetUrl}Fop"/>
+        </menu-item>
+        <menu-item name="Text" title="${uiLabelMap.CommonViewAsText}">
+            <link target="${demoTargetUrl}Text" target-window="_blank"/>
+        </menu-item>
+        <menu-item name="Xml" title="${uiLabelMap.CommonViewAsXml}">
+            <link target="${demoTargetUrl}Xml" target-window="_blank"/>
+        </menu-item>
+        <menu-item name="Csv" title="${uiLabelMap.CommonViewAsCsv}">
+            <link target="${demoTargetUrl}Csv" target-window="_blank"/>
+        </menu-item>
     </menu>
 
 </menus>

Modified: ofbiz/trunk/framework/webtools/widget/MiscScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/MiscScreens.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/MiscScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/MiscScreens.xml Fri Jun 12 16:25:30 
2015
@@ -72,9 +72,10 @@ under the License.
                 <set field="altRowStyle" value=""/>
                 <set field="headerStyle" value="header-row-1"/>
                 <set field="tableStyle" value="basic-table light-grid"/>
+                <set field="mainDecoratorName" from-field="mainDecoratorName" 
default-value="main-decorator"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="${mainDecoratorName}" 
location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="pre-body">
                         <section>
                             <condition>
@@ -237,4 +238,29 @@ under the License.
         </section>
     </screen>
 
+    <screen name="WebtoolsLayoutDemoFop">
+        <section>
+            <actions>
+                <set field="mainDecoratorName" value="SimpleDecorator"/>
+                <property-map resource="WebtoolsUiLabels" 
map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <label 
style="h1">${uiLabelMap.WebtoolsViewAsPdfTheHtmlLayoutDemo}</label>
+                <include-screen name="WebtoolsLayoutDemo"/>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="WebtoolsLayoutDemoText">
+        <section>
+            <actions>
+                <set field="mainDecoratorName" value="SimpleDecorator"/>
+                <property-map resource="WebtoolsUiLabels" 
map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <label 
style="h1">${uiLabelMap.WebtoolsViewAsTextTheHtmlLayoutDemo}</label>
+                <include-screen name="WebtoolsLayoutDemo"/>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/framework/widget/build.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/build.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/build.xml (original)
+++ ofbiz/trunk/framework/widget/build.xml Fri Jun 12 16:25:30 2015
@@ -44,5 +44,11 @@ under the License.
         <fileset dir="../minilang/build/lib" includes="*.jar"/>
         <fileset dir="../webapp/lib" includes="*.jar"/>
         <fileset dir="../webapp/build/lib" includes="*.jar"/>
+        <fileset dir="../testtools/lib" includes="*.jar"/>
     </path>
+
+    <target name="jar" depends="classes">
+        <main-jar/>
+        <test-jar/>
+    </target>
 </project>

Modified: ofbiz/trunk/framework/widget/dtd/widget-screen.xsd
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-screen.xsd?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-screen.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-screen.xsd Fri Jun 12 16:25:30 2015
@@ -571,6 +571,8 @@ under the License.
                 <xs:element minOccurs="0" ref="swing" />
                 <xs:element minOccurs="0" ref="xsl-fo" />
                 <xs:element minOccurs="0" ref="xml" />
+                <xs:element minOccurs="0" ref="text" />
+                <xs:element minOccurs="0" ref="csv" />
             </xs:sequence>
         </xs:complexType>
     </xs:element>
@@ -594,6 +596,20 @@ under the License.
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" maxOccurs="unbounded" 
ref="HtmlWidgets" />
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="text">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" 
ref="HtmlWidgets" />
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="csv">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" 
ref="HtmlWidgets" />
             </xs:sequence>
         </xs:complexType>
     </xs:element>

Modified: ofbiz/trunk/framework/widget/ofbiz-component.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/ofbiz-component.xml?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/ofbiz-component.xml (original)
+++ ofbiz/trunk/framework/widget/ofbiz-component.xml Fri Jun 12 16:25:30 2015
@@ -25,4 +25,5 @@ under the License.
     <classpath type="dir" location="config"/>
     <classpath type="dir" location="dtd"/>
     <classpath type="jar" location="build/lib/*"/>
+    <test-suite loader="main" location="testdef/widgettests.xml"/>
 </ofbiz-component>

Modified: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java 
(original)
+++ 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java 
Fri Jun 12 16:25:30 2015
@@ -1294,6 +1294,10 @@ public abstract class ModelScreenWidget
                         subWidgets.put("xsl-fo", new HtmlWidget(modelScreen, 
childElement));
                     } else if ("xml".equals(childElement.getNodeName())) {
                         subWidgets.put("xml", new HtmlWidget(modelScreen, 
childElement));
+                    } else if ("text".equals(childElement.getNodeName())) {
+                        subWidgets.put("text", new HtmlWidget(modelScreen, 
childElement));
+                    } else if ("csv".equals(childElement.getNodeName())) {
+                        subWidgets.put("csv", new HtmlWidget(modelScreen, 
childElement));
                     } else {
                         throw new IllegalArgumentException("Tag not supported 
under the platform-specific tag with name: " + childElement.getNodeName());
                     }

Modified: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroScreenRenderer.java?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
 (original)
+++ 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
 Fri Jun 12 16:25:30 2015
@@ -232,7 +232,7 @@ public class MacroScreenRenderer impleme
         String linkType = 
WidgetWorker.determineAutoLinkType(link.getLinkType(), target, 
link.getUrlMode(), request);
         String linkUrl = "";
         String actionUrl = "";
-        StringBuilder parameters=new StringBuilder();
+        StringBuilder parameters = new StringBuilder();
         String width = link.getWidth();
         if (UtilValidate.isEmpty(width)) {
             width = "300";
@@ -259,7 +259,6 @@ public class MacroScreenRenderer impleme
                 parameters.append("'}");
             }
             parameters.append("]");
-
         }
         String id = link.getId(context);
         String style = link.getStyle(context);

Added: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java?rev=1685124&view=auto
==============================================================================
--- 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
 (added)
+++ 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
 Fri Jun 12 16:25:30 2015
@@ -0,0 +1,140 @@
+/*
+ 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.
+ */
+
+package org.ofbiz.widget.test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.fop.apps.Fop;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.collections.MapStack;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
+import org.ofbiz.entity.util.EntityUtilProperties;
+import org.ofbiz.security.Security;
+import org.ofbiz.security.SecurityFactory;
+import org.ofbiz.service.testtools.OFBizTestCase;
+import org.ofbiz.webapp.view.ApacheFopWorker;
+import org.ofbiz.widget.renderer.ScreenRenderer;
+import org.ofbiz.widget.renderer.ScreenStringRenderer;
+import org.ofbiz.widget.renderer.macro.MacroScreenRenderer;
+import org.springframework.mock.web.MockServletContext;
+
+public class WidgetMacroLibraryTests extends OFBizTestCase {
+
+    protected final String screenLocation = 
"component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemo"; //use 
existing screen to present most of layout use case
+    protected MapStack<String> context = null;
+    protected Appendable writer = null;
+
+    public WidgetMacroLibraryTests(String name) {
+        super(name);
+    }
+
+    protected void initScreens(String screenType) throws Exception {
+        GenericValue userLogin = 
EntityQuery.use(delegator).from("UserLogin").where("userLoginId", 
"system").queryOne();
+        TimeZone timeZone = TimeZone.getDefault();
+        Locale locale = Locale.getDefault();
+        context = MapStack.create();
+        context.put("userLogin", userLogin);
+        context.put("timeZone", timeZone);
+        context.put("locale", locale);
+        context.put("dispatcher", dispatcher);
+        context.put("delegator", delegator);
+        context.put("security", SecurityFactory.getInstance(delegator));
+        context.put("servletContext", new MockServletContext());
+        context.put("parameters", UtilMisc.toMap("mainDecoratorLocation", 
"component://webtools/widget/CommonScreens.xml"));
+
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        Appendable writer = new OutputStreamWriter(output, "UTF-8");
+        ScreenStringRenderer screenStringRenderer = new 
MacroScreenRenderer(EntityUtilProperties.getPropertyValue("widget", 
screenType.concat(".name"), delegator), 
EntityUtilProperties.getPropertyValue("widget", 
screenType.concat(".screenrenderer"), delegator));
+        context.put("screens", new ScreenRenderer(writer, context, 
screenStringRenderer));
+    }
+
+    public void testHtmlMacroLibrary() throws Exception {
+        initScreens("screen");
+        ScreenRenderer screens = (ScreenRenderer) context.get("screens");
+        screens.render(screenLocation);
+        String screenOutString = writer.toString();
+        assertNotNull("HtmlScreen failed to return the screen " + 
screenLocation, screenOutString);
+
+        //Test if a ftl macro error is present
+        assertTrue("Html Screen contains Macro on error : see 
https://localhost:8443/webtools/control/WebtoolsLayoutDemo for more detail", 
screenOutString.contains("FreeMarker template error:"));
+    }
+
+    public void testTextMacroLibrary() throws Exception {
+        initScreens("screentext");
+        ScreenRenderer screens = (ScreenRenderer) context.get("screens");
+        screens.render(screenLocation + "Text");
+        String screenOutString = writer.toString();
+        assertNotNull("TextScreen failed to return the screen " + 
screenLocation + "Text", screenOutString);
+
+        //Test if a ftl macro error is present
+        assertTrue("Text Screen contains Macro on error : see 
https://localhost:8443/webtools/control/WebtoolsLayoutDemoText for more 
detail", screenOutString.contains("FreeMarker template error:"));
+    }
+
+    public void testXmlMacroLibrary() throws Exception {
+        initScreens("screenxml");
+        ScreenRenderer screens = (ScreenRenderer) context.get("screens");
+        screens.render(screenLocation + "Text");
+
+        String screenOutString = writer.toString();
+        assertNotNull("XmlScreen failed to return the screen " + 
screenLocation + "Text", screenOutString);
+
+        //Test if a ftl macro error is present
+        assertTrue("Xml Screen contains Macro on error : see 
https://localhost:8443/webtools/control/WebtoolsLayoutDemoXml for more detail", 
screenOutString.contains("FreeMarker template error:"));
+    }
+
+    public void testCsvMacroLibrary() throws Exception {
+        initScreens("screencsv");
+        ScreenRenderer screens = (ScreenRenderer) context.get("screens");
+        screens.render(screenLocation + "Text");
+        String screenOutString = writer.toString();
+        assertNotNull("CsvScreen failed to return the screen " + 
screenLocation + "Text", screenOutString);
+
+        //Test if a ftl macro error is present
+        assertTrue("Csv Screen contains Macro on error : see 
https://localhost:8443/webtools/control/WebtoolsLayoutDemoCsv for more detail", 
screenOutString.contains("FreeMarker template error:"));
+    }
+
+    public void testFopMacroLibrary() throws Exception {
+        initScreens("screenfop");
+        ScreenRenderer screens = (ScreenRenderer) context.get("screens");
+        screens.render(screenLocation + "Fop");
+        String screenOutString = writer.toString();
+        assertNotNull("FopScreen failed to return the screen " + 
screenLocation + "Fop", screenOutString);
+        if (!screenOutString.startsWith("<?xml")) {
+            screenOutString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 
screenOutString;
+        }
+        Reader reader = new StringReader(screenOutString);
+        StreamSource src = new StreamSource(reader);
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try {
+            Fop fop = ApacheFopWorker.createFopInstance(out, 
"application/pdf");
+            ApacheFopWorker.transform(src, null, fop);
+        } catch (Exception e) {
+            assertTrue("Unable to transform FO file : see 
https://localhost:8443/webtools/control/WebtoolsLayoutDemoPdf for more detail" 
, false);
+        }
+    }
+}

Propchange: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -19,16 +19,16 @@ under the License.
 
 <#macro renderField text><#if text??>"${text?replace("\"", 
"\"\"")}"</#if></#macro>
 
-<#macro renderDisplayField type imageLocation idName description title class 
alert inPlaceEditorId="" inPlaceEditorUrl="" inPlaceEditorParams="">
+<#macro renderDisplayField type imageLocation idName description title class 
alert inPlaceEditorUrl="" inPlaceEditorParams="">
 <@renderField description />,<#rt/>
 </#macro>
 <#macro renderHyperlinkField></#macro>
 
-<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask placeholder 
tabindex><@renderField value /></#macro>
+<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex  readonly 
placeholder=""><@renderField value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons><@renderField value 
/></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength 
step timeValues id dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName tabindex mask><@renderField value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField 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 tabindex>
 <#if currentValue?has_content && firstInList?has_content>
@@ -53,7 +53,7 @@ under the License.
 <#macro renderFieldTitle style title id="" fieldHelpText="" 
for=""><@renderField title />,</#macro>
 <#macro renderSingleFormFieldTitle></#macro>
 
-<#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name useRowSubmit></#macro>
+<#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name viewIndexField viewSizeField viewIndex 
viewSize useRowSubmit></#macro>
 <#macro renderFormClose focusFieldName formName containerId 
hasRequiredField></#macro>
 <#macro renderMultiFormClose></#macro>
 
@@ -97,23 +97,26 @@ under the License.
 
 <#macro renderTextFindField name value defaultOption opEquals opBeginsWith 
opContains opIsEmpty opNotEqual className alert size maxlength autocomplete 
titleStyle hideIgnoreCase ignCase ignoreCase tabindex><@renderField 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 tabindex><@renderField value /></#macro>
+<#macro renderDateFindField className alert name localizedInputTitle value 
value2 size maxlength dateType formName defaultDateTimeString imgSrc 
localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals 
opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan 
opUpToDay opUpThruDay opIsEmpty tabindex><@renderField value /></#macro>
 
 <#macro renderRangeFindField className alert name value size maxlength 
autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan 
opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru 
tabindex>
 <@renderField value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event 
action readonly autocomplete descriptionFieldName formName fieldFormName 
targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height 
position fadeBackground clearText showDescription initiallyCollapsed 
tabindex></#macro>
+<#macro renderLookupField name formName fieldFormName className="" 
alert="false" value="" size="" maxlength="" id="" event="" action="" 
readonly=false autocomplete="" descriptionFieldName="" targetParameterIter="" 
imgSrc="" ajaxUrl="" ajaxEnabled=javaScriptEnabled presentation="layer" 
width="" height="" position="" fadeBackground="true" clearText="" 
showDescription="" initiallyCollapsed="" lastViewName="main" 
tabindex=""></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex 
listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl 
paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl 
paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl 
selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl 
paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel 
paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete 
tabindex><@renderField value /></#macro>
 <#macro renderPasswordField className alert name value size maxlength id 
autocomplete tabindex></#macro>
-<#macro renderImageField value description alternate border width height event 
action></#macro>
+<#macro renderImageField value description alternate style event 
action></#macro>
 <#macro renderBanner style leftStyle rightStyle leftText text 
rightText></#macro>
+<#macro renderContainerField id className></#macro>
 <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId 
collapsible expandToolTip collapseToolTip></#macro>
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
 <#macro renderSortField style title linkUrl ajaxEnabled 
tooltip=""><@renderFieldTitle style title /></#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 title 
alternate linkUrl targetWindow description confirmation><@renderField 
description />,<#rt/></#macro>
+<#macro renderAsterisks requiredField requiredStyle></#macro>
+<#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow></#macro>
+<#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc 
description confirmation><@renderField description /></#macro>
+<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation id><@renderField 
description />,<#rt/></#macro>
\ No newline at end of file

Modified: ofbiz/trunk/framework/widget/templates/csvScreenMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvScreenMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/csvScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/csvScreenMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -44,7 +44,7 @@ under the License.
         ${text}<#lt/>
     </#if>
 </#macro>
-<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name linkUrl text imgStr></#macro>
+<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name height width linkUrl text imgStr></#macro>
 <#macro renderImage src id style wid hgt border alt urlString></#macro>
 
 <#macro renderContentFrame fullUrl width height border></#macro>

Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -45,18 +45,18 @@ under the License.
 
 <#macro renderField text><#if text??>${text}</#if></#macro>
 
-<#macro renderDisplayField type imageLocation idName description title class 
alert inPlaceEditorId="" inPlaceEditorUrl="" inPlaceEditorParams="">
+<#macro renderDisplayField type imageLocation idName description title class 
alert inPlaceEditorUrl="" inPlaceEditorParams="">
 <@makeBlock class description />
 </#macro>
 <#macro renderHyperlinkField></#macro>
 
-<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask  placeholder 
tabindex readonly><@makeBlock className value /></#macro>
+<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder=""><@makeBlock className value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons><@makeBlock className value 
/></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons tabindex 
language=""><@makeBlock className value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength 
step timeValues id event action dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask><@makeBlock className value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength 
step timeValues id event action dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex=""><@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>
+<#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 tabindex>
 <#if currentValue?has_content && firstInList?has_content>
 <@makeBlock "" explicitDescription />
 <#else>
@@ -66,22 +66,22 @@ under the License.
 </#if>
 </#macro>
 
-<#macro renderCheckField items className alert id allChecked currentValue name 
event action><@makeBlock "" "" /></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event ation><@makeBlock "" "" /></#macro>
+<#macro renderCheckField items className alert id allChecked currentValue name 
event action tabindex><@makeBlock "" "" /></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action tabindex><@makeBlock "" "" /></#macro>
 
-<#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl><@makeBlock "" "" /></#macro>
+<#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex><@makeBlock "" "" 
/></#macro>
 <#macro renderResetField className alert name title><@makeBlock "" "" 
/></#macro>
 
 <#macro renderHiddenField name value id event action></#macro>
 <#macro renderIgnoredField></#macro>
 
 <#macro renderFieldTitle style title id fieldHelpText="" for=""><fo:block 
<@getFoStyle style/>>${title?default("")?replace("&nbsp;", " 
")}</fo:block></#macro>
-<#macro renderSingleFormFieldTitle title>${title?default("")}</#macro>
-    
+<#macro renderSingleFormFieldTitle></#macro>
+
 <#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name viewIndexField viewSizeField viewIndex 
viewSize useRowSubmit><fo:block <@getFoStyle containerStyle/>></#macro>
 <#macro renderFormClose focusFieldName formName containerId 
hasRequiredField></fo:block></#macro>
 <#macro renderMultiFormClose></#macro>
-    
+
 <#macro renderFormatListWrapperOpen formName style columnStyles><fo:table 
border="solid black" <@getFoStyle style/>><#list columnStyles as 
columnStyle><fo:table-column<#if columnStyle?has_content> <@getFoStyle 
columnStyle/></#if>/></#list></#macro>
 <#macro renderFormatListWrapperClose 
formName></fo:table-body></fo:table></#macro>
 
@@ -96,7 +96,7 @@ under the License.
 <#macro renderFormatHeaderRowFormCellOpen style><fo:table-cell></#macro>
 <#macro renderFormatHeaderRowFormCellClose></fo:table-cell></#macro>
 <#macro renderFormatHeaderRowFormCellTitleSeparator style isLast></#macro>
-    
+
 <#macro renderFormatItemRowOpen formName itemIndex altRowStyles evenRowStyle 
oddRowStyle><fo:table-row></#macro>
 <#macro renderFormatItemRowClose formName></fo:table-row></#macro>
 <#macro renderFormatItemRowCellOpen fieldName 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>
@@ -117,28 +117,31 @@ under the License.
 
 <#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 renderTextFindField name value defaultOption opEquals opBeginsWith 
opContains opIsEmpty opNotEqual className alert size maxlength autocomplete 
titleStyle hideIgnoreCase ignCase ignoreCase><@makeBlock className value 
tabindex/></#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 opLessThan opLessThanEquals value2 defaultOptionThru>
+<#macro renderDateFindField className alert name localizedInputTitle value 
value2 size maxlength dateType formName defaultDateTimeString imgSrc 
localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals 
opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan 
opUpToDay opUpThruDay opIsEmpty tabindex>
+<@makeBlock className value />
+</#macro>
+<#macro renderRangeFindField className alert name value size maxlength 
autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan 
opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru 
tabindex>
 <@makeBlock className value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event 
action readonly autocomplete descriptionFieldName formName fieldFormName 
targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height 
position fadeBackground clearText showDescription initiallyCollapsed></#macro>
+<#macro renderLookupField name formName fieldFormName className="" alert="" 
value="" size="" maxlength="" id="" event="" action="" readonly=false 
autocomplete="" descriptionFieldName="" targetParameterIter="" imgSrc="" 
ajaxUrl="" ajaxEnabled=javaScriptEnabled presentation="" width="" height="" 
position="" fadeBackground="" clearText="" showDescription="" 
initiallyCollapsed="" lastViewName="" tabindex=""></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex 
listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl 
paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl 
paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl 
selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl 
paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel 
paginateViewSizeLabel></#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 description alternate border width height event 
action><@makeBlock "" "" /></#macro>
+<#macro renderFileField className alert name value size maxlength autocomplete 
tabindex><@makeBlock className value /></#macro>
+<#macro renderPasswordField className alert name value size maxlength id 
autocomplete tabindex><@makeBlock className "" /></#macro>
+<#macro renderImageField value description alternate style event 
action><@makeBlock "" "" /></#macro>
 <#macro renderBanner style leftStyle rightStyle leftText text 
rightText><@makeBlock "" "" /></#macro>
+<#macro renderContainerField id className><@makeBlock className "" /></#macro>
 <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId 
collapsible expandToolTip collapseToolTip></#macro>
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
 <#macro renderSortField style title linkUrl ajaxEnabled 
tooltip=""><@renderFieldTitle style title /></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
+<#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc 
description><@renderField description /></#macro>
-<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation><@makeBlock linkStyle 
description /></#macro>
+<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation id><@makeBlock 
linkStyle description /></#macro>
 <#macro renderTooltip tooltip tooltipStyle></#macro>
 <#macro renderAsterisks requiredField requiredStyle></#macro>
 </#escape>

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -366,7 +366,7 @@ under the License.
   </form><#lt/>
 </#macro>
 
-<#macro renderFormatListWrapperOpen formName style columnStyles>
+<#macro renderFormatListWrapperOpen  style columnStyles>
   <table cellspacing="0" class="<#if 
style?has_content>${style}<#else>basic-table form-widget-table 
dark-grid</#if>"><#lt/>
 </#macro>
 

Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -19,16 +19,16 @@ under the License.
 
 <#macro renderField text><#if text??>"${text}"</#if></#macro>
 
-<#macro renderDisplayField type imageLocation idName description class alert 
inPlaceEditorId="" inPlaceEditorUrl="" inPlaceEditorParams="">
+<#macro renderDisplayField type imageLocation idName description title class 
alert inPlaceEditorUrl="" inPlaceEditorParams="">
 <@renderField description />
 </#macro>
 <#macro renderHyperlinkField></#macro>
 
-<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask placeholder 
tabindex  readonly><@renderField value /></#macro>
+<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex  readonly 
placeholder=""><@renderField value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons tabindex><@renderField value 
/></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
event action dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName tabindex><@renderField value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField 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 tabindex>
 <#if currentValue?has_content && firstInList?has_content>
@@ -42,7 +42,7 @@ under the License.
 
 <#macro renderTooltip tooltip tooltipStyle></#macro>
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action tabindex></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event ation tabindex></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action tabindex></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex></#macro>
 <#macro renderResetField className alert name title></#macro>
@@ -53,7 +53,7 @@ under the License.
 <#macro renderFieldTitle style title id fieldHelpText="" for=""><@renderField 
title /></#macro>
 <#macro renderSingleFormFieldTitle></#macro>
 
-<#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name useRowSubmit></#macro>
+<#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name viewIndexField viewSizeField viewIndex 
viewSize useRowSubmit></#macro>
 <#macro renderFormClose focusFieldName formName containerId 
hasRequiredField></#macro>
 <#macro renderMultiFormClose></#macro>
 
@@ -97,23 +97,26 @@ under the License.
 
 <#macro renderTextFindField name value defaultOption opEquals opBeginsWith 
opContains opIsEmpty opNotEqual className alert size maxlength autocomplete 
titleStyle hideIgnoreCase ignCase ignoreCase tabindex><@renderField 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 tabindex><@renderField value /></#macro>
+<#macro renderDateFindField className alert name localizedInputTitle value 
value2 size maxlength dateType formName defaultDateTimeString imgSrc 
localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals 
opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan 
opUpToDay opUpThruDay opIsEmpty tabindex><@renderField value /></#macro>
 
 <#macro renderRangeFindField className alert name value size maxlength 
autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan 
opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru 
tabindex>
 <@renderField value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event 
action readonly autocomplete descriptionFieldName formName fieldFormName 
targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height 
position fadeBackground clearText showDescription initiallyCollapsed 
tabindex><@renderField value /></#macro>
+<#macro renderLookupField name formName fieldFormName className="" 
alert="false" value="" size="" maxlength="" id="" event="" action="" 
readonly=false autocomplete="" descriptionFieldName="" targetParameterIter="" 
imgSrc="" ajaxUrl="" ajaxEnabled=javaScriptEnabled presentation="layer" 
width="" height="" position="" fadeBackground="true" clearText="" 
showDescription="" initiallyCollapsed="" lastViewName="main" 
tabindex=""><@renderField value /></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex 
listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl 
paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl 
paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl 
selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl 
paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel 
paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete 
tabindex><@renderField value /></#macro>
 <#macro renderPasswordField className alert name value size maxlength id 
autocomplete tabindex></#macro>
-<#macro renderImageFiel value border width height event action></#macro>
+<#macro renderImageField value description alternate style event 
action></#macro>
 <#macro renderBanner style leftStyle rightStyle leftText text 
rightText></#macro>
+<#macro renderContainerField id className></#macro>
 <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId 
collapsible expandToolTip collapseToolTip></#macro>
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
 <#macro renderSortField style title linkUrl ajaxEnabled 
tooltip=""><@renderFieldTitle style title /></#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 
alternate linkUrl targetWindow description><@renderField description /></#macro>
+<#macro renderAsterisks requiredField requiredStyle>*</#macro>
+<#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow></#macro>
+<#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc 
description confirmation><@renderField description /></#macro>
+<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation id><@renderField 
description /></#macro>
\ No newline at end of file

Modified: ofbiz/trunk/framework/widget/templates/textScreenMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textScreenMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textScreenMacroLibrary.ftl Fri Jun 
12 16:25:30 2015
@@ -44,7 +44,7 @@ under the License.
         ${text}<#lt/>
     </#if>
 </#macro>
-<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name linkUrl text imgStr></#macro>
+<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name height width linkUrl text imgStr></#macro>
 <#macro renderImage src id style wid hgt border alt urlString></#macro>
 
 <#macro renderContentFrame fullUrl width height border></#macro>

Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -40,11 +40,11 @@ under the License.
 </#macro>
 <#macro renderHyperlinkField></#macro>
 
-<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask placeholder 
tabindex readonly><@renderField value/></#macro>
+<#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder=""><@renderField value/></#macro>
 
 <#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value/></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName tabindex mask="" event="" action="" step="" 
timeValues=""><@renderField value/></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField 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 tabindex>
 </#macro>
@@ -59,13 +59,12 @@ under the License.
 <#macro renderIgnoredField></#macro>
 
 <#macro renderFieldTitle style title id fieldHelpText="" for=""></#macro>
-<#macro renderSingleFormFieldTitle title></#macro>
-    
+<#macro renderSingleFormFieldTitle></#macro>
+
 <#macro renderFormOpen linkUrl formType targetWindow containerId 
containerStyle autocomplete name viewIndexField viewSizeField viewIndex 
viewSize useRowSubmit></#macro>
 <#macro renderFormClose focusFieldName formName containerId 
hasRequiredField></#macro>
 <#macro renderMultiFormClose></#macro>
 
-
 <#macro renderFormatHeaderRowOpen style></#macro>
 <#macro renderFormatHeaderRowClose>
 </#macro>
@@ -91,24 +90,26 @@ under the License.
 
 <#macro renderTextFindField name value defaultOption opEquals opBeginsWith 
opContains opIsEmpty opNotEqual className alert size maxlength autocomplete 
titleStyle hideIgnoreCase ignCase ignoreCase tabindex><@renderField 
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 tabindex></#macro>
+<#macro renderDateFindField className alert name localizedInputTitle value 
value2 size maxlength dateType formName defaultDateTimeString imgSrc 
localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals 
opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan 
opUpToDay opUpThruDay opIsEmpty tabindex></#macro>
 
 <#macro renderRangeFindField className alert name value size maxlength 
autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan 
opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru 
tabindex>
 </#macro>
 
-<#macro renderLookupField name formName fieldFormName className="" 
alert="false" value="" size="" maxlength="" id="" event="" action="" 
readonly=false autocomplete="" descriptionFieldName="" targetParameterIter="" 
imgSrc="" ajaxUrl="" ajaxEnabled=javaScriptEnabled  tabindex 
presentation="layer" width="" height="" position="" fadeBackground="true" 
clearText="" showDescription="" initiallyCollapsed="" lastViewName="main" 
></#macro>
+<#macro renderLookupField name formName fieldFormName className="" 
alert="false" value="" size="" maxlength="" id="" event="" action="" 
readonly=false autocomplete="" descriptionFieldName="" targetParameterIter="" 
imgSrc="" ajaxUrl="" ajaxEnabled=javaScriptEnabled presentation="layer" 
width="" height="" position="" fadeBackground="true" clearText="" 
showDescription="" initiallyCollapsed="" lastViewName="main" 
tabindex=""></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex 
listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl 
paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl 
paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl 
selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl 
paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel 
paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete 
tabindex></#macro>
 <#macro renderPasswordField className alert name value size maxlength id 
autocomplete tabindex></#macro>
-<#macro renderImageField value description alternate border width height event 
action></#macro>
+<#macro renderImageField value description alternate style event 
action></#macro>
 <#macro renderBanner style leftStyle rightStyle leftText text 
rightText></#macro>
+<#macro renderContainerField id className></#macro>
 <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId 
collapsible expandToolTip collapseToolTip></#macro>
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
 <#macro renderSortField style title linkUrl ajaxEnabled tooltip=""></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
+<#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc 
description confirmation><@renderField description /></#macro>
-<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation><@renderField 
description /></#macro>
+<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title 
alternate linkUrl targetWindow description confirmation id=""><@renderField 
description /></#macro>
 <#macro renderTooltip tooltip tooltipStyle></#macro>
 <#macro renderAsterisks requiredField requiredStyle></#macro>

Modified: ofbiz/trunk/framework/widget/templates/xmlScreenMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlScreenMacroLibrary.ftl?rev=1685124&r1=1685123&r2=1685124&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/xmlScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/xmlScreenMacroLibrary.ftl Fri Jun 12 
16:25:30 2015
@@ -46,7 +46,7 @@ under the License.
 
 <#macro renderHorizontalSeparator id style></#macro>
 <#macro renderLabel text id style></#macro>
-<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name linkUrl text imgStr>
+<#macro renderLink parameterList targetWindow target uniqueItemName linkType 
actionUrl id style name height width linkUrl text imgStr>
 </#macro>
 <#macro renderImage src id style wid hgt border alt urlString>
 </#macro>

Added: ofbiz/trunk/framework/widget/testdef/widgettests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/testdef/widgettests.xml?rev=1685124&view=auto
==============================================================================
--- ofbiz/trunk/framework/widget/testdef/widgettests.xml (added)
+++ ofbiz/trunk/framework/widget/testdef/widgettests.xml Fri Jun 12 16:25:30 
2015
@@ -0,0 +1,27 @@
+<!--
+  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.
+  -->
+
+<test-suite suite-name="widgettests"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd";>
+
+    <test-case case-name="widget-tests">
+        <junit-test-suite 
class-name="org.ofbiz.widget.test.WidgetMacroLibraryTests"/>
+    </test-case>
+</test-suite>

Propchange: ofbiz/trunk/framework/widget/testdef/widgettests.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/widget/testdef/widgettests.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/framework/widget/testdef/widgettests.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to