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

svn commit: r1762996 - in /ofbiz/trunk/applications/content: minilang/data/DataServices.xml servicedef/services.xml

Author: jleroux
Date: Sat Oct  1 10:12:55 2016
New Revision: 1762996

URL: http://svn.apache.org/viewvc?rev=1762996&view=rev
Log:
Fixes: Error : Column 'DATA_CATEGORY_ID' cannot accept a NULL value
(OFBIZ-8282)

Steps to regenerate :
1) Login into webtools component.
2) Run "createDataCategory" service without passing any parameter.
3) Following error message occured : (Column 'DATA_CATEGORY_ID' cannot accept 
a NULL value) PFA attached screenshot.

In this patch I have changed service engine to "entity-auto" and removed 
service implementation.

Thanks: Pawan Verma

Modified:
    ofbiz/trunk/applications/content/minilang/data/DataServices.xml
    ofbiz/trunk/applications/content/servicedef/services.xml

Modified: ofbiz/trunk/applications/content/minilang/data/DataServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/minilang/data/DataServices.xml?rev=1762996&r1=1762995&r2=1762996&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/minilang/data/DataServices.xml (original)
+++ ofbiz/trunk/applications/content/minilang/data/DataServices.xml Sat Oct  1 10:12:55 2016
@@ -119,13 +119,6 @@ under the License.
     </simple-method>
 
   <!-- Methods for DataCategory -->
-    <simple-method method-name="createDataCategory" short-description="Create Data Category">
-        <make-value entity-name="DataCategory" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-        <field-to-result result-name="dataCategoryId" field="newEntity.dataCategoryId"/>
-    </simple-method>
     <simple-method method-name="updateDataCategory" short-description="Update Data Category">
         <make-value entity-name="DataCategory" value-field="lookupKeyValue"/>
         <set-pk-fields map="parameters" value-field="lookupKeyValue"/>

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=1762996&r1=1762995&r2=1762996&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Sat Oct  1 10:12:55 2016
@@ -80,11 +80,10 @@
     </service>
 
     <!-- DataCategory services -->
-    <service name="createDataCategory" engine="simple" default-entity-name="DataCategory" auth="true"
-            location="component://content/minilang/data/DataServices.xml" invoke="createDataCategory">
+    <service name="createDataCategory" engine="entity-auto" default-entity-name="DataCategory" auth="true" invoke="create">
         <description>Create a DataCategory</description>
         <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
-        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateDataCategory" engine="simple" default-entity-name="DataCategory" auth="true"