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/03/09 08:42:37 UTC

svn commit: r516320 - in /ofbiz/trunk/applications/content: data/ script/org/ofbiz/content/website/ servicedef/ webapp/content/WEB-INF/ webapp/content/website/ widget/

Author: jaz
Date: Thu Mar  8 23:42:36 2007
New Revision: 516320

URL: http://svn.apache.org/viewvc?view=rev&rev=516320
Log:
added quick way to create publish points for websites

Modified:
    ofbiz/trunk/applications/content/data/ContentTypeData.xml
    ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
    ofbiz/trunk/applications/content/servicedef/services_website.xml
    ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
    ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
    ofbiz/trunk/applications/content/widget/WebSiteScreens.xml

Modified: ofbiz/trunk/applications/content/data/ContentTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/data/ContentTypeData.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/data/ContentTypeData.xml (original)
+++ ofbiz/trunk/applications/content/data/ContentTypeData.xml Thu Mar  8 23:42:36 2007
@@ -226,8 +226,9 @@
     <SubscriptionType description="Product Info" hasTable="N" parentTypeId="" subscriptionTypeId="PRODUCT_INFO_SUBSCR"/>
 
     <!-- website data -->
-    <WebSiteContentType webSiteContentTypeId="PUBLISH_POINT" description="Publish Point (one)" hasTable="N" parentTypeId=""/>
-    <WebSiteContentType webSiteContentTypeId="META_DATA" description="HTML Meta Data (many)" hasTable="N" parentTypeId=""/>
+    <WebSiteContentType webSiteContentTypeId="PUBLISH_POINT" description="Publish Point" hasTable="N" parentTypeId=""/>
+    <WebSiteContentType webSiteContentTypeId="MENU_ROOT" description="Menu Containers" hasTable="N" parentTypeId=""/>
+    <WebSiteContentType webSiteContentTypeId="BLOG_ROOT" description="Blog Root" hasTable="N" parentTypeId=""/>    
 
     <!-- survey data -->
     <SurveyApplType surveyApplTypeId="CART_ADD" description="Add-To Cart"/>

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml Thu Mar  8 23:42:36 2007
@@ -147,4 +147,51 @@
         <find-by-primary-key entity-name="WebSiteRole" map-name="lookupPKMap" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
+
+    <!-- quick create website CMS content -->
+    <simple-method method-name="quickCreateWebSiteContent" short-description="Auto-Create WebSite CMS Content">
+        <entity-one entity-name="WebSite" value-name="webSite">
+            <field-map field-name="webSiteId" env-name="parameters.webSiteId"/>
+        </entity-one>
+        <now-timestamp-to-env env-name="now"/>
+        <log level="always" message="Parameters: ${parameters}"/>
+        
+        <if-instance-of field-name="parameters.webSiteContentTypeId" class="String">
+            <!-- just one checked -->
+            <entity-one entity-name="WebSiteContentType" value-name="wct">
+                <field-map field-name="webSiteContentTypeId" env-name="parameters.webSiteContentTypeId"/>
+            </entity-one>
+
+            <set field="cnt.contentName" value="${webSite.siteName} ${wct.description}"/>
+            <set field="cnt.contentTypeId" value="WEB_SITE_PUB_PT"/>
+            <call-service service-name="createContent" in-map-name="cnt">
+                <result-to-field result-name="contentId" field-name="wcc.contentId"/>
+            </call-service>
+
+            <set field="wcc.webSiteId" from-field="webSite.webSiteId"/>
+            <set field="wcc.webSiteContentTypeId" from-field="type.webSiteContentTypeId"/>
+            <set field="wcc.fromDate" from-field="now"/>
+            <call-service service-name="createWebSiteContent" in-map-name="wcc"/>
+
+            <else>
+                <!-- multi-checked -->
+                <iterate entry-name="thisType" list-name="parameters.webSiteContentTypeId">
+                    <entity-one entity-name="WebSiteContentType" value-name="wct">
+                        <field-map field-name="webSiteContentTypeId" env-name="thisType"/>
+                    </entity-one>
+
+                    <set field="cnt.contentName" value="${webSite.siteName} ${wct.description}"/>
+                    <set field="cnt.contentTypeId" value="WEB_SITE_PUB_PT"/>
+                    <call-service service-name="createContent" in-map-name="cnt">
+                        <result-to-field result-name="contentId" field-name="wcc.contentId"/>
+                    </call-service>
+
+                    <set field="wcc.webSiteId" from-field="webSite.webSiteId"/>
+                    <set field="wcc.webSiteContentTypeId" from-field="thisType"/>
+                    <set field="wcc.fromDate" from-field="now"/>
+                    <call-service service-name="createWebSiteContent" in-map-name="wcc"/>
+                </iterate>
+            </else>
+        </if-instance-of>                
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/content/servicedef/services_website.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_website.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_website.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_website.xml Thu Mar  8 23:42:36 2007
@@ -152,4 +152,12 @@
         <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
         <auto-attributes entity-name="WebSiteRole" include="pk" mode="IN" optional="false"/>
     </service>
+
+    <!-- auto-create website content records -->
+    <service name="autoCreateWebSiteContent" engine="simple" auth="true"
+            location="org/ofbiz/content/website/WebSiteServices.xml" invoke="quickCreateWebSiteContent">
+        <description>Auto Create Content Publish Points</description>
+        <attribute name="webSiteId" type="String" mode="IN" optional="false"/>
+        <attribute name="webSiteContentTypeId" type="List" mode="IN" optional="false"/> 
+    </service>
 </services>

Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Thu Mar  8 23:42:36 2007
@@ -247,6 +247,12 @@
         <response name="success" type="view" value="WebSiteContent"/>
         <response name="error" type="view" value="WebSiteContent"/>
     </request-map>
+    <request-map uri="autoCreateWebSiteContent">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="autoCreateWebSiteContent"/>
+        <response name="success" type="view" value="WebSiteContent"/>
+        <response name="error" type="view" value="WebSiteContent"/>
+    </request-map>
 
     <!-- ================ WebSite Parties Requests ================= -->
     <request-map uri="EditWebSiteParties">

Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml Thu Mar  8 23:42:36 2007
@@ -147,4 +147,16 @@
                 description="[Delete]" also-hidden="false"/>
         </field>
     </form>
+    <form name="AutoCreateWebsiteContent" type="single" target="autoCreateWebSiteContent" title=""
+            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <field name="webSiteId"><hidden/></field>
+        <field name="webSiteContentTypeId" widget-style="tabletext">
+            <check all-checked="false">
+                <entity-options entity-name="WebSiteContentType" description="${description}">
+                    <entity-order-by field-name="description"/>    
+                </entity-options>
+            </check>
+        </field>        
+        <field name="submitButton" title="Create" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/content/widget/WebSiteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/WebSiteScreens.xml?view=diff&rev=516320&r1=516319&r2=516320
==============================================================================
--- ofbiz/trunk/applications/content/widget/WebSiteScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/WebSiteScreens.xml Thu Mar  8 23:42:36 2007
@@ -67,7 +67,9 @@
                             </condition>
                             <widgets>
                                 <platform-specific><html><html-template location="component://content/webapp/content/website/WebSiteTabBar.ftl"/></html></platform-specific>
-                                <container style="widget-container"><link  text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.ContentWebSite}" target="EditWebSite" style="buttontext"/></container>
+                                <container style="widget-container">
+                                    <link  text="${uiLabelMap.CommonCreateNew} ${uiLabelMap.ContentWebSite}" target="EditWebSite" style="buttontext"/>
+                                </container>
                                 
                                 <decorator-section-include name="body"/>
                             </widgets>
@@ -113,10 +115,8 @@
                 <set field="labelTitleProperty" value="PageTitleEditWebSiteContent"/>
                 <set field="webSiteId" from-field="parameters.webSiteId"/>
                 <entity-one entity-name="WebSite" value-name="webSite"/>
-
-                <set field="webSiteContentTypeId" value="PUBLISH_POINT"/>
+                
                 <entity-and entity-name="WebSiteContent" list-name="webSiteContent">
-                    <field-map field-name="webSiteContentTypeId" env-name="webSiteContentTypeId"/>
                     <field-map field-name="webSiteId" env-name="webSiteId"/>
                 </entity-and>                
             </actions>
@@ -129,7 +129,13 @@
                                     <label style="head1">WebSite Content</label>
                                     <include-form name="ListWebSiteContent" location="component://content/webapp/content/website/WebSiteForms.xml"/>
                                 </container>
-                                <include-form name="CreateWebSiteContent" location="component://content/webapp/content/website/WebSiteForms.xml"/>
+                                <container style="widget-container">
+                                    <include-form name="CreateWebSiteContent" location="component://content/webapp/content/website/WebSiteForms.xml"/>
+                                </container>
+                                <container style="widget-container">
+                                    <label style="head2">Auto-Create Content Publish Points</label>
+                                    <include-form name="AutoCreateWebsiteContent" location="component://content/webapp/content/website/WebSiteForms.xml"/>
+                                </container> 
                             </widgets>
                         </section>
                     </decorator-section>