Commit 29a7966d by chenith

Company user verification process.

parent 1b73026b
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<column name="hiring_team_type" type="String" nullable="true" length="200"/> <column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/> <column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/> <column name="time_zone" type="String" nullable="true" length="200"/>
<column name="is_verified" type="Boolean" nullable="true"/>
<column name="state" type="String" nullable="true" length="200"/> <column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/> <column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/> <column name="post_code" type="String" nullable="true" length="10"/>
......
...@@ -12,6 +12,7 @@ CREATE TABLE tl_company ( ...@@ -12,6 +12,7 @@ CREATE TABLE tl_company (
hiring_team_type varchar(200) NULL, hiring_team_type varchar(200) NULL,
industry varchar(200) NULL, industry varchar(200) NULL,
time_zone varchar(200) NULL, time_zone varchar(200) NULL,
is_verified char(1) NULL,
state varchar(200) NULL, state varchar(200) NULL,
country varchar(200) NULL, country varchar(200) NULL,
post_code varchar(10) NULL, post_code varchar(10) NULL,
......
...@@ -13,6 +13,7 @@ CREATE TABLE tl_company ( ...@@ -13,6 +13,7 @@ CREATE TABLE tl_company (
hiring_team_type varchar2(200) NULL, hiring_team_type varchar2(200) NULL,
industry varchar2(200) NULL, industry varchar2(200) NULL,
time_zone varchar2(200) NULL, time_zone varchar2(200) NULL,
is_verified char(1) NULL,
state varchar2(200) NULL, state varchar2(200) NULL,
country varchar2(200) NULL, country varchar2(200) NULL,
post_code varchar2(10) NULL, post_code varchar2(10) NULL,
......
...@@ -13,6 +13,7 @@ CREATE TABLE tl_company ( ...@@ -13,6 +13,7 @@ CREATE TABLE tl_company (
hiring_team_type varchar(200) NULL, hiring_team_type varchar(200) NULL,
industry varchar(200) NULL, industry varchar(200) NULL,
time_zone varchar(200) NULL, time_zone varchar(200) NULL,
is_verified char(1) NULL,
state varchar(200) NULL, state varchar(200) NULL,
country varchar(200) NULL, country varchar(200) NULL,
post_code varchar(10) NULL, post_code varchar(10) NULL,
......
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.email.ConfigurableEmailerException;
import oneit.logging.*;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*;
import performa.orm.*;
import performa.utils.Utils;
import performa.utils.WebUtils;
public class VerifyCompanyUserFP extends ORMProcessFormProcessor
{
private static LoggingArea LOG = LoggingArea.createLoggingArea("VerifyCompanyUser");
protected ConfigurableArticleTemplateEmailer emailer;
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getUserName()), secUser, SecUser.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getFirstName()!=null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getLastName()!=null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request);
if(company.getIsVerified()!=Boolean.TRUE)
{
BusinessObjectParser.assertFieldCondition(company.getCompanyName()!=null, company, Company.FIELD_CompanyName, "mandatory", exceptions, true, request);
}
BusinessObjectParser.assertFieldCondition(companyUser.getPassword()!= null, companyUser, Job.FIELD_Password, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(companyUser.getConfirmPassword()!= null, companyUser, Job.FIELD_ConfirmPassword, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(CollectionUtils.equals(companyUser.getPassword(), companyUser.getConfirmPassword()), companyUser, Job.FIELD_ConfirmPassword, "passwordNotMatch", exceptions, true, request);
return super.validate(submission, exceptions);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
String nextPage = (String) request.getAttribute("nextPage");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User", companyUser, secUser);
if(CollectionUtils.equals(companyUser.getPassword(), companyUser.getConfirmPassword()))
{
secUser.setAttribute("md5:" + SecUser.FIELD_Password, companyUser.getPassword());
companyUser.setIsAccountVerified(Boolean.TRUE);
if(company.getIsVerified()!=Boolean.TRUE)
{
company.setIsVerified(Boolean.TRUE);
nextPage = nextPage + "&CompanyUserID=" + companyUser.getObjectID();
}
else
{
nextPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request);
}
sendMail(companyUser, request);
request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Password resetted", companyUser, secUser);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User finished", companyUser, secUser);
process.completeAndRestart();
return new ProcessRedirectResult(nextPage, new String[0]);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountCreatedEmailer"));
}
protected void sendMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from VerifyCompanyUserFP to :: ", companyUser);
Map defaultParams = CollectionUtils.EMPTY_MAP;
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getUser().getUserName()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent Account Created mail successfully from " + VerifyCompanyUserFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for CompanyUser :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
}
\ No newline at end of file
...@@ -48,6 +48,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -48,6 +48,7 @@ public abstract class BaseCompany extends BaseBusinessClass
public static final String FIELD_HiringTeamType = "HiringTeamType"; public static final String FIELD_HiringTeamType = "HiringTeamType";
public static final String FIELD_Industry = "Industry"; public static final String FIELD_Industry = "Industry";
public static final String FIELD_TimeZone = "TimeZone"; public static final String FIELD_TimeZone = "TimeZone";
public static final String FIELD_IsVerified = "IsVerified";
public static final String FIELD_State = "State"; public static final String FIELD_State = "State";
public static final String FIELD_Country = "Country"; public static final String FIELD_Country = "Country";
public static final String FIELD_PostCode = "PostCode"; public static final String FIELD_PostCode = "PostCode";
...@@ -68,6 +69,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -68,6 +69,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final EnumeratedAttributeHelper<Company, HiringTeamType> HELPER_HiringTeamType = new EnumeratedAttributeHelper<Company, HiringTeamType> (HiringTeamType.FACTORY_HiringTeamType); private static final EnumeratedAttributeHelper<Company, HiringTeamType> HELPER_HiringTeamType = new EnumeratedAttributeHelper<Company, HiringTeamType> (HiringTeamType.FACTORY_HiringTeamType);
private static final EnumeratedAttributeHelper<Company, Industry> HELPER_Industry = new EnumeratedAttributeHelper<Company, Industry> (Industry.FACTORY_Industry); private static final EnumeratedAttributeHelper<Company, Industry> HELPER_Industry = new EnumeratedAttributeHelper<Company, Industry> (Industry.FACTORY_Industry);
private static final EnumeratedAttributeHelper<Company, TimeZone> HELPER_TimeZone = new EnumeratedAttributeHelper<Company, TimeZone> (TimeZone.FACTORY_TimeZone); private static final EnumeratedAttributeHelper<Company, TimeZone> HELPER_TimeZone = new EnumeratedAttributeHelper<Company, TimeZone> (TimeZone.FACTORY_TimeZone);
private static final DefaultAttributeHelper<Company> HELPER_IsVerified = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Company, State> HELPER_State = new EnumeratedAttributeHelper<Company, State> (State.FACTORY_State); private static final EnumeratedAttributeHelper<Company, State> HELPER_State = new EnumeratedAttributeHelper<Company, State> (State.FACTORY_State);
private static final EnumeratedAttributeHelper<Company, Countries> HELPER_Country = new EnumeratedAttributeHelper<Company, Countries> (Countries.FACTORY_Countries); private static final EnumeratedAttributeHelper<Company, Countries> HELPER_Country = new EnumeratedAttributeHelper<Company, Countries> (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper<Company> HELPER_PostCode = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Company> HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
...@@ -80,6 +82,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -80,6 +82,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private HiringTeamType _HiringTeamType; private HiringTeamType _HiringTeamType;
private Industry _Industry; private Industry _Industry;
private TimeZone _TimeZone; private TimeZone _TimeZone;
private Boolean _IsVerified;
private State _State; private State _State;
private Countries _Country; private Countries _Country;
private String _PostCode; private String _PostCode;
...@@ -104,6 +107,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -104,6 +107,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final AttributeValidator[] FIELD_HiringTeamType_Validators; private static final AttributeValidator[] FIELD_HiringTeamType_Validators;
private static final AttributeValidator[] FIELD_Industry_Validators; private static final AttributeValidator[] FIELD_Industry_Validators;
private static final AttributeValidator[] FIELD_TimeZone_Validators; private static final AttributeValidator[] FIELD_TimeZone_Validators;
private static final AttributeValidator[] FIELD_IsVerified_Validators;
private static final AttributeValidator[] FIELD_State_Validators; private static final AttributeValidator[] FIELD_State_Validators;
private static final AttributeValidator[] FIELD_Country_Validators; private static final AttributeValidator[] FIELD_Country_Validators;
private static final AttributeValidator[] FIELD_PostCode_Validators; private static final AttributeValidator[] FIELD_PostCode_Validators;
...@@ -131,6 +135,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -131,6 +135,7 @@ public abstract class BaseCompany extends BaseBusinessClass
FIELD_HiringTeamType_Validators = (AttributeValidator[])setupAttribMetaData_HiringTeamType(validatorMapping).toArray (new AttributeValidator[0]); FIELD_HiringTeamType_Validators = (AttributeValidator[])setupAttribMetaData_HiringTeamType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Industry_Validators = (AttributeValidator[])setupAttribMetaData_Industry(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Industry_Validators = (AttributeValidator[])setupAttribMetaData_Industry(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TimeZone_Validators = (AttributeValidator[])setupAttribMetaData_TimeZone(validatorMapping).toArray (new AttributeValidator[0]); FIELD_TimeZone_Validators = (AttributeValidator[])setupAttribMetaData_TimeZone(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsVerified(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_State_Validators = (AttributeValidator[])setupAttribMetaData_State(validatorMapping).toArray (new AttributeValidator[0]); FIELD_State_Validators = (AttributeValidator[])setupAttribMetaData_State(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Country_Validators = (AttributeValidator[])setupAttribMetaData_Country(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Country_Validators = (AttributeValidator[])setupAttribMetaData_Country(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PostCode_Validators = (AttributeValidator[])setupAttribMetaData_PostCode(validatorMapping).toArray (new AttributeValidator[0]); FIELD_PostCode_Validators = (AttributeValidator[])setupAttribMetaData_PostCode(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -274,6 +279,25 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -274,6 +279,25 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_IsVerified(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_verified");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsVerified");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.IsVerified:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_IsVerified, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "IsVerified", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.IsVerified:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_State(Map validatorMapping) private static List setupAttribMetaData_State(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -406,6 +430,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -406,6 +430,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (_HiringTeamType)); _HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (_HiringTeamType));
_Industry = (Industry)(HELPER_Industry.initialise (_Industry)); _Industry = (Industry)(HELPER_Industry.initialise (_Industry));
_TimeZone = (TimeZone)(HELPER_TimeZone.initialise (_TimeZone)); _TimeZone = (TimeZone)(HELPER_TimeZone.initialise (_TimeZone));
_IsVerified = (Boolean)(Boolean.FALSE);
_State = (State)(State.WA); _State = (State)(State.WA);
_Country = (Countries)(Countries.AU); _Country = (Countries)(Countries.AU);
_PostCode = (String)(HELPER_PostCode.initialise (_PostCode)); _PostCode = (String)(HELPER_PostCode.initialise (_PostCode));
...@@ -835,6 +860,104 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -835,6 +860,104 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
/** /**
* Get the attribute IsVerified
*/
public Boolean getIsVerified ()
{
assertValid();
Boolean valToReturn = _IsVerified;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getIsVerified ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsVerifiedChange (Boolean newIsVerified) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsVerifiedChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsVerified ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsVerified. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsVerified (Boolean newIsVerified) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsVerified.compare (_IsVerified, newIsVerified);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newIsVerified = bhd.setIsVerified ((Company)this, newIsVerified);
oldAndNewIdentical = HELPER_IsVerified.compare (_IsVerified, newIsVerified);
}
if (FIELD_IsVerified_Validators.length > 0)
{
Object newIsVerifiedObj = HELPER_IsVerified.toObject (newIsVerified);
if (newIsVerifiedObj != null)
{
int loopMax = FIELD_IsVerified_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_IsVerified);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsVerified_Validators[v].checkAttribute (this, FIELD_IsVerified, metadata, newIsVerifiedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsVerified () != FieldWriteability.FALSE, "Field IsVerified is not writeable");
preIsVerifiedChange (newIsVerified);
markFieldChange (FIELD_IsVerified);
_IsVerified = newIsVerified;
postFieldChange (FIELD_IsVerified);
postIsVerifiedChange ();
}
}
/**
* Get the attribute State * Get the attribute State
*/ */
public State getState () public State getState ()
...@@ -1945,6 +2068,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1945,6 +2068,7 @@ public abstract class BaseCompany extends BaseBusinessClass
tl_companyPSet.setAttrib (FIELD_HiringTeamType, HELPER_HiringTeamType.toObject (_HiringTeamType)); // tl_companyPSet.setAttrib (FIELD_HiringTeamType, HELPER_HiringTeamType.toObject (_HiringTeamType)); //
tl_companyPSet.setAttrib (FIELD_Industry, HELPER_Industry.toObject (_Industry)); // tl_companyPSet.setAttrib (FIELD_Industry, HELPER_Industry.toObject (_Industry)); //
tl_companyPSet.setAttrib (FIELD_TimeZone, HELPER_TimeZone.toObject (_TimeZone)); // tl_companyPSet.setAttrib (FIELD_TimeZone, HELPER_TimeZone.toObject (_TimeZone)); //
tl_companyPSet.setAttrib (FIELD_IsVerified, HELPER_IsVerified.toObject (_IsVerified)); //
tl_companyPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); // tl_companyPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); //
tl_companyPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); // tl_companyPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); //
tl_companyPSet.setAttrib (FIELD_PostCode, HELPER_PostCode.toObject (_PostCode)); // tl_companyPSet.setAttrib (FIELD_PostCode, HELPER_PostCode.toObject (_PostCode)); //
...@@ -1969,6 +2093,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1969,6 +2093,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.fromObject (_HiringTeamType, tl_companyPSet.getAttrib (FIELD_HiringTeamType))); // _HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.fromObject (_HiringTeamType, tl_companyPSet.getAttrib (FIELD_HiringTeamType))); //
_Industry = (Industry)(HELPER_Industry.fromObject (_Industry, tl_companyPSet.getAttrib (FIELD_Industry))); // _Industry = (Industry)(HELPER_Industry.fromObject (_Industry, tl_companyPSet.getAttrib (FIELD_Industry))); //
_TimeZone = (TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, tl_companyPSet.getAttrib (FIELD_TimeZone))); // _TimeZone = (TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, tl_companyPSet.getAttrib (FIELD_TimeZone))); //
_IsVerified = (Boolean)(HELPER_IsVerified.fromObject (_IsVerified, tl_companyPSet.getAttrib (FIELD_IsVerified))); //
_State = (State)(HELPER_State.fromObject (_State, tl_companyPSet.getAttrib (FIELD_State))); // _State = (State)(HELPER_State.fromObject (_State, tl_companyPSet.getAttrib (FIELD_State))); //
_Country = (Countries)(HELPER_Country.fromObject (_Country, tl_companyPSet.getAttrib (FIELD_Country))); // _Country = (Countries)(HELPER_Country.fromObject (_Country, tl_companyPSet.getAttrib (FIELD_Country))); //
_PostCode = (String)(HELPER_PostCode.fromObject (_PostCode, tl_companyPSet.getAttrib (FIELD_PostCode))); // _PostCode = (String)(HELPER_PostCode.fromObject (_PostCode, tl_companyPSet.getAttrib (FIELD_PostCode))); //
...@@ -2028,6 +2153,15 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2028,6 +2153,15 @@ public abstract class BaseCompany extends BaseBusinessClass
try try
{ {
setIsVerified (otherCompany.getIsVerified ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setState (otherCompany.getState ()); setState (otherCompany.getState ());
} }
catch (FieldException ex) catch (FieldException ex)
...@@ -2090,6 +2224,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2090,6 +2224,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = sourceCompany._HiringTeamType; _HiringTeamType = sourceCompany._HiringTeamType;
_Industry = sourceCompany._Industry; _Industry = sourceCompany._Industry;
_TimeZone = sourceCompany._TimeZone; _TimeZone = sourceCompany._TimeZone;
_IsVerified = sourceCompany._IsVerified;
_State = sourceCompany._State; _State = sourceCompany._State;
_Country = sourceCompany._Country; _Country = sourceCompany._Country;
_PostCode = sourceCompany._PostCode; _PostCode = sourceCompany._PostCode;
...@@ -2156,6 +2291,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2156,6 +2291,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.readExternal (_HiringTeamType, vals.get(FIELD_HiringTeamType))); // _HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.readExternal (_HiringTeamType, vals.get(FIELD_HiringTeamType))); //
_Industry = (Industry)(HELPER_Industry.readExternal (_Industry, vals.get(FIELD_Industry))); // _Industry = (Industry)(HELPER_Industry.readExternal (_Industry, vals.get(FIELD_Industry))); //
_TimeZone = (TimeZone)(HELPER_TimeZone.readExternal (_TimeZone, vals.get(FIELD_TimeZone))); // _TimeZone = (TimeZone)(HELPER_TimeZone.readExternal (_TimeZone, vals.get(FIELD_TimeZone))); //
_IsVerified = (Boolean)(HELPER_IsVerified.readExternal (_IsVerified, vals.get(FIELD_IsVerified))); //
_State = (State)(HELPER_State.readExternal (_State, vals.get(FIELD_State))); // _State = (State)(HELPER_State.readExternal (_State, vals.get(FIELD_State))); //
_Country = (Countries)(HELPER_Country.readExternal (_Country, vals.get(FIELD_Country))); // _Country = (Countries)(HELPER_Country.readExternal (_Country, vals.get(FIELD_Country))); //
_PostCode = (String)(HELPER_PostCode.readExternal (_PostCode, vals.get(FIELD_PostCode))); // _PostCode = (String)(HELPER_PostCode.readExternal (_PostCode, vals.get(FIELD_PostCode))); //
...@@ -2179,6 +2315,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2179,6 +2315,7 @@ public abstract class BaseCompany extends BaseBusinessClass
vals.put (FIELD_HiringTeamType, HELPER_HiringTeamType.writeExternal (_HiringTeamType)); vals.put (FIELD_HiringTeamType, HELPER_HiringTeamType.writeExternal (_HiringTeamType));
vals.put (FIELD_Industry, HELPER_Industry.writeExternal (_Industry)); vals.put (FIELD_Industry, HELPER_Industry.writeExternal (_Industry));
vals.put (FIELD_TimeZone, HELPER_TimeZone.writeExternal (_TimeZone)); vals.put (FIELD_TimeZone, HELPER_TimeZone.writeExternal (_TimeZone));
vals.put (FIELD_IsVerified, HELPER_IsVerified.writeExternal (_IsVerified));
vals.put (FIELD_State, HELPER_State.writeExternal (_State)); vals.put (FIELD_State, HELPER_State.writeExternal (_State));
vals.put (FIELD_Country, HELPER_Country.writeExternal (_Country)); vals.put (FIELD_Country, HELPER_Country.writeExternal (_Country));
vals.put (FIELD_PostCode, HELPER_PostCode.writeExternal (_PostCode)); vals.put (FIELD_PostCode, HELPER_PostCode.writeExternal (_PostCode));
...@@ -2216,6 +2353,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2216,6 +2353,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
listener.notifyFieldChange(this, other, FIELD_TimeZone, HELPER_TimeZone.toObject(this._TimeZone), HELPER_TimeZone.toObject(otherCompany._TimeZone)); listener.notifyFieldChange(this, other, FIELD_TimeZone, HELPER_TimeZone.toObject(this._TimeZone), HELPER_TimeZone.toObject(otherCompany._TimeZone));
} }
if (!HELPER_IsVerified.compare(this._IsVerified, otherCompany._IsVerified))
{
listener.notifyFieldChange(this, other, FIELD_IsVerified, HELPER_IsVerified.toObject(this._IsVerified), HELPER_IsVerified.toObject(otherCompany._IsVerified));
}
if (!HELPER_State.compare(this._State, otherCompany._State)) if (!HELPER_State.compare(this._State, otherCompany._State))
{ {
listener.notifyFieldChange(this, other, FIELD_State, HELPER_State.toObject(this._State), HELPER_State.toObject(otherCompany._State)); listener.notifyFieldChange(this, other, FIELD_State, HELPER_State.toObject(this._State), HELPER_State.toObject(otherCompany._State));
...@@ -2265,6 +2406,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2265,6 +2406,7 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor.visitField(this, FIELD_HiringTeamType, HELPER_HiringTeamType.toObject(getHiringTeamType())); visitor.visitField(this, FIELD_HiringTeamType, HELPER_HiringTeamType.toObject(getHiringTeamType()));
visitor.visitField(this, FIELD_Industry, HELPER_Industry.toObject(getIndustry())); visitor.visitField(this, FIELD_Industry, HELPER_Industry.toObject(getIndustry()));
visitor.visitField(this, FIELD_TimeZone, HELPER_TimeZone.toObject(getTimeZone())); visitor.visitField(this, FIELD_TimeZone, HELPER_TimeZone.toObject(getTimeZone()));
visitor.visitField(this, FIELD_IsVerified, HELPER_IsVerified.toObject(getIsVerified()));
visitor.visitField(this, FIELD_State, HELPER_State.toObject(getState())); visitor.visitField(this, FIELD_State, HELPER_State.toObject(getState()));
visitor.visitField(this, FIELD_Country, HELPER_Country.toObject(getCountry())); visitor.visitField(this, FIELD_Country, HELPER_Country.toObject(getCountry()));
visitor.visitField(this, FIELD_PostCode, HELPER_PostCode.toObject(getPostCode())); visitor.visitField(this, FIELD_PostCode, HELPER_PostCode.toObject(getPostCode()));
...@@ -2334,6 +2476,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2334,6 +2476,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return filter.matches (getTimeZone ()); return filter.matches (getTimeZone ());
} }
else if (attribName.equals (FIELD_IsVerified))
{
return filter.matches (getIsVerified ());
}
else if (attribName.equals (FIELD_State)) else if (attribName.equals (FIELD_State))
{ {
return filter.matches (getState ()); return filter.matches (getState ());
...@@ -2413,6 +2559,12 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2413,6 +2559,12 @@ public abstract class BaseCompany extends BaseBusinessClass
return this; return this;
} }
public SearchAll andIsVerified (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_company.is_verified", "IsVerified");
return this;
}
public SearchAll andState (QueryFilter<State> filter) public SearchAll andState (QueryFilter<State> filter)
{ {
filter.addFilter (context, "tl_company.state", "State"); filter.addFilter (context, "tl_company.state", "State");
...@@ -2500,6 +2652,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2500,6 +2652,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return HELPER_TimeZone.toObject (getTimeZone ()); return HELPER_TimeZone.toObject (getTimeZone ());
} }
else if (attribName.equals (FIELD_IsVerified))
{
return HELPER_IsVerified.toObject (getIsVerified ());
}
else if (attribName.equals (FIELD_State)) else if (attribName.equals (FIELD_State))
{ {
return HELPER_State.toObject (getState ()); return HELPER_State.toObject (getState ());
...@@ -2549,6 +2705,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2549,6 +2705,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return HELPER_TimeZone; return HELPER_TimeZone;
} }
else if (attribName.equals (FIELD_IsVerified))
{
return HELPER_IsVerified;
}
else if (attribName.equals (FIELD_State)) else if (attribName.equals (FIELD_State))
{ {
return HELPER_State; return HELPER_State;
...@@ -2598,6 +2758,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2598,6 +2758,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
setTimeZone ((TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, attribValue))); setTimeZone ((TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, attribValue)));
} }
else if (attribName.equals (FIELD_IsVerified))
{
setIsVerified ((Boolean)(HELPER_IsVerified.fromObject (_IsVerified, attribValue)));
}
else if (attribName.equals (FIELD_State)) else if (attribName.equals (FIELD_State))
{ {
setState ((State)(HELPER_State.fromObject (_State, attribValue))); setState ((State)(HELPER_State.fromObject (_State, attribValue)));
...@@ -2654,6 +2818,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2654,6 +2818,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return getWriteability_TimeZone (); return getWriteability_TimeZone ();
} }
else if (fieldName.equals (FIELD_IsVerified))
{
return getWriteability_IsVerified ();
}
else if (fieldName.equals (FIELD_State)) else if (fieldName.equals (FIELD_State))
{ {
return getWriteability_State (); return getWriteability_State ();
...@@ -2716,6 +2884,11 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2716,6 +2884,11 @@ public abstract class BaseCompany extends BaseBusinessClass
fields.add (FIELD_TimeZone); fields.add (FIELD_TimeZone);
} }
if (getWriteability_IsVerified () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsVerified);
}
if (getWriteability_State () != FieldWriteability.TRUE) if (getWriteability_State () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_State); fields.add (FIELD_State);
...@@ -2754,6 +2927,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2754,6 +2927,7 @@ public abstract class BaseCompany extends BaseBusinessClass
result.add(HELPER_HiringTeamType.getAttribObject (getClass (), _HiringTeamType, false, FIELD_HiringTeamType)); result.add(HELPER_HiringTeamType.getAttribObject (getClass (), _HiringTeamType, false, FIELD_HiringTeamType));
result.add(HELPER_Industry.getAttribObject (getClass (), _Industry, false, FIELD_Industry)); result.add(HELPER_Industry.getAttribObject (getClass (), _Industry, false, FIELD_Industry));
result.add(HELPER_TimeZone.getAttribObject (getClass (), _TimeZone, false, FIELD_TimeZone)); result.add(HELPER_TimeZone.getAttribObject (getClass (), _TimeZone, false, FIELD_TimeZone));
result.add(HELPER_IsVerified.getAttribObject (getClass (), _IsVerified, false, FIELD_IsVerified));
result.add(HELPER_State.getAttribObject (getClass (), _State, false, FIELD_State)); result.add(HELPER_State.getAttribObject (getClass (), _State, false, FIELD_State));
result.add(HELPER_Country.getAttribObject (getClass (), _Country, false, FIELD_Country)); result.add(HELPER_Country.getAttribObject (getClass (), _Country, false, FIELD_Country));
result.add(HELPER_PostCode.getAttribObject (getClass (), _PostCode, false, FIELD_PostCode)); result.add(HELPER_PostCode.getAttribObject (getClass (), _PostCode, false, FIELD_PostCode));
...@@ -2882,6 +3056,24 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -2882,6 +3056,24 @@ public abstract class BaseCompany extends BaseBusinessClass
} }
/** /**
* Get the attribute IsVerified
*/
public Boolean getIsVerified (Company obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsVerified.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsVerified (Company obj, Boolean newIsVerified) throws FieldException
{
return newIsVerified;
}
/**
* Get the attribute State * Get the attribute State
*/ */
public State getState (Company obj, State original) public State getState (Company obj, State original)
...@@ -3047,6 +3239,10 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -3047,6 +3239,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
return toTimeZone (); return toTimeZone ();
} }
if (name.equals ("IsVerified"))
{
return toIsVerified ();
}
if (name.equals ("State")) if (name.equals ("State"))
{ {
return toState (); return toState ();
...@@ -3085,6 +3281,8 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -3085,6 +3281,8 @@ public abstract class BaseCompany extends BaseBusinessClass
public PipeLine<From, TimeZone> toTimeZone () { return pipe(new ORMAttributePipe<Me, TimeZone>(FIELD_TimeZone)); } public PipeLine<From, TimeZone> toTimeZone () { return pipe(new ORMAttributePipe<Me, TimeZone>(FIELD_TimeZone)); }
public PipeLine<From, Boolean> toIsVerified () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsVerified)); }
public PipeLine<From, State> toState () { return pipe(new ORMAttributePipe<Me, State>(FIELD_State)); } public PipeLine<From, State> toState () { return pipe(new ORMAttributePipe<Me, State>(FIELD_State)); }
public PipeLine<From, Countries> toCountry () { return pipe(new ORMAttributePipe<Me, Countries>(FIELD_Country)); } public PipeLine<From, Countries> toCountry () { return pipe(new ORMAttributePipe<Me, Countries>(FIELD_Country)); }
......
...@@ -49,6 +49,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -49,6 +49,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate"; public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate";
public static final String FIELD_VerificationKey = "VerificationKey"; public static final String FIELD_VerificationKey = "VerificationKey";
public static final String FIELD_IsAccountVerified = "IsAccountVerified"; public static final String FIELD_IsAccountVerified = "IsAccountVerified";
public static final String FIELD_Password = "Password";
public static final String FIELD_ConfirmPassword = "ConfirmPassword";
public static final String SINGLEREFERENCE_Company = "Company"; public static final String SINGLEREFERENCE_Company = "Company";
public static final String BACKREF_Company = ""; public static final String BACKREF_Company = "";
...@@ -65,6 +67,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -65,6 +67,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_Password = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_ConfirmPassword = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -75,6 +79,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -75,6 +79,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private Date _VerificationMailSendDate; private Date _VerificationMailSendDate;
private String _VerificationKey; private String _VerificationKey;
private Boolean _IsAccountVerified; private Boolean _IsAccountVerified;
private String _Password;
private String _ConfirmPassword;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -88,6 +94,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -88,6 +94,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final Map ATTRIBUTES_METADATA_CompanyUser = new HashMap (); private static final Map ATTRIBUTES_METADATA_CompanyUser = new HashMap ();
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Password_Validators;
private static final AttributeValidator[] FIELD_ConfirmPassword_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordMailSendDate_Validators; private static final AttributeValidator[] FIELD_ForgotPasswordMailSendDate_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators; private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators;
private static final AttributeValidator[] FIELD_Role_Validators; private static final AttributeValidator[] FIELD_Role_Validators;
...@@ -110,6 +118,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -110,6 +118,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping")); Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_Company(); setupAssocMetaData_Company();
FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordMailSendDate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ForgotPasswordMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordMailSendDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Role_Validators = (AttributeValidator[])setupAttribMetaData_Role(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Role_Validators = (AttributeValidator[])setupAttribMetaData_Role(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -147,6 +157,40 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -147,6 +157,40 @@ public abstract class BaseCompanyUser extends SecUserExtension
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_Password(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "Password");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.Password:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_Password, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "Password", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.Password:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ConfirmPassword(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "ConfirmPassword");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.ConfirmPassword:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_ConfirmPassword, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "ConfirmPassword", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.ConfirmPassword:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ForgotPasswordMailSendDate(Map validatorMapping) private static List setupAttribMetaData_ForgotPasswordMailSendDate(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -313,6 +357,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -313,6 +357,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate)); _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate));
_VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey)); _VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey));
_IsAccountVerified = (Boolean)(Boolean.FALSE); _IsAccountVerified = (Boolean)(Boolean.FALSE);
_Password = (String)(HELPER_Password.initialise (_Password));
_ConfirmPassword = (String)(HELPER_ConfirmPassword.initialise (_ConfirmPassword));
} }
...@@ -1025,6 +1071,202 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1025,6 +1071,202 @@ public abstract class BaseCompanyUser extends SecUserExtension
} }
} }
/**
* Get the attribute Password
*/
public String getPassword ()
{
assertValid();
String valToReturn = _Password;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getPassword ((CompanyUser)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void prePasswordChange (String newPassword) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postPasswordChange () throws FieldException
{
}
public FieldWriteability getWriteability_Password ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Password. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPassword (String newPassword) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Password.compare (_Password, newPassword);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newPassword = bhd.setPassword ((CompanyUser)this, newPassword);
oldAndNewIdentical = HELPER_Password.compare (_Password, newPassword);
}
if (FIELD_Password_Validators.length > 0)
{
Object newPasswordObj = HELPER_Password.toObject (newPassword);
if (newPasswordObj != null)
{
int loopMax = FIELD_Password_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_Password);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Password_Validators[v].checkAttribute (this, FIELD_Password, metadata, newPasswordObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Password () != FieldWriteability.FALSE, "Field Password is not writeable");
prePasswordChange (newPassword);
markFieldChange (FIELD_Password);
_Password = newPassword;
postFieldChange (FIELD_Password);
postPasswordChange ();
}
}
/**
* Get the attribute ConfirmPassword
*/
public String getConfirmPassword ()
{
assertValid();
String valToReturn = _ConfirmPassword;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getConfirmPassword ((CompanyUser)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preConfirmPasswordChange (String newConfirmPassword) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postConfirmPasswordChange () throws FieldException
{
}
public FieldWriteability getWriteability_ConfirmPassword ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ConfirmPassword. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setConfirmPassword (String newConfirmPassword) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ConfirmPassword.compare (_ConfirmPassword, newConfirmPassword);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newConfirmPassword = bhd.setConfirmPassword ((CompanyUser)this, newConfirmPassword);
oldAndNewIdentical = HELPER_ConfirmPassword.compare (_ConfirmPassword, newConfirmPassword);
}
if (FIELD_ConfirmPassword_Validators.length > 0)
{
Object newConfirmPasswordObj = HELPER_ConfirmPassword.toObject (newConfirmPassword);
if (newConfirmPasswordObj != null)
{
int loopMax = FIELD_ConfirmPassword_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_ConfirmPassword);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ConfirmPassword_Validators[v].checkAttribute (this, FIELD_ConfirmPassword, metadata, newConfirmPasswordObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ConfirmPassword () != FieldWriteability.FALSE, "Field ConfirmPassword is not writeable");
preConfirmPasswordChange (newConfirmPassword);
markFieldChange (FIELD_ConfirmPassword);
_ConfirmPassword = newConfirmPassword;
postFieldChange (FIELD_ConfirmPassword);
postConfirmPasswordChange ();
}
}
/** /**
...@@ -1554,6 +1796,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1554,6 +1796,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_VerificationMailSendDate = sourceCompanyUser._VerificationMailSendDate; _VerificationMailSendDate = sourceCompanyUser._VerificationMailSendDate;
_VerificationKey = sourceCompanyUser._VerificationKey; _VerificationKey = sourceCompanyUser._VerificationKey;
_IsAccountVerified = sourceCompanyUser._IsAccountVerified; _IsAccountVerified = sourceCompanyUser._IsAccountVerified;
_Password = sourceCompanyUser._Password;
_ConfirmPassword = sourceCompanyUser._ConfirmPassword;
} }
} }
...@@ -1614,6 +1858,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1614,6 +1858,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); // _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); // _VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); // _IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); //
_Password = (String)(HELPER_Password.readExternal (_Password, vals.get(FIELD_Password))); //
_ConfirmPassword = (String)(HELPER_ConfirmPassword.readExternal (_ConfirmPassword, vals.get(FIELD_ConfirmPassword))); //
_Company.readExternalData(vals.get(SINGLEREFERENCE_Company)); _Company.readExternalData(vals.get(SINGLEREFERENCE_Company));
} }
...@@ -1633,6 +1879,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1633,6 +1879,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate)); vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate));
vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey)); vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey));
vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified)); vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified));
vals.put (FIELD_Password, HELPER_Password.writeExternal (_Password));
vals.put (FIELD_ConfirmPassword, HELPER_ConfirmPassword.writeExternal (_ConfirmPassword));
vals.put (SINGLEREFERENCE_Company, _Company.writeExternalData()); vals.put (SINGLEREFERENCE_Company, _Company.writeExternalData());
} }
...@@ -1690,6 +1938,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1690,6 +1938,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
super.visitAttributes (visitor); super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Password, HELPER_Password.toObject(getPassword()));
visitor.visitField(this, FIELD_ConfirmPassword, HELPER_ConfirmPassword.toObject(getConfirmPassword()));
} }
...@@ -2040,6 +2290,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2040,6 +2290,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return HELPER_IsAccountVerified.toObject (getIsAccountVerified ()); return HELPER_IsAccountVerified.toObject (getIsAccountVerified ());
} }
else if (attribName.equals (FIELD_Password))
{
return HELPER_Password.toObject (getPassword ());
}
else if (attribName.equals (FIELD_ConfirmPassword))
{
return HELPER_ConfirmPassword.toObject (getConfirmPassword ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -2081,6 +2339,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2081,6 +2339,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return HELPER_IsAccountVerified; return HELPER_IsAccountVerified;
} }
else if (attribName.equals (FIELD_Password))
{
return HELPER_Password;
}
else if (attribName.equals (FIELD_ConfirmPassword))
{
return HELPER_ConfirmPassword;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -2122,6 +2388,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2122,6 +2388,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue))); setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue)));
} }
else if (attribName.equals (FIELD_Password))
{
setPassword ((String)(HELPER_Password.fromObject (_Password, attribValue)));
}
else if (attribName.equals (FIELD_ConfirmPassword))
{
setConfirmPassword ((String)(HELPER_ConfirmPassword.fromObject (_ConfirmPassword, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -2174,6 +2448,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2174,6 +2448,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return getWriteability_Company (); return getWriteability_Company ();
} }
else if (fieldName.equals (FIELD_Password))
{
return getWriteability_Password ();
}
else if (fieldName.equals (FIELD_ConfirmPassword))
{
return getWriteability_ConfirmPassword ();
}
else else
{ {
return super.getWriteable (fieldName); return super.getWriteable (fieldName);
...@@ -2219,6 +2501,16 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2219,6 +2501,16 @@ public abstract class BaseCompanyUser extends SecUserExtension
fields.add (FIELD_IsAccountVerified); fields.add (FIELD_IsAccountVerified);
} }
if (getWriteability_Password () != FieldWriteability.TRUE)
{
fields.add (FIELD_Password);
}
if (getWriteability_ConfirmPassword () != FieldWriteability.TRUE)
{
fields.add (FIELD_ConfirmPassword);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -2235,6 +2527,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2235,6 +2527,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate)); result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate));
result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey)); result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey));
result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified)); result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified));
result.add(HELPER_Password.getAttribObject (getClass (), _Password, false, FIELD_Password));
result.add(HELPER_ConfirmPassword.getAttribObject (getClass (), _ConfirmPassword, false, FIELD_ConfirmPassword));
return result; return result;
} }
...@@ -2411,6 +2705,42 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2411,6 +2705,42 @@ public abstract class BaseCompanyUser extends SecUserExtension
return newIsAccountVerified; return newIsAccountVerified;
} }
/**
* Get the attribute Password
*/
public String getPassword (CompanyUser obj, String original)
{
return original;
}
/**
* Change the value set for attribute Password.
* May modify the field beforehand
* Occurs before validation.
*/
public String setPassword (CompanyUser obj, String newPassword) throws FieldException
{
return newPassword;
}
/**
* Get the attribute ConfirmPassword
*/
public String getConfirmPassword (CompanyUser obj, String original)
{
return original;
}
/**
* Change the value set for attribute ConfirmPassword.
* May modify the field beforehand
* Occurs before validation.
*/
public String setConfirmPassword (CompanyUser obj, String newConfirmPassword) throws FieldException
{
return newConfirmPassword;
}
} }
...@@ -2463,6 +2793,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2463,6 +2793,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
public PipeLine<From, ? extends Object> to(String name) public PipeLine<From, ? extends Object> to(String name)
{ {
if (name.equals ("Password"))
{
return toPassword ();
}
if (name.equals ("ConfirmPassword"))
{
return toConfirmPassword ();
}
if (name.equals ("ForgotPasswordMailSendDate")) if (name.equals ("ForgotPasswordMailSendDate"))
{ {
return toForgotPasswordMailSendDate (); return toForgotPasswordMailSendDate ();
...@@ -2501,6 +2839,10 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2501,6 +2839,10 @@ public abstract class BaseCompanyUser extends SecUserExtension
} }
public PipeLine<From, String> toPassword () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Password)); }
public PipeLine<From, String> toConfirmPassword () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ConfirmPassword)); }
public PipeLine<From, Date> toForgotPasswordMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ForgotPasswordMailSendDate)); } public PipeLine<From, Date> toForgotPasswordMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ForgotPasswordMailSendDate)); }
public PipeLine<From, String> toForgotPasswordKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ForgotPasswordKey)); } public PipeLine<From, String> toForgotPasswordKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ForgotPasswordKey)); }
...@@ -2526,6 +2868,16 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2526,6 +2868,16 @@ public abstract class BaseCompanyUser extends SecUserExtension
public boolean isTransientAttrib(String attribName) public boolean isTransientAttrib(String attribName)
{ {
if(CollectionUtils.equals(attribName, "Password"))
{
return true;
}
if(CollectionUtils.equals(attribName, "ConfirmPassword"))
{
return true;
}
return super.isTransientAttrib(attribName); return super.isTransientAttrib(attribName);
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" mandatory="false" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="Industry" type="Industry" dbcol="industry" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="IsVerified" type="Boolean" dbcol="is_verified" defaultValue="Boolean.FALSE"/>
<ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/> <ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
......
...@@ -33,6 +33,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -33,6 +33,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private HiringTeamType dummyHiringTeamType; private HiringTeamType dummyHiringTeamType;
private Industry dummyIndustry; private Industry dummyIndustry;
private TimeZone dummyTimeZone; private TimeZone dummyTimeZone;
private Boolean dummyIsVerified;
private State dummyState; private State dummyState;
private Countries dummyCountry; private Countries dummyCountry;
private String dummyPostCode; private String dummyPostCode;
...@@ -45,6 +46,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -45,6 +46,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private static final EnumeratedAttributeHelper HELPER_HiringTeamType = new EnumeratedAttributeHelper (HiringTeamType.FACTORY_HiringTeamType); private static final EnumeratedAttributeHelper HELPER_HiringTeamType = new EnumeratedAttributeHelper (HiringTeamType.FACTORY_HiringTeamType);
private static final EnumeratedAttributeHelper HELPER_Industry = new EnumeratedAttributeHelper (Industry.FACTORY_Industry); private static final EnumeratedAttributeHelper HELPER_Industry = new EnumeratedAttributeHelper (Industry.FACTORY_Industry);
private static final EnumeratedAttributeHelper HELPER_TimeZone = new EnumeratedAttributeHelper (TimeZone.FACTORY_TimeZone); private static final EnumeratedAttributeHelper HELPER_TimeZone = new EnumeratedAttributeHelper (TimeZone.FACTORY_TimeZone);
private static final DefaultAttributeHelper HELPER_IsVerified = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State); private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State);
private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries); private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper HELPER_PostCode = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
...@@ -60,6 +62,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -60,6 +62,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
dummyHiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (dummyHiringTeamType)); dummyHiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (dummyHiringTeamType));
dummyIndustry = (Industry)(HELPER_Industry.initialise (dummyIndustry)); dummyIndustry = (Industry)(HELPER_Industry.initialise (dummyIndustry));
dummyTimeZone = (TimeZone)(HELPER_TimeZone.initialise (dummyTimeZone)); dummyTimeZone = (TimeZone)(HELPER_TimeZone.initialise (dummyTimeZone));
dummyIsVerified = (Boolean)(HELPER_IsVerified.initialise (dummyIsVerified));
dummyState = (State)(HELPER_State.initialise (dummyState)); dummyState = (State)(HELPER_State.initialise (dummyState));
dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry)); dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry));
dummyPostCode = (String)(HELPER_PostCode.initialise (dummyPostCode)); dummyPostCode = (String)(HELPER_PostCode.initialise (dummyPostCode));
...@@ -68,7 +71,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -68,7 +71,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
} }
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.added_by_user_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.added_by_user_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -123,6 +126,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -123,6 +126,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
!tl_companyPSet.containsAttrib(Company.FIELD_HiringTeamType)|| !tl_companyPSet.containsAttrib(Company.FIELD_HiringTeamType)||
!tl_companyPSet.containsAttrib(Company.FIELD_Industry)|| !tl_companyPSet.containsAttrib(Company.FIELD_Industry)||
!tl_companyPSet.containsAttrib(Company.FIELD_TimeZone)|| !tl_companyPSet.containsAttrib(Company.FIELD_TimeZone)||
!tl_companyPSet.containsAttrib(Company.FIELD_IsVerified)||
!tl_companyPSet.containsAttrib(Company.FIELD_State)|| !tl_companyPSet.containsAttrib(Company.FIELD_State)||
!tl_companyPSet.containsAttrib(Company.FIELD_Country)|| !tl_companyPSet.containsAttrib(Company.FIELD_Country)||
!tl_companyPSet.containsAttrib(Company.FIELD_PostCode)|| !tl_companyPSet.containsAttrib(Company.FIELD_PostCode)||
...@@ -198,10 +202,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -198,10 +202,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_company " + "UPDATE {PREFIX}tl_company " +
"SET company_name = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET company_name = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -461,6 +465,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -461,6 +465,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
tl_companyPSet.setAttrib(Company.FIELD_HiringTeamType, HELPER_HiringTeamType.getFromRS(dummyHiringTeamType, r, "hiring_team_type")); tl_companyPSet.setAttrib(Company.FIELD_HiringTeamType, HELPER_HiringTeamType.getFromRS(dummyHiringTeamType, r, "hiring_team_type"));
tl_companyPSet.setAttrib(Company.FIELD_Industry, HELPER_Industry.getFromRS(dummyIndustry, r, "industry")); tl_companyPSet.setAttrib(Company.FIELD_Industry, HELPER_Industry.getFromRS(dummyIndustry, r, "industry"));
tl_companyPSet.setAttrib(Company.FIELD_TimeZone, HELPER_TimeZone.getFromRS(dummyTimeZone, r, "time_zone")); tl_companyPSet.setAttrib(Company.FIELD_TimeZone, HELPER_TimeZone.getFromRS(dummyTimeZone, r, "time_zone"));
tl_companyPSet.setAttrib(Company.FIELD_IsVerified, HELPER_IsVerified.getFromRS(dummyIsVerified, r, "is_verified"));
tl_companyPSet.setAttrib(Company.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state")); tl_companyPSet.setAttrib(Company.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state"));
tl_companyPSet.setAttrib(Company.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country")); tl_companyPSet.setAttrib(Company.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_companyPSet.setAttrib(Company.FIELD_PostCode, HELPER_PostCode.getFromRS(dummyPostCode, r, "post_code")); tl_companyPSet.setAttrib(Company.FIELD_PostCode, HELPER_PostCode.getFromRS(dummyPostCode, r, "post_code"));
...@@ -484,10 +489,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr ...@@ -484,10 +489,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_company " + "INSERT INTO {PREFIX}tl_company " +
" (company_name, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (company_name, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray());
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED); tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<IMPORT value="oneit.security.*" /> <IMPORT value="oneit.security.*" />
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/>
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE"> <TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="ForgotPasswordMailSendDate" type="Date" dbcol="forgot_password_mail_send_date" /> <ATTRIB name="ForgotPasswordMailSendDate" type="Date" dbcol="forgot_password_mail_send_date" />
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/> <FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/>
<FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/> <FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/>
<FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/> <FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/>
<FORM name="*.verifyCompanyUser" factory="Participant" class="performa.form.VerifyCompanyUserFP">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
</FORM>
</NODE> </NODE>
<NODE name="job_assessment_criteria_add_jsp" factory="Participant"> <NODE name="job_assessment_criteria_add_jsp" factory="Participant">
......
...@@ -90,6 +90,8 @@ ...@@ -90,6 +90,8 @@
<INHERITS nodename="StandardJSP"/> <INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/verify_company.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/adminportal/verify_company.jsp"/>
<RenderMode name="CompanyProfile" preIncludeJSP="extensions/adminportal/company_profile.jsp"/>
<RenderMode name="InviteUsers" preIncludeJSP="extensions/adminportal/invite_users.jsp"/>
<RenderMode name="AuthError" preIncludeJSP="extensions/adminportal/auth_error.jsp"/> <RenderMode name="AuthError" preIncludeJSP="extensions/adminportal/auth_error.jsp"/>
</NODE> </NODE>
</MAP> </MAP>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<oneit:dynIncluded>
</oneit:dynIncluded>
...@@ -12,13 +12,24 @@ ...@@ -12,13 +12,24 @@
SecUser secUser = companyUser.getUser(); SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany(); Company company = companyUser.getCompany();
Boolean readOnly = companyUser.getStatus()!=ObjectStatus.NEW;
%> %>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Email Address</label> <label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true" readOnly="<%= readOnly? "true" : "false"%>"/> <%
if(companyUser.getStatus()==ObjectStatus.NEW)
{
%>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true"/>
<%
}
else
{
%>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" readonly="true" style="text-transform: lowercase" required="true"/>
<%
}
%>
</div> </div>
<div class="row"> <div class="row">
<div class="form-group text-left col-sm-6 col-xs-12"> <div class="form-group text-left col-sm-6 col-xs-12">
...@@ -36,6 +47,19 @@ ...@@ -36,6 +47,19 @@
</div> </div>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Company</label> <label>Company</label>
<%
if(company.getIsVerified()==Boolean.TRUE)
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" readonly="true" required="true"/>
<%
}
else
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true"/> <oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true"/>
<%
}
%>
</div> </div>
</oneit:dynIncluded> </oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<oneit:dynIncluded>
</oneit:dynIncluded>
...@@ -7,27 +7,29 @@ ...@@ -7,27 +7,29 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
String nextPage = WebUtils.getArticleLink(request, process.getTransaction (), WebUtils.JOB_APPLICATION, "Page"); String nextPage = WebUtils.getSamePageInRenderMode(request, "CompanyProfile");
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser"); CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
SecUser secUser = null; SecUser secUser = null;
//to process company user verification //to process company user verification
String id = request.getParameter("id"); String id = request.getParameter("id");
String key = request.getParameter("key"); String key = request.getParameter("key");
Boolean isVerify = Boolean.FALSE; Boolean invalid = Boolean.TRUE;
if(id!=null && key!=null) if(id!=null && key!=null)
{ {
isVerify = Boolean.TRUE;
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id), key); companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id), key);
if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE) if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{ {
secUser = companyUser.getUser(); secUser = companyUser.getUser();
process.setAttribute("CompanyUser", companyUser); process.setAttribute("CompanyUser", companyUser);
invalid = Boolean.FALSE;
} }
} }
else
if(invalid)
{ {
response.sendRedirect(WebUtils.getSamePageInRenderMode(request, "AuthError")); response.sendRedirect(WebUtils.getSamePageInRenderMode(request, "AuthError"));
} }
...@@ -76,8 +78,18 @@ ...@@ -76,8 +78,18 @@
<div class="main-box-layout login-box"> <div class="main-box-layout login-box">
<oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/> <oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/>
<oneit:button value="Verify and login" name="xxx" cssClass="box-btn send-btn" <div class="form-group text-left">
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp").toMap() %>"/> <label>Password</label>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="Password" cssClass="form-control second-style reset-pw" required="true"/>
</div>
<div class="form-group text-left">
<label>Confirm password</label>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control second-style reset-pw " required="true"/>
</div>
<oneit:button value="Verify and login" name="verifyCompanyUser" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("CompanyUser", companyUser)
.mapEntry("nextPage", nextPage).toMap() %>"/>
</div> </div>
</oneit:form> </oneit:form>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_company</tableName>
<column name="is_verified" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment