// External Candidate Registration email address validation.
package xxxx.oracle.apps.irc.candidateSelfService.webui;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAFwkConstants;
import oracle.apps.irc.common.Constants;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.irc.candidateSelfService.webui.RegisterCO;
public class xxxxRegisterValidateEmailCO extends RegisterCO
{
public xxxxRegisterValidateEmailCO()
{
}
public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
{
super.processRequest(oapagecontext, oawebbean);
}
public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
{
String action = getIrcAction(oapagecontext);
if (oapagecontext.getParameter("Cancel") != null)
{ // retain AM
oapagecontext.forwardImmediately("OA.jsp?page=/oracle/apps/irc/candidateSelfService/webui/VisHomePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, false,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
if( action != null && action.equals(IRC_SUBMIT) )
{
String email = oapagecontext.getParameter("Email");
// Validation 1 : First, to check if the Email Address includes the word: Domain name i.e. your-companyname.com the following logic can be used.
if(email.indexOf("your-Company.com") != -1)
{
OAException message = new OAException(" The Email address should not include the word your-companyname.com.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
// Validation 2 : To check if the Email Address includes at least one @ symbol, the following logic can be used:
boolean flag = email.indexOf("@") == -1 ;
if(flag)
{
OAException message = new OAException ("The email address does not include @ symbol.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 3: To check if the Email Address includes more than one @ symbols
boolean flag3 = email.indexOf('@' ,email.indexOf('@') + 1 ) != -1 ;
if(flag3)
{
OAException message = new OAException ( "The Email address provided included more than one @ Symbol");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 4 : To check if the Email Address contains any white spaces
boolean flag4 = email.indexOf(' ') != -1 ;
if(flag4)
{
OAException message = new OAException ( "The Email address provided must not include spaces");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 5 : To check if the Email Address starts with WWW or @ or . ( Dot).
boolean flag5 = email.startsWith("www") || email.startsWith("@") || email.startsWith(".");
if(flag5)
{
OAException message = new OAException ( "The Email Address Must not Starts with 'www' or '@' or '.'.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 6 : To check if the length of the Email Address should not exceed 240 Characters.
int email_len = email.length();
if(email_len > 240 )
{
OAException message = new OAException ( "The length of the Email Address should be more than 240 Characters");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
}
super.processFormRequest(oapagecontext, oawebbean);
}
}
-- Developed By Raghavendra Seregar
-- rseregar@hotmail.com
// Ex-employee Candidate Registration email address validation.
package xxxx.oracle.apps.irc.candidateSelfService.webui;import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAFwkConstants;
import oracle.apps.irc.common.Constants;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.irc.candidateSelfService.webui.PreviousEmpRegCO;
public class xxxx_EXTM_RegisterValidateEmailCO extends PreviousEmpRegCO
{
public xxxx_EXTM_RegisterValidateEmailCO()
{
}
public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
{
super.processRequest(oapagecontext, oawebbean);
}
public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
{
if (oapagecontext.getParameter("cancelButton") != null)
{
oapagecontext.forwardImmediately("OA.jsp?page=/oracle/apps/irc/candidateSelfService/webui/VisHomePG&akRegionApplicationId=821&OAPB=IRC_BRAND",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, false,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
if(oapagecontext.getParameter("submitButton") != null );
{
String email = oapagecontext.getParameter("newEmail");
// Validation 1 : First, to check if the Email Address includes the word: Domain name i.e. your-companyname.com the following logic can be used.
if(email.indexOf("yourcompany.com") != -1)
{
OAException message = new OAException(" The Email address should not include the word your-companyname.com.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
// Validation 2 : To check if the Email Address includes at least one @ symbol, the following logic can be used:
boolean flag = email.indexOf("@") == -1 ;
if(flag)
{
OAException message = new OAException ("The email address does not include @ symbol.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 3: To check if the Email Address includes more than one @ symbols
boolean flag3 = email.indexOf('@' ,email.indexOf('@') + 1 ) != -1 ;
if(flag3)
{
OAException message = new OAException ( "The Email address provided included more than one @ Symbol");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 4 : To check if the Email Address contains any white spaces
boolean flag4 = email.indexOf(' ') != -1 ;
if(flag4)
{
OAException message = new OAException ( "The Email address provided must not include spaces");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 5 : To check if the Email Address starts with WWW or @ or . ( Dot).
boolean flag5 = email.startsWith("www") || email.startsWith("@") || email.startsWith(".");
if(flag5)
{
OAException message = new OAException ( "The Email Address Must not Starts with 'www' or '@' or '.'.");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
//Validation 6 : To check if the length of the Email Address should not exceed 240 Characters.
int email_len = email.length();
if(email_len > 240 )
{
OAException message = new OAException ( "The length of the Email Address should be more than 240 Characters");
oapagecontext.putDialogMessage(message);
oapagecontext.forwardImmediatelyToCurrentPage(null,true,ADD_BREAD_CRUMB_SAVE);
}
}
super.processFormRequest(oapagecontext, oawebbean);
}
}
-- Developed By Raghavendra Seregar
-- rseregar@hotmail.com