Author: deepak
Date: Tue Oct 18 19:21:09 2016
New Revision: 1765499

URL: http://svn.apache.org/viewvc?rev=1765499&view=rev
Log:
Improved: Converted some DataResource related CRUD services from simple to 
entity-auto.
(OFBIZ-8346)(OFBIZ-8347)(OFBIZ-8349)(OFBIZ-8350)(OFBIZ-8351)

Thanks Pawan Verma for your contribution.

Modified:
    ofbiz/trunk/applications/content/minilang/data/DataServices.xml
    ofbiz/trunk/applications/content/servicedef/services.xml
    ofbiz/trunk/applications/content/servicedef/services_contenttypes.xml

Modified: ofbiz/trunk/applications/content/minilang/data/DataServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/minilang/data/DataServices.xml?rev=1765499&r1=1765498&r2=1765499&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/minilang/data/DataServices.xml (original)
+++ ofbiz/trunk/applications/content/minilang/data/DataServices.xml Tue Oct 18 
19:21:09 2016
@@ -91,33 +91,6 @@ under the License.
        <if-compare field="dataResource.dataResourceTypeId" operator="equals" 
value="IMAGE_OBJECT"><return 
response-code="${dataResource.dataResourceTypeId}"/></if-compare>       
     </simple-method>
 
-  <!-- Methods for DataResourceRole -->
-    <simple-method method-name="createDataResourceRole" 
short-description="Create Data Resource Role">
-        <if-not-empty field="parameters.partyId">
-            <make-value entity-name="DataResourceRole" 
value-field="newEntity"/>
-            <set-nonpk-fields map="parameters" value-field="newEntity"/>
-            <set-pk-fields map="parameters" value-field="newEntity"/>
-            <if-empty field="newEntity.fromDate">
-                <now-timestamp field="nowTimestamp"/>
-                <set field="newEntity.fromDate" from-field="nowTimestamp"/>
-            </if-empty>
-            <create-value value-field="newEntity"/>
-        </if-not-empty>
-    </simple-method>
-    <simple-method method-name="updateDataResourceRole" 
short-description="Update Data Resource Role">
-        <make-value entity-name="DataResourceRole" 
value-field="lookupKeyValue"/>
-        <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="DataResourceRole" 
map="lookupKeyValue" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-    <simple-method method-name="removeDataResourceRole" 
short-description="Remove Data Resource Role">
-        <make-value entity-name="DataResourceRole" 
value-field="lookupKeyValue"/>
-        <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="DataResourceRole" 
map="lookupKeyValue" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
   <!-- Methods for DataCategory -->
     <simple-method method-name="updateDataCategory" short-description="Update 
Data Category">
         <make-value entity-name="DataCategory" value-field="lookupKeyValue"/>
@@ -133,28 +106,6 @@ under the License.
         <remove-value value-field="lookedUpValue"/>
     </simple-method>
 
-    <!-- Methods for DataResourceType -->
-    <simple-method method-name="createDataResourceType" 
short-description="Create Data Resource Type">
-        <make-value entity-name="DataResourceType" 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="dataResourceTypeId" 
field="newEntity.dataResourceTypeId"/>
-    </simple-method>
-    <simple-method method-name="updateDataResourceType" 
short-description="Update Data Resource Type">
-        <make-value entity-name="DataResourceType" 
value-field="lookupKeyValue"/>
-        <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="DataResourceType" 
map="lookupKeyValue" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-    <simple-method method-name="removeDataResourceType" 
short-description="Remove Data Resource Type">
-        <make-value entity-name="DataResourceType" 
value-field="lookupKeyValue"/>
-        <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="DataResourceType" 
map="lookupKeyValue" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
     <!--
     getElectronicText
     Passed a Content GenericValue or a contentId, this service returns the 
text data from

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=1765499&r1=1765498&r2=1765499&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Tue Oct 18 
19:21:09 2016
@@ -120,22 +120,19 @@
     </service>
 
     <!-- DataResourceRole services -->
-    <service name="createDataResourceRole" engine="simple" 
default-entity-name="DataResourceRole" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="createDataResourceRole">
+    <service name="createDataResourceRole" engine="entity-auto" 
default-entity-name="DataResourceRole" auth="true" invoke="create">
         <description>Create a DataResourceRole</description>
         <permission-service service-name="genericDataResourcePermission" 
main-action="UPDATE"/>
-        <auto-attributes include="pk" mode="IN" optional="true"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="updateDataResourceRole" engine="simple" 
default-entity-name="DataResourceRole" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="updateDataResourceRole">
+    <service name="updateDataResourceRole" engine="entity-auto" 
default-entity-name="DataResourceRole" auth="true" invoke="update">
         <description>Update a DataResourceRole</description>
         <permission-service service-name="genericDataResourcePermission" 
main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="removeDataResourceRole" engine="simple" 
default-entity-name="DataResourceRole" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="removeDataResourceRole">
+    <service name="removeDataResourceRole" engine="entity-auto" 
default-entity-name="DataResourceRole" auth="true" invoke="delete">
         <description>Remove DataResourceRole</description>
         <permission-service service-name="genericDataResourcePermission" 
main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>

Modified: ofbiz/trunk/applications/content/servicedef/services_contenttypes.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_contenttypes.xml?rev=1765499&r1=1765498&r2=1765499&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_contenttypes.xml 
(original)
+++ ofbiz/trunk/applications/content/servicedef/services_contenttypes.xml Tue 
Oct 18 19:21:09 2016
@@ -132,22 +132,19 @@ under the License.
     </service>
 
     <!-- DataResourceType services -->
-    <service name="createDataResourceType" engine="simple" 
default-entity-name="DataResourceType" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="createDataResourceType">
+    <service name="createDataResourceType" engine="entity-auto" 
default-entity-name="DataResourceType" auth="true" invoke="create">
         <description>Create a DataResourceType</description>
         <permission-service service-name="contentManagerPermission" 
main-action="CREATE"/>
-        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="updateDataResourceType" engine="simple" 
default-entity-name="DataResourceType" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="updateDataResourceType">
+    <service name="updateDataResourceType" engine="entity-auto" 
default-entity-name="DataResourceType" auth="true" invoke="update">
         <description>Update a DataResourceType</description>
         <permission-service service-name="contentManagerPermission" 
main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="removeDataResourceType" engine="simple" 
default-entity-name="DataResourceType" auth="true"
-            location="component://content/minilang/data/DataServices.xml" 
invoke="removeDataResourceType">
+    <service name="removeDataResourceType" engine="entity-auto" 
default-entity-name="DataResourceType" auth="true" invoke="delete">
         <description>Remove DataResourceType</description>
         <permission-service service-name="contentManagerPermission" 
main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>


Reply via email to