[OFBiz] SVN: r7769 - in trunk/applications: content/script/org/ofbiz/content/content content/servicedef content/src/org/ofbiz/content/content product/script/org/ofbiz/product/category product/script/org/ofbiz/product/product product/servicedef product/webapp/catalog/WEB-INF/actions/category product/webapp/catalog/category product/webapp/catalog/product product/widget/catalog

jonesde@svn.ofbiz.org jonesde at svn.ofbiz.org
Sun Jun 11 01:28:22 CDT 2006


Author: jonesde
Date: 2006-06-11 01:28:05 -0500 (Sun, 11 Jun 2006)
New Revision: 7769

Removed:
   trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContent.bsh
   trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.bsh
   trunk/applications/product/webapp/catalog/category/EditCategoryContentContent.ftl
Modified:
   trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
   trunk/applications/content/servicedef/services.xml
   trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java
   trunk/applications/product/script/org/ofbiz/product/category/CategoryContentServices.xml
   trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
   trunk/applications/product/servicedef/services.xml
   trunk/applications/product/webapp/catalog/category/CategoryForms.xml
   trunk/applications/product/webapp/catalog/category/EditCategoryContent.ftl
   trunk/applications/product/webapp/catalog/product/ProductForms.xml
   trunk/applications/product/widget/catalog/CategoryScreens.xml
Log:
A bunch of improvements to the category content and product content stuff; includes rewrite of some category content screens to not use bsh and ftl for most things; this includes fixes for the product and category content admin in the catalog manager, which somehow got broken by some changes in the last month for certain enhancements and such

Modified: trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
===================================================================
--- trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    $Id$
-    
-    Copyright 2001-2006 The Apache Software Foundation
-    
-    Licensed 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.
+$Id$
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
 -->
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

Modified: trunk/applications/content/servicedef/services.xml
===================================================================
--- trunk/applications/content/servicedef/services.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/content/servicedef/services.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -88,7 +88,7 @@
     </service>
     
     <service name="createContent" default-entity-name="Content" engine="java"
-        location="org.ofbiz.content.content.ContentServices" invoke="createContent" transaction-timout="72000" auth="true" >
+        location="org.ofbiz.content.content.ContentServices" invoke="createContent" transaction-timout="72000" auth="true">
         <description>Create a Content</description>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>

Modified: trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java	2006-06-11 06:28:05 UTC (rev 7769)
@@ -530,6 +530,7 @@
     /**
      * Update a Content method. The work is done in this separate method so that complex services that need this functionality do not need to incur the
      * reflection performance penalty of calling a service.
+     * DEJ20060610: why is this being done? It's a bad design because the service call overhead is not very big, but not calling through the service engine breaks functionality possibilities like ECAs and such
      */
     public static Map updateContentMethod(DispatchContext dctx, Map context) {
         GenericDelegator delegator = dctx.getDelegator();
@@ -563,12 +564,14 @@
             Timestamp lastModifiedDate = UtilDateTime.nowTimestamp();
 
             // update status first to see if allowed
-            Map statusInMap = UtilMisc.toMap("contentId", context.get("contentId"), "statusId", context.get("statusId"),"userLogin", userLogin);
-            try {
-               dispatcher.runSync("setContentStatus", statusInMap);
-            } catch (GenericServiceException e) {
-                Debug.logError(e, "Problem updating content Status", "ContentServices");
-                return ServiceUtil.returnError("Problem updating content Status: " + e);
+            if (UtilValidate.isNotEmpty((String) context.get("statusId"))) {
+                Map statusInMap = UtilMisc.toMap("contentId", context.get("contentId"), "statusId", context.get("statusId"),"userLogin", userLogin);
+                try {
+                   dispatcher.runSync("setContentStatus", statusInMap);
+                } catch (GenericServiceException e) {
+                    Debug.logError(e, "Problem updating content Status", "ContentServices");
+                    return ServiceUtil.returnError("Problem updating content Status: " + e);
+                }
             }
             
             content.setNonPKFields(context);

Modified: trunk/applications/product/script/org/ofbiz/product/category/CategoryContentServices.xml
===================================================================
--- trunk/applications/product/script/org/ofbiz/product/category/CategoryContentServices.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/script/org/ofbiz/product/category/CategoryContentServices.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -64,13 +64,13 @@
         <find-by-primary-key entity-name="ProductCategoryContent" map-name="lookupPKMap" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
-      <simple-method method-name="createSimpleTextContentForCategory" short-description="Create Simple Text Content For Product Category">
-        <set-service-fields service-name="createCategoryContent" map-name="parameters" to-map-name="createCategoryContent"/>
-        <set-service-fields service-name="createSimpleTextContent" map-name="parameters" to-map-name="createSimpleText"/>
-        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleText" break-on-error="true" >
-            <result-to-field result-name="contentId" map-name="createCategoryContent" />
+    <simple-method method-name="createSimpleTextContentForCategory" short-description="Create Simple Text Content For Product Category">
+        <set-service-fields service-name="createCategoryContent" map-name="parameters" to-map-name="createCategoryContentMap"/>
+        <set-service-fields service-name="createSimpleTextContent" map-name="parameters" to-map-name="createSimpleTextMap"/>
+        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleTextMap">
+            <result-to-field result-name="contentId" map-name="createCategoryContentMap" />
         </call-service>
-        <call-service service-name="createCategoryContent" in-map-name="createCategoryContent"/>
+        <call-service service-name="createCategoryContent" in-map-name="createCategoryContentMap"/>
     </simple-method>
     <simple-method method-name="updateSimpleTextContentForCategory" short-description="Update Simple Text Content For Product Category">
         <set-service-fields service-name="updateCategoryContent" map-name="parameters" to-map-name="updateCategoryContent"/>
@@ -78,4 +78,4 @@
         <set-service-fields service-name="updateSimpleTextContent" map-name="parameters" to-map-name="updateSimpleText"/>
         <call-service service-name="updateSimpleTextContent" in-map-name="updateSimpleText"/>
     </simple-method>
-</simple-methods>
\ No newline at end of file
+</simple-methods>

Modified: trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
===================================================================
--- trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -97,12 +97,12 @@
     </simple-method>
 
     <simple-method method-name="createSimpleTextContentForProduct" short-description="Create Simple Text Content For Product">
-        <set-service-fields service-name="createProductContent" map-name="parameters" to-map-name="createProductContent"/>
-        <set-service-fields service-name="createSimpleTextContent" map-name="parameters" to-map-name="createSimpleText"/>
-        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleText" break-on-error="true" >
-            <result-to-field result-name="contentId" map-name="createProductContent" />
+        <set-service-fields service-name="createProductContent" map-name="parameters" to-map-name="createProductContentMap"/>
+        <set-service-fields service-name="createSimpleTextContent" map-name="parameters" to-map-name="createSimpleTextMap"/>
+        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleTextMap">
+            <result-to-field result-name="contentId" map-name="createProductContentMap"/>
         </call-service>
-        <call-service service-name="createProductContent" in-map-name="createProductContent"/>
+        <call-service service-name="createProductContent" in-map-name="createProductContentMap"/>
     </simple-method>
     <simple-method method-name="updateSimpleTextContentForProduct" short-description="Update Simple Text Content For Product">
         <set-service-fields service-name="updateProductContent" map-name="parameters" to-map-name="updateProductContent"/>

Modified: trunk/applications/product/servicedef/services.xml
===================================================================
--- trunk/applications/product/servicedef/services.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/servicedef/services.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -596,9 +596,10 @@
             location="org/ofbiz/product/product/ProductContentServices.xml" invoke="createSimpleTextContentForProduct" auth="true">
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <auto-attributes mode="IN" entity-name="Content" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
         <attribute name="text" type="String" mode="IN" optional="false"/>
         <override name="contentId" optional="true"/>
+        <override name="fromDate" optional="true"/>
     </service>
     <service name="updateSimpleTextContentForProduct" default-entity-name="ProductContent" engine="simple"
             location="org/ofbiz/product/product/ProductContentServices.xml" invoke="updateSimpleTextContentForProduct" auth="true">
@@ -609,9 +610,9 @@
         <attribute name="text" type="String" mode="IN" optional="true"/>
     </service>
 
-   <!-- Category content services -->
+    <!-- Category content services -->
     <service name="createCategoryContent" default-entity-name="ProductCategoryContent" engine="simple"
-                location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="createCategoryContent" auth="true">
+            location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="createCategoryContent" auth="true">
         <description>Add Content To Category</description>
         <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -620,14 +621,14 @@
         <!--<override name="contentId" optional="true" mode="INOUT" />-->
     </service>
     <service name="updateCategoryContent" default-entity-name="ProductCategoryContent" engine="simple"
-                location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="updateCategoryContent" auth="true">
+            location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="updateCategoryContent" auth="true">
         <description>Update Content To Category</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeCategoryContent" default-entity-name="ProductCategoryContent" engine="simple"
-                location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="removeCategoryContent" auth="true">
+            location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="removeCategoryContent" auth="true">
         <description>Remove Content From Category</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -637,27 +638,28 @@
             location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="createSimpleTextContentForCategory" auth="true">
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <auto-attributes mode="IN" entity-name="Content" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
         <attribute name="text" type="String" mode="IN" optional="false"/>
         <override name="contentId" optional="true"/>
+        <override name="fromDate" optional="true"/>
     </service>
     <service name="updateSimpleTextContentForCategory" default-entity-name="ProductCategoryContent" engine="simple"
             location="org/ofbiz/product/category/CategoryContentServices.xml" invoke="updateSimpleTextContentForCategory" auth="true">
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <auto-attributes mode="IN" entity-name="Content" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
         <attribute name="textDataResourceId" type="String" mode="IN" optional="true"/>
         <attribute name="text" type="String" mode="IN" optional="true"/>
     </service>
 
     <!-- ProductFeatureDataResource services -->
     <service name="createProductFeatureDataResource" default-entity-name="ProductFeatureDataResource" engine="simple"
-                location="org/ofbiz/product/product/ProductContentServices.xml" invoke="createProductFeatureDataResource" auth="true">
+            location="org/ofbiz/product/product/ProductContentServices.xml" invoke="createProductFeatureDataResource" auth="true">
         <description>Create ProductFeature-DataResource</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <service name="removeProductFeatureDataResource" default-entity-name="ProductFeatureDataResource" engine="simple"
-                location="org/ofbiz/product/product/ProductContentServices.xml" invoke="removeProductFeatureDataResource" auth="true">
+            location="org/ofbiz/product/product/ProductContentServices.xml" invoke="removeProductFeatureDataResource" auth="true">
         <description>Remove ProductFeature-DataResource</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>

Deleted: trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContent.bsh
===================================================================
--- trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContent.bsh	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContent.bsh	2006-06-11 06:28:05 UTC (rev 7769)
@@ -1,72 +0,0 @@
-/*
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a 
- *  copy of this software and associated documentation files (the "Software"), 
- *  to deal in the Software without restriction, including without limitation 
- *  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- *  and/or sell copies of the Software, and to permit persons to whom the 
- *  Software is furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included 
- *  in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
- *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
- *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
- *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
- *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
- *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *@author     David E. Jones
- *@author     Arukala
- *@author     Brad Steiner
- *@version    $Rev$
- *@since      2.2
- */
-
-import org.ofbiz.base.util.*;
-import org.ofbiz.widget.html.*;
-import org.ofbiz.entity.GenericValue;
-
-if (productCategory != null) {
-    productCategoryType = productCategory.getRelatedOne("ProductCategoryType");
-    categoryContent = productCategory.getRelated("ProductCategoryContent", null, UtilMisc.toList("prodCatContentTypeId"));
-
-    context.put("productCategoryType", productCategoryType);
-    context.put("categoryContent", categoryContent);
-}
-//ProductCategoryTypes
-productCategoryTypes = delegator.findAll("ProductCategoryType");
-context.put("productCategoryTypes", productCategoryTypes);
-
-// Start CategoryContent stuff
-List categoryContentDatas = new LinkedList();
-Iterator categoryContentIter = categoryContent.iterator();
-while (categoryContentIter.hasNext()) {
-    GenericValue categoryContent = (GenericValue) categoryContentIter.next();
-    GenericValue content = categoryContent.getRelatedOne("Content");
-    categoryContentDatas.add(UtilMisc.toMap("categoryContent", categoryContent, "content", content));
-}
-
-
-HtmlFormWrapper updateCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "UpdateCategoryContentAssoc", request, response);
-context.put("updateCategoryContentWrapper", updateCategoryContentWrapper);
-updateCategoryContentWrapper.putInContext("categoryContentDatas", categoryContentDatas);
-
-HtmlFormWrapper prepareAddCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "PrepareAddCategoryContentAssoc", request, response);
-context.put("prepareAddCategoryContentWrapper", prepareAddCategoryContentWrapper);
-
-prepareAddCategoryContentWrapper.putInContext("productCategory", productCategory);
-
-
-HtmlFormWrapper addCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "AddCategoryContentAssoc", request, response);
-context.put("addCategoryContentWrapper", addCategoryContentWrapper);
-addCategoryContentWrapper.putInContext("productCategory", productCategory);
-
-context.put("categoryContentList", categoryContentDatas);
-
-// End ProductContent stuff
-
-// UPLOADING STUFF

Deleted: trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.bsh
===================================================================
--- trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.bsh	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.bsh	2006-06-11 06:28:05 UTC (rev 7769)
@@ -1,141 +0,0 @@
-/*
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a
- *  copy of this software and associated documentation files (the "Software"),
- *  to deal in the Software without restriction, including without limitation
- *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
- *  and/or sell copies of the Software, and to permit persons to whom the
- *  Software is furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included
- *  in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
- *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *@author     David E. Jones
- *@author     Brad Steiner
- *@author     Arukala
- *@version    $Rev$
- *@since      2.2
- */
-
-import java.util.*;
-import java.io.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.entity.util.*;
-import org.ofbiz.base.util.*;
-import org.ofbiz.widget.html.*;
-import javax.servlet.HttpServletRequest;
-
-contentId = request.getParameter("contentId");
-if("".equals(contentId)) contentId = null;
-
-prodCatContentTypeId = request.getParameter("prodCatContentTypeId");
-fromDate = request.getParameter("fromDate");
-if("".equals(fromDate)) fromDate = null;
-
-description = request.getParameter("description");
-if("".equals(description)) description = null;
-
-categoryContent = delegator.findByPrimaryKey("ProductCategoryContent", UtilMisc.toMap("contentId", contentId, "productCategoryId", productCategoryId, "prodCatContentTypeId", prodCatContentTypeId, "fromDate", fromDate));
-if(categoryContent == null) {
-    categoryContent = new HashMap();
-    categoryContent.put("productCategoryId", productCategoryId);
-    categoryContent.put("contentId", contentId);
-    categoryContent.put("prodCatContentTypeId", prodCatContentTypeId);
-    categoryContent.put("fromDate", fromDate);
-    categoryContent.put("thruDate", request.getParameter("thruDate"));
-    categoryContent.put("purchaseFromDate", request.getParameter("purchaseFromDate"));
-    categoryContent.put("purchaseThruDate", request.getParameter("purchaseThruDate"));
-    categoryContent.put("useDaysLimit", request.getParameter("useDaysLimit"));
-    categoryContent.put("useCountLimit", request.getParameter("useCountLimit"));
-}
-context.put("categoryContent", categoryContent);
-
-categoryContentData = new HashMap();
-categoryContentData.putAll(categoryContent);
-
-Map content = null;
-context.put("contentId", contentId);
-if(contentId != null) {
-    content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
-    context.put("content", content);
-} else {
-    content = new HashMap();
-    if(description != null) content.put("description", description);
-}
-
-HtmlFormWrapper updateCategoryContentWrapper = null;
-
-//Email
-if ("FULFILLMENT_EMAIL".equals(prodCatContentTypeId)) {
-    emailData = new HashMap();
-    if (contentId != null && content != null) {
-        subjectDr = content.getRelatedOne("DataResource");
-        if (subjectDr != null) {
-            subject = subjectDr.getRelatedOne("ElectronicText");
-            emailData.put("subject", subject.get("textData"));
-            emailData.put("subjectDataResourceId", subject.get("dataResourceId"));
-        }
-        serviceCtx = UtilMisc.toMap("userLogin", userLogin, "contentId", contentId, "mapKeys", UtilMisc.toList("plainBody", "htmlBody"));
-        result = dispatcher.runSync("findAssocContent", serviceCtx);
-        contentAssocs = result.get("contentAssocs");
-        if (contentAssocs != null) {
-            for (java.util.Iterator iterator = contentAssocs.iterator(); iterator.hasNext(); ) {
-                contentAssoc  = iterator.next();
-                bodyContent = contentAssoc.getRelatedOne("ToContent");
-                bodyDr = bodyContent.getRelatedOne("DataResource");
-                body = bodyDr.getRelatedOne("ElectronicText");
-                emailData.put(contentAssoc.get("mapKey"), body.get("textData"));
-                emailData.put(contentAssoc.get("mapKey")+"DataResourceId", body.get("dataResourceId"));
-            }
-        }
-    }
-
-    updateCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentEmail", request, response);
-    updateCategoryContentWrapper.putInContext("emailData", emailData);
-    context.put("emailData", emailData);
-} else if ("DIGITAL_DOWNLOAD".equals(prodCatContentTypeId)) {
-    downloadData = new HashMap();
-    if (contentId != null && content != null) {
-        downloadDr = content.getRelatedOne("DataResource");
-        if (subjectDr != null) {
-            download = downloadDr.getRelatedOne("OtherDataResource");
-            downloadData.put("file", download.get("dataResourceContent"));
-            downloadData.put("fileDataResourceId", download.get("dataResourceId"));
-        }
-    }
-    updateCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentDownload", request, response);
-    updateCategoryContentWrapper.putInContext("downloadData", downloadData);
-} else if ("FULFILLMENT_EXTERNAL".equals(prodCatContentTypeId)) {
-    updateCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditProductContentExternal", request, response);
-} else {
-    //Assume it is a generic simple text content
-    textData = new HashMap();
-    if (contentId != null && content != null) {
-        textDr = content.getRelatedOne("DataResource");
-        if (textDr != null) {
-            text = textDr.getRelatedOne("ElectronicText");
-            textData.put("text", text.get("textData"));
-            textData.put("textDataResourceId", text.get("dataResourceId"));
-        }
-    }
-    updateCategoryContentWrapper = new HtmlFormWrapper("/product/ProductForms.xml", "EditCategoryContentSimpleText", request, response);
-    updateCategoryContentWrapper.putInContext("textData", textData);
-
-}
-
-context.put("updateCategoryContentWrapper", updateCategoryContentWrapper);
-updateCategoryContentWrapper.putInContext("categoryContentData", categoryContentData);
-//updateCategoryContentWrapper.putInContext("content", content);
-context.put("categoryContentData", categoryContentData);
-updateCategoryContentWrapper.putInContext("content", content);
-updateCategoryContentWrapper.putInContext("contentId", contentId);
-//context.put("log", log);

Modified: trunk/applications/product/webapp/catalog/category/CategoryForms.xml
===================================================================
--- trunk/applications/product/webapp/catalog/category/CategoryForms.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/category/CategoryForms.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!--
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ *  Copyright (c) 2003-2006 The Open For Business Project - www.ofbiz.org
  *
  *  Permission is hereby granted, free of charge, to any person obtaining a
  *  copy of this software and associated documentation files (the "Software"),
@@ -43,4 +43,83 @@
                 description="[${uiLabelMap.CommonDelete}]"/>
         </field>
     </form>
+
+    <!-- Product Category Content Forms  -->
+    <form name="AddCategoryContentAssoc" type="single"
+        target="addContentToCategory" title="${uiLabelMap.ProductAddProductCategoryContentFromDate}"
+        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <auto-fields-entity entity-name="ProductCategoryContent"/>
+        <field name="productCategoryId" map-name="productCategory"><hidden/></field>
+        <field name="prodCatContentTypeId" widget-style="selectBox">
+            <drop-down>
+                <entity-options entity-name="ProductCategoryContentType" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="PrepareAddCategoryContentAssoc" type="single"
+        target="prepareAddContentToCategory" title="${uiLabelMap.ProductAddProductCategoryContentFromDate}"
+        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <field name="productId"><hidden/></field>
+        <field name="productCategoryId" map-name="productCategory"><hidden/></field>
+        <field name="prodCatContentTypeId" widget-style="selectBox">
+            <drop-down>
+                <entity-options entity-name="ProductCategoryContentType" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <!-- <field name="description"><text size="40"/></field> -->
+        <field name="submitButton" title="${uiLabelMap.ProductPrepareCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="UpdateCategoryContentAssoc" type="list"
+        target="updateContentToCategory" title="" list-name="productCategoryContentList"
+        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <field name="productCategoryId"><hidden/></field>
+        <field name="contentId" title="${uiLabelMap.ProductContent}" widget-style="tabletext">
+            <display-entity entity-name="Content" description="${description}" also-hidden="true">
+                <sub-hyperlink target="/content/control/EditContent?contentId=${contentId}" description="Content: ${contentId}" target-type="inter-app" link-style="buttontext"/>
+            </display-entity>
+        </field>
+        <field name="fromDate" widget-style="tabletext"><display/></field>
+        <field name="thruDate"><date-time type="timestamp"/></field>
+        <field name="prodCatContentTypeId" widget-style="selectBox">
+            <drop-down>
+                <entity-options entity-name="ProductCategoryContentType" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="editLink" title="" widget-style="buttontext">
+            <hyperlink target="EditCategoryContentContent?productCategoryId=${productCategoryId}&amp;contentId=${contentId}&amp;prodCatContentTypeId=${prodCatContentTypeId}&amp;fromDate=${fromDate}" description="${uiLabelMap.CommonEdit}"/>
+        </field>
+        <field name="deleteLink" title="" widget-style="buttontext">
+            <hyperlink target="removeContentFromCategory?productCategoryId=${productCategoryId}&amp;contentId=${contentId}&amp;prodCatContentTypeId=${prodCatContentTypeId}&amp;fromDate=${fromDate}"
+                description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
+        </field>
+    </form>
+    <form name="EditCategoryContentSimpleText" type="single" default-map-name="categoryContent"
+        target="updateSimpleTextContentForCategory" title="${uiLabelMap.ProductUpdateSimpleTextContentCategory}"
+        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <alt-target use-when="content==null" target="createSimpleTextContentForCategory"/>
+        <auto-fields-entity entity-name="ProductCategoryContent"/>
+
+        <field use-when="content==null" name="contentId"><ignored/></field>
+        <field use-when="content!=null" name="contentId" tooltip="${uiLabelMap.ProductNotModificationRecrationProductContentAssociation}" map-name="categoryContentData" widget-style="tabletext"><display/></field>
+
+        <field name="prodCatContentTypeId" title="Category Content Type" widget-style="tabletext"><display-entity entity-name="ProductCategoryContentType" also-hidden="true"/></field>
+        <field name="description" map-name="content"><text size="40"/></field>
+        <field name="localeString" map-name="content"><text size="40"/></field>
+        <field name="text" map-name="textDataMap" widget-style="textAreaBox"><textarea cols="80" rows="10"/></field>
+        <field name="textDataResourceId" map-name="textDataMap"><hidden/></field>
+        <field name="useCountLimit"><hidden/></field>
+        <field name="purchaseThruDate"><hidden/></field>
+        <field name="purchaseFromDate"><hidden/></field>
+        <field name="productCategoryId"><hidden/></field>
+        <field use-when="content == null" name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field use-when="content != null" name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: trunk/applications/product/webapp/catalog/category/EditCategoryContent.ftl
===================================================================
--- trunk/applications/product/webapp/catalog/category/EditCategoryContent.ftl	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/category/EditCategoryContent.ftl	2006-06-11 06:28:05 UTC (rev 7769)
@@ -26,62 +26,13 @@
  *@version    $Rev$
  *@since      2.2
 -->
-<script language="JavaScript" type="text/javascript">
-function insertNowTimestamp(field) {
-  eval('document.categoryForm.' + field + '.value="${nowTimestamp?string}";');
-};
-
-</script>
-
-    <#if !(productCategory?exists)>
-        <h3>${uiLabelMap.ProductCouldNotFindProduct} "${productCategoryId}".</h3>
-    <#else>
-        <table border="1" cellpadding="2" cellspacing="0">
-        <tr class="tableheadtext">
-            <td>${uiLabelMap.CommonContent}</td>
-            <td>${uiLabelMap.CommonType}</td>
-            <td>${uiLabelMap.CommonFrom}</td>
-            <td>${uiLabelMap.CommonThru}</td>
-            <td>${uiLabelMap.ProductPurchaseFrom}</td>
-            <td>${uiLabelMap.ProductPurchaseThru}</td>
-            <td>${uiLabelMap.ProductUseCount}</td>
-            <td>${uiLabelMap.ProductUseDays}</td>
-            <td>&nbsp;</td>
-        </tr>
-          <#list categoryContentList as entry>
-            <#assign categoryContent=entry.categoryContent/>
-            <#assign prodCatContentType=categoryContent.getRelatedOneCache("ProductCategoryContentType")/>
-            <tr class="tabletext">
-                <td><a href="<@ofbizUrl>EditCategoryContentContent?productCategoryId=${categoryContent.productCategoryId}&amp;contentId=${categoryContent.contentId}&amp;prodCatContentTypeId=${categoryContent.prodCatContentTypeId}&amp;fromDate=${categoryContent.fromDate}</@ofbizUrl>" class="buttontext">${entry.content.get("description",locale)?default("[No description]")} [${entry.content.contentId}]</td>
-                <td>${prodCatContentType.get("description",locale)?default(categoryContent.prodCatContentTypeId)}</td>
-                <td>${categoryContent.fromDate?default("N/A")}</td>
-                <td>${categoryContent.thruDate?default("N/A")}</td>
-                <td>${categoryContent.purchaseFromDate?default("N/A")}</td>
-                <td>${categoryContent.purchaseThruDate?default("N/A")}</td>
-                <td>${categoryContent.useCountLimit?default("N/A")}</td>
-                <td>${categoryContent.useDaysLimit?default("N/A")}</td>
-                <td><a href="<@ofbizUrl>removeContentFromCategory?productCategoryId=${categoryContent.productCategoryId}&amp;contentId=${categoryContent.contentId}&amp;prodCatContentTypeId=${categoryContent.prodCatContentTypeId}&amp;fromDate=${categoryContent.fromDate}</@ofbizUrl>" class="buttontext">[Delete]</a></td>
-                <td><a href="/content/control/EditContent?contentId=${categoryContent.contentId}&externalLoginKey=${requestAttributes.externalLoginKey?if_exists}" class="buttontext">[${uiLabelMap.CommonEdit} ${uiLabelMap.Content} ${entry.content.contentId}]</td>
-             </tr>
-        </#list>
-        </table>
     
-   <div class="head2">${uiLabelMap.ProductAddProductCategoryContentFromDate}</div>
-   
-        <#if productCategoryId?has_content && productCategory?has_content>
-           ${prepareAddCategoryContentWrapper.renderFormString()}  
-        </#if>
-        <div class="head2">${uiLabelMap.ProductAddContentCategory}</div>
-        <#if productCategoryId?has_content && productCategory?has_content>
-            ${addCategoryContentWrapper.renderFormString()}   
-        </#if>
+<hr class="sepbar"/>
 
-        <hr class="sepbar"/>
-        
-        <div class="head2">${uiLabelMap.ProductOverrideSimpleFields}</div>
-        <form action="<@ofbizUrl>updateCategoryContent</@ofbizUrl>" method="post" style="margin: 0;" name="categoryForm">
-        <table border="0" cellpadding="2" cellspacing="0">
-        <input type="hidden" name="productCategoryId" value="${productCategoryId?if_exists}">
+<div class="head2">${uiLabelMap.ProductOverrideSimpleFields}</div>
+<form action="<@ofbizUrl>updateCategoryContent</@ofbizUrl>" method="post" style="margin: 0;" name="categoryForm">
+<table border="0" cellpadding="2" cellspacing="0">
+<input type="hidden" name="productCategoryId" value="${productCategoryId?if_exists}">
     <tr>
     <td width="26%" align="right"><div class="tabletext">${uiLabelMap.ProductProductCategoryType}</div></td>
     <td>&nbsp;</td>
@@ -117,12 +68,12 @@
         <br/><span class="tabletext">${uiLabelMap.ProductDefaultsTo} &quot;categorydetail&quot;, ${uiLabelMap.ProductDetailScreenMessage}: &quot;component://ecommerce/widget/CatalogScreens.xml#categorydetail&quot;</span>
     </td>
   </tr>
-        <tr>
-            <td colspan="2">&nbsp;</td>
-            <td><input type="submit" name="Update" value="${uiLabelMap.CommonUpdate}"></td>
-            <td colspan="3">&nbsp;</td>
-        </tr>
-        </table>
-        </form>
-        <hr class="sepbar"/>
-   </#if> 
+
+<tr>
+    <td colspan="2">&nbsp;</td>
+    <td><input type="submit" name="Update" value="${uiLabelMap.CommonUpdate}"></td>
+    <td colspan="3">&nbsp;</td>
+</tr>
+</table>
+</form>
+<hr class="sepbar"/>

Deleted: trunk/applications/product/webapp/catalog/category/EditCategoryContentContent.ftl
===================================================================
--- trunk/applications/product/webapp/catalog/category/EditCategoryContentContent.ftl	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/category/EditCategoryContentContent.ftl	2006-06-11 06:28:05 UTC (rev 7769)
@@ -1,32 +0,0 @@
-<#--
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a 
- *  copy of this software and associated documentation files (the "Software"), 
- *  to deal in the Software without restriction, including without limitation 
- *  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- *  and/or sell copies of the Software, and to permit persons to whom the 
- *  Software is furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included 
- *  in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
- *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
- *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
- *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
- *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
- *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *@author     Arukala  (arukala at gmx.de)
- *@version    $Rev$
- *@since      3.0
--->
-    <#if contentId?has_content>
-        <a href="/content/control/gotoContent?contentId=${contentId}" class='buttontext' target='_blank'>[${uiLabelMap.Content} ${uiLabelMap.CommonPage}]</a>
-    </#if>
-    <br/>
-    <#if productCategoryId?has_content && categoryContent?has_content>
-        ${updateCategoryContentWrapper.renderFormString()}
-    </#if>

Modified: trunk/applications/product/webapp/catalog/product/ProductForms.xml
===================================================================
--- trunk/applications/product/webapp/catalog/product/ProductForms.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/webapp/catalog/product/ProductForms.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -604,92 +604,6 @@
         </field>
     </form>
 
-    <!-- Product Category Content Forms  -->
-    <form name="AddCategoryContentAssoc" type="single"
-            target="addContentToCategory" title="${uiLabelMap.ProductAddProductCategoryContentFromDate}"
-            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
-        <auto-fields-entity entity-name="ProductCategoryContent"/>
-        <field name="productCategoryId" map-name="productCategory"><hidden/></field>
-        <field name="prodCatContentTypeId" title="${uiLabelMap.ProductProdCatContentTypeId}" widget-style="selectBox">
-            <drop-down>
-                <entity-options entity-name="ProductCategoryContentType" description="${description}">
-                    <entity-order-by field-name="description"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
-    </form>
-    <form name="PrepareAddCategoryContentAssoc" type="single"
-            target="prepareAddContentToCategory" title="${uiLabelMap.ProductAddProductCategoryContentFromDate}"
-            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
-        <auto-fields-entity entity-name="ProductCategoryContent"/>
-        <field name="contentId"><ignored/></field>
-        <field name="useTime"><ignored/></field>
-        <field name="useTimeUomId"><ignored/></field>
-        <field name="useRoleTypeId"><ignored/></field>
-        <field name="useCountLimit"><ignored/></field>
-        <field name="purchaseThruDate"><ignored/></field>
-        <field name="purchaseFromDate"><ignored/></field>
-        <field name="fromDate"><ignored/></field>
-        <field name="thruDate"><ignored/></field>
-        <field name="productId"><hidden value="${productId}"/></field>
-        <field name="productCategoryId" map-name="productCategory"><hidden/></field>
-        <field name="prodCatContentTypeId" title="${uiLabelMap.ProductProdCatContentTypeId}" widget-style="selectBox">
-            <drop-down>
-                <entity-options entity-name="ProductCategoryContentType" description="${description}">
-                    <entity-order-by field-name="description"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <!-- <field name="description"><text size="40"/></field> -->
-        <field name="submitButton" title="${uiLabelMap.ProductPrepareCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
-    </form>
-    <form name="UpdateCategoryContentAssoc" type="list"
-            target="updateContentToCategory" title="" list-name="categoryContentDatas"
-            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
-        <!-- each entry in the list will be a Map with the entries: categoryContent and content -->
-        <auto-fields-service service-name="updateCategoryContent" map-name="productCategoryContent"/>
-        <field name="productCategoryId"><hidden/></field>
-        <field name="contentId" title="${uiLabelMap.ProductContent_ID}" widget-style="buttontext">
-            <hyperlink target="EditCategoryContentContent?productCategoryId=${categoryContent.productCategoryId}&amp;contentId=${categoryContent.contentId}"
-                description="${content.description} [${categoryContent.contentId}]"/>
-        </field>
-        <field name="prodCatContentTypeId" title="${uiLabelMap.ProductProdCatContentTypeId}" widget-style="selectBox">
-            <drop-down>
-                <entity-options entity-name="ProductCategoryContentType" description="${description}">
-                    <entity-order-by field-name="description"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
-        <field name="deleteLink" title="" widget-style="buttontext">
-            <hyperlink target="removeContentFromCategory?productCategoryId=${categoryContent.productCategoryId}&amp;contentId=${categoryContent.contentId}&amp;prodCatContentTypeId=${categoryContent.prodCatContentTypeId}&amp;fromDate=${categoryContent.fromDate}"
-                description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
-        </field>
-    </form>
-    <form name="EditCategoryContentSimpleText" type="single"
-            target="updateSimpleTextContentForCategory" title="${uiLabelMap.ProductUpdateSimpleTextContentCategory}"
-            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
-        <alt-target use-when="contentId==null" target="createSimpleTextContentForCategory"/>
-        <auto-fields-entity entity-name="ProductCategoryContent" map-name="categoryContentData"/>
-        <field name="description" title="${uiLabelMap.ProductDescription}" map-name="content"><text size="40"/></field>
-        <field name="localeString" title="${uiLabelMap.ProductLocaleString}" map-name="content"><text size="40"/></field>
-        <field use-when="contentId == null" name="contentId"><ignored/></field>
-        <field use-when="contentId != null" name="contentId" tooltip="${uiLabelMap.ProductNotModificationRecrationProductContentAssociation}" map-name="categoryContentData" ><display/></field>
-        <field name="text" title="${uiLabelMap.ProductText}" map-name="textData" widget-style="textAreaBox" ><textarea cols="60" rows="7"/></field>
-        <field name="textDataResourceId" map-name="textData"><hidden/></field>
-        <field name="useTime"><hidden/></field>
-        <field name="useTimeUomId"><hidden/></field>
-        <field name="useRoleTypeId"><hidden/></field>
-        <field name="useCountLimit"><hidden/></field>
-        <field name="purchaseThruDate"><hidden/></field>
-        <field name="purchaseFromDate"><hidden/></field>
-        <field name="productCategoryId"><hidden/></field>
-        <field name="prodCatContentTypeId"><hidden/></field>
-        <field use-when="contentId == null" name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
-        <field use-when="contentId != null" name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
-    </form>
-    
     <!-- ProductConfig -->
     <form name="AddProductConfig" type="single"
             target="createProductConfig" title="" 

Modified: trunk/applications/product/widget/catalog/CategoryScreens.xml
===================================================================
--- trunk/applications/product/widget/catalog/CategoryScreens.xml	2006-06-10 19:11:57 UTC (rev 7768)
+++ trunk/applications/product/widget/catalog/CategoryScreens.xml	2006-06-11 06:28:05 UTC (rev 7769)
@@ -52,10 +52,10 @@
                                         </container>
                                         
                                         <container>
-                                            <link target="EditCategory" text="[${uiLabelMap.ProductNewCategory}]" style="buttontext"/>
-                                            <link target="createProductInCategoryStart?productCategoryId=${productCategoryId}" text="[${uiLabelMap.ProductCreateProductInCategory}]" style="buttontext"/>
-                                            <link target="advancedsearch?SEARCH_CATEGORY_ID=${productCategoryId}" text="[${uiLabelMap.ProductSearchinCategory}]" style="buttontext"/>
-                                            <link target="/ecommerce/control/category?category_id=${productCategoryId}" url-mode="plain" text="[${uiLabelMap.ProductCategoryPage}]" style="buttontext"/>
+                                            <link target="EditCategory" text="${uiLabelMap.ProductNewCategory}" style="buttontext"/>
+                                            <link target="createProductInCategoryStart?productCategoryId=${productCategoryId}" text="${uiLabelMap.ProductCreateProductInCategory}" style="buttontext"/>
+                                            <link target="advancedsearch?SEARCH_CATEGORY_ID=${productCategoryId}" text="${uiLabelMap.ProductSearchinCategory}" style="buttontext"/>
+                                            <link target="/ecommerce/control/category?category_id=${productCategoryId}" url-mode="plain" text="${uiLabelMap.ProductCategoryPage}" style="buttontext"/>
                                         </container>
                                     </widgets>
                                 </section>
@@ -113,12 +113,23 @@
 
                 <set field="productCategoryId" from-field="parameters.productCategoryId"/>
                 <entity-one entity-name="ProductCategory" value-name="productCategory"/>
+                <get-related-one value-name="productCategory" relation-name="ProductCategoryType" to-value-name="productCategoryType"/>
+                <set field="categoryContentOrderList[]" value="prodCatContentTypeId"/>
+                <get-related value-name="productCategory" relation-name="ProductCategoryContent" list-name="productCategoryContentList" order-by-list-name="categoryContentOrderList"/>
 
-                <script location="component://product/webapp/catalog/WEB-INF/actions/category/EditCategoryContent.bsh"/>
+                <entity-condition entity-name="ProductCategoryType" list-name="productCategoryTypes"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonCategoryDecorator">
                     <decorator-section name="body">
+                        <include-form name="UpdateCategoryContentAssoc" location="component://product/webapp/catalog/category/CategoryForms.xml"/>
+
+                        <container><label text="${uiLabelMap.ProductAddProductCategoryContentFromDate}" style="head2"/></container>
+                        <include-form name="PrepareAddCategoryContentAssoc" location="component://product/webapp/catalog/category/CategoryForms.xml"/>
+
+                        <container><label text="${uiLabelMap.ProductAddContentCategory}" style="head2"/></container>
+                        <include-form name="AddCategoryContentAssoc" location="component://product/webapp/catalog/category/CategoryForms.xml"/>
+
                         <platform-specific>
                             <html><html-template location="component://product/webapp/catalog/category/EditCategoryContent.ftl"/></html>
                         </platform-specific>
@@ -137,15 +148,22 @@
 
                 <set field="productCategoryId" from-field="parameters.productCategoryId"/>
                 <entity-one entity-name="ProductCategory" value-name="productCategory"/>
-
-                <script location="component://product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.bsh"/>
+                <entity-one entity-name="ProductCategoryContent" value-name="categoryContent"/>
+                <entity-one entity-name="Content" value-name="content"/>
+                <entity-one entity-name="ElectronicText" value-name="electronicText" auto-field-map="false">
+                    <field-map field-name="dataResourceId" env-name="content.dataResourceId"/>
+                </entity-one>
+                <set field="textDataMap.text" from-field="electronicText.textData"/>
+                <set field="textDataMap.textDataResourceId" from-field="content.dataResourceId"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonCategoryDecorator">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <html><html-template location="component://product/webapp/catalog/category/EditCategoryContentContent.ftl"/></html>
-                        </platform-specific>
+                        <section>
+                            <condition><not><if-empty field-name="contentId"/></not></condition>
+                            <widgets><link target="/content/control/gotoContent?contentId=${contentId}" text="${uiLabelMap.ContentContent} ${uiLabelMap.CommonPage}" url-mode="inter-app" style="buttontext"/></widgets>
+                        </section>
+                        <include-form name="EditCategoryContentSimpleText" location="component://product/webapp/catalog/category/CategoryForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>



More information about the Svn mailing list