[ofbiz-framework] branch trunk updated: Improved: Converted remaining ElectronicText related CRUD services from simple to entity-auto (#120)

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: Converted remaining ElectronicText related CRUD services from simple to entity-auto (#120)

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk 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 e3124a6  Improved: Converted remaining ElectronicText related CRUD services from simple to entity-auto (#120)
e3124a6 is described below

commit e3124a6856dbd0131bad1dd6491252fa1fb1a7fe
Author: Suraj Khurana <[hidden email]>
AuthorDate: Wed May 13 10:46:55 2020 +0530

    Improved: Converted remaining ElectronicText related CRUD services from simple to entity-auto (#120)
   
    (OFBIZ-11664)
---
 applications/content/minilang/data/DataServices.xml | 18 ------------------
 applications/content/servicedef/services_data.xml   |  8 +++-----
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/applications/content/minilang/data/DataServices.xml b/applications/content/minilang/data/DataServices.xml
index 10a64a9..c845e90 100644
--- a/applications/content/minilang/data/DataServices.xml
+++ b/applications/content/minilang/data/DataServices.xml
@@ -98,24 +98,6 @@ under the License.
 
     Not that this service does not now do permission checking.
     -->
-    <simple-method method-name="createElectronicTextForm" short-description="Create Electronic Text with Form code">
-        <make-value entity-name="ElectronicText" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-        <field-to-result result-name="dataResourceId" field="newEntity.dataResourceId"/>
-    </simple-method>
-
-    <simple-method method-name="updateElectronicTextForm" short-description="Update Electronic Text with Form code">
-        <make-value entity-name="ElectronicText" value-field="lookupKeyValue"/>
-        <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="ElectronicText" map="lookupKeyValue" value-field="lookedUpValue"/>
-
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-        <field-to-result result-name="dataResourceId" field="lookedUpValue.dataResourceId"/>
-    </simple-method>
-
     <simple-method method-name="getElectronicText" short-description="Get Electronic Text" login-required="false">
         <set field="userLogin" from-field="parameters.userLogin"/>
         <set field="currentContent" from-field="parameters.content"/>
diff --git a/applications/content/servicedef/services_data.xml b/applications/content/servicedef/services_data.xml
index 4625253..48ffe5d 100644
--- a/applications/content/servicedef/services_data.xml
+++ b/applications/content/servicedef/services_data.xml
@@ -125,8 +125,7 @@
         <attribute name="contentId" mode="INOUT" optional="true" type="String"/><!-- to optionaly know where this text is belonging to -->
         <override name="textData" allow-html="safe"/>
     </service>
-    <service name="createElectronicTextForm" default-entity-name="ElectronicText" engine="simple"
-            location="component://content/minilang/data/DataServices.xml" invoke="createElectronicTextForm" auth="true">
+    <service name="createElectronicTextForm" default-entity-name="ElectronicText" engine="entity-auto" invoke="create" auth="true">
         <description>Create a ElectronicText with Form code</description>
         <permission-service service-name="genericDataResourcePermission" main-action="CREATE"/>
         <implements service="createDataResource"/>
@@ -135,13 +134,12 @@
         <override name="dataResourceTypeId" default-value="ELECTRONIC_TEXT"/>
         <override name="textData" allow-html="any"/>
     </service>
-    <service name="updateElectronicTextForm" default-entity-name="ElectronicText" engine="simple"
-            location="component://content/minilang/data/DataServices.xml" invoke="updateElectronicTextForm" auth="true">
+    <service name="updateElectronicTextForm" default-entity-name="ElectronicText" engine="entity-auto" invoke="update" auth="true">
         <description>Update a ElectronicText with Form code</description>
         <permission-service service-name="genericDataResourcePermission" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <attribute name="contentId" mode="INOUT" optional="true" type="String"/><!-- to optionaly know where this text is belonging to -->
+        <attribute name="contentId" mode="INOUT" optional="true" type="String"/><!-- to optionally know where this text is belonging to -->
         <override name="textData" allow-html="any"/>
     </service>
     <service name="removeElectronicText" default-entity-name="ElectronicText" engine="entity-auto" invoke="delete" auth="true">