svn commit: r1643579 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/budget/BudgetServices.xml servicedef/services_budget.xml

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

svn commit: r1643579 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/budget/BudgetServices.xml servicedef/services_budget.xml

nmalin
Author: nmalin
Date: Sat Dec  6 18:12:21 2014
New Revision: 1643579

URL: http://svn.apache.org/r1643579
Log:


I converted the Crud service from simple to entity-auto for :

    Budget (except create)
    BudgetItem
    BudgetRole (except create)
    BudgetReview

Issue Associate OFBIZ-5900

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_budget.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml?rev=1643579&r1=1643578&r2=1643579&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml Sat Dec  6 18:12:21 2014
@@ -32,23 +32,12 @@ under the License.
 
         <!-- finally create the record (should not exist already)-->
         <create-value value-field="newEntity"/>
-        
         <set field="setStatus.budgetId" from-field="newEntity.budgetId"/>
         <set field="setStatus.statusId" value="BG_CREATED"/>
         <call-service service-name="updateBudgetStatus" in-map-name="setStatus"/>
         <field-to-result field="newEntity.budgetId" result-name="budgetId"/>
     </simple-method>
-    
-    <!-- update an existing Budget header Record -->
-    <simple-method method-name="updateBudget" short-description="Update an existing Budget">
-        <entity-one entity-name="Budget" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <set-pk-fields value-field="lookedUpValue" map="parameters"/>
-        <store-value value-field="lookedUpValue"/>
-        
-        <field-to-result field="parameters.budgetId" result-name="budgetId"/>
-    </simple-method>
-    
+
     <!-- update Budget Status -->
     <simple-method method-name="updateBudgetStatus" short-description="Update Budget Status">
         <now-timestamp field="nowDate"/>
@@ -78,75 +67,20 @@ under the License.
             </else>
         </if-not-empty>
     </simple-method>
-    
-    <simple-method method-name="createBudgetItem" short-description="Create a new Budget Item">
-        <set field="budgetId" from-field="parameters.budgetId"/>
-        <make-value value-field="newEntity" entity-name="BudgetItem"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <if-empty field="newEntity.budgetItemSeqId">
-            <make-next-seq-id value-field="newEntity" seq-field-name="budgetItemSeqId"/>
-        </if-empty>
-        <create-value value-field="newEntity"/>
-        <field-to-result field="budgetId"/>
-    </simple-method>
-    
-    <simple-method method-name="updateBudgetItem"
-        short-description="Update an existing Budget Item">
-        <make-value value-field="lookedUpValue" entity-name="BudgetItem"/>
-        <set-pk-fields map="parameters" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
 
-        <store-value value-field="lookedUpValue"/>
-        <field-to-result field="lookedUpValue.budgetItemSeqId" result-name="budgetItemSeqId"/>
-        <field-to-result field="lookedUpValue.budgetId" result-name="budgetId"/>
-    </simple-method>
-    
-    <simple-method method-name="removeBudgetItem" short-description="Remove an existing Budget Item">
-        <entity-one entity-name="BudgetItem" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-    
     <simple-method method-name="createBudgetRole" short-description="Create a Budget Role">
-        <entity-one value-field="partyRole" entity-name="PartyRole">
-            <field-map field-name="partyId" from-field="parameters.partyId"/>
-            <field-map field-name="roleTypeId" from-field="parameters.roleTypeId"/>
-        </entity-one>
+        <entity-one value-field="partyRole" entity-name="PartyRole"/>
         <if-empty field="partyRole">
             <set field="createPartyRole.partyId" from-field="parameters.partyId"/>
             <set field="createPartyRole.roleTypeId" from-field="parameters.roleTypeId"/>
             <call-service service-name="createPartyRole" in-map-name="createPartyRole"/>
             <check-errors/>
         </if-empty>
-        
         <make-value value-field="newEntity" entity-name="BudgetRole"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <create-value value-field="newEntity"/>
-        <field-to-result field="parameters.budgetId" result-name="budgetId"/>
     </simple-method>
 
-    <simple-method method-name="removeBudgetRole" short-description="Remove existing Budget Role">
-        <entity-one entity-name="BudgetRole" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-        <field-to-result field="parameters.budgetId" result-name="budgetId"/>
-    </simple-method>
-    
-    <simple-method method-name="createBudgetReview" short-description="Create a Budget Review">
-        <make-value value-field="newEntity" entity-name="BudgetReview"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <if-empty field="newEntity.budgetReviewId">
-            <make-next-seq-id value-field="newEntity" seq-field-name="budgetReviewId"/>
-        </if-empty>
-        <create-value value-field="newEntity"/>
-        <field-to-result field="parameters.budgetId" result-name="budgetId"/>
-    </simple-method>
-    
-    <simple-method method-name="removeBudgetReview" short-description="Remove existing Budget Review">
-        <entity-one entity-name="BudgetReview" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-        <field-to-result field="parameters.budgetId" result-name="budgetId"/>
-    </simple-method>
 </simple-methods>
 

Modified: ofbiz/trunk/applications/accounting/servicedef/services_budget.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_budget.xml?rev=1643579&r1=1643578&r2=1643579&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_budget.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_budget.xml Sat Dec  6 18:12:21 2014
@@ -20,8 +20,8 @@ under the License.
 
 <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
-    <description>Accounting Services: Fixed Asset </description>
-    <vendor>OFBiz</vendor>
+    <description>Accounting Services: Budget</description>
+    <vendor>Apache OFBiz</vendor>
     <version>1.0</version>
 
     <!-- Budget  -->
@@ -31,65 +31,54 @@ under the License.
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="updateBudget" default-entity-name="Budget" engine="simple"
-                location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="updateBudget" auth="true">
+    <service name="updateBudget" default-entity-name="Budget" engine="entity-auto" invoke="update" auth="true">
         <description>Update a Budget</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
-        <attribute name="budgetId" mode="OUT" type="String" optional="false"></attribute>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <service name="updateBudgetStatus" default-entity-name="BudgetStatus" engine="simple"
                 location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="updateBudgetStatus">
         <description>Update a Budget</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="createBudgetItem" default-entity-name="BudgetItem" engine="simple"
-                location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="createBudgetItem">
+
+    <service name="createBudgetItem" default-entity-name="BudgetItem" engine="entity-auto" invoke="create" auth="true">
         <description>Create a Budget Item</description>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <attribute name="budgetId" mode="INOUT" type="String" optional="false"></attribute>
+        <attribute name="budgetId" mode="IN" type="String" optional="false"/>
+        <attribute name="budgetItemSeqId" mode="OUT" type="String" optional="false"/>
     </service>
-    <service name="updateBudgetItem" default-entity-name="BudgetItem" engine="simple"
-                location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="updateBudgetItem">
+    <service name="updateBudgetItem" default-entity-name="BudgetItem" engine="entity-auto" invoke="update" auth="true">
         <description>Update a Budget Item</description>
-        <auto-attributes include="pk" mode="INOUT" optional="false"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="removeBudgetItem" engine="simple" default-entity-name="BudgetItem"
-        location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="removeBudgetItem">
+    <service name="removeBudgetItem" default-entity-name="BudgetItem" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove an existing Budget Item Record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
-    
-    <service name="createBudgetRole" engine="simple" default-entity-name="BudgetRole"
+
+    <service name="createBudgetRole" default-entity-name="BudgetRole" engine="simple"
         location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="createBudgetRole">
         <description>Create a new Budget Role Record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
-        <attribute name="budgetId" mode="OUT" type="String" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    
-    <service name="removeBudgetRole" engine="simple" default-entity-name="BudgetRole"
-        location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="removeBudgetRole">
+    <service name="removeBudgetRole" default-entity-name="BudgetRole" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove an existing Budget Role Record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
-        <attribute name="budgetId" mode="OUT" type="String" optional="false"/>
     </service>
-    
-    <service name="createBudgetReview" engine="simple" default-entity-name="BudgetReview"
-        location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="createBudgetReview">
+
+    <service name="createBudgetReview" default-entity-name="BudgetReview" engine="entity-auto" invoke="create" auth="true">
         <description>Create a new Budget Review Record</description>
-        <attribute name="budgetId" mode="INOUT" type="String" optional="false"/>
-        <attribute name="partyId" mode="IN" type="String" optional="false"/>
-        <attribute name="budgetReviewResultTypeId" mode="IN" type="String" optional="false"/>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <override name="budgetReviewId" mode="OUT" type="String" optional="false"/>
     </service>
-    
-    <service name="removeBudgetReview" engine="simple" default-entity-name="BudgetReview"
-        location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="removeBudgetReview">
+    <service name="removeBudgetReview" default-entity-name="BudgetReview" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove an existing Budget Review Record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
-        <attribute name="budgetId" mode="OUT" type="String" optional="false"/>
     </service>
 </services>