Commit e6798bf0 by chenith Committed by Harsh Shah

Applicant job view and Login details seperated with new article.

parent 2f8d8c4b
package performa.form;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.NavigationFP;
import oneit.security.AuthorisationToken;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.ORMProcessFormProcessor;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.ProcessRedirectResult;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*;
import performa.orm.Candidate;
import performa.orm.Job;
public class SignInCandidateFP extends NavigationFP
public class SignInCandidateFP extends ORMProcessFormProcessor
{
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
......@@ -25,6 +34,33 @@ public class SignInCandidateFP extends NavigationFP
true,
request);
return super.validate(submission, exceptions);
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
String nextPage = (String) request.getAttribute("nextPage");
Tuple.T2<Candidate, Boolean> tuple = job.getUserOrCreate();
Candidate candidate = tuple.get0();
SecUser secUser = candidate.getUser();
// request.getSession().invalidate();
request.getSession().setAttribute (AuthorisationToken.AUTH_TOKEN_ID, secUser);
// place the user on the session
request.getSession ().setAttribute (SecUser.SEC_USER_ID, secUser);
// This is only to help with the tomcat manager, so you can see which user belongs to which session
request.getSession ().setAttribute (SecUser.SEC_USER_ID+".desc", secUser.getDescription());
request.getSession ().setAttribute (SecUser.SEC_USER_ID+".loggedin", ""+new Date());
request.getSession ().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
process.setAttribute("Candidate", candidate);
return new ProcessRedirectResult(nextPage, new String[]{});
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ public class Utils
public static final String ROLE_APPLICANT = "TL_Applicant";
public static final String ROLE_CLIENT = "TL_Client";
public static final String PRIV_ACCESS_ADMIN_PORTAL = "TL_AccessAdminPortal";
public static final String PRIV_ACCESS_APPLICANT_PORTAL = "TL_AccessApplicantPortal";
public static final String LEVEL_GENERAL_PURPOSE = "General Workforce";
public static final String LEVEL_SALES = "Sales Personnel";
public static final String LEVEL_MANAGEMENT = "Management";
......@@ -36,6 +37,11 @@ public class Utils
return (secUser != null && secUser.hasPrivilege(PRIV_ACCESS_ADMIN_PORTAL));
}
public static boolean checkApplicantPortalAccess(SecUser secUser)
{
return (secUser != null && secUser.hasPrivilege(PRIV_ACCESS_APPLICANT_PORTAL));
}
public static Importance[] getImportancesForAssessment()
{
List<Importance> importances = new ArrayList<>();
......
......@@ -23,6 +23,8 @@ public class WebUtils
public static final String WORKPLACE_CULTURE = "WorkplaceCulture";
public static final String JOB_MATCH = "JobMatchAssessment";
public static final String JOB_REVIEW = "JobReview";
public static final String APPLY_JOB = "ApplyJob";
public static final String JOB_APPLICATION = "JobApplication";
public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode)
{
......
<%! protected String getName (ServletConfig config) { return "dynamic_content_form_applicant"; } %>
<%@ include file="dynamic_content_core.jsp" %>
......@@ -3,7 +3,24 @@
<NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant">
<FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/>
</NODE>
<NODE name="dynamic_content_form_applicant" factory="Participant">
<INHERITS factory="Named" nodename="dynamic_content_form"/>
<DECORATOR id="auth" factory="MetaComponent" component="ApplicantPortalAuthDecorator" priv="TL_AccessApplicantPortal"/>
<FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"/>
</NODE>
<NODE name="ApplicantPortalAuthDecorator" factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator">
<AUTHENTICATOR factory="Participant" class="oneit.security.SecurityAuthenticator">
<PRIVILEGE factory="Parameter" param="priv"/>
<FAILED_URL factory="String" value="RestrictedAccess.jsp"/>
<NO_USER_URL factory="String" value="ApplicantPortal-ApplyJob.htm"/>
</AUTHENTICATOR>
</NODE>
</OBJECTS>
......@@ -24,7 +24,18 @@
<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"/>
</NODE>
</MAP>
<MAP value="JOB_APLICATION" description="Job Application" TemplatePage="dynamic_content_form_applicant.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" 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"/>
......
......@@ -6,7 +6,7 @@
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getSamePageInRenderMode(request, "VerifyIdentity");
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "Page");
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null, "Job is null in applicant portal");
......
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="JobApplication">
<createSpecificIdentifier factory='String' value='CD91Q0CDW34QWPXZBG3OPJ1XMZVQRL'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="CD91Q0CDW34QWPXZBG3OPJ1XMZVQRL"/>
</articleIdentifiers>
<createdLabel factory="String" value="CD91Q0CDW34QWPXZBG3OPJ1XMZVQRL"/>
<newParentCategory factory="String" value="created:N6SFUFOG4A2H5U7ER9T8YDQI56H2TG"/>
<articleAttributeChanges factory="Map">
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Shortcuts" factory="String" value="JobApplication"/>
<NODE name="Menu Title" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-06-29 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-06-29 14:00:00"/>
<NODE name="Title" factory="String" value="JobApplication"/>
<NODE name="ShortTitle" factory="String" value="JobApplication"/>
<NODE name="SortOrder" factory="Integer" value="-36837574"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="JOB_APLICATION"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -10,20 +10,8 @@
Candidate candidate = (Candidate) process.getAttribute("Candidate");
Debug.assertion(job != null, "Job is null in applicant portal");
Debug.assertion(candidate != null, "Candidate is null in applicant portal");
if(candidate == null)
{
Tuple.T2<Candidate, Boolean> tuple = job.getUserOrCreate();
candidate = tuple.get0();
process.setAttribute("Candidate", candidate);
if(tuple.get1())
{
%><%@include file="/saferedirect.jsp" %><%
}
}
SecUser secUser = candidate.getUser();
%>
<script>
......
<?xml version="1.0"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">oneit_sec_privilege</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="TL_AccessApplicantPortal"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>TL_AccessApplicantPortal</value>
<value name='description' factory='String'>Can access applicant portal</value>
<value name='category' factory='String'>Talentology</value>
<value name='grant_priv_name' factory='Null'/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation" query="select object_id roleid from oneit_sec_role where name='TL_Applicant'">
<tableName factory="String">oneit_sec_role_priv_link</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="roleid"/>
<value name='priv_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="TL_AccessApplicantPortal"/>
</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