Commit 679cf5c5 by Nilu

Distance calculations based on google distance matrix api. Changing application…

Distance calculations based on google distance matrix api. Changing application flow to have confirm details  page on every time a user would apply for a job.
parent b96f4080
......@@ -16,8 +16,6 @@
<column name="verification_key" type="String" nullable="true" length="10"/>
<column name="is_account_verified" type="Boolean" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
<column name="test_input_id" type="Long" length="11" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,9 @@
<column name="cover_letter" type="BLOB" nullable="true"/>
<column name="application_status" type="String" nullable="false" length="200"/>
<column name="submitted_date" type="Date" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
......
......@@ -15,8 +15,6 @@ CREATE TABLE oneit_sec_user_extension (
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
test_input_id numeric(12) NULL,
user_id numeric(12) NULL
);
......
......@@ -12,6 +12,9 @@ CREATE TABLE tl_job_application (
cover_letter image NULL,
application_status varchar(200) NOT NULL,
submitted_date datetime NULL,
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -16,8 +16,6 @@ CREATE TABLE oneit_sec_user_extension (
verification_key varchar2(10) NULL,
is_account_verified char(1) NULL,
google_address_text varchar2(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
test_input_id number(12) NULL,
user_id number(12) NULL
);
......
......@@ -13,6 +13,9 @@ CREATE TABLE tl_job_application (
cover_letter blob NULL,
application_status varchar2(200) NOT NULL,
submitted_date date NULL,
google_address_text varchar2(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL
);
......
......@@ -16,8 +16,6 @@ CREATE TABLE oneit_sec_user_extension (
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
test_input_id numeric(12) NULL,
user_id numeric(12) NULL
);
......
......@@ -13,6 +13,9 @@ CREATE TABLE tl_job_application (
cover_letter bytea NULL,
application_status varchar(200) NOT NULL,
submitted_date timestamp NULL,
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -48,8 +48,8 @@ public class ValidateApplicationFP extends SaveFP
if(fromCoverLetter)
{
BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "uploadCV", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "uploadCover", exceptions, true, request);
}
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ public class VerifyIdentityFP extends SaveFP
Job job = (Job) request.getAttribute("Job");
Candidate candidate = (Candidate) request.getAttribute("Candidate");
SecUser secUser = candidate.getUser();
Boolean isVerify = CollectionUtils.equals(request.getAttribute("isVerify"), Boolean.TRUE);
if(secUser.getUserName() != null)
{
......@@ -41,8 +42,12 @@ public class VerifyIdentityFP extends SaveFP
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(isVerify)
{
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getPrivacyPolicyAgreed()), candidate, Candidate.FIELD_PrivacyPolicyAgreed, "agreePrivacy", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getConditionsAgreed()), candidate, Candidate.FIELD_ConditionsAgreed, "agreeTerms", exceptions, true, request);
}
return super.validate(submission, exceptions);
}
......@@ -54,11 +59,12 @@ public class VerifyIdentityFP extends SaveFP
HttpServletRequest request = submission.getRequest();
Boolean isVerify = CollectionUtils.equals(request.getAttribute("isVerify"), Boolean.TRUE);
Job job = (Job) request.getAttribute("Job");
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
String nextPage = (String) request.getAttribute("nextPage");
Candidate candidate = (Candidate) request.getAttribute("Candidate");
if(isVerify)
{
Candidate candidate = (Candidate) request.getAttribute("Candidate");
SecUser secUser = candidate.getUser();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User", job, secUser);
......@@ -81,6 +87,10 @@ public class VerifyIdentityFP extends SaveFP
// }
}
// storing candidate location in application for distance calculation to be accurate even if user edits
// location in the next application
jobApplication.setGoogleAddressText(candidate.getGoogleAddressText());
process.completeAndRestart();
return new ProcessRedirectResult(nextPage + "&JobID=" + job.getObjectID(), new String[0]);
......
......@@ -47,8 +47,6 @@ public abstract class BaseCandidate extends SecUserExtension
public static final String FIELD_VerificationKey = "VerificationKey";
public static final String FIELD_IsAccountVerified = "IsAccountVerified";
public static final String FIELD_GoogleAddressText = "GoogleAddressText";
public static final String FIELD_PreferRemote = "PreferRemote";
public static final String FIELD_HappyToRelocate = "HappyToRelocate";
public static final String FIELD_PrivacyPolicyAgreed = "PrivacyPolicyAgreed";
public static final String FIELD_ConditionsAgreed = "ConditionsAgreed";
public static final String SINGLEREFERENCE_TestInput = "TestInput";
......@@ -75,8 +73,6 @@ public abstract class BaseCandidate extends SecUserExtension
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_PrivacyPolicyAgreed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ConditionsAgreed = DefaultAttributeHelper.INSTANCE;
......@@ -89,8 +85,6 @@ public abstract class BaseCandidate extends SecUserExtension
private String _VerificationKey;
private Boolean _IsAccountVerified;
private String _GoogleAddressText;
private Boolean _PreferRemote;
private Boolean _HappyToRelocate;
private Boolean _PrivacyPolicyAgreed;
private Boolean _ConditionsAgreed;
......@@ -119,8 +113,6 @@ public abstract class BaseCandidate extends SecUserExtension
private static final AttributeValidator[] FIELD_VerificationKey_Validators;
private static final AttributeValidator[] FIELD_IsAccountVerified_Validators;
private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
private static final AttributeValidator[] FIELD_PreferRemote_Validators;
private static final AttributeValidator[] FIELD_HappyToRelocate_Validators;
// Arrays of behaviour decorators
......@@ -153,8 +145,6 @@ public abstract class BaseCandidate extends SecUserExtension
FIELD_VerificationKey_Validators = (AttributeValidator[])setupAttribMetaData_VerificationKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PreferRemote_Validators = (AttributeValidator[])setupAttribMetaData_PreferRemote(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_HappyToRelocate_Validators = (AttributeValidator[])setupAttribMetaData_HappyToRelocate(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Candidate.initialiseReference ();
......@@ -407,44 +397,6 @@ public abstract class BaseCandidate extends SecUserExtension
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_PreferRemote(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "prefer_remote");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "PreferRemote");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.PreferRemote:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_PreferRemote, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "PreferRemote", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.PreferRemote:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_HappyToRelocate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "happy_to_relocate");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "HappyToRelocate");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.HappyToRelocate:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_HappyToRelocate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "HappyToRelocate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.HappyToRelocate:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -479,8 +431,6 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey));
_IsAccountVerified = (Boolean)(Boolean.FALSE);
_GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
_PreferRemote = (Boolean)(Boolean.FALSE);
_HappyToRelocate = (Boolean)(Boolean.FALSE);
_PrivacyPolicyAgreed = (Boolean)(Boolean.FALSE);
_ConditionsAgreed = (Boolean)(Boolean.FALSE);
}
......@@ -1204,202 +1154,6 @@ public abstract class BaseCandidate extends SecUserExtension
}
/**
* Get the attribute PreferRemote
*/
public Boolean getPreferRemote ()
{
assertValid();
Boolean valToReturn = _PreferRemote;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getPreferRemote ((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 prePreferRemoteChange (Boolean newPreferRemote) 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 postPreferRemoteChange () throws FieldException
{
}
public FieldWriteability getWriteability_PreferRemote ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PreferRemote. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPreferRemote (Boolean newPreferRemote) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newPreferRemote = bhd.setPreferRemote ((Candidate)this, newPreferRemote);
oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
}
if (FIELD_PreferRemote_Validators.length > 0)
{
Object newPreferRemoteObj = HELPER_PreferRemote.toObject (newPreferRemote);
if (newPreferRemoteObj != null)
{
int loopMax = FIELD_PreferRemote_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_PreferRemote);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PreferRemote_Validators[v].checkAttribute (this, FIELD_PreferRemote, metadata, newPreferRemoteObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PreferRemote () != FieldWriteability.FALSE, "Field PreferRemote is not writeable");
prePreferRemoteChange (newPreferRemote);
markFieldChange (FIELD_PreferRemote);
_PreferRemote = newPreferRemote;
postFieldChange (FIELD_PreferRemote);
postPreferRemoteChange ();
}
}
/**
* Get the attribute HappyToRelocate
*/
public Boolean getHappyToRelocate ()
{
assertValid();
Boolean valToReturn = _HappyToRelocate;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getHappyToRelocate ((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 preHappyToRelocateChange (Boolean newHappyToRelocate) 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 postHappyToRelocateChange () throws FieldException
{
}
public FieldWriteability getWriteability_HappyToRelocate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute HappyToRelocate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setHappyToRelocate (Boolean newHappyToRelocate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newHappyToRelocate = bhd.setHappyToRelocate ((Candidate)this, newHappyToRelocate);
oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
}
if (FIELD_HappyToRelocate_Validators.length > 0)
{
Object newHappyToRelocateObj = HELPER_HappyToRelocate.toObject (newHappyToRelocate);
if (newHappyToRelocateObj != null)
{
int loopMax = FIELD_HappyToRelocate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_HappyToRelocate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_HappyToRelocate_Validators[v].checkAttribute (this, FIELD_HappyToRelocate, metadata, newHappyToRelocateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_HappyToRelocate () != FieldWriteability.FALSE, "Field HappyToRelocate is not writeable");
preHappyToRelocateChange (newHappyToRelocate);
markFieldChange (FIELD_HappyToRelocate);
_HappyToRelocate = newHappyToRelocate;
postFieldChange (FIELD_HappyToRelocate);
postHappyToRelocateChange ();
}
}
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed ()
......@@ -2489,8 +2243,6 @@ public abstract class BaseCandidate extends SecUserExtension
oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationKey, HELPER_VerificationKey.toObject (_VerificationKey)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_PreferRemote, HELPER_PreferRemote.toObject (_PreferRemote)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject (_HappyToRelocate)); //
_TestInput.getPersistentSets (allSets);
}
......@@ -2513,8 +2265,6 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationKey = (String)(HELPER_VerificationKey.fromObject (_VerificationKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (FIELD_GoogleAddressText))); //
_PreferRemote = (Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, oneit_sec_user_extensionPSet.getAttrib (FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, oneit_sec_user_extensionPSet.getAttrib (FIELD_HappyToRelocate))); //
_TestInput.setFromPersistentSets (objectID, allSets);
}
......@@ -2594,24 +2344,6 @@ public abstract class BaseCandidate extends SecUserExtension
e.addException (ex);
}
try
{
setPreferRemote (otherCandidate.getPreferRemote ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setHappyToRelocate (otherCandidate.getHappyToRelocate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -2634,8 +2366,6 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationKey = sourceCandidate._VerificationKey;
_IsAccountVerified = sourceCandidate._IsAccountVerified;
_GoogleAddressText = sourceCandidate._GoogleAddressText;
_PreferRemote = sourceCandidate._PreferRemote;
_HappyToRelocate = sourceCandidate._HappyToRelocate;
_PrivacyPolicyAgreed = sourceCandidate._PrivacyPolicyAgreed;
_ConditionsAgreed = sourceCandidate._ConditionsAgreed;
......@@ -2702,8 +2432,6 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
_PreferRemote = (Boolean)(HELPER_PreferRemote.readExternal (_PreferRemote, vals.get(FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.readExternal (_HappyToRelocate, vals.get(FIELD_HappyToRelocate))); //
_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));
......@@ -2729,8 +2457,6 @@ public abstract class BaseCandidate extends SecUserExtension
vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey));
vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified));
vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
vals.put (FIELD_PreferRemote, HELPER_PreferRemote.writeExternal (_PreferRemote));
vals.put (FIELD_HappyToRelocate, HELPER_HappyToRelocate.writeExternal (_HappyToRelocate));
vals.put (FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.writeExternal (_PrivacyPolicyAgreed));
vals.put (FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.writeExternal (_ConditionsAgreed));
vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData());
......@@ -2779,14 +2505,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherCandidate._GoogleAddressText));
}
if (!HELPER_PreferRemote.compare(this._PreferRemote, otherCandidate._PreferRemote))
{
listener.notifyFieldChange(this, other, FIELD_PreferRemote, HELPER_PreferRemote.toObject(this._PreferRemote), HELPER_PreferRemote.toObject(otherCandidate._PreferRemote));
}
if (!HELPER_HappyToRelocate.compare(this._HappyToRelocate, otherCandidate._HappyToRelocate))
{
listener.notifyFieldChange(this, other, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(this._HappyToRelocate), HELPER_HappyToRelocate.toObject(otherCandidate._HappyToRelocate));
}
// Compare single assocs
_TestInput.compare (otherCandidate._TestInput, listener);
......@@ -2823,8 +2541,6 @@ public abstract class BaseCandidate extends SecUserExtension
visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey()));
visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified()));
visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
visitor.visitField(this, FIELD_PreferRemote, HELPER_PreferRemote.toObject(getPreferRemote()));
visitor.visitField(this, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(getHappyToRelocate()));
visitor.visitAssociation (_TestInput);
visitor.visitAssociation (_TestAnalysises);
visitor.visitAssociation (_JobApplications);
......@@ -2911,14 +2627,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
return filter.matches (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PreferRemote))
{
return filter.matches (getPreferRemote ());
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return filter.matches (getHappyToRelocate ());
}
else if (attribName.equals (SINGLEREFERENCE_TestInput))
{
return filter.matches (getTestInput ());
......@@ -2996,18 +2704,6 @@ public abstract class BaseCandidate extends SecUserExtension
return this;
}
public SearchAll andPreferRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.prefer_remote", "PreferRemote");
return this;
}
public SearchAll andHappyToRelocate (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.happy_to_relocate", "HappyToRelocate");
return this;
}
public SearchAll andTestInput (QueryFilter<TestInput> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
......@@ -3125,18 +2821,6 @@ public abstract class BaseCandidate extends SecUserExtension
return this;
}
public SearchIdPin andPreferRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.prefer_remote", "PreferRemote");
return this;
}
public SearchIdPin andHappyToRelocate (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.happy_to_relocate", "HappyToRelocate");
return this;
}
public SearchIdPin andTestInput (QueryFilter<TestInput> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
......@@ -3212,14 +2896,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
return HELPER_GoogleAddressText.toObject (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PreferRemote))
{
return HELPER_PreferRemote.toObject (getPreferRemote ());
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return HELPER_HappyToRelocate.toObject (getHappyToRelocate ());
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed.toObject (getPrivacyPolicyAgreed ());
......@@ -3269,14 +2945,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
return HELPER_GoogleAddressText;
}
else if (attribName.equals (FIELD_PreferRemote))
{
return HELPER_PreferRemote;
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return HELPER_HappyToRelocate;
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
return HELPER_PrivacyPolicyAgreed;
......@@ -3326,14 +2994,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue)));
}
else if (attribName.equals (FIELD_PreferRemote))
{
setPreferRemote ((Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, attribValue)));
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
setHappyToRelocate ((Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, attribValue)));
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{
setPrivacyPolicyAgreed ((Boolean)(HELPER_PrivacyPolicyAgreed.fromObject (_PrivacyPolicyAgreed, attribValue)));
......@@ -3390,14 +3050,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
return getWriteability_GoogleAddressText ();
}
else if (fieldName.equals (FIELD_PreferRemote))
{
return getWriteability_PreferRemote ();
}
else if (fieldName.equals (FIELD_HappyToRelocate))
{
return getWriteability_HappyToRelocate ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_TestAnalysises))
{
return getWriteability_TestAnalysises ();
......@@ -3471,16 +3123,6 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_GoogleAddressText);
}
if (getWriteability_PreferRemote () != FieldWriteability.TRUE)
{
fields.add (FIELD_PreferRemote);
}
if (getWriteability_HappyToRelocate () != FieldWriteability.TRUE)
{
fields.add (FIELD_HappyToRelocate);
}
if (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.TRUE)
{
fields.add (FIELD_PrivacyPolicyAgreed);
......@@ -3507,8 +3149,6 @@ public abstract class BaseCandidate extends SecUserExtension
result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey));
result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified));
result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
result.add(HELPER_PreferRemote.getAttribObject (getClass (), _PreferRemote, false, FIELD_PreferRemote));
result.add(HELPER_HappyToRelocate.getAttribObject (getClass (), _HappyToRelocate, false, FIELD_HappyToRelocate));
result.add(HELPER_PrivacyPolicyAgreed.getAttribObject (getClass (), _PrivacyPolicyAgreed, false, FIELD_PrivacyPolicyAgreed));
result.add(HELPER_ConditionsAgreed.getAttribObject (getClass (), _ConditionsAgreed, false, FIELD_ConditionsAgreed));
......@@ -3688,42 +3328,6 @@ public abstract class BaseCandidate extends SecUserExtension
}
/**
* Get the attribute PreferRemote
*/
public Boolean getPreferRemote (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute PreferRemote.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setPreferRemote (Candidate obj, Boolean newPreferRemote) throws FieldException
{
return newPreferRemote;
}
/**
* Get the attribute HappyToRelocate
*/
public Boolean getHappyToRelocate (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute HappyToRelocate.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setHappyToRelocate (Candidate obj, Boolean newHappyToRelocate) throws FieldException
{
return newHappyToRelocate;
}
/**
* Get the attribute PrivacyPolicyAgreed
*/
public Boolean getPrivacyPolicyAgreed (Candidate obj, Boolean original)
......@@ -3863,14 +3467,6 @@ public abstract class BaseCandidate extends SecUserExtension
{
return toGoogleAddressText ();
}
if (name.equals ("PreferRemote"))
{
return toPreferRemote ();
}
if (name.equals ("HappyToRelocate"))
{
return toHappyToRelocate ();
}
if (name.equals ("TestInput"))
{
return toTestInput ();
......@@ -3898,10 +3494,6 @@ public abstract class BaseCandidate extends SecUserExtension
public PipeLine<From, Boolean> toIsAccountVerified () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsAccountVerified)); }
public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); }
public PipeLine<From, Boolean> toPreferRemote () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PreferRemote)); }
public PipeLine<From, Boolean> toHappyToRelocate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_HappyToRelocate)); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput () { return toTestInput (Filter.ALL); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput (Filter<TestInput> filter)
......
......@@ -44,6 +44,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
public static final String FIELD_CoverLetter = "CoverLetter";
public static final String FIELD_ApplicationStatus = "ApplicationStatus";
public static final String FIELD_SubmittedDate = "SubmittedDate";
public static final String FIELD_GoogleAddressText = "GoogleAddressText";
public static final String FIELD_PreferRemote = "PreferRemote";
public static final String FIELD_HappyToRelocate = "HappyToRelocate";
public static final String FIELD_AppProcessOption = "AppProcessOption";
public static final String FIELD_OverallRank = "OverallRank";
public static final String FIELD_RoleFit = "RoleFit";
......@@ -69,6 +72,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private static final BLOBAttributeHelper HELPER_CoverLetter = BLOBAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<JobApplication, ApplicationStatus> HELPER_ApplicationStatus = new EnumeratedAttributeHelper<JobApplication, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper<JobApplication> HELPER_SubmittedDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<JobApplication> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<JobApplication> HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<JobApplication> HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<JobApplication, AppProcessOption> HELPER_AppProcessOption = new EnumeratedAttributeHelper<JobApplication, AppProcessOption> (AppProcessOption.FACTORY_AppProcessOption);
private static final DefaultAttributeHelper<JobApplication> HELPER_OverallRank = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_RoleFit = BLOBAttributeHelper.INSTANCE;
......@@ -82,6 +88,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private BinaryContent _CoverLetter;
private ApplicationStatus _ApplicationStatus;
private Date _SubmittedDate;
private String _GoogleAddressText;
private Boolean _PreferRemote;
private Boolean _HappyToRelocate;
private AppProcessOption _AppProcessOption;
private Integer _OverallRank;
private Map _RoleFit;
......@@ -114,6 +123,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private static final AttributeValidator[] FIELD_CoverLetter_Validators;
private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
private static final AttributeValidator[] FIELD_SubmittedDate_Validators;
private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
private static final AttributeValidator[] FIELD_PreferRemote_Validators;
private static final AttributeValidator[] FIELD_HappyToRelocate_Validators;
// Arrays of behaviour decorators
......@@ -144,6 +156,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
FIELD_CoverLetter_Validators = (AttributeValidator[])setupAttribMetaData_CoverLetter(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_SubmittedDate_Validators = (AttributeValidator[])setupAttribMetaData_SubmittedDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PreferRemote_Validators = (AttributeValidator[])setupAttribMetaData_PreferRemote(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_HappyToRelocate_Validators = (AttributeValidator[])setupAttribMetaData_HappyToRelocate(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_JobApplication.initialiseReference ();
......@@ -411,6 +426,62 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_GoogleAddressText(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "google_address_text");
metaInfo.put ("length", "300");
metaInfo.put ("name", "GoogleAddressText");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.GoogleAddressText:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (FIELD_GoogleAddressText, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "GoogleAddressText", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.GoogleAddressText:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_PreferRemote(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "prefer_remote");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "PreferRemote");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.PreferRemote:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (FIELD_PreferRemote, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "PreferRemote", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.PreferRemote:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_HappyToRelocate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "happy_to_relocate");
metaInfo.put ("name", "HappyToRelocate");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.HappyToRelocate:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (FIELD_HappyToRelocate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "HappyToRelocate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.HappyToRelocate:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -442,6 +513,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_CoverLetter = (BinaryContent)(HELPER_CoverLetter.initialise (_CoverLetter));
_ApplicationStatus = (ApplicationStatus)(ApplicationStatus.DRAFT);
_SubmittedDate = (Date)(HELPER_SubmittedDate.initialise (_SubmittedDate));
_GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
_PreferRemote = (Boolean)(Boolean.FALSE);
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (_HappyToRelocate));
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.initialise (_AppProcessOption));
_OverallRank = (Integer)(HELPER_OverallRank.initialise (_OverallRank));
_RoleFit = (Map)(HELPER_RoleFit.initialise (_RoleFit));
......@@ -874,6 +948,300 @@ public abstract class BaseJobApplication extends BaseBusinessClass
}
/**
* Get the attribute GoogleAddressText
*/
public String getGoogleAddressText ()
{
assertValid();
String valToReturn = _GoogleAddressText;
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
valToReturn = bhd.getGoogleAddressText ((JobApplication)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 preGoogleAddressTextChange (String newGoogleAddressText) 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 postGoogleAddressTextChange () throws FieldException
{
}
public FieldWriteability getWriteability_GoogleAddressText ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute GoogleAddressText. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setGoogleAddressText (String newGoogleAddressText) throws FieldException
{
boolean oldAndNewIdentical = HELPER_GoogleAddressText.compare (_GoogleAddressText, newGoogleAddressText);
try
{
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
newGoogleAddressText = bhd.setGoogleAddressText ((JobApplication)this, newGoogleAddressText);
oldAndNewIdentical = HELPER_GoogleAddressText.compare (_GoogleAddressText, newGoogleAddressText);
}
if (FIELD_GoogleAddressText_Validators.length > 0)
{
Object newGoogleAddressTextObj = HELPER_GoogleAddressText.toObject (newGoogleAddressText);
if (newGoogleAddressTextObj != null)
{
int loopMax = FIELD_GoogleAddressText_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_GoogleAddressText);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_GoogleAddressText_Validators[v].checkAttribute (this, FIELD_GoogleAddressText, metadata, newGoogleAddressTextObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_GoogleAddressText () != FieldWriteability.FALSE, "Field GoogleAddressText is not writeable");
preGoogleAddressTextChange (newGoogleAddressText);
markFieldChange (FIELD_GoogleAddressText);
_GoogleAddressText = newGoogleAddressText;
postFieldChange (FIELD_GoogleAddressText);
postGoogleAddressTextChange ();
}
}
/**
* Get the attribute PreferRemote
*/
public Boolean getPreferRemote ()
{
assertValid();
Boolean valToReturn = _PreferRemote;
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
valToReturn = bhd.getPreferRemote ((JobApplication)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 prePreferRemoteChange (Boolean newPreferRemote) 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 postPreferRemoteChange () throws FieldException
{
}
public FieldWriteability getWriteability_PreferRemote ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PreferRemote. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPreferRemote (Boolean newPreferRemote) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
try
{
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
newPreferRemote = bhd.setPreferRemote ((JobApplication)this, newPreferRemote);
oldAndNewIdentical = HELPER_PreferRemote.compare (_PreferRemote, newPreferRemote);
}
if (FIELD_PreferRemote_Validators.length > 0)
{
Object newPreferRemoteObj = HELPER_PreferRemote.toObject (newPreferRemote);
if (newPreferRemoteObj != null)
{
int loopMax = FIELD_PreferRemote_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_PreferRemote);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PreferRemote_Validators[v].checkAttribute (this, FIELD_PreferRemote, metadata, newPreferRemoteObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PreferRemote () != FieldWriteability.FALSE, "Field PreferRemote is not writeable");
prePreferRemoteChange (newPreferRemote);
markFieldChange (FIELD_PreferRemote);
_PreferRemote = newPreferRemote;
postFieldChange (FIELD_PreferRemote);
postPreferRemoteChange ();
}
}
/**
* Get the attribute HappyToRelocate
*/
public Boolean getHappyToRelocate ()
{
assertValid();
Boolean valToReturn = _HappyToRelocate;
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
valToReturn = bhd.getHappyToRelocate ((JobApplication)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 preHappyToRelocateChange (Boolean newHappyToRelocate) 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 postHappyToRelocateChange () throws FieldException
{
}
public FieldWriteability getWriteability_HappyToRelocate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute HappyToRelocate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setHappyToRelocate (Boolean newHappyToRelocate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
try
{
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
newHappyToRelocate = bhd.setHappyToRelocate ((JobApplication)this, newHappyToRelocate);
oldAndNewIdentical = HELPER_HappyToRelocate.compare (_HappyToRelocate, newHappyToRelocate);
}
if (FIELD_HappyToRelocate_Validators.length > 0)
{
Object newHappyToRelocateObj = HELPER_HappyToRelocate.toObject (newHappyToRelocate);
if (newHappyToRelocateObj != null)
{
int loopMax = FIELD_HappyToRelocate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_HappyToRelocate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_HappyToRelocate_Validators[v].checkAttribute (this, FIELD_HappyToRelocate, metadata, newHappyToRelocateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_HappyToRelocate () != FieldWriteability.FALSE, "Field HappyToRelocate is not writeable");
preHappyToRelocateChange (newHappyToRelocate);
markFieldChange (FIELD_HappyToRelocate);
_HappyToRelocate = newHappyToRelocate;
postFieldChange (FIELD_HappyToRelocate);
postHappyToRelocateChange ();
}
}
/**
* Get the attribute AppProcessOption
*/
public AppProcessOption getAppProcessOption ()
......@@ -2240,6 +2608,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
tl_job_applicationPSet.setAttrib (FIELD_CoverLetter, HELPER_CoverLetter.toObject (_CoverLetter)); //
tl_job_applicationPSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
tl_job_applicationPSet.setAttrib (FIELD_SubmittedDate, HELPER_SubmittedDate.toObject (_SubmittedDate)); //
tl_job_applicationPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
tl_job_applicationPSet.setAttrib (FIELD_PreferRemote, HELPER_PreferRemote.toObject (_PreferRemote)); //
tl_job_applicationPSet.setAttrib (FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject (_HappyToRelocate)); //
_Candidate.getPersistentSets (allSets);
_Job.getPersistentSets (allSets);
......@@ -2260,6 +2631,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_CoverLetter = (BinaryContent)(HELPER_CoverLetter.fromObject (_CoverLetter, tl_job_applicationPSet.getAttrib (FIELD_CoverLetter))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_job_applicationPSet.getAttrib (FIELD_ApplicationStatus))); //
_SubmittedDate = (Date)(HELPER_SubmittedDate.fromObject (_SubmittedDate, tl_job_applicationPSet.getAttrib (FIELD_SubmittedDate))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, tl_job_applicationPSet.getAttrib (FIELD_GoogleAddressText))); //
_PreferRemote = (Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, tl_job_applicationPSet.getAttrib (FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, tl_job_applicationPSet.getAttrib (FIELD_HappyToRelocate))); //
_Candidate.setFromPersistentSets (objectID, allSets);
_Job.setFromPersistentSets (objectID, allSets);
......@@ -2313,6 +2687,33 @@ public abstract class BaseJobApplication extends BaseBusinessClass
e.addException (ex);
}
try
{
setGoogleAddressText (otherJobApplication.getGoogleAddressText ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setPreferRemote (otherJobApplication.getPreferRemote ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setHappyToRelocate (otherJobApplication.getHappyToRelocate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -2332,6 +2733,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_CoverLetter = sourceJobApplication._CoverLetter;
_ApplicationStatus = sourceJobApplication._ApplicationStatus;
_SubmittedDate = sourceJobApplication._SubmittedDate;
_GoogleAddressText = sourceJobApplication._GoogleAddressText;
_PreferRemote = sourceJobApplication._PreferRemote;
_HappyToRelocate = sourceJobApplication._HappyToRelocate;
_AppProcessOption = sourceJobApplication._AppProcessOption;
_OverallRank = sourceJobApplication._OverallRank;
_RoleFit = sourceJobApplication._RoleFit;
......@@ -2402,6 +2806,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_CoverLetter = (BinaryContent)(HELPER_CoverLetter.readExternal (_CoverLetter, vals.get(FIELD_CoverLetter))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
_SubmittedDate = (Date)(HELPER_SubmittedDate.readExternal (_SubmittedDate, vals.get(FIELD_SubmittedDate))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
_PreferRemote = (Boolean)(HELPER_PreferRemote.readExternal (_PreferRemote, vals.get(FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.readExternal (_HappyToRelocate, vals.get(FIELD_HappyToRelocate))); //
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.readExternal (_AppProcessOption, vals.get(FIELD_AppProcessOption))); //
_OverallRank = (Integer)(HELPER_OverallRank.readExternal (_OverallRank, vals.get(FIELD_OverallRank))); //
_RoleFit = (Map)(HELPER_RoleFit.readExternal (_RoleFit, vals.get(FIELD_RoleFit))); //
......@@ -2427,6 +2834,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
vals.put (FIELD_CoverLetter, HELPER_CoverLetter.writeExternal (_CoverLetter));
vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
vals.put (FIELD_SubmittedDate, HELPER_SubmittedDate.writeExternal (_SubmittedDate));
vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
vals.put (FIELD_PreferRemote, HELPER_PreferRemote.writeExternal (_PreferRemote));
vals.put (FIELD_HappyToRelocate, HELPER_HappyToRelocate.writeExternal (_HappyToRelocate));
vals.put (FIELD_AppProcessOption, HELPER_AppProcessOption.writeExternal (_AppProcessOption));
vals.put (FIELD_OverallRank, HELPER_OverallRank.writeExternal (_OverallRank));
vals.put (FIELD_RoleFit, HELPER_RoleFit.writeExternal (_RoleFit));
......@@ -2466,6 +2876,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_SubmittedDate, HELPER_SubmittedDate.toObject(this._SubmittedDate), HELPER_SubmittedDate.toObject(otherJobApplication._SubmittedDate));
}
if (!HELPER_GoogleAddressText.compare(this._GoogleAddressText, otherJobApplication._GoogleAddressText))
{
listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherJobApplication._GoogleAddressText));
}
if (!HELPER_PreferRemote.compare(this._PreferRemote, otherJobApplication._PreferRemote))
{
listener.notifyFieldChange(this, other, FIELD_PreferRemote, HELPER_PreferRemote.toObject(this._PreferRemote), HELPER_PreferRemote.toObject(otherJobApplication._PreferRemote));
}
if (!HELPER_HappyToRelocate.compare(this._HappyToRelocate, otherJobApplication._HappyToRelocate))
{
listener.notifyFieldChange(this, other, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(this._HappyToRelocate), HELPER_HappyToRelocate.toObject(otherJobApplication._HappyToRelocate));
}
// Compare single assocs
_WorkFlow.compare (otherJobApplication._WorkFlow, listener);
......@@ -2502,6 +2924,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
visitor.visitField(this, FIELD_CoverLetter, HELPER_CoverLetter.toObject(getCoverLetter()));
visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
visitor.visitField(this, FIELD_SubmittedDate, HELPER_SubmittedDate.toObject(getSubmittedDate()));
visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
visitor.visitField(this, FIELD_PreferRemote, HELPER_PreferRemote.toObject(getPreferRemote()));
visitor.visitField(this, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(getHappyToRelocate()));
visitor.visitAssociation (_WorkFlow);
visitor.visitAssociation (_Candidate);
visitor.visitAssociation (_Job);
......@@ -2571,6 +2996,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return filter.matches (getSubmittedDate ());
}
else if (attribName.equals (FIELD_GoogleAddressText))
{
return filter.matches (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PreferRemote))
{
return filter.matches (getPreferRemote ());
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return filter.matches (getHappyToRelocate ());
}
else if (attribName.equals (SINGLEREFERENCE_Candidate))
{
return filter.matches (getCandidate ());
......@@ -2634,6 +3071,24 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchAll andGoogleAddressText (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
return this;
}
public SearchAll andPreferRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
return this;
}
public SearchAll andHappyToRelocate (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
return this;
}
public SearchAll andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -2735,6 +3190,24 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchCandidateJob andGoogleAddressText (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
return this;
}
public SearchCandidateJob andPreferRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
return this;
}
public SearchCandidateJob andHappyToRelocate (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
return this;
}
public SearchCandidateJob andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -2852,6 +3325,24 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchDetails andGoogleAddressText (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job_application.google_address_text", "GoogleAddressText");
return this;
}
public SearchDetails andPreferRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.prefer_remote", "PreferRemote");
return this;
}
public SearchDetails andHappyToRelocate (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job_application.happy_to_relocate", "HappyToRelocate");
return this;
}
public SearchDetails andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -2916,6 +3407,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return HELPER_SubmittedDate.toObject (getSubmittedDate ());
}
else if (attribName.equals (FIELD_GoogleAddressText))
{
return HELPER_GoogleAddressText.toObject (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PreferRemote))
{
return HELPER_PreferRemote.toObject (getPreferRemote ());
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return HELPER_HappyToRelocate.toObject (getHappyToRelocate ());
}
else if (attribName.equals (FIELD_AppProcessOption))
{
return HELPER_AppProcessOption.toObject (getAppProcessOption ());
......@@ -2969,6 +3472,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return HELPER_SubmittedDate;
}
else if (attribName.equals (FIELD_GoogleAddressText))
{
return HELPER_GoogleAddressText;
}
else if (attribName.equals (FIELD_PreferRemote))
{
return HELPER_PreferRemote;
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
return HELPER_HappyToRelocate;
}
else if (attribName.equals (FIELD_AppProcessOption))
{
return HELPER_AppProcessOption;
......@@ -3022,6 +3537,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
setSubmittedDate ((Date)(HELPER_SubmittedDate.fromObject (_SubmittedDate, attribValue)));
}
else if (attribName.equals (FIELD_GoogleAddressText))
{
setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue)));
}
else if (attribName.equals (FIELD_PreferRemote))
{
setPreferRemote ((Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, attribValue)));
}
else if (attribName.equals (FIELD_HappyToRelocate))
{
setHappyToRelocate ((Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, attribValue)));
}
else if (attribName.equals (FIELD_AppProcessOption))
{
setAppProcessOption ((AppProcessOption)(HELPER_AppProcessOption.fromObject (_AppProcessOption, attribValue)));
......@@ -3082,6 +3609,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return getWriteability_SubmittedDate ();
}
else if (fieldName.equals (FIELD_GoogleAddressText))
{
return getWriteability_GoogleAddressText ();
}
else if (fieldName.equals (FIELD_PreferRemote))
{
return getWriteability_PreferRemote ();
}
else if (fieldName.equals (FIELD_HappyToRelocate))
{
return getWriteability_HappyToRelocate ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_AssessmentCriteriaAnswers))
{
return getWriteability_AssessmentCriteriaAnswers ();
......@@ -3152,6 +3691,21 @@ public abstract class BaseJobApplication extends BaseBusinessClass
fields.add (FIELD_SubmittedDate);
}
if (getWriteability_GoogleAddressText () != FieldWriteability.TRUE)
{
fields.add (FIELD_GoogleAddressText);
}
if (getWriteability_PreferRemote () != FieldWriteability.TRUE)
{
fields.add (FIELD_PreferRemote);
}
if (getWriteability_HappyToRelocate () != FieldWriteability.TRUE)
{
fields.add (FIELD_HappyToRelocate);
}
if (getWriteability_AppProcessOption () != FieldWriteability.TRUE)
{
fields.add (FIELD_AppProcessOption);
......@@ -3195,6 +3749,9 @@ public abstract class BaseJobApplication extends BaseBusinessClass
result.add(HELPER_CoverLetter.getAttribObject (getClass (), _CoverLetter, false, FIELD_CoverLetter));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
result.add(HELPER_SubmittedDate.getAttribObject (getClass (), _SubmittedDate, false, FIELD_SubmittedDate));
result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
result.add(HELPER_PreferRemote.getAttribObject (getClass (), _PreferRemote, false, FIELD_PreferRemote));
result.add(HELPER_HappyToRelocate.getAttribObject (getClass (), _HappyToRelocate, false, FIELD_HappyToRelocate));
result.add(HELPER_AppProcessOption.getAttribObject (getClass (), _AppProcessOption, false, FIELD_AppProcessOption));
result.add(HELPER_OverallRank.getAttribObject (getClass (), _OverallRank, false, FIELD_OverallRank));
result.add(HELPER_RoleFit.getAttribObject (getClass (), _RoleFit, false, FIELD_RoleFit));
......@@ -3360,6 +3917,60 @@ public abstract class BaseJobApplication extends BaseBusinessClass
}
/**
* Get the attribute GoogleAddressText
*/
public String getGoogleAddressText (JobApplication obj, String original)
{
return original;
}
/**
* Change the value set for attribute GoogleAddressText.
* May modify the field beforehand
* Occurs before validation.
*/
public String setGoogleAddressText (JobApplication obj, String newGoogleAddressText) throws FieldException
{
return newGoogleAddressText;
}
/**
* Get the attribute PreferRemote
*/
public Boolean getPreferRemote (JobApplication obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute PreferRemote.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setPreferRemote (JobApplication obj, Boolean newPreferRemote) throws FieldException
{
return newPreferRemote;
}
/**
* Get the attribute HappyToRelocate
*/
public Boolean getHappyToRelocate (JobApplication obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute HappyToRelocate.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setHappyToRelocate (JobApplication obj, Boolean newHappyToRelocate) throws FieldException
{
return newHappyToRelocate;
}
/**
* Get the attribute AppProcessOption
*/
public AppProcessOption getAppProcessOption (JobApplication obj, AppProcessOption original)
......@@ -3567,6 +4178,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return toSubmittedDate ();
}
if (name.equals ("GoogleAddressText"))
{
return toGoogleAddressText ();
}
if (name.equals ("PreferRemote"))
{
return toPreferRemote ();
}
if (name.equals ("HappyToRelocate"))
{
return toHappyToRelocate ();
}
if (name.equals ("Candidate"))
{
return toCandidate ();
......@@ -3600,6 +4223,12 @@ public abstract class BaseJobApplication extends BaseBusinessClass
public PipeLine<From, ApplicationStatus> toApplicationStatus () { return pipe(new ORMAttributePipe<Me, ApplicationStatus>(FIELD_ApplicationStatus)); }
public PipeLine<From, Date> toSubmittedDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_SubmittedDate)); }
public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); }
public PipeLine<From, Boolean> toPreferRemote () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PreferRemote)); }
public PipeLine<From, Boolean> toHappyToRelocate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_HappyToRelocate)); }
public WorkFlow.WorkFlowPipeLineFactory<From, WorkFlow> toWorkFlow () { return toWorkFlow (Filter.ALL); }
public WorkFlow.WorkFlowPipeLineFactory<From, WorkFlow> toWorkFlow (Filter<WorkFlow> filter)
......
package performa.orm;
import com.google.maps.model.Distance;
import java.util.Calendar;
import java.util.Collection;
import java.util.Comparator;
......@@ -18,6 +19,7 @@ import oneit.utils.DateDiff;
import oneit.utils.ObjectTransform;
import oneit.utils.StringUtils;
import oneit.utils.filter.*;
import performa.utils.DistanceUtils;
import performa.utils.ExpressAnswerFilter;
......@@ -164,16 +166,6 @@ public class Candidate extends BaseCandidate
return null;
}
public boolean showHappyToRelocate()
{
return isTrue(getHappyToRelocate());
}
public boolean showPreferRemote()
{
return isTrue(getPreferRemote());
}
public boolean showPrivacyPolicyAgreed()
{
return isTrue(getPrivacyPolicyAgreed());
......@@ -186,6 +178,7 @@ public class Candidate extends BaseCandidate
public boolean isFarFromJob()
{
Distance calculateDistance = DistanceUtils.calculateDistance(FIELD_Phone, FIELD_Phone);
return false;
}
}
\ No newline at end of file
......@@ -23,8 +23,6 @@
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300"/>
<ATTRIB name="PreferRemote" type="Boolean" dbcol="prefer_remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HappyToRelocate" type="Boolean" dbcol="happy_to_relocate" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates" />
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
......
......@@ -34,8 +34,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
private String dummyVerificationKey;
private Boolean dummyIsAccountVerified;
private String dummyGoogleAddressText;
private Boolean dummyPreferRemote;
private Boolean dummyHappyToRelocate;
// Static constants corresponding to attribute helpers
......@@ -46,8 +44,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
......@@ -61,12 +57,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey));
dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified));
dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText));
dummyPreferRemote = (Boolean)(HELPER_PreferRemote.initialise (dummyPreferRemote));
dummyHappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (dummyHappyToRelocate));
}
private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.google_address_text, {PREFIX}oneit_sec_user_extension.prefer_remote, {PREFIX}oneit_sec_user_extension.happy_to_relocate, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.google_address_text, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -125,8 +119,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationKey)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsAccountVerified)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_GoogleAddressText)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_PreferRemote)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_HappyToRelocate)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_TestInput)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_User))
{
......@@ -227,10 +219,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}oneit_sec_user_extension " +
"SET phone = ?, forgot_password_mail_send_date = ?, forgot_password_key = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, google_address_text = ?, prefer_remote = ?, happy_to_relocate = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET phone = ?, forgot_password_mail_send_date = ?, forgot_password_key = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, google_address_text = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_HappyToRelocate))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -600,8 +592,6 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_PreferRemote, HELPER_PreferRemote.getFromRS(dummyPreferRemote, r, "prefer_remote"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_HappyToRelocate, HELPER_HappyToRelocate.getFromRS(dummyHappyToRelocate, r, "happy_to_relocate"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_TestInput, r.getObject ("test_input_id"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_User, r.getObject ("user_id"));
......@@ -621,10 +611,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (phone, forgot_password_mail_send_date, forgot_password_key, verification_mail_send_date, verification_key, is_account_verified, google_address_text, prefer_remote, happy_to_relocate, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
" (phone, forgot_password_mail_send_date, forgot_password_key, verification_mail_send_date, verification_key, is_account_verified, google_address_text, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_HappyToRelocate))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
package performa.orm;
import com.google.maps.model.Distance;
import java.awt.Color;
import java.util.*;
import oneit.logging.*;
......@@ -174,6 +175,10 @@ public class JobApplication extends BaseJobApplication
return false;
}
public boolean hasStartedApplication()
{
return getAssessmentCriteriaAnswersCount() > 0 || getCandidate().getCultureCriteriaAnswersCount() > 0;
}
public boolean cultureCompleted()
{
......@@ -640,4 +645,28 @@ public class JobApplication extends BaseJobApplication
{
return getJob().getIncludeAssessmentCriteria() ? ((getAssessmentCriteriaAnswersCount() * 100) / getJob().getAssessmentCriteriasCount()) : 0d;
}
public boolean isFarFromJob()
{
if(getJob().getGoogleAddressText() != null && getCandidate().getGoogleAddressText() != null)
{
Distance distance = DistanceUtils.calculateDistance(getCandidate().getGoogleAddressText() , getJob().getGoogleAddressText());
if(distance != null)
{
return distance.inMeters / 1000 > getJob().getExpectedCandidateRadius().getDistanceInKM();
}
}
return false;
}
public boolean showHappyToRelocate()
{
return isTrue(getHappyToRelocate());
}
public boolean showPreferRemote()
{
return isTrue(getPreferRemote());
}
}
\ No newline at end of file
......@@ -22,6 +22,9 @@
<ATTRIB name="CoverLetter" type="BinaryContent" dbcol="cover_letter" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" mandatory="false"/>
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" attribHelper="EnumeratedAttributeHelper" defaultValue="ApplicationStatus.DRAFT" mandatory="true"/>
<ATTRIB name="SubmittedDate" type="Date" dbcol="submitted_date"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300"/>
<ATTRIB name="PreferRemote" type="Boolean" dbcol="prefer_remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HappyToRelocate" type="Boolean" dbcol="happy_to_relocate"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications" mandatory="true"/>
......
......@@ -31,6 +31,9 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
private BinaryContent dummyCoverLetter;
private ApplicationStatus dummyApplicationStatus;
private Date dummySubmittedDate;
private String dummyGoogleAddressText;
private Boolean dummyPreferRemote;
private Boolean dummyHappyToRelocate;
// Static constants corresponding to attribute helpers
......@@ -38,6 +41,9 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
private static final BLOBAttributeHelper HELPER_CoverLetter = BLOBAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicationStatus = new EnumeratedAttributeHelper (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper HELPER_SubmittedDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
......@@ -48,10 +54,13 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
dummyCoverLetter = (BinaryContent)(HELPER_CoverLetter.initialise (dummyCoverLetter));
dummyApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (dummyApplicationStatus));
dummySubmittedDate = (Date)(HELPER_SubmittedDate.initialise (dummySubmittedDate));
dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText));
dummyPreferRemote = (Boolean)(HELPER_PreferRemote.initialise (dummyPreferRemote));
dummyHappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (dummyHappyToRelocate));
}
private String SELECT_COLUMNS = "{PREFIX}tl_job_application.object_id as id, {PREFIX}tl_job_application.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job_application.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job_application.cv, {PREFIX}tl_job_application.cover_letter, {PREFIX}tl_job_application.application_status, {PREFIX}tl_job_application.submitted_date, {PREFIX}tl_job_application.candidate_id, {PREFIX}tl_job_application.job_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_job_application.object_id as id, {PREFIX}tl_job_application.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job_application.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job_application.cv, {PREFIX}tl_job_application.cover_letter, {PREFIX}tl_job_application.application_status, {PREFIX}tl_job_application.submitted_date, {PREFIX}tl_job_application.google_address_text, {PREFIX}tl_job_application.prefer_remote, {PREFIX}tl_job_application.happy_to_relocate, {PREFIX}tl_job_application.candidate_id, {PREFIX}tl_job_application.job_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -106,6 +115,9 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_CoverLetter)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_ApplicationStatus)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_SubmittedDate)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_GoogleAddressText)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_PreferRemote)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_HappyToRelocate)||
!tl_job_applicationPSet.containsAttrib(JobApplication.SINGLEREFERENCE_Candidate)||
!tl_job_applicationPSet.containsAttrib(JobApplication.SINGLEREFERENCE_Job))
{
......@@ -197,10 +209,10 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job_application " +
"SET cv = ?, cover_letter = ?, application_status = ?, submitted_date = ?, candidate_id = ? , job_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET cv = ?, cover_letter = ?, application_status = ?, submitted_date = ?, google_address_text = ?, prefer_remote = ?, happy_to_relocate = ?, candidate_id = ? , job_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job_application.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -580,6 +592,9 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_CoverLetter, HELPER_CoverLetter.getFromRS(dummyCoverLetter, r, "cover_letter"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_SubmittedDate, HELPER_SubmittedDate.getFromRS(dummySubmittedDate, r, "submitted_date"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_PreferRemote, HELPER_PreferRemote.getFromRS(dummyPreferRemote, r, "prefer_remote"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_HappyToRelocate, HELPER_HappyToRelocate.getFromRS(dummyHappyToRelocate, r, "happy_to_relocate"));
tl_job_applicationPSet.setAttrib(JobApplication.SINGLEREFERENCE_Candidate, r.getObject ("candidate_id"));
tl_job_applicationPSet.setAttrib(JobApplication.SINGLEREFERENCE_Job, r.getObject ("job_id"));
......@@ -599,10 +614,10 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job_application " +
" (cv, cover_letter, application_status, submitted_date, candidate_id, job_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (cv, cover_letter, application_status, submitted_date, google_address_text, prefer_remote, happy_to_relocate, candidate_id, job_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))) .listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))) .listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
tl_job_applicationPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -35,11 +35,18 @@ public class LocationRadius extends AbstractEnumerated
return allLocationRadiuss;
}
private transient Integer DistanceInKM;
private LocationRadius (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public Integer getDistanceInKM()
{
return DistanceInKM;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allLocationRadiuss);
......@@ -107,6 +114,9 @@ public class LocationRadius extends AbstractEnumerated
public static void defineAdditionalData ()
{
KM30.DistanceInKM = 30;
KM60.DistanceInKM = 60;
KM100.DistanceInKM = 100;
}
......@@ -134,6 +144,7 @@ public class LocationRadius extends AbstractEnumerated
{
Map attribs = new HashMap ();
attribs.put ("DistanceInKM", ArrayFormatter.toObject(getDistanceInKM()));
return attribs;
}
......
......@@ -3,9 +3,11 @@
<ROOT>
<CONSTANT package="performa.orm.types" name="LocationRadius">
<VALUE name="KM30" value="KM30" description="30km/20mi"/>
<VALUE name="KM60" value="KM60" description="60km/40mi"/>
<VALUE name="KM100" value="KM100" description="100km/65mi"/>
<DATA name="DistanceInKM" type="Integer"/>
<VALUE name="KM30" value="KM30" description="30km/20mi" DistanceInKM="30" />
<VALUE name="KM60" value="KM60" description="60km/40mi" DistanceInKM="60" />
<VALUE name="KM100" value="KM100" description="100km/65mi" DistanceInKM="100" />
</CONSTANT>
</ROOT>
\ No newline at end of file
package performa.utils;
import com.google.maps.DistanceMatrixApi;
import com.google.maps.DistanceMatrixApiRequest;
import com.google.maps.GeoApiContext;
import com.google.maps.model.Distance;
import com.google.maps.model.DistanceMatrix;
import java.io.IOException;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
public class DistanceUtils
{
private static final String API_KEY= ConfigMgr.getKeyfileString("google.api.key","AIzaSyCaBh-MsMb8BBYJD_NcFzoCmygQbt5-QSw");
public static Distance calculateDistance(String origin, String destination)
{
try
{
DistanceMatrixApiRequest req = DistanceMatrixApi.newRequest(new GeoApiContext.Builder().apiKey(API_KEY).build());
DistanceMatrix trix = req.origins(new String[]{origin})
.destinations(new String[]{destination})
.await();
return trix.rows[0].elements[0].distance;
}
catch (com.google.maps.errors.ApiException | InterruptedException | IOException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while retrieving distance via google distance matrix api. origin: " + origin + " destination: " + destination);
}
return null;
}
}
......@@ -570,22 +570,39 @@
<oneit:toString value="<%= candidate.getPhone() %>" mode="EscapeHTML" />
</div>
</div>
<div class="contact-row" >
<div class="contact-row" style="display:none;">
<div class="contact-label"><img src="images/linkdin-icon.png" /></div>
<div class="contact-value"><a href="#">View LinkedIn profile</a></div>
</div>
<div class="contact-row" >
<%
if(jobApplication.getCV() != null)
{
%>
<div class="contact-row">
<div class="contact-label"><img src="images/download-icon.png" /></div>
<div class="contact-value"><a href="#">Download Resume</a></div>
<div class="contact-value">
<a target='blank' href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
Download Resume
</a>
</div>
</div>
<%
}
%>
</div>
<div class="applicant-location-info">
<div class="contact-row" >
<div class="contact-label"><img src="images/icon-location.png" /></div>
<div class="contact-value">
<div>Melbourne, Victoria</div>
<div>Austrilia 3000</div>
<div><oneit:toString value="<%= candidate.getGoogleAddressText() %>" mode="EscapeHTML"/></div>
<%
if(candidate.)
{
%>
<div class="orange-text">Does not want to relocate</div>
<%
}
%>
</div>
</div>
<div class="contact-row" >
......
......@@ -52,6 +52,7 @@
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/application_outline.jsp"/>
<RenderMode name="ConfirmDetails" preIncludeJSP="extensions/applicantportal/confirm_details.jsp"/>
<RenderMode name="CoverLetter" preIncludeJSP="extensions/applicantportal/cv_cover_letter.jsp"/>
<RenderMode name="SelectionCriteria" preIncludeJSP="extensions/applicantportal/selection_criteria.jsp"/>
<RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/applicantportal/workplace_culture.jsp"/>
......
......@@ -8,7 +8,7 @@
<div class="main-application-outline">
<%
ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
String nextPage = WebUtils.getSamePageInRenderMode(request, "SubmitApplication");
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
......@@ -22,37 +22,13 @@
JobApplication jobApplication = JobApplication.searchCandidateJob(objTran, candidate, job);
if(jobApplication == null)
{
jobApplication = JobApplication.createNewApplication(candidate, job);
}
Debug.assertion(jobApplication != null, "Invalid Job Application in applicant portal");
// //to store already completed culture or role data
// Boolean alreadyCompletedCulture = (Boolean) process.getAttribute("AlreadyCompletedCulture");
// Boolean alreadyCompletedRole = (Boolean) process.getAttribute("AlreadyCompletedRole");
//
// if(alreadyCompletedCulture==null)
// {
// alreadyCompletedCulture = jobApplication.getAlreadyCompletedApplicationForCulture()!=null;
// process.setAttribute("AlreadyCompletedCulture", alreadyCompletedCulture);
// }
//
// if(alreadyCompletedRole==null)
// {
// alreadyCompletedRole = jobApplication.getAlreadyCompletedApplicationForRole()!=null;
// process.setAttribute("AlreadyCompletedRole", alreadyCompletedRole);
// }
Boolean cvCompleted = jobApplication.getCV() != null && jobApplication.getCoverLetter() != null;
Boolean isSelectionComplete = jobApplication.selectionCompleted();
Boolean isCultureComplete = jobApplication.cultureCompleted();
Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
if(!cvCompleted)
{
nextPage = WebUtils.getSamePageInRenderMode(request, "CoverLetter");
}
else if(!isSelectionComplete)
if(!isSelectionComplete)
{
nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
}
......@@ -188,12 +164,6 @@
<%
if(job.getJobStatus() == JobStatus.OPEN && jobApplication.getApplicationStatus() == ApplicationStatus.DRAFT)
{
String btnText = "Resume the application";
if(jobApplication.getStatus()==ObjectStatus.NEW)
{
btnText = "Begin the application";
}
%>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="app-out-btn">
......@@ -223,7 +193,7 @@
else
{
%>
<oneit:button value="<%= btnText %>" name="save" skin="link" cssClass="box-btn"
<oneit:button value="<%= jobApplication.hasStartedApplication() ? "Resume the application" : "Begin the application" %>" name="save" skin="link" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry("restartProcess", Boolean.TRUE)
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
String nextPage = WebUtils.getSamePageInRenderMode(request, "CoverLetter") + "&JobID=" + job.getID().toString();
String outlinePage = WebUtils.getSamePageInRenderMode(request, "Page") + "&JobID=" + job.getID().toString();
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
JobApplication jobApplication = JobApplication.searchCandidateJob(objTran, candidate, job);
if(jobApplication != null)
{
response.sendRedirect(jobApplication.getCV() != null && jobApplication.getCoverLetter() != null ? outlinePage : nextPage);
}
if(jobApplication == null)
{
jobApplication = JobApplication.createNewApplication(candidate, job);
}
process.setAttribute("JobApplication", jobApplication);
process.setAttribute("JobApplicationID", jobApplication.getID().longID());
BinaryContent logo = job.getLogo();
%>
<oneit:form name="confirmDetails" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
recalcFunction = setupRecalc ($("form#confirmDetails"), {'recalcOnError':true});
});
</script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=AIzaSyCaBh-MsMb8BBYJD_NcFzoCmygQbt5-QSw"></script>
<oneit:script>
<oneit:script src="/scripts/google_address.js"/>
</oneit:script>
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="apply-job-logo-header signinpage">
<div>
<div class="logo-img">
<%
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
</div>
<div class="header-title">
<%= job.getTeamName() %>
</div>
</div>
</div>
<div class="main-verify-identity">
<div class="pl-confirm text-center">Please confirm your details to continue</div>
<div class="main-box-layout main-verify-step-2">
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="UserName" cssClass="form-control second-style" disabled="true" readonly="true"/>
</div>
<div class="row">
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="FirstName" cssClass="form-control second-style" required="true"/>
</div>
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="LastName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="LastName" cssClass="form-control second-style" required="true"/>
</div>
</div>
<div class="form-group text-left">
<label><oneit:ormlabel obj="<%= candidate %>" field="Phone" /></label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="Phone" cssClass="form-control second-style" required="true"/>
</div>
<hr class="seperate-line">
<div class="form-group text-left">
<label>Location</label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" />
</div>
<div class="form-group text-left" style="margin-top: 30px;">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= jobApplication %>" id="prefer-remote" attributeName="PreferRemote" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="jobApplication.showPreferRemote() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="prefer-remote">
<oneit:label GUIName="I would prefer to work remotely" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<oneit:recalcClass htmlTag="div" classScript="jobApplication.isFarFromJob() ? 'show': 'hide'" jobApplication="<%= jobApplication %>">
<div class="relocate-warning-box">
<p>
We noticed that your location is different to the location of the job (Melbourne, 3000).
</p>
<p>
Are you prepared to relocate for this position?
</p>
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= jobApplication %>" id="happy-to-relocate" attributeName="HappyToRelocate" type="checkbox" />
<oneit:recalcClass htmlTag="span" classScript="jobApplication.showHappyToRelocate() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="happy-to-relocate">
<oneit:label GUIName="Yes, I am happy to relocate"/>
</label>
</oneit:recalcClass>
</div>
</div>
<span class="warning-icon"></span>
</div>
</oneit:recalcClass>
<div class="text-center">
<oneit:button value="Verify and proceed" name="verifyIdentity" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job",job)
.mapEntry("Candidate",candidate)
.mapEntry("JobApplication",jobApplication)
.toMap() %>"/>
</div>
</div>
</div>
<script>
addGoogleAddressListener('#<%= "gAddress_"+ candidate.getObjectID() %>');
</script>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
......@@ -6,44 +6,28 @@
<oneit:dynIncluded>
<%
String currentPage = WebUtils.getSamePageInRenderMode(request, "CoverLetter");
String nextPage = WebUtils.getSamePageInRenderMode(request, "SubmitApplication");
ObjectTransaction objTran = ObjectTransaction.getTransaction();
Long jobAppId = process.getAttribute("JobApplicationID") != null ?
(Long) process.getAttribute("JobApplicationID") :
((JobApplication) process.getAttribute("JobApplication")).getID().longValue();
JobApplication jobApplication = null;
if(jobAppId != null)
{
jobApplication = JobApplication.getJobApplicationByID(objTran, jobAppId);
}
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
if(jobApplication == null)
{
jobApplication = (JobApplication) process.getAttribute("JobApplication");
}
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
Debug.assertion(jobApplication != null, "Job Application cannot be null in applicant portal - cv and cover letter ");
JobApplication jobApplication = JobApplication.searchCandidateJob(objTran, candidate, job);
Job job = jobApplication.getJob();
Debug.assertion(jobApplication != null, "Invalid Job Application in applicant portal");
if(process.getAttribute("JobApplicationID") == null)
{
process.setAttribute("JobApplicationID" , jobApplication.getID().longValue());
}
if(!jobApplication.selectionCompleted())
{
nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
}
else if(!jobApplication.cultureCompleted())
{
nextPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
}
else if(!jobApplication.assessmentCompleted())
{
nextPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment");
}
process.setAttribute("JobApplication" , jobApplication);
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
......
JobApplication.CoverLetter = Cover Letter
Job.Email = Email Address
Job.ConfirmPassword = Confirm Password
......
......@@ -5,3 +5,5 @@
#existsInOtherCompany = An account with this email address is already associated with another company.
#emailSent = A verification email has been sent to you. Please check your email.
#alreadyApplied = You have already applied for this job.
#uploadCover = Please upload your Cover Letter.
#uploadCV = Please upload your CV.
......@@ -7,7 +7,8 @@
<%
ObjectTransaction objTran = process.getTransaction ();
String successPage = WebUtils.getSamePageInRenderMode(request, "VerificationSent");
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "Page");
Article applicationArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.JOB_APPLICATION);
String nextPage = applicationArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "ConfirmDetails").toMap());
Job job = (Job) process.getAttribute("Job");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate");
......
<?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_job_application</tableName>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -7,8 +7,6 @@
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">oneit_sec_user_extension</tableName>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getArticleLink(request, process.getTransaction (), WebUtils.JOB_APPLICATION, "Page");
String nextPage = WebUtils.getArticleLink(request, process.getTransaction (), WebUtils.JOB_APPLICATION, "CoverLetter");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate");
Job job = (Job) process.getAttribute("Job");
SecUser secUser = null;
......@@ -18,15 +18,15 @@
String pin = request.getParameter("pin");
Boolean isVerify = Boolean.FALSE;
if(id!=null || key!=null || candidateId!=null || pin!=null)
if(id != null || key != null || candidateId != null || pin != null)
{
isVerify = Boolean.TRUE;
if(candidateId!=null && pin!=null)
if(candidateId != null && pin != null)
{
candidate = Candidate.searchIdPin(transaction, Long.parseLong(candidateId), pin);
if(candidate!=null && candidate.getIsAccountVerified()!=Boolean.TRUE)
if(candidate != null && candidate.getIsAccountVerified() != Boolean.TRUE)
{
secUser = candidate.getUser();
process.setAttribute("NewCandidate", candidate);
......@@ -45,13 +45,13 @@
}
//INVALID REQUEST FOR VERIFY CANDIDATE
if(isVerify && (job==null || secUser==null))
if(isVerify && (job == null || secUser == null))
{
response.sendRedirect(WebUtils.getSamePageInRenderMode(request, "AuthError"));
return; //Else it will continue execution and throws NPE.
}
if(secUser==null)
if(secUser == null)
{
secUser = SecUser.getTXUser(transaction);
candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
......@@ -59,6 +59,16 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
JobApplication jobApplication = JobApplication.searchCandidateJob(transaction, candidate, job);
if(jobApplication == null)
{
jobApplication = JobApplication.createNewApplication(candidate, job);
}
process.setAttribute("JobApplication", jobApplication);
process.setAttribute("JobApplicationID", jobApplication.getID().longID());
%>
<oneit:script>
<oneit:script src="/scripts/password_strength_lightweight.js"/>
......@@ -134,7 +144,6 @@
</div>
<div class="main-verify-identity">
<!--<div class="pl-confirm text-center"><%= job.getTeamName() %></div>-->
<div class="pl-confirm text-center">Please confirm your details to continue</div>
<div class="main-box-layout main-verify-step-2">
<div class="form-group text-left">
......@@ -163,8 +172,8 @@
<div class="form-group text-left" style="margin-top: 30px;">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= candidate %>" id="prefer-remote" attributeName="PreferRemote" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="candidate.showPreferRemote() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<oneit:ormInput obj="<%= jobApplication %>" id="prefer-remote" attributeName="PreferRemote" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="jobApplication.showPreferRemote() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="prefer-remote">
<oneit:label GUIName="I would prefer to work remotely" />
</label>
......@@ -172,7 +181,7 @@
</div>
</div>
</div>
<oneit:recalcClass htmlTag="div" classScript="candidate.isFarFromJob() ? 'show': 'hide'" candidate="<%= candidate %>">
<oneit:recalcClass htmlTag="div" classScript="jobApplication.isFarFromJob() ? 'show': 'hide'" jobApplication="<%= jobApplication %>">
<div class="relocate-warning-box">
<p>
We noticed that your location is different to the location of the job (Melbourne, 3000).
......@@ -182,10 +191,9 @@
</p>
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= candidate %>" id="happy-to-relocate" attributeName="HappyToRelocate" type="checkbox" />
<oneit:recalcClass htmlTag="span" classScript="candidate.showHappyToRelocate() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<oneit:ormInput obj="<%= jobApplication %>" id="happy-to-relocate" attributeName="HappyToRelocate" type="checkbox" />
<oneit:recalcClass htmlTag="span" classScript="jobApplication.showHappyToRelocate() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="happy-to-relocate">
<oneit:label GUIName="Yes, I am happy to relocate"/>
</label>
......@@ -241,6 +249,7 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job",job)
.mapEntry("Candidate",candidate)
.mapEntry("JobApplication",jobApplication)
.mapEntry("isVerify",isVerify)
.toMap() %>"/>
</div>
......
......@@ -2,3 +2,4 @@
<%@ page import="performa.intercom.utils.*, performa.intercom.resources.User, com.stripe.model.*"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.*, oneit.objstore.utils.ObjstoreUtils "%>
<%@ page import="oneit.utils.text.FormatUtils, oneit.utils.math.*"%>
<%@ page import="oneit.servlets.objstore.binary.*"%>
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