svn commit: r636315 - in /ofbiz/trunk/applications/product: script/org/ofbiz/product/catalog/CatalogServices.xml servicedef/services.xml

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

svn commit: r636315 - in /ofbiz/trunk/applications/product: script/org/ofbiz/product/catalog/CatalogServices.xml servicedef/services.xml

bibryam
Author: bibryam
Date: Wed Mar 12 06:26:12 2008
New Revision: 636315

URL: http://svn.apache.org/viewvc?rev=636315&view=rev
Log:
Fixed createProdCatalog service: If prodCatalogId is not entered, the service should create one.

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
    ofbiz/trunk/applications/product/servicedef/services.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml?rev=636315&r1=636314&r2=636315&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml Wed Mar 12 06:26:12 2008
@@ -23,8 +23,17 @@
     <simple-method method-name="createProdCatalog" short-description="Create an ProdCatalog">
         <make-value value-name="newEntity" entity-name="ProdCatalog"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
-        <set-pk-fields map-name="parameters" value-name="newEntity"/>
         
+        <if-empty field-name="parameters.prodCatalogId">
+            <sequenced-id-to-env sequence-name="ProdCatalog" env-name="newEntity.prodCatalogId"/>
+        <else>
+            <set field="newEntity.prodCatalogId" from-field="parameters.prodCatalogId"/>
+            <check-id field-name="newEntity.prodCatalogId"/>
+            <check-errors/>
+        </else>
+        </if-empty>
+        <field-to-result field-name="newEntity.prodCatalogId" result-name="prodCatalogId"/>
+              
         <create-value value-name="newEntity"/>
     </simple-method>
     <simple-method method-name="updateProdCatalog" short-description="Update an ProdCatalog">

Modified: ofbiz/trunk/applications/product/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=636315&r1=636314&r2=636315&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services.xml Wed Mar 12 06:26:12 2008
@@ -551,7 +551,7 @@
                 location="org/ofbiz/product/catalog/CatalogServices.xml" invoke="createProdCatalog" auth="true">
         <description>Create a ProdCatalog</description>
         <permission-service service-name="catalogPermissionCheck" main-action="CREATE"/>
-        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="catalogName" optional="false"/>
     </service>