Commit 8175e87c by nilu

removing usage of application status

parent 44928130
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.servlets.forms.RedisplayResult;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import performa.orm.JobApplication;
public class ChangeApplicationStatusFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In ChangeApplicationStatusFP changing status of Job Application : ", jobApplication );
if(jobApplication.getWorkFlow() == null)
{
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In ChangeApplicationStatusFP , no workflow set : ", jobApplication.getWorkFlow() );
return RedisplayResult.getInstance();
}
jobApplication.setApplicationStatus(jobApplication.getWorkFlow().getApplicationStatus());
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In ChangeApplicationStatusFP Job Application Status successfully changed : ", jobApplication );
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
...@@ -676,14 +676,7 @@ public class Job extends BaseJob ...@@ -676,14 +676,7 @@ public class Job extends BaseJob
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder)); Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder));
return pipelineJob().toWorkFlows(filter).val(); return pipelineJob().toWorkFlows(filter).val();
} }
public WorkFlow getWorkFlowByStatus(ApplicationStatus appStatus)
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andApplicationStatus(new EqualsFilter<>(appStatus));
return pipelineJob().toWorkFlows(filter).val();
}
public WorkFlowStage getWorkFlowByStageType(StageType stageType) public WorkFlowStage getWorkFlowByStageType(StageType stageType)
{ {
......
...@@ -547,14 +547,6 @@ public class JobApplication extends BaseJobApplication ...@@ -547,14 +547,6 @@ public class JobApplication extends BaseJobApplication
} }
public String getApplicantStatusStr()
{
WorkFlow workflow = getJob().getWorkFlowByStatus(getApplicationStatus());
return workflow != null ? workflow.getName() : "";
}
public List<ApplicationStatus> getAvailableStatuses() public List<ApplicationStatus> getAvailableStatuses()
{ {
List<ApplicationStatus> statuses = new ArrayList<>(); List<ApplicationStatus> statuses = new ArrayList<>();
......
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
<TRANSIENT name="CultureFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/> <TRANSIENT name="CultureFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<TRANSIENT name="FactorScoreDetails" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/> <TRANSIENT name="FactorScoreDetails" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<TRANSIENT name="Note" type="String" /> <TRANSIENT name="Note" type="String" />
<TRANSIENTSINGLE name="WorkFlow" type="WorkFlow" />
<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="false"/> <ATTRIB name="CV" type="BinaryContent" dbcol="cv" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" mandatory="false"/>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<FORM name="*.loadJobFromTemplate" factory="Participant" class="performa.form.LoadJobFromTemplateFP"/> <FORM name="*.loadJobFromTemplate" factory="Participant" class="performa.form.LoadJobFromTemplateFP"/>
<FORM name="*.loadRequirementsFromTemplate" factory="Participant" class="performa.form.LoadRequirementsFromTemplateFP"/> <FORM name="*.loadRequirementsFromTemplate" factory="Participant" class="performa.form.LoadRequirementsFromTemplateFP"/>
<FORM name="*.loadCultureFromTemplate" factory="Participant" class="performa.form.LoadCultureFromTemplateFP"/> <FORM name="*.loadCultureFromTemplate" factory="Participant" class="performa.form.LoadCultureFromTemplateFP"/>
<FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/>
<FORM name="*.addNote" factory="Participant" class="performa.form.AddNoteFP"/> <FORM name="*.addNote" factory="Participant" class="performa.form.AddNoteFP"/>
<FORM name="*.extendJob" factory="Participant" class="performa.form.ExtendJobFP"/> <FORM name="*.extendJob" factory="Participant" class="performa.form.ExtendJobFP"/>
<FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/> <FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<div class="appli-list-name appli-l"> <div class="appli-list-name appli-l">
<oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" /> <oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" />
<div class="appli-status"> <div class="appli-status">
<oneit:toString value="<%= jobApplication.getApplicantStatusStr() %>" mode="EscapeHTML" /> <oneit:toString value="<%= jobApplication.getWorkFlowStage() %>" mode="EscapeHTML" />
</div> </div>
</div> </div>
<div class="appli-overall appli-l"> <div class="appli-overall appli-l">
......
...@@ -65,10 +65,7 @@ ...@@ -65,10 +65,7 @@
String appID = "app-id-" + jobApplication.getID().toString(); String appID = "app-id-" + jobApplication.getID().toString();
Integer overallRank = jobApplication.getOverallRank(); Integer overallRank = jobApplication.getOverallRank();
Boolean isTopRank = CollectionUtils.equals(overallRank, 1); Boolean isTopRank = CollectionUtils.equals(overallRank, 1);
WorkFlow workflow = job.getWorkFlowByStatus(jobApplication.getApplicationStatus());
boolean missingReq = jobApplication.hasFailedEssentialRequirements(); boolean missingReq = jobApplication.hasFailedEssentialRequirements();
jobApplication.setWorkFlow(workflow);
%> %>
<div class="appli-row" id="<%= jobApplication.getID() %>"> <div class="appli-row" id="<%= jobApplication.getID() %>">
<div class="appli-checkbox appli-l eq-second-height"> <div class="appli-checkbox appli-l eq-second-height">
...@@ -225,19 +222,18 @@ ...@@ -225,19 +222,18 @@
{ {
%> %>
<div class="appli-list-drop"> <div class="appli-list-drop">
<tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlow" cssClass="form-control app-process" <tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlowStage" cssClass="form-control app-process"
options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/> options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/>
</div> </div>
<% <%
} }
%> %>
</div> </div>
<oneit:button name="changeApplicationStatus" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>" <oneit:button name="save" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("StageType", stageType).mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("StageType", stageType).mapEntry("Job", job).toMap())
.mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "StageType"}))) .mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "StageType"})))
.mapEntry("JobApplication", jobApplication)
.toMap() %>" /> .toMap() %>" />
</div> </div>
<% <%
......
...@@ -45,10 +45,7 @@ ...@@ -45,10 +45,7 @@
Boolean isTopRank = CollectionUtils.equals(overallRank, 1); Boolean isTopRank = CollectionUtils.equals(overallRank, 1);
Boolean isVisible = CollectionUtils.equals(overallRank, 2) || isTopRank; Boolean isVisible = CollectionUtils.equals(overallRank, 2) || isTopRank;
Boolean onTrial = hiringTeam.isTrue(hiringTeam.getOnTrial()); Boolean onTrial = hiringTeam.isTrue(hiringTeam.getOnTrial());
WorkFlow workflow = job.getWorkFlowByStatus(jobApplication.getApplicationStatus());
boolean missingReq = jobApplication.hasFailedEssentialRequirements(); boolean missingReq = jobApplication.hasFailedEssentialRequirements();
jobApplication.setWorkFlow(workflow);
%> %>
<div class="appli-row" id="<%= jobApplication.getID() %>"> <div class="appli-row" id="<%= jobApplication.getID() %>">
...@@ -147,12 +144,11 @@ ...@@ -147,12 +144,11 @@
options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/> options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/>
</div> </div>
</div> </div>
<oneit:button name="changeApplicationStatus" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>" <oneit:button name="save" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("StageType", stageType).mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("StageType", stageType).mapEntry("Job", job).toMap())
.mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "StageType"}))) .mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "StageType"})))
.mapEntry("JobApplication", jobApplication)
.toMap() %>" /> .toMap() %>" />
</div> </div>
<% <%
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION); String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
boolean missingReq = jobApplication.hasFailedEssentialRequirements(); boolean missingReq = jobApplication.hasFailedEssentialRequirements();
boolean hasAllReq = jobApplication.hasAllEssentialRequirements(); boolean hasAllReq = jobApplication.hasAllEssentialRequirements();
WorkFlow workflow = job.getWorkFlowByStatus(jobApplication.getApplicationStatus());
List<WorkFlowStage> sortedWorkFlows = ObjstoreUtils.sort(jobApplication.getWorkFlowStage().getStageType() == StageType.INCOMPLETE || List<WorkFlowStage> sortedWorkFlows = ObjstoreUtils.sort(jobApplication.getWorkFlowStage().getStageType() == StageType.INCOMPLETE ||
jobApplication.getWorkFlowStage().getStageType() == StageType.POST_INGEST ? job.getIncompleteApplicantStages() : job.getApplicantStages(), jobApplication.getWorkFlowStage().getStageType() == StageType.POST_INGEST ? job.getIncompleteApplicantStages() : job.getApplicantStages(),
new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()}, new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
...@@ -28,8 +27,6 @@ ...@@ -28,8 +27,6 @@
boolean onTrial = hiringTeam.isTrue(hiringTeam.getOnTrial()); boolean onTrial = hiringTeam.isTrue(hiringTeam.getOnTrial());
boolean isVisible = CollectionUtils.equals(overallRank, 2) || CollectionUtils.equals(overallRank, 1); boolean isVisible = CollectionUtils.equals(overallRank, 2) || CollectionUtils.equals(overallRank, 1);
jobApplication.setWorkFlow(workflow);
Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit(); Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
%> %>
<script> <script>
...@@ -90,7 +87,7 @@ ...@@ -90,7 +87,7 @@
tabToggle("#tab1", ".role-fit"); tabToggle("#tab1", ".role-fit");
$("[name$='WorkFlow']").change(function() $("[name$='WorkFlowStage']").change(function()
{ {
$('.save-application').click(); $('.save-application').click();
}); });
...@@ -151,14 +148,13 @@ ...@@ -151,14 +148,13 @@
%> %>
<span class="appli-status-short"> <span class="appli-status-short">
<tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlow" cssClass="form-control app-process" <tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlowStage" cssClass="form-control app-process"
options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/> options="<%= sortedWorkFlows.toArray(new WorkFlowStage[0]) %>"/>
<oneit:button name="changeApplicationStatus" value=" " cssClass="save-application hidden" <oneit:button name="save" value=" " cssClass="save-application hidden"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).mapEntry("Job", job).toMap())
.mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "JobApplication", "Applications"}))) .mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "JobApplication", "Applications"})))
.mapEntry("JobApplication", jobApplication)
.toMap() %>" /> .toMap() %>" />
</span> </span>
</div> </div>
......
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