[OFBiz] SVN: r6713 - in trunk/applications/party: script/org/ofbiz/party/party servicedef

jonesde@svn.ofbiz.org jonesde at svn.ofbiz.org
Fri Feb 10 18:35:40 CST 2006


Author: jonesde
Date: 2006-02-10 18:35:35 -0600 (Fri, 10 Feb 2006)
New Revision: 6713

Modified:
   trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
   trunk/applications/party/servicedef/services.xml
Log:
Applied patch from Hans Bakker to getPartyEmail, a good initial pass that could maybe use some extension

Modified: trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
===================================================================
--- trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml	2006-02-11 00:07:06 UTC (rev 6712)
+++ trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml	2006-02-11 00:35:35 UTC (rev 6713)
@@ -662,4 +662,18 @@
             <call-simple-method method-name="getChildRoleTypesInline"/>
         </if-not-empty>
     </simple-method>    
+
+    <simple-method method-name="getPartyEmail" short-description="Get the email of the party">
+        <set field="findMap.partyId" from-field="parameters.partyId"/>
+        <set field="findMap.contactMechTypeId" value="EMAIL_ADDRESS"/>
+        <find-by-and entity-name="PartyAndContactMech" map-name="findMap" list-name="emailAddressesAll"/>
+        <if-empty field-name="emailAddressesAll">
+            <set field="findMap.contactMechTypeId" value="ELECTRONIC_ADDRESS"/>
+            <find-by-and entity-name="PartyAndContactMech" map-name="findMap" list-name="emailAddressesAll"/>
+        </if-empty>
+        <now-date-to-env env-name="fromDate"/>
+        <filter-list-by-date list-name="emailAddressesAll" from-field-name="fromDate" to-list-name="emailAddresses"/>
+        <first-from-list entry-name="emailAddress" list-name="emailAddresses"/>
+        <field-to-result field-name="emailAddress.infoString" result-name="emailAddress"/>
+    </simple-method>
 </simple-methods>

Modified: trunk/applications/party/servicedef/services.xml
===================================================================
--- trunk/applications/party/servicedef/services.xml	2006-02-11 00:07:06 UTC (rev 6712)
+++ trunk/applications/party/servicedef/services.xml	2006-02-11 00:35:35 UTC (rev 6713)
@@ -601,7 +601,7 @@
     </service>
 
     <service name="createPartyContent" engine="simple"
-            location="org/ofbiz/party/party/PartyServices.xml" invoke="createPartyContent" auth="false">
+        location="org/ofbiz/party/party/PartyServices.xml" invoke="createPartyContent" auth="false">
         <description>Create Party Associated Content</description>
         <attribute name="uploadedFile" type="org.ofbiz.entity.util.ByteWrapper" mode="IN" optional="false"/>
         <attribute name="_uploadedFile_fileName" type="String" mode="IN" optional="false"/>
@@ -612,4 +612,10 @@
         <attribute name="partyId" type="String" mode="IN" optional="true"/>
         <attribute name="contentId" type="String" mode="OUT" optional="false"/>
     </service>
+    <service name="getPartyEmail" engine="simple"
+        location="org/ofbiz/party/party/PartyServices.xml" invoke="getPartyEmail" auth="false">
+        <description>Get the main party Email address</description>
+        <attribute name="partyId" type="String" mode="IN" optional="false"/>
+        <attribute name="emailAddress" type="String" mode="OUT" optional="true"/>
+    </service>
 </services>



More information about the Svn mailing list