Commit 07b20465 by Harsh Shah

Finish Hotfix-20190716

parents aea7a944 9b104e03
...@@ -109,15 +109,13 @@ public class JobApplication extends BaseJobApplication ...@@ -109,15 +109,13 @@ public class JobApplication extends BaseJobApplication
if(getCV() != null) if(getCV() != null)
{ {
String contentType = getCV().getContentType(); String contentType = getCV().getContentType();
context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text") context.check(contentType!= null && Utils.isValidContentType(contentType.toLowerCase()), this, FIELD_CV, "invalid");
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CV, "invalid");
} }
if(getCoverLetter() != null) if(getCoverLetter() != null)
{ {
String contentType = getCoverLetter().getContentType(); String contentType = getCoverLetter().getContentType();
context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text") context.check(contentType!= null && Utils.isValidContentType(contentType.toLowerCase()) , this, FIELD_CoverLetter, "invalid");
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CoverLetter, "invalid");
} }
} }
catch(RuntimeException ex) catch(RuntimeException ex)
......
...@@ -20,6 +20,8 @@ public class JobType extends AbstractEnumerated ...@@ -20,6 +20,8 @@ public class JobType extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_JobType = new JobTypeFactory(); 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 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); public static final JobType PART_TIME = new JobType ("PART_TIME", "PART_TIME", "Part Time", false);
...@@ -27,7 +29,7 @@ public class JobType extends AbstractEnumerated ...@@ -27,7 +29,7 @@ public class JobType extends AbstractEnumerated
public static final JobType CONTRACT = new JobType ("CONTRACT", "CONTRACT", "Contract", false); public static final JobType CONTRACT = new JobType ("CONTRACT", "CONTRACT", "Contract", false);
private static final JobType[] allJobTypes = private static final JobType[] allJobTypes =
new JobType[] { FULL_TIME,PART_TIME,CONTRACT}; new JobType[] { CASUAL,FULL_TIME,PART_TIME,CONTRACT};
private static JobType[] getAllJobTypes () private static JobType[] getAllJobTypes ()
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<ROOT> <ROOT>
<CONSTANT package="performa.orm.types" name="JobType"> <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="FULL_TIME" value="FULL_TIME" description="Full Time"/>
<VALUE name="PART_TIME" value="PART_TIME" description="Part Time"/> <VALUE name="PART_TIME" value="PART_TIME" description="Part Time"/>
<VALUE name="CONTRACT" value="CONTRACT" description="Contract"/> <VALUE name="CONTRACT" value="CONTRACT" description="Contract"/>
......
...@@ -388,14 +388,24 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant ...@@ -388,14 +388,24 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
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);
}
} }
if(contents.size() > 1) if(contents.size() > 1)
{ {
FileBinaryContent coverLetter = contents.get(0);
if(coverLetter.getContentType() != null && Utils.isValidContentType(coverLetter.getContentType().toLowerCase()))
{
jobApplication.setCoverLetter(contents.get(1)); jobApplication.setCoverLetter(contents.get(1));
} }
} }
}
private void handleIndeedEmail(ObjectTransaction objTran, Job job) throws StorageException, FieldException private void handleIndeedEmail(ObjectTransaction objTran, Job job) throws StorageException, FieldException
{ {
...@@ -438,9 +448,14 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant ...@@ -438,9 +448,14 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST); jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
jobApplication.setIsEmailIngest(true); 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); Document document = Jsoup.parse(messageBody);
......
...@@ -716,4 +716,10 @@ public class Utils ...@@ -716,4 +716,10 @@ public class Utils
{ {
return request.getSession ().getAttribute (oneit.security.jsp.AssumeUserFP.UNASSUME_SEC_USER_ID) != null; 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,10 +123,6 @@ ...@@ -123,10 +123,6 @@
.toMap() %>"> .toMap() %>">
EDIT JOB EDIT JOB
</oneit:button> </oneit:button>
<%
if(applicantPage)
{
%>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link" <oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView) requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView)
.mapEntry("ApplicantPage", applicantPage) .mapEntry("ApplicantPage", applicantPage)
...@@ -137,6 +133,10 @@ ...@@ -137,6 +133,10 @@
EXPORT APPLICANT REPORT EXPORT APPLICANT REPORT
</oneit:button> </oneit:button>
<%
if(applicantPage)
{
%>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link" <oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView) requestAttribs="<%= CollectionUtils.mapEntry("AppView", appView)
.mapEntry("ApplicantPage", applicantPage) .mapEntry("ApplicantPage", applicantPage)
......
...@@ -740,7 +740,7 @@ ...@@ -740,7 +740,7 @@
{ {
%> %>
<div class="no-preview">No preview available</div> <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 <img src="images/icon-download-large.png" />Download
</a> </a>
<% <%
...@@ -759,7 +759,7 @@ ...@@ -759,7 +759,7 @@
{ {
%> %>
<div class="no-preview">No preview available</div> <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 <img src="images/icon-download-large.png" />Download
</a> </a>
<% <%
......
...@@ -135,10 +135,12 @@ ...@@ -135,10 +135,12 @@
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
</div> </div>
<div class="main-box-layout verify-i-setpone"> <div class="main-box-layout verify-i-setpone">
<%--
<div class="box-label">Sign in using your social network of choice</div> <div class="box-label">Sign in using your social network of choice</div>
<oneit:form name="socialLogin" method="post"> <oneit:form name="socialLogin" method="post">
<ul class="social-login"> <ul class="social-login">
<li> <li>
<oneit:button value=" " name="linkedinOAuthLogin" skin="link" cssClass="social_login_btn" <oneit:button value=" " name="linkedinOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.linkedInAvailable() ? "false" : "true" %>" disabled="<%= Utils.linkedInAvailable() ? "false" : "true" %>"
...@@ -153,7 +155,7 @@ ...@@ -153,7 +155,7 @@
<img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" /> <img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" />
</oneit:button> </oneit:button>
</li> </li>
<%--
<li> <li>
<oneit:button value=" " name="googleOAuthLogin" skin="link" cssClass="social_login_btn" <oneit:button value=" " name="googleOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.googleAvailable() ? "false" : "true" %>" disabled="<%= Utils.googleAvailable() ? "false" : "true" %>"
...@@ -161,17 +163,17 @@ ...@@ -161,17 +163,17 @@
<img src="<%= request.getContextPath() %>/images/login-google.png" /> <img src="<%= request.getContextPath() %>/images/login-google.png" />
</oneit:button> </oneit:button>
</li> </li>
--%>
</ul> </ul>
</oneit:form> </oneit:form>
<div class="box-br-line"><span></span></div> <div class="box-br-line"><span></span></div>
--%>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data"> <oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <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"> <div class="form-group text-left" id="email-div">
<label>Email Address</label> <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