blob: cb866e25e5ae3e834f567b990887d9176cebd59b [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="prepareProductDimensionData" short-description="">
<entity-one entity-name="Product" value-field="product"/>
<if-empty field="product">
<add-error>
<fail-property resource="ProductUiLabels" property="ProductProductNotFoundWithProduct"/>
</add-error>
</if-empty>
<check-errors/>
<make-value value-field="productDimension" entity-name="ProductDimension"/>
<set-nonpk-fields map="product" value-field="productDimension"/>
<get-related-one value-field="product" relation-name="ProductType" to-value-field="productType"/>
<set field="productDimension.productType" from-field="productType.description"/>
<field-to-result field="productDimension"/>
</simple-method>
<simple-method method-name="loadProductInProductDimension" short-description="">
<set-service-fields service-name="prepareProductDimensionData" map="parameters" to-map="inMap"/>
<call-service service-name="prepareProductDimensionData" in-map-name="inMap">
<result-to-field result-name="productDimension"/>
</call-service>
<clear-field field="inMap"/>
<set-service-fields service-name="storeGenericDimension" map="parameters" to-map="inMap"/>
<set field="inMap.naturalKeyFields[]" value="productId"/>
<set field="inMap.dimensionValue" from-field="productDimension"/>
<call-service service-name="storeGenericDimension" in-map-name="inMap"/>
</simple-method>
<simple-method method-name="loadAllProductsInProductDimension" short-description="">
<entity-condition entity-name="Product" list="products"/>
<iterate list="products" entry="product">
<set-service-fields service-name="loadProductInProductDimension" map="parameters" to-map="inMap"/>
<set field="inMap.productId" from-field="product.productId"/>
<call-service service-name="loadProductInProductDimension" in-map-name="inMap"/>
<clear-field field="inMap"/>
</iterate>
</simple-method>
</simple-methods>