Commit 4f4c0d47 by nilu

Merged 'develop'.

# Conflicts:
#	cmsWebApp/src/performa/orm/Job.java
parents 6881ffbc 54fc188a
......@@ -9,7 +9,7 @@
<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="template_name" type="String" nullable="true" length="100"/>
<column name="job_title" type="String" nullable="false" length="30"/>
<column name="job_title" type="String" nullable="false" length="60"/>
<column name="job_description" type="CLOB" nullable="false"/>
<column name="ref_number" type="String" nullable="true" length="10"/>
<column name="google_address_text" type="String" nullable="false" length="300"/>
......
......@@ -9,7 +9,7 @@ CREATE TABLE tl_assessment_template (
object_created_date datetime DEFAULT getdate() NOT NULL
,
template_name varchar(100) NULL,
job_title varchar(30) NOT NULL,
job_title varchar(60) NOT NULL,
job_description text NOT NULL,
ref_number varchar(10) NULL,
google_address_text varchar(300) NOT NULL,
......
......@@ -10,7 +10,7 @@ CREATE TABLE tl_assessment_template (
object_created_date date DEFAULT SYSDATE NOT NULL
,
template_name varchar2(100) NULL,
job_title varchar2(30) NOT NULL,
job_title varchar2(60) NOT NULL,
job_description clob NOT NULL,
ref_number varchar2(10) NULL,
google_address_text varchar2(300) NOT NULL,
......
......@@ -10,7 +10,7 @@ CREATE TABLE tl_assessment_template (
object_created_date timestamp DEFAULT NOW() NOT NULL
,
template_name varchar(100) NULL,
job_title varchar(30) NOT NULL,
job_title varchar(60) NOT NULL,
job_description text NOT NULL,
ref_number varchar(10) NULL,
google_address_text varchar(300) NOT NULL,
......
......@@ -15,7 +15,7 @@
<TABLE name="tl_assessment_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="TemplateName" type="String" dbcol="template_name" length="100" uniqueGroup="TemplateID"/>
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="30" mandatory="true"/>
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="60" mandatory="true"/>
<ATTRIB name="JobDescription" type="String" dbcol="job_description" mandatory="true"/>
<ATTRIB name="ReferenceNumber" type="String" dbcol="ref_number" length="10"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" mandatory="true" length="300" />
......
......@@ -378,7 +378,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title");
metaInfo.put ("length", "30");
metaInfo.put ("length", "60");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobTitle");
metaInfo.put ("type", "String");
......
......@@ -6,6 +6,7 @@ import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LoggingArea;
import oneit.objstore.MessageSource;
......@@ -113,22 +114,40 @@ public class Candidate extends BaseCandidate
public boolean cultureCompleted(Job job)
{
int allAnswersCount = getCultureCriteriaAnswersCount();
if(job.showCultureCriteriaSection() && allAnswersCount == job.getCultureCriteriasCount())
if(!job.showCultureCriteriaSection())
{
Filter filter = CultureCriteriaAnswer.SearchByAll().andSelectedQuestion(new IsNotNullFilter<>());
Collection selectedAnswers = pipelineCandidate().toCultureCriteriaAnswers(filter).vals();
return (selectedAnswers.size() == allAnswersCount);
return false;
}
return false;
Set<CultureCriteriaAnswer> selectedAnswers = pipelineCandidate().toCultureCriteriaAnswers(CultureCriteriaAnswer.SearchByAll().andSelectedQuestion(new IsNotNullFilter<>())).uniqueVals();
Set<CultureElement> answeredElements = CultureCriteriaAnswer.pipesCultureCriteriaAnswer(selectedAnswers).toCultureElement().uniqueVals();
Set<CultureElement> applicableElements = CultureCriteria.pipesCultureCriteria(job.getApplicableCultureSet()).toCultureElement().uniqueVals();
return answeredElements.containsAll(applicableElements);
}
public double cultureCompletedPercentage(Job job)
{
return job.showCultureCriteriaSection() ? (getCultureCriteriaAnswersCount() * 100) / job.getCultureCriteriasCount() : 0d;
return job.showCultureCriteriaSection() ? (getApplicableCultureAnswerCount(job) * 100) / job.getApplicableCultureCount(): 0d;
}
public int getApplicableCultureAnswerCount(Job job)
{
int applicableAnswerCount = 0;
for(CultureCriteria cultureCriteria : job.getApplicableCultureSet())
{
for(CultureCriteriaAnswer answer : getCultureCriteriaAnswersSet())
{
if(CollectionUtils.equals(answer.getCultureElement(), cultureCriteria.getCultureElement()))
{
applicableAnswerCount+= 1;
break;
}
}
}
return applicableAnswerCount;
}
public double roleFitCompletedPercentage(Job job)
......
package performa.orm;
import java.util.SortedSet;
import oneit.utils.CollectionUtils;
......@@ -20,16 +19,13 @@ public class CultureCriteriaAnswer extends BaseCultureCriteriaAnswer
{
CultureCriteria criteria = null;
if(job!=null)
if(job != null)
{
SortedSet<CultureCriteria> cultureCriteriasSet = job.getCultureCriteriasSet();
for(CultureCriteria cc: cultureCriteriasSet)
for(CultureCriteria cc: job.getApplicableCultureSet())
{
if(CollectionUtils.equals(cc.getCultureElement(), getCultureElement()))
{
criteria = cc;
break;
}
}
......
......@@ -827,4 +827,18 @@ public class Job extends BaseJob
return null;
}
public int getApplicableCultureCount()
{
Filter<CultureCriteria> filter = CultureCriteria.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE));
return pipelineJob().toCultureCriterias(filter).uniqueVals().size();
}
public Set<CultureCriteria> getApplicableCultureSet()
{
Filter<CultureCriteria> filter = CultureCriteria.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE));
return pipelineJob().toCultureCriterias(filter).uniqueVals();
}
}
\ No newline at end of file
......@@ -109,15 +109,13 @@ public class JobApplication extends BaseJobApplication
if(getCV() != null)
{
String contentType = getCV().getContentType();
context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text")
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CV, "invalid");
context.check(contentType!= null && Utils.isValidContentType(contentType.toLowerCase()), this, FIELD_CV, "invalid");
}
if(getCoverLetter() != null)
{
String contentType = getCoverLetter().getContentType();
context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text")
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CoverLetter, "invalid");
context.check(contentType!= null && Utils.isValidContentType(contentType.toLowerCase()) , this, FIELD_CoverLetter, "invalid");
}
}
catch(RuntimeException ex)
......@@ -174,7 +172,7 @@ public class JobApplication extends BaseJobApplication
return safeRedirect;
}
for(CultureCriteria cultureCriteria : getJob().getCultureCriteriasSet())
for(CultureCriteria cultureCriteria : getJob().getApplicableCultureSet())
{
boolean available = false;
......
......@@ -20,6 +20,8 @@ public class JobType extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_JobType = new JobTypeFactory();
public static final JobType CASUAL = new JobType ("CASUAL", "CASUAL", "Casual", false);
public static final JobType FULL_TIME = new JobType ("FULL_TIME", "FULL_TIME", "Full Time", false);
public static final JobType PART_TIME = new JobType ("PART_TIME", "PART_TIME", "Part Time", false);
......@@ -27,7 +29,7 @@ public class JobType extends AbstractEnumerated
public static final JobType CONTRACT = new JobType ("CONTRACT", "CONTRACT", "Contract", false);
private static final JobType[] allJobTypes =
new JobType[] { FULL_TIME,PART_TIME,CONTRACT};
new JobType[] { CASUAL,FULL_TIME,PART_TIME,CONTRACT};
private static JobType[] getAllJobTypes ()
......
......@@ -3,6 +3,7 @@
<ROOT>
<CONSTANT package="performa.orm.types" name="JobType">
<VALUE name="CASUAL" value="CASUAL" description="Casual"/>
<VALUE name="FULL_TIME" value="FULL_TIME" description="Full Time"/>
<VALUE name="PART_TIME" value="PART_TIME" description="Part Time"/>
<VALUE name="CONTRACT" value="CONTRACT" description="Contract"/>
......
......@@ -388,12 +388,22 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
if(contents.size() > 0)
{
jobApplication.setCV(contents.get(0));
FileBinaryContent cv = contents.get(0);
if(cv.getContentType() != null && Utils.isValidContentType(cv.getContentType().toLowerCase()))
{
jobApplication.setCV(cv);
}
}
if(contents.size() > 1)
{
jobApplication.setCoverLetter(contents.get(1));
FileBinaryContent coverLetter = contents.get(0);
if(coverLetter.getContentType() != null && Utils.isValidContentType(coverLetter.getContentType().toLowerCase()))
{
jobApplication.setCoverLetter(contents.get(1));
}
}
}
......@@ -438,9 +448,14 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0)
if(contents.size() > 0 )
{
jobApplication.setCV(contents.get(0));
FileBinaryContent cv = contents.get(0);
if(cv.getContentType() != null && Utils.isValidContentType(cv.getContentType().toLowerCase()))
{
jobApplication.setCV(cv);
}
}
Document document = Jsoup.parse(messageBody);
......
......@@ -716,4 +716,10 @@ public class Utils
{
return request.getSession ().getAttribute (oneit.security.jsp.AssumeUserFP.UNASSUME_SEC_USER_ID) != null;
}
public static boolean isValidContentType(String contentType)
{
return contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text")
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") || contentType.contains("text/plain");
}
}
\ No newline at end of file
......@@ -123,6 +123,16 @@
.toMap() %>">
EDIT JOB
</oneit:button>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView)
.mapEntry("ApplicantPage", applicantPage)
.mapEntry("Applications", applications)
.mapEntry("Detailed", false)
.mapEntry("WorkFlow", workFlow)
.toMap() %>">
EXPORT APPLICANT REPORT
</oneit:button>
<%
if(applicantPage)
{
......@@ -131,16 +141,6 @@
requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView)
.mapEntry("ApplicantPage", applicantPage)
.mapEntry("Applications", applications)
.mapEntry("Detailed", false)
.mapEntry("WorkFlow", workFlow)
.toMap() %>">
EXPORT APPLICANT REPORT
</oneit:button>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView)
.mapEntry("ApplicantPage", applicantPage)
.mapEntry("Applications", applications)
.mapEntry("Detailed", true)
.toMap() %>">
EXPORT DETAILED APPLICANT REPORT
......
......@@ -740,7 +740,7 @@
{
%>
<div class="no-preview">No preview available</div>
<a class="btn download-btn" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'>
<a class="btn download-btn" target="_blank" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'>
<img src="images/icon-download-large.png" />Download
</a>
<%
......@@ -759,7 +759,7 @@
{
%>
<div class="no-preview">No preview available</div>
<a class="btn download-btn" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
<a class="btn download-btn" target="_blank" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
<img src="images/icon-download-large.png" />Download
</a>
<%
......
ALTER TABLE tl_assessment_template ALTER COLUMN job_title TYPE character varying(60);
\ No newline at end of file
......@@ -135,10 +135,12 @@
<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>
<oneit:form name="socialLogin" method="post">
<ul class="social-login">
<li>
<oneit:button value=" " name="linkedinOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.linkedInAvailable() ? "false" : "true" %>"
......@@ -153,7 +155,7 @@
<img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" />
</oneit:button>
</li>
<%--
<li>
<oneit:button value=" " name="googleOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.googleAvailable() ? "false" : "true" %>"
......@@ -161,17 +163,17 @@
<img src="<%= request.getContextPath() %>/images/login-google.png" />
</oneit:button>
</li>
--%>
</ul>
</oneit:form>
<div class="box-br-line"><span></span></div>
--%>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="box-label">Or sign in via email</div>
<%--<div class="box-label">Or sign in via email</div>--%>
<div class="form-group text-left" id="email-div">
<label>Email Address</label>
......
......@@ -46,6 +46,6 @@ cd.deploy.dir=${dir.root}/Deploy/PerformaInvestments/CD_image
key.file=${config.deploy.dir}/production.keyfile.properties
rsync.user=1itupdate
rsync.server=54.153.249.224
rsync.server=app.matchd.com
tctransform.version=55
rsync.port=40022
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