Updated all simple methods to use the new attributes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@667748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -26,10 +26,10 @@ under the License.
|
||||
<if>
|
||||
<condition>
|
||||
<and>
|
||||
<not><if-empty field-name="postalAddress"/></not>
|
||||
<not><if-empty field="postalAddress"/></not>
|
||||
<!-- Make sure this address in the USA, required for this CDyne service -->
|
||||
<if-compare field-name="postalAddress.countryGeoId" operator="equals" value="USA"/>
|
||||
<if-empty field-name="postalAddress.countyGeoId"/>
|
||||
<if-compare field="postalAddress.countryGeoId" operator="equals" value="USA"/>
|
||||
<if-empty field="postalAddress.countyGeoId"/>
|
||||
</and>
|
||||
</condition>
|
||||
<then>
|
||||
@@ -54,7 +54,7 @@ under the License.
|
||||
</condition-list>
|
||||
</entity-condition>
|
||||
<first-from-list entry-name="countyGeo" list-name="geoList"/>
|
||||
<if-not-empty field-name="countyGeo">
|
||||
<if-not-empty field="countyGeo">
|
||||
<!-- We found a county, now just save off the ID -->
|
||||
<set field="postalAddress.countyGeoId" from-field="countyGeo.geoId"/>
|
||||
<store-value value-name="postalAddress"/>
|
||||
|
||||
@@ -61,12 +61,12 @@ under the License.
|
||||
|
||||
<simple-method method-name="convertUom" short-description="Convert UOM values" login-required="false">
|
||||
<!-- base case: if both uomIds are the same, return the original value -->
|
||||
<if-compare-field field-name="parameters.uomId" operator="equals" to-field-name="parameters.uomIdTo">
|
||||
<if-compare-field field="parameters.uomId" to-field="parameters.uomIdTo" operator="equals">
|
||||
<field-to-result field-name="parameters.originalValue" result-name="convertedValue"/>
|
||||
<return/>
|
||||
</if-compare-field>
|
||||
|
||||
<if-empty field-name="parameters.asOfDate">
|
||||
<if-empty field="parameters.asOfDate">
|
||||
<now-timestamp-to-env env-name="nowTimestamp"/>
|
||||
<set field="asOfDate" from-field="nowTimestamp"/>
|
||||
<else>
|
||||
@@ -78,7 +78,7 @@ under the License.
|
||||
<entity-one entity-name="UomConversion" value-name="uomConversion" auto-field-map="true" use-cache="true"/>
|
||||
|
||||
<!-- if not found, try the dated uom conversion entity -->
|
||||
<if-empty field-name="uomConversion">
|
||||
<if-empty field="uomConversion">
|
||||
<entity-condition entity-name="UomConversionDated" list-name="uomConversions" use-cache="true">
|
||||
<condition-list combine="and">
|
||||
<condition-expr field-name="uomId" env-name="parameters.uomId"/>
|
||||
@@ -96,13 +96,13 @@ under the License.
|
||||
</if-empty>
|
||||
<log level="verbose" message="using conversion factor=${uomConversion.conversionFactor}"/>
|
||||
|
||||
<if-empty field-name="uomConversion">
|
||||
<if-empty field="uomConversion">
|
||||
<!-- if still no uom conversion entity, then no conversion is possible -->
|
||||
<add-error><fail-property property="NoUomConversionFound" resource="CommonUiLabels"/></add-error>
|
||||
<check-errors/>
|
||||
<else>
|
||||
<!-- Do custom conversion, if we have customMethodId -->
|
||||
<if-not-empty field-name="uomConversion.customMethodId"> <!-- custom conversion? -->
|
||||
<if-not-empty field="uomConversion.customMethodId"> <!-- custom conversion? -->
|
||||
<log level="verbose" message="using custom conversion customMethodId=${uomConversion.customMethodId}"/>
|
||||
<set field="customParms" from-field="parameters"/>
|
||||
<set field="customParms.uomConversion" from-field="uomConversion"/>
|
||||
@@ -123,7 +123,7 @@ under the License.
|
||||
|
||||
<!-- round result, if UomConversion[Dated] so specifies -->
|
||||
<set field="roundingMode" from-field="uomConversion.roundingMode"/>
|
||||
<if-not-empty field-name="uomConversion.roundingMode">
|
||||
<if-not-empty field="uomConversion.roundingMode">
|
||||
<calculate field-name="roundedValue" type="Double" decimal-scale="${uomConversion.decimalScale}" rounding-mode="${roundingMode}">
|
||||
<calcop operator="get" field-name="convertedValue"/>
|
||||
</calculate>
|
||||
@@ -143,7 +143,7 @@ under the License.
|
||||
<set field="customMethodId" from-field="parameters.uomConversion.customMethodId"/>
|
||||
<entity-one entity-name="CustomMethod" value-name="customMethod" auto-field-map="true" use-cache="true"/>
|
||||
|
||||
<if-empty field-name="customMethod.customMethodName">
|
||||
<if-empty field="customMethod.customMethodName">
|
||||
<add-error> <fail-property property="NoCustomMethodName" resource="CommonUiLabels"/> </add-error>
|
||||
<check-errors/>
|
||||
<else>
|
||||
@@ -157,7 +157,7 @@ under the License.
|
||||
</simple-method>
|
||||
<simple-method method-name="getFileUploadProgressStatus" short-description="Look up progress made in File Upload process">
|
||||
<set field="uploadProgressListener" from-field="parameters.uploadProgressListener"/>
|
||||
<if-not-empty field-name="uploadProgressListener">
|
||||
<if-not-empty field="uploadProgressListener">
|
||||
<call-object-method obj-field-name="uploadProgressListener" method-name="getContentLength" ret-field-name="parameters.contentLength"/>
|
||||
<field-to-result field-name="parameters.contentLength" result-name="contentLength"/>
|
||||
<call-object-method obj-field-name="uploadProgressListener" method-name="getBytesRead" ret-field-name="parameters.bytesRead"/>
|
||||
|
||||
@@ -21,10 +21,10 @@ under the License.
|
||||
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
|
||||
<simple-method method-name="lookupParty" short-description="Lookup a party">
|
||||
<if-not-empty field-name="firstName" map-name="parameters">
|
||||
<if-not-empty field="parameters.firstName">
|
||||
<set from-field="parameters.firstName" field="LookupMap.firstName"/>
|
||||
</if-not-empty>
|
||||
<if-not-empty field-name="lastName" map-name="parameters">
|
||||
<if-not-empty field="parameters.lastName">
|
||||
<set from-field="parameters.lastName" field="LookupMap.lastName"/>
|
||||
</if-not-empty>
|
||||
<find-by-and entity-name="Person" map-name="LookupMap" list-name="parties" />
|
||||
@@ -33,7 +33,7 @@ under the License.
|
||||
<set from-field="party.partyId" field="resultEntry.value"/>
|
||||
<field-to-list field-name="resultEntry" list-name="lookupResult"/>
|
||||
</iterate>
|
||||
<if-empty field-name="parties">
|
||||
<if-empty field="parties">
|
||||
<set value="No match" field="resultEntry.label"/>
|
||||
<set value="" field="resultEntry.value"/>
|
||||
<field-to-list field-name="resultEntry" list-name="lookupResult"/>
|
||||
|
||||
@@ -55,7 +55,7 @@ under the License.
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="findCustomTimePeriods" short-description="Find a CustomTimePeriod">
|
||||
<if-not-empty field-name="parameters.organizationPartyId">
|
||||
<if-not-empty field="parameters.organizationPartyId">
|
||||
<!-- walk up the tree and find all party groups that this is a member of, and include the periods for all of them -->
|
||||
<set from-field="parameters.organizationPartyId" field="getParentOrganizationsCallMap.organizationPartyId"/>
|
||||
<call-service service-name="getParentOrganizations" in-map-name="getParentOrganizationsCallMap">
|
||||
@@ -81,7 +81,7 @@ under the License.
|
||||
</iterate>
|
||||
</if-not-empty>
|
||||
|
||||
<if-compare field-name="parameters.excludeNoOrganizationPeriods" operator="not-equals" value="Y">
|
||||
<if-compare field="parameters.excludeNoOrganizationPeriods" operator="not-equals" value="Y">
|
||||
<entity-condition entity-name="CustomTimePeriod" list-name="generalCustomTimePeriodList">
|
||||
<condition-list combine="and">
|
||||
<condition-list combine="or">
|
||||
@@ -102,7 +102,7 @@ under the License.
|
||||
<!--
|
||||
* We might want to implement this sometime in the future, but for now is not needed
|
||||
* go through the list and check each one to see if it has a child in the list, if so don't copy it
|
||||
<if-compare field-name="parameters.excludeParentPeriods" operator="equals" value="Y"></if-compare>
|
||||
<if-compare field="parameters.excludeParentPeriods" operator="equals" value="Y"></if-compare>
|
||||
-->
|
||||
|
||||
<field-to-result field-name="listSoFar" result-name="customTimePeriodList"/>
|
||||
|
||||
@@ -22,18 +22,18 @@ under the License.
|
||||
|
||||
<simple-method method-name="genericBasePermissionCheck" short-description="Basic Permission check">
|
||||
<!-- allow mainAction to be set from outside methods or direct to the service -->
|
||||
<if-empty field-name="mainAction">
|
||||
<if-empty field="mainAction">
|
||||
<set field="mainAction" from-field="parameters.mainAction"/>
|
||||
<if-empty field-name="mainAction">
|
||||
<if-empty field="mainAction">
|
||||
<add-error><fail-property resource="CommonUiLabels" property="CommonPermissionMainActionAttributeMissing"/></add-error>
|
||||
</if-empty>
|
||||
</if-empty>
|
||||
<check-errors/>
|
||||
|
||||
<!-- allow primary permission to be set from outside methods or direct to the service -->
|
||||
<if-empty field-name="primaryPermission">
|
||||
<if-empty field="primaryPermission">
|
||||
<set field="primaryPermission" from-field="parameters.primaryPermission"/>
|
||||
<if-empty field-name="primaryPermission">
|
||||
<if-empty field="primaryPermission">
|
||||
<add-error><fail-property resource="CommonUiLabels" property="CommonPermissionPrimaryPermissionMissing"/></add-error>
|
||||
</if-empty>
|
||||
</if-empty>
|
||||
@@ -41,10 +41,10 @@ under the License.
|
||||
<log level="info" message="Checking for primary permission ${primaryPermission}_${mainAction}"/>
|
||||
|
||||
<!-- allow alt permission to be set from outside methods or direct to the service -->
|
||||
<if-empty field-name="altPermission">
|
||||
<if-empty field="altPermission">
|
||||
<set field="altPermission" from-field="parameters.altPermission"/>
|
||||
</if-empty>
|
||||
<if-not-empty field-name="altPermission">
|
||||
<if-not-empty field="altPermission">
|
||||
<log level="info" message="Checking for alternate permission ${altPermission}_${mainAction}"/>
|
||||
<set field="altPermissionList" value=", ${altPermission}_${mainAction}, ${altPermission}_ADMIN"/>
|
||||
</if-not-empty>
|
||||
@@ -52,7 +52,7 @@ under the License.
|
||||
|
||||
<!-- set up called service name -->
|
||||
<set field="resourceDescription" from-field="parameters.resourceDescription"/>
|
||||
<if-empty field-name="resourceDescription">
|
||||
<if-empty field="resourceDescription">
|
||||
<property-to-field resource="CommonUiLabels" property="CommonPermissionThisOperation" field-name="resourceDescription"/>
|
||||
</if-empty>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user