Commit 4b6cb83d by chenith Committed by Harsh Shah

Introduced JobApplication complete.

parent 7d3ff3c2
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="answer_number" type="Long" nullable="true"/> <column name="answer_number" type="Long" nullable="true"/>
<column name="section_number" type="Long" length="11" nullable="true"/> <column name="section_number" type="Long" length="11" nullable="true"/>
<column name="job_application_id" type="Long" length="11" nullable="true"/> <column name="job_application_id" type="Long" length="11" nullable="false"/>
<column name="quest_number" type="Long" length="11" nullable="true"/> <column name="quest_number" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <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_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="cv" type="BLOB" nullable="false"/> <column name="cv" type="BLOB" nullable="true"/>
<column name="application_status" type="String" nullable="true" length="200"/> <column name="application_status" type="String" nullable="true" length="200"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/> <column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/> <column name="job_id" type="Long" length="11" nullable="false"/>
......
...@@ -10,7 +10,7 @@ CREATE TABLE tl_answer ( ...@@ -10,7 +10,7 @@ CREATE TABLE tl_answer (
, ,
answer_number numeric(12) NULL, answer_number numeric(12) NULL,
section_number numeric(12) NULL, section_number numeric(12) NULL,
job_application_id numeric(12) NULL, job_application_id numeric(12) NOT NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
); );
......
...@@ -8,7 +8,7 @@ CREATE TABLE tl_job_application ( ...@@ -8,7 +8,7 @@ CREATE TABLE tl_job_application (
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
cv image NOT NULL, cv image NULL,
application_status varchar(200) NULL, application_status varchar(200) NULL,
candidate_id numeric(12) NOT NULL, candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL job_id numeric(12) NOT NULL
......
...@@ -11,7 +11,7 @@ CREATE TABLE tl_answer ( ...@@ -11,7 +11,7 @@ CREATE TABLE tl_answer (
, ,
answer_number number(12) NULL, answer_number number(12) NULL,
section_number number(12) NULL, section_number number(12) NULL,
job_application_id number(12) NULL, job_application_id number(12) NOT NULL,
quest_number number(12) NULL quest_number number(12) NULL
); );
......
...@@ -9,7 +9,7 @@ CREATE TABLE tl_job_application ( ...@@ -9,7 +9,7 @@ CREATE TABLE tl_job_application (
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
cv blob NOT NULL, cv blob NULL,
application_status varchar2(200) NULL, application_status varchar2(200) NULL,
candidate_id number(12) NOT NULL, candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL job_id number(12) NOT NULL
......
...@@ -11,7 +11,7 @@ CREATE TABLE tl_answer ( ...@@ -11,7 +11,7 @@ CREATE TABLE tl_answer (
, ,
answer_number numeric(12) NULL, answer_number numeric(12) NULL,
section_number numeric(12) NULL, section_number numeric(12) NULL,
job_application_id numeric(12) NULL, job_application_id numeric(12) NOT NULL,
quest_number numeric(12) NULL quest_number numeric(12) NULL
); );
......
...@@ -9,7 +9,7 @@ CREATE TABLE tl_job_application ( ...@@ -9,7 +9,7 @@ CREATE TABLE tl_job_application (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
cv bytea NOT NULL, cv bytea NULL,
application_status varchar(200) NULL, application_status varchar(200) NULL,
candidate_id numeric(12) NOT NULL, candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL job_id numeric(12) NOT NULL
......
package performa.form;
import java.util.Map;
import oneit.logging.*;
import oneit.objstore.StorageException;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.utils.*;
import performa.orm.*;
import performa.orm.types.ApplicationStatus;
public class CompleteApplicationFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
jobApplication.setApplicationStatus(ApplicationStatus.SUBMITTED);
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING2, "Job Application Completed", jobApplication);
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<ATTRIB name="AnswerNo" type="Integer" dbcol="answer_number"/> <ATTRIB name="AnswerNo" type="Integer" dbcol="answer_number"/>
<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" /> <SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="ProfileAssessmentAnswers"/> <SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="ProfileAssessmentAnswers" mandatory="true"/>
<SINGLEREFERENCE name="Question" type="Question" dbcol="quest_number" /> <SINGLEREFERENCE name="Question" type="Question" dbcol="quest_number" />
</TABLE> </TABLE>
......
...@@ -123,6 +123,7 @@ public abstract class BaseAnswer extends BaseBusinessClass ...@@ -123,6 +123,7 @@ public abstract class BaseAnswer extends BaseBusinessClass
metaInfo.put ("backreferenceName", "ProfileAssessmentAnswers"); metaInfo.put ("backreferenceName", "ProfileAssessmentAnswers");
metaInfo.put ("dbcol", "job_application_id"); metaInfo.put ("dbcol", "job_application_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobApplication"); metaInfo.put ("name", "JobApplication");
metaInfo.put ("type", "JobApplication"); metaInfo.put ("type", "JobApplication");
...@@ -653,6 +654,7 @@ public abstract class BaseAnswer extends BaseBusinessClass ...@@ -653,6 +654,7 @@ public abstract class BaseAnswer extends BaseBusinessClass
*/ */
public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException
{ {
BusinessObjectParser.assertFieldCondition (newJobApplication != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
if (_JobApplication.wouldReferencedChange (newJobApplication)) if (_JobApplication.wouldReferencedChange (newJobApplication))
...@@ -1053,6 +1055,8 @@ public abstract class BaseAnswer extends BaseBusinessClass ...@@ -1053,6 +1055,8 @@ public abstract class BaseAnswer extends BaseBusinessClass
super.validate (context); super.validate (context);
context.check (getJobApplicationID() != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
} }
......
...@@ -207,7 +207,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -207,7 +207,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE"); metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
metaInfo.put ("binaryHandler", "loggedin"); metaInfo.put ("binaryHandler", "loggedin");
metaInfo.put ("dbcol", "cv"); metaInfo.put ("dbcol", "cv");
metaInfo.put ("mandatory", "true"); metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "CV"); metaInfo.put ("name", "CV");
metaInfo.put ("type", "BinaryContent"); metaInfo.put ("type", "BinaryContent");
...@@ -361,7 +361,6 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -361,7 +361,6 @@ public abstract class BaseJobApplication extends BaseBusinessClass
oldAndNewIdentical = HELPER_CV.compare (_CV, newCV); oldAndNewIdentical = HELPER_CV.compare (_CV, newCV);
} }
BusinessObjectParser.assertFieldCondition (newCV != null, this, FIELD_CV, "mandatory");
if (FIELD_CV_Validators.length > 0) if (FIELD_CV_Validators.length > 0)
...@@ -1994,7 +1993,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -1994,7 +1993,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
List result = super.getAttributes (); List result = super.getAttributes ();
result.add(HELPER_CV.getAttribObject (getClass (), _CV, true, FIELD_CV)); result.add(HELPER_CV.getAttribObject (getClass (), _CV, false, FIELD_CV));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, false, FIELD_ApplicationStatus)); result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, false, FIELD_ApplicationStatus));
return result; return result;
......
...@@ -29,7 +29,7 @@ public class JobApplication extends BaseJobApplication ...@@ -29,7 +29,7 @@ public class JobApplication extends BaseJobApplication
jobApplication.setJob(job); jobApplication.setJob(job);
jobApplication.initACAnswers(); jobApplication.initACAnswers();
jobApplication.initCCAnswers(); // jobApplication.initCCAnswers();
return jobApplication; return jobApplication;
} }
...@@ -45,14 +45,17 @@ public class JobApplication extends BaseJobApplication ...@@ -45,14 +45,17 @@ public class JobApplication extends BaseJobApplication
} }
} }
private void initCCAnswers() public void initCCAnswers()
{ {
for(CultureCriteria cultureCriteria : getJob().getCultureCriteriasSet()) if(this.getCultureCriteriaAnswersCount()==0)
{ {
CultureCriteriaAnswer answer = CultureCriteriaAnswer.createCultureCriteriaAnswer(getTransaction()); for(CultureCriteria cultureCriteria : getJob().getCultureCriteriasSet())
{
CultureCriteriaAnswer answer = CultureCriteriaAnswer.createCultureCriteriaAnswer(getTransaction());
addToCultureCriteriaAnswers(answer); addToCultureCriteriaAnswers(answer);
cultureCriteria.addToAnswers(answer); cultureCriteria.addToAnswers(answer);
}
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<TABLE name="tl_job_application" tablePrefix="object" polymorphic="FALSE"> <TABLE name="tl_job_application" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="CV" type="BinaryContent" dbcol="cv" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" mandatory="true"/> <ATTRIB name="CV" type="BinaryContent" dbcol="cv" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" mandatory="false"/>
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" attribHelper="EnumeratedAttributeHelper" defaultValue="ApplicationStatus.DRAFT"/> <ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" attribHelper="EnumeratedAttributeHelper" defaultValue="ApplicationStatus.DRAFT"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/> <SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<OBJECTS name="AdminPortal"> <OBJECTS name="AdminPortal">
<NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant"> <NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant">
<FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/> <FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/>
<FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"/> <FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"/>
<FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/>
</NODE> </NODE>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<%@ include file="/extensions/performa/inc/stdimports.jsp" %> <%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded> <oneit:dynIncluded>
<div class="main-application-outline">
<% <%
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria"); String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
...@@ -18,8 +19,17 @@ ...@@ -18,8 +19,17 @@
process.setAttribute("JobApplication", jobApplication); process.setAttribute("JobApplication", jobApplication);
if(jobApplication.getApplicationStatus()==ApplicationStatus.SUBMITTED)
{
%>
<div class="welcome-aust-logo">
<p class="overview-title" align="center">You have already applied to this job.</p>
</div>
<%
}
else
{
%> %>
<div class="main-application-outline">
<div class="welcome-aust-logo"><img src="images/australia-post.png" /></div> <div class="welcome-aust-logo"><img src="images/australia-post.png" /></div>
<div class="welcome-title">Welcome <oneit:toString value="<%= candidate.getFirstName() %>"/>, here's your application outline</div> <div class="welcome-title">Welcome <oneit:toString value="<%= candidate.getFirstName() %>"/>, here's your application outline</div>
<div class="appli-aust-title"><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></div> <div class="appli-aust-title"><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></div>
...@@ -73,5 +83,8 @@ ...@@ -73,5 +83,8 @@
.toMap() %>"/> .toMap() %>"/>
</div> </div>
</oneit:form> </oneit:form>
</div> <%
}
%>
</div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
...@@ -130,21 +130,21 @@ ...@@ -130,21 +130,21 @@
.toMap() %>"/> .toMap() %>"/>
<% <%
} }
else
{
%>
<oneit:button value="Complete" name="completeApplication" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry("restartProcess", Boolean.TRUE)
.toMap() %>"/>
<%
}
%> %>
</span> </span>
</div> </div>
<div class="auto-save"> <div class="auto-save">
<%
if((questionNumber)==totNoOfQuestions)
{
%>
<oneit:button value="Complete" name="gotoPage" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"/>
<%
}
%>
<%-- <div>Autosaved 1 min ago.</div> --%> <%-- <div>Autosaved 1 min ago.</div> --%>
</div> </div>
</div> </div>
......
...@@ -3,3 +3,5 @@ Job.Email = Email Address ...@@ -3,3 +3,5 @@ Job.Email = Email Address
SecUser.FirstName = First Name SecUser.FirstName = First Name
SecUser.LastName = Last Name SecUser.LastName = Last Name
CultureCriteriaAnswer.SelectedQuestion = Question
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
String nextPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture"); String nextPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication"); JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
Job job = jobApplication.getJob(); Job job = jobApplication.getJob();
String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page");
exitPage = exitPage + "&id=" + job.getID() + "&key=" + job.getRandomKey();
%> %>
<script> <script>
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
...@@ -98,7 +99,10 @@ ...@@ -98,7 +99,10 @@
<div class="selection-br-line"></div> <div class="selection-br-line"></div>
<div class="main-sc-section btn-remove-padd"> <div class="main-sc-section btn-remove-padd">
<div class="section-btn text-center"> <div class="section-btn text-center">
<input type="button" class="box-btn-gray" value="Save and exit" /> <oneit:button value="Save and exit" name="save" cssClass="box-btn-gray"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", exitPage)
.mapEntry ("procParams", Collections.singletonMap("id", "XXXXXXXXXXX"))
.toMap() %>"/>
<oneit:button value="Proceed to step 2" name="gotoPage" cssClass="box-btn" <oneit:button value="Proceed to step 2" name="gotoPage" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
......
...@@ -18,14 +18,18 @@ ...@@ -18,14 +18,18 @@
<div class="main-application-outline"> <div class="main-application-outline">
<div class="selection-aust-logo"> <div class="selection-aust-logo">
<img src="images/australia-post.png" /> <img src="images/australia-post.png" />
<span>Australia Post Chief Executive Officer</span> <span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
</div> </div>
<div class="mobile-successfull-show display-none">Application Successfully Submitted</div> <div class="mobile-successfull-show display-none">Application Successfully Submitted</div>
<div class="section-page-area complete-back"> <div class="section-page-area complete-back">
<div class="job-post-complete"> <div class="job-post-complete">
<div class="big-right-sy"><span><img src="images/big-right-symbol.png" /></span></div> <div class="big-right-sy"><span><img src="images/big-right-symbol.png" /></span></div>
<div class="app-complete-title m-hide">Application Successfully Submitted</div> <div class="app-complete-title m-hide">Application Successfully Submitted</div>
<div class="app-complete-text">Your application for Australia Post Chief Executive Officer has been submitted for review. If you are successful, you will be contacted directly with your provided details.</div> <div class="app-complete-text">
Your application for
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
has been submitted for review. If you are successful, you will be contacted directly with your provided details.
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
String nextPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment"); String nextPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment");
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication"); JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
Job job = jobApplication.getJob(); Job job = jobApplication.getJob();
String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page");
exitPage = exitPage + "&id=" + job.getID() + "&key=" + job.getRandomKey();
jobApplication.initCCAnswers();
%> %>
<script> <script>
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
...@@ -93,7 +97,10 @@ ...@@ -93,7 +97,10 @@
<div class="selection-br-line"></div> <div class="selection-br-line"></div>
<div class="main-sc-section btn-remove-padd"> <div class="main-sc-section btn-remove-padd">
<div class="section-btn text-center"> <div class="section-btn text-center">
<input type="button" class="box-btn-gray" value="Save and exit" /> <oneit:button value="Save and exit" name="save" cssClass="box-btn-gray"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", exitPage)
.mapEntry ("procParams", Collections.singletonMap("id", "XXXXXXXXXXX"))
.toMap() %>"/>
<oneit:button value="Proceed to step 3" name="gotoPage" cssClass="box-btn" <oneit:button value="Proceed to step 3" name="gotoPage" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
......
-- @AutoRun
ALTER TABLE tl_answer ALTER COLUMN section_number DROP NOT NULL;
\ No newline at end of file
-- @AutoRun
ALTER TABLE tl_job_application ALTER COLUMN cv DROP NOT NULL;
\ 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