===
Fixed: createProductFeature service ignoring passed productFeatureId parameter
(OFBIZ-10958)
In the change, used override tag instead of attribute.
And set the optional true in INOUT mode for productFeatureId.
But since we are using entity-auto productFeatureId will be always available (either user provide it and if not passed by the user, system will autogenerate it), thus it will be always OUT.
Additional Notes:
Here we can't make a changes mentioned below, because, for *optional* field's value, invokeCreate method (internally calling isIn and IsOut methods of ModelParam) of EntityAutoEngine.java consider the attribute (override) defined at last for parameters with the same name.
i.e. for below example, optional value for productFeatureId for mode IN will be false (but it is defined true)
{code}
<override name=productFeatureId type=String mode=IN optional=true/>
<override name=productFeatureId type=String mode=OUT optional=false/>
{code}
Due to this, isSinglePkIn (in invokeCreate method) field got false value, and the system will auto-generate the productFeatureId and ignore the user's input.
Similarly, we can't write in this way
{code}
<override name=productFeatureId type=String mode=OUT optional=false/>
<override name=productFeatureId type=String mode=IN optional=true/>
{code}
Because in this case, isSinglePkOut (in invokeCreate method) field got false value, and again the system will auto-generate the productFeatureId and ignore the user's input.
Thanks: Ulrich Heidfeld for reporting the issue and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1858320 13f79535-47bb-0310-9956-ffa450edef68
282 lines
19 KiB
XML
282 lines
19 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
|
|
<description>Product Component Services</description>
|
|
<vendor>OFBiz</vendor>
|
|
<version>1.0</version>
|
|
|
|
<!-- Product Feature Services -->
|
|
<service name="createProductFeatureCategory" engine="entity-auto" invoke="create" default-entity-name="ProductFeatureCategory" auth="true">
|
|
<description>Create a ProductFeatureCategory record</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="OUT" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="description" optional="false"/>
|
|
</service>
|
|
<service name="updateProductFeatureCategory" engine="entity-auto" invoke="update" default-entity-name="ProductFeatureCategory" auth="true">
|
|
<description>Update a ProductFeatureCategory record</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="description" optional="false"/>
|
|
</service>
|
|
|
|
<service name="createProductFeature" engine="entity-auto" invoke="create" default-entity-name="ProductFeature" auth="true">
|
|
<description>Create a ProductFeature record</description>
|
|
<auto-attributes include="all" mode="IN" optional="true"/>
|
|
<override name="productFeatureId" type="String" mode="INOUT" optional="true"/>
|
|
<override name="productFeatureTypeId" mode="IN" optional="false"/>
|
|
<override name="description" mode="IN" optional="false"/>
|
|
</service>
|
|
<service name="updateProductFeature" engine="entity-auto" invoke="update" default-entity-name="ProductFeature" auth="true">
|
|
<description>Update a ProductFeature record</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="productFeatureTypeId" mode="IN" optional="false"/>
|
|
<override name="description" mode="IN" optional="false"/>
|
|
</service>
|
|
|
|
<service name="applyFeatureToProduct" engine="entity-auto" invoke="create" default-entity-name="ProductFeatureAppl" auth="true">
|
|
<description>Apply a ProductFeature to a Product; a fromDate can be used
|
|
to specify when the feature will be applied, if no fromDate is specified,
|
|
it will be applied now.</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="productFeatureApplTypeId" mode="IN" optional="false"/>
|
|
<override name="fromDate" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="updateFeatureToProductApplication" engine="entity-auto" invoke="update" default-entity-name="ProductFeatureAppl" auth="true">
|
|
<description>Update a ProductFeature to Product Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="productFeatureApplTypeId" mode="IN" optional="false"/>
|
|
</service>
|
|
<service name="removeFeatureFromProduct" engine="entity-auto" invoke="delete" default-entity-name="ProductFeatureAppl" auth="true">
|
|
<description>Remove a ProductFeature from a Product</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
<service name="applyFeatureToProductFromTypeAndCode" engine="simple"
|
|
location="component://product/minilang/product/feature/ProductFeatureServices.xml" invoke="applyFeatureToProductFromTypeAndCode" auth="true">
|
|
<description>Apply a ProductFeature to a Product</description>
|
|
<attribute name="productId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="productFeatureTypeId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="idCode" type="String" mode="IN" optional="false"/>
|
|
<attribute name="productFeatureApplTypeId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="fromDate" type="java.sql.Timestamp" mode="IN" optional="true"/>
|
|
<attribute name="thruDate" type="java.sql.Timestamp" mode="IN" optional="true"/>
|
|
<attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
|
|
</service>
|
|
|
|
<!-- ProductFeatureCategoryAppl Services -->
|
|
<service name="createProductFeatureCategoryAppl" default-entity-name="ProductFeatureCategoryAppl" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureCategory to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="fromDate" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureCategoryAppl" default-entity-name="ProductFeatureCategoryAppl" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureCategory to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="removeProductFeatureCategoryAppl" default-entity-name="ProductFeatureCategoryAppl" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureCategory to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
|
|
<!-- ProductFeatureCatGrpAppl Services -->
|
|
<service name="createProductFeatureCatGrpAppl" default-entity-name="ProductFeatureCatGrpAppl" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureGroup to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="fromDate" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureCatGrpAppl" default-entity-name="ProductFeatureCatGrpAppl" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureGroup to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="removeProductFeatureCatGrpAppl" default-entity-name="ProductFeatureCatGrpAppl" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureGroup to ProductCategory Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
|
|
<!-- ProductFeatureGroup Services -->
|
|
<service name="createProductFeatureGroup" default-entity-name="ProductFeatureGroup" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureGroup</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<attribute name="description" type="String" mode="IN" optional="true"/>
|
|
<attribute name="productFeatureGroupId" type="String" mode="OUT" optional="false"/>
|
|
</service>
|
|
<service name="updateProductFeatureGroup" default-entity-name="ProductFeatureGroup" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Create a ProductFeatureGroup</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<attribute name="productFeatureGroupId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="description" type="String" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="createProductFeatureGroupAppl" default-entity-name="ProductFeatureGroupAppl" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureGroup to ProductFeature Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="fromDate" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureGroupAppl" default-entity-name="ProductFeatureGroupAppl" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureGroup to ProductFeature Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="removeProductFeatureGroupAppl" default-entity-name="ProductFeatureGroupAppl" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureGroup to ProductFeature Application</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<attribute name="productFeatureGroupId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="productFeatureId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="fromDate" type="java.sql.Timestamp" mode="IN" optional="false"/>
|
|
</service>
|
|
<!-- ProductFeatureIactn Services -->
|
|
<service name="createProductFeatureIactn" default-entity-name="ProductFeatureIactn" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureIactn</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="productFeatureIactnTypeId" mode="IN" optional="false"/>
|
|
</service>
|
|
<service name="removeProductFeatureIactn" default-entity-name="ProductFeatureIactn" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureIactn</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
<!-- ProductFeatureType Services -->
|
|
<service name="createProductFeatureType" default-entity-name="ProductFeatureType" engine="simple"
|
|
location="component://product/minilang/product/feature/ProductFeatureServices.xml" invoke="createProductFeatureType" auth="true">
|
|
<description>Create a ProductFeatureType</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="productFeatureTypeId" mode="INOUT" optional="true" />
|
|
</service>
|
|
<service name="updateProductFeatureType" default-entity-name="ProductFeatureType" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureType</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="removeProductFeatureType" default-entity-name="ProductFeatureType" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureType</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
<!-- ProductFeatureApplAttr -->
|
|
<service name="createProductFeatureApplAttr" default-entity-name="ProductFeatureApplAttr" engine="simple"
|
|
location="component://product/minilang/product/feature/ProductFeatureServices.xml" invoke="createProductFeatureApplAttr" auth="true">
|
|
<description>Create a ProductFeatureApplAttr</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<override name="fromDate" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureApplAttr" default-entity-name="ProductFeatureApplAttr" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureApplAttr</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="removeProductFeatureApplAttr" default-entity-name="ProductFeatureApplAttr" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Remove a ProductFeatureApplAttr</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
<!-- Feature Price Service -->
|
|
<service name="createFeaturePrice" default-entity-name="ProductFeaturePrice" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a Feature Price</description>
|
|
<permission-service service-name="productGenericPermission" main-action="CREATE"/>
|
|
<auto-attributes mode="IN" include="pk" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true">
|
|
<exclude field-name="createdDate"/>
|
|
<exclude field-name="createdByUserLogin"/>
|
|
<exclude field-name="lastModifiedDate"/>
|
|
<exclude field-name="lastModifiedByUserLogin"/>
|
|
</auto-attributes>
|
|
<override name="productFeatureId" mode="IN" optional="true"/>
|
|
<override name="fromDate" mode="INOUT" optional="true"/>
|
|
<override name="price" optional="false"/>
|
|
</service>
|
|
<service name="updateFeaturePrice" default-entity-name="ProductFeaturePrice" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a Feature Price</description>
|
|
<permission-service service-name="productGenericPermission" main-action="UPDATE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true">
|
|
<exclude field-name="createdDate"/>
|
|
<exclude field-name="createdByUserLogin"/>
|
|
<exclude field-name="lastModifiedDate"/>
|
|
<exclude field-name="lastModifiedByUserLogin"/>
|
|
</auto-attributes>
|
|
<override name="price" optional="false"/>
|
|
</service>
|
|
<service name="deleteFeaturePrice" default-entity-name="ProductFeaturePrice" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Delete a Feature Price</description>
|
|
<permission-service service-name="productGenericPermission" main-action="DELETE"/>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
|
|
<!-- ProductFeatureApplType services -->
|
|
<service name="createProductFeatureApplType" default-entity-name="ProductFeatureApplType" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureApplType</description>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<auto-attributes include="pk" mode="INOUT" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureApplType" default-entity-name="ProductFeatureApplType" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureApplType</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="deleteProductFeatureApplType" default-entity-name="ProductFeatureApplType" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Delete a ProductFeatureApplType</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
|
|
<!-- ProductFeatureIactnType services -->
|
|
<service name="createProductFeatureIactnType" default-entity-name="ProductFeatureIactnType" engine="entity-auto" invoke="create" auth="true">
|
|
<description>Create a ProductFeatureIactnType</description>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
<auto-attributes include="pk" mode="INOUT" optional="true"/>
|
|
</service>
|
|
<service name="updateProductFeatureIactnType" default-entity-name="ProductFeatureIactnType" engine="entity-auto" invoke="update" auth="true">
|
|
<description>Update a ProductFeatureIactnType</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
|
</service>
|
|
<service name="deleteProductFeatureIactnType" default-entity-name="ProductFeatureIactnType" engine="entity-auto" invoke="delete" auth="true">
|
|
<description>Delete a ProductFeatureIactnType</description>
|
|
<auto-attributes include="pk" mode="IN" optional="false"/>
|
|
</service>
|
|
</services>
|