Author: hansbak
Date: Wed Oct 13 09:34:48 2010 New Revision: 1022048 URL: http://svn.apache.org/viewvc?rev=1022048&view=rev Log: some more error correction for the update blog in ecommerce Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/blog/BlogServices.xml ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogForms.xml ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogTemplates.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=1022048&r1=1022047&r2=1022048&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 Wed Oct 13 09:34:48 2010 @@ -31,27 +31,30 @@ </if-empty> <!-- determine of we need to create complex template structure or simple content structure --> - <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.templateDataResourceId"/> - <set field="createMain.contentAssocTypeId" from-field="contentAssocTypeId"/> - <set field="createMain.contentName" from-field="parameters.contentName"/> - <set field="createMain.description" from-field="parameters.description"/> - <set field="createMain.statusId" from-field="parameters.statusId"/> - <set field="createMain.contentIdFrom" from-field="contentIdFrom"/> - <set field="createMain.partyId" from-field="userLogin.partyId"/> - <set field="createMain.ownerContentId" from-field="ownerContentId"/> - <set field="createMain.dataTemplateTypeId" value="SCREEN_COMBINED"/> - <set field="createMain.mapKey" value="MAIN"/> - <call-service service-name="createContent" in-map-name="createMain"> - <result-to-field result-name="contentId" field="contentId"/> - </call-service> - <!-- reset contentIdFrom to new contentId --> - <set field="contentAssocTypeId" value="SUB_CONTENT"/> - <set field="contentIdFrom" from-field="contentId"/> - </if-not-empty> - </if-not-empty> + <if-empty field="parameters.contentName"> + <add-error> + <fail-message message="Article Name is missing."/> + </add-error> + </if-empty> + <check-errors/> + <!-- complex template structure (image & text) --> + <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"/> + <set field="createMain.statusId" from-field="parameters.statusId"/> + <set field="createMain.contentIdFrom" from-field="contentIdFrom"/> + <set field="createMain.partyId" from-field="userLogin.partyId"/> + <set field="createMain.ownerContentId" from-field="ownerContentId"/> + <set field="createMain.dataTemplateTypeId" value="SCREEN_COMBINED"/> + <set field="createMain.mapKey" value="MAIN"/> + <call-service service-name="createContent" in-map-name="createMain"> + <result-to-field result-name="contentId" field="contentId"/> + </call-service> + <!-- reset contentIdFrom to new contentId --> + <set field="contentAssocTypeId" value="SUB_CONTENT"/> + <set field="contentIdFrom" from-field="contentId"/> + <if-not-empty field="parameters._uploadedFile_fileName"> <!-- upload a picture --> @@ -72,11 +75,6 @@ <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-not-empty field="parameters.articleData"> @@ -93,15 +91,11 @@ <set field="createText.textData" from-field="parameters.articleData"/> <set field="createText.contentIdFrom" from-field="contentIdFrom"/> <set field="createText.partyId" from-field="userLogin.partyId"/> + <set field="createText.mapKey" value="ARTICLE"/> <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> <if-not-empty field="contentId"> @@ -123,7 +117,7 @@ </if-not-empty> </if-not-empty> - <field-to-result field="contentId"/> + <field-to-result field="contentIdFrom" result-name="contentId"/> <field-to-result field="parameters.blogContentId" result-name="blogContentId"/> </simple-method> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogForms.xml?rev=1022048&r1=1022047&r2=1022048&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogForms.xml (original) +++ ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogForms.xml Wed Oct 13 09:34:48 2010 @@ -201,10 +201,10 @@ <alt-target use-when="contentId!=void&&contentId!=null" target="updateBlogArticle"/> <field name="blogContentId"><hidden value="${parameters.blogContentId}"/></field> <field name="contentId" title="${uiLabelMap.EcommerceBlogEntryId}" use-when="contentId!=void&&contentId!=null"><display/></field> - <field name="contentName"><text size="40"/></field> - <field name="description"><textarea cols="40" rows="2"/></field> + <field name="contentName" title="${uiLabelMap.EcommerceArticleName}"><text size="40"/></field> + <field name="description"><textarea cols="60" rows="2"/></field> <field name="summaryData" title="${uiLabelMap.EcommerceSummary}" widget-style="inputBox dojo-ResizableTextArea"><textarea cols="60" rows="4"/></field> - <field name="articleData" title="${uiLabelMap.EcommerceBlogArticle}" widget-style="inputBox dojo-ResizableTextArea"><textarea cols="60" rows="12"/></field> + <field name="articleData" title="${uiLabelMap.EcommerceBlogArticle}" widget-style="inputBox dojo-ResizableTextArea"><textarea cols="100" rows="20" visual-editor-enable="true"/></field> <field name="uploadedFile" title="${uiLabelMap.ContentImage}"><file size="25"/></field> <field name="templateDataResourceId" title="${uiLabelMap.ContentTemplate}"> <drop-down> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogTemplates.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogTemplates.xml?rev=1022048&r1=1022047&r2=1022048&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogTemplates.xml (original) +++ ofbiz/trunk/specialpurpose/ecommerce/widget/blog/BlogTemplates.xml Wed Oct 13 09:34:48 2010 @@ -34,6 +34,7 @@ <sub-content content-id="${contentId}" map-key="IMAGE" enable-edit-name="enableEdit" edit-request="EditBlogImage?contentContentId=${parameters.contentContentId}&contentContentIdTo=${parameters.contentContentIdTo}&contentDataResourceId=${parameters.contentDataResourceId}&contentContentAssocTypeId=${parameters.contentContentAssocTypeId}&contentFromDate=${parameters.contentFromDate}"/> </container> <sub-content content-id="${contentId}" map-key="MAIN" enable-edit-name="enableEdit" edit-request="EditBlogText?contentContentId=${parameters.contentContentId}&contentContentIdTo=${parameters.contentContentIdTo}&contentDataResourceId=${parameters.contentDataResourceId}&contentContentAssocTypeId=${parameters.contentContentAssocTypeId}&contentFromDate=${parameters.contentFromDate}"/> + <sub-content content-id="${contentId}" map-key="ARTICLE" enable-edit-name="enableEdit" edit-request="EditBlogText?contentContentId=${parameters.contentContentId}&contentContentIdTo=${parameters.contentContentIdTo}&contentDataResourceId=${parameters.contentDataResourceId}&contentContentAssocTypeId=${parameters.contentContentAssocTypeId}&contentFromDate=${parameters.contentFromDate}"/> </widgets> </section> </screen> @@ -47,6 +48,7 @@ <label text="<p/>"/> <label text="<br/>"/> <sub-content content-id="${contentId}" map-key="MAIN" enable-edit-name="enableEdit" edit-request="EditBlogText?contentContentId=${parameters.contentContentId}&contentContentIdTo=${parameters.contentContentIdTo}&contentDataResourceId=${parameters.contentDataResourceId}&contentContentAssocTypeId=${parameters.contentContentAssocTypeId}&contentFromDate=${parameters.contentFromDate}"/> + <sub-content content-id="${contentId}" map-key="ARTICLE" enable-edit-name="enableEdit" edit-request="EditBlogText?contentContentId=${parameters.contentContentId}&contentContentIdTo=${parameters.contentContentIdTo}&contentDataResourceId=${parameters.contentDataResourceId}&contentContentAssocTypeId=${parameters.contentContentAssocTypeId}&contentFromDate=${parameters.contentFromDate}"/> </widgets> </section> </screen> |
Free forum by Nabble | Edit this page |