Re: svn commit: r783603 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/ applications/party/servicedef/ applications/party/widget/partymgr/ framework/base/src/org/ofbiz/base/util/

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

Re: svn commit: r783603 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/ applications/party/servicedef/ applications/party/widget/partymgr/ framework/base/src/org/ofbiz/base/util/

Adrian Crum
Hans,

This method isn't necessary. There is a UEL function that does the same
thing:

http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html

See str:replcate()

-Adrian


[hidden email] wrote:

> Author: hansbak
> Date: Thu Jun 11 02:14:32 2009
> New Revision: 783603
>
> URL: http://svn.apache.org/viewvc?rev=783603&view=rev
> Log:
> make the party viewprofile request also working when only an emailaddress or telephone number is provided. usefull when this url is called from other webbased systems.
> 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=783603&r1=783602&r2=783603&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 Thu Jun 11 02:14:32 2009
> @@ -35,4 +35,17 @@
>          }
>          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, ""));
> +    }
> +
>  }
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r783603 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/ applications/party/servicedef/ applications/party/widget/partymgr/ framework/base/src/org/ofbiz/base/util/

Adrian Crum
Oops, keyboard malfunction. See str:replace().

-Adrian

Adrian Crum wrote:

> Hans,
>
> This method isn't necessary. There is a UEL function that does the same
> thing:
>
> http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html
>
> See str:replcate()
>
> -Adrian
>
>
> [hidden email] wrote:
>> Author: hansbak
>> Date: Thu Jun 11 02:14:32 2009
>> New Revision: 783603
>>
>> URL: http://svn.apache.org/viewvc?rev=783603&view=rev
>> Log:
>> make the party viewprofile request also working when only an
>> emailaddress or telephone number is provided. usefull when this url is
>> called from other webbased systems.
>> 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=783603&r1=783602&r2=783603&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
>> Thu Jun 11 02:14:32 2009
>> @@ -35,4 +35,17 @@
>>          }
>>          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, ""));
>> +    }
>> +
>>  }
>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r783603 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/ applications/party/servicedef/ applications/party/widget/partymgr/ framework/base/src/org/ofbiz/base/util/

Adam Heath-2
In reply to this post by Adrian Crum
Adrian Crum wrote:
> Hans,

>> ==============================================================================
>>
>> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java
>> (original)
>> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java
>> Thu Jun 11 02:14:32 2009
>> @@ -35,4 +35,17 @@
>>          }
>>          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, ""));
>> +    }
>> +

Please follow ofbiz code formatting guidelines.  Remove the () around
the expression(not needed), and put a space after return.

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r783603 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/ applications/party/servicedef/ applications/party/widget/partymgr/ framework/base/src/org/ofbiz/base/util/

hans_bakker
In reply to this post by Adrian Crum
good point Adrian, revised in revision 784399.

Regards,
Hans

On Thu, 2009-06-11 at 08:07 -0700, Adrian Crum wrote:

> Oops, keyboard malfunction. See str:replace().
>
> -Adrian
>
> Adrian Crum wrote:
> > Hans,
> >
> > This method isn't necessary. There is a UEL function that does the same
> > thing:
> >
> > http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html
> >
> > See str:replcate()
> >
> > -Adrian
> >
> >
> > [hidden email] wrote:
> >> Author: hansbak
> >> Date: Thu Jun 11 02:14:32 2009
> >> New Revision: 783603
> >>
> >> URL: http://svn.apache.org/viewvc?rev=783603&view=rev
> >> Log:
> >> make the party viewprofile request also working when only an
> >> emailaddress or telephone number is provided. usefull when this url is
> >> called from other webbased systems.
> >> 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=783603&r1=783602&r2=783603&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
> >> Thu Jun 11 02:14:32 2009
> >> @@ -35,4 +35,17 @@
> >>          }
> >>          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, ""));
> >> +    }
> >> +
> >>  }
> >>
> >>
> >>
> >
--
Antwebsystems.com: Quality OFBiz services for competitive rates