Commit a2f2ca06 by Nilu

C003 HT019

Need  to  use  unchecked  by  default.  Link  to  Privacy  policy.  Use  wording  that  makes  it  clear  that  data  captured  will  be  shared  with  participants  to  the  recruitment  process  including  the  Employer.  Plus  T&C.  Need  to  review  how  the  App  actually  implements  the  policies.  Need  2x  explicit  consent  =  Privacy  +  T&C.
parent 310276b8
...@@ -43,6 +43,8 @@ public class SendVerificationMailFP extends SaveFP ...@@ -43,6 +43,8 @@ public class SendVerificationMailFP extends SaveFP
SecUser secUser = companyUser.getUser(); SecUser secUser = companyUser.getUser();
BusinessObjectParser.assertFieldCondition(!Utils.emailExists(process.getTransaction(), secUser.getEmail(), false), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request); BusinessObjectParser.assertFieldCondition(!Utils.emailExists(process.getTransaction(), secUser.getEmail(), false), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(companyUser.isTrue(companyUser.getPrivacyPolicyAgreed()), companyUser, CompanyUser.FIELD_PrivacyPolicyAgreed, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(companyUser.isTrue(companyUser.getConditionsAgreed()), companyUser, CompanyUser.FIELD_ConditionsAgreed, "mandatory", exceptions, true, request);
} }
else else
{ {
......
...@@ -41,6 +41,8 @@ public class VerifyIdentityFP extends SaveFP ...@@ -41,6 +41,8 @@ public class VerifyIdentityFP extends SaveFP
BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", 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); BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getPrivacyPolicyAgreed()), candidate, Candidate.FIELD_PrivacyPolicyAgreed, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getConditionsAgreed()), candidate, Candidate.FIELD_ConditionsAgreed, "mandatory", exceptions, true, request);
return super.validate(submission, exceptions); return super.validate(submission, exceptions);
} }
......
...@@ -46,6 +46,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -46,6 +46,8 @@ public abstract class BaseCandidate 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_PrivacyPolicyAgreed = "PrivacyPolicyAgreed";
public static final String FIELD_ConditionsAgreed = "ConditionsAgreed";
public static final String SINGLEREFERENCE_TestInput = "TestInput"; public static final String SINGLEREFERENCE_TestInput = "TestInput";
public static final String BACKREF_TestInput = ""; public static final String BACKREF_TestInput = "";
public static final String MULTIPLEREFERENCE_TestAnalysises = "TestAnalysises"; public static final String MULTIPLEREFERENCE_TestAnalysises = "TestAnalysises";
...@@ -69,6 +71,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -69,6 +71,8 @@ public abstract class BaseCandidate extends SecUserExtension
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_PrivacyPolicyAgreed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ConditionsAgreed = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -78,6 +82,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -78,6 +82,8 @@ public abstract class BaseCandidate extends SecUserExtension
private Date _VerificationMailSendDate; private Date _VerificationMailSendDate;
private String _VerificationKey; private String _VerificationKey;
private Boolean _IsAccountVerified; private Boolean _IsAccountVerified;
private Boolean _PrivacyPolicyAgreed;
private Boolean _ConditionsAgreed;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -95,6 +101,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -95,6 +101,8 @@ public abstract class BaseCandidate extends SecUserExtension
private static final Map ATTRIBUTES_METADATA_Candidate = new HashMap (); private static final Map ATTRIBUTES_METADATA_Candidate = new HashMap ();
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_PrivacyPolicyAgreed_Validators;
private static final AttributeValidator[] FIELD_ConditionsAgreed_Validators;
private static final AttributeValidator[] FIELD_Phone_Validators; private static final AttributeValidator[] FIELD_Phone_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;
...@@ -124,6 +132,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -124,6 +132,8 @@ public abstract class BaseCandidate extends SecUserExtension
setupAssocMetaData_CultureCriteriaAnswers(); setupAssocMetaData_CultureCriteriaAnswers();
setupAssocMetaData_ProfileAssessmentAnswers(); setupAssocMetaData_ProfileAssessmentAnswers();
setupAssocMetaData_TestInput(); setupAssocMetaData_TestInput();
FIELD_PrivacyPolicyAgreed_Validators = (AttributeValidator[])setupAttribMetaData_PrivacyPolicyAgreed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConditionsAgreed_Validators = (AttributeValidator[])setupAttribMetaData_ConditionsAgreed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(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]);
...@@ -216,6 +226,42 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -216,6 +226,42 @@ public abstract class BaseCandidate extends SecUserExtension
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_PrivacyPolicyAgreed(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "PrivacyPolicyAgreed");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.PrivacyPolicyAgreed:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_PrivacyPolicyAgreed, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "PrivacyPolicyAgreed", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.PrivacyPolicyAgreed:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ConditionsAgreed(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "ConditionsAgreed");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.ConditionsAgreed:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_ConditionsAgreed, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "ConditionsAgreed", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.ConditionsAgreed:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Phone(Map validatorMapping) private static List setupAttribMetaData_Phone(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -360,6 +406,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -360,6 +406,8 @@ public abstract class BaseCandidate 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);
_PrivacyPolicyAgreed = (Boolean)(Boolean.FALSE);
_ConditionsAgreed = (Boolean)(Boolean.FALSE);
} }
...@@ -982,6 +1030,202 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -982,6 +1030,202 @@ public abstract class BaseCandidate extends SecUserExtension
} }
} }
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed ()
{
assertValid();
Boolean valToReturn = _PrivacyPolicyAgreed;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getPrivacyPolicyAgreed ((Candidate)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 prePrivacyPolicyAgreedChange (Boolean newPrivacyPolicyAgreed) 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 postPrivacyPolicyAgreedChange () throws FieldException
{
}
public FieldWriteability getWriteability_PrivacyPolicyAgreed ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PrivacyPolicyAgreed. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPrivacyPolicyAgreed (Boolean newPrivacyPolicyAgreed) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PrivacyPolicyAgreed.compare (_PrivacyPolicyAgreed, newPrivacyPolicyAgreed);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newPrivacyPolicyAgreed = bhd.setPrivacyPolicyAgreed ((Candidate)this, newPrivacyPolicyAgreed);
oldAndNewIdentical = HELPER_PrivacyPolicyAgreed.compare (_PrivacyPolicyAgreed, newPrivacyPolicyAgreed);
}
if (FIELD_PrivacyPolicyAgreed_Validators.length > 0)
{
Object newPrivacyPolicyAgreedObj = HELPER_PrivacyPolicyAgreed.toObject (newPrivacyPolicyAgreed);
if (newPrivacyPolicyAgreedObj != null)
{
int loopMax = FIELD_PrivacyPolicyAgreed_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_PrivacyPolicyAgreed);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PrivacyPolicyAgreed_Validators[v].checkAttribute (this, FIELD_PrivacyPolicyAgreed, metadata, newPrivacyPolicyAgreedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.FALSE, "Field PrivacyPolicyAgreed is not writeable");
prePrivacyPolicyAgreedChange (newPrivacyPolicyAgreed);
markFieldChange (FIELD_PrivacyPolicyAgreed);
_PrivacyPolicyAgreed = newPrivacyPolicyAgreed;
postFieldChange (FIELD_PrivacyPolicyAgreed);
postPrivacyPolicyAgreedChange ();
}
}
/**
* Get the attribute ConditionsAgreed
*/
public Boolean getConditionsAgreed ()
{
assertValid();
Boolean valToReturn = _ConditionsAgreed;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getConditionsAgreed ((Candidate)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 preConditionsAgreedChange (Boolean newConditionsAgreed) 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 postConditionsAgreedChange () throws FieldException
{
}
public FieldWriteability getWriteability_ConditionsAgreed ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ConditionsAgreed. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setConditionsAgreed (Boolean newConditionsAgreed) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ConditionsAgreed.compare (_ConditionsAgreed, newConditionsAgreed);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newConditionsAgreed = bhd.setConditionsAgreed ((Candidate)this, newConditionsAgreed);
oldAndNewIdentical = HELPER_ConditionsAgreed.compare (_ConditionsAgreed, newConditionsAgreed);
}
if (FIELD_ConditionsAgreed_Validators.length > 0)
{
Object newConditionsAgreedObj = HELPER_ConditionsAgreed.toObject (newConditionsAgreed);
if (newConditionsAgreedObj != null)
{
int loopMax = FIELD_ConditionsAgreed_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_ConditionsAgreed);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ConditionsAgreed_Validators[v].checkAttribute (this, FIELD_ConditionsAgreed, metadata, newConditionsAgreedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ConditionsAgreed () != FieldWriteability.FALSE, "Field ConditionsAgreed is not writeable");
preConditionsAgreedChange (newConditionsAgreed);
markFieldChange (FIELD_ConditionsAgreed);
_ConditionsAgreed = newConditionsAgreed;
postFieldChange (FIELD_ConditionsAgreed);
postConditionsAgreedChange ();
}
}
/** /**
...@@ -1987,6 +2231,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1987,6 +2231,8 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationMailSendDate = sourceCandidate._VerificationMailSendDate; _VerificationMailSendDate = sourceCandidate._VerificationMailSendDate;
_VerificationKey = sourceCandidate._VerificationKey; _VerificationKey = sourceCandidate._VerificationKey;
_IsAccountVerified = sourceCandidate._IsAccountVerified; _IsAccountVerified = sourceCandidate._IsAccountVerified;
_PrivacyPolicyAgreed = sourceCandidate._PrivacyPolicyAgreed;
_ConditionsAgreed = sourceCandidate._ConditionsAgreed;
} }
} }
...@@ -2050,6 +2296,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2050,6 +2296,8 @@ public abstract class BaseCandidate 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))); //
_PrivacyPolicyAgreed = (Boolean)(HELPER_PrivacyPolicyAgreed.readExternal (_PrivacyPolicyAgreed, vals.get(FIELD_PrivacyPolicyAgreed))); //
_ConditionsAgreed = (Boolean)(HELPER_ConditionsAgreed.readExternal (_ConditionsAgreed, vals.get(FIELD_ConditionsAgreed))); //
_TestInput.readExternalData(vals.get(SINGLEREFERENCE_TestInput)); _TestInput.readExternalData(vals.get(SINGLEREFERENCE_TestInput));
_TestAnalysises.readExternalData(vals.get(MULTIPLEREFERENCE_TestAnalysises)); _TestAnalysises.readExternalData(vals.get(MULTIPLEREFERENCE_TestAnalysises));
_JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications)); _JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications));
...@@ -2072,6 +2320,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2072,6 +2320,8 @@ public abstract class BaseCandidate 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_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.writeExternal (_PrivacyPolicyAgreed));
vals.put (FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.writeExternal (_ConditionsAgreed));
vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData()); vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData());
vals.put (MULTIPLEREFERENCE_TestAnalysises, _TestAnalysises.writeExternalData()); vals.put (MULTIPLEREFERENCE_TestAnalysises, _TestAnalysises.writeExternalData());
vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData()); vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData());
...@@ -2133,6 +2383,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2133,6 +2383,8 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
super.visitAttributes (visitor); super.visitAttributes (visitor);
visitor.visitField(this, FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.toObject(getPrivacyPolicyAgreed()));
visitor.visitField(this, FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.toObject(getConditionsAgreed()));
} }
...@@ -2482,6 +2734,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2482,6 +2734,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_IsAccountVerified.toObject (getIsAccountVerified ()); return HELPER_IsAccountVerified.toObject (getIsAccountVerified ());
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed.toObject (getPrivacyPolicyAgreed ());
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
return HELPER_ConditionsAgreed.toObject (getConditionsAgreed ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -2519,6 +2779,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2519,6 +2779,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_IsAccountVerified; return HELPER_IsAccountVerified;
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed;
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
return HELPER_ConditionsAgreed;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -2556,6 +2824,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2556,6 +2824,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue))); setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue)));
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
setPrivacyPolicyAgreed ((Boolean)(HELPER_PrivacyPolicyAgreed.fromObject (_PrivacyPolicyAgreed, attribValue)));
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
setConditionsAgreed ((Boolean)(HELPER_ConditionsAgreed.fromObject (_ConditionsAgreed, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -2620,6 +2896,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2620,6 +2896,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return getWriteability_TestInput (); return getWriteability_TestInput ();
} }
else if (fieldName.equals (FIELD_PrivacyPolicyAgreed))
{
return getWriteability_PrivacyPolicyAgreed ();
}
else if (fieldName.equals (FIELD_ConditionsAgreed))
{
return getWriteability_ConditionsAgreed ();
}
else else
{ {
return super.getWriteable (fieldName); return super.getWriteable (fieldName);
...@@ -2660,6 +2944,16 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2660,6 +2944,16 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_IsAccountVerified); fields.add (FIELD_IsAccountVerified);
} }
if (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.TRUE)
{
fields.add (FIELD_PrivacyPolicyAgreed);
}
if (getWriteability_ConditionsAgreed () != FieldWriteability.TRUE)
{
fields.add (FIELD_ConditionsAgreed);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -2675,6 +2969,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2675,6 +2969,8 @@ public abstract class BaseCandidate 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_PrivacyPolicyAgreed.getAttribObject (getClass (), _PrivacyPolicyAgreed, false, FIELD_PrivacyPolicyAgreed));
result.add(HELPER_ConditionsAgreed.getAttribObject (getClass (), _ConditionsAgreed, false, FIELD_ConditionsAgreed));
return result; return result;
} }
...@@ -2833,6 +3129,42 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2833,6 +3129,42 @@ public abstract class BaseCandidate extends SecUserExtension
return newIsAccountVerified; return newIsAccountVerified;
} }
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute PrivacyPolicyAgreed.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setPrivacyPolicyAgreed (Candidate obj, Boolean newPrivacyPolicyAgreed) throws FieldException
{
return newPrivacyPolicyAgreed;
}
/**
* Get the attribute ConditionsAgreed
*/
public Boolean getConditionsAgreed (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute ConditionsAgreed.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setConditionsAgreed (Candidate obj, Boolean newConditionsAgreed) throws FieldException
{
return newConditionsAgreed;
}
} }
...@@ -2901,6 +3233,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2901,6 +3233,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return toProfileAssessmentAnswers (); return toProfileAssessmentAnswers ();
} }
if (name.equals ("PrivacyPolicyAgreed"))
{
return toPrivacyPolicyAgreed ();
}
if (name.equals ("ConditionsAgreed"))
{
return toConditionsAgreed ();
}
if (name.equals ("Phone")) if (name.equals ("Phone"))
{ {
return toPhone (); return toPhone ();
...@@ -2935,6 +3275,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2935,6 +3275,10 @@ public abstract class BaseCandidate extends SecUserExtension
} }
public PipeLine<From, Boolean> toPrivacyPolicyAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PrivacyPolicyAgreed)); }
public PipeLine<From, Boolean> toConditionsAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ConditionsAgreed)); }
public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); } public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); }
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)); }
...@@ -2982,6 +3326,16 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2982,6 +3326,16 @@ public abstract class BaseCandidate extends SecUserExtension
public boolean isTransientAttrib(String attribName) public boolean isTransientAttrib(String attribName)
{ {
if(CollectionUtils.equals(attribName, "PrivacyPolicyAgreed"))
{
return true;
}
if(CollectionUtils.equals(attribName, "ConditionsAgreed"))
{
return true;
}
return super.isTransientAttrib(attribName); return super.isTransientAttrib(attribName);
} }
......
...@@ -55,6 +55,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -55,6 +55,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
public static final String FIELD_Email = "Email"; public static final String FIELD_Email = "Email";
public static final String FIELD_Password = "Password"; public static final String FIELD_Password = "Password";
public static final String FIELD_ConfirmPassword = "ConfirmPassword"; public static final String FIELD_ConfirmPassword = "ConfirmPassword";
public static final String FIELD_PrivacyPolicyAgreed = "PrivacyPolicyAgreed";
public static final String FIELD_ConditionsAgreed = "ConditionsAgreed";
public static final String SINGLEREFERENCE_SelectedTeam = "SelectedTeam"; public static final String SINGLEREFERENCE_SelectedTeam = "SelectedTeam";
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 = "";
...@@ -82,6 +84,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -82,6 +84,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final DefaultAttributeHelper<CompanyUser> HELPER_Email = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_Email = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_Password = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_Password = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_ConfirmPassword = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<CompanyUser> HELPER_ConfirmPassword = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_PrivacyPolicyAgreed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_ConditionsAgreed = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -98,6 +102,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -98,6 +102,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private String _Email; private String _Email;
private String _Password; private String _Password;
private String _ConfirmPassword; private String _ConfirmPassword;
private Boolean _PrivacyPolicyAgreed;
private Boolean _ConditionsAgreed;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -117,6 +123,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -117,6 +123,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final AttributeValidator[] FIELD_Email_Validators; private static final AttributeValidator[] FIELD_Email_Validators;
private static final AttributeValidator[] FIELD_Password_Validators; private static final AttributeValidator[] FIELD_Password_Validators;
private static final AttributeValidator[] FIELD_ConfirmPassword_Validators; private static final AttributeValidator[] FIELD_ConfirmPassword_Validators;
private static final AttributeValidator[] FIELD_PrivacyPolicyAgreed_Validators;
private static final AttributeValidator[] FIELD_ConditionsAgreed_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;
...@@ -149,6 +157,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -149,6 +157,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PrivacyPolicyAgreed_Validators = (AttributeValidator[])setupAttribMetaData_PrivacyPolicyAgreed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConditionsAgreed_Validators = (AttributeValidator[])setupAttribMetaData_ConditionsAgreed(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]);
...@@ -282,6 +292,42 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -282,6 +292,42 @@ public abstract class BaseCompanyUser extends SecUserExtension
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_PrivacyPolicyAgreed(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "PrivacyPolicyAgreed");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.PrivacyPolicyAgreed:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_PrivacyPolicyAgreed, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "PrivacyPolicyAgreed", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.PrivacyPolicyAgreed:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ConditionsAgreed(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "ConditionsAgreed");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.ConditionsAgreed:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_ConditionsAgreed, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "ConditionsAgreed", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.ConditionsAgreed:", 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 ();
...@@ -513,6 +559,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -513,6 +559,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_Email = (String)(HELPER_Email.initialise (_Email)); _Email = (String)(HELPER_Email.initialise (_Email));
_Password = (String)(HELPER_Password.initialise (_Password)); _Password = (String)(HELPER_Password.initialise (_Password));
_ConfirmPassword = (String)(HELPER_ConfirmPassword.initialise (_ConfirmPassword)); _ConfirmPassword = (String)(HELPER_ConfirmPassword.initialise (_ConfirmPassword));
_PrivacyPolicyAgreed = (Boolean)(Boolean.FALSE);
_ConditionsAgreed = (Boolean)(Boolean.FALSE);
} }
...@@ -1819,6 +1867,202 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -1819,6 +1867,202 @@ public abstract class BaseCompanyUser extends SecUserExtension
} }
} }
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed ()
{
assertValid();
Boolean valToReturn = _PrivacyPolicyAgreed;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getPrivacyPolicyAgreed ((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 prePrivacyPolicyAgreedChange (Boolean newPrivacyPolicyAgreed) 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 postPrivacyPolicyAgreedChange () throws FieldException
{
}
public FieldWriteability getWriteability_PrivacyPolicyAgreed ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PrivacyPolicyAgreed. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPrivacyPolicyAgreed (Boolean newPrivacyPolicyAgreed) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PrivacyPolicyAgreed.compare (_PrivacyPolicyAgreed, newPrivacyPolicyAgreed);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newPrivacyPolicyAgreed = bhd.setPrivacyPolicyAgreed ((CompanyUser)this, newPrivacyPolicyAgreed);
oldAndNewIdentical = HELPER_PrivacyPolicyAgreed.compare (_PrivacyPolicyAgreed, newPrivacyPolicyAgreed);
}
if (FIELD_PrivacyPolicyAgreed_Validators.length > 0)
{
Object newPrivacyPolicyAgreedObj = HELPER_PrivacyPolicyAgreed.toObject (newPrivacyPolicyAgreed);
if (newPrivacyPolicyAgreedObj != null)
{
int loopMax = FIELD_PrivacyPolicyAgreed_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_PrivacyPolicyAgreed);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PrivacyPolicyAgreed_Validators[v].checkAttribute (this, FIELD_PrivacyPolicyAgreed, metadata, newPrivacyPolicyAgreedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.FALSE, "Field PrivacyPolicyAgreed is not writeable");
prePrivacyPolicyAgreedChange (newPrivacyPolicyAgreed);
markFieldChange (FIELD_PrivacyPolicyAgreed);
_PrivacyPolicyAgreed = newPrivacyPolicyAgreed;
postFieldChange (FIELD_PrivacyPolicyAgreed);
postPrivacyPolicyAgreedChange ();
}
}
/**
* Get the attribute ConditionsAgreed
*/
public Boolean getConditionsAgreed ()
{
assertValid();
Boolean valToReturn = _ConditionsAgreed;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getConditionsAgreed ((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 preConditionsAgreedChange (Boolean newConditionsAgreed) 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 postConditionsAgreedChange () throws FieldException
{
}
public FieldWriteability getWriteability_ConditionsAgreed ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ConditionsAgreed. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setConditionsAgreed (Boolean newConditionsAgreed) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ConditionsAgreed.compare (_ConditionsAgreed, newConditionsAgreed);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newConditionsAgreed = bhd.setConditionsAgreed ((CompanyUser)this, newConditionsAgreed);
oldAndNewIdentical = HELPER_ConditionsAgreed.compare (_ConditionsAgreed, newConditionsAgreed);
}
if (FIELD_ConditionsAgreed_Validators.length > 0)
{
Object newConditionsAgreedObj = HELPER_ConditionsAgreed.toObject (newConditionsAgreed);
if (newConditionsAgreedObj != null)
{
int loopMax = FIELD_ConditionsAgreed_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_ConditionsAgreed);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ConditionsAgreed_Validators[v].checkAttribute (this, FIELD_ConditionsAgreed, metadata, newConditionsAgreedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ConditionsAgreed () != FieldWriteability.FALSE, "Field ConditionsAgreed is not writeable");
preConditionsAgreedChange (newConditionsAgreed);
markFieldChange (FIELD_ConditionsAgreed);
_ConditionsAgreed = newConditionsAgreed;
postFieldChange (FIELD_ConditionsAgreed);
postConditionsAgreedChange ();
}
}
/** /**
...@@ -2736,6 +2980,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2736,6 +2980,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_Email = sourceCompanyUser._Email; _Email = sourceCompanyUser._Email;
_Password = sourceCompanyUser._Password; _Password = sourceCompanyUser._Password;
_ConfirmPassword = sourceCompanyUser._ConfirmPassword; _ConfirmPassword = sourceCompanyUser._ConfirmPassword;
_PrivacyPolicyAgreed = sourceCompanyUser._PrivacyPolicyAgreed;
_ConditionsAgreed = sourceCompanyUser._ConditionsAgreed;
} }
} }
...@@ -2805,6 +3051,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2805,6 +3051,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
_Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); // _Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
_Password = (String)(HELPER_Password.readExternal (_Password, vals.get(FIELD_Password))); // _Password = (String)(HELPER_Password.readExternal (_Password, vals.get(FIELD_Password))); //
_ConfirmPassword = (String)(HELPER_ConfirmPassword.readExternal (_ConfirmPassword, vals.get(FIELD_ConfirmPassword))); // _ConfirmPassword = (String)(HELPER_ConfirmPassword.readExternal (_ConfirmPassword, vals.get(FIELD_ConfirmPassword))); //
_PrivacyPolicyAgreed = (Boolean)(HELPER_PrivacyPolicyAgreed.readExternal (_PrivacyPolicyAgreed, vals.get(FIELD_PrivacyPolicyAgreed))); //
_ConditionsAgreed = (Boolean)(HELPER_ConditionsAgreed.readExternal (_ConditionsAgreed, vals.get(FIELD_ConditionsAgreed))); //
_SelectedTeam.readExternalData(vals.get(SINGLEREFERENCE_SelectedTeam)); _SelectedTeam.readExternalData(vals.get(SINGLEREFERENCE_SelectedTeam));
_Company.readExternalData(vals.get(SINGLEREFERENCE_Company)); _Company.readExternalData(vals.get(SINGLEREFERENCE_Company));
_DefaultHiringTeam.readExternalData(vals.get(SINGLEREFERENCE_DefaultHiringTeam)); _DefaultHiringTeam.readExternalData(vals.get(SINGLEREFERENCE_DefaultHiringTeam));
...@@ -2833,6 +3081,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2833,6 +3081,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email)); vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
vals.put (FIELD_Password, HELPER_Password.writeExternal (_Password)); vals.put (FIELD_Password, HELPER_Password.writeExternal (_Password));
vals.put (FIELD_ConfirmPassword, HELPER_ConfirmPassword.writeExternal (_ConfirmPassword)); vals.put (FIELD_ConfirmPassword, HELPER_ConfirmPassword.writeExternal (_ConfirmPassword));
vals.put (FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.writeExternal (_PrivacyPolicyAgreed));
vals.put (FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.writeExternal (_ConditionsAgreed));
vals.put (SINGLEREFERENCE_SelectedTeam, _SelectedTeam.writeExternalData()); vals.put (SINGLEREFERENCE_SelectedTeam, _SelectedTeam.writeExternalData());
vals.put (SINGLEREFERENCE_Company, _Company.writeExternalData()); vals.put (SINGLEREFERENCE_Company, _Company.writeExternalData());
vals.put (SINGLEREFERENCE_DefaultHiringTeam, _DefaultHiringTeam.writeExternalData()); vals.put (SINGLEREFERENCE_DefaultHiringTeam, _DefaultHiringTeam.writeExternalData());
...@@ -2911,6 +3161,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -2911,6 +3161,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
visitor.visitField(this, FIELD_Email, HELPER_Email.toObject(getEmail())); visitor.visitField(this, FIELD_Email, HELPER_Email.toObject(getEmail()));
visitor.visitField(this, FIELD_Password, HELPER_Password.toObject(getPassword())); visitor.visitField(this, FIELD_Password, HELPER_Password.toObject(getPassword()));
visitor.visitField(this, FIELD_ConfirmPassword, HELPER_ConfirmPassword.toObject(getConfirmPassword())); visitor.visitField(this, FIELD_ConfirmPassword, HELPER_ConfirmPassword.toObject(getConfirmPassword()));
visitor.visitField(this, FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.toObject(getPrivacyPolicyAgreed()));
visitor.visitField(this, FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.toObject(getConditionsAgreed()));
} }
...@@ -3503,6 +3755,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3503,6 +3755,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return HELPER_ConfirmPassword.toObject (getConfirmPassword ()); return HELPER_ConfirmPassword.toObject (getConfirmPassword ());
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed.toObject (getPrivacyPolicyAgreed ());
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
return HELPER_ConditionsAgreed.toObject (getConditionsAgreed ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -3568,6 +3828,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3568,6 +3828,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return HELPER_ConfirmPassword; return HELPER_ConfirmPassword;
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed;
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
return HELPER_ConditionsAgreed;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -3633,6 +3901,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3633,6 +3901,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
setConfirmPassword ((String)(HELPER_ConfirmPassword.fromObject (_ConfirmPassword, attribValue))); setConfirmPassword ((String)(HELPER_ConfirmPassword.fromObject (_ConfirmPassword, attribValue)));
} }
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
setPrivacyPolicyAgreed ((Boolean)(HELPER_PrivacyPolicyAgreed.fromObject (_PrivacyPolicyAgreed, attribValue)));
}
else if (attribName.equals (FIELD_ConditionsAgreed))
{
setConditionsAgreed ((Boolean)(HELPER_ConditionsAgreed.fromObject (_ConditionsAgreed, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -3717,6 +3993,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3717,6 +3993,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return getWriteability_ConfirmPassword (); return getWriteability_ConfirmPassword ();
} }
else if (fieldName.equals (FIELD_PrivacyPolicyAgreed))
{
return getWriteability_PrivacyPolicyAgreed ();
}
else if (fieldName.equals (FIELD_ConditionsAgreed))
{
return getWriteability_ConditionsAgreed ();
}
else if (fieldName.equals (SINGLEREFERENCE_SelectedTeam)) else if (fieldName.equals (SINGLEREFERENCE_SelectedTeam))
{ {
return getWriteability_SelectedTeam (); return getWriteability_SelectedTeam ();
...@@ -3796,6 +4080,16 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3796,6 +4080,16 @@ public abstract class BaseCompanyUser extends SecUserExtension
fields.add (FIELD_ConfirmPassword); fields.add (FIELD_ConfirmPassword);
} }
if (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.TRUE)
{
fields.add (FIELD_PrivacyPolicyAgreed);
}
if (getWriteability_ConditionsAgreed () != FieldWriteability.TRUE)
{
fields.add (FIELD_ConditionsAgreed);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -3818,6 +4112,8 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -3818,6 +4112,8 @@ public abstract class BaseCompanyUser extends SecUserExtension
result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email)); result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));
result.add(HELPER_Password.getAttribObject (getClass (), _Password, false, FIELD_Password)); result.add(HELPER_Password.getAttribObject (getClass (), _Password, false, FIELD_Password));
result.add(HELPER_ConfirmPassword.getAttribObject (getClass (), _ConfirmPassword, false, FIELD_ConfirmPassword)); result.add(HELPER_ConfirmPassword.getAttribObject (getClass (), _ConfirmPassword, false, FIELD_ConfirmPassword));
result.add(HELPER_PrivacyPolicyAgreed.getAttribObject (getClass (), _PrivacyPolicyAgreed, false, FIELD_PrivacyPolicyAgreed));
result.add(HELPER_ConditionsAgreed.getAttribObject (getClass (), _ConditionsAgreed, false, FIELD_ConditionsAgreed));
return result; return result;
} }
...@@ -4102,6 +4398,42 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -4102,6 +4398,42 @@ public abstract class BaseCompanyUser extends SecUserExtension
return newConfirmPassword; return newConfirmPassword;
} }
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed (CompanyUser obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute PrivacyPolicyAgreed.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setPrivacyPolicyAgreed (CompanyUser obj, Boolean newPrivacyPolicyAgreed) throws FieldException
{
return newPrivacyPolicyAgreed;
}
/**
* Get the attribute ConditionsAgreed
*/
public Boolean getConditionsAgreed (CompanyUser obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute ConditionsAgreed.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setConditionsAgreed (CompanyUser obj, Boolean newConditionsAgreed) throws FieldException
{
return newConditionsAgreed;
}
} }
...@@ -4170,6 +4502,14 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -4170,6 +4502,14 @@ public abstract class BaseCompanyUser extends SecUserExtension
{ {
return toConfirmPassword (); return toConfirmPassword ();
} }
if (name.equals ("PrivacyPolicyAgreed"))
{
return toPrivacyPolicyAgreed ();
}
if (name.equals ("ConditionsAgreed"))
{
return toConditionsAgreed ();
}
if (name.equals ("SelectedTeam")) if (name.equals ("SelectedTeam"))
{ {
return toSelectedTeam (); return toSelectedTeam ();
...@@ -4234,6 +4574,10 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -4234,6 +4574,10 @@ public abstract class BaseCompanyUser extends SecUserExtension
public PipeLine<From, String> toConfirmPassword () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ConfirmPassword)); } public PipeLine<From, String> toConfirmPassword () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ConfirmPassword)); }
public PipeLine<From, Boolean> toPrivacyPolicyAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PrivacyPolicyAgreed)); }
public PipeLine<From, Boolean> toConditionsAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ConditionsAgreed)); }
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)); }
...@@ -4298,6 +4642,16 @@ public abstract class BaseCompanyUser extends SecUserExtension ...@@ -4298,6 +4642,16 @@ public abstract class BaseCompanyUser extends SecUserExtension
return true; return true;
} }
if(CollectionUtils.equals(attribName, "PrivacyPolicyAgreed"))
{
return true;
}
if(CollectionUtils.equals(attribName, "ConditionsAgreed"))
{
return true;
}
return super.isTransientAttrib(attribName); return super.isTransientAttrib(attribName);
} }
......
...@@ -153,4 +153,14 @@ public class Candidate extends BaseCandidate ...@@ -153,4 +153,14 @@ public class Candidate extends BaseCandidate
return null; return null;
} }
public boolean showPrivacyPolicyAgreed()
{
return isTrue(getPrivacyPolicyAgreed());
}
public boolean showConditionsAgreed()
{
return isTrue(getConditionsAgreed());
}
} }
\ No newline at end of file
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<MULTIPLEREFERENCE name="CultureCriteriaAnswers" type="CultureCriteriaAnswer" backreferenceName="Candidate" /> <MULTIPLEREFERENCE name="CultureCriteriaAnswers" type="CultureCriteriaAnswer" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="ProfileAssessmentAnswers" type="Answer" backreferenceName="Candidate" /> <MULTIPLEREFERENCE name="ProfileAssessmentAnswers" type="Answer" backreferenceName="Candidate" />
<TRANSIENT name="PrivacyPolicyAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="ConditionsAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE"> <TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="Phone" type="String" dbcol="phone" length="30"/> <ATTRIB name="Phone" type="String" dbcol="phone" length="30"/>
......
...@@ -198,4 +198,15 @@ public class CompanyUser extends BaseCompanyUser ...@@ -198,4 +198,15 @@ public class CompanyUser extends BaseCompanyUser
{ {
return super.getSelectedTeam() == null ? getDefaultHiringTeam() : super.getSelectedTeam(); return super.getSelectedTeam() == null ? getDefaultHiringTeam() : super.getSelectedTeam();
} }
public boolean showPrivacyPolicyAgreed()
{
return isTrue(getPrivacyPolicyAgreed());
}
public boolean showConditionsAgreed()
{
return isTrue(getConditionsAgreed());
}
} }
\ No newline at end of file
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<TRANSIENT name="Email" type="String" validators="Email" /> <TRANSIENT name="Email" type="String" validators="Email" />
<TRANSIENT name="Password" type="String"/> <TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/> <TRANSIENT name="ConfirmPassword" type="String"/>
<TRANSIENT name="PrivacyPolicyAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="ConditionsAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENTSINGLE name="SelectedTeam" type="HiringTeam" /> <TRANSIENTSINGLE name="SelectedTeam" type="HiringTeam" />
......
...@@ -6355,3 +6355,8 @@ input{ ...@@ -6355,3 +6355,8 @@ input{
} }
.blue-label {color: #03a0e7;} .blue-label {color: #03a0e7;}
.privacy-link{
text-decoration: underline;
color: #03A0E7
}
\ No newline at end of file
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
<%@ page import="oneit.security.SecUser"%> <%@ page import="oneit.security.SecUser"%>
<oneit:dynIncluded> <oneit:dynIncluded>
<script type="text/javascript">
$(document).ready(function() {
recalcFunction = setupRecalc ($("form#sign_up"), {'recalcOnError':true});
});
</script>
<% <%
CompanyUser companyUser = (CompanyUser) getData(request, "CompanyUser"); CompanyUser companyUser = (CompanyUser) getData(request, "CompanyUser");
...@@ -62,4 +67,30 @@ ...@@ -62,4 +67,30 @@
} }
%> %>
</div> </div>
<div class="form-group text-left">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= companyUser %>" id="privacy-policy-agreed" attributeName="PrivacyPolicyAgreed" type="checkbox" required="true"/>
<oneit:recalcClass htmlTag="span" classScript="companyUser.showPrivacyPolicyAgreed() ? 'checked': 'unchecked'" companyUser="<%= companyUser %>">
<label for="privacy-policy-agreed">
<oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/privacy/" target="_blank" class="privacy-link">Privacy Policy</a>
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="form-group text-left">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= companyUser %>" id="conditions-agreed" attributeName="ConditionsAgreed" type="checkbox" required="true"/>
<oneit:recalcClass htmlTag="span" classScript="companyUser.showConditionsAgreed() ? 'checked': 'unchecked'" companyUser="<%= companyUser %>">
<label for="conditions-agreed">
<oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/terms-of-service/" target="_blank" class="privacy-link">Terms & Conditions</a>
</label>
</oneit:recalcClass>
</div>
</div>
</div>
</oneit:dynIncluded> </oneit:dynIncluded>
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
$(document).ready(function() { $(document).ready(function() {
recalcFunction = setupRecalc ($("form#signIn"), {'recalcOnError':true});
validate(); validate();
$('input').on('change keyup', function() { validate() }); $('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500); interval = setInterval(function() { validate(); }, 500);
...@@ -156,20 +158,40 @@ ...@@ -156,20 +158,40 @@
<% <%
} }
%> %>
<div class="form-group text-left">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= candidate %>" id="privacy-policy-agreed" attributeName="PrivacyPolicyAgreed" type="checkbox" required="true"/>
<oneit:recalcClass htmlTag="span" classScript="candidate.showPrivacyPolicyAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<label for="privacy-policy-agreed">
<oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/privacy/" target="_blank" class="privacy-link">Privacy Policy</a>
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="form-group text-left">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= candidate %>" id="conditions-agreed" attributeName="ConditionsAgreed" type="checkbox" required="true"/>
<oneit:recalcClass htmlTag="span" classScript="candidate.showConditionsAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<label for="conditions-agreed">
<oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/terms-of-service/" target="_blank" class="privacy-link">Terms & Conditions</a>
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="text-center"> <div class="text-center">
<oneit:button value="Create my account" name="verifyIdentity" cssClass="box-btn verify-btn" <oneit:button value="Verify and proceed" name="verifyIdentity" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job",job) .mapEntry("Job",job)
.mapEntry("Candidate",candidate) .mapEntry("Candidate",candidate)
.mapEntry("isVerify",isVerify) .mapEntry("isVerify",isVerify)
.toMap() %>"/> .toMap() %>"/>
</div> </div>
<div class="box-label" style="padding-top: 20px;">
By selecting 'Create my account' I agree to Talentology's
<a href="https://www.talentology.com/privacy/" target="_blank">privacy policy</a> and
<a href="https://www.talentology.com/terms-of-service/" target="_blank">terms of service</a>
</div>
</div> </div>
</div> </div>
</oneit:form> </oneit:form>
......
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