svn commit: r1792270 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/quote/QuoteServices.xml servicedef/services_quote.xml

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

svn commit: r1792270 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/quote/QuoteServices.xml servicedef/services_quote.xml

Deepak Dixit-5
Author: deepak
Date: Sat Apr 22 07:59:45 2017
New Revision: 1792270

URL: http://svn.apache.org/viewvc?rev=1792270&view=rev
Log:
Improved: Converted create and remove QuoteRole service to entity-auto also added update and expire QuoteRole service.(OFBIZ-9331)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/minilang/quote/QuoteServices.xml
    ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_quote.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/order/minilang/quote/QuoteServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/minilang/quote/QuoteServices.xml?rev=1792270&r1=1792269&r2=1792270&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/minilang/quote/QuoteServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/minilang/quote/QuoteServices.xml Sat Apr 22 07:59:45 2017
@@ -281,47 +281,6 @@ under the License.
         <check-errors/>
     </simple-method>
 
-    <!-- create a new QuoteRole -->
-    <simple-method method-name="createQuoteRole" short-description="Create a QuoteRole">
-        <check-permission permission="ORDERMGR" action="_CREATE">
-            <fail-property resource="OrderErrorUiLabels" property="OrderErrorCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-        <set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
-        <set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
-        <find-by-primary-key entity-name="PartyRole" map="lookupPKMap" value-field="partyRole"/>
-        <if-empty field="partyRole.partyId">
-            <check-permission permission="PARTYMGR" action="_CREATE">
-                <fail-property resource="OrderErrorUiLabels" property="OrderErrorCreatePermissionError"/>
-            </check-permission>
-            <check-permission permission="PARTYMGR" action="_UPDATE">
-                <fail-property resource="OrderErrorUiLabels" property="OrderErrorCreatePermissionError"/>
-            </check-permission>
-            <check-errors/>
-            <make-value value-field="partyRole" entity-name="PartyRole"/>
-            <set-pk-fields map="lookupPKMap" value-field="partyRole"/>
-            <create-value value-field="partyRole"/>
-        </if-empty>
-        <!-- create new entity and create all the fields -->
-        <make-value value-field="newEntity" entity-name="QuoteRole"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-        <property-to-field resource="OrderUiLabels" property="OrderOrderQuoteRoleAddedSuccessfully" field="successMessage"/>
-        <check-errors/>
-    </simple-method>
-
-    <!-- remove an existing QuoteRole -->
-    <simple-method method-name="removeQuoteRole" short-description="Remove an existing QuoteRole">
-        <check-permission permission="ORDERMGR" action="_DELETE">
-            <fail-property resource="OrderErrorUiLabels" property="OrderErrorDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-        <entity-one entity-name="QuoteRole" value-field="quoteRole" auto-field-map="true"/>
-        <check-errors/>
-        <remove-value value-field="quoteRole"/>
-        <check-errors/>
-    </simple-method>
-
     <!-- create a new QuoteItem -->
     <simple-method method-name="createQuoteItem" short-description="Create a QuoteItem">
         <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_quote.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_quote.xml?rev=1792270&r1=1792269&r2=1792270&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_quote.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_quote.xml Sat Apr 22 07:59:45 2017
@@ -69,16 +69,37 @@ under the License.
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <!-- QuoteRole  -->
-    <service name="createQuoteRole" default-entity-name="QuoteRole" engine="simple"
-                location="component://order/minilang/quote/QuoteServices.xml" invoke="createQuoteRole" auth="true">
+    <service name="createQuoteRole" default-entity-name="QuoteRole" engine="entity-auto" invoke="create" auth="true">
         <description>Create a QuoteRole</description>
-        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="_CREATE"/>
+        </required-permissions>
+        <auto-attributes mode="IN" include="pk" />
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <!-- make fromDate as optional for backward compatibility, EntityAuto engine automatically set the fromDate to nowTimestamp if its not missing-->
+        <override name="fromDate" mode="IN" optional="true"/>
     </service>
-    <service name="removeQuoteRole" default-entity-name="QuoteRole" engine="simple"
-                location="component://order/minilang/quote/QuoteServices.xml" invoke="removeQuoteRole" auth="true">
+    <service name="updateQuoteRole" default-entity-name="QuoteRole" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a QuoteRole</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="_UPDATE"/>
+        </required-permissions>
+        <auto-attributes mode="IN" include="pk" />
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="removeQuoteRole" default-entity-name="QuoteRole" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove a QuoteRole</description>
-        <auto-attributes include="pk" mode="INOUT" optional="true"/>
-        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="_DELETE"/>
+        </required-permissions>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+    <service name="removeQuoteRole" default-entity-name="QuoteRole" engine="entity-auto" invoke="expire" auth="true">
+        <description>Expire a QuoteRole</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="_UPDATE"/>
+        </required-permissions>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <!-- QuoteItem  -->
     <service name="createQuoteItem" default-entity-name="QuoteItem" engine="simple"