Commit 14f12bd4 by chenith Committed by Harsh Shah

Applicant SignIn, Verify Identity pages.(C002 - Apply - Verify Identity (Authenticate) - 1)

parent 510c87a5
......@@ -4,14 +4,18 @@
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_candidate</tableName>
<tableName factory="String">oneit_sec_user_extension</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="first_name" type="String" nullable="true" length="30"/>
<column name="object_type" type="String" nullable="false" length="30"/>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="test_input_id" type="Long" length="11" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_candidate" indexName="idx_tl_candidate_test_input_id" isUnique="false"><column name="test_input_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_test_input_id" isUnique="false"><column name="test_input_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_user_id" isUnique="false"><column name="user_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE tl_candidate;
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE tl_candidate (
CREATE TABLE oneit_sec_user_extension (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
first_name varchar(30) NULL,
test_input_id numeric(12) NULL
, object_type varchar(30) NOT NULL ,
phone varchar(30) NULL,
test_input_id numeric(12) NULL,
user_id numeric(12) NULL
);
ALTER TABLE tl_candidate ADD
CONSTRAINT PK_tl_candidate PRIMARY KEY
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_test_input_id
ON tl_candidate (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_test_input_id
ON oneit_sec_user_extension (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
-- DROP TABLE tl_candidate;
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE tl_candidate (
CREATE TABLE oneit_sec_user_extension (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
first_name varchar2(30) NULL,
test_input_id number(12) NULL
, object_type varchar2(30) NOT NULL ,
phone varchar2(30) NULL,
test_input_id number(12) NULL,
user_id number(12) NULL
);
ALTER TABLE tl_candidate ADD
CONSTRAINT PK_tl_candidate PRIMARY KEY
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_test_input_id
ON tl_candidate (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_test_input_id
ON oneit_sec_user_extension (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
-- @AutoRun
-- drop table tl_candidate;
-- drop table oneit_sec_user_extension;
CREATE TABLE tl_candidate (
CREATE TABLE oneit_sec_user_extension (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
first_name varchar(30) NULL,
test_input_id numeric(12) NULL
, object_type varchar(30) NOT NULL ,
phone varchar(30) NULL,
test_input_id numeric(12) NULL,
user_id numeric(12) NULL
);
ALTER TABLE tl_candidate ADD
CONSTRAINT pk_tl_candidate PRIMARY KEY
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT pk_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_test_input_id
ON tl_candidate (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_test_input_id
ON oneit_sec_user_extension (test_input_id);
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
......@@ -7,6 +7,7 @@ import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.jsp.TableTag;
import oneit.servlets.portability.FileDownloader;
......@@ -141,8 +142,14 @@ public class TestAnalysisFP extends ORMProcessFormProcessor
for (int i = 1; i < values.length ; i++)
{
Candidate candidate = Candidate.createCandidate(objTran);
candidate.setFirstName(values[i]);
//updated to use sec user ext
SecUser user = SecUser.createSecUser(objTran);
user.setFirstName(values[i]);
user.setUserName(values[i]);
user.setPassword(values[i]);
candidate.setUser(user);
testInput.addToCandidates(candidate);
}
first = false;
......
......@@ -26,9 +26,11 @@ import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import oneit.security.*;
public abstract class BaseCandidate extends BaseBusinessClass
public abstract class BaseCandidate extends SecUserExtension
{
// Reference instance for the object
public static final Candidate REFERENCE_Candidate = new Candidate ();
......@@ -38,7 +40,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
// Static constants corresponding to field names
public static final String FIELD_FirstName = "FirstName";
public static final String FIELD_Phone = "Phone";
public static final String SINGLEREFERENCE_TestInput = "TestInput";
public static final String BACKREF_TestInput = "";
public static final String MULTIPLEREFERENCE_TestAnalysises = "TestAnalysises";
......@@ -53,11 +55,11 @@ public abstract class BaseCandidate extends BaseBusinessClass
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<Candidate> HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _FirstName;
private String _Phone;
// Private attributes corresponding to single references
......@@ -74,7 +76,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
private static final Map ATTRIBUTES_METADATA_Candidate = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_FirstName_Validators;
private static final AttributeValidator[] FIELD_Phone_Validators;
// Arrays of behaviour decorators
......@@ -96,7 +98,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
setupAssocMetaData_Answers();
setupAssocMetaData_JobApplications();
setupAssocMetaData_TestInput();
FIELD_FirstName_Validators = (AttributeValidator[])setupAttribMetaData_FirstName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Candidate.initialiseReference ();
......@@ -169,20 +171,20 @@ public abstract class BaseCandidate extends BaseBusinessClass
// Meta Info setup
private static List setupAttribMetaData_FirstName(Map validatorMapping)
private static List setupAttribMetaData_Phone(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "first_name");
metaInfo.put ("dbcol", "phone");
metaInfo.put ("length", "30");
metaInfo.put ("name", "FirstName");
metaInfo.put ("name", "Phone");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.FirstName:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_FirstName, Collections.unmodifiableMap (metaInfo));
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.Phone:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_Phone, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "FirstName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.FirstName:", validators);
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "Phone", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.Phone:", validators);
return validators;
}
......@@ -214,7 +216,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
super._initialiseNewObjAttributes (transaction);
_FirstName = (String)(HELPER_FirstName.initialise (_FirstName));
_Phone = (String)(HELPER_Phone.initialise (_Phone));
}
......@@ -223,7 +225,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
super._initialiseAssociations ();
_TestInput = new SingleAssociation<Candidate, TestInput> (this, SINGLEREFERENCE_TestInput, TestInput.MULTIPLEREFERENCE_Candidates, TestInput.REFERENCE_TestInput, "tl_candidate");
_TestInput = new SingleAssociation<Candidate, TestInput> (this, SINGLEREFERENCE_TestInput, TestInput.MULTIPLEREFERENCE_Candidates, TestInput.REFERENCE_TestInput, "oneit_sec_user_extension");
_TestAnalysises = new MultipleAssociation<Candidate, TestAnalysis> (this, MULTIPLEREFERENCE_TestAnalysises, TestAnalysis.SINGLEREFERENCE_Candidate, TestAnalysis.REFERENCE_TestAnalysis);
_Answers = new MultipleAssociation<Candidate, Answer> (this, MULTIPLEREFERENCE_Answers, Answer.SINGLEREFERENCE_Candidate, Answer.REFERENCE_Answer);
_JobApplications = new MultipleAssociation<Candidate, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Candidate, JobApplication.REFERENCE_JobApplication);
......@@ -236,7 +238,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
super.initialiseReference ();
_TestInput = new SingleAssociation<Candidate, TestInput> (this, SINGLEREFERENCE_TestInput, TestInput.MULTIPLEREFERENCE_Candidates, TestInput.REFERENCE_TestInput, "tl_candidate");
_TestInput = new SingleAssociation<Candidate, TestInput> (this, SINGLEREFERENCE_TestInput, TestInput.MULTIPLEREFERENCE_Candidates, TestInput.REFERENCE_TestInput, "oneit_sec_user_extension");
_TestAnalysises = new MultipleAssociation<Candidate, TestAnalysis> (this, MULTIPLEREFERENCE_TestAnalysises, TestAnalysis.SINGLEREFERENCE_Candidate, TestAnalysis.REFERENCE_TestAnalysis);
_Answers = new MultipleAssociation<Candidate, Answer> (this, MULTIPLEREFERENCE_Answers, Answer.SINGLEREFERENCE_Candidate, Answer.REFERENCE_Answer);
_JobApplications = new MultipleAssociation<Candidate, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Candidate, JobApplication.REFERENCE_JobApplication);
......@@ -248,16 +250,16 @@ public abstract class BaseCandidate extends BaseBusinessClass
/**
* Get the attribute FirstName
* Get the attribute Phone
*/
public String getFirstName ()
public String getPhone ()
{
assertValid();
String valToReturn = _FirstName;
String valToReturn = _Phone;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getFirstName ((Candidate)this, valToReturn);
valToReturn = bhd.getPhone ((Candidate)this, valToReturn);
}
return valToReturn;
......@@ -269,7 +271,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
* 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 preFirstNameChange (String newFirstName) throws FieldException
protected void prePhoneChange (String newPhone) throws FieldException
{
}
......@@ -279,46 +281,46 @@ public abstract class BaseCandidate extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postFirstNameChange () throws FieldException
protected void postPhoneChange () throws FieldException
{
}
public FieldWriteability getWriteability_FirstName ()
public FieldWriteability getWriteability_Phone ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute FirstName. Checks to ensure a new value
* Set the attribute Phone. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setFirstName (String newFirstName) throws FieldException
public void setPhone (String newPhone) throws FieldException
{
boolean oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
boolean oldAndNewIdentical = HELPER_Phone.compare (_Phone, newPhone);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newFirstName = bhd.setFirstName ((Candidate)this, newFirstName);
oldAndNewIdentical = HELPER_FirstName.compare (_FirstName, newFirstName);
newPhone = bhd.setPhone ((Candidate)this, newPhone);
oldAndNewIdentical = HELPER_Phone.compare (_Phone, newPhone);
}
if (FIELD_FirstName_Validators.length > 0)
if (FIELD_Phone_Validators.length > 0)
{
Object newFirstNameObj = HELPER_FirstName.toObject (newFirstName);
Object newPhoneObj = HELPER_Phone.toObject (newPhone);
if (newFirstNameObj != null)
if (newPhoneObj != null)
{
int loopMax = FIELD_FirstName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_FirstName);
int loopMax = FIELD_Phone_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_Phone);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_FirstName_Validators[v].checkAttribute (this, FIELD_FirstName, metadata, newFirstNameObj);
FIELD_Phone_Validators[v].checkAttribute (this, FIELD_Phone, metadata, newPhoneObj);
}
}
}
......@@ -336,12 +338,12 @@ public abstract class BaseCandidate extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_FirstName () != FieldWriteability.FALSE, "Field FirstName is not writeable");
preFirstNameChange (newFirstName);
markFieldChange (FIELD_FirstName);
_FirstName = newFirstName;
postFieldChange (FIELD_FirstName);
postFirstNameChange ();
Debug.assertion (getWriteability_Phone () != FieldWriteability.FALSE, "Field Phone is not writeable");
prePhoneChange (newPhone);
markFieldChange (FIELD_Phone);
_Phone = newPhone;
postFieldChange (FIELD_Phone);
postPhoneChange ();
}
}
......@@ -1086,7 +1088,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
public String getBaseSetName ()
{
return "tl_candidate";
return "oneit_sec_user_extension";
}
......@@ -1107,10 +1109,10 @@ public abstract class BaseCandidate extends BaseBusinessClass
super.getPersistentSets (allSets);
PersistentSet tl_candidatePSet = allSets.getPersistentSet (myID, "tl_candidate", myPSetStatus);
PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (myID, "oneit_sec_user_extension", myPSetStatus);
tl_candidatePSet.setAttrib (FIELD_ObjectID, myID);
tl_candidatePSet.setAttrib (FIELD_FirstName, HELPER_FirstName.toObject (_FirstName)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_ObjectID, myID);
oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); //
_TestInput.getPersistentSets (allSets);
}
......@@ -1124,9 +1126,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_candidatePSet = allSets.getPersistentSet (objectID, "tl_candidate");
PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (objectID, "oneit_sec_user_extension");
_FirstName = (String)(HELPER_FirstName.fromObject (_FirstName, tl_candidatePSet.getAttrib (FIELD_FirstName))); //
_Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); //
_TestInput.setFromPersistentSets (objectID, allSets);
}
......@@ -1145,7 +1147,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
try
{
setFirstName (otherCandidate.getFirstName ());
setPhone (otherCandidate.getPhone ());
}
catch (FieldException ex)
{
......@@ -1167,7 +1169,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
BaseCandidate sourceCandidate = (BaseCandidate)(source);
_FirstName = sourceCandidate._FirstName;
_Phone = sourceCandidate._Phone;
}
}
......@@ -1224,7 +1226,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
super.readExternalData(vals);
_FirstName = (String)(HELPER_FirstName.readExternal (_FirstName, vals.get(FIELD_FirstName))); //
_Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); //
_TestInput.readExternalData(vals.get(SINGLEREFERENCE_TestInput));
_TestAnalysises.readExternalData(vals.get(MULTIPLEREFERENCE_TestAnalysises));
_Answers.readExternalData(vals.get(MULTIPLEREFERENCE_Answers));
......@@ -1240,7 +1242,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
super.writeExternalData(vals);
vals.put (FIELD_FirstName, HELPER_FirstName.writeExternal (_FirstName));
vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone));
vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData());
vals.put (MULTIPLEREFERENCE_TestAnalysises, _TestAnalysises.writeExternalData());
vals.put (MULTIPLEREFERENCE_Answers, _Answers.writeExternalData());
......@@ -1258,9 +1260,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
BaseCandidate otherCandidate = (BaseCandidate)(other);
if (!HELPER_FirstName.compare(this._FirstName, otherCandidate._FirstName))
if (!HELPER_Phone.compare(this._Phone, otherCandidate._Phone))
{
listener.notifyFieldChange(this, other, FIELD_FirstName, HELPER_FirstName.toObject(this._FirstName), HELPER_FirstName.toObject(otherCandidate._FirstName));
listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone));
}
// Compare single assocs
......@@ -1288,7 +1290,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_FirstName, HELPER_FirstName.toObject(getFirstName()));
visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone()));
visitor.visitAssociation (_TestInput);
visitor.visitAssociation (_TestAnalysises);
visitor.visitAssociation (_Answers);
......@@ -1342,9 +1344,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_FirstName))
else if (attribName.equals (FIELD_Phone))
{
return filter.matches (getFirstName ());
return filter.matches (getPhone ());
}
else if (attribName.equals (SINGLEREFERENCE_TestInput))
{
......@@ -1364,32 +1366,38 @@ public abstract class BaseCandidate extends BaseBusinessClass
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_candidate.object_id", FIELD_ObjectID);
filter.addFilter (context, "oneit_sec_user_extension.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_candidate.object_created_date", FIELD_ObjectCreated);
filter.addFilter (context, "oneit_sec_user_extension.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_candidate.object_last_updated_date", FIELD_ObjectLastModified);
filter.addFilter (context, "oneit_sec_user_extension.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andFirstName (QueryFilter<String> filter)
public SearchAll andPhone (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_candidate.first_name", "FirstName");
filter.addFilter (context, "oneit_sec_user_extension.phone", "Phone");
return this;
}
public SearchAll andTestInput (QueryFilter<TestInput> filter)
{
filter.addFilter (context, "tl_candidate.test_input_id", "TestInput");
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
return this;
}
public SearchAll andUser (QueryFilter<SecUser> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.user_id", "User");
return this;
}
......@@ -1428,9 +1436,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_FirstName))
else if (attribName.equals (FIELD_Phone))
{
return HELPER_FirstName.toObject (getFirstName ());
return HELPER_Phone.toObject (getPhone ());
}
else
{
......@@ -1445,9 +1453,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_FirstName))
else if (attribName.equals (FIELD_Phone))
{
return HELPER_FirstName;
return HELPER_Phone;
}
else
{
......@@ -1462,9 +1470,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_FirstName))
else if (attribName.equals (FIELD_Phone))
{
setFirstName ((String)(HELPER_FirstName.fromObject (_FirstName, attribValue)));
setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue)));
}
else
{
......@@ -1486,9 +1494,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_FirstName))
else if (fieldName.equals (FIELD_Phone))
{
return getWriteability_FirstName ();
return getWriteability_Phone ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_TestAnalysises))
{
......@@ -1516,9 +1524,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_FirstName () != FieldWriteability.TRUE)
if (getWriteability_Phone () != FieldWriteability.TRUE)
{
fields.add (FIELD_FirstName);
fields.add (FIELD_Phone);
}
......@@ -1530,7 +1538,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_FirstName.getAttribObject (getClass (), _FirstName, false, FIELD_FirstName));
result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone));
return result;
}
......@@ -1582,21 +1590,21 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
/**
* Get the attribute FirstName
* Get the attribute Phone
*/
public String getFirstName (Candidate obj, String original)
public String getPhone (Candidate obj, String original)
{
return original;
}
/**
* Change the value set for attribute FirstName.
* Change the value set for attribute Phone.
* May modify the field beforehand
* Occurs before validation.
*/
public String setFirstName (Candidate obj, String newFirstName) throws FieldException
public String setPhone (Candidate obj, String newPhone) throws FieldException
{
return newFirstName;
return newPhone;
}
}
......@@ -1631,7 +1639,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
}
public class CandidatePipeLineFactory<From extends BaseBusinessClass, Me extends Candidate> extends BaseBusinessClass.ORMPipeLine<From, Me>
public class CandidatePipeLineFactory<From extends BaseBusinessClass, Me extends Candidate> extends SecUserExtensionPipeLineFactory<From, Me>
{
public <Prev> CandidatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
......@@ -1663,9 +1671,9 @@ public abstract class BaseCandidate extends BaseBusinessClass
{
return toJobApplications ();
}
if (name.equals ("FirstName"))
if (name.equals ("Phone"))
{
return toFirstName ();
return toPhone ();
}
if (name.equals ("TestInput"))
{
......@@ -1677,7 +1685,7 @@ public abstract class BaseCandidate extends BaseBusinessClass
}
public PipeLine<From, String> toFirstName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_FirstName)); }
public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput () { return toTestInput (Filter.ALL); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput (Filter<TestInput> filter)
......
......@@ -49,6 +49,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String FIELD_IncludeAssessmentCriteria = "IncludeAssessmentCriteria";
public static final String FIELD_AssessmentType = "AssessmentType";
public static final String FIELD_JobLink = "JobLink";
public static final String FIELD_Email = "Email";
public static final String SINGLEREFERENCE_Level = "Level";
public static final String SINGLEREFERENCE_SecUser = "SecUser";
public static final String MULTIPLEREFERENCE_JobApplications = "JobApplications";
......@@ -70,6 +71,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final DefaultAttributeHelper<Job> HELPER_IncludeAssessmentCriteria = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Job, AssessmentType> HELPER_AssessmentType = new EnumeratedAttributeHelper<Job, AssessmentType> (AssessmentType.FACTORY_AssessmentType);
private static final DefaultAttributeHelper<Job> HELPER_JobLink = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_Email = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
......@@ -80,6 +82,7 @@ public abstract class BaseJob extends BaseBusinessClass
private Boolean _IncludeAssessmentCriteria;
private AssessmentType _AssessmentType;
private String _JobLink;
private String _Email;
// Private attributes corresponding to single references
......@@ -97,6 +100,7 @@ public abstract class BaseJob extends BaseBusinessClass
private static final Map ATTRIBUTES_METADATA_Job = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Email_Validators;
private static final AttributeValidator[] FIELD_JobTitle_Validators;
private static final AttributeValidator[] FIELD_JobDescription_Validators;
private static final AttributeValidator[] FIELD_JobStatus_Validators;
......@@ -125,6 +129,7 @@ public abstract class BaseJob extends BaseBusinessClass
setupAssocMetaData_CultureCriterias();
setupAssocMetaData_Level();
setupAssocMetaData_SecUser();
FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobDescription_Validators = (AttributeValidator[])setupAttribMetaData_JobDescription(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobStatus_Validators = (AttributeValidator[])setupAttribMetaData_JobStatus(validatorMapping).toArray (new AttributeValidator[0]);
......@@ -217,6 +222,24 @@ public abstract class BaseJob extends BaseBusinessClass
// Meta Info setup
private static List setupAttribMetaData_Email(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "Email");
metaInfo.put ("type", "String");
metaInfo.put ("validators", "Email");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.Email:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_Email, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Job.class, "Email", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.Email:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_JobTitle(Map validatorMapping)
{
Map metaInfo = new HashMap ();
......@@ -380,6 +403,7 @@ public abstract class BaseJob extends BaseBusinessClass
_IncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.initialise (_IncludeAssessmentCriteria));
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.initialise (_AssessmentType));
_JobLink = (String)(HELPER_JobLink.initialise (_JobLink));
_Email = (String)(HELPER_Email.initialise (_Email));
}
......@@ -1100,6 +1124,104 @@ public abstract class BaseJob extends BaseBusinessClass
}
}
/**
* Get the attribute Email
*/
public String getEmail ()
{
assertValid();
String valToReturn = _Email;
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
valToReturn = bhd.getEmail ((Job)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 preEmailChange (String newEmail) 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 postEmailChange () throws FieldException
{
}
public FieldWriteability getWriteability_Email ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Email. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmail (String newEmail) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
try
{
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
newEmail = bhd.setEmail ((Job)this, newEmail);
oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
}
if (FIELD_Email_Validators.length > 0)
{
Object newEmailObj = HELPER_Email.toObject (newEmail);
if (newEmailObj != null)
{
int loopMax = FIELD_Email_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_Email);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Email_Validators[v].checkAttribute (this, FIELD_Email, metadata, newEmailObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Email () != FieldWriteability.FALSE, "Field Email is not writeable");
preEmailChange (newEmail);
markFieldChange (FIELD_Email);
_Email = newEmail;
postFieldChange (FIELD_Email);
postEmailChange ();
}
}
/**
......@@ -2084,6 +2206,7 @@ public abstract class BaseJob extends BaseBusinessClass
_IncludeAssessmentCriteria = sourceJob._IncludeAssessmentCriteria;
_AssessmentType = sourceJob._AssessmentType;
_JobLink = sourceJob._JobLink;
_Email = sourceJob._Email;
}
}
......@@ -2148,6 +2271,7 @@ public abstract class BaseJob extends BaseBusinessClass
_IncludeAssessmentCriteria = (Boolean)(HELPER_IncludeAssessmentCriteria.readExternal (_IncludeAssessmentCriteria, vals.get(FIELD_IncludeAssessmentCriteria))); //
_AssessmentType = (AssessmentType)(HELPER_AssessmentType.readExternal (_AssessmentType, vals.get(FIELD_AssessmentType))); //
_JobLink = (String)(HELPER_JobLink.readExternal (_JobLink, vals.get(FIELD_JobLink))); //
_Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
_Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
_SecUser.readExternalData(vals.get(SINGLEREFERENCE_SecUser));
_JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications));
......@@ -2171,6 +2295,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (FIELD_IncludeAssessmentCriteria, HELPER_IncludeAssessmentCriteria.writeExternal (_IncludeAssessmentCriteria));
vals.put (FIELD_AssessmentType, HELPER_AssessmentType.writeExternal (_AssessmentType));
vals.put (FIELD_JobLink, HELPER_JobLink.writeExternal (_JobLink));
vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
vals.put (SINGLEREFERENCE_SecUser, _SecUser.writeExternalData());
vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData());
......@@ -2236,6 +2361,7 @@ public abstract class BaseJob extends BaseBusinessClass
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Email, HELPER_Email.toObject(getEmail()));
}
......@@ -2493,6 +2619,10 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_JobLink.toObject (getJobLink ());
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email.toObject (getEmail ());
}
else
{
return super.getAttribute (attribName);
......@@ -2534,6 +2664,10 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_JobLink;
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -2575,6 +2709,10 @@ public abstract class BaseJob extends BaseBusinessClass
{
setJobLink ((String)(HELPER_JobLink.fromObject (_JobLink, attribValue)));
}
else if (attribName.equals (FIELD_Email))
{
setEmail ((String)(HELPER_Email.fromObject (_Email, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -2643,6 +2781,10 @@ public abstract class BaseJob extends BaseBusinessClass
{
return getWriteability_SecUser ();
}
else if (fieldName.equals (FIELD_Email))
{
return getWriteability_Email ();
}
else
{
return super.getWriteable (fieldName);
......@@ -2688,6 +2830,11 @@ public abstract class BaseJob extends BaseBusinessClass
fields.add (FIELD_JobLink);
}
if (getWriteability_Email () != FieldWriteability.TRUE)
{
fields.add (FIELD_Email);
}
super.putUnwriteable (fields);
}
......@@ -2704,6 +2851,7 @@ public abstract class BaseJob extends BaseBusinessClass
result.add(HELPER_IncludeAssessmentCriteria.getAttribObject (getClass (), _IncludeAssessmentCriteria, false, FIELD_IncludeAssessmentCriteria));
result.add(HELPER_AssessmentType.getAttribObject (getClass (), _AssessmentType, false, FIELD_AssessmentType));
result.add(HELPER_JobLink.getAttribObject (getClass (), _JobLink, false, FIELD_JobLink));
result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));
return result;
}
......@@ -2880,6 +3028,24 @@ public abstract class BaseJob extends BaseBusinessClass
return newJobLink;
}
/**
* Get the attribute Email
*/
public String getEmail (Job obj, String original)
{
return original;
}
/**
* Change the value set for attribute Email.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmail (Job obj, String newEmail) throws FieldException
{
return newEmail;
}
}
......@@ -2944,6 +3110,10 @@ public abstract class BaseJob extends BaseBusinessClass
{
return toCultureCriterias ();
}
if (name.equals ("Email"))
{
return toEmail ();
}
if (name.equals ("JobTitle"))
{
return toJobTitle ();
......@@ -2986,6 +3156,8 @@ public abstract class BaseJob extends BaseBusinessClass
}
public PipeLine<From, String> toEmail () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Email)); }
public PipeLine<From, String> toJobTitle () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobTitle)); }
public PipeLine<From, String> toJobDescription () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobDescription)); }
......@@ -3035,6 +3207,11 @@ public abstract class BaseJob extends BaseBusinessClass
public boolean isTransientAttrib(String attribName)
{
if(CollectionUtils.equals(attribName, "Email"))
{
return true;
}
return super.isTransientAttrib(attribName);
}
......
......@@ -16,4 +16,9 @@ public class Candidate extends BaseCandidate
{
return "Candidate";
}
public String getFirstName()
{
return getUser().getFirstName();
}
}
\ No newline at end of file
......@@ -2,20 +2,23 @@
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="Candidate" package="performa.orm">
<BUSINESSCLASS name="Candidate" package="performa.orm" superclass="SecUserExtension">
<IMPORT value="oneit.security.*" />
<MULTIPLEREFERENCE name="TestAnalysises" type="TestAnalysis" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="Answers" type="Answer" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="JobApplications" type="JobApplication" backreferenceName="Candidate" />
<TABLE name="tl_candidate" tablePrefix="object" polymorphic="FALSE">
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="FirstName" type="String" dbcol="first_name" length="30"/>
<ATTRIB name="Phone" type="String" dbcol="phone" length="30"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" inSuper='TRUE' backreferenceName="Extensions" />
</TABLE>
<SEARCH type="All" paramFilter="tl_candidate.object_id is not null" orderBy="tl_candidate.object_id" />
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" orderBy="oneit_sec_user_extension.object_id" />
</BUSINESSCLASS>
......
......@@ -14,6 +14,7 @@ import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.security.*;
......@@ -21,27 +22,27 @@ import oneit.utils.threading.*;
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class CandidatePersistenceMgr extends ObjectPersistenceMgr
public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{
private static final LoggingArea CandidatePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Candidate");
// Private attributes corresponding to business object data
private String dummyFirstName;
private String dummyPhone;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_FirstName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
public CandidatePersistenceMgr ()
{
dummyFirstName = (String)(HELPER_FirstName.initialise (dummyFirstName));
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
}
private String SELECT_COLUMNS = "{PREFIX}tl_candidate.object_id as id, {PREFIX}tl_candidate.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_candidate.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_candidate.first_name, {PREFIX}tl_candidate.test_input_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.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
......@@ -86,14 +87,16 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
}
}
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(id, "tl_candidate", PersistentSetStatus.FETCHED);
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(id, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
String objectType = null;
// Check for persistent sets already prefetched
if (false || !tl_candidatePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_candidatePSet.containsAttrib(Candidate.FIELD_FirstName)||
!tl_candidatePSet.containsAttrib(Candidate.SINGLEREFERENCE_TestInput))
if (false ||
!oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_Phone)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_TestInput)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_User))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -102,13 +105,22 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
{
LogMgr.log (CandidatePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
Candidate result = new Candidate ();
/* Polymorphic */
objectType = (String)(oneit_sec_user_extensionPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (Candidate.REFERENCE_Candidate, objectType) != Candidate.REFERENCE_Candidate)
{
idsToFetch.add (id.longValue());
}
else
{
Candidate result = new Candidate ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
results.add (result);
}
}
}
......@@ -116,8 +128,8 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_candidate " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_candidate.object_id IN ?";
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "{PREFIX}oneit_sec_user_extension.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
......@@ -142,13 +154,23 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
else if (refName.equals (Candidate.SINGLEREFERENCE_TestInput))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_candidate " +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "test_input_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else if (refName.equals (Candidate.SINGLEREFERENCE_User))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "user_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
......@@ -164,47 +186,47 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(objectID, "tl_candidate");
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
if (tl_candidatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_candidatePSet.getStatus () != PersistentSetStatus.DEFERRED)
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_candidate " +
"SET first_name = ?, test_input_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"UPDATE {PREFIX}oneit_sec_user_extension " +
"SET phone = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_candidate.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_FirstName.getForSQL(dummyFirstName, tl_candidatePSet.getAttrib (Candidate.FIELD_FirstName))).listEntry (SQLManager.CheckNull((Long)(tl_candidatePSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
"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 (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)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_candidate WHERE object_id = ?",
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}oneit_sec_user_extension WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_candidate", objectID.longID (), obj.getObjectLastModified (), d },
new Object[] { "oneit_sec_user_extension", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (CandidatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_candidate");
throw new ConcurrentUpdateConflictException (obj, "oneit_sec_user_extension");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_candidate for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
String errorMsg = "Attempt to update nonexistent row in table:oneit_sec_user_extension for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (CandidatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_candidatePSet.setStatus (PersistentSetStatus.PROCESSED);
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
......@@ -219,42 +241,42 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(objectID, "tl_candidate");
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
LogMgr.log (CandidatePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_candidatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_candidatePSet.getStatus () != PersistentSetStatus.DEFERRED)
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_candidate " +
"WHERE tl_candidate.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_candidate WHERE object_id = ?",
"SELECT object_id FROM {PREFIX}oneit_sec_user_extension WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_candidate");
throw new ConcurrentUpdateConflictException (obj, "oneit_sec_user_extension");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_candidate for row:" + objectID;
String errorMsg = "Attempt to delete nonexistent row in table:oneit_sec_user_extension for row:" + objectID;
LogMgr.log (CandidatePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_candidatePSet.setStatus (PersistentSetStatus.PROCESSED);
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
......@@ -272,6 +294,8 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
{
LinkedHashMap<ObjectID, Candidate> results = new LinkedHashMap ();
MultiHashtable<String,ObjectID> needsRefetch = new MultiHashtable ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
......@@ -309,11 +333,22 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
}
else
{
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(objectID, "tl_candidate", PersistentSetStatus.FETCHED);
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
String objectType = (String)(oneit_sec_user_extensionPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (Candidate.REFERENCE_Candidate, objectType) != Candidate.REFERENCE_Candidate)
{
needsRefetch.add (objectType, objectID); // We will fetch these later
resultElement = new Candidate ();
resultElement.initialiseGhost (objectID);
}
else
{
resultElement = new Candidate ();
......@@ -321,12 +356,30 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
context.addRetrievedObject(resultElement);
}
}
results.put (objectID, resultElement);
}
for (String objectType : needsRefetch.keySet())
{
BaseBusinessClass referenceObject = context.getReferenceObject (Candidate.REFERENCE_Candidate, objectType);
ObjectPersistenceMgr persistenceMgr = context.getPersistenceMgr (referenceObject);
ResourceCheckpoint checkpoint = sqlMgr.getCheckpoint();
Set<BaseBusinessClass> objsRefetched = persistenceMgr.fetchByIDs(new HashSet (needsRefetch.getValuesForKey (objectType)), allPSets, context, sqlMgr);
checkpoint.releaseNewResources();
for (BaseBusinessClass objRefetched : objsRefetched)
{
results.put (objRefetched.getID (), (Candidate)objRefetched);
}
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
......@@ -368,7 +421,7 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_candidate " + tables +
"FROM {PREFIX}oneit_sec_user_extension " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
......@@ -384,12 +437,12 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
String orderBy = " ORDER BY tl_candidate.object_id";
String orderBy = " ORDER BY oneit_sec_user_extension.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_candidate.object_id is not null
String preFilter = "(tl_candidate.object_id is not null)"
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
+ " ";
......@@ -404,7 +457,7 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_candidate " + tables + tableSetToSQL(joinTableSet) +
"FROM {PREFIX}oneit_sec_user_extension " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
......@@ -416,7 +469,27 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
BaseBusinessClass[] resultsArray = super.find(searchType, allPSets, criteria, context, sqlMgr);
Vector results = new Vector ();
for (int x = 0 ; x < resultsArray.length ; ++x)
{
if (resultsArray[x] instanceof Candidate)
{
results.add (resultsArray[x]);
}
else
{
// Ignore
}
}
resultsArray = new BaseBusinessClass[results.size ()];
results.copyInto (resultsArray);
return resultsArray;
}
......@@ -424,17 +497,18 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(objectID, "tl_candidate", PersistentSetStatus.FETCHED);
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
// Object Modified
tl_candidatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_candidatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE"));
tl_candidatePSet.setAttrib(Candidate.FIELD_FirstName, HELPER_FirstName.getFromRS(dummyFirstName, r, "first_name"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
tl_candidatePSet.setAttrib(Candidate.SINGLEREFERENCE_TestInput, r.getObject ("test_input_id"));
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"));
}
......@@ -442,21 +516,21 @@ public class CandidatePersistenceMgr extends ObjectPersistenceMgr
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_candidatePSet = allPSets.getPersistentSet(objectID, "tl_candidate");
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
if (tl_candidatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_candidatePSet.getStatus () != PersistentSetStatus.DEFERRED)
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_candidate " +
" (first_name, test_input_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (phone, 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_FirstName.getForSQL(dummyFirstName, tl_candidatePSet.getAttrib (Candidate.FIELD_FirstName))) .listEntry (SQLManager.CheckNull((Long)(tl_candidatePSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))) .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());
tl_candidatePSet.setStatus (PersistentSetStatus.PROCESSED);
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
......
......@@ -9,7 +9,9 @@
<MULTIPLEREFERENCE name="JobApplications" type="JobApplication" backreferenceName="Job" />
<MULTIPLEREFERENCE name="AssessmentCriterias" type="AssessmentCriteria" backreferenceName="Job" />
<MULTIPLEREFERENCE name="CultureCriterias" type="CultureCriteria" backreferenceName="Job" />
<TRANSIENT name="Email" type="String" validators="Email" />
<TABLE name="tl_job" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="500"/>
......
......@@ -23,7 +23,13 @@
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/>
<RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/>
<RenderMode name="ApplicationOutline" preIncludeJSP="extensions/applicantportal/application_outline.jsp"/>
<RenderMode name="SelectionCriteria" preIncludeJSP="extensions/applicantportal/selection_criteria.jsp"/>
<RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/applicantportal/workplace_culture.jsp"/>
<RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/applicantportal/job_Match_assessment.jsp"/>
<RenderMode name="SubmitApplication" preIncludeJSP="extensions/applicantportal/submit_application.jsp"/>
</NODE>
......
......@@ -8,11 +8,11 @@
ObjectTransaction objTran = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
Job job = (Job) process.getAttribute("Job");
SecUser loggedInUser = SecUser.getTXUser(objTran);
SecUser user = (SecUser) process.getAttribute("SecUser");
%>
<div class="main-application-outline">
<div class="welcome-aust-logo"><img src="images/australia-post.png" /></div>
<div class="welcome-title">Welcome <oneit:toString value="<%= loggedInUser!=null ? loggedInUser.getName() : "" %>"/>, here's your application outline</div>
<div class="welcome-title">Welcome <oneit:toString value="<%= user!=null ? user.getName() : "" %>"/>, here's your application outline</div>
<div class="appli-aust-title"><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></div>
<p class="appli-content">
<oneit:toString value="<%= job.getJobDescription() %>" mode="ParagraphHTML" nullValue="-"/>
......@@ -55,7 +55,7 @@
</p>
</div>
</div>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data" action="<%= nextPage%>">
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="app-out-btn">
<span>Total time to complete: Approximately 40 minutes</span>
<oneit:button value="Begin the application" name="gotoPage" skin="link" cssClass="box-btn"
......
......@@ -6,7 +6,7 @@
<oneit:dynIncluded>
<%
ObjectTransaction objTran = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
String nextPage = WebUtils.getSamePageInRenderMode(request, "ApplicationOutline");
String nextPage = WebUtils.getSamePageInRenderMode(request, "SignIn");
Job job = (Job) process.getAttribute("Job");
String jobID = request.getParameter("jobID");
......@@ -53,7 +53,7 @@
<oneit:toString value="<%= job.getJobDescription() %>" mode="ParagraphHTML" nullValue="-"/>
</p>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data" action="<%= nextPage%>">
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="apply-job-btn">
<oneit:button value="Apply Now" name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
......
<%@ 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="../../inc/std_imports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
Job job = (Job) process.getAttribute("Job");
SecUser loggedInUser = SecUser.getTXUser(objTran);
%>
<script>
$(document.body).addClass('bg-color');
</script>
<div class="main-application-outline">
<div class="selection-aust-logo">
<img src="images/australia-post.png" />
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
</div>
<div class="show-mobile-title">
<div class="mobile-title-page">Section 1 - Selection Criteria</div>
<div class="mobile-estimated">Estimated time to complete: <b>5 mins</b></div>
</div>
<div class="section-title m-hide">Section 1</div>
<div class="section-c-title m-hide">
Selection Criteria
<span>Estimated time to complete: <b>5 mins</b></span>
</div>
<div class="section-tab-view">
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="active"><a href="#"><span>1</span><div class="mobile-hide">Selection Criteria</div></a></li>
<li><a href="#"><span>2</span><div class="mobile-hide">Workplace Culture</div></a></li>
<li><a href="#"><span>3</span><div class="mobile-hide">Job Match Assessment</div></a></li>
<li><a href="#"><span>4</span><div class="mobile-hide">Submit Application</div></a></li>
</ul>
</div>
<div class="section-page-area">
<div class="main-sc-section">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper at magna a
tristique. Ut ut magna ut mauris sagittis placerat. Suspendisse vitae tempus sem. Lorem
ipsum dolor sit amet, consectetur adipiscing elit.
</p>
</div>
<div class="selection-br-line"></div>
<div class="main-sc-section">
<div class="selection-form-title">Qualifications</div>
<div class="form-group-new question-y-n">
<label class="second-label">Do you have a degree in Masters of Business (Leadership)?</label>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio30" id="radio5" value="option1" checked="">
<label for="radio5">
Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio30" id="radio6" value="option1" checked="">
<label for="radio6">
No
</label>
</div>
</div>
<div class="textarea-box">
<textarea class="form-control second-style" placeholder="Please add any notes to support your answer"></textarea>
</div>
<div class="section-br-inside"></div>
<div class="form-group-new question-y-n">
<label class="second-label">Do you have a degree in Masters of Business (Leadership)?</label>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio29" id="radio7" value="option1" checked="">
<label for="radio7">
Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio29" id="radio8" value="option1" checked="">
<label for="radio8">
No
</label>
</div>
</div>
<div class="section-br-inside"></div>
<div class="form-group-new question-y-n">
<label class="second-label">Do you have a degree in Masters of Business (Leadership)?</label>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio28" id="radio9" value="option1" checked="">
<label for="radio9">
Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio28" id="radio10" value="option1" checked="">
<label for="radio10">
No
</label>
</div>
</div>
</div>
<div class="selection-br-line"></div>
<div class="main-sc-section">
<div class="selection-form-title">Skills</div>
<div class="form-group-new question-y-n">
<label class="second-label">Do you have the necessary skills to pay the bills?</label>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio27" id="radio11" value="option1" checked="">
<label for="radio11">
Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio27" id="radio12" value="option1" checked="">
<label for="radio12">
No
</label>
</div>
</div>
<div class="section-br-inside"></div>
<div class="form-group-new question-y-n">
<label class="second-label">Do you have the necessary skills to pay the bills?</label>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio26" id="radio13" value="option1" checked="">
<label for="radio13">
Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="radio26" id="radio14" value="option1" checked="">
<label for="radio14">
No
</label>
</div>
</div>
</div>
<div class="selection-br-line"></div>
<div class="main-sc-section btn-remove-padd">
<div class="section-btn text-center">
<input type="button" class="box-btn-gray" value="Save and exit" />
<input type="button" class="box-btn" value="Proceed to step 2" />
</div>
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
\ No newline at end of file
<%@ 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="../../inc/std_imports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
String nextPage = WebUtils.getSamePageInRenderMode(request, "VerifyIdentity");
Job job = (Job) process.getAttribute("Job");
%>
<script>
$(document.body).addClass('bg-color');
</script>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="main-verify-identity">
<div class="verify-aust-logo"><img src="images/australia-post.png"></div>
<div class="pl-verify">Please verify your identity before applying to:</div>
<div class="verify-i-title"><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></div>
<div class="main-box-layout verify-i-setpone">
<div class="box-label">Sign in using your social network of choice</div>
<ul class="social-login">
<li><a href="#"><img src="images/login-linkedin-icon.png"></a></li>
<li><a href="#"><img src="images/login-facebok-icon.png"></a></li>
<li><a href="#"><img src="images/login-google.png"></a></li>
</ul>
<div class="box-br-line"><span></span></div>
<div class="box-label">Or sign in via email</div>
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="Email" cssClass="form-control second-style" />
</div>
<div class="form-group">
<oneit:button value="Verify and proceed" name="gotoPage" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"/>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<%@ 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="../../inc/std_imports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
String nextPage = WebUtils.getSamePageInRenderMode(request, "ApplicationOutline");
Job job = (Job) process.getAttribute("Job");
SecUser secUser = SecUser.searchNAME(objTran, job.getEmail());
if(secUser==null)
{
secUser = SecUser.createSecUser(objTran);
secUser.setUserName(job.getEmail());
secUser.setPassword("abc123");
}
Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
%>
<script>
$(document.body).addClass('bg-color');
</script>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="main-verify-identity">
<div class="verify-aust-logo"><img src="images/australia-post.png"></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">
<label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="UserName" cssClass="form-control second-style" />
</div>
<div class="row">
<div class="form-group text-left col-sm-6 col-xs-12">
<label>First Name</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="FirstName" cssClass="form-control second-style" />
</div>
<div class="form-group text-left col-sm-6 col-xs-12">
<label>Last Name</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="LastName" cssClass="form-control second-style" />
</div>
</div>
<div class="form-group text-left">
<label>Phone</label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="Phone" cssClass="form-control second-style" />
</div>
<div class="text-center">
<oneit:button value="Verify and proceed" name="save" cssClass="box-btn margin-top-18"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"/>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
......@@ -16,6 +16,7 @@
<NODE name="StorageMappings::Performa">
<MAP code="TestInput" class="performa.orm.TestInput"/>
<MAP code="JobApplication" class="performa.orm.JobApplication"/>
<MAP code="Candidate" class="performa.orm.Candidate"/>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">oneit_sec_user_extension</tableName>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="test_input_id" type="Long" length="11" nullable="true"/>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_test_input_id" isUnique="false"><column name="test_input_id"/></NODE>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment