svn commit: r735627 - in /ofbiz/trunk/applications: content/script/org/ofbiz/content/blog/ content/servicedef/ content/src/org/ofbiz/content/blog/ content/webapp/content/WEB-INF/ ecommerce/webapp/ecommerce/WEB-INF/ ecommerce/widget/blog/

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

svn commit: r735627 - in /ofbiz/trunk/applications: content/script/org/ofbiz/content/blog/ content/servicedef/ content/src/org/ofbiz/content/blog/ content/webapp/content/WEB-INF/ ecommerce/webapp/ecommerce/WEB-INF/ ecommerce/widget/blog/

hansbak-2
Author: hansbak
Date: Mon Jan 19 00:09:48 2009
New Revision: 735627

URL: http://svn.apache.org/viewvc?rev=735627&view=rev
Log:
update blogentry now added which replaces persistBlogAll and renaming of some files to be more to the ofbiz standard. blog Still not complete......

Removed:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogServices.java
Modified:
    ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml
    ofbiz/trunk/applications/content/servicedef/services.xml
    ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/applications/ecommerce/widget/blog/BlogForms.xml
    ofbiz/trunk/applications/ecommerce/widget/blog/BlogMenus.xml
    ofbiz/trunk/applications/ecommerce/widget/blog/BlogScreens.xml

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml Mon Jan 19 00:09:48 2009
@@ -19,25 +19,22 @@
   -->
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
-    <simple-method method-name="postBlogEntry" short-description="Post a new Blog Entry">
-        <set field="contentAssocTypeId" from-field="parameters.contentAssocTypeId"/>
+    <simple-method method-name="createBlogEntry" short-description="Create a new Blog Entry">
+        <set field="contentAssocTypeId" value="PUBLISH_LINK"/>
         <set field="ownerContentId" from-field="parameters.blogContentId"/>
-        <set field="contentIdFrom" from-field="parameters.blogContentId"/>        
+        <set field="contentIdFrom" from-field="parameters.blogContentId"/>
+        <if-empty field="parameters.statusId">
+            <set field="parameters.statusId" value="CTNT_INITIAL_DRAFT"/>
+        </if-empty>
+        <if-empty field="parameters.templateDataResourceId">
+            <set field="parameters.templateDataResourceId" value="BLOG_TPL_TOPLEFT"/>
+        </if-empty>
+        
         <!-- determine of we need to create complex template structure or simple content structure -->
-        <if>
-            <condition>
-                <and>
-                    <not>
-                        <if-empty field="parameters._uploadedFile_fileName"/>
-                    </not>
-                    <not>
-                        <if-empty field="parameters.textData"/>
-                    </not>
-                </and>
-            </condition>
-            <then>
+        <if-not-empty field="parameters._uploadedFile_fileName">
+            <if-not-empty field="parameters.articleData">
                 <!-- complex template structure (image & text) -->
-                <set field="createMain.dataResourceId" from-field="parameters.dataResourceId"/>
+                <set field="createMain.dataResourceId" from-field="parameters.templateDataResourceId"/>
                 <set field="createMain.contentAssocTypeId"  from-field="contentAssocTypeId"/>
                 <set field="createMain.contentName" from-field="parameters.contentName"/>
                 <set field="createMain.description" from-field="parameters.description"/>
@@ -53,87 +50,62 @@
                 <!-- reset contentIdFrom to new contentId -->
                 <set field="contentAssocTypeId" value="SUB_CONTENT"/>
                 <set field="contentIdFrom" from-field="contentId"/>                                
-            </then>
-        </if>
-        
-        <if>
-            <condition>
-                <not>
-                    <if-empty field="parameters._uploadedFile_fileName"/>
-                </not>
-            </condition>
-            <then>
-                <!-- upload a picture -->
-                <set field="createImage.dataResourceTypeId" value="LOCAL_FILE"/>
-                <set field="createImage.dataTemplateTypeId" value="NONE"/>
-                <set field="createImage.mapKey" value="IMAGE"/>
-                <set field="createImage.ownerContentId" from-field="ownerContentId"/>
-                <set field="createImage.contentName" from-field="parameters.contentName"/>
-                <set field="createImage.description" from-field="parameters.description"/>
-                <set field="createImage.statusId" from-field="parameters.statusId"/>
-                <set field="createImage.contentAssocTypeId"  from-field="contentAssocTypeId"/>
-                <set field="createImage.contentIdFrom" from-field="contentIdFrom"/>
-                <set field="createImage.partyId" from-field="userLogin.partyId"/>
-                <set field="createImage.isPublic" value="Y"/>
-                <set field="createImage.uploadedFile" from-field="parameters.uploadedFile"/>
-                <set field="createImage._uploadedFile_fileName" from-field="parameters._uploadedFile_fileName"/>
-                <set field="createImage._uploadedFile_contentType" from-field="parameters._uploadedFile_contentType"/>
-                <call-service service-name="createContentFromUploadedFile" in-map-name="createImage">
-                    <result-to-field result-name="contentId" field="imageContentId"/>
-                </call-service>
-                <if-empty field="contentId">
-                    <set field="contentIdFrom" from-field="imageContentId"/>
-                    <set field="contentId" from-field="imageContentId"/>
-                    <set field="contentAssocTypeId" value="SUB_CONTENT"/>
-                </if-empty>
-            </then>
-        </if>
+            </if-not-empty>
+        </if-not-empty>
+
+        <if-not-empty field="parameters._uploadedFile_fileName">
+            <!-- upload a picture -->
+            <set field="createImage.dataResourceTypeId" value="LOCAL_FILE"/>
+            <set field="createImage.dataTemplateTypeId" value="NONE"/>
+            <set field="createImage.mapKey" value="IMAGE"/>
+            <set field="createImage.ownerContentId" from-field="ownerContentId"/>
+            <set field="createImage.contentName" from-field="parameters.contentName"/>
+            <set field="createImage.description" from-field="parameters.description"/>
+            <set field="createImage.statusId" from-field="parameters.statusId"/>
+            <set field="createImage.contentAssocTypeId"  from-field="contentAssocTypeId"/>
+            <set field="createImage.contentIdFrom" from-field="contentIdFrom"/>
+            <set field="createImage.partyId" from-field="userLogin.partyId"/>
+            <set field="createImage.isPublic" value="Y"/>
+            <set field="createImage.uploadedFile" from-field="parameters.uploadedFile"/>
+            <set field="createImage._uploadedFile_fileName" from-field="parameters._uploadedFile_fileName"/>
+            <set field="createImage._uploadedFile_contentType" from-field="parameters._uploadedFile_contentType"/>
+            <call-service service-name="createContentFromUploadedFile" in-map-name="createImage">
+                <result-to-field result-name="contentId" field="imageContentId"/>
+            </call-service>
+            <if-empty field="contentId">
+                <set field="contentIdFrom" from-field="imageContentId"/>
+                <set field="contentId" from-field="imageContentId"/>
+                <set field="contentAssocTypeId" value="SUB_CONTENT"/>
+            </if-empty>
+        </if-not-empty>
         
-        <if>
-            <condition>
-                <not>
-                    <if-empty field="parameters.textData"/>
-                </not>
-            </condition>
-            <then>
-                <!-- create text data -->
-                <set field="createText.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
-                <set field="createText.contentPurposeTypeId" value="ARTICLE"/>
-                <set field="createText.dataTemplateTypeId" value="NONE"/>
-                <set field="createText.mapKey" value="MAIN"/>
-                <set field="createText.ownerContentId" from-field="ownerContentId"/>
-                <set field="createText.contentName" from-field="parameters.contentName"/>
-                <set field="createText.description" from-field="parameters.description"/>
-                <set field="createText.statusId" from-field="parameters.statusId"/>
-                <set field="createText.contentAssocTypeId"  from-field="contentAssocTypeId"/>
-                <set field="createText.textData" from-field="parameters.textData"/>
-                <set field="createText.contentIdFrom" from-field="contentIdFrom"/>
-                <set field="createText.partyId" from-field="userLogin.partyId"/>
-                <log level="always" message="calling createTextContent with map: ${createText}"/>
-                <call-service service-name="createTextContent" in-map-name="createText">
-                    <result-to-field result-name="contentId" field="textContentId"/>
-                </call-service>
-                <if-empty field="contentId">
-                    <set field="contentIdFrom" from-field="textContentId"/>
-                    <set field="contentId" from-field="textContentId"/>
-                    <set field="contentAssocTypeId" value="SUB_CONTENT"/>
-                </if-empty>
-            </then>
-        </if>
+        <if-not-empty field="parameters.articleData">
+            <!-- create text data -->
+            <set field="createText.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
+            <set field="createText.contentPurposeTypeId" value="ARTICLE"/>
+            <set field="createText.dataTemplateTypeId" value="NONE"/>
+            <set field="createText.mapKey" value="MAIN"/>
+            <set field="createText.ownerContentId" from-field="ownerContentId"/>
+            <set field="createText.contentName" from-field="parameters.contentName"/>
+            <set field="createText.description" from-field="parameters.description"/>
+            <set field="createText.statusId" from-field="parameters.statusId"/>
+            <set field="createText.contentAssocTypeId"  from-field="contentAssocTypeId"/>
+            <set field="createText.textData" from-field="parameters.articleData"/>
+            <set field="createText.contentIdFrom" from-field="contentIdFrom"/>
+            <set field="createText.partyId" from-field="userLogin.partyId"/>
+            <log level="always" message="calling createTextContent with map: ${createText}"/>
+            <call-service service-name="createTextContent" in-map-name="createText">
+                <result-to-field result-name="contentId" field="textContentId"/>
+            </call-service>
+            <if-empty field="contentId">
+                <set field="contentIdFrom" from-field="textContentId"/>
+                <set field="contentId" from-field="textContentId"/>
+                <set field="contentAssocTypeId" value="SUB_CONTENT"/>
+            </if-empty>
+        </if-not-empty>
         
-        <!-- we should have a primary (at least) contentId -->
-        <if>
-            <condition>
-                <and>
-                    <not>
-                        <if-empty field="contentId"/>
-                    </not>
-                    <not>
-                        <if-empty field="parameters.summaryData"/>
-                    </not>
-                </and>            
-            </condition>
-            <then>
+        <if-not-empty field="contentId">
+            <if-not-empty field="parameters.summaryData">
                 <!-- create the summary data -->
                 <set field="createSummary.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
                 <set field="createSummary.contentPurposeTypeId" value="ARTICLE"/>
@@ -148,11 +120,100 @@
                 <set field="createSummary.contentIdFrom" from-field="contentIdFrom"/>
                 <set field="createSummary.partyId" from-field="userLogin.partyId"/>
                 <call-service service-name="createTextContent" in-map-name="createSummary"/>
+            </if-not-empty>
+        </if-not-empty>
+
+        <field-to-result field="contentId"/>
+        <field-to-result field="parameters.blogContentId" result-name="blogContentId"/>
+    </simple-method>
+
+    <simple-method method-name="updateBlogEntry" short-description="Update a existing Blog Entry">
+        <set field="showNoResult" value="Y"/>
+        <call-simple-method method-name="getBlogEntry"/>
+        <if>
+            <condition>
+                <or>
+                    <if-compare-field field="parameters.contentName" operator="not-equals" to-field="contentName"/>                
+                    <if-compare-field field="parameters.description" operator="not-equals" to-field="description"/>                
+                    <if-compare-field field="parameters.templateDataResourceId" operator="not-equals" to-field="templateDataResourceId"/>                
+                    <if-compare-field field="parameters.statusId" operator="not-equals" to-field="statusId"/>                
+                </or>
+            </condition>
+            <then>
+                <set-service-fields service-name="updateContent" map="parameters" to-map="updContent"/>
+                <set field="updContent.dataResourceId" from-field="parameters.templateDataResourceId"/>
+                <call-service service-name="updateContent" in-map-name="updContent"/>
             </then>
         </if>
-        <field-to-result field="contentId"/>
+
+        <!-- new article text -->
+        <if-empty field="articleText">
+            <if-not-empty field="parameters.articleData">
+                <set field="createText.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
+                <set field="createText.contentPurposeTypeId" value="ARTICLE"/>
+                <set field="createText.dataTemplateTypeId" value="NONE"/>
+                <set field="createText.mapKey" value="MAIN"/>
+                <set field="createSummary.ownerContentId" from-field="parameters.contentId"/>
+                <set field="createSummary.contentName" from-field="parameters.contentName" default-value="${contentName}"/>
+                <set field="createSummary.description" from-field="parameters.description" default-value="${description}"/>
+                <set field="createSummary.statusId" from-field="parameters.statusId" default-value="${statusId}"/>
+                <set field="createSummary.contentAssocTypeId" value="SUB_CONTENT"/>
+                <set field="createText.textData" from-field="parameters.articleData"/>
+                <set field="createText.contentIdFrom" from-field="contentIdFrom"/>
+                <set field="createText.partyId" from-field="userLogin.partyId"/>
+                <log level="always" message="calling createTextContent with map: ${createText}"/>
+                <call-service service-name="createTextContent" in-map-name="createText"/>
+            </if-not-empty>
+        </if-empty>
+        
+        <!-- update article text -->        
+        <if-not-empty field="articleText">
+            <if-compare-field field="parameters.articleData" operator="not-equals" to-field="articleData">
+                <set field="articleText.textData" from-field="parameters.articleData"/>
+                <store-value value-field="articleText"/>
+            </if-compare-field>
+        </if-not-empty>
+        
+        <!-- update summary text -->        
+        <if-not-empty field="summaryText">
+            <if-compare-field field="parameters.summaryData" operator="not-equals" to-field="summaryData">
+                <set field="summaryText.textData" from-field="parameters.summaryData"/>
+                <store-value value-field="summaryText"/>
+            </if-compare-field>
+        </if-not-empty>
+        
+        <if-not-empty field="parameters._uploadedFile_fileName">
+            <if-not-empty field="imageContent">
+                <entity-and entity-name="ContentAssoc" list="oldAssocs" filter-by-date="true">
+                    <field-map field-name="contentId" from-field="contentId"/>
+                    <field-map field-name="contentIdTo" from-field="imageContent.contentId"/>
+                    <field-map field-name="mapKey" value="IMAGE"/>
+                </entity-and>
+                <first-from-list entry="oldAssoc" list="oldAssocs"/>
+                <now-date-to-env field="oldAssoc.thruDate"/>
+                <store-value value-field="oldAssoc"/>
+            </if-not-empty>
+            <!-- upload a picture -->
+            <set field="createImage.dataResourceTypeId" value="LOCAL_FILE"/>
+            <set field="createImage.dataTemplateTypeId" value="NONE"/>
+            <set field="createImage.mapKey" value="IMAGE"/>
+            <set field="createImage.ownerContentId" from-field="parameters.contentId"/>
+            <set field="createImage.contentName" from-field="parameters.contentName" default-value="${contentName}"/>
+            <set field="createImage.description" from-field="parameters.description" default-value="${description}"/>
+            <set field="createImage.statusId" from-field="parameters.statusId" default-value="${statusId}"/>
+            <set field="createImage.contentAssocTypeId"  value="SUB_CONTENT"/>
+            <set field="createImage.contentIdFrom" from-field="parameters.contentId"/>
+            <set field="createImage.partyId" from-field="userLogin.partyId"/>
+            <set field="createImage.isPublic" value="Y"/>
+            <set field="createImage.uploadedFile" from-field="parameters.uploadedFile"/>
+            <set field="createImage._uploadedFile_fileName" from-field="parameters._uploadedFile_fileName"/>
+            <set field="createImage._uploadedFile_contentType" from-field="parameters._uploadedFile_contentType"/>
+            <call-service service-name="createContentFromUploadedFile" in-map-name="createImage"/>
+        </if-not-empty>
+        <field-to-result field="parameters.contentId" result-name="contentId"/>
+        <field-to-result field="parameters.blogContentId" result-name="blogContentId"/>
     </simple-method>
-    
+
     <simple-method method-name="getOwnedOrPublishedBlogEntries" short-description="Get blog entries that the user owns or are published">
         <entity-condition entity-name="ContentAssocViewTo" use-cache="false" list="unfilteredList">
             <condition-list combine="and">
@@ -183,36 +244,49 @@
             </if-compare>
         </iterate>
         <field-to-result field="blogList" result-name="blogList"/>
+        <field-to-result field="parameters.blogContentId" result-name="blogContentId"/>
     </simple-method>
 
     <simple-method method-name="getBlogEntry" short-description="Get all the info for a blog article">
         <entity-one entity-name="Content" value-field="content"/>
-        <field-to-result field="content.contentId" result-name="contentId"/>
-        <field-to-result field="content.contentName" result-name="contentName"/>
-        <field-to-result field="content.description" result-name="description"/>
-        <field-to-result field="content.statusId" result-name="statusId"/>
-        <field-to-result field="content.datResourceId" result-name="templateDataResourceId"/>
-        <get-related value-field="Content" relation-name="ContentAssoc" list="rawAssocs"/>
+        <get-related value-field="content" relation-name="FromContentAssoc" list="rawAssocs"/>
         <filter-list-by-date list="rawAssocs" to-list="assocs"/>
         <iterate entry="assoc" list="assocs">
             <if-compare field="assoc.mapKey" value="MAIN" operator="equals">
-                <get-related-one value-field="assoc" relation-name="Content" to-value-field="content"/>
-                <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
-                <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="text"/>
-                <field-to-result field="text.textData" result-name="article"/>
+                <get-related-one value-field="assoc" relation-name="ToContent" to-value-field="mainContent"/>
+                <get-related-one value-field="mainContent" relation-name="DataResource" to-value-field="dataResource"/>
+                <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="articleText"/>
             </if-compare>
             <if-compare field="assoc.mapKey" value="SUMMARY" operator="equals">
-                <get-related-one value-field="assoc" relation-name="Content" to-value-field="content"/>
-                <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
-                <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="text"/>
-                <field-to-result field="text.textData" result-name="summary"/>
+                <get-related-one value-field="assoc" relation-name="ToContent" to-value-field="summaryContent"/>
+                <get-related-one value-field="summaryContent" relation-name="DataResource" to-value-field="dataResource"/>
+                <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="summaryText"/>
             </if-compare>
             <if-compare field="assoc.mapKey" value="IMAGE" operator="equals">
-                <get-related-one value-field="assoc" relation-name="Content" to-value-field="content"/>
-                <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
-                <field-to-result field="dataResource.dataResourceId" result-name="imageDataResourceId"/>
+                <get-related-one value-field="assoc" relation-name="ToContent" to-value-field="imageContent"/>
             </if-compare>
         </iterate>
+        <if-empty field="showNoResult">
+            <field-to-result field="content.contentId" result-name="contentId"/>
+            <field-to-result field="content.contentName" result-name="contentName"/>
+            <field-to-result field="content.description" result-name="description"/>
+            <field-to-result field="content.statusId" result-name="statusId"/>
+            <field-to-result field="content.dataResourceId" result-name="templateDataResourceId"/>
+            <field-to-result field="articleText.textData" result-name="articleData"/>
+            <field-to-result field="summaryText.textData" result-name="summaryData"/>
+            <field-to-result field="imageContent.dataResourceId" result-name="imageDataResourceId"/>
+            <field-to-result field="parameters.blogContentId" result-name="blogContentId"/>
+            <else>
+                <set from-field="content.contentId" field="contentId"/>
+                <set from-field="content.contentName" field="contentName"/>
+                <set from-field="content.description" field="description"/>
+                <set from-field="content.statusId" field="statusId"/>
+                <set from-field="content.dataResourceId" field="templateDataResourceId"/>
+                <set from-field="articleText.textData" field="articleData"/>
+                <set from-field="summaryText.textData" field="summaryData"/>
+                <set from-field="imageContent.dataResourceId" field="imageDataResourceId"/>
+            </else>
+        </if-empty>
     </simple-method>
 
 </simple-methods>

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Mon Jan 19 00:09:48 2009
@@ -1058,50 +1058,45 @@
     </service>
 
     <!-- blog services -->
-    <service name="postBlogEntry" engine="simple" transaction-timeout="300" auth="true"
-        location="org/ofbiz/content/blog/BlogServices.xml" invoke="postBlogEntry">
+    <service name="createBlogEntry" engine="simple" auth="true"
+        location="org/ofbiz/content/blog/BlogServices.xml" invoke="createBlogEntry">
         <description>Creates content records for a blog entry</description>
-        <implements service="createContentFromUploadedFile" optional="true"/>
-        <implements service="createTextContent" optional="true"/>
-        <attribute name="blogContentId" type="String" mode="IN" optional="false"/>
+        <implements service="uploadFileInterface" optional="true"/>
+        <attribute name="blogContentId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="contentId" type="String" mode="OUT" optional="false"/>
+        <attribute name="contentName" type="String" mode="IN" optional="true"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
+        <attribute name="description" type="String" mode="IN" optional="true"/>
+        <attribute name="templateDataResourceId" type="String" mode="IN" optional="true"/>
+        <attribute name="articleData" type="String" mode="IN" optional="true"/>
+        <attribute name="summaryData" type="String" mode="IN" optional="true"/>
+    </service>
+    <service name="updateBlogEntry" engine="simple" auth="true"
+        location="org/ofbiz/content/blog/BlogServices.xml" invoke="updateBlogEntry">
+        <description>Updates content records for a blog entry</description>
+        <implements service="uploadFileInterface" optional="true"/>
+        <attribute name="blogContentId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="contentId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="contentName" type="String" mode="IN" optional="true"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
+        <attribute name="description" type="String" mode="IN" optional="true"/>
+        <attribute name="templateDataResourceId" type="String" mode="IN" optional="true"/>
+        <attribute name="articleData" type="String" mode="IN" optional="true"/>
         <attribute name="summaryData" type="String" mode="IN" optional="true"/>
     </service>
-    <service name="getBlogEntry" engine="simple" transaction-timeout="300" auth="true"
+    <service name="getBlogEntry" engine="simple" auth="true"
         location="org/ofbiz/content/blog/BlogServices.xml" invoke="getBlogEntry">
-        <description>Creates content records for a blog entry</description>
+        <description>Retrieves content records for a blog entry</description>
+        <attribute name="blogContentId" type="String" mode="INOUT" optional="false"/>
         <attribute name="contentId" type="String" mode="INOUT" optional="false"/>
         <attribute name="contentName" type="String" mode="OUT" optional="true"/>
         <attribute name="statusId" type="String" mode="OUT" optional="true"/>
         <attribute name="description" type="String" mode="OUT" optional="true"/>
         <attribute name="templateDataResourceId" type="String" mode="OUT" optional="true"/>
-        <attribute name="summary" type="String" mode="OUT" optional="true"/>
-        <attribute name="article" type="String" mode="OUT" optional="true"/>
+        <attribute name="summaryData" type="String" mode="OUT" optional="true"/>
+        <attribute name="articleData" type="String" mode="OUT" optional="true"/>
         <attribute name="imageDataResourceId" type="String" mode="OUT" optional="true"/>
     </service>
-    <!-- TO BE REMOVED
-    <service name="updateBlogEntry" engine="simple" transaction-timeout="300" auth="true"
-            location="org/ofbiz/content/blog/BlogServices.xml" invoke="updateBlogEntry">
-        <description>Creates content records for a blog entry</description>
-        <implements service="createContentFromUploadedFile" optional="true"/>
-        <implements service="createTextContent" optional="true"/>
-        <attribute name="blogContentId" type="String" mode="IN" optional="false"/>
-        <attribute name="summaryData" type="String" mode="IN" optional="true"/>
-    </service>
-    -->
-
-    <service name="persistBlogAll" engine="java" location="org.ofbiz.content.blog.BlogServices" invoke="persistBlogAll"
-         auth="true"  transaction-timeout="72000">
-        <implements service="persistContentAndAssoc"/>
-        <attribute type="String" mode="IN" name="summaryData" optional="true"/>
-        <attribute type="String" mode="IN" name="mainData" optional="true"/>
-        <attribute type="String" mode="IN" name="drMimeTypeId_TEXT" optional="true"/>
-        <attribute type="String" mode="IN" name="drMimeTypeId_IMAGE" optional="true"/>
-        <attribute type="String" mode="IN" name="templateId" optional="true"/>
-        <attribute type="String" mode="INOUT" name="textContentId" optional="true"/>
-        <attribute type="String" mode="INOUT" name="imageContentId" optional="true"/>
-        <attribute type="String" mode="INOUT" name="textDataResourceId" optional="true"/>
-        <attribute type="String" mode="INOUT" name="imageDataResourceId" optional="true"/>
-    </service>
     <service name="getOwnedOrPublishedBlogEntries" engine="simple" location="org/ofbiz/content/blog/BlogServices.xml" invoke="getOwnedOrPublishedBlogEntries"
          auth="true"  transaction-timeout="72000">
         <attribute type="String" mode="IN" name="contentId" optional="false"/>

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?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Mon Jan 19 00:09:48 2009
@@ -94,13 +94,13 @@
     </request-map>
     <request-map uri="createBlogArticle">
         <security https="true" auth="true"/>
-        <event type="service" invoke="postBlogEntry"/>
+        <event type="service" invoke="createBlogEntry"/>
         <response name="success" type="view" value="blogContent"/>
         <response name="error" type="view" value="NewBlogArticle"/>
     </request-map>
     <request-map uri="updateBlogArticle">
         <security https="true" auth="true"/>
-        <event type="service" invoke="persistBlogAll"/>
+        <event type="service" invoke="updateBlogEntry"/>
         <response name="success" type="view" value="blogContent"/>
         <response name="error" type="view" value="EditBlogArticle"/>
     </request-map>

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Mon Jan 19 00:09:48 2009
@@ -1334,14 +1334,14 @@
 
     <request-map uri="createBlogArticle">
         <security https="true" auth="true"/>
-        <event type="service" invoke="postBlogEntry"/>
+        <event type="service" invoke="createBlogEntry"/>
         <response name="success" type="view" value="ViewBlogArticle"/>
         <response name="error" type="view" value="EditBlogArticle"/>
     </request-map>
     
     <request-map uri="updateBlogArticle">
         <security https="true" auth="true"/>
-        <event type="service" invoke="persistBlogAll"/>
+        <event type="service" invoke="updateBlogEntry"/>
         <response name="success" type="view" value="ViewBlogArticle"/>
         <response name="error" type="view" value="EditBlogArticle"/>
     </request-map>

Modified: ofbiz/trunk/applications/ecommerce/widget/blog/BlogForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/blog/BlogForms.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/blog/BlogForms.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/blog/BlogForms.xml Mon Jan 19 00:09:48 2009
@@ -190,84 +190,18 @@
         </sort-order>
     </form>
 
-    <form name="CreateArticle" target="createBlogArticle" title="" type="upload" skip-end="true"
+    <form name="EditArticle" target="createBlogArticle" title="" type="upload" skip-end="true" default-map-name="blogEntry"
         default-title-style="treeHeader" default-tooltip-style="tabletext" default-widget-style="inputBox">
-        <field name="contentName" title="Short title">
-            <text size="40"/>
-        </field>
-        <field name="description" title="Slightly longer title (250 chars max)">
-            <textarea cols="40" rows="2"/>
-        </field>
-        <field name="summaryData" title="Summary" widget-style="inputBox dojo-ResizableTextArea">
-            <textarea cols="60" rows="4"/>
-        </field>
-        <field name="textData" title="Article" widget-style="inputBox dojo-ResizableTextArea">
-            <textarea cols="60" rows="12"/>
-        </field>
-        <field name="uploadedFile" title="Image">
-            <file size="25"/>
-        </field>
-        <field name="dataResourceId" title="Template">
-            <drop-down allow-empty="true">                
-                <option key="BLOG_TPL_TOPLEFT" description="Top Left"/>
-                <option key="BLOG_TPL_TOPCENTER" description="Top Center"/>
-            </drop-down>
-        </field>
-        <field name="statusId" title="Status">
-            <drop-down no-current-selected-key="CTNT_INITIAL_DRAFT">
-                <option key="CTNT_PUBLISHED" description="Publish"/>
-                <option key="CTNT_INITIAL_DRAFT" description="Preview"/>
-            </drop-down>
-        </field>
-        <field name="submitButton" title="Submit" widget-style="smallSubmit">
-            <submit button-type="button"/>
-        </field>
-        <field name="contentPurposeString">
-            <hidden value="ARTICLE"/>
-        </field>
-        <field name="contentAssocTypeId">
-            <hidden value="PUBLISH_LINK"/>
-        </field>
-        <field name="blogContentId" entry-name="blogContentId">
-            <hidden/>
-        </field>
-        <field name="contentIdFrom" entry-name="blogContentId">
-            <hidden/>
-        </field>
-        <sort-order>            
-            <sort-field name="contentName"/>
-            <sort-field name="description"/>
-            <sort-field name="summaryData"/>
-            <sort-field name="textData"/>
-            <sort-field name="uploadedFile"/>
-            <sort-field name="dataResourceId"/>
-            <sort-field name="statusId"/>
-            <sort-field name="submitButton"/>
-        </sort-order>
-    </form>
-
-    <form name="EditArticle" target="updateBlogArticle" title="" type="upload" skip-end="true" default-map-name="blogEntry"
-        default-title-style="treeHeader" default-tooltip-style="tabletext" default-widget-style="inputBox">
-        <field name="contentId" title="Blog ID" use-when="contentId!=null&amp;&amp;contentId!=&quot;&quot;">
-            <display/>
-        </field>
-        <field name="contentName" title="Short title">
-            <text size="40"/>
-        </field>
-        <field name="description" title="Slightly longer title (250 chars max)">
-            <textarea cols="40" rows="2"/>
-        </field>
-        <field name="summaryData" title="Summary" entry-name="summary" widget-style="inputBox dojo-ResizableTextArea">
-            <textarea cols="60" rows="4"/>
-        </field>
-        <field name="textData" title="Article" entry-name="article" widget-style="inputBox dojo-ResizableTextArea">
-            <textarea cols="60" rows="12"/>
-        </field>
-        <field name="uploadedFile" title="Image">
-            <file size="25"/>
-        </field>
-        <field name="dataResourceId" title="Template" entry-name="templateDataResourceId">
-            <drop-down allow-empty="true">
+        <alt-target use-when="contentId!=void" target="updateBlogArticle"/>
+        <field name="blogContentId"><hidden value="${parameters.blogContentId}"/></field>
+        <field name="contentId" title="Blog entry Id" use-when="contentId!=void"><display/></field>
+        <field name="contentName" title="Short title"><text size="40"/></field>
+        <field name="description" title="Slightly longer title (250 chars max)"><textarea cols="40" rows="2"/></field>
+        <field name="summaryData" title="Summary" widget-style="inputBox dojo-ResizableTextArea"><textarea cols="60" rows="4"/></field>
+        <field name="articleData" title="Article" widget-style="inputBox dojo-ResizableTextArea"><textarea cols="60" rows="12"/></field>
+        <field name="uploadedFile" title="Image"><file size="25"/></field>
+        <field name="templateDataResourceId" title="Template">
+            <drop-down>
                 <option key="BLOG_TPL_TOPLEFT" description="Top Left"/>
                 <option key="BLOG_TPL_TOPCENTER" description="Top Center"/>
             </drop-down>
@@ -278,26 +212,7 @@
                 <option key="CTNT_INITIAL_DRAFT" description="Preview"/>
             </drop-down>
         </field>
-        <field name="submitButton" title="Submit" widget-style="smallSubmit">
-            <submit button-type="button"/>
-        </field>
-        <field name="contentPurposeString">
-            <hidden value="ARTICLE"/>
-        </field>
-        <field name="blogContentId" entry-name="blogContentId">
-            <hidden/>
-        </field>
-        <sort-order>
-            <sort-field name="contentId"/>
-            <sort-field name="contentName"/>
-            <sort-field name="description"/>
-            <sort-field name="summaryData"/>
-            <sort-field name="textData"/>
-            <sort-field name="uploadedFile"/>
-            <sort-field name="dataResourceId"/>
-            <sort-field name="statusId"/>
-            <sort-field name="submitButton"/>
-        </sort-order>
+        <field name="submitButton" title="Submit" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
     <form name="editFormSubmit" target="" title="" type="single" skip-start="true" skip-end="true"

Modified: ofbiz/trunk/applications/ecommerce/widget/blog/BlogMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/blog/BlogMenus.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/blog/BlogMenus.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/blog/BlogMenus.xml Mon Jan 19 00:09:48 2009
@@ -27,7 +27,7 @@
                     <if-entity-permission entity-id="${blog.contentId}" entity-name="Content" target-operation="CONTENT_UPDATE"/>
                 </or>
             </condition>
-            <link text="Edit" target="EditBlogArticle?articleContentId=${blog.contentId}&amp;blogContentId=${blog.contentIdStart}" style="buttontext"/>
+            <link text="Edit" target="EditBlogArticle?contentId=${blog.contentId}&amp;blogContentId=${parameters.blogContentId}" style="buttontext"/>
         </menu-item>                
     </menu>
 </menus>

Modified: ofbiz/trunk/applications/ecommerce/widget/blog/BlogScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/blog/BlogScreens.xml?rev=735627&r1=735626&r2=735627&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/blog/BlogScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/blog/BlogScreens.xml Mon Jan 19 00:09:48 2009
@@ -111,7 +111,7 @@
                                     <container style="blogwrapper">
                                         <include-menu name="view_edit" location="component://ecommerce/widget/blog/BlogMenus.xml"/>
                                         <label text="&lt;p/&gt;"/>
-                                        <link text="${blog.contentName} [${blog.contentId}]" target="ViewBlogArticle?articleContentId=${blog.contentId}&amp;blogContentId=${blogContentId}" style="blogheader"/>
+                                        <link text="${blog.contentName} [${blog.contentId}]" target="ViewBlogArticle?contentId=${blog.contentId}&amp;blogContentId=${blogContentId}" style="blogheader"/>
                                         <!--
                                             <link text="Latest" target="LatestResponses?ownerContentId=${blog.ownerContentId}" />
                                         -->
@@ -131,7 +131,7 @@
                                         <include-menu name="view_edit" location="component://ecommerce/widget/blog/BlogMenus.xml"/>
                                         <label text="&lt;p/&gt;"/>
                                         <!--<label text="${blog.contentName} [${blog.contentId}]" style="blogheader"/>-->
-                                        <link text="${blog.contentName} [${blog.contentId}]" target="ViewBlogArticle?articleContentId=${blog.contentId}&amp;blogContentId=${blogContentId}" style="blogheader"/>
+                                        <link text="${blog.contentName} [${blog.contentId}]" target="ViewBlogArticle?contentId=${blog.contentId}&amp;blogContentId=${blogContentId}" style="blogheader"/>
                                         <!--
                                             <link text="Latest" target="LatestResponses?ownerContentId=${blog.ownerContentId}" />
                                         -->
@@ -152,7 +152,6 @@
     <screen name="NewArticle">
         <section>
             <actions>
-                <set field="blogContentId" from-field="parameters.blogContentId"/>
                 <set field="crPerm.ownerContentId" from-field="parameters.blogContentId"/>
                 <set field="crPerm.contentOperationId" value="CONTENT_CREATE"/>
                 <set field="crPerm.contentPurposeTypeId" value="ARTICLE"/>
@@ -165,7 +164,7 @@
                     <widgets>
                         <decorator-screen name="CommonBlog" location="${parameters.mainDecoratorLocation}">
                             <decorator-section name="body">
-                                <include-form name="CreateArticle" location="component://ecommerce/widget/blog/BlogForms.xml"/>                                
+                                <include-form name="EditArticle" location="component://ecommerce/widget/blog/BlogForms.xml"/>                                
                             </decorator-section>
                         </decorator-screen>
                     </widgets>
@@ -181,28 +180,29 @@
         <section>
             <actions>
                 <set field="blogContentId" from-field="parameters.blogContentId"/>
-
                 <set field="upPerm.contentId" from-field="parameters.blogContentId"/>
                 <set field="upPerm.contentOperationId" value="CONTENT_UPDATE"/>
                 <set field="upPerm.contentPurposeTypeId" value="ARTICLE"/>
+                <set field="contentId" from-field="parameters.contentId"/>
             </actions>
             <widgets>
                 <section>
-                    <condition>
-                        <if-service-permission service-name="genericContentPermission" main-action="UPDATE" context-map="upPerm"/>
-                    </condition>
+                    <!--condition>
+                        <if-service-permission service-name="genericContentPermission" main-action="UPDATE"/>
+                    </condition-->
                     <actions>
                         <service service-name="getBlogEntry" result-map-name="blogEntry" auto-field-map="true"/>
                     </actions>
                     <widgets>
                         <decorator-screen name="CommonBlog" location="${parameters.mainDecoratorLocation}">
                             <decorator-section name="body">
+                                <sub-content content-id="${parameters.contentId}" map-key="IMAGE"/>
                                 <include-form name="EditArticle" location="component://ecommerce/widget/blog/BlogForms.xml"/>                                
                             </decorator-section>
                         </decorator-screen>
                     </widgets>
                     <fail-widgets>
-                        <label text="Permissions failed."></label>
+                        <label text="Permissions failed to edit Article: ${contentId} in Blog: ${blogContentId}"></label>
                     </fail-widgets>
                 </section>
             </widgets>