Author: jleroux
Date: Tue Aug 17 14:31:25 2010 New Revision: 986325 URL: http://svn.apache.org/viewvc?rev=986325&view=rev Log: Moves getCountryList and getAssociatedStateList from Party component to Framework to avoid dependencies on Party component (countries and states are not parties, but Geo, ie should be in the framework) Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml ofbiz/trunk/applications/party/servicedef/services_view.xml ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml ofbiz/trunk/framework/common/servicedef/services.xml Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=986325&r1=986324&r2=986325&view=diff ============================================================================== --- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original) +++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Tue Aug 17 14:31:25 2010 @@ -1037,36 +1037,6 @@ under the License. </if-not-empty> </simple-method> - <simple-method method-name="getCountryList" short-description="Returns a list of country" login-required="false"> - <call-class-method method-name="getCountryList" class-name="org.ofbiz.common.CommonWorkers" ret-field="geoList"> - <field field="delegator" type="org.ofbiz.entity.Delegator"/> - </call-class-method> - <iterate list="geoList" entry="countryGeo"> - <set field="countryName" value="${countryGeo.geoName}: ${countryGeo.geoId}"/> - <field-to-list list="countryList" field="countryName"/> - </iterate> - <field-to-result field="countryList"/> - </simple-method> - - <simple-method method-name="getAssociatedStateList" short-description="set the state options for selected country" login-required="false"> - <set field="countryGeoId" from-field="parameters.countryGeoId"/> - <set field="listOrderBy" from-field="parameters.listOrderBy"/> - <call-class-method method-name="getAssociatedStateList" class-name="org.ofbiz.common.CommonWorkers" ret-field="geoList"> - <field field="delegator" type="org.ofbiz.entity.Delegator"/> - <field field="countryGeoId" type="String"/> - <field field="listOrderBy" type="String"/> - </call-class-method> - <iterate list="geoList" entry="stateGeo"> - <set field="stateName" value="${stateGeo.geoName}: ${stateGeo.geoId}"/> - <field-to-list list="stateList" field="stateName"/> - </iterate> - <if-empty field="stateList"> - <property-to-field resource="CommonUiLabels" property="CommonNoStatesProvinces" field="noOption"/> - <field-to-list list="stateList" field="noOption"/> - </if-empty> - <field-to-result field="stateList"/> - </simple-method> - <simple-method method-name="createUpdatePerson" short-description="Create and update a person" login-required="false"> <call-map-processor xml-resource="component://party/script/org/ofbiz/party/party/PartyMapProcs.xml" processor-name="person" in-map-name="parameters" out-map-name="personMap"/> Modified: ofbiz/trunk/applications/party/servicedef/services_view.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services_view.xml?rev=986325&r1=986324&r2=986325&view=diff ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services_view.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services_view.xml Tue Aug 17 14:31:25 2010 @@ -175,18 +175,4 @@ under the License. <attribute name="contactMechId" type="String" mode="IN" optional="false"/> <attribute name="geos" type="java.util.List" mode="OUT" optional="true"/> </service> - - <!-- Get a list of country and associated states from Geo --> - <service name="getCountryList" engine="simple" auth="false" - location="component://party/script/org/ofbiz/party/party/PartyServices.xml" invoke="getCountryList"> - <attribute name="countryList" mode="OUT" type="java.util.List"/> - </service> - - <service name="getAssociatedStateList" engine="simple" auth="false" - location="component://party/script/org/ofbiz/party/party/PartyServices.xml" invoke="getAssociatedStateList"> - <attribute name="countryGeoId" mode="IN" type="String" optional="false"/> - <attribute name="listOrderBy" mode="IN" type="String" optional="true"/> - <attribute name="stateList" mode="OUT" type="java.util.List"/> - </service> - </services> Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=986325&r1=986324&r2=986325&view=diff ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml (original) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml Tue Aug 17 14:31:25 2010 @@ -238,5 +238,35 @@ under the License. <store-value value-field="noteData"/> <field-to-result field="noteData.noteId" result-name="noteId"/> </simple-method> + + <simple-method method-name="getCountryList" short-description="Returns a list of country" login-required="false"> + <call-class-method method-name="getCountryList" class-name="org.ofbiz.common.CommonWorkers" ret-field="geoList"> + <field field="delegator" type="org.ofbiz.entity.Delegator"/> + </call-class-method> + <iterate list="geoList" entry="countryGeo"> + <set field="countryName" value="${countryGeo.geoName}: ${countryGeo.geoId}"/> + <field-to-list list="countryList" field="countryName"/> + </iterate> + <field-to-result field="countryList"/> + </simple-method> + <simple-method method-name="getAssociatedStateList" short-description="set the state options for selected country" login-required="false"> + <set field="countryGeoId" from-field="parameters.countryGeoId"/> + <set field="listOrderBy" from-field="parameters.listOrderBy"/> + <call-class-method method-name="getAssociatedStateList" class-name="org.ofbiz.common.CommonWorkers" ret-field="geoList"> + <field field="delegator" type="org.ofbiz.entity.Delegator"/> + <field field="countryGeoId" type="String"/> + <field field="listOrderBy" type="String"/> + </call-class-method> + <iterate list="geoList" entry="stateGeo"> + <set field="stateName" value="${stateGeo.geoName}: ${stateGeo.geoId}"/> + <field-to-list list="stateList" field="stateName"/> + </iterate> + <if-empty field="stateList"> + <property-to-field resource="CommonUiLabels" property="CommonNoStatesProvinces" field="noOption"/> + <field-to-list list="stateList" field="noOption"/> + </if-empty> + <field-to-result field="stateList"/> + </simple-method> + </simple-methods> Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=986325&r1=986324&r2=986325&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Tue Aug 17 14:31:25 2010 @@ -704,4 +704,17 @@ under the License. <permission-service service-name="commonGenericPermission" main-action="DELETE"/> <auto-attributes include="pk" mode="IN" optional="false"/> </service> + + <!-- Get a list of country and associated states from Geo --> + <service name="getCountryList" engine="simple" auth="false" + location="component://common/script/org/ofbiz/common/CommonServices.xml" invoke="getCountryList"> + <attribute name="countryList" mode="OUT" type="java.util.List"/> + </service> + + <service name="getAssociatedStateList" engine="simple" auth="false" + location="component://common/script/org/ofbiz/common/CommonServices.xml" invoke="getAssociatedStateList"> + <attribute name="countryGeoId" mode="IN" type="String" optional="false"/> + <attribute name="listOrderBy" mode="IN" type="String" optional="true"/> + <attribute name="stateList" mode="OUT" type="java.util.List"/> + </service> </services> |
Free forum by Nabble | Edit this page |