[OFBiz] SVN: r5901 - in trunk/applications:
accounting/script/org/ofbiz/accounting/fixedasset
accounting/script/org/ofbiz/accounting/payment
order/script/org/ofbiz/order/shoppinglist
jonesde at svn.ofbiz.org
jonesde at svn.ofbiz.org
Mon Oct 3 01:15:16 EDT 2005
Author: jonesde
Date: 2005-10-03 00:15:08 -0500 (Mon, 03 Oct 2005)
New Revision: 5901
Modified:
trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
Log:
More simple-method cleanups to modernize and simplify
Modified: trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
===================================================================
--- trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml 2005-10-02 22:41:31 UTC (rev 5900)
+++ trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml 2005-10-03 05:15:08 UTC (rev 5901)
@@ -41,27 +41,23 @@
<!-- create new entity and create all the fields -->
<make-value value-name="newEntity" entity-name="FixedAsset"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="newEntity"/>
+ <set from-field="parameters.fixedAssetId" field="newEntity.fixedAssetId"/>
<!-- create a non existing ID if not supplied -->
- <if-empty field-name="fixedAssetId" map-name="newEntity">
- <sequenced-id-to-env sequence-name="fixedAsset" env-name="fixedAssetId"/>
- <to-string field-name="fixedAssetId"/>
- <env-to-field env-name="fixedAssetId" map-name="newEntity"/>
- <field-to-result field-name="fixedAssetId" result-name="fixedAssetId"/>
+ <if-empty field-name="newEntity.fixedAssetId">
+ <sequenced-id-to-env sequence-name="FixedAsset" env-name="newEntity.fixedAssetId"/>
+ <field-to-result field-name="newEntity.fixedAssetId" result-name="fixedAssetId"/>
<else>
<!-- check the provided ID -->
- <check-id field-name="fixedAssetId" map-name="newEntity"/>
+ <check-id field-name="newEntity.fixedAssetId"/>
<check-errors/>
- </else>
+ </else>
</if-empty>
<!-- finally create the record (should not exist already)-->
<create-value value-name="newEntity"/>
- <check-errors/>
+ </simple-method>
- </simple-method>
-
<!-- update an existing Fixed Asset header Record -->
<simple-method method-name="updateFixedAsset" short-description="Update an existing FixedAsset">
<check-permission permission="ACCOUNTING" action="_UPDATE">
@@ -70,12 +66,9 @@
</check-permission>
<check-errors/>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAsset" map-name="lookupPKMap" value-name="lookedUpValue"/>
- <check-errors/>
+ <entity-one entity-name="FixedAsset" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
- <check-errors/>
</simple-method>
<!-- ================================================================ -->
@@ -94,13 +87,11 @@
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <if-empty field-name="fromDate" map-name="newEntity">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" field-name="fromDate" map-name="newEntity"/>
+ <if-empty field-name="newEntity.fromDate">
+ <now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
- <check-errors/>
</simple-method>
<!-- update the product to fixed Asset link -->
@@ -111,12 +102,9 @@
</check-permission>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetProduct"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetProduct" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetProduct" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
- <check-errors/>
</simple-method>
<!-- remove the productlink from the Fixed Asset -->
@@ -127,11 +115,8 @@
</check-permission>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetProduct"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetProduct" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetProduct" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
- <check-errors/>
</simple-method>
<!-- ================================================================ -->
@@ -145,9 +130,7 @@
</check-permission>
<check-errors/>
- <make-value value-name="fixedAssetPKMap" entity-name="FixedAsset"/>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="fixedAssetPKMap"/>
- <find-by-primary-key entity-name="FixedAsset" map-name="fixedAssetPKMap" value-name="fixedAsset"/>
+ <entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
<make-value value-name="excDayPKMap" entity-name="TechDataCalendarExcDay"/>
<set-pk-fields field-name= "calendarId" map-name="fixedAsset" value-name="excDayPKMap"/>
@@ -155,7 +138,6 @@
<find-by entity-name="TechDataCalendarExcDay" map-name="excDayPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields field-name="capacity" map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
- <check-errors/>
</simple-method>
@@ -166,8 +148,8 @@
<!-- ================================================================ -->
<simple-method method-name="addPartyToFixedAsset" short-description="Add Party to FixedAsset">
- <string-to-field string="addPartyToFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="CREATE" field-name="checkAction"/>
+ <set value="addPartyToFixedAsset" field="callingMethodName"/>
+ <set value="CREATE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
@@ -175,34 +157,29 @@
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <if-empty field-name="fromDate" map-name="newEntity">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" field-name="fromDate" map-name="newEntity"/>
+ <if-empty field-name="newEntity.fromDate">
+ <now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updatePartyToFixedAsset" short-description="Update Party to FixedAsset Application">
- <string-to-field string="updatePartyToFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="UPDATE" field-name="checkAction"/>
+ <set value="updatePartyToFixedAsset" field="callingMethodName"/>
+ <set value="UPDATE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetRole"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetRole" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetRole" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="removePartyFromFixedAsset" short-description="Remove Party From FixedAsset">
- <string-to-field string="removePartyFromFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="DELETE" field-name="checkAction"/>
+ <set value="removePartyFromFixedAsset" field="callingMethodName"/>
+ <set value="DELETE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetRole"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetRole" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetRole" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
@@ -211,10 +188,10 @@
<!-- ================================================================ -->
<simple-method method-name="addFixedAssetToFixedAsset" short-description="Add FixedAsset to FixedAsset">
- <string-to-field string="addFixedAssetToFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="CREATE" field-name="checkAction"/>
+ <set value="addFixedAssetToFixedAsset" field="callingMethodName"/>
+ <set value="CREATE" field="checkAction"/>
<!-- note the the user must be associated with the parent FixedAsset with the role limited permission -->
- <string-to-field string="parentFixedAssetId" field-name="fixedAssetIdName"/>
+ <set value="parentFixedAssetId" field="fixedAssetIdName"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
@@ -222,40 +199,33 @@
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <if-empty field-name="fromDate" map-name="newEntity">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" field-name="fromDate" map-name="newEntity"/>
+ <if-empty field-name="newEntity.fromDate">
+ <now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
</simple-method>
-
<simple-method method-name="updateFixedAssetToFixedAsset" short-description="Update FixedAsset to FixedAsset Application">
- <string-to-field string="updateFixedAssetToFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="UPDATE" field-name="checkAction"/>
+ <set value="updateFixedAssetToFixedAsset" field="callingMethodName"/>
+ <set value="UPDATE" field="checkAction"/>
<!-- note the the user must be associated with the parent FixedAsset with the role limited permission -->
- <string-to-field string="parentFixedAssetId" field-name="fixedAssetIdName"/>
+ <set value="parentFixedAssetId" field="fixedAssetIdName"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetRollup"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetRollup" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetRollup" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
-
<simple-method method-name="removeFixedAssetFromFixedAsset" short-description="Remove FixedAsset From FixedAsset">
- <string-to-field string="removeFixedAssetFromFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="DELETE" field-name="checkAction"/>
+ <set value="removeFixedAssetFromFixedAsset" field="callingMethodName"/>
+ <set value="DELETE" field="checkAction"/>
<!-- note the the user must be associated with the parent FixedAsset with the role limited permission -->
- <string-to-field string="parentFixedAssetId" field-name="fixedAssetIdName"/>
+ <set value="parentFixedAssetId" field="fixedAssetIdName"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <make-value value-name="lookupPKMap" entity-name="FixedAssetRollup"/>
- <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
- <find-by-primary-key entity-name="FixedAssetRollup" map-name="lookupPKMap" value-name="lookedUpValue"/>
+ <entity-one entity-name="FixedAssetRollup" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
@@ -264,88 +234,92 @@
<!-- ================================================================ -->
<simple-method method-name="copyFixedAssetProductMembers" short-description="copy FixedAssetProduct Members to a FixedAssetProductTo">
- <string-to-field string="copyFixedAssetProductMembers" field-name="callingMethodName"/>
- <string-to-field string="CREATE" field-name="checkAction"/>
+ <set value="copyFixedAssetProductMembers" field="callingMethodName"/>
+ <set value="CREATE" field="checkAction"/>
<!-- note the the user must be associated with the target FixedAsset with the role limited permission -->
- <string-to-field string="fixedAssetIdTo" field-name="fixedAssetIdName"/>
+ <set value="fixedAssetIdTo" field="fixedAssetIdName"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="lookupMap"/>
- <find-by-and entity-name="FixedAssetMember" map-name="lookupMap" list-name="FixedAssetMembers"/>
+ <entity-and entity-name="FixedAssetMember" list-name="fixedAssetMembers">
+ <field-map field-name="fixedAssetId" env-name="parameters.fixedAssetId"/>
+ </entity-and>
- <field-to-env field-name="validDate" map-name="parameters" env-name="validDate"/>
- <if-not-empty field-name="validDate">
- <filter-list-by-date list-name="FixedAssetMembers" valid-date-name="validDate"/>
+ <if-not-empty field-name="parameters.validDate">
+ <filter-list-by-date list-name="fixedAssetMembers" valid-date-name="parameters.validDate"/>
</if-not-empty>
<!-- add each to a list to store and then store all and let the entity engine do inserts or updates as needed; much more reliable/useful -->
- <iterate entry-name="FixedAssetMember" list-name="FixedAssetMembers">
- <clone-value value-name="FixedAssetMember" new-value-name="newFixedAssetMember"/>
- <field-to-field field-name="fixedAssetIdTo" map-name="parameters" to-field-name="fixedAssetId" to-map-name="newFixedAssetMember"/>
- <field-to-list field-name="newFixedAssetMember" list-name="pcmsToStore"/>
+ <iterate entry-name="fixedAssetMember" list-name="fixedAssetMembers">
+ <clone-value value-name="fixedAssetMember" new-value-name="newFixedAssetMember"/>
+ <set from-field="parameters.fixedAssetIdTo" field="newFixedAssetMember.fixedAssetId"/>
+ <set field="pcmsToStore[]" from-field="newFixedAssetMember"/>
</iterate>
<store-list list-name="pcmsToStore"/>
<if-compare field-name="recurse" map-name="parameters" operator="equals" value="Y">
<!-- call this service for each sub-FixedAsset in the rollup with the same FixedAssetIdTo -->
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-field-name="parentFixedAssetId" to-map-name="lookupChildrenMap"/>
- <find-by-and entity-name="FixedAssetRollup" map-name="lookupChildrenMap" list-name="FixedAssetRollups"/>
+ <entity-and entity-name="FixedAssetRollup" list-name="fixedAssetRollups">
+ <field-map field-name="parentFixedAssetId" env-name="parameters.fixedAssetId"/>
+ </entity-and>
- <if-not-empty field-name="validDate">
- <filter-list-by-date list-name="FixedAssetRollups" valid-date-name="validDate"/>
+
+ <if-not-empty field-name="parameters.validDate">
+ <filter-list-by-date list-name="fixedAssetRollups" valid-date-name="parameters.validDate"/>
</if-not-empty>
- <iterate entry-name="FixedAssetRollup" list-name="FixedAssetRollups">
- <field-to-field field-name="fixedAssetId" map-name="FixedAssetRollup" to-map-name="callServiceMap"/>
- <field-to-field field-name="fixedAssetIdTo" map-name="parameters" to-map-name="callServiceMap"/>
- <field-to-field field-name="validDate" map-name="parameters" to-map-name="callServiceMap"/>
- <field-to-field field-name="recurse" map-name="parameters" to-map-name="callServiceMap"/>
+ <iterate entry-name="fixedAssetRollup" list-name="fixedAssetRollups">
+ <set from-field="fixedAssetRollup.fixedAssetId" field="callServiceMap.fixedAssetId"/>
+ <set from-field="parameters.fixedAssetIdTo" field="callServiceMap.fixedAssetIdTo"/>
+ <set from-field="parameters.validDate" field="callServiceMap.validDate"/>
+ <set from-field="parameters.recurse" field="callServiceMap.recurse"/>
<call-service service-name="copyFixedAssetProductMembers" in-map-name="callServiceMap"/>
</iterate>
</if-compare>
</simple-method>
<simple-method method-name="expireAllFixedAssetProductMembers" short-description="Remove FixedAsset From FixedAsset">
- <string-to-field string="expireAllFixedAssetProductMembers" field-name="callingMethodName"/>
- <string-to-field string="UPDATE" field-name="checkAction"/>
+ <set value="expireAllFixedAssetProductMembers" field="callingMethodName"/>
+ <set value="UPDATE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
<if-not-empty field-name="thruDate" map-name="parameters">
- <field-to-env field-name="thruDate" map-name="parameters" env-name="expireTimestamp"/>
- <else>
- <now-timestamp-to-env env-name="expireTimestamp"/>
- </else>
+ <set from-field="parameters.thruDate" field="expireTimestamp"/>
+ <else>
+ <now-timestamp-to-env env-name="expireTimestamp"/>
+ </else>
</if-not-empty>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="lookupMap"/>
- <find-by-and entity-name="FixedAssetMember" map-name="lookupMap" list-name="FixedAssetMembers"/>
+ <entity-and entity-name="FixedAssetMember" list-name="fixedAssetMembers">
+ <field-map field-name="fixedAssetId" env-name="parameters.fixedAssetId"/>
+ </entity-and>
- <iterate entry-name="FixedAssetMember" list-name="FixedAssetMembers">
- <env-to-field env-name="expireTimestamp" field-name="thruDate" map-name="FixedAssetMember"/>
- <store-value value-name="FixedAssetMember"/>
+ <iterate entry-name="fixedAssetMember" list-name="fixedAssetMembers">
+ <set from-field="expireTimestamp" field="fixedAssetMember.thruDate"/>
+ <store-value value-name="fixedAssetMember"/>
</iterate>
</simple-method>
<simple-method method-name="removeExpiredFixedAssetProductMembers" short-description="Remove FixedAsset From FixedAsset">
- <string-to-field string="removeExpiredFixedAssetProductMembers" field-name="callingMethodName"/>
- <string-to-field string="DELETE" field-name="checkAction"/>
+ <set value="removeExpiredFixedAssetProductMembers" field="callingMethodName"/>
+ <set value="DELETE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <if-not-empty field-name="validDate" map-name="parameters">
- <field-to-env field-name="validDate" map-name="parameters" env-name="expireTimestamp"/>
- <else>
- <now-timestamp-to-env env-name="expireTimestamp"/>
- </else>
+ <if-not-empty field-name="parameters.validDate">
+ <set from-field="parameters.validDate" field="expireTimestamp"/>
+ <else>
+ <now-timestamp-to-env env-name="expireTimestamp"/>
+ </else>
</if-not-empty>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="lookupMap"/>
- <find-by-and entity-name="FixedAssetMember" map-name="lookupMap" list-name="FixedAssetMembers"/>
+ <entity-and entity-name="FixedAssetMember" list-name="fixedAssetMembers">
+ <field-map field-name="fixedAssetId" env-name="parameters.fixedAssetId"/>
+ </entity-and>
- <iterate entry-name="FixedAssetMember" list-name="FixedAssetMembers">
- <if-compare-field field-name="thruDate" map-name="FixedAssetMember" operator="less" to-field-name="expireTimestamp" type="Timestamp">
- <remove-value value-name="FixedAssetMember"/>
+ <iterate entry-name="fixedAssetMember" list-name="fixedAssetMembers">
+ <if-compare-field field-name="thruDate" map-name="fixedAssetMember" operator="less" to-field-name="expireTimestamp" type="Timestamp">
+ <remove-value value-name="fixedAssetMember"/>
</if-compare-field>
</iterate>
</simple-method>
@@ -354,20 +328,20 @@
<!-- Special FixedAsset Related Create Services -->
<!-- ================================================================ -->
<simple-method method-name="createProductInFixedAsset" short-description="Create a Product in a FixedAsset along with special information such as features">
- <string-to-field string="createProductInFixedAsset" field-name="callingMethodName"/>
- <string-to-field string="CREATE" field-name="checkAction"/>
+ <set value="createProductInFixedAsset" field="callingMethodName"/>
+ <set value="CREATE" field="checkAction"/>
<call-simple-method method-name="checkFixedAssetRelatedPermission"/>
<check-errors/>
- <if-empty field-name="currencyUomId" map-name="parameters">
+ <if-empty field-name="parameters.currencyUomId">
<!-- default to USD for lack of a better alternative, for now anyway... -->
- <string-to-field string="USD" field-name="currencyUomId" map-name="parameters"/>
+ <set value="USD" field="parameters.currencyUomId"/>
</if-empty>
<!-- create Product -->
<set-service-fields service-name="createProduct" map-name="parameters" to-map-name="callCreateProductMap"/>
- <if-empty field-name="productTypeId" map-name="callCreateProductMap">
- <string-to-field string="FINISHED_GOOD" field-name="productTypeId" map-name="callCreateProductMap"/>
+ <if-empty field-name="callCreateProductMap.productTypeId">
+ <set value="FINISHED_GOOD" field="callCreateProductMap.productTypeId"/>
</if-empty>
<call-service service-name="createProduct" in-map-name="callCreateProductMap">
<result-to-field result-name="productId"/>
@@ -375,40 +349,40 @@
<field-to-result field-name="productId"/>
<!-- create FixedAssetMember -->
- <env-to-field env-name="productId" map-name="callCreateFixedAssetMemberMap"/>
- <field-to-field field-name="fixedAssetId" map-name="parameters" to-map-name="callCreateFixedAssetMemberMap"/>
+ <set field="callCreateFixedAssetMemberMap.productId" from-field="productId"/>
+ <set field="callCreateFixedAssetMemberMap.fixedAssetId" from-field="parameters.fixedAssetId"/>
<call-service service-name="addProductToFixedAsset" in-map-name="callCreateFixedAssetMemberMap"/>
<!-- create defaultPrice and averageCost ProductPrice -->
<if-not-empty field-name="parameters.defaultPrice">
- <env-to-field env-name="productId" map-name="createDefaultPriceMap"/>
- <field-to-field field-name="currencyUomId" map-name="parameters" to-map-name="createDefaultPriceMap"/>
- <env-to-env env-name="parameters.defaultPrice" to-env-name="createDefaultPriceMap.price"/>
- <string-to-field string="_NA_" field-name="createDefaultPriceMap.productStoreGroupId"/>
- <string-to-field string="DEFAULT_PRICE" field-name="createDefaultPriceMap.productPriceTypeId"/>
+ <set from-field="productId" field="createDefaultPriceMap.productId"/>
+ <set from-field="parameters.currencyUomId" field="createDefaultPriceMap.currencyUomId"/>
+ <set from-field="parameters.defaultPrice" field="createDefaultPriceMap.price"/>
+ <set value="_NA_" field="createDefaultPriceMap.productStoreGroupId"/>
+ <set value="DEFAULT_PRICE" field="createDefaultPriceMap.productPriceTypeId"/>
<call-service service-name="createProductPrice" in-map-name="createDefaultPriceMap"/>
</if-not-empty>
<if-not-empty field-name="parameters.averageCost">
- <env-to-field env-name="productId" map-name="createAverageCostMap"/>
- <field-to-field field-name="currencyUomId" map-name="parameters" to-map-name="createAverageCostMap"/>
- <env-to-env env-name="parameters.averageCost" to-env-name="createAverageCostMap.price"/>
- <string-to-field string="_NA_" field-name="createAverageCostMap.productStoreGroupId"/>
- <string-to-field string="AVERAGE_COST" field-name="createAverageCostMap.productPriceTypeId"/>
+ <set from-field="productId" field="createAverageCostMap.productId"/>
+ <set from-field="parameters.currencyUomId" field="createAverageCostMap.currencyUomId"/>
+ <set from-field="parameters.averageCost" field="createAverageCostMap.price"/>
+ <set value="_NA_" field="createAverageCostMap.productStoreGroupId"/>
+ <set value="AVERAGE_COST" field="createAverageCostMap.productPriceTypeId"/>
<call-service service-name="createProductPrice" in-map-name="createAverageCostMap"/>
</if-not-empty>
<!-- create ProductFeatureAppl(s) -->
- <string-to-field string="N" field-name="hasSelectableFeatures"/>
+ <set value="N" field="hasSelectableFeatures"/>
<iterate-map map-name="parameters.productFeatureIdByType" key-name="productFeatureTypeId" value-name="productFeatureId">
<log level="info" message="Applying feature [${productFeatureId}] of type [${productFeatureTypeId}] to product [${productId}]"/>
- <env-to-field env-name="productId" map-name="createPfaMap"/>
- <env-to-field env-name="productFeatureId" map-name="createPfaMap"/>
+ <set from-field="productId" field="createPfaMap.productId"/>
+ <set from-field="productFeatureId" field="createPfaMap.productFeatureId"/>
<if-compare field-name="${productFeatureTypeId}" map-name="parameters.productFeatureSelectableByType" operator="equals" value="Y">
- <string-to-field string="SELECTABLE_FEATURE" field-name="productFeatureApplTypeId" map-name="createPfaMap"/>
- <string-to-field string="Y" field-name="hasSelectableFeatures"/>
+ <set value="SELECTABLE_FEATURE" field="createPfaMap.productFeatureApplTypeId"/>
+ <set value="Y" field="hasSelectableFeatures"/>
<else>
- <string-to-field string="STANDARD_FEATURE" field-name="productFeatureApplTypeId" map-name="createPfaMap"/>
+ <set value="STANDARD_FEATURE" field="createPfaMap.productFeatureApplTypeId"/>
</else>
</if-compare>
<call-service service-name="applyFeatureToProduct" in-map-name="createPfaMap"/>
@@ -417,9 +391,8 @@
<!-- set isVirtual based on hasSelectableFeatures -->
<if-compare field-name="hasSelectableFeatures" operator="equals" value="Y">
- <env-to-field env-name="productId" map-name="findProductMap"/>
- <find-by-primary-key entity-name="Product" map-name="findProductMap" value-name="newProduct"/>
- <string-to-field string="Y" field-name="isVirtual" map-name="newProduct"/>
+ <entity-one entity-name="Product" value-name="newProduct"/>
+ <set value="Y" field="newProduct.isVirtual"/>
<store-value value-name="newProduct"/>
</if-compare>
</simple-method>
@@ -449,11 +422,10 @@
<fail-message message="Security Error: to run updateFixedAssetStdCost you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
</check-permission>
<check-errors/>
- <entity-one entity-name="FixedAssetStdCost" value-name="fixedAssetStdCost" auto-field-map="true"/>
- <check-errors/>
+
+ <entity-one entity-name="FixedAssetStdCost" value-name="fixedAssetStdCost"/>
<set-nonpk-fields map-name="parameters" value-name="fixedAssetStdCost"/>
<store-value value-name="fixedAssetStdCost"/>
- <check-errors/>
</simple-method>
<!-- cancel an existing Agreement -->
@@ -463,12 +435,9 @@
<fail-message message="Security Error: to run cancelFixedAssetStdCost you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
</check-permission>
<check-errors/>
- <entity-one entity-name="FixedAssetStdCost" value-name="fixedAssetStdCost" auto-field-map="true"/>
- <check-errors/>
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" field-name="thruDate" map-name="fixedAssetStdCost"/>
+
+ <entity-one entity-name="FixedAssetStdCost" value-name="fixedAssetStdCost"/>
+ <now-timestamp-to-env env-name="fixedAssetStdCost.thruDate"/>
<store-value value-name="fixedAssetStdCost"/>
- <check-errors/>
</simple-method>
-
</simple-methods>
\ No newline at end of file
Modified: trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
===================================================================
--- trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml 2005-10-02 22:41:31 UTC (rev 5900)
+++ trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml 2005-10-03 05:15:08 UTC (rev 5901)
@@ -46,42 +46,34 @@
<check-errors/>
<make-value entity-name="Payment" value-name="payment"/>
- <sequenced-id-to-env sequence-name="Payment" env-name="paymentId"/>
- <to-string field-name="paymentId"/>
- <env-to-field env-name="paymentId" map-name="payment"/>
-
- <set-nonpk-fields map-name="parameters" value-name="payment"/>
+ <sequenced-id-to-env sequence-name="Payment" env-name="payment.paymentId"/>
+ <field-to-result field-name="payment.paymentId" result-name="paymentId"/>
- <if-empty field-name="effectiveDate" map-name="parameters">
- <now-timestamp-to-env env-name="timestamp"/>
- <env-to-field env-name="timestamp" field-name="effectiveDate" map-name="payment"/>
+ <set-nonpk-fields map-name="parameters" value-name="payment"/>
+ <if-empty field-name="payment.effectiveDate">
+ <now-timestamp-to-env env-name="payment.effectiveDate"/>
</if-empty>
<create-value value-name="payment"/>
- <field-to-result field-name="paymentId" map-name="payment" result-name="paymentId"/>
</simple-method>
<simple-method method-name="updatePayment" short-description="Update a Payment">
- <make-value entity-name="Payment" value-name="lookupPayment"/>
- <set-pk-fields value-name="lookupPayment" map-name="parameters"/>
-
- <find-by-primary-key entity-name="Payment" map-name="lookupPayment" value-name="payment"/>
+ <entity-one entity-name="Payment" value-name="payment"/>
<if>
- <condition>
- <and>
- <not><if-has-permission permission="PAY_INFO" action="_UPDATE"/></not>
- <not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdFrom" to-map-name="payment"/></not>
- <not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdTo" to-map-name="payment"/></not>
- </and>
- </condition>
- <then>
- <add-error><fail-property resource="AccountingUiLabels" property="AccountingUpdatePaymentPermissionError"/></add-error>
- </then>
+ <condition>
+ <and>
+ <not><if-has-permission permission="PAY_INFO" action="_UPDATE"/></not>
+ <not><if-compare-field field-name="userLogin.partyId" operator="equals" to-field-name="payment.partyIdFrom"/></not>
+ <not><if-compare-field field-name="userLogin.partyId" operator="equals" to-field-name="payment.partyIdTo"/></not>
+ </and>
+ </condition>
+ <then>
+ <add-error><fail-property resource="AccountingUiLabels" property="AccountingUpdatePaymentPermissionError"/></add-error>
+ </then>
</if>
<check-errors/>
<set-nonpk-fields map-name="parameters" value-name="payment"/>
- <if-empty field-name="effectiveDate" map-name="parameters">
- <now-timestamp-to-env env-name="timestamp"/>
- <env-to-field env-name="timestamp" field-name="effectiveDate" map-name="payment"/>
+ <if-empty field-name="payment.effectiveDate">
+ <now-timestamp-to-env env-name="payment.effectiveDate"/>
</if-empty>
<store-value value-name="payment"/>
</simple-method>
@@ -99,19 +91,16 @@
<make-value entity-name="PaymentApplication" value-name="paymentAppl"/>
<set-nonpk-fields map-name="parameters" value-name="paymentAppl"/>
- <if-not-empty field-name="invoiceId" map-name="parameters">
- <field-to-field field-name="invoiceId" map-name="parameters" to-map-name="invoiceLookup"/>
- <find-by-primary-key entity-name="Invoice" map-name="invoiceLookup" value-name="invoice"/>
- <if-not-empty field-name="billingAccountId" map-name="invoice">
- <field-to-field field-name="billingAccountId" map-name="invoice" to-map-name="paymentAppl"/>
+ <if-not-empty field-name="parameters.invoiceId">
+ <entity-one entity-name="Invoice" value-name="invoice"/>
+ <if-not-empty field-name="invoice.billingAccountId">
+ <set from-field="invoice.billingAccountId" field="paymentAppl.billingAccountId"/>
</if-not-empty>
</if-not-empty>
- <sequenced-id-to-env sequence-name="PaymentApplication" env-name="paymentApplicationId"/>
- <to-string field-name="paymentApplicationId"/>
- <env-to-field env-name="paymentApplicationId" field-name="paymentApplicationId" map-name="paymentAppl"/>
+ <sequenced-id-to-env sequence-name="PaymentApplication" env-name="paymentAppl.paymentApplicationId"/>
+ <field-to-result field-name="paymentAppl.paymentApplicationId" result-name="paymentApplicationId"/>
<create-value value-name="paymentAppl"/>
- <field-to-result field-name="paymentApplicationId" map-name="paymentAppl"/>
</simple-method>
</simple-methods>
Modified: trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
===================================================================
--- trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml 2005-10-02 22:41:31 UTC (rev 5900)
+++ trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml 2005-10-03 05:15:08 UTC (rev 5901)
@@ -46,76 +46,72 @@
<make-value value-name="newEntity" entity-name="ShoppingList"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <if-empty field-name="partyId" map-name="newEntity">
- <field-to-field field-name="partyId" map-name="userLogin" to-map-name="newEntity"/>
+ <if-empty field-name="newEntity.partyId">
+ <set from-field="userLogin.partyId" field="newEntity.partyId"/>
</if-empty>
- <if-empty field-name="shoppingListTypeId" map-name="newEntity">
- <string-to-field string="SLT_WISH_LIST" field-name="shoppingListTypeId" map-name="newEntity"/>
+ <if-empty field-name="newEntity.shoppingListTypeId">
+ <set value="SLT_WISH_LIST" field="newEntity.shoppingListTypeId"/>
</if-empty>
<if-empty field-name="listName" map-name="newEntity">
- <string-to-field string="New Shopping List" field-name="listName" map-name="newEntity"/>
+ <set value="New Shopping List" field="newEntity.listName"/>
</if-empty>
<if-empty field-name="isPublic" map-name="newEntity">
- <string-to-field string="N" field-name="isPublic" map-name="newEntity"/>
+ <set value="N" field="newEntity.isPublic"/>
</if-empty>
<if-empty field-name="isActive" map-name="newEntity">
- <if-compare field-name="shoppingListTypeId" map-name="newEntity" operator="equals" value="SLT_AUTO_REODR">
- <string-to-field string="N" field-name="isActive" map-name="newEntity"/>
+ <if-compare field-name="newEntity.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR">
+ <set value="N" field="newEntity.isActive"/>
<else>
- <string-to-field string="Y" field-name="isActive" map-name="newEntity"/>
+ <set value="Y" field="newEntity.isActive"/>
</else>
- </if-compare>
+ </if-compare>
</if-empty>
- <sequenced-id-to-env sequence-name="ShoppingList" env-name="shoppingListId"/>
- <to-string field-name="shoppingListId"/>
- <env-to-field env-name="shoppingListId" map-name="newEntity"/>
- <field-to-result field-name="shoppingListId" result-name="shoppingListId"/>
-
+ <sequenced-id-to-env sequence-name="ShoppingList" env-name="newEntity.shoppingListId"/>
+ <field-to-result field-name="newEntity.shoppingListId" result-name="shoppingListId"/>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updateShoppingList" short-description="Update a ShoppingList">
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupPKMap" value-name="shoppingList"/>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
- <string-to-field field-name="parentMethodName" string="updateShoppingList"/>
- <string-to-field field-name="permissionAction" string="UPDATE"/>
+ <set field="parentMethodName" value="updateShoppingList"/>
+ <set field="permissionAction" value="UPDATE"/>
<call-simple-method method-name="checkShoppingListSecurity"/>
- <check-errors/>
+ <check-errors/>
<set-nonpk-fields map-name="parameters" value-name="shoppingList"/>
<!-- don't let auto-reorders be active unless there is some recurrence info -->
- <if-compare field-name="shoppingListTypeId" map-name="shoppingList" operator="equals" value="SLT_AUTO_REODR">
- <if-empty field-name="recurrenceInfoId" map-name="shoppingList">
- <string-to-field string="N" field-name="isActive" map-name="shoppingList"/>
- </if-empty>
- <if-empty field-name="paymentMethodId" map-name="shoppingList">
- <string-to-field string="N" field-name="isActive" map-name="shoppingList"/>
- </if-empty>
- <if-empty field-name="contactMechId" map-name="shoppingList">
- <string-to-field string="N" field-name="isActive" map-name="shoppingList"/>
- </if-empty>
- <if-empty field-name="shipmentMethodTypeId" map-name="shoppingList">
- <string-to-field string="N" field-name="isActive" map-name="shoppingList"/>
- </if-empty>
- </if-compare>
+ <if>
+ <condition>
+ <and>
+ <if-compare field-name="shoppingList.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR"/>
+ <or>
+ <if-empty field-name="shoppingList.recurrenceInfoId"/>
+ <if-empty field-name="shoppingList.paymentMethodId"/>
+ <if-empty field-name="shoppingList.contactMechId"/>
+ <if-empty field-name="shoppingList.shipmentMethodTypeId"/>
+ </or>
+ </and>
+ </condition>
+ <then>
+ <set value="N" field="shoppingList.isActive"/>
+ </then>
+ </if>
- <log level="always" message="Parameters - ${parameters}"/>
<store-value value-name="shoppingList"/>
</simple-method>
<simple-method method-name="removeShoppingList" short-description="Remove a ShoppingList">
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupPKMap" value-name="shoppingList"/>
-
- <string-to-field field-name="parentMethodName" string="removeShoppingList"/>
- <string-to-field field-name="permissionAction" string="DELETE"/>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
+
+ <set field="parentMethodName" value="removeShoppingList"/>
+ <set field="permissionAction" value="DELETE"/>
<call-simple-method method-name="checkShoppingListSecurity"/>
<check-errors/>
@@ -123,58 +119,38 @@
</simple-method>
<simple-method method-name="createShoppingListItem" short-description="Create a ShoppingList Item">
- <string-to-field field-name="parentMethodName" string="createShoppingListItem"/>
- <string-to-field field-name="permissionAction" string="CREATE"/>
+ <set field="parentMethodName" value="createShoppingListItem"/>
+ <set field="permissionAction" value="CREATE"/>
<call-simple-method method-name="checkShoppingListItemSecurity"/>
<check-errors/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupPKMap" value-name="shoppingList"/>
-
- <make-value value-name="newEntity" entity-name="ShoppingListItem"/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="newEntity"/>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupMap"/>
- <string-to-list string="-shoppingListItemSeqId" list-name="orderBy"/>
- <find-by-and entity-name="ShoppingListItem" list-name="currentItems" map-name="lookupMap" order-by-list-name="orderBy"></find-by-and>
- <if-empty field-name="currentItems">
- <string-to-field string="1" field-name="shoppingListItemSeqId" map-name="newEntity"/>
- <else>
- <first-from-list entry-name="newestItem" list-name="currentItems"/>
- <calculate field-name="shoppingListItemSeqId" map-name="newEntity" type="Integer">
- <calcop field-name="shoppingListItemSeqId" map-name="newestItem" operator="add">
- <number value="1"/>
- </calcop>
- </calculate>
- </else>
- </if-empty>
- <to-string field-name="shoppingListItemSeqId" map-name="newEntity" numeric-padding="5"/>
+ <make-value value-name="newEntity" entity-name="ShoppingListItem"/>
+ <set from-field="parameters.shoppingListId" field="newEntity.shoppingListId"/>
+ <make-next-seq-id value-name="newEntity" seq-field-name="shoppingListItemSeqId" numeric-padding="5"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
- <field-to-result field-name="shoppingListItemSeqId" map-name="newEntity"/>
- <field-to-result field-name="shoppingListId" map-name="newEntity"/>
+ <field-to-result field-name="newEntity.shoppingListItemSeqId" result-name="shoppingListItemSeqId"/>
+ <field-to-result field-name="newEntity.shoppingListId" result-name="shoppingListId"/>
<create-value value-name="newEntity"/>
- <if-compare-field map-name="shoppingList" field-name="partyId" operator="not-equals" to-map-name="userLogin">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" map-name="shoppingList" field-name="lastAdminModified"/>
+ <if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
+ <now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
</simple-method>
<simple-method method-name="updateShoppingListItem" short-description="Update a ShoppingListItem">
- <string-to-field field-name="parentMethodName" string="updateShoppingListItem"/>
- <string-to-field field-name="permissionAction" string="UPDATE"/>
+ <set field="parentMethodName" value="updateShoppingListItem"/>
+ <set field="permissionAction" value="UPDATE"/>
<call-simple-method method-name="checkShoppingListItemSecurity"/>
<check-errors/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupPKMap" value-name="shoppingList"/>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
+ <entity-one entity-name="ShoppingListItem" value-name="shoppingListItem"/>
- <field-to-field field-name="shoppingListItemSeqId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingListItem" map-name="lookupPKMap" value-name="shoppingListItem"/>
-
- <if-compare field-name="quantity" map-name="parameters" operator="equals" value="0">
+ <if-compare field-name="parameters.quantity" operator="equals" value="0" type="Double">
<!-- if we're setting quantity to 0.0 then remove the item -->
<set-service-fields service-name="removeShoppingListItem" map-name="parameters" to-map-name="removeParams"/>
<call-service service-name="removeShoppingListItem" in-map-name="removeParams"/>
@@ -185,85 +161,81 @@
</else>
</if-compare>
- <if-compare-field map-name="shoppingList" field-name="partyId" operator="not-equals" to-map-name="userLogin">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" map-name="shoppingList" field-name="lastAdminModified"/>
+ <if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
+ <now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
</simple-method>
<simple-method method-name="removeShoppingListItem" short-description="Remove a ShoppingListItem">
- <string-to-field field-name="parentMethodName" string="removeShoppingListItem"/>
- <string-to-field field-name="permissionAction" string="DELETE"/>
+ <set field="parentMethodName" value="removeShoppingListItem"/>
+ <set field="permissionAction" value="DELETE"/>
<call-simple-method method-name="checkShoppingListItemSecurity"/>
<check-errors/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupPKMap" value-name="shoppingList"/>
-
- <field-to-field field-name="shoppingListItemSeqId" map-name="parameters" to-map-name="lookupPKMap"/>
- <find-by-primary-key entity-name="ShoppingListItem" map-name="lookupPKMap" value-name="shoppingListItem"/>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
+ <entity-one entity-name="ShoppingListItem" value-name="shoppingListItem"/>
<remove-value value-name="shoppingListItem"/>
- <if-compare-field map-name="shoppingList" field-name="partyId" operator="not-equals" to-map-name="userLogin">
- <now-timestamp-to-env env-name="nowTimestamp"/>
- <env-to-field env-name="nowTimestamp" map-name="shoppingList" field-name="lastAdminModified"/>
+ <if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
+ <now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
</simple-method>
<simple-method method-name="calculateShoppingListDeepTotalPrice" short-description="Calculate Deep Total Price for a ShoppingList">
- <string-to-field field-name="parentMethodName" string="calculateShoppingListDeepTotalPrice"/>
- <string-to-field field-name="permissionAction" string="VIEW"/>
+ <set field="parentMethodName" value="calculateShoppingListDeepTotalPrice"/>
+ <set field="permissionAction" value="VIEW"/>
<call-simple-method method-name="checkShoppingListItemSecurity"/>
<check-errors/>
- <field-to-field field-name="prodCatalogId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="webSiteId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="partyId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="productStoreId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="productStoreGroupId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="currencyUomId" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
- <field-to-field field-name="autoUserLogin" map-name="parameters" to-map-name="calcPriceInBaseMap"/>
+ <set from-field="parameters.prodCatalogId" field="calcPriceInBaseMap.prodCatalogId"/>
+ <set from-field="parameters.webSiteId" field="calcPriceInBaseMap.webSiteId"/>
+ <set from-field="parameters.partyId" field="calcPriceInBaseMap.partyId"/>
+ <set from-field="parameters.productStoreId" field="calcPriceInBaseMap.productStoreId"/>
+ <set from-field="parameters.productStoreGroupId" field="calcPriceInBaseMap.productStoreGroupId"/>
+ <set from-field="parameters.currencyUomId" field="calcPriceInBaseMap.currencyUomId"/>
+ <set from-field="parameters.autoUserLogin" field="calcPriceInBaseMap.autoUserLogin"/>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupMap"/>
- <find-by-and entity-name="ShoppingListItem" list-name="shoppingListItems" map-name="lookupMap" use-cache="true"/>
+ <entity-and entity-name="ShoppingListItem" list-name="shoppingListItems" use-cache="true">
+ <field-map field-name="shoppingListId" env-name="parameters.shoppingListId"/>
+ </entity-and>
- <calculate field-name="totalPrice" type="Double"><number value="0.0"/></calculate>
+ <set field="totalPrice" type="Double" value="0.0"/>
<iterate entry-name="shoppingListItem" list-name="shoppingListItems">
- <field-to-field field-name="productId" map-name="shoppingListItem" to-map-name="lookupProductMap"/>
- <find-by-primary-key entity-name="Product" value-name="product" map-name="lookupProductMap" use-cache="true"/>
+ <entity-one entity-name="Product" value-name="product" use-cache="true" auto-field-map="false">
+ <field-map field-name="productId" env-name="shoppingListItem.productId"/>
+ </entity-one>
<map-to-map map-name="calcPriceInBaseMap" to-map-name="calcPriceInMap"/>
- <env-to-field env-name="product" field-name="product" map-name="calcPriceInMap"/>
- <field-to-field field-name="quantity" map-name="shoppingListItem" to-map-name="calcPriceInMap"/>
+ <set field="calcPriceInMap.product" from-field="product"/>
+ <set field="calcPriceInMap.quantity" from-field="shoppingListItem.quantity"/>
<call-service service-name="calculateProductPrice" in-map-name="calcPriceInMap">
- <result-to-field result-name="price" field-name="price" map-name="calcPriceOutMap"/>
+ <result-to-field result-name="price" field-name="calcPriceOutMap.price"/>
</call-service>
<calculate field-name="totalPrice">
- <calcop field-name="totalPrice" operator="add">
- <calcop operator="multiply">
- <calcop operator="get" field-name="price" map-name="calcPriceOutMap"/>
- <calcop operator="get" field-name="quantity" map-name="shoppingListItem"/>
- </calcop>
+ <calcop field-name="totalPrice" operator="add"/>
+ <calcop operator="multiply">
+ <calcop operator="get" field-name="calcPriceOutMap.price"/>
+ <calcop operator="get" field-name="shoppingListItem.quantity"/>
</calcop>
</calculate>
<clear-field field-name="calcPriceInMap"/>
</iterate>
- <field-to-field field-name="shoppingListId" map-name="parameters" to-field-name="parentShoppingListId" to-map-name="lookupChildrenMap"/>
- <field-to-field field-name="partyId" map-name="userLogin" to-map-name="lookupChildrenMap"/>
- <find-by-and entity-name="ShoppingList" list-name="childshoppingLists" map-name="lookupChildrenMap" use-cache="true"/>
+ <entity-and entity-name="ShoppingList" list-name="childshoppingLists" use-cache="true">
+ <field-map field-name="parentShoppingListId" env-name="parameters.shoppingListId"/>
+ <field-map field-name="partyId" env-name="userLogin.partyId"/>
+ </entity-and>
<iterate entry-name="childshoppingList" list-name="childshoppingLists">
<map-to-map map-name="calcPriceInBaseMap" to-map-name="calcChildPriceInMap"/>
- <field-to-field field-name="shoppingListId" map-name="childshoppingList" to-map-name="calcChildPriceInMap"/>
+ <set from-field="childshoppingList.shoppingListId" field="calcChildPriceInMap.shoppingListId"/>
<call-service service-name="calculateShoppingListDeepTotalPrice" in-map-name="calcChildPriceInMap">
<result-to-field result-name="totalPrice" field-name="totalPrice" map-name="calcPriceOutMap"/>
</call-service>
<calculate field-name="totalPrice">
- <calcop field-name="totalPrice" operator="add">
- <calcop operator="get" field-name="totalPrice" map-name="calcPriceOutMap"/>
- </calcop>
+ <calcop field-name="totalPrice" operator="get"/>
+ <calcop field-name="calcPriceOutMap.totalPrice" operator="get"/>
</calculate>
<clear-field field-name="calcChildPriceInMap"/>
</iterate>
@@ -274,7 +246,7 @@
<simple-method method-name="checkShoppingListSecurity" short-description="Checks security on a ShoppingList">
<if>
<condition>
- <and>
+ <and>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-map-name="shoppingList"/></not>
<not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
</and>
@@ -282,21 +254,20 @@
<then>
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunForAnotherParty"/></add-error>
</then>
- </if>
- </simple-method>
+ </if>
+ </simple-method>
<simple-method method-name="checkShoppingListItemSecurity" short-description="Checks security on a ShoppingListItem">
- <field-to-field field-name="shoppingListId" map-name="parameters" to-map-name="lookupSLMap"/>
- <find-by-primary-key entity-name="ShoppingList" map-name="lookupSLMap" value-name="shoppingList"/>
- <if>
+ <entity-one entity-name="ShoppingList" value-name="shoppingList"/>
+ <if>
<condition>
- <and>
- <not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-map-name="shoppingList"/></not>
+ <and>
+ <not><if-compare-field field-name="userLogin.partyId" operator="equals" to-field-name="shoppingList.partyId"/></not>
<not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
</and>
</condition>
<then>
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunForAnotherParty"/></add-error>
</then>
- </if>
+ </if>
</simple-method>
</simple-methods>
More information about the Svn
mailing list