svn commit: r784399 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml framework/base/src/org/ofbiz/base/util/UtilParse.java

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

svn commit: r784399 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml framework/base/src/org/ofbiz/base/util/UtilParse.java

hansbak-2
Author: hansbak
Date: Sat Jun 13 14:32:25 2009
New Revision: 784399

URL: http://svn.apache.org/viewvc?rev=784399&view=rev
Log:
correction on revision 783603 as suggested by Adrian, no functional change

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java

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=784399&r1=784398&r2=784399&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 Sat Jun 13 14:32:25 2009
@@ -325,15 +325,12 @@
         <entity-and entity-name="PartyAndContactMech" list="contactMechs" filter-by-date="true">
             <field-map field-name="contactMechTypeId" value="TELECOM_NUMBER"/>
         </entity-and>
-        
-        <set field="inputString" from-field="parameters.telno"/>
-        <call-simple-method method-name="removeTelnoChar"/>
-        <set field="inputTelno" from-field="inputString"/>
-        
+
+        <set field="dash" value="-"/>
+        <set field="emptyString" value=""/>
+        <set field="inputTelno" value="${str:replaceAll(parameters.telno, dash, emptyString)}"/>
         <iterate entry="contactMech" list="contactMechs">
-            <set field="inputString" from-field="contactMech.tnContactNumber"/>
-            <call-simple-method method-name="removeTelnoChar"/>
-            <set field="telno" from-field="inputString"/>
+            <set field="telno" value="${str:replace(contactMech.tnContactNumber, dash, emptyString)}"/>
             <if-compare-field field="inputTelno" operator="equals" to-field="telno">
                 <set field="partyId" from-field="contactMech.partyId"/>
             </if-compare-field>
@@ -356,20 +353,6 @@
         </if-not-empty>
     </simple-method>
     
-    <simple-method method-name="removeTelnoChar" short-description="remove a string from another string">
-        <set field="removeString" value="-"/>
-        <call-class-method class-name="org.ofbiz.base.util.UtilParse" method-name="removeStringFromString" ret-field="inputString">
-            <field field="inputString" type="String"/>
-            <field field="removeString" type="String"/>
-        </call-class-method>
-        <set field="removeString" value=" "/>
-        <call-class-method class-name="org.ofbiz.base.util.UtilParse" method-name="removeStringFromString" ret-field="inputString">
-            <field field="inputString" type="String"/>
-            <field field="removeString" type="String"/>
-        </call-class-method>
-    </simple-method>
-    
-    
     <simple-method method-name="createPostalAddressAndPurposes" short-description="Create postal address, purposes and set them defaults" login-required="false">
         <call-service service-name="createPartyPostalAddress" in-map-name="parameters">
             <result-to-field result-name="contactMechId" field="parameters.contactMechId"/>

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java?rev=784399&r1=784398&r2=784399&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java Sat Jun 13 14:32:25 2009
@@ -36,16 +36,4 @@
         return new BigDecimal(bigDecimalString);
     }
 
-    /**
-     *
-     * to be used in minilanguage to remove all occurrencies of removeString from inputString
-     *
-     * @param inputString
-     * @param removeString
-     * @return
-     */
-    public static String removeStringFromString(String inputString, String removeString) {
-     return(inputString.replaceAll(removeString, ""));
-    }
-
 }