svn commit: r659935 - in /ofbiz/trunk: applications/accounting/webapp/accounting/WEB-INF/ applications/accounting/widget/ applications/order/widget/ordermgr/ applications/product/config/ applications/product/webapp/facility/WEB-INF/ applications/produc...

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

svn commit: r659935 - in /ofbiz/trunk: applications/accounting/webapp/accounting/WEB-INF/ applications/accounting/widget/ applications/order/widget/ordermgr/ applications/product/config/ applications/product/webapp/facility/WEB-INF/ applications/produc...

jacopoc
Author: jacopoc
Date: Sun May 25 01:00:10 2008
New Revision: 659935

URL: http://svn.apache.org/viewvc?rev=659935&view=rev
Log:
Added support for xsl-fo and xml templates to the platform-specific screen widget element. Now it is possible to define the same screen that can be rendered with different renderers. An example of this is the SimpleDecorator that is now used to render simple PDF report (xsl-fo), xml export and printer friendly html output. You can test it in the Edit Example screen (and some other screens as well): the PDF and Printer Friendly links in that page both share the same screen definition. Misc fixes to the widget FO and XML renderers, for issues found while testing.

Modified:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml
    ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml
    ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
    ofbiz/trunk/framework/common/webcommon/includes/simple.ftl
    ofbiz/trunk/framework/common/webcommon/includes/simple.xml.ftl
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml
    ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
    ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml
    ofbiz/trunk/framework/widget/dtd/widget-screen.xsd
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sun May 25 01:00:10 2008
@@ -1863,7 +1863,7 @@
     <view-map name="FindGlobalGlAccount" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccounts"/>
     <view-map name="ListGlobalGlAccounts" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccounts"/>
     <view-map name="ListGlAccountsReport" type="screenfop" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccountsReport" content-type="application/pdf" encoding="none"/>
-    <view-map name="ListGlAccountsExport" type="screenxml" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccountsExport" content-type="text/xml"/>
+    <view-map name="ListGlAccountsExport" type="screenxml" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccountsReport" content-type="text/xml"/>
     <view-map name="GlAccountNavigate" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#GlAccountNavigate"/>
     <view-map name="AssignGlAccount" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#AssignGlAccount"/>
     <view-map name="FindGlAccountReconciliation" type="screen" page="component://accounting/widget/GlScreens.xml#FindGlAccountReconciliation"/>  
@@ -1923,6 +1923,7 @@
     <view-map name="EditAgreementPromoAppl" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementPromoAppl"/>
     <view-map name="ListAgreementItemTerms" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemTerms"/>
     <view-map name="EditAgreementItemTerm" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemTerm"/>
+    
     <view-map name="ListAgreementItemProducts" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemProducts"/>
     <view-map name="ListAgreementItemProductsReport" type="screenfop" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemProductsReport" content-type="application/pdf" encoding="none"/>
     <view-map name="EditAgreementItemProduct" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemProduct"/>

Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Sun May 25 01:00:10 2008
@@ -502,7 +502,7 @@
                 </entity-and>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <container style="screenlet">
                             <container style="screenlet-title-bar">
@@ -649,7 +649,7 @@
                 </entity-and>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <container style="screenlet">
                             <container style="screenlet-title-bar">

Modified: ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml Sun May 25 01:00:10 2008
@@ -382,22 +382,7 @@
                 <set field="pageLayoutName" value="simple-landscape"/>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
-                    <decorator-section name="body">
-                        <include-form name="ListGlAccount" location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
-    <screen name="ListGlAccountsExport">
-        <section>
-            <actions>
-                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
-                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="1000"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="XmlDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <include-form name="ListGlAccount" location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
                     </decorator-section>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml Sun May 25 01:00:10 2008
@@ -266,7 +266,7 @@
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="500"/>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <include-form name="ApprovedProductRequirementsList" location="component://order/webapp/ordermgr/requirement/RequirementForms.xml"/>
                     </decorator-section>
@@ -317,7 +317,7 @@
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="500"/>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <include-form name="ApprovedProductRequirementsByVendorList" location="component://order/webapp/ordermgr/requirement/RequirementForms.xml"/>
                     </decorator-section>

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sun May 25 01:00:10 2008
@@ -14199,9 +14199,9 @@
         <value xml:lang="zh">承诺有效减去最小存货</value>
     </property>
     <property key="ProductQtyOffsetATPBelow">
-        <value xml:lang="en">ATP minus Min Stock &lt;=</value>
+        <value xml:lang="en">ATP minus Min Stock less than</value>
         <value xml:lang="fr">ATP moins réserve stock mini &lt;=</value>
-        <value xml:lang="it">ATP meno la Giacenza Minima &lt;=</value>
+        <value xml:lang="it">ATP meno la Giacenza Minima inferiore a</value>
         <value xml:lang="ro">ATP minus stocul Minim &lt;=</value>
         <value xml:lang="ru">ATP минус мин склад &lt;=</value>
         <value xml:lang="th">ลบคลังสินค้าจำนวนน้อย&lt;=</value>
@@ -14223,9 +14223,9 @@
         <value xml:lang="zh">现货数量减去最小存货</value>
     </property>
     <property key="ProductQtyOffsetQOHBelow">
-        <value xml:lang="en">QOH minus Min Stock &lt;=</value>
+        <value xml:lang="en">QOH minus Min Stock less than</value>
         <value xml:lang="fr">QOH moins réserve stock mini &lt;=</value>
-        <value xml:lang="it">QOH meno la Giacenza Minima &lt;=</value>
+        <value xml:lang="it">QOH meno la Giacenza Minima inferiore a</value>
         <value xml:lang="ro">QOH minus stocul Minim &lt;=</value>
         <value xml:lang="ru">QOH минус мин склад &lt;=</value>
         <value xml:lang="th">QOH ลบคลังสินค้าจำนวนน้อย&lt;=</value>

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Sun May 25 01:00:10 2008
@@ -1114,7 +1114,7 @@
     <view-map name="ViewFacilityInventoryByProduct" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ViewFacilityInventoryByProduct"/>
     <view-map name="ViewFacilityInventoryByProductSimple" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ViewFacilityInventoryByProductSimple"/>
     <view-map name="ViewFacilityInventoryByProductReport" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#ViewFacilityInventoryByProductReport" content-type="application/pdf" encoding="none"/>
-    <view-map name="ViewFacilityInventoryByProductExport" type="screenxml" page="component://product/widget/facility/FacilityScreens.xml#ViewFacilityInventoryByProductExport" content-type="text/xml"/>
+    <view-map name="ViewFacilityInventoryByProductExport" type="screenxml" page="component://product/widget/facility/FacilityScreens.xml#ViewFacilityInventoryByProductReport" content-type="text/xml"/>
     <view-map name="EditFacilityGroups" type="screen" page="component://product/widget/facility/FacilityScreens.xml#EditFacilityGroups"/>
     <view-map name="EditFacilityRoles" type="screen" page="component://product/widget/facility/FacilityScreens.xml#EditFacilityRoles"/>
     <view-map name="ViewContactMechs" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ViewContactMechs"/>

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Sun May 25 01:00:10 2008
@@ -333,7 +333,7 @@
         <field name="productSupplierId" title="${uiLabelMap.ProductSupplier}">
             <drop-down allow-empty="true">
                 <entity-options entity-name="PartyRoleAndPartyDetail" key-field-name="partyId" description="${groupName} [${partyId}]">
-                    <entity-constraint name="roleTypeId"  value="SUPPLIER" operator="equals"/>
+                    <entity-constraint name="roleTypeId" value="SUPPLIER" operator="equals"/>
                     <entity-order-by field-name="partyId"/>
                 </entity-options>
             </drop-down>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Sun May 25 01:00:10 2008
@@ -512,7 +512,7 @@
                 <script location="component://product/webapp/facility/WEB-INF/actions/facility/countFacilityInventoryByProduct.bsh"/>
             </actions>
             <widgets>
-                <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <include-form name="FindFacilityInventoryByProduct" location="component://product/webapp/facility/facility/FacilityForms.xml"/>
                         <include-form name="ListFacilityInventoryByProduct" location="component://product/webapp/facility/facility/FacilityForms.xml"/>
@@ -521,37 +521,6 @@
             </widgets>
         </section>
     </screen>
-    <screen name="ViewFacilityInventoryByProductExport">
-        <section>
-            <actions>
-                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
-                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
-
-                <set field="titleProperty" value="PageTitleEditFacilityInventoryItems"/>
-                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
-                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="200"/>
-
-                <set field="facilityId" from-field="parameters.facilityId"/>
-                <set field="productTypeId" from-field="parameters.productTypeId"/>
-                <set field="searchInProductCategoryId" from-field="parameters.searchInProductCategoryId"/>
-                <set field="productSupplierId" from-field="parameters.productSupplierId"/>
-                <set field="offsetQOHQty" from-field="parameters.offsetQOHQty"/>
-                <set field="offsetATPQty" from-field="parameters.offsetATPQty"/>
-                <set field="productsSoldThruTimestamp" from-field="parameters.productsSoldThruTimestamp"/>
-                <set field="internalName" from-field="parameters.internalName"/>
-                <set field="productId" from-field="parameters.productId"/>
-
-                <script location="component://product/webapp/facility/WEB-INF/actions/facility/countFacilityInventoryByProduct.bsh"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="XmlDecorator" location="component://common/widget/CommonScreens.xml">
-                    <decorator-section name="body">
-                        <include-form name="ListFacilityInventoryByProduct" location="component://product/webapp/facility/facility/FacilityForms.xml"/>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
 
     <screen name="ViewFacilityInventoryItemsDetails">
         <section>

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Sun May 25 01:00:10 2008
@@ -4054,6 +4054,9 @@
         <value xml:lang="fr">SVP, changer cotre mot de passe</value>
         <value xml:lang="th">กรุณาเปลี่ยนรหัสผ่านของคุณ</value>
     </property>
+    <property key="CommonPdf">
+        <value xml:lang="en">Pdf</value>
+    </property>
     <property key="CommonPerform">
         <value xml:lang="ar">إحراء</value>
         <value xml:lang="en">Perform</value>
@@ -4186,6 +4189,9 @@
         <value xml:lang="th">พิมพ์</value>
         <value xml:lang="zh">打印</value>
     </property>
+    <property key="CommonPrinterFriendly">
+        <value xml:lang="en">Printer Friendly</value>
+    </property>
     <property key="CommonPriority">
         <value xml:lang="ar">الأولوية</value>
         <value xml:lang="de">Priorität</value>

Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl Sun May 25 01:00:10 2008
@@ -48,17 +48,17 @@
              in the right side cell we put the title, username and date
         -->
         <fo:static-content flow-name="xsl-region-before" font-size="${headerFontSize?default("8pt")}">
-            <fo:table>
+            <fo:table table-layout="fixed">
                 <fo:table-column column-number="1" column-width="proportional-column-width(50)"/>
                 <fo:table-column column-number="2" column-width="proportional-column-width(50)"/>
                 <fo:table-body>
                     <fo:table-row>
                         <fo:table-cell>
-                        <#if logoImageUrl?exists>
                             <fo:block>
+                            <#if logoImageUrl?exists>
                                 <fo:external-graphic src="${logoImageUrl}" overflow="hidden" height="40px"/>
+                            </#if>
                             </fo:block>
-                        </#if>
                         </fo:table-cell>
                         <fo:table-cell>
                             <#-- The title of the report -->

Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/simple.ftl?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/simple.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/simple.ftl Sun May 25 01:00:10 2008
@@ -27,7 +27,7 @@
 <html lang="${docLangAttr}" dir="${langDir}" xmlns="http://www.w3.org/1999/xhtml">
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>${layoutSettings.companyName}: <#if (page.titleProperty)?has_content>${uiLabelMap[page.titleProperty]}<#else>${(page.title)?if_exists}</#if></title>
+    <title>${layoutSettings.companyName?if_exists}: <#if (page.titleProperty)?has_content>${uiLabelMap[page.titleProperty]}<#else>${(page.title)?if_exists}</#if></title>
     <#if layoutSettings.shortcutIcon?has_content>
       <link rel="shortcut icon" href="<@ofbizContentUrl>${layoutSettings.shortcutIcon}</@ofbizContentUrl>" />    
     </#if>

Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.xml.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/simple.xml.ftl?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/simple.xml.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/simple.xml.ftl Sun May 25 01:00:10 2008
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <#--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
@@ -17,5 +16,6 @@
 specific language governing permissions and limitations
 under the License.
 -->
-
+<export>
 ${sections.render("body")}
+</export>
\ No newline at end of file

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Sun May 25 01:00:10 2008
@@ -214,8 +214,9 @@
         </section>
     </screen>
 
-    <!-- Simple decorator for printer friendly screens (no logo and no application bar, header and footer).
-         A print button is also available at the top of the screen.
+    <!-- Simple decorator (no application and menu bars); it can be used:
+         * for printer friendly html screens (no logo and no application bar, header and footer); a print button is also available at the top of the screen
+         * for simple PDF report (a simple header with the logo/date is rendered and a footer with page numbers)
     -->
     <screen name="SimpleDecorator">
         <section>
@@ -230,10 +231,18 @@
                 <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/>
                 <!-- The default (global) shortcut icon -->
                 <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/>
+                <!-- The settings below are used for xsl-fo screens -->
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="logoImageUrl" value="/images/ofbiz_logo.jpg"/>
+                <!--<set field="defaultFontFamily" value="Arial"/>-->
             </actions>
             <widgets>
                 <!-- render header -->
-                <platform-specific><html><html-template location="component://common/webcommon/includes/simple.ftl"/></html></platform-specific>
+                <platform-specific>
+                    <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/simple.xml.ftl"/></xml>
+                </platform-specific>
             </widgets>
         </section>
     </screen>
@@ -252,20 +261,6 @@
         </section>
     </screen>
 
-    <!-- Simple fo decorator for pdf reports. -->
-    <screen name="FoDecorator">
-        <section>
-            <actions>
-                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
-                <set field="logoImageUrl" value="/images/ofbiz_logo.jpg"/>
-                <!--<set field="defaultFontFamily" value="Arial"/>-->
-            </actions>
-            <widgets>
-                <platform-specific><html><html-template location="component://common/webcommon/includes/simple.fo.ftl"/></html></platform-specific>
-            </widgets>
-        </section>
-    </screen>
-
     <!-- Decorator for xsl-fo rendering -->
     <screen name="GlobalFoDecorator">
         <section>
@@ -303,17 +298,6 @@
         </section>
     </screen>
 
-    <!-- Simple xml decorator for widget export. -->
-    <screen name="XmlDecorator">
-        <section>
-            <actions>
-            </actions>
-            <widgets>
-                <platform-specific><html><html-template location="component://common/webcommon/includes/simple.xml.ftl"/></html></platform-specific>
-            </widgets>
-        </section>
-    </screen>
-
     <screen name="login">
         <section>
             <widgets>

Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml Sun May 25 01:00:10 2008
@@ -56,6 +56,8 @@
     <!-- Example Requests -->
     <request-map uri="FindExample"><security https="true" auth="true"/><response name="success" type="view" value="FindExample"/></request-map>
     <request-map uri="EditExample"><security https="true" auth="true"/><response name="success" type="view" value="EditExample"/></request-map>
+    <request-map uri="ExampleReportHtml"><security https="true" auth="true"/><response name="success" type="view" value="ExampleReportHtml"/></request-map>
+    <request-map uri="ExampleReportPdf"><security https="true" auth="true"/><response name="success" type="view" value="ExampleReportPdf"/></request-map>
     <request-map uri="createExample">
         <security https="true" auth="true"/>
         <event type="service" invoke="createExample"/>
@@ -178,6 +180,8 @@
     <view-map name="EditExample" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExample"/>
     <view-map name="EditExampleItems" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExampleItems"/>
     <view-map name="EditExampleFeatureAppls" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExampleFeatureAppls"/>
+    <view-map name="ExampleReportHtml" type="screen" page="component://example/widget/example/ExampleScreens.xml#ExampleReport"/>
+    <view-map name="ExampleReportPdf" type="screenfop" page="component://example/widget/example/ExampleScreens.xml#ExampleReport" content-type="application/pdf" encoding="none"/>
     
     <view-map name="FindExampleFeature" type="screen" page="component://example/widget/example/ExampleFeatureScreens.xml#FindExampleFeature"/>
     <view-map name="EditExampleFeature" type="screen" page="component://example/widget/example/ExampleFeatureScreens.xml#EditExampleFeature"/>

Modified: ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/CommonScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/CommonScreens.xml Sun May 25 01:00:10 2008
@@ -90,7 +90,11 @@
                                     </condition>
                                     <widgets>
                                         <container style="h1"><label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} ${example.exampleName} [${exampleId}]</label></container>
-                                        <container style="button-bar"><link target="EditExample" text="${uiLabelMap.ExampleNewExample}" style="buttontext"/></container>
+                                        <container style="button-bar">
+                                            <link target="EditExample" text="${uiLabelMap.ExampleNewExample}" style="buttontext"/>
+                                            <link target="ExampleReportHtml?exampleId=${exampleId}" text="${uiLabelMap.CommonPrinterFriendly}" style="buttontext"/>
+                                            <link target="ExampleReportPdf?exampleId=${exampleId}" text="${uiLabelMap.CommonPdf}" style="buttontext"/>
+                                        </container>
                                     </widgets>
                                     <fail-widgets>
                                         <container style="h1"><label>${uiLabelMap.ExampleNewExample}</label></container>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml Sun May 25 01:00:10 2008
@@ -67,6 +67,24 @@
         </section>
     </screen>
 
+    <screen name="ExampleReport">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditExample"/>
+                <set field="tabButtonItem" value="EditExample"/>
+                <set field="exampleId" from-field="parameters.exampleId"/>
+                <entity-one entity-name="Example" value-name="example"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="body">
+                        <include-form name="EditExample" location="component://example/widget/example/ExampleForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="EditExampleItems">
         <section>
             <actions>

Modified: ofbiz/trunk/framework/widget/dtd/widget-screen.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-screen.xsd?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-screen.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-screen.xsd Sun May 25 01:00:10 2008
@@ -1075,10 +1075,12 @@
     <!-- ============== Platform Specific Elements =============== -->
     <xs:element name="platform-specific" substitutionGroup="AllWidgets">
         <xs:complexType>
-            <xs:choice>
+            <xs:sequence>
                 <xs:element minOccurs="0" ref="html"/>
                 <xs:element minOccurs="0" ref="swing"/>
-            </xs:choice>
+                <xs:element minOccurs="0" ref="xsl-fo"/>
+                <xs:element minOccurs="0" ref="xml"/>
+            </xs:sequence>
         </xs:complexType>
     </xs:element>
     <!-- ============== HTML Specific Elements =============== -->
@@ -1090,6 +1092,20 @@
             </xs:sequence>
         </xs:complexType>
     </xs:element>
+    <xs:element name="xsl-fo">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="HtmlWidgets"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="xml">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="HtmlWidgets"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
     <xs:element name="html-template" substitutionGroup="HtmlWidgets">
         <xs:complexType>
             <xs:attributeGroup ref="attlist.html-template"/>

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java Sun May 25 01:00:10 2008
@@ -125,29 +125,38 @@
             }
         } else {
             Iterator optionValueIter = allOptionValues.iterator();
+            boolean optionSelected = false;
             while (optionValueIter.hasNext()) {
                 ModelFormField.OptionValue optionValue = (ModelFormField.OptionValue) optionValueIter.next();
                 String noCurrentSelectedKey = dropDownField.getNoCurrentSelectedKey(context);
                 if ((UtilValidate.isNotEmpty(currentValue) && currentValue.equals(optionValue.getKey()) && "selected".equals(dropDownField.getCurrent())) ||
                         (UtilValidate.isEmpty(currentValue) && noCurrentSelectedKey != null && noCurrentSelectedKey.equals(optionValue.getKey()))) {
                     this.makeBlockString(buffer, modelFormField.getWidgetStyle(), optionValue.getDescription());
+                    optionSelected = true;
                     break;
                 }
             }
+            if (!optionSelected) {
+                this.makeBlockString(buffer, null, "");
+            }
         }
         appendWhitespace(buffer);
     }
 
     public void renderCheckField(StringBuffer buffer, Map context, CheckField checkField) {
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderRadioField(StringBuffer buffer, Map context, RadioField radioField) {
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderSubmitField(StringBuffer buffer, Map context, SubmitField submitField) {
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderResetField(StringBuffer buffer, Map context, ResetField resetField) {
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderHiddenField(StringBuffer buffer, Map context, HiddenField hiddenField) {
@@ -217,6 +226,8 @@
         buffer.append("</fo:table-row>");
         buffer.append("</fo:table-header>");
         buffer.append("<fo:table-body>");
+        // FIXME: this is an hack to avoid FOP rendering errors for empty lists (fo:table-body cannot be null)
+        buffer.append("<fo:table-row><fo:table-cell><fo:block/></fo:table-cell></fo:table-row>");
         appendWhitespace(buffer);
     }
 
@@ -384,10 +395,12 @@
     }
 
     public void renderPasswordField(StringBuffer buffer, Map context, PasswordField passwordField) {
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderImageField(StringBuffer buffer, Map context, ImageField imageField) {
         // TODO
+        this.makeBlockString(buffer, null, "");
     }
 
     public void renderFieldGroupOpen(StringBuffer buffer, Map context, ModelForm.FieldGroup fieldGroup) {
@@ -400,6 +413,7 @@
     
     public void renderBanner(StringBuffer buffer, Map context, ModelForm.Banner banner) {
         // TODO
+        this.makeBlockString(buffer, null, "");
     }
     
     public void renderHyperlinkTitle(StringBuffer buffer, Map context, ModelFormField modelFormField, String titleText) {

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=659935&r1=659934&r2=659935&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 Sun May 25 01:00:10 2008
@@ -22,6 +22,7 @@
 import java.io.Serializable;
 import java.io.Writer;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -42,6 +43,7 @@
 import org.ofbiz.base.util.collections.MapStack;
 import org.ofbiz.base.util.string.FlexibleStringExpander;
 import org.ofbiz.widget.ModelWidget;
+import org.ofbiz.widget.fo.FoScreenRenderer;
 import org.ofbiz.widget.form.FormFactory;
 import org.ofbiz.widget.form.FormStringRenderer;
 import org.ofbiz.widget.form.ModelForm;
@@ -54,6 +56,7 @@
 import org.ofbiz.widget.tree.ModelTree;
 import org.ofbiz.widget.tree.TreeFactory;
 import org.ofbiz.widget.tree.TreeStringRenderer;
+import org.ofbiz.widget.xml.XmlFormRenderer;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.GenericEntityException;
@@ -899,24 +902,53 @@
     }
 
     public static class PlatformSpecific extends ModelScreenWidget {
-        protected ModelScreenWidget subWidget;
+        protected Map<String, ModelScreenWidget> subWidgets;
         
         public PlatformSpecific(ModelScreen modelScreen, Element platformSpecificElement) {
             super(modelScreen, platformSpecificElement);
-            Element childElement = UtilXml.firstChildElement(platformSpecificElement);
-            if ("html".equals(childElement.getNodeName())) {
-                subWidget = new HtmlWidget(modelScreen, childElement);
-            } else {
-                throw new IllegalArgumentException("Tag not supported under the platform-specific tag with name: " + childElement.getNodeName());
+            subWidgets = new HashMap();
+            List childElements = UtilXml.childElementList(platformSpecificElement);
+            if (childElements != null) {
+                Iterator childElementsIt = childElements.iterator();
+                while (childElementsIt.hasNext()) {
+                    Element childElement = (Element)childElementsIt.next();
+                    if ("html".equals(childElement.getNodeName())) {
+                        subWidgets.put("html", new HtmlWidget(modelScreen, childElement));
+                    } else if ("xsl-fo".equals(childElement.getNodeName())) {
+                        subWidgets.put("xsl-fo", new HtmlWidget(modelScreen, childElement));
+                    } else if ("xml".equals(childElement.getNodeName())) {
+                        subWidgets.put("xml", new HtmlWidget(modelScreen, childElement));
+                    } else {
+                        throw new IllegalArgumentException("Tag not supported under the platform-specific tag with name: " + childElement.getNodeName());
+                    }
+                }
             }
         }
 
         public void renderWidgetString(Writer writer, Map context, ScreenStringRenderer screenStringRenderer) throws GeneralException {
-            subWidget.renderWidgetString(writer, context, screenStringRenderer);
+            ModelScreenWidget subWidget = null;
+            if (screenStringRenderer instanceof FoScreenRenderer) {
+                subWidget = (ModelScreenWidget)subWidgets.get("xsl-fo");
+            } else {
+                FormStringRenderer formRenderer = (FormStringRenderer)context.get("formStringRenderer");
+                if (formRenderer instanceof XmlFormRenderer) {
+                    subWidget = (ModelScreenWidget)subWidgets.get("xml");
+                } else {
+                    subWidget = (ModelScreenWidget)subWidgets.get("html");
+                }
+            }
+            if (subWidget != null) {
+                subWidget.renderWidgetString(writer, context, screenStringRenderer);
+            }
         }
 
         public String rawString() {
-            return "<platform-specific>" + (this.subWidget==null?"":this.subWidget.rawString());
+            Collection<ModelScreenWidget> subWidgetList = this.subWidgets.values();
+            String subWidgetsRawString = "";
+            for (ModelScreenWidget subWidget: subWidgetList) {
+                subWidgetsRawString = subWidgetsRawString + subWidget.rawString();
+            }
+            return "<platform-specific>" + subWidgetsRawString + "</platform-specific>";
         }
     }
 

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java?rev=659935&r1=659934&r2=659935&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java Sun May 25 01:00:10 2008
@@ -243,9 +243,17 @@
     }
 
     public void renderFormatSingleWrapperOpen(StringBuffer buffer, Map context, ModelForm modelForm) {
+        buffer.append("<");
+        buffer.append(modelForm.getName());
+        buffer.append("Export>");
+        this.appendWhitespace(buffer);
     }
 
     public void renderFormatSingleWrapperClose(StringBuffer buffer, Map context, ModelForm modelForm) {
+        buffer.append("</");
+        buffer.append(modelForm.getName());
+        buffer.append("Export>");
+        this.appendWhitespace(buffer);
     }
 
     public void renderFormatFieldRowOpen(StringBuffer buffer, Map context, ModelForm modelForm) {