You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2008/11/25 20:40:34 UTC

svn commit: r720570 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml applications/party/servicedef/services.xml framework/common/config/general.properties

Author: sichen
Date: Tue Nov 25 11:40:33 2008
New Revision: 720570

URL: http://svn.apache.org/viewvc?rev=720570&view=rev
Log:
Allow email matching to be non case sensitive, so SiChen@opentaps.org would map to sichen@opentaps.org

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/framework/common/config/general.properties

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=720570&r1=720569&r2=720570&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 Nov 25 11:40:33 2008
@@ -293,6 +293,14 @@
         <set field="input.entityName" value="PartyAndContactMech"/>
         <set field="input.filterByDate" value="Y"/>
         <set field="input.inputFields.infoString" from-field="parameters.address"/>
+        <if-empty map-name="parameters" field-name="caseInsensitive">
+            <call-bsh><![CDATA[
+                String caseInsensitiveEmail = org.ofbiz.base.util.UtilProperties.getPropertyValue("general.properties", "mail.address.caseInsensitive", "N");
+                parameters.put("caseInsensitive", caseInsensitiveEmail);
+            ]]></call-bsh>
+        </if-empty>
+        <set field="input.inputFields.infoString_ic" from-field="parameters.caseInsensitive"/>
+        <log level="info" message="findPartyFromEmailAddress with case insensitive search: ${parameters.caseInsensitive}"/>
         
         <if-empty field="parameters.fromDate">
             <now-timestamp-to-env env-name="input.filterByDateValue"/>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=720570&r1=720569&r2=720570&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue Nov 25 11:40:33 2008
@@ -379,6 +379,7 @@
             location="org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="findPartyFromEmailAddress" auth="true">
         <description>Find the partyId/contactMechId for a specific email address, if not found do not return a value</description>
         <attribute name="address" type="String" mode="IN" optional="false"/>
+        <attribute name="caseInsensitive" type="String" mode="IN" optional="true"/>
         <attribute name="personal" type="String" mode="IN" optional="true"/><!-- field not used -->
         <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
         <attribute name="partyId" type="String" mode="OUT" optional="true"/>

Modified: ofbiz/trunk/framework/common/config/general.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/general.properties?rev=720570&r1=720569&r2=720570&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/general.properties (original)
+++ ofbiz/trunk/framework/common/config/general.properties Tue Nov 25 11:40:33 2008
@@ -73,6 +73,9 @@
 #--Fallback [true|false] determines whether you will allow a non secure connection if you are unable to get a secure one
 #mail.smtp.socketFactory.fallback=false
 
+# -- how the address are matched with the CRM addresses
+mail.address.caseInsensitive=Y
+
 # -- debug SMTP mail option enabled (Y|N)
 mail.debug.on=N
 



Re: svn commit: r720570 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml applications/party/servicedef/services.xml framework/common/config/general.properties

Posted by Adam Heath <do...@brainfood.com>.
Adam Heath wrote:
>> --- ofbiz/trunk/framework/common/config/general.properties (original)
>> +++ ofbiz/trunk/framework/common/config/general.properties Tue Nov 25 11:40:33 2008
>> @@ -73,6 +73,9 @@
>>  #--Fallback [true|false] determines whether you will allow a non secure connection if you are unable to get a secure one
>>  #mail.smtp.socketFactory.fallback=false
>>  
>> +# -- how the address are matched with the CRM addresses
>> +mail.address.caseInsensitive=Y
>> +
> 
> No.  Do not change the current default to something that will break for
> most installs.  Current deployments are case-senstive, and this change
> will break them.  I'm going to revert this hunk.

Actually, to be fair, this isn't the entire situation.  Domain names are
case *insenstive*.  The SMTP spec says that mail servers are free to
implement whatever kind of matching they want with the username.  So,
OFBiz should probably handle emails smarter, by converting the
primaryKey field's domain to lower case during a store, etc, with an ECA
or some such.

Re: svn commit: r720570 - in /ofbiz/trunk: applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml applications/party/servicedef/services.xml framework/common/config/general.properties

Posted by Adam Heath <do...@brainfood.com>.
> --- ofbiz/trunk/framework/common/config/general.properties (original)
> +++ ofbiz/trunk/framework/common/config/general.properties Tue Nov 25 11:40:33 2008
> @@ -73,6 +73,9 @@
>  #--Fallback [true|false] determines whether you will allow a non secure connection if you are unable to get a secure one
>  #mail.smtp.socketFactory.fallback=false
>  
> +# -- how the address are matched with the CRM addresses
> +mail.address.caseInsensitive=Y
> +

No.  Do not change the current default to something that will break for
most installs.  Current deployments are case-senstive, and this change
will break them.  I'm going to revert this hunk.