Adding services to handle InventoryItemAttribute
Posted by Cimballi on
URL: http://ofbiz.116.s1.nabble.com/Adding-services-to-handle-InventoryItemAttribute-tp786479.html
Hi,
It seems there is no service to handle the entity
"InventoryItemAttribute" like there are for "ProductAttribute".
Here is the missing code :
applications/product/servicedef/services_facility.xml
<!-- InventoryItem Attribute Services -->
<service name="createInventoryItemAttribute"
default-entity-name="InventoryItemAttribute" engine="simple"
location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml"
invoke="createInventoryItemAttribute" auth="true">
<description>Create a InventoryItemAttribute</description>
<permission-service service-name="facilityGenericPermission"
main-action="CREATE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="updateInventoryItemAttribute"
default-entity-name="InventoryItemAttribute" engine="simple"
location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml"
invoke="updateInventoryItemAttribute" auth="true">
<description>Update a InventoryItemAttribute</description>
<permission-service service-name="facilityGenericPermission"
main-action="UPDATE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="deleteInventoryItemAttribute"
default-entity-name="InventoryItemAttribute" engine="simple"
location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml"
invoke="deleteInventoryItemAttribute" auth="true">
<description>Delete a InventoryItemAttribute</description>
<permission-service service-name="facilityGenericPermission"
main-action="DELETE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
<!-- InventoryItem Attribute Services -->
<simple-method method-name="createInventoryItemAttribute"
short-description="create a InventoryItemAttribute">
<make-value entity-name="InventoryItemAttribute"
value-field="newEntity"/>
<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="updateInventoryItemAttribute"
short-description="update a InventoryItemAttribute">
<entity-one entity-name="InventoryItemAttribute"
value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteInventoryItemAttribute"
short-description="delete a InventoryItemAttribute">
<entity-one entity-name="InventoryItemAttribute"
value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
I know it would be better with a test class and a patch. Maybe the
next time... :-)
Cimballi