Commit 54fc188a by Harsh Shah

Finish Hotfix-20190716

parents 04a5e4c1 9b104e03
......@@ -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)
......
......@@ -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>
<%
......
......@@ -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>
......
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