blob: 794fb821202db383192188fee7c6ae5eac4a47d5 [file] [log] [blame]
<?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.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods-v2.xsd">
<simple-method method-name="createProductFeatureCategory" short-description="Create Product Feature Category">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value entity-name="ProductFeatureCategory" value-field="newEntity"/>
<set-nonpk-fields value-field="newEntity" map="parameters"/>
<sequenced-id sequence-name="ProductFeatureCategory" field="newEntity.productFeatureCategoryId"/>
<field-to-result field="newEntity.productFeatureCategoryId" result-name="productFeatureCategoryId"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureCategory" short-description="Update Product Feature Category">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<entity-one entity-name="ProductFeatureCategory" value-field="productFeatureCategory"/>
<set-nonpk-fields value-field="productFeatureCategory" map="parameters"/>
<store-value value-field="productFeatureCategory"/>
</simple-method>
<simple-method method-name="createProductFeature" short-description="Create Product Feature">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeature"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<if-empty field="parameters.productFeatureId">
<sequenced-id sequence-name="ProductFeature" field="newEntity.productFeatureId"/>
<else>
<set field="newEntity.productFeatureId" from-field="parameters.productFeatureId"/>
</else>
</if-empty>
<field-to-result field="newEntity.productFeatureId" result-name="productFeatureId"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeature" short-description="Update Product Feature">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<entity-one entity-name="ProductFeature" value-field="productFeature"/>
<set-nonpk-fields map="parameters" value-field="productFeature"/>
<store-value value-field="productFeature"/>
</simple-method>
<simple-method method-name="applyFeatureToProduct" short-description="Apply Feature to Product">
<set field="callingMethodName" value="applyFeatureToProduct"/>
<set field="checkAction" value="CREATE"/>
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/product/ProductServices.xml"/>
<check-errors/>
<if-empty field="parameters.fromDate">
<now-timestamp field="parameters.fromDate"/>
</if-empty>
<make-value value-field="newEntity" entity-name="ProductFeatureAppl"/>
<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="updateFeatureToProductApplication" short-description="Update Feature to Product Application">
<set field="callingMethodName" value="updateFeatureToProductApplication"/>
<set field="checkAction" value="UPDATE"/>
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/product/ProductServices.xml"/>
<check-errors/>
<entity-one entity-name="ProductFeatureAppl" value-field="productFeatureAppl"/>
<set-nonpk-fields map="parameters" value-field="productFeatureAppl"/>
<store-value value-field="productFeatureAppl"/>
</simple-method>
<simple-method method-name="removeFeatureFromProduct" short-description="Remove Feature from Product">
<set field="callingMethodName" value="removeFeatureFromProduct"/>
<set field="checkAction" value="DELETE"/>
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/product/ProductServices.xml"/>
<check-errors/>
<entity-one entity-name="ProductFeatureAppl" value-field="productFeatureAppl"/>
<!-- This is old code that just sets the thru date; the current codes actually removes the db row
<if-empty field="parameters.thruDate">
<now-timestamp field="nowStamp"/>
<env-to-field env-name="nowStamp" field-name="thruDate" map-name="parameters"/>
</if-empty>
<field-to-field field-name="thruDate" map-name="parameters" to-map-name="productFeatureAppl"/>
<store-value value-field="productFeatureAppl"/>
-->
<remove-value value-field="productFeatureAppl"/>
</simple-method>
<simple-method method-name="applyFeatureToProductFromTypeAndCode" short-description="Apply Feature to Product using Feature Type and ID Code">
<set field="callingMethodName" value="applyFeatureToProductFromTypeAndCode"/>
<set field="checkAction" value="CREATE"/>
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/product/ProductServices.xml"/>
<check-errors/>
<!-- find the ProductFeatures by type and id code -->
<entity-and entity-name="ProductFeature" list="productFeatures">
<field-map field-name="productFeatureTypeId" from-field="parameters.productFeatureTypeId"/>
<field-map field-name="idCode" from-field="parameters.idCode"/>
</entity-and>
<iterate entry="productFeature" list="productFeatures">
<set-service-fields service-name="applyFeatureToProduct" map="parameters" to-map="applyFeatureContext"/>
<set field="applyFeatureContext.productFeatureId" from-field="productFeature.productFeatureId"/>
<if-empty field="applyFeatureContext.sequenceNum">
<set field="applyFeatureContext.sequenceNum" from-field="productFeature.defaultSequenceNum"/>
</if-empty>
<call-service service-name="applyFeatureToProduct" in-map-name="applyFeatureContext"/>
</iterate>
</simple-method>
<!-- Methods for ProductFeatureCategoryAppl -->
<simple-method method-name="createProductFeatureCategoryAppl" short-description="Create an Product Feature Category Application">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureCategoryAppl"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="newEntity.fromDate"/>
</if-empty>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureCategoryAppl" short-description="Update an Product Feature Category Application">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureCategoryAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeProductFeatureCategoryAppl" short-description="Remove a Product Feature Category Application">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureCategoryAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- Methods for ProductFeatureCatGrpAppl -->
<simple-method method-name="createProductFeatureCatGrpAppl" short-description="Create a ProductFeatureGroup to ProductCategory Application">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureCatGrpAppl"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="newEntity.fromDate"/>
</if-empty>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureCatGrpAppl" short-description="Update a ProductFeatureGroup to ProductCategory Application">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureCatGrpAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeProductFeatureCatGrpAppl" short-description="Remove a ProductFeatureGroup to ProductCategory Application">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureCatGrpAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- ProductFeatureGroup Services -->
<simple-method method-name="createProductFeatureGroup" short-description="Create Product Feature Group">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureGroup"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<sequenced-id sequence-name="ProductFeatureGroup" field="newEntity.productFeatureGroupId"/>
<field-to-result field="newEntity.productFeatureGroupId" result-name="productFeatureGroupId"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureGroup" short-description="Update Product Feature Group">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<entity-one entity-name="ProductFeatureGroup" value-field="productFeatureGroup"/>
<set-nonpk-fields map="parameters" value-field="productFeatureGroup"/>
<store-value value-field="productFeatureGroup"/>
</simple-method>
<simple-method method-name="createProductFeatureGroupAppl" short-description="Create an Product Feature Group Application">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureGroupAppl"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="newEntity.fromDate"/>
</if-empty>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureGroupAppl" short-description="Update an Product Feature Group Application">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureGroupAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key entity-name="ProductFeatureGroupAppl" map="lookupKeyValue" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeProductFeatureGroupAppl" short-description="Remove a Product Feature Group Application">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureGroupAppl"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key entity-name="ProductFeatureGroupAppl" map="lookupKeyValue" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- Methods for ProductFeatureIactn -->
<simple-method method-name="createProductFeatureIactn" short-description="Create a Product Feature Interaction">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureIactn"/>
<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="removeProductFeatureIactn" short-description="Remove a Product Feature Interaction">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureIactn"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- Methods for ProductFeatureType -->
<simple-method method-name="createProductFeatureType" short-description="Create a Product Feature Type">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<if>
<condition>
<if-empty field="parameters.productFeatureTypeId" />
</condition>
<then>
<sequenced-id sequence-name="ProductFeatureType" field="parameters.productFeatureTypeId"/>
</then>
</if>
<check-errors/>
<if>
<condition>
<not>
<if-regexp field="parameters.productFeatureTypeId" expr="^[a-zA-Z_0-9]+$"></if-regexp>
</not>
</condition>
<then>
<add-error>
<fail-property resource="ProductErrorUiLabels" property="ProductFeatureTypeIdMustContainsLettersAndDigits"/>
</add-error>
</then>
</if>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureType"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateProductFeatureType" short-description="Update an Product Feature Type">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureType"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeProductFeatureType" short-description="Remove a Product Feature Type">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="lookupKeyValue" entity-name="ProductFeatureType"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key map="lookupKeyValue" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- create a new ProductFeatureApplAttr -->
<simple-method method-name="createProductFeatureApplAttr" short-description="Create a ProductFeatureApplAttr">
<check-permission permission="CATALOG" action="_CREATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
</check-permission>
<check-errors/>
<make-value value-field="newEntity" entity-name="ProductFeatureApplAttr"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<entity-condition entity-name="ProductFeatureAppl" list="productFeatureAppls" filter-by-date="true">
<condition-list combine="and">
<condition-expr field-name="productId" from-field="newEntity.productId"/>
<condition-expr field-name="productFeatureId" from-field="newEntity.productFeatureId"/>
</condition-list>
<order-by field-name="-fromDate"/>
</entity-condition>
<first-from-list list="productFeatureAppls" entry="productFeatureAppl"/>
<set field="newEntity.fromDate" from-field="productFeatureAppl.fromDate"/>
</if-empty>
<create-value value-field="newEntity"/>
<check-errors/>
</simple-method>
<!-- update an existing ProductFeatureApplAttr -->
<simple-method method-name="updateProductFeatureApplAttr" short-description="Update an existing ProductFeatureApplAttr">
<check-permission permission="CATALOG" action="_UPDATE">
<fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/>
</check-permission>
<check-errors/>
<entity-one entity-name="ProductFeatureApplAttr" value-field="productFeatureApplAttr" auto-field-map="true"/>
<check-errors/>
<set-nonpk-fields map="parameters" value-field="productFeatureApplAttr"/>
<store-value value-field="productFeatureApplAttr"/>
<check-errors/>
</simple-method>
<!-- remove an existing ProductFeatureApplAttr -->
<simple-method method-name="removeProductFeatureApplAttr" short-description="Remove an existing ProductFeatureApplAttr">
<check-permission permission="CATALOG" action="_DELETE">
<fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
</check-permission>
<check-errors/>
<entity-one entity-name="ProductFeatureApplAttr" value-field="productFeatureApplAttr" auto-field-map="true"/>
<check-errors/>
<remove-value value-field="productFeatureApplAttr"/>
<check-errors/>
</simple-method>
<!-- Feature Price Service -->
<simple-method method-name="createFeaturePrice" short-description="Create a Feature Price">
<make-value value-field="newEntity" entity-name="ProductFeaturePrice"/>
<if-empty field="parameters.productFeatureId">
<sequenced-id sequence-name="ProductFeaturePrice" field="parameters.productFeatureId"/>
</if-empty>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<now-timestamp field="nowTimestamp"/>
<if-empty field="newEntity.fromDate">
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
<field-to-result field="newEntity.fromDate" result-name="fromDate"/>
<set field="newEntity.lastModifiedDate" from-field="nowTimestamp"/>
<set field="newEntity.createdDate" from-field="nowTimestamp"/>
<set field="newEntity.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/>
<set field="newEntity.createdByUserLogin" from-field="userLogin.userLoginId"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateFeaturePrice" short-description="Update a feature price">
<entity-one entity-name="ProductFeaturePrice" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<now-timestamp field="nowTimestamp"/>
<set field="lookedUpValue.lastModifiedDate" from-field="nowTimestamp"/>
<set field="lookedUpValue.lastModifiedByUserLogin" from-field="userLogin.userLoginId"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteFeaturePrice" short-description="Delete a feature price">
<make-value entity-name="ProductFeaturePrice" value-field="lookupPKMap"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="ProductFeaturePrice" map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
</simple-methods>