Author: ashish
Date: Sat Nov 15 12:19:44 2014 New Revision: 1639867 URL: http://svn.apache.org/r1639867 Log: 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/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java ofbiz/trunk/applications/content/widget/cms/CMSForms.xml ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1639867&r1=1639866&r2=1639867&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sat Nov 15 12:19:44 2014 @@ -181,6 +181,7 @@ public class ContentManagementServices { } GenericValue content = delegator.makeValue("Content"); + content.setPKFields(context); content.setNonPKFields(context); String contentId = (String) content.get("contentId"); @@ -334,7 +335,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) { @@ -410,7 +410,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/trunk/applications/content/widget/cms/CMSForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/cms/CMSForms.xml?rev=1639867&r1=1639866&r2=1639867&view=diff ============================================================================== --- ofbiz/trunk/applications/content/widget/cms/CMSForms.xml (original) +++ ofbiz/trunk/applications/content/widget/cms/CMSForms.xml Sat Nov 15 12:19:44 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"> @@ -406,7 +407,7 @@ under the License. </field> <field name="caMapKey" position="2" use-when=""${caMapKey}".length()>0" > - <display /> + <text /> </field> <field name="caContentAssocTypeId" position="1" use-when=""${caContentAssocTypeId}".length()>0" > @@ -423,8 +424,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=""${caFromDate}".length()>0"> + <display default-value="${nowTimestamp}"/> + </field> + <field name="caFromDate" title="${uiLabelMap.CommonFromDate}" widget-style="buttontext" position="1" use-when=""${caFromDate}".length()==0"> + <date-time default-value="${nowTimestamp}"/> + </field> + <field name="caThruDate" title="${uiLabelMap.CommonThruDate}" widget-style="buttontext" position="2" use-when=""${caThruDate}".length()>0"> + <date-time/> + </field> + <field name="caThruDate" title="${uiLabelMap.CommonThruDate}" widget-style="buttontext" position="2" use-when=""${caThruDate}".length()==0"> + <date-time/> + </field> <field name="contentTitle" title="${uiLabelMap.ContentContent}" title-style="h1" map-name="dummy"> <display description=""/> </field> Modified: ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml?rev=1639867&r1=1639866&r2=1639867&view=diff ============================================================================== --- ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml (original) +++ ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml Sat Nov 15 12:19:44 2014 @@ -103,7 +103,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"/> @@ -111,6 +113,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"/> @@ -123,7 +127,7 @@ under the License. <screenlet title="${uiLabelMap.ContentCMSEditPage}"> <link text="${uiLabelMap.ContentGoToFind}" target="CMSContentFind?VIEW_INDEX=${CMSContentFindViewIndex}&${CMSContentFindQueryString}"/> <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}&MASTER_caContentIdTo=${MASTER_caContentIdTo}&MASTER_caContentAssocTypeId=${MASTER_caContentAssocTypeId}&MASTER_caFromDate=${MASTER_caFromDate}&MASTER_drDataResourceId=${MASTER_drDataResourceId}&caContentIdTo=${caContentIdTo}"/> + <content content-id="${contentId}" enable-edit-name="notfound" edit-request="EditAddSubContent?MASTER_caMapKey=${MASTER_caMapKey}&MASTER_contentId=${MASTER_contentId}&MASTER_caContentIdTo=${MASTER_caContentIdTo}&MASTER_caContentAssocTypeId=${MASTER_caContentAssocTypeId}&MASTER_caFromDate=${MASTER_caFromDate}&MASTER_caThruDate=${MASTER_caThruDate}&MASTER_drDataResourceId=${MASTER_drDataResourceId}&caContentIdTo=${caContentIdTo}"/> </screenlet> </decorator-section> </decorator-screen> |
Free forum by Nabble | Edit this page |