Login  Register

Adding services to handle InventoryItemAttribute

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

Adding services to handle InventoryItemAttribute

Cimballi
51 posts
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