[ofbiz-framework] branch trunk updated: Improved: Convert createCommEventContentAssoc service from mini-lang to groovy DSL(OFBIZ-11380)

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

[ofbiz-framework] branch trunk updated: Improved: Convert createCommEventContentAssoc service from mini-lang to groovy DSL(OFBIZ-11380)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 271e3c9  Improved: Convert createCommEventContentAssoc service from mini-lang to groovy DSL(OFBIZ-11380)
271e3c9 is described below

commit 271e3c9bd56ead7f5f1db8bc47b8ac8b32a6d852
Author: Pawan Verma <[hidden email]>
AuthorDate: Sat Aug 22 19:09:44 2020 +0530

    Improved: Convert createCommEventContentAssoc service from mini-lang to groovy DSL(OFBIZ-11380)
   
    Thanks, Devanshu for report, rushikesh and priya for the patch and Suraj and jacques for the review.
---
 applications/content/minilang/content/ContentServices.xml | 13 -------------
 applications/content/servicedef/services_commevent.xml    | 11 ++++-------
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/applications/content/minilang/content/ContentServices.xml b/applications/content/minilang/content/ContentServices.xml
index 68d6a47..6218094 100644
--- a/applications/content/minilang/content/ContentServices.xml
+++ b/applications/content/minilang/content/ContentServices.xml
@@ -244,19 +244,6 @@
 
     </simple-method>
 
-    <!-- This service ties CommunicationEvent and Content entities together along with the standard from/thruDate fields.
-        -->
-    <simple-method method-name="createCommEventContentAssoc" short-description="Create CommEventContentAssoc">
-        <make-value entity-name="CommEventContentAssoc" value-field="commEventContentAssoc"/>
-        <set-pk-fields value-field="commEventContentAssoc" map="parameters"/>
-        <set-nonpk-fields map="parameters" value-field="commEventContentAssoc"/>
-        <if-empty field="commEventContentAssoc.fromDate">
-            <now-timestamp field="commEventContentAssoc.fromDate"/>
-        </if-empty>
-        <create-value value-field="commEventContentAssoc"/>
-        <field-to-result field="commEventContentAssoc.fromDate" result-name="fromDate"/>
-    </simple-method>
-
     <!-- simply use createContent and the accoc will be created too" the service below +aca will create 2 contentAssocs-->
     <!--simple-method method-name="createContentAndAssoc" short-description="Create content and associate with other content">
         <set-service-fields service-name="createContent" map="parameters" to-map="contentData"/>
diff --git a/applications/content/servicedef/services_commevent.xml b/applications/content/servicedef/services_commevent.xml
index dc57c18..9c37b26 100644
--- a/applications/content/servicedef/services_commevent.xml
+++ b/applications/content/servicedef/services_commevent.xml
@@ -69,14 +69,11 @@ under the License.
         </attribute>
     </service>
 
-    <service name="createCommEventContentAssoc" engine="simple"
-                location="component://content/minilang/content/ContentServices.xml" invoke="createCommEventContentAssoc" auth="true">
+    <service name="createCommEventContentAssoc" engine="entity-auto" invoke="create" default-entity-name="CommEventContentAssoc" auth="true">
         <description>Create CommEventContentAssoc</description>
-        <attribute name="communicationEventId" type="String" mode="IN" optional="false"/>
-        <attribute name="contentId" type="String" mode="IN" optional="false"/>
-        <attribute name="fromDate" type="java.sql.Timestamp" mode="INOUT" optional="true"/>
-        <attribute name="thruDate" type="java.sql.Timestamp" mode="IN" optional="true"/>
-         <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
+        <auto-attributes mode="INOUT" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <override name="fromDate" optional="true"/>
     </service>
 
     <service name="updateCommEventContentAssoc" default-entity-name="CommEventContentAssoc" engine="entity-auto" invoke="update" auth="true">