You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/04/19 21:54:46 UTC

svn commit: r530530 - in /ofbiz/trunk/applications/content: script/org/ofbiz/content/content/ servicedef/ webapp/content/website/ widget/

Author: jaz
Date: Thu Apr 19 12:54:45 2007
New Revision: 530530

URL: http://svn.apache.org/viewvc?view=rev&rev=530530
Log:
updated CMS to do simple (single) content purpose and updates

Modified:
    ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
    ofbiz/trunk/applications/content/servicedef/secas.xml
    ofbiz/trunk/applications/content/servicedef/services.xml
    ofbiz/trunk/applications/content/servicedef/services_content.xml
    ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl
    ofbiz/trunk/applications/content/widget/WebSiteScreens.xml

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml Thu Apr 19 12:54:45 2007
@@ -438,6 +438,11 @@
         <find-by-primary-key entity-name="ContentPurpose" map-name="lookupKeyValue" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
+    <simple-method method-name="updateSingleContentPurpose" short-description="Updates the purpose making sure there is only one">
+        <set field="toRemove.contentId" from-field="parameters.contentId"/>
+        <remove-by-and entity-name="ContentPurpose" map-name="toRemove"/>
+        <call-simple-method method-name="createContentPurpose"/>
+    </simple-method>
     
     <!-- Methods for ContentOperation -->
     <simple-method method-name="createContentOperation" short-description="Create Content Operation">

Modified: ofbiz/trunk/applications/content/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/secas.xml?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/secas.xml Thu Apr 19 12:54:45 2007
@@ -166,6 +166,10 @@
         <condition field-name="fromDate" operator="is-not-empty"/>
         <action service="updateContentAssoc" mode="sync" run-as-user="system"/>
     </eca>
+    <eca service="updateContent" event="commit">
+        <condition field-name="contentPurposeTypeId" operator="is-not-empty"/>
+        <action service="updateSingleContentPurpose" mode="sync" run-as-user="system"/>
+    </eca>
 
     <!-- content assoc services -->
     <eca service="createContentAssoc" event="in-validate">

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Thu Apr 19 12:54:45 2007
@@ -121,6 +121,13 @@
         <permission-service service-name="contentManagerPermission" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+    <service name="updateSingleContentPurpose" engine="simple" default-entity-name="ContentPurpose" auth="true"
+            location="org/ofbiz/content/content/ContentServices.xml" invoke="updateSingleContentPurpose">
+        <description>Removes content purposes and creates a new one</description>
+        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="true"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
 
     <!-- ContentPurposeOperation services -->
     <service name="createContentPurposeOperation" engine="simple" default-entity-name="ContentPurposeOperation" auth="true"

Modified: ofbiz/trunk/applications/content/servicedef/services_content.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_content.xml?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_content.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_content.xml Thu Apr 19 12:54:45 2007
@@ -111,6 +111,7 @@
         <implements service="updateContentAssoc" optional="true"/>
         <auto-attributes entity-name="Content" include="pk" mode="INOUT" optional="false"/>
         <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
+        <attribute name="contentPurposeTypeId" type="String" mode="IN" optional="true"/> 
         <!-- TODO: the following fields are depricated; but will not be removed until all services and callers are updated -->
         <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
         <attribute mode="IN" name="skipPermissionCheck" optional="true" type="String"/>

Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl Thu Apr 19 12:54:45 2007
@@ -150,8 +150,7 @@
                     <input type="hidden" name="${paramName}" value="${requestParameters.get(paramName)}"/>
                 </#if>
             </#list>
-        <#else>
-            <input type="hidden" name="contentPurposeTypeId" value="${contentPurposeTypeId?default('SECTION')}"/>
+        <#else>            
             <input type="hidden" name="contentAssocTypeId" value="${contentAssocTypeId?default('SUBSITE')}"/>
             <input type="hidden" name="ownerContentId" value="${contentIdFrom?default(contentRoot)}"/>
             <input type="hidden" name="contentIdFrom" value="${contentIdFrom?default(contentRoot)}"/>
@@ -186,6 +185,24 @@
             <td><div class="tableheadtext">Key</div></td>
             <td>
                 <input type="text" name="mapKey" class="inputBox" value="${(assoc.mapKey)?if_exists}" size="40"/>
+            </td>
+          </tr>
+          <tr>
+            <td><div class="tableheadtext">Purpose</div></td>
+            <td>
+                <select name="contentPurposeTypeId" class="selectBox">
+                    <#if (currentPurposes?has_content)>
+                        <#assign purpose = currentPurposes[0].getRelatedOne("ContentPurposeType")/>
+                        <option value="${purpose.contentPurposeTypeId}">${purpose.description?default(purpose.contentPurposeTypeId)}</option>
+                        <option value="${purpose.contentPurposeTypeId}">----</option>
+                    <#else>
+                        <option value="SECTION">Section</option>
+                        <option value="SECTION">----</option>
+                    </#if>
+                    <#list purposeTypes as type>
+                        <option value="${type.contentPurposeTypeId}">${type.description}</option>
+                    </#list>
+                </select>
             </td>
           </tr>
           <tr>

Modified: ofbiz/trunk/applications/content/widget/WebSiteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/WebSiteScreens.xml?view=diff&rev=530530&r1=530529&r2=530530
==============================================================================
--- ofbiz/trunk/applications/content/widget/WebSiteScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/WebSiteScreens.xml Thu Apr 19 12:54:45 2007
@@ -256,6 +256,12 @@
                     <field-map field-name="contentAssocTypeId" env-name="parameters.contentAssocTypeId"/>
                     <field-map field-name="fromDate" env-name="parameters.fromDate"/>
                 </entity-one>
+                <entity-and entity-name="ContentPurpose" list-name="currentPurposes">
+                    <field-map field-name="contentId" env-name="contentId"/>                    
+                </entity-and>
+                <entity-condition entity-name="ContentPurposeType" list-name="purposeTypes">
+                    <order-by field-name="description"/>
+                </entity-condition>
                 <entity-and entity-name="DataResource" list-name="templates">
                     <field-map field-name="dataCategoryId" value="TEMPLATE"/>
                     <order-by field-name="dataResourceName"/>