svn commit: r900988 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/contact/PartyContactMechServices.xml servicedef/services.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r900988 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/contact/PartyContactMechServices.xml servicedef/services.xml

jleroux@apache.org
Author: jleroux
Date: Tue Jan 19 22:37:13 2010
New Revision: 900988

URL: http://svn.apache.org/viewvc?rev=900988&view=rev
Log:
New createUpdatePartyPostalAddress service, works like createUpdatePartyTelecomNumber

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml?rev=900988&r1=900987&r2=900988&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml Tue Jan 19 22:37:13 2010
@@ -260,7 +260,7 @@
             <else><add-error><fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/></add-error></else>
         </if-validate-method>
         <check-errors/>
-        
+
         <!-- if e-mail address already exists simply return -->
         <entity-condition list="partyAndContactMechs" entity-name="PartyAndContactMech">
             <condition-list combine="and">
@@ -645,4 +645,23 @@
         </if-empty>
         <field-to-result field="contactMechId"/>
     </simple-method>
+
+    <simple-method method-name="createUpdatePartyPostalAddress" short-description="Create or update postal address" login-required="false">
+        <if-empty field="parameters.contactMechId">
+            <set-service-fields service-name="createPartyPostalAddress" map="parameters" to-map="postalAddressContext"/>
+            <call-service service-name="createPartyPostalAddress" in-map-name="postalAddressContext">
+                <result-to-field result-name="contactMechId" field="contactMechId"/>
+            </call-service>
+            <log level="info" message="Postal address created, contactMechId is ${contactMechId}"></log>
+            <else>
+                <set-service-fields service-name="createPartyPostalAddress" map="parameters" to-map="postalAddressContext"/>
+                <call-service service-name="updatePartyPostalAddress" in-map-name="postalAddressContext">
+                    <result-to-field result-name="contactMechId" field="contactMechId"/>
+                </call-service>
+                <log level="info" message="Postal address contact updated, contactMechId is ${contactMechId}"></log>
+            </else>
+        </if-empty>
+        <field-to-result field="contactMechId"/>
+    </simple-method>
+
 </simple-methods>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=900988&r1=900987&r2=900988&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue Jan 19 22:37:13 2010
@@ -1281,6 +1281,16 @@
         <attribute name="contactMechId" type="String" mode="IN" optional="true"/>
         <attribute name="contactMechId" type="String" mode="OUT" optional="false"/>
     </service>
+    <service name="createUpdatePartyPostalAddress" engine="simple"
+        location="component://party/script/org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="createUpdatePartyPostalAddress" auth="false">
+        <description>Create or Update a postal address</description>
+        <attribute name="partyId" type="String" mode="IN" optional="false"/>
+        <auto-attributes entity-name="PartyContactMech" include="all" mode="IN" optional="true"/>
+        <auto-attributes entity-name="PostalAddress" include="nonpk" mode="IN" optional="true"/>
+        <attribute name="userLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
+        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
+        <attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
+    </service>
 
      <!--  bounced message processing -->
     <service name="processBouncedMessage" engine="java"