You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2016/01/23 00:01:09 UTC

svn commit: r1726338 - in /ofbiz/trunk/applications: marketing/servicedef/services_opportunity.xml order/script/org/ofbiz/order/opportunity/OpportunityServices.xml

Author: nmalin
Date: Fri Jan 22 23:01:08 2016
New Revision: 1726338

URL: http://svn.apache.org/viewvc?rev=1726338&view=rev
Log:
I converted crud services from simple to entity-auto for entities SalesOpportunity and SalesForecastDetail, related issue OFBIZ-6853

Modified:
    ofbiz/trunk/applications/marketing/servicedef/services_opportunity.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/opportunity/OpportunityServices.xml

Modified: ofbiz/trunk/applications/marketing/servicedef/services_opportunity.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services_opportunity.xml?rev=1726338&r1=1726337&r2=1726338&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services_opportunity.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services_opportunity.xml Fri Jan 22 23:01:08 2016
@@ -49,41 +49,34 @@ under the License.
     </service>
 
      <!-- Sales Forecast Detail -->
-    <service name="createSalesForecastDetail" engine="simple" auth="true" default-entity-name="SalesForecastDetail"
-            location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="createSalesForecastDetail">
+    <service name="createSalesForecastDetail" default-entity-name="SalesForecastDetail" engine="entity-auto" invoke="create" auth="true">
         <description>Creates a Sales Forecast Detail</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="salesForecastDetailId" mode="OUT"/>
     </service>
-    <service name="updateSalesForecastDetail" engine="simple" auth="true" default-entity-name="SalesForecastDetail"
-            location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="updateSalesForecastDetail">
+    <service name="updateSalesForecastDetail" default-entity-name="SalesForecastDetail" engine="entity-auto" invoke="update" auth="true">
         <description>Updates a Sales Forecast Detail</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="deleteSalesForecastDetail" engine="simple" default-entity-name="SalesForecastDetail"
-            location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="deleteSalesForecastDetail">
+    <service name="deleteSalesForecastDetail" default-entity-name="SalesForecastDetail" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete a Sales Forecast Detail</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
-    
-        <!-- opportunity service -->
-    <service name="createSalesOpportunity" engine="simple" default-entity-name="SalesOpportunity"
-        location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="createSalesOpportunity">
+
+    <!-- opportunity service -->
+    <service name="createSalesOpportunity" default-entity-name="SalesOpportunity" engine="entity-auto" invoke="create">
         <description>Create an sales opportunity</description>
         <auto-attributes mode="INOUT" include="pk" optional="true"/>
-        <auto-attributes mode="IN" include="nonpk" optional="true">
-            <exclude field-name="createdByUserLogin"/>
-        </auto-attributes>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <attribute name="accountPartyId" mode="IN" type="String" optional="true"/>
         <attribute name="leadPartyId" mode="IN" type="String" optional="true"/>
         <override name="opportunityName" allow-html="any"/>
         <override name="description" allow-html="any"/>
         <override name="nextStep" allow-html="any"/>
     </service>
-    <service name="updateSalesOpportunity" engine="simple" default-entity-name="SalesOpportunity"
-        location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="updateSalesOpportunity">
+    <service name="updateSalesOpportunity" default-entity-name="SalesOpportunity" engine="entity-auto" invoke="update">
         <description>Update an sales opportunity</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
@@ -93,10 +86,9 @@ under the License.
         <override name="description" allow-html="any"/>
         <override name="nextStep" allow-html="any"/>
     </service>
-    <service name="createSalesOpportunityRole" engine="simple" default-entity-name="SalesOpportunityRole" 
-        location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="createSalesOpportunityRole">
+    <service name="createSalesOpportunityRole" default-entity-name="SalesOpportunityRole" engine="entity-auto" invoke="create">
         <description>Create sales opportunity role</description>
-        <auto-attributes mode="INOUT" include="pk" optional="true"/>
+        <auto-attributes mode="IN" include="pk" optional="true"/>
     </service>
     <service name="createSalesOpportunityAccountRole" engine="simple" default-entity-name="SalesOpportunityRole" 
         location="component://order/script/org/ofbiz/order/opportunity/OpportunityServices.xml" invoke="createSalesOpportunityAccountRole">
@@ -118,5 +110,4 @@ under the License.
         <attribute name="partyId" mode="OUT" type="String" optional="true"/>
     </service>
 
-    
 </services>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/opportunity/OpportunityServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/opportunity/OpportunityServices.xml?rev=1726338&r1=1726337&r2=1726338&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/opportunity/OpportunityServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/opportunity/OpportunityServices.xml Fri Jan 22 23:01:08 2016
@@ -82,36 +82,6 @@ This file contains basic services for Sa
         <create-value value-field="salesForecastHistory"/>
     </simple-method>
 
-    <!-- Sales Forecast Detail -->
-    <simple-method method-name="createSalesForecastDetail" short-description="Creates a sales forecast detail">
-        <make-value entity-name="SalesForecastDetail" value-field="newEntity"/>
-        <sequenced-id sequence-name="SalesForecastDetail" field="newEntity.salesForecastDetailId"/>
-        <field-to-result field="newEntity.salesForecastDetailId" result-name="salesForecastDetailId"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-    <simple-method method-name="updateSalesForecastDetail" short-description="Updates a sales forecast detail">
-        <entity-one entity-name="SalesForecastDetail" value-field="lookedUpValue"/>
-        <set-nonpk-fields value-field="lookedUpValue" map="parameters"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-    <simple-method method-name="deleteSalesForecastDetail" short-description="Delete a Sales Forecast Detail">
-        <entity-one entity-name="SalesForecastDetail" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-    
-    <simple-method method-name="createSalesOpportunity" short-description="Create Sales Opportunity">
-        <make-value entity-name="SalesOpportunity" value-field="newEntity"/>
-        <if-empty field="parameters.salesOpportunityId">
-            <sequenced-id sequence-name="SalesOpportunity" field="parameters.salesOpportunityId"/>
-        </if-empty>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
-        <field-to-result field="parameters.salesOpportunityId" result-name="salesOpportunityId"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
     <simple-method method-name="updateSalesOpportunity" short-description="Update an Sales opportunity">
         <entity-one entity-name="SalesOpportunity" value-field="lookedUpValue"/>
         <if-compare field="parameters.opportunityStageId" operator="equals" value="SOSTG_CLOSED">
@@ -125,12 +95,6 @@ This file contains basic services for Sa
         <set-nonpk-fields value-field="lookedUpValue" map="parameters"/>
         <store-value value-field="lookedUpValue"/>
     </simple-method>
-    <simple-method method-name="createSalesOpportunityRole" short-description="Create Sales Opportunity Role">
-        <make-value value-field="newEntity" entity-name="SalesOpportunityRole"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
     <simple-method method-name="createSalesOpportunityAccountRole" short-description="Create Sales Opportunity Account Role">
         <entity-and list="salesOpportunityRoles" entity-name="SalesOpportunityRole">
             <field-map field-name="salesOpportunityId" from-field="parameters.salesOpportunityId"/>
@@ -177,5 +141,4 @@ This file contains basic services for Sa
         <first-from-list entry="lookedUpValue" list="salesOpportunityRoles"/>
         <field-to-result field="lookedUpValue.partyId" result-name="partyId"/>
     </simple-method>
-    
 </simple-methods>