You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/15 23:46:28 UTC

svn commit: r1639934 - in /ofbiz/branches/release12.04: ./ applications/content/src/org/ofbiz/content/ContentManagementServices.java applications/content/widget/cms/CMSForms.xml applications/content/widget/cms/CMSScreens.xml

Author: jleroux
Date: Sat Nov 15 22:46:28 2014
New Revision: 1639934

URL: http://svn.apache.org/r1639934
Log:
"Applied fix from trunk for revision: 1639867" 
------------------------------------------------------------------------
r1639867 | ashish | 2014-11-15 13:19:44 +0100 (sam. 15 nov. 2014) | 2 lignes

Applied patch from jira issue - OFBIZ-4362 - MapKey for CMS content cannot be updated.
Thanks Manuela for reporting the bug, Thanks Deepak for providing the patch for this issue. 
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/content/src/org/ofbiz/content/ContentManagementServices.java
    ofbiz/branches/release12.04/applications/content/widget/cms/CMSForms.xml
    ofbiz/branches/release12.04/applications/content/widget/cms/CMSScreens.xml

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1639867

Modified: ofbiz/branches/release12.04/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1639934&r1=1639933&r2=1639934&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/branches/release12.04/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sat Nov 15 22:46:28 2014
@@ -207,6 +207,7 @@ public class ContentManagementServices {
         }
 
         GenericValue content = delegator.makeValue("Content");
+        
         content.setPKFields(context);
         content.setNonPKFields(context);
         String contentId = (String) content.get("contentId");
@@ -360,7 +361,6 @@ public class ContentManagementServices {
             results.put("contentId", contentId);
             context.put("contentId", contentId);
             context.put("caContentIdTo", contentId);
-            contentAssoc.put("contentIdTo", contentId);
 
             // Add ContentPurposes if this is a create operation
             if (contentId != null && !contentExists) {
@@ -436,7 +436,7 @@ public class ContentManagementServices {
                     results.put("caSequenceNum", thisResult.get("sequenceNum"));
                 } else {
                     if (deactivateExisting) {
-                        contentAssoc.put("thruDate", UtilDateTime.nowTimestamp());
+                        contentAssocExisting.put("thruDate", UtilDateTime.nowTimestamp());
                     }
                     ModelService contentAssocModel = dispatcher.getDispatchContext().getModelService("updateContentAssoc");
                     Map<String, Object> ctx = contentAssocModel.makeValid(contentAssoc, "IN");

Modified: ofbiz/branches/release12.04/applications/content/widget/cms/CMSForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/content/widget/cms/CMSForms.xml?rev=1639934&r1=1639933&r2=1639934&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/content/widget/cms/CMSForms.xml (original)
+++ ofbiz/branches/release12.04/applications/content/widget/cms/CMSForms.xml Sat Nov 15 22:46:28 2014
@@ -51,6 +51,7 @@ under the License.
                 <parameter param-name="MASTER_caContentIdTo" from-field="caContentIdTo"/>
                 <parameter param-name="MASTER_caContentAssocTypeId" from-field="caContentAssocTypeId"/>
                 <parameter param-name="MASTER_caFromDate" from-field="caFromDate"/>
+                <parameter param-name="MASTER_caMapKey" from-field="caMapKey"/>
             </hyperlink>
 <!--
             <hyperlink also-hidden="false" description="${uiLabelMap.CommonEdit}" target="EditContent">
@@ -434,7 +435,7 @@ under the License.
         </field>
         <field name="caMapKey" position="2"
             use-when="&quot;${caMapKey}&quot;.length()>0" >
-            <display />
+            <text />
         </field>
         <field name="caContentAssocTypeId" position="1"
             use-when="&quot;${caContentAssocTypeId}&quot;.length()>0" >
@@ -451,8 +452,18 @@ under the License.
                 <entity-options description="${description}" entity-name="MetaDataPredicate" key-field-name="metaDataPredicateId"/>
             </drop-down>
         </field>
-        <field name="caFromDate" title="${uiLabelMap.CommonFromDate}" widget-style="buttontext" position="1"><date-time default-value="${nowTimestamp}"/></field>
-        <field name="caThruDate" title="${uiLabelMap.CommonThruDate}" widget-style="buttontext" position="2"><date-time/></field>
+        <field name="caFromDate" title="${uiLabelMap.CommonFromDate}" widget-style="buttontext" position="1" use-when="&quot;${caFromDate}&quot;.length()>0">
+            <display default-value="${nowTimestamp}"/>
+        </field>
+        <field name="caFromDate" title="${uiLabelMap.CommonFromDate}" widget-style="buttontext" position="1" use-when="&quot;${caFromDate}&quot;.length()==0">
+            <date-time default-value="${nowTimestamp}"/>
+        </field>
+        <field name="caThruDate" title="${uiLabelMap.CommonThruDate}" widget-style="buttontext" position="2" use-when="&quot;${caThruDate}&quot;.length()>0">
+            <date-time/>
+        </field>
+        <field name="caThruDate" title="${uiLabelMap.CommonThruDate}" widget-style="buttontext" position="2" use-when="&quot;${caThruDate}&quot;.length()==0">
+            <date-time/>
+        </field>
         <field name="contentTitle" title="${uiLabelMap.ContentContent}" title-style="h1" map-name="dummy">
             <display description=""/>
         </field>

Modified: ofbiz/branches/release12.04/applications/content/widget/cms/CMSScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/content/widget/cms/CMSScreens.xml?rev=1639934&r1=1639933&r2=1639934&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/content/widget/cms/CMSScreens.xml (original)
+++ ofbiz/branches/release12.04/applications/content/widget/cms/CMSScreens.xml Sat Nov 15 22:46:28 2014
@@ -121,7 +121,9 @@ under the License.
                 <set field="MASTER_caContentIdTo" from-field="parameters.MASTER_caContentIdTo" default-value="${parameters.caContentIdTo}"/>
                 <set field="MASTER_caContentId" from-field="parameters.MASTER_caContentId" default-value="${parameters.caContentIdFrom}"/>
                 <set field="MASTER_caContentAssocTypeId" from-field="parameters.MASTER_caContentAssocTypeId" default-value="${parameters.caContentAssocTypeId}"/>
+                <set field="MASTER_caMapKey" from-field="parameters.MASTER_caMapKey" default-value="${parameters.caMapKey}"/>
                 <set field="MASTER_caFromDate" from-field="parameters.MASTER_caFromDate" default-value="${parameters.caFromDate}" type="Timestamp"/>
+                <set field="MASTER_caThruDate" from-field="parameters.MASTER_caThruDate" default-value="${parameters.caThruDate}" type="Timestamp"/>
 
                 <set field="contentId" from-field="MASTER_contentId"/>
                 <set field="drDataResourceId" from-field="MASTER_drDataResourceId"/>
@@ -129,6 +131,8 @@ under the License.
                 <set field="caContentId" from-field="MASTER_caContentId"/>
                 <set field="caContentAssocTypeId" from-field="MASTER_caContentAssocTypeId"/>
                 <set field="caFromDate" from-field="MASTER_caFromDate"/>
+                <set field="caThruDate" from-field="MASTER_caThruDate"/>
+                <set field="caMapKey" from-field="MASTER_caMapKey"/>
 
 
                 <script location="component://content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy"/>
@@ -141,7 +145,7 @@ under the License.
                         <screenlet title="${uiLabelMap.ContentCMSEditPage}">
                             <link  text="${uiLabelMap.ContentGoToFind}" target="CMSContentFind?VIEW_INDEX=${CMSContentFindViewIndex}&amp;${CMSContentFindQueryString}" style="tabletext"/>
                             <include-form name="EditAddContentStuff" location="component://content/widget/cms/CMSForms.xml"/>
-                            <content content-id="${contentId}" enable-edit-name="notfound"  edit-request="EditAddSubContent?MASTER_contentId=${MASTER_contentId}&amp;MASTER_caContentIdTo=${MASTER_caContentIdTo}&amp;MASTER_caContentAssocTypeId=${MASTER_caContentAssocTypeId}&amp;MASTER_caFromDate=${MASTER_caFromDate}&amp;MASTER_drDataResourceId=${MASTER_drDataResourceId}&amp;caContentIdTo=${caContentIdTo}"/>
+                            <content content-id="${contentId}" enable-edit-name="notfound"  edit-request="EditAddSubContent?MASTER_caMapKey=${MASTER_caMapKey}&amp;MASTER_contentId=${MASTER_contentId}&amp;MASTER_caContentIdTo=${MASTER_caContentIdTo}&amp;MASTER_caContentAssocTypeId=${MASTER_caContentAssocTypeId}&amp;MASTER_caFromDate=${MASTER_caFromDate}&amp;MASTER_caThruDate=${MASTER_caThruDate}&amp;MASTER_drDataResourceId=${MASTER_drDataResourceId}&amp;caContentIdTo=${caContentIdTo}"/>
                         </screenlet>
                     </decorator-section>
                 </decorator-screen>