You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/01/24 09:34:57 UTC

svn commit: r499309 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/product/ webapp/catalog/product/ widget/catalog/

Author: jonesde
Date: Wed Jan 24 00:34:54 2007
New Revision: 499309

URL: http://svn.apache.org/viewvc?view=rev&rev=499309
Log:
Refactored ProductContent screens to not use relative form refs, for easy derived apps

Removed:
    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContentContent.ftl
Modified:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.bsh
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.bsh
    ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContent.ftl
    ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.bsh?view=diff&rev=499309&r1=499308&r2=499309
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.bsh Wed Jan 24 00:34:54 2007
@@ -57,18 +57,6 @@
         productContentDatas.add(UtilMisc.toMap("productContent", productContent, "content", content));
     }
     
-    HtmlFormWrapper updateProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "UpdateProductContentAssoc", request, response);
-    context.put("updateProductContentWrapper", updateProductContentWrapper);
-    updateProductContentWrapper.putInContext("productContentDatas", productContentDatas);
-    
-    HtmlFormWrapper prepareAddProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "PrepareAddProductContentAssoc", request, response);
-    context.put("prepareAddProductContentWrapper", prepareAddProductContentWrapper);
-    prepareAddProductContentWrapper.putInContext("product", product);
-    
-    HtmlFormWrapper addProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "AddProductContentAssoc", request, response);
-    context.put("addProductContentWrapper", addProductContentWrapper);
-    addProductContentWrapper.putInContext("product", product);
-    
     context.put("productContentList", productContentDatas);
 }
 // End ProductContent stuff

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.bsh?view=diff&rev=499309&r1=499308&r2=499309
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.bsh Wed Jan 24 00:34:54 2007
@@ -63,8 +63,6 @@
     if(description != null) content.put("description", description);
 }
 
-HtmlFormWrapper updateProductContentWrapper = null;
-
 //Email
 if ("FULFILLMENT_EMAIL".equals(productContentTypeId)) {
     emailData = new HashMap();
@@ -90,8 +88,7 @@
         }
     }
 
-    updateProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentEmail", request, response);
-    updateProductContentWrapper.putInContext("emailData", emailData);
+    context.put("contentFormName", "EditProductContentEmail");
     context.put("emailData", emailData);
 } else if ("DIGITAL_DOWNLOAD".equals(productContentTypeId)) {
     downloadData = new HashMap();
@@ -105,10 +102,10 @@
             }
         }
     }
-    updateProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentDownload", request, response);
-    updateProductContentWrapper.putInContext("downloadData", downloadData);
+    context.put("contentFormName", "EditProductContentDownload");
+    context.put("downloadData", downloadData);
 } else if ("FULFILLMENT_EXTERNAL".equals(productContentTypeId)) {
-    updateProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentExternal", request, response);
+    context.put("contentFormName", "EditProductContentExternal");
 } else {
     //Assume it is a generic simple text content
     textData = new HashMap();
@@ -120,15 +117,10 @@
             textData.put("textDataResourceId", text.get("dataResourceId"));
         }
     }
-    updateProductContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentSimpleText", request, response);
-    updateProductContentWrapper.putInContext("textData", textData);
-
+    context.put("contentFormName", "EditProductContentSimpleText");
+    context.put("textData", textData);
 }
 
-context.put("updateProductContentWrapper", updateProductContentWrapper);
-updateProductContentWrapper.putInContext("productContentData", productContentData);
-//updateProductContentWrapper.putInContext("content", content);
 context.put("productContentData", productContentData);
-updateProductContentWrapper.putInContext("content", content);
-updateProductContentWrapper.putInContext("contentId", contentId);
-//context.put("log", log);
+context.put("content", content);
+context.put("contentId", contentId);

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContent.ftl?view=diff&rev=499309&r1=499308&r2=499309
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContent.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/EditProductContent.ftl Wed Jan 24 00:34:54 2007
@@ -75,11 +75,11 @@
     </table>
     <div class="head2">${uiLabelMap.ProductCreateNewProductContent}</div>
     <#if productId?has_content && product?has_content>
-        ${prepareAddProductContentWrapper.renderFormString(context)}
+        ${sections.render("PrepareAddProductContentAssoc")}
     </#if>
     <div class="head2">${uiLabelMap.ProductAddContentProduct}</div>
     <#if productId?has_content && product?has_content>
-        ${addProductContentWrapper.renderFormString(context)}
+        ${sections.render("AddProductContentAssoc")}
     </#if>
 
     <hr class="sepbar"/>

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?view=diff&rev=499309&r1=499308&r2=499309
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Wed Jan 24 00:34:54 2007
@@ -30,7 +30,7 @@
 
         <field use-when="product==null" name="isCreate"><hidden value="true"/></field>
 
-        <field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotModificationRecreatingProduct}"><display/></field>
+        <field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotModificationRecreatingProduct}" widget-style="tabletext"><display/></field>
         <field use-when="product==null&amp;&amp;productId==null" name="productId" title="${uiLabelMap.ProductProductId}"><text size="20" maxlength="20"/></field>
         <field use-when="product==null&amp;&amp;productId!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotFindProductId} [${productId}]"><text size="20" maxlength="20"/></field>
 

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?view=diff&rev=499309&r1=499308&r2=499309
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Wed Jan 24 00:34:54 2007
@@ -648,7 +648,16 @@
                 <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <platform-specific>
-                            <html><html-template location="component://product/webapp/catalog/product/EditProductContent.ftl"/></html>
+                            <html>
+                                <html-template-decorator location="component://product/webapp/catalog/product/EditProductContent.ftl">
+                                    <html-template-decorator-section name="PrepareAddProductContentAssoc">
+                                        <include-form name="PrepareAddProductContentAssoc" location="component://product/webapp/catalog/product/ProductForms.xml"/>
+                                    </html-template-decorator-section>
+                                    <html-template-decorator-section name="AddProductContentAssoc">
+                                        <include-form name="AddProductContentAssoc" location="component://product/webapp/catalog/product/ProductForms.xml"/>
+                                    </html-template-decorator-section>
+                                </html-template-decorator>
+                            </html>
                         </platform-specific>
                     </decorator-section>
                 </decorator-screen>
@@ -669,9 +678,7 @@
             <widgets>
                 <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <html><html-template location="component://product/webapp/catalog/product/EditProductContentContent.ftl"/></html>
-                        </platform-specific>
+                        <include-form name="${contentFormName}" location="component://product/webapp/catalog/product/ProductForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>