svn commit: r1231077 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

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

svn commit: r1231077 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

adrianc
Author: adrianc
Date: Fri Jan 13 14:06:57 2012
New Revision: 1231077

URL: http://svn.apache.org/viewvc?rev=1231077&view=rev
Log:
Small code cleanup and performance improvement for the findPartyFromEmailAddress service.

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.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=1231077&r1=1231076&r2=1231077&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 Fri Jan 13 14:06:57 2012
@@ -318,29 +318,23 @@ under the License.
     <simple-method method-name="findPartyFromEmailAddress" short-description="Find partyId from email address">
         <set field="input.filterByDate" value="Y"/>
         <set field="input.inputFields.infoString" from-field="parameters.address"/>
-        <if-empty field="parameters.caseInsensitive">
-            <call-bsh><![CDATA[
-                String caseInsensitiveEmail = org.ofbiz.base.util.UtilProperties.getPropertyValue("general.properties", "mail.address.caseInsensitive", "N");
-                parameters.put("caseInsensitive", caseInsensitiveEmail);
-            ]]></call-bsh>
+        <set field="caseInsensitive" from-field="parameters.caseInsensitive"/>
+        <if-empty field="caseInsensitive">
+            <property-to-field resource="general.properties" property="mail.address.caseInsensitive" field="caseInsensitive" default="N"/>
         </if-empty>
-        <set field="input.inputFields.infoString_ic" from-field="parameters.caseInsensitive"/>
-        <log level="info" message="findPartyFromEmailAddress with case insensitive search: ${parameters.caseInsensitive}"/>
-
+        <set field="input.inputFields.infoString_ic" from-field="caseInsensitive"/>
         <if-empty field="parameters.fromDate">
             <set field="input.filterByDate" value="Y"/>
             <else>
                 <set field="input.filterByDateValue" from-field="parameters.fromDate"/>
             </else>
         </if-empty>
-
         <!-- try primary email address -->
         <set field="input.inputFields.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
         <set field="input.entityName" value="PartyContactDetailByPurpose"/>
         <call-service service-name="performFindItem" in-map-name="input">
             <results-to-map map-name="results"/>
         </call-service>
-
         <!-- any other email address -->
         <if-empty field="results.item">
             <set field="input.entityName" value="PartyAndContactMech"/>
@@ -349,12 +343,10 @@ under the License.
                 <results-to-map map-name="results"/>
             </call-service>
         </if-empty>
-
         <if-not-empty field="results.item">
             <field-to-result field="results.item.partyId" result-name="partyId"/>
             <field-to-result field="results.item.contactMechId" result-name="contactMechId"/>
         </if-not-empty>
-
     </simple-method>
 
     <simple-method method-name="findPartyFromTelephone" short-description="Find partyId from the telephone number">