Author: arunpatidar
Date: Sat Oct 28 12:56:17 2017 New Revision: 1813623 URL: http://svn.apache.org/viewvc?rev=1813623&view=rev Log: IMPROVED: Replace ContentAssoc related CRUD services with entity-auto. (OFBIZ-9907) Thanks Mr. Khurana for your contribution. Modified: ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml ofbiz/ofbiz-framework/trunk/applications/content/minilang/layout/LayoutEvents.xml ofbiz/ofbiz-framework/trunk/applications/content/servicedef/secas.xml ofbiz/ofbiz-framework/trunk/applications/content/servicedef/services_content.xml Modified: ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml?rev=1813623&r1=1813622&r2=1813623&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml Sat Oct 28 12:56:17 2017 @@ -91,40 +91,6 @@ </if-not-empty> </simple-method> - <!-- content assoc services --> - <simple-method method-name="createContentAssoc" short-description="Create a ContntAssoc Record"> - <make-value entity-name="ContentAssoc" value-field="assoc"/> - <set-nonpk-fields map="parameters" value-field="assoc"/> - <set-pk-fields value-field="assoc" map="parameters"/> - - <set field="assoc.contentId" from-field="parameters.contentIdFrom" default-value="${parameters.contentId}"/> - - <now-timestamp field="nowTimestamp"/> - <if-empty field="assoc.fromDate"> - <set field="assoc.fromDate" from-field="nowTimestamp"/> - </if-empty> - - <set field="assoc.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/> - <set field="assoc.createdByUserLogin" from-field="userLogin.userLoginId"/> - <set field="assoc.lastModifiedDate" from-field="nowTimestamp"/> - <set field="assoc.createdDate" from-field="nowTimestamp"/> - - <create-value value-field="assoc"/> - <log level="info" message="assoc: ${assoc}"/> - <field-to-result field="assoc.fromDate" result-name="fromDate"/> - </simple-method> - <simple-method method-name="updateContentAssoc" short-description="Update a ContentAssoc Record"> - <set field="contentId" from-field="parameters.contentIdFrom" default-value="${parameters.contentId}"/> - <entity-one entity-name="ContentAssoc" value-field="assoc" auto-field-map="true"/> - <set-nonpk-fields map="parameters" value-field="assoc"/> - - <now-timestamp field="nowTimestamp"/> - <set field="content.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/> - <set field="content.lastModifiedDate" from-field="nowTimestamp"/> - - <store-value value-field="assoc"/> - </simple-method> - <!-- update content; just status --> <simple-method method-name="setContentStatus" short-description="Set The Content Status"> Modified: ofbiz/ofbiz-framework/trunk/applications/content/minilang/layout/LayoutEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/minilang/layout/LayoutEvents.xml?rev=1813623&r1=1813622&r2=1813623&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/minilang/layout/LayoutEvents.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/minilang/layout/LayoutEvents.xml Sat Oct 28 12:56:17 2017 @@ -374,7 +374,6 @@ under the License. <set-service-fields service-name="createContentAssoc" map="formInput.formInput" to-map="contentMap"/> <if-not-empty field="formInput.formInput.contentIdFrom"> <set field="contentMap.contentAssocTypeId" value="SUB_CONTENT"/> - <set field="contentMap.contentIdFrom" from-field="formInput.formInput.contentIdFrom"/> <set field="contentMap.contentId" from-field="formInput.formInput.contentIdFrom"/> <set field="contentMap.contentIdTo" from-field="context.contentId"/> <now-timestamp field="contentMap.fromDate"/> Modified: ofbiz/ofbiz-framework/trunk/applications/content/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/servicedef/secas.xml?rev=1813623&r1=1813622&r2=1813623&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/servicedef/secas.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/servicedef/secas.xml Sat Oct 28 12:56:17 2017 @@ -162,7 +162,7 @@ under the License. </eca> <eca service="updateContent" event="commit"> <condition field-name="contentAssocTypeId" operator="is-not-empty"/> - <condition field-name="contentIdFrom" operator="is-not-empty"/> + <condition field-name="contentId" operator="is-not-empty"/> <condition field-name="fromDate" operator="is-not-empty"/> <action service="updateContentAssoc" mode="sync" run-as-user="system"/> </eca> Modified: ofbiz/ofbiz-framework/trunk/applications/content/servicedef/services_content.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/servicedef/services_content.xml?rev=1813623&r1=1813622&r2=1813623&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/servicedef/services_content.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/servicedef/services_content.xml Sat Oct 28 12:56:17 2017 @@ -269,40 +269,24 @@ </attribute> </service> - <service name="createContentAssoc" default-entity-name="ContentAssoc" engine="simple" auth="true" - location="component://content/minilang/content/ContentServices.xml" invoke="createContentAssoc"> + <!-- content assoc services --> + <service name="createContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="create"> <description>Create a ContentAssoc</description> <permission-service service-name="genericContentPermission" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> - <!-- deprecated fields to be removed --> - <attribute mode="IN" name="targetOperationList" optional="true" type="List"/> - <attribute mode="IN" name="targetOperationString" optional="true" type="String"/> - <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/> - <attribute mode="IN" name="contentPurposeString" optional="true" type="String"/> - <attribute mode="IN" name="deactivateExisting" optional="true" type="String"/> - <attribute mode="IN" name="skipPermissionCheck" optional="true" type="String"/> - <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/> - <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/> - <attribute mode="INOUT" name="contentIdFrom" optional="true" type="String"/> <override name="fromDate" mode="INOUT" optional="true"/> - <!-- end of deprecated fields --> </service> - <service name="updateContentAssoc" default-entity-name="ContentAssoc" engine="simple" auth="true" - location="component://content/minilang/content/ContentServices.xml" invoke="updateContentAssoc"> + <service name="updateContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="update"> <description>Update a ContentAssoc</description> <permission-service service-name="genericContentPermission" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> - <!-- deprecated fields to be removed --> - <attribute mode="IN" name="targetOperationList" optional="true" type="List"/> - <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/> - <attribute mode="IN" name="skipPermissionCheck" optional="true" type="String"/> - <attribute mode="IN" name="deactivateExisting" optional="true" type="String"/> - <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/> - <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/> - <attribute mode="INOUT" name="contentIdFrom" optional="true" type="String"/> - <!-- end of deprecated fields --> + </service> + <service name="expireContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="expire"> + <description>Expire a ContentAssoc</description> + <permission-service service-name="genericContentPermission" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> </service> <service name="removeContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="delete"> <description>Remove ContentAssoc</description> |
Free forum by Nabble | Edit this page |