Author: jleroux
Date: Mon May 14 07:46:50 2018
New Revision: 1831542

URL: http://svn.apache.org/viewvc?rev=1831542&view=rev
Log:
Improved: Replace deleteRequirement service by entity-auto
(OFBIZ-10400)

Also, introduces deleteRequirementAndRelated service which will delete all 
related entity records before deleting requirement. This new service is used 
in place of deleteRequirement for history compatibility reason

Thanks: Aditya

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
    
ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml
    
ofbiz/ofbiz-framework/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml?rev=1831542&r1=1831541&r2=1831542&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/minilang/requirement/RequirementServices.xml
 Mon May 14 07:46:50 2018
@@ -20,7 +20,7 @@ under the License.
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xmlns="http://ofbiz.apache.org/Simple-Method"; 
xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method 
http://ofbiz.apache.org/dtds/simple-methods.xsd";>
-    <simple-method method-name="deleteRequirement" short-description="Delete a 
requirement">
+    <simple-method method-name="deleteRequirementAndRelated" 
short-description="Delete a requirement after deleting related entity records">
         <entity-one entity-name="Requirement" value-field="requirement" 
auto-field-map="true"/>
         <check-errors/>
         <remove-related value-field="requirement" 
relation-name="RequirementRole"/>

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml?rev=1831542&r1=1831541&r2=1831542&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/servicedef/services_requirement.xml
 Mon May 14 07:46:50 2018
@@ -38,9 +38,13 @@ under the License.
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="oldStatusId" type="String" mode="OUT" 
optional="true"/>
     </service>
-    <service name="deleteRequirement" engine="simple"
-            
location="component://order/minilang/requirement/RequirementServices.xml" 
invoke="deleteRequirement">
+    <service name="deleteRequirement" engine="entity-auto" 
default-entity-name="Requirement" auth="true" invoke="delete">
         <description>Delete a requirement</description>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+    </service>
+    <service name="deleteRequirementAndRelated" engine="simple"
+            
location="component://order/minilang/requirement/RequirementServices.xml" 
invoke="deleteRequirementAndRelated">
+        <description>Delete a requirement after deleting related entity 
records.</description>
         <attribute name="requirementId" type="String" mode="IN" 
optional="false"/>
     </service>
 

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=1831542&r1=1831541&r2=1831542&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
 Mon May 14 07:46:50 2018
@@ -1200,7 +1200,7 @@ under the License.
     </request-map>
     <request-map uri="deleteRequirement">
         <security https="true" auth="true"/>
-        <event type="service" invoke="deleteRequirement"/>
+        <event type="service" invoke="deleteRequirementAndRelated"/>
         <response name="success" type="view" value="FindRequirements"/>
     </request-map>
     <request-map uri="removeRequirementRole">


Reply via email to