Bug 868016 - Feature request - Make email validation pluggable by user's custom rule in EPP 6.
Summary: Feature request - Make email validation pluggable by user's custom rule in EP...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 6.1.0
Assignee: Default User
QA Contact: vramik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-18 21:31 UTC by Gary Hu
Modified: 2018-11-29 19:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-07 14:25:28 UTC
Type: Feature Request
Embargoed:


Attachments (Terms of Use)

Description Gary Hu 2012-10-18 21:31:09 UTC
The current EPP 5.2.2 has a default rule to validate email address. Here is the source code http://anonsvn.jboss.org/repos/gatein/epp/portal/tags/EPP_5_2_2_GA/webui/core/src/main/java/org/exoplatform/webui/form/validator/EmailAddressValidator.java

 private boolean validateLocalPart(char[] localPart)
   {
      if(localPart.length == 0 || !Character.isLetter(localPart[0]) || !Character.isLetterOrDigit(localPart[localPart.length - 1]))
      {
         return false;
      }

      for(int i = 1; i < localPart.length -1; i++)
      {
         char c = localPart[i];
         char next = localPart[i+1];

         if(Character.isLetterOrDigit(c) || (isLocalPartSymbol(c) && Character.isLetterOrDigit(next)))
         {
            continue;
         }
         else
         {
            return false;
         }
      }
      return true;
   }

It only allow letter, digit and symbols "." and "_" in the local part. It also forces the first character to be letter and the last character to be letter or digit.

1) Can we review the validation rule? Are we following any spec for the validation rule?

2) Can we create a mechanism in EPP 6 that allows user to plug in their own custom validation rule such as regular expression as we've done for username/groupmembership?

Comment 2 Boleslaw Dawidowicz 2013-05-08 23:22:19 UTC
Implemented upstream. Documentation remaining.

Comment 3 Viliam Rockai 2013-05-21 12:31:22 UTC
Since this was just an extension of existing solution, just a very minor addition to documentation was needed. It's done here:
https://docs.jboss.org/author/display/GTNPORTAL36/Configuration+of+custom+data+validators

Comment 5 vramik 2013-07-08 21:15:02 UTC
Verified in er02


Note You need to log in before you can comment on or make changes to this bug.