Commit 509ebddb by nilu

Finish Feature-Diversity

parents ba473fef 883d6caf
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_answer_option</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="is_selected" type="Boolean" nullable="true"/>
<column name="candidate_answer_id" type="Long" length="11" nullable="false"/>
<column name="answer_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_answer_option" indexName="idx_tl_answer_option_candidate_answer_id" isUnique="false"><column name="candidate_answer_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_candidate_diversity_answer</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_id" type="Long" length="11" nullable="false"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_candidate_diversity_answer" indexName="idx_tl_candidate_diversity_answer_candidate_id" isUnique="false"><column name="candidate_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_diversity_answer</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="answer_code" type="CLOB" nullable="false"/>
<column name="answer" type="CLOB" nullable="false"/>
<column name="question_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_diversity_answer" indexName="idx_tl_diversity_answer_question_id" isUnique="false"><column name="question_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_diversity_question</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_code" type="CLOB" nullable="false"/>
<column name="question_text" type="CLOB" nullable="false"/>
<column name="australia_only" type="Boolean" nullable="true"/>
<column name="multiple_answers" type="Boolean" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_ht_diversity_question</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_text" type="CLOB" nullable="false"/>
<column name="is_applicable" type="Boolean" nullable="true"/>
<column name="question_id" type="Long" length="11" nullable="false"/>
<column name="hiring_team_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_ht_diversity_question" indexName="idx_tl_ht_diversity_question_hiring_team_id" isUnique="false"><column name="hiring_team_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<column name="post_code" type="String" nullable="true" length="10"/> <column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/> <column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/> <column name="has_client_support" type="Boolean" nullable="true"/>
<column name="has_diversity" type="Boolean" nullable="true"/>
<column name="manage_own_billing" type="Boolean" nullable="true"/> <column name="manage_own_billing" type="Boolean" nullable="true"/>
<column name="stripe_reference" type="String" nullable="true" length="100"/> <column name="stripe_reference" type="String" nullable="true" length="100"/>
<column name="stripe_subscription" type="String" nullable="true" length="100"/> <column name="stripe_subscription" type="String" nullable="true" length="100"/>
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<column name="culture_statement" type="String" nullable="true" length="2000"/> <column name="culture_statement" type="String" nullable="true" length="2000"/>
<column name="draft_location" type="String" nullable="true" length="200"/> <column name="draft_location" type="String" nullable="true" length="200"/>
<column name="google_address_text" type="String" nullable="false" length="300"/> <column name="google_address_text" type="String" nullable="false" length="300"/>
<column name="diversity_included" type="Boolean" nullable="true"/>
<column name="level_id" type="Long" length="11" nullable="true"/> <column name="level_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/> <column name="client_id" type="Long" length="11" nullable="true"/>
<column name="job_owner_id" type="Long" length="11" nullable="true"/> <column name="job_owner_id" type="Long" length="11" nullable="true"/>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <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="object_created_date" type="Date" nullable="false" length="22"/>
<column name="xxxx" type="CLOB" nullable="true"/> <column name="xxxx" type="CLOB" nullable="true"/>
<column name="xxxx" type="String" nullable="true" length="200"/>
<column name="xxxx" type="Long" length="11" nullable="true"/> <column name="xxxx" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
-- DROP TABLE tl_answer_option;
CREATE TABLE tl_answer_option (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
is_selected char(1) NULL,
candidate_answer_id numeric(12) NOT NULL,
answer_id numeric(12) NOT NULL
);
ALTER TABLE tl_answer_option ADD
CONSTRAINT PK_tl_answer_option PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_answer_option_candidate_answer_id
ON tl_answer_option (candidate_answer_id);
-- DROP TABLE tl_candidate_diversity_answer;
CREATE TABLE tl_candidate_diversity_answer (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
question_id numeric(12) NOT NULL,
candidate_id numeric(12) NOT NULL
);
ALTER TABLE tl_candidate_diversity_answer ADD
CONSTRAINT PK_tl_candidate_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_diversity_answer_candidate_id
ON tl_candidate_diversity_answer (candidate_id);
-- DROP TABLE tl_diversity_answer;
CREATE TABLE tl_diversity_answer (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
answer_code text NOT NULL,
answer text NOT NULL,
question_id numeric(12) NOT NULL
);
ALTER TABLE tl_diversity_answer ADD
CONSTRAINT PK_tl_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_diversity_answer_question_id
ON tl_diversity_answer (question_id);
-- DROP TABLE tl_diversity_question;
CREATE TABLE tl_diversity_question (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
question_code text NOT NULL,
question_text text NOT NULL,
australia_only char(1) NULL,
multiple_answers char(1) NULL
);
ALTER TABLE tl_diversity_question ADD
CONSTRAINT PK_tl_diversity_question PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_ht_diversity_question;
CREATE TABLE tl_ht_diversity_question (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
question_text text NOT NULL,
is_applicable char(1) NULL,
question_id numeric(12) NOT NULL,
hiring_team_id numeric(12) NOT NULL
);
ALTER TABLE tl_ht_diversity_question ADD
CONSTRAINT PK_tl_ht_diversity_question PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_ht_diversity_question_hiring_team_id
ON tl_ht_diversity_question (hiring_team_id);
...@@ -18,6 +18,7 @@ CREATE TABLE tl_hiring_team ( ...@@ -18,6 +18,7 @@ CREATE TABLE tl_hiring_team (
post_code varchar(10) NULL, post_code varchar(10) NULL,
city varchar(100) NULL, city varchar(100) NULL,
has_client_support char(1) NULL, has_client_support char(1) NULL,
has_diversity char(1) NULL,
manage_own_billing char(1) NULL, manage_own_billing char(1) NULL,
stripe_reference varchar(100) NULL, stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL, stripe_subscription varchar(100) NULL,
......
...@@ -34,6 +34,7 @@ CREATE TABLE tl_job ( ...@@ -34,6 +34,7 @@ CREATE TABLE tl_job (
culture_statement varchar(2000) NULL, culture_statement varchar(2000) NULL,
draft_location varchar(200) NULL, draft_location varchar(200) NULL,
google_address_text varchar(300) NOT NULL, google_address_text varchar(300) NOT NULL,
diversity_included char(1) NULL,
level_id numeric(12) NULL, level_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
job_owner_id numeric(12) NULL, job_owner_id numeric(12) NULL,
......
...@@ -9,6 +9,7 @@ CREATE TABLE it_does_not_matter ( ...@@ -9,6 +9,7 @@ CREATE TABLE it_does_not_matter (
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
xxxx text NULL, xxxx text NULL,
xxxx varchar(200) NULL,
xxxx numeric(12) NULL xxxx numeric(12) NULL
); );
......
-- DROP TABLE tl_answer_option;
CREATE TABLE tl_answer_option (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
is_selected char(1) NULL,
candidate_answer_id number(12) NOT NULL,
answer_id number(12) NOT NULL
);
ALTER TABLE tl_answer_option ADD
CONSTRAINT PK_tl_answer_option PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_answer_option_candidate_answer_id
ON tl_answer_option (candidate_answer_id);
-- DROP TABLE tl_candidate_diversity_answer;
CREATE TABLE tl_candidate_diversity_answer (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
question_id number(12) NOT NULL,
candidate_id number(12) NOT NULL
);
ALTER TABLE tl_candidate_diversity_answer ADD
CONSTRAINT PK_tl_candidate_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_diversity_answer_candidate_id
ON tl_candidate_diversity_answer (candidate_id);
-- DROP TABLE tl_diversity_answer;
CREATE TABLE tl_diversity_answer (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
answer_code clob NOT NULL,
answer clob NOT NULL,
question_id number(12) NOT NULL
);
ALTER TABLE tl_diversity_answer ADD
CONSTRAINT PK_tl_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_diversity_answer_question_id
ON tl_diversity_answer (question_id);
-- DROP TABLE tl_diversity_question;
CREATE TABLE tl_diversity_question (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
question_code clob NOT NULL,
question_text clob NOT NULL,
australia_only char(1) NULL,
multiple_answers char(1) NULL
);
ALTER TABLE tl_diversity_question ADD
CONSTRAINT PK_tl_diversity_question PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_ht_diversity_question;
CREATE TABLE tl_ht_diversity_question (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
question_text clob NOT NULL,
is_applicable char(1) NULL,
question_id number(12) NOT NULL,
hiring_team_id number(12) NOT NULL
);
ALTER TABLE tl_ht_diversity_question ADD
CONSTRAINT PK_tl_ht_diversity_question PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_ht_diversity_question_hiring_team_id
ON tl_ht_diversity_question (hiring_team_id);
...@@ -19,6 +19,7 @@ CREATE TABLE tl_hiring_team ( ...@@ -19,6 +19,7 @@ CREATE TABLE tl_hiring_team (
post_code varchar2(10) NULL, post_code varchar2(10) NULL,
city varchar2(100) NULL, city varchar2(100) NULL,
has_client_support char(1) NULL, has_client_support char(1) NULL,
has_diversity char(1) NULL,
manage_own_billing char(1) NULL, manage_own_billing char(1) NULL,
stripe_reference varchar2(100) NULL, stripe_reference varchar2(100) NULL,
stripe_subscription varchar2(100) NULL, stripe_subscription varchar2(100) NULL,
......
...@@ -35,6 +35,7 @@ CREATE TABLE tl_job ( ...@@ -35,6 +35,7 @@ CREATE TABLE tl_job (
culture_statement varchar2(2000) NULL, culture_statement varchar2(2000) NULL,
draft_location varchar2(200) NULL, draft_location varchar2(200) NULL,
google_address_text varchar2(300) NOT NULL, google_address_text varchar2(300) NOT NULL,
diversity_included char(1) NULL,
level_id number(12) NULL, level_id number(12) NULL,
client_id number(12) NULL, client_id number(12) NULL,
job_owner_id number(12) NULL, job_owner_id number(12) NULL,
......
...@@ -10,6 +10,7 @@ CREATE TABLE it_does_not_matter ( ...@@ -10,6 +10,7 @@ CREATE TABLE it_does_not_matter (
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
xxxx clob NULL, xxxx clob NULL,
xxxx varchar2(200) NULL,
xxxx number(12) NULL xxxx number(12) NULL
); );
......
-- @AutoRun
-- drop table tl_answer_option;
CREATE TABLE tl_answer_option (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
is_selected char(1) NULL,
candidate_answer_id numeric(12) NOT NULL,
answer_id numeric(12) NOT NULL
);
ALTER TABLE tl_answer_option ADD
CONSTRAINT pk_tl_answer_option PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_answer_option_candidate_answer_id
ON tl_answer_option (candidate_answer_id);
-- @AutoRun
-- drop table tl_candidate_diversity_answer;
CREATE TABLE tl_candidate_diversity_answer (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
question_id numeric(12) NOT NULL,
candidate_id numeric(12) NOT NULL
);
ALTER TABLE tl_candidate_diversity_answer ADD
CONSTRAINT pk_tl_candidate_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_candidate_diversity_answer_candidate_id
ON tl_candidate_diversity_answer (candidate_id);
-- @AutoRun
-- drop table tl_diversity_answer;
CREATE TABLE tl_diversity_answer (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
answer_code text NOT NULL,
answer text NOT NULL,
question_id numeric(12) NOT NULL
);
ALTER TABLE tl_diversity_answer ADD
CONSTRAINT pk_tl_diversity_answer PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_diversity_answer_question_id
ON tl_diversity_answer (question_id);
-- @AutoRun
-- drop table tl_diversity_question;
CREATE TABLE tl_diversity_question (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
question_code text NOT NULL,
question_text text NOT NULL,
australia_only char(1) NULL,
multiple_answers char(1) NULL
);
ALTER TABLE tl_diversity_question ADD
CONSTRAINT pk_tl_diversity_question PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table tl_ht_diversity_question;
CREATE TABLE tl_ht_diversity_question (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
question_text text NOT NULL,
is_applicable char(1) NULL,
question_id numeric(12) NOT NULL,
hiring_team_id numeric(12) NOT NULL
);
ALTER TABLE tl_ht_diversity_question ADD
CONSTRAINT pk_tl_ht_diversity_question PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_ht_diversity_question_hiring_team_id
ON tl_ht_diversity_question (hiring_team_id);
...@@ -19,6 +19,7 @@ CREATE TABLE tl_hiring_team ( ...@@ -19,6 +19,7 @@ CREATE TABLE tl_hiring_team (
post_code varchar(10) NULL, post_code varchar(10) NULL,
city varchar(100) NULL, city varchar(100) NULL,
has_client_support char(1) NULL, has_client_support char(1) NULL,
has_diversity char(1) NULL,
manage_own_billing char(1) NULL, manage_own_billing char(1) NULL,
stripe_reference varchar(100) NULL, stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL, stripe_subscription varchar(100) NULL,
......
...@@ -35,6 +35,7 @@ CREATE TABLE tl_job ( ...@@ -35,6 +35,7 @@ CREATE TABLE tl_job (
culture_statement varchar(2000) NULL, culture_statement varchar(2000) NULL,
draft_location varchar(200) NULL, draft_location varchar(200) NULL,
google_address_text varchar(300) NOT NULL, google_address_text varchar(300) NOT NULL,
diversity_included char(1) NULL,
level_id numeric(12) NULL, level_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
job_owner_id numeric(12) NULL, job_owner_id numeric(12) NULL,
......
...@@ -10,6 +10,7 @@ CREATE TABLE it_does_not_matter ( ...@@ -10,6 +10,7 @@ CREATE TABLE it_does_not_matter (
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
xxxx text NULL, xxxx text NULL,
xxxx varchar(200) NULL,
xxxx numeric(12) NULL xxxx numeric(12) NULL
); );
......
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.servlets.forms.RedisplayResult;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessFormProcessor;
import oneit.servlets.process.ORMProcessState;
import oneit.utils.BusinessException;
import performa.orm.DiversityQuestion;
import performa.orm.HTDiversityQuestion;
import performa.orm.HiringTeam;
import performa.orm.types.Countries;
public class ChangeDiversityFP extends ORMProcessFormProcessor
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
HiringTeam hiringTeam = (HiringTeam) request.getAttribute("HiringTeam");
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1, "Inside ChangeDiversityFP for ", hiringTeam , " Has Diversity:", hiringTeam.getHasDiversity());
if(hiringTeam.showHasDiversity())
{
if(hiringTeam.getDiversityQuestionsCount() == 0)
{
for(DiversityQuestion question : DiversityQuestion.searchAll(objTran))
{
if(hiringTeam.getCountry() != Countries.AU && question.getAustraliaOnly())
{
continue;
}
HTDiversityQuestion htDiversityQuestion = HTDiversityQuestion.createHTDiversityQuestion(objTran);
htDiversityQuestion.setQuestion(question);
htDiversityQuestion.setQuestionText(question.getQuestionText());
htDiversityQuestion.setHiringTeam(hiringTeam);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1, "ChangeDiversityFP created diversity question : ", htDiversityQuestion);
}
}
}
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1, "ChangeDiversityFP completed for ", hiringTeam);
return RedisplayResult.getInstance();
}
}
...@@ -72,6 +72,14 @@ public class SaveCompanyFP extends SaveFP ...@@ -72,6 +72,14 @@ public class SaveCompanyFP extends SaveFP
} }
} }
if(!hiringTeam.showHasDiversity())
{
hiringTeam.getDiversityQuestionsSet().forEach((question) -> {
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP deleting diversity question : ", question );
question.delete();
});
}
//Set attribute IsHTLogoPresent false when HT logo is not uploaded or deleted //Set attribute IsHTLogoPresent false when HT logo is not uploaded or deleted
if(hiringTeam.getHiringTeamLogo() == null && !isHTLogoPresent) if(hiringTeam.getHiringTeamLogo() == null && !isHTLogoPresent)
......
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.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter;
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 oneit.utils.MultiException;
import oneit.utils.filter.Filter;
import performa.orm.AnswerOption;
import performa.orm.Candidate;
import performa.orm.CandidateDiversityAnswer;
import performa.orm.HTDiversityQuestion;
import performa.orm.Job;
import performa.orm.JobApplication;
public class SaveDiversityAnswersFP 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 SaveDiversityAnswersFP saving job application: ", jobApplication );
Candidate candidate = jobApplication.getCandidate();
Job job = jobApplication.getJob();
for(HTDiversityQuestion htQuestion : job.getDiversityQuestions())
{
CandidateDiversityAnswer diversityAnswer = candidate.getDiversityAnswerByQuestion(htQuestion.getQuestion());
if(htQuestion.getQuestion().getMultipleAnswers())
{
for(AnswerOption answer : diversityAnswer.getAnswersSet())
{
if(!answer.isTrue(answer.getIsSelected()))
{
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In SaveDiversityAnswersFP for multiple answer questions deleting AnswerOption : ", answer );
answer.delete();
}
}
}
else if(diversityAnswer.pipelineCandidateDiversityAnswer().toAnswers(AnswerOption.SearchByAll().andIsSelected(new EqualsFilter<>(Boolean.TRUE))).uniqueVals().isEmpty())
{
AnswerOption answerOption = diversityAnswer.pipelineCandidateDiversityAnswer().toAnswers().val();
if(answerOption == null)
{
answerOption = AnswerOption.createAnswerOption(process.getTransaction());
}
diversityAnswer.addToAnswers(answerOption);
answerOption.setAnswer(diversityAnswer.getAnswerOption());
answerOption.setIsSelected(Boolean.TRUE);
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In SaveDiversityAnswersFP created AnswerOption : ", answerOption);
}
}
return super.processForm(process, submission, params);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
Candidate candidate = jobApplication.getCandidate();
Job job = jobApplication.getJob();
for(HTDiversityQuestion htQuestion : job.getDiversityQuestions())
{
CandidateDiversityAnswer diversityAnswer = candidate.getDiversityAnswerByQuestion(htQuestion.getQuestion());
if(htQuestion.getQuestion().getMultipleAnswers())
{
Filter<AnswerOption> filter = AnswerOption.SearchByAll().andIsSelected(new EqualsFilter<>(Boolean.TRUE));
BusinessObjectParser.assertFieldCondition(diversityAnswer.pipelineCandidateDiversityAnswer().toAnswers(filter).uniqueVals().size() >= 1 , diversityAnswer, CandidateDiversityAnswer.MULTIPLEREFERENCE_Answers, "atleastOneAnswer", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(diversityAnswer.getAnswerOption() != null , diversityAnswer, CandidateDiversityAnswer.SINGLEREFERENCE_AnswerOption, "mandatory", exceptions, true, request);
}
}
super.validate(process, submission, exceptions, params);
}
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import oneit.logging.*; ...@@ -8,6 +8,7 @@ import oneit.logging.*;
import oneit.objstore.ObjectTransaction; import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser; import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
...@@ -64,6 +65,7 @@ public class SendVerificationMailFP extends SaveFP ...@@ -64,6 +65,7 @@ public class SendVerificationMailFP extends SaveFP
BusinessObjectParser.assertFieldCondition(candidate.getGoogleAddressText() != null, candidate, Candidate.FIELD_GoogleAddressText, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(candidate.getGoogleAddressText() != null, candidate, Candidate.FIELD_GoogleAddressText, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getHasValidAddress()), candidate, Candidate.FIELD_GoogleAddressText, "invalid", exceptions, true, request); BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getHasValidAddress()), candidate, Candidate.FIELD_GoogleAddressText, "invalid", exceptions, true, request);
} }
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
......
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
public class AnswerOption extends BaseAnswerOption
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public AnswerOption ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="AnswerOption" package="performa.orm">
<TABLE name="tl_answer_option" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="IsSelected" type="Boolean" dbcol="is_selected" defaultValue="Boolean.FALSE" />
<SINGLEREFERENCE name="CandidateAnswer" type="CandidateDiversityAnswer" dbcol="candidate_answer_id" mandatory="true" backreferenceName="Answers"/>
<SINGLEREFERENCE name="Answer" type="DiversityAnswer" dbcol="answer_id" mandatory="true" />
</TABLE>
<SEARCH type="All" paramFilter="tl_answer_option.object_id is not null" orderBy="tl_answer_option.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -112,6 +112,20 @@ public class Candidate extends BaseCandidate ...@@ -112,6 +112,20 @@ public class Candidate extends BaseCandidate
} }
public boolean diversityCompleted(Job job)
{
Set<AnswerOption> selectedAnswers = pipelineCandidate().toDiversityAnswers().toAnswers(AnswerOption.SearchByAll().andAnswer(new IsNotNullFilter<>()).andIsSelected(new EqualsFilter<>(Boolean.TRUE))).uniqueVals();
Set<DiversityQuestion> answeredQuestions = AnswerOption.pipesAnswerOption(selectedAnswers).toCandidateAnswer().toQuestion().uniqueVals();
Set<DiversityQuestion> applicableQuestions = HTDiversityQuestion.pipesHTDiversityQuestion(job.getDiversityQuestions()).toQuestion().uniqueVals();
return answeredQuestions.containsAll(applicableQuestions);
}
public CandidateDiversityAnswer getDiversityAnswerByQuestion(DiversityQuestion question)
{
return pipelineCandidate().toDiversityAnswers(CandidateDiversityAnswer.SearchByAll().andQuestion(new EqualsFilter<>(question))).val();
}
public boolean cultureCompleted(Job job) public boolean cultureCompleted(Job job)
{ {
if(!job.showCultureCriteriaSection()) if(!job.showCultureCriteriaSection())
...@@ -235,4 +249,9 @@ public class Candidate extends BaseCandidate ...@@ -235,4 +249,9 @@ public class Candidate extends BaseCandidate
return Boolean.FALSE; return Boolean.FALSE;
} }
public Boolean hasAnswer(HTDiversityQuestion htQuestion)
{
return Boolean.FALSE;
}
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<MULTIPLEREFERENCE name="JobApplications" type="JobApplication" backreferenceName="Candidate" /> <MULTIPLEREFERENCE name="JobApplications" type="JobApplication" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="CultureCriteriaAnswers" type="CultureCriteriaAnswer" backreferenceName="Candidate" /> <MULTIPLEREFERENCE name="CultureCriteriaAnswers" type="CultureCriteriaAnswer" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="ProfileAssessmentAnswers" type="Answer" backreferenceName="Candidate" /> <MULTIPLEREFERENCE name="ProfileAssessmentAnswers" type="Answer" backreferenceName="Candidate" />
<MULTIPLEREFERENCE name="DiversityAnswers" type="CandidateDiversityAnswer" backreferenceName="Candidate" />
<TRANSIENT name="PrivacyPolicyAgreed" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="PrivacyPolicyAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="ConditionsAgreed" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="ConditionsAgreed" type="Boolean" defaultValue="Boolean.FALSE"/>
......
package performa.orm;
public class CandidateDiversityAnswer extends BaseCandidateDiversityAnswer
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public CandidateDiversityAnswer ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="CandidateDiversityAnswer" package="performa.orm">
<TRANSIENTSINGLE name="AnswerOption" type="DiversityAnswer" />
<MULTIPLEREFERENCE name="Answers" type="AnswerOption" backreferenceName="CandidateAnswer" />
<TABLE name="tl_candidate_diversity_answer" tablePrefix="object" polymorphic="FALSE">
<SINGLEREFERENCE name="Question" type="DiversityQuestion" dbcol="question_id" mandatory="true" />
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" mandatory="true" backreferenceName="DiversityAnswers" />
</TABLE>
<SEARCH type="All" paramFilter="tl_candidate_diversity_answer.object_id is not null" orderBy="tl_candidate_diversity_answer.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
public class DiversityAnswer extends BaseDiversityAnswer
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public DiversityAnswer ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="DiversityAnswer" package="performa.orm">
<TABLE name="tl_diversity_answer" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Code" type="String" dbcol="answer_code" mandatory="true"/>
<ATTRIB name="Answer" type="String" dbcol="answer" mandatory="true"/>
<SINGLEREFERENCE name="Question" type="DiversityQuestion" dbcol="question_id" backreferenceName="Answers" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_diversity_answer.object_id is not null" orderBy="tl_diversity_answer.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
public class DiversityQuestion extends BaseDiversityQuestion
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public DiversityQuestion ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="DiversityQuestion" package="performa.orm">
<MULTIPLEREFERENCE name="Answers" type="DiversityAnswer" backreferenceName="Question" />
<TABLE name="tl_diversity_question" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Code" type="String" dbcol="question_code" mandatory="true"/>
<ATTRIB name="QuestionText" type="String" dbcol="question_text" mandatory="true"/>
<ATTRIB name="AustraliaOnly" type="Boolean" dbcol="australia_only" defaultValue="Boolean.FALSE" />
<ATTRIB name="MultipleAnswers" type="Boolean" dbcol="multiple_answers" defaultValue="Boolean.FALSE" />
</TABLE>
<SEARCH type="All" paramFilter="tl_diversity_question.object_id is not null" orderBy="tl_diversity_question.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
public class HTDiversityQuestion extends BaseHTDiversityQuestion
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public HTDiversityQuestion ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="HTDiversityQuestion" package="performa.orm">
<TABLE name="tl_ht_diversity_question" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="QuestionText" type="String" dbcol="question_text" mandatory="true"/>
<ATTRIB name="IsApplicable" type="Boolean" dbcol="is_applicable" defaultValue="Boolean.TRUE" />
<SINGLEREFERENCE name="Question" type="DiversityQuestion" dbcol="question_id" mandatory="true"/>
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="DiversityQuestions" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_ht_diversity_question.object_id is not null" orderBy="tl_ht_diversity_question.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -6,7 +6,6 @@ import java.util.Date; ...@@ -6,7 +6,6 @@ import java.util.Date;
import java.util.Set; import java.util.Set;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
import oneit.objstore.FieldWriteability; import oneit.objstore.FieldWriteability;
import oneit.objstore.ValidationContext;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
...@@ -38,6 +37,11 @@ public class HiringTeam extends BaseHiringTeam ...@@ -38,6 +37,11 @@ public class HiringTeam extends BaseHiringTeam
return isTrue(getHasClientSupport()); return isTrue(getHasClientSupport());
} }
public boolean showHasDiversity()
{
return isTrue(getHasDiversity());
}
@Override @Override
public String getToString() public String getToString()
{ {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<MULTIPLEREFERENCE name="Users" type="CompanyUserHiringTeamLink" backreferenceName="HiringTeam" /> <MULTIPLEREFERENCE name="Users" type="CompanyUserHiringTeamLink" backreferenceName="HiringTeam" />
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="HiringTeam" /> <MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="HiringTeam" />
<MULTIPLEREFERENCE name="BillingTeams" type="HiringTeam" backreferenceName="BilledByTeam" /> <MULTIPLEREFERENCE name="BillingTeams" type="HiringTeam" backreferenceName="BilledByTeam" />
<MULTIPLEREFERENCE name="DiversityQuestions" type="HTDiversityQuestion" backreferenceName="HiringTeam" />
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/> <TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="CouponCode" type="String" length="20"/> <TRANSIENT name="CouponCode" type="String" length="20"/>
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/> <ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/> <ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/> <ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HasDiversity" type="Boolean" dbcol="has_diversity" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="ManageOwnBilling" type="Boolean" dbcol="manage_own_billing" mandatory="false" defaultValue="Boolean.TRUE"/> <ATTRIB name="ManageOwnBilling" type="Boolean" dbcol="manage_own_billing" mandatory="false" defaultValue="Boolean.TRUE"/>
<ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100" /> <ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100" />
<ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100" /> <ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100" />
......
...@@ -88,6 +88,11 @@ public class Job extends BaseJob ...@@ -88,6 +88,11 @@ public class Job extends BaseJob
{ {
setGoogleAddressText(hiringTeam.getGoogleAddressText()); setGoogleAddressText(hiringTeam.getGoogleAddressText());
} }
if(hiringTeam.showHasDiversity())
{
setDiversityIncluded(Boolean.TRUE);
}
} }
...@@ -806,6 +811,23 @@ public class Job extends BaseJob ...@@ -806,6 +811,23 @@ public class Job extends BaseJob
return getOccupation(); return getOccupation();
} }
public boolean hasDiversityQuestions()
{
Filter<HTDiversityQuestion> filter = HTDiversityQuestion.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE));
return getDiversityIncluded() && getHiringTeam().showHasDiversity() && pipelineJob().toHiringTeam().toDiversityQuestions(filter).uniqueVals().size() > 0;
}
public Set<HTDiversityQuestion> getDiversityQuestions()
{
if(getDiversityIncluded())
{
return pipelineJob().toHiringTeam().toDiversityQuestions(HTDiversityQuestion.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE))).uniqueVals();
}
return new HashSet();
}
public int getApplicableCultureCount() public int getApplicableCultureCount()
{ {
Filter<CultureCriteria> filter = CultureCriteria.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE)); Filter<CultureCriteria> filter = CultureCriteria.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE));
...@@ -819,4 +841,16 @@ public class Job extends BaseJob ...@@ -819,4 +841,16 @@ public class Job extends BaseJob
return pipelineJob().toCultureCriterias(filter).uniqueVals(); return pipelineJob().toCultureCriterias(filter).uniqueVals();
} }
public DiversityQuestion getQuestionByFilter(AppFilter filter)
{
if(hasDiversityQuestions())
{
Filter<DiversityQuestion> diversityFilter = DiversityQuestion.SearchByAll().andCode(new EqualsFilter<>(filter.getName()));
return pipelineJob().toHiringTeam().toDiversityQuestions().toQuestion(diversityFilter).val();
}
return null;
}
} }
\ No newline at end of file
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<ATTRIB name="CultureStatement" type="String" dbcol="culture_statement" length="2000"/> <ATTRIB name="CultureStatement" type="String" dbcol="culture_statement" length="2000"/>
<ATTRIB name="DraftLocation" type="DraftLocation" dbcol="draft_location" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="DraftLocation" type="DraftLocation" dbcol="draft_location" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" mandatory="true" length="300" /> <ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" mandatory="true" length="300" />
<ATTRIB name="DiversityIncluded" type="Boolean" dbcol="diversity_included" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/> <SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
......
...@@ -199,6 +199,71 @@ public class JobApplication extends BaseJobApplication ...@@ -199,6 +199,71 @@ public class JobApplication extends BaseJobApplication
return safeRedirect; return safeRedirect;
} }
public boolean createDiversityAnswerObjects() throws FieldException
{
boolean safeRedirect = false;
Candidate candidate = getCandidate();
//to skip diversity test
if(!isDiversityIncluded() || diversityCompleted())
{
return safeRedirect;
}
for(HTDiversityQuestion htQuestion : getJob().getDiversityQuestions())
{
DiversityQuestion question = htQuestion.getQuestion();
boolean available = false;
for(CandidateDiversityAnswer answer : getCandidate().getDiversityAnswersSet())
{
if(answer.getQuestion().equals(question))
{
available = true;
break;
}
}
if(!available)
{
CandidateDiversityAnswer answer = CandidateDiversityAnswer.createCandidateDiversityAnswer(getTransaction());
if(question.getMultipleAnswers())
{
for(DiversityAnswer diversityAnswer : question.getAnswersSet())
{
AnswerOption answerOption = AnswerOption.createAnswerOption(getTransaction());
answer.addToAnswers(answerOption);
answerOption.setAnswer(diversityAnswer);
}
}
candidate.addToDiversityAnswers(answer);
answer.setQuestion(question);
safeRedirect = true;
}
}
return safeRedirect;
}
public void setDiversityAnswerOptions() throws StorageException, FieldException
{
for(CandidateDiversityAnswer candidateAnswer : pipelineJobApplication().toCandidate().toDiversityAnswers().uniqueVals())
{
if(!candidateAnswer.getQuestion().getMultipleAnswers())
{
AnswerOption answerOption = candidateAnswer.pipelineCandidateDiversityAnswer().toAnswers().val();
if(answerOption != null && answerOption.getAnswer() != null && answerOption.isTrue(answerOption.getIsSelected()))
{
candidateAnswer.setAnswerOption(answerOption.getAnswer());
}
}
}
}
public Answer getAnswerForQuestion(Question question) throws FieldException public Answer getAnswerForQuestion(Question question) throws FieldException
{ {
...@@ -254,6 +319,11 @@ public class JobApplication extends BaseJobApplication ...@@ -254,6 +319,11 @@ public class JobApplication extends BaseJobApplication
return isIncludeCultureCriteria() ? getCandidate().cultureCompleted(getJob()) : true; return isIncludeCultureCriteria() ? getCandidate().cultureCompleted(getJob()) : true;
} }
public boolean diversityCompleted()
{
return getCandidate().diversityCompleted(getJob());
}
public boolean assessmentCompleted() //role public boolean assessmentCompleted() //role
{ {
...@@ -288,6 +358,11 @@ public class JobApplication extends BaseJobApplication ...@@ -288,6 +358,11 @@ public class JobApplication extends BaseJobApplication
return getJob() != null && isTrue(getJob().getIncludeCulture()); return getJob() != null && isTrue(getJob().getIncludeCulture());
} }
public boolean isDiversityIncluded()
{
return getJob() != null && getJob().hasDiversityQuestions();
}
@Override @Override
public Map getRoleFit() public Map getRoleFit()
{ {
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class AppFilter extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_AppFilter = new AppFilterFactory();
public static final AppFilter REQ = new AppFilter ("REQ", "REQ", "Requirements", false);
public static final AppFilter REQ_MET = new AppFilter ("REQ_MET", "REQ_MET", "Met", false);
public static final AppFilter REQ_NOT_MET = new AppFilter ("REQ_NOT_MET", "REQ_NOT_MET", "Not Met", false);
public static final AppFilter GENDER = new AppFilter ("GENDER", "GENDER", "Gender", false);
public static final AppFilter GENDER_MAN = new AppFilter ("GENDER_MAN", "GENDER_MAN", "Man", false);
public static final AppFilter GENDER_WOMAN = new AppFilter ("GENDER_WOMAN", "GENDER_WOMAN", "Woman", false);
public static final AppFilter GENDER_OTHER = new AppFilter ("GENDER_OTHER", "GENDER_OTHER", "Other", false);
public static final AppFilter ATSI = new AppFilter ("ATSI", "ATSI", "ATSI", false);
public static final AppFilter ATSI_ABORIGINAL = new AppFilter ("ATSI_ABORIGINAL", "ATSI_ABORIGINAL", "Aboriginal", false);
public static final AppFilter ATSI_TSI = new AppFilter ("ATSI_TSI", "ATSI_TSI", "Torres Strait Islander", false);
public static final AppFilter ATSI_BOTH = new AppFilter ("ATSI_BOTH", "ATSI_BOTH", "Both", false);
public static final AppFilter DISABLED = new AppFilter ("DISABLED", "DISABLED", "Disability", false);
public static final AppFilter DISABLED_HEARING = new AppFilter ("DISABLED_HEARING", "DISABLED_HEARING", "Hearing", false);
public static final AppFilter DISABLED_LEARNING = new AppFilter ("DISABLED_LEARNING", "DISABLED_LEARNING", "Learning", false);
public static final AppFilter DISABLED_MEDICAL = new AppFilter ("DISABLED_MEDICAL", "DISABLED_MEDICAL", "Medical / Physical / Psychiatric", false);
public static final AppFilter DISABLED_SIGHT = new AppFilter ("DISABLED_SIGHT", "DISABLED_SIGHT", "Sight", false);
public static final AppFilter DISABLED_SPEECH = new AppFilter ("DISABLED_SPEECH", "DISABLED_SPEECH", "Speech", false);
public static final AppFilter DISABLED_ARMS = new AppFilter ("DISABLED_ARMS", "DISABLED_ARMS", "Use of Arms and Hands", false);
public static final AppFilter DISABLED_LEGS = new AppFilter ("DISABLED_LEGS", "DISABLED_LEGS", "Use of Legs", false);
public static final AppFilter DISABLED_OTHER = new AppFilter ("DISABLED_OTHER", "DISABLED_OTHER", "Other", false);
private static final AppFilter[] allAppFilters =
new AppFilter[] { REQ,REQ_MET,REQ_NOT_MET,GENDER,GENDER_MAN,GENDER_WOMAN,GENDER_OTHER,ATSI,ATSI_ABORIGINAL,ATSI_TSI,ATSI_BOTH,DISABLED,DISABLED_HEARING,DISABLED_LEARNING,DISABLED_MEDICAL,DISABLED_SIGHT,DISABLED_SPEECH,DISABLED_ARMS,DISABLED_LEGS,DISABLED_OTHER};
private static AppFilter[] getAllAppFilters ()
{
return allAppFilters;
}
private transient Boolean IsRoot;
private transient AppFilter[] ChildNodes;
private transient AppFilter ParentNode;
private AppFilter (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public Boolean getIsRoot()
{
return IsRoot;
}
public AppFilter[] getChildNodes()
{
return ChildNodes;
}
public AppFilter getParentNode()
{
return ParentNode;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allAppFilters);
static
{
defineAdditionalData ();
}
public boolean isEqual (AppFilter other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return AppFilter.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return AppFilter.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_AppFilter;
}
public static AppFilter forName (String name)
{
if (name == null) { return null; }
AppFilter[] all = getAllAppFilters();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static AppFilter forValue (String value)
{
if (value == null) { return null; }
AppFilter[] all = getAllAppFilters();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllAppFilters (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllAppFilters());
}
public static AppFilter[] getAppFilterArray ()
{
return (AppFilter[])getAllAppFilters().clone ();
}
public static void defineAdditionalData ()
{
REQ.IsRoot = Boolean.TRUE;
REQ.ChildNodes = new AppFilter[] {AppFilter.REQ_MET, AppFilter.REQ_NOT_MET};
REQ_MET.IsRoot = Boolean.FALSE;
REQ_MET.ChildNodes = new AppFilter[] {};
REQ_MET.ParentNode = AppFilter.REQ;
REQ_NOT_MET.IsRoot = Boolean.FALSE;
REQ_NOT_MET.ChildNodes = new AppFilter[] {};
REQ_NOT_MET.ParentNode = AppFilter.REQ;
GENDER.IsRoot = Boolean.TRUE;
GENDER.ChildNodes = new AppFilter[] {AppFilter.GENDER_MAN, AppFilter.GENDER_WOMAN, AppFilter.GENDER_OTHER};
GENDER_MAN.IsRoot = Boolean.FALSE;
GENDER_MAN.ChildNodes = new AppFilter[] {};
GENDER_MAN.ParentNode = AppFilter.GENDER;
GENDER_WOMAN.IsRoot = Boolean.FALSE;
GENDER_WOMAN.ChildNodes = new AppFilter[] {};
GENDER_WOMAN.ParentNode = AppFilter.GENDER;
GENDER_OTHER.IsRoot = Boolean.FALSE;
GENDER_OTHER.ChildNodes = new AppFilter[] {};
GENDER_OTHER.ParentNode = AppFilter.GENDER;
ATSI.IsRoot = Boolean.TRUE;
ATSI.ChildNodes = new AppFilter[] {AppFilter.ATSI_ABORIGINAL, AppFilter.ATSI_TSI, AppFilter.ATSI_BOTH};
ATSI_ABORIGINAL.IsRoot = Boolean.FALSE;
ATSI_ABORIGINAL.ChildNodes = new AppFilter[] {};
ATSI_ABORIGINAL.ParentNode = AppFilter.ATSI;
ATSI_TSI.IsRoot = Boolean.FALSE;
ATSI_TSI.ChildNodes = new AppFilter[] {};
ATSI_TSI.ParentNode = AppFilter.ATSI;
ATSI_BOTH.IsRoot = Boolean.FALSE;
ATSI_BOTH.ChildNodes = new AppFilter[] {};
ATSI_BOTH.ParentNode = AppFilter.ATSI;
DISABLED.IsRoot = Boolean.TRUE;
DISABLED.ChildNodes = new AppFilter[] {AppFilter.DISABLED_HEARING, AppFilter.DISABLED_LEARNING, AppFilter.DISABLED_MEDICAL, AppFilter.DISABLED_SIGHT, AppFilter.DISABLED_SPEECH , AppFilter.DISABLED_ARMS , AppFilter.DISABLED_LEGS , AppFilter.DISABLED_OTHER };
DISABLED_HEARING.IsRoot = Boolean.FALSE;
DISABLED_HEARING.ChildNodes = new AppFilter[] {};
DISABLED_HEARING.ParentNode = AppFilter.DISABLED;
DISABLED_LEARNING.IsRoot = Boolean.FALSE;
DISABLED_LEARNING.ChildNodes = new AppFilter[] {};
DISABLED_LEARNING.ParentNode = AppFilter.DISABLED;
DISABLED_MEDICAL.IsRoot = Boolean.FALSE;
DISABLED_MEDICAL.ChildNodes = new AppFilter[] {};
DISABLED_MEDICAL.ParentNode = AppFilter.DISABLED;
DISABLED_SIGHT.IsRoot = Boolean.FALSE;
DISABLED_SIGHT.ChildNodes = new AppFilter[] {};
DISABLED_SIGHT.ParentNode = AppFilter.DISABLED;
DISABLED_SPEECH.IsRoot = Boolean.FALSE;
DISABLED_SPEECH.ChildNodes = new AppFilter[] {};
DISABLED_SPEECH.ParentNode = AppFilter.DISABLED;
DISABLED_ARMS.IsRoot = Boolean.FALSE;
DISABLED_ARMS.ChildNodes = new AppFilter[] {};
DISABLED_ARMS.ParentNode = AppFilter.DISABLED;
DISABLED_LEGS.IsRoot = Boolean.FALSE;
DISABLED_LEGS.ChildNodes = new AppFilter[] {};
DISABLED_LEGS.ParentNode = AppFilter.DISABLED;
DISABLED_OTHER.IsRoot = Boolean.FALSE;
DISABLED_OTHER.ChildNodes = new AppFilter[] {};
DISABLED_OTHER.ParentNode = AppFilter.DISABLED;
}
static class AppFilterFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return AppFilter.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return AppFilter.forValue (name);
}
public Enumeration getAll ()
{
return AppFilter.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("IsRoot", ArrayFormatter.toObject(getIsRoot()));
attribs.put ("ChildNodes", ArrayFormatter.toObject(getChildNodes()));
attribs.put ("ParentNode", ArrayFormatter.toObject(getParentNode()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="AppFilter">
<DATA name="IsRoot" type="Boolean"/>
<DATA name="ChildNodes" type="AppFilter[]"/>
<DATA name="ParentNode" type="AppFilter"/>
<VALUE name="REQ" description="Requirements" IsRoot="Boolean.TRUE" ChildNodes='new AppFilter[] {AppFilter.REQ_MET, AppFilter.REQ_NOT_MET}'/>
<VALUE name="REQ_MET" description="Met" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.REQ"/>
<VALUE name="REQ_NOT_MET" description="Not Met" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.REQ"/>
<VALUE name="GENDER" description="Gender" IsRoot="Boolean.TRUE" ChildNodes='new AppFilter[] {AppFilter.GENDER_MAN, AppFilter.GENDER_WOMAN, AppFilter.GENDER_OTHER}'/>
<VALUE name="GENDER_MAN" description="Man" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.GENDER"/>
<VALUE name="GENDER_WOMAN" description="Woman" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.GENDER"/>
<VALUE name="GENDER_OTHER" description="Other" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.GENDER"/>
<VALUE name="ATSI" description="ATSI" IsRoot="Boolean.TRUE" ChildNodes='new AppFilter[] {AppFilter.ATSI_ABORIGINAL, AppFilter.ATSI_TSI, AppFilter.ATSI_BOTH}'/>
<VALUE name="ATSI_ABORIGINAL" description="Aboriginal" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.ATSI"/>
<VALUE name="ATSI_TSI" description="Torres Strait Islander" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.ATSI"/>
<VALUE name="ATSI_BOTH" description="Both" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.ATSI"/>
<VALUE name="DISABLED" description="Disability" IsRoot="Boolean.TRUE" ChildNodes='new AppFilter[] {AppFilter.DISABLED_HEARING, AppFilter.DISABLED_LEARNING, AppFilter.DISABLED_MEDICAL, AppFilter.DISABLED_SIGHT, AppFilter.DISABLED_SPEECH , AppFilter.DISABLED_ARMS , AppFilter.DISABLED_LEGS , AppFilter.DISABLED_OTHER }'/>
<VALUE name="DISABLED_HEARING" description="Hearing" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_LEARNING" description="Learning" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_MEDICAL" description="Medical / Physical / Psychiatric" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_SIGHT" description="Sight" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_SPEECH" description="Speech" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_ARMS" description="Use of Arms and Hands" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_LEGS" description="Use of Legs" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
<VALUE name="DISABLED_OTHER" description="Other" IsRoot="Boolean.FALSE" ChildNodes='new AppFilter[] {}' ParentNode="AppFilter.DISABLED"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
package performa.search; package performa.search;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import oneit.logging.LogLevel; import oneit.logging.LogLevel;
import oneit.logging.LogMgr; import oneit.logging.LogMgr;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
...@@ -43,11 +45,22 @@ public class SearchApplicant extends BaseSearchApplicant ...@@ -43,11 +45,22 @@ public class SearchApplicant extends BaseSearchApplicant
for(JobApplication app : results) for(JobApplication app : results)
{ {
ApplicationStatus appStatus = app.getApplicationStatus(); ApplicationStatus appStatus = app.getApplicationStatus();
boolean skip = false;
app = app.getInTransaction(getTransaction()); app = app.getInTransaction(getTransaction());
app.setApplicationStatus(appStatus); app.setApplicationStatus(appStatus);
if(getFilter() != null)
{
skip = applyFilters(app);
}
if(skip)
{
continue;
}
Answer[] answers = Answer.SearchByAll().andCandidate(new EqualsFilter<>(app.getCandidate())).search(getTransaction()); Answer[] answers = Answer.SearchByAll().andCandidate(new EqualsFilter<>(app.getCandidate())).search(getTransaction());
for (Answer answer: answers) for (Answer answer: answers)
...@@ -74,6 +87,79 @@ public class SearchApplicant extends BaseSearchApplicant ...@@ -74,6 +87,79 @@ public class SearchApplicant extends BaseSearchApplicant
} }
} }
private boolean applyFilters(JobApplication app) throws StorageException
{
Map<AppFilter, List<AppFilter>> map = createFilterMap();
for(AppFilter filter : getFilter())
{
if(filter.getIsRoot())
{
if(filter == AppFilter.ATSI || filter == AppFilter.DISABLED)
{
DiversityQuestion question = app.getJob().getQuestionByFilter(filter);
if(question != null)
{
CandidateDiversityAnswer answer = app.getCandidate().getDiversityAnswerByQuestion(question);
boolean hasAnswer = false;
for(AppFilter child : filter.getChildNodes())
{
if(answer != null && answer.pipelineCandidateDiversityAnswer().toAnswers().toAnswer().toCode().uniqueVals().contains(child.getName()))
{
hasAnswer = true;
break;
}
}
if(answer == null || !hasAnswer)
{
return true;
}
}
}
}
else if(filter.getParentNode() != null && filter.getParentNode() == AppFilter.REQ && getJob().showAssessmentCriteriaSection())
{
if((filter == AppFilter.REQ_MET && !app.hasAllEssentialRequirements()) || (filter == AppFilter.REQ_NOT_MET && !app.hasFailedEssentialRequirements()))
{
return true;
}
}
}
for(Map.Entry<AppFilter, List<AppFilter>> entry :map.entrySet()){
AppFilter parentNode = entry.getKey();
List<AppFilter> childList = entry.getValue();
DiversityQuestion question = app.getJob().getQuestionByFilter(parentNode);
if(question != null)
{
CandidateDiversityAnswer answer = app.getCandidate().getDiversityAnswerByQuestion(question);
boolean hasAnswer = false;
for(AppFilter child : childList)
{
if(answer != null && answer.pipelineCandidateDiversityAnswer().toAnswers().toAnswer().toCode().uniqueVals().contains(child.getName()))
{
hasAnswer = true;
break;
}
}
if(answer == null || !hasAnswer)
{
return true;
}
}
}
return false;
}
}); });
} }
catch (FieldException | StorageException ex) catch (FieldException | StorageException ex)
...@@ -84,4 +170,25 @@ public class SearchApplicant extends BaseSearchApplicant ...@@ -84,4 +170,25 @@ public class SearchApplicant extends BaseSearchApplicant
return appResults.toArray(new JobApplication[0]); return appResults.toArray(new JobApplication[0]);
} }
private Map<AppFilter, List<AppFilter>> createFilterMap()
{
Map<AppFilter, List<AppFilter>> map = new HashMap<>();
for(AppFilter filter : getFilter())
{
if(filter.getParentNode() != null && filter.getParentNode() != AppFilter.REQ)
{
if (!map.containsKey(filter.getParentNode()))
{
map.put(filter.getParentNode(), new ArrayList<>());
}
map.get(filter.getParentNode()).add(filter);
}
}
return map;
}
} }
\ No newline at end of file
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
<IMPORT value="oneit.servlets.orm.*" /> <IMPORT value="oneit.servlets.orm.*" />
<IMPORT value="performa.orm.*"/> <IMPORT value="performa.orm.*"/>
<IMPORT value="performa.orm.types.*"/>
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE" > <TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE" >
<ATTRIB name="Details" type="String" dbcol="xxxx" /> <ATTRIB name="Details" type="String" dbcol="xxxx" />
<ATTRIB name="Filter" type="Set&lt;AppFilter&gt;" dbcol="xxxx" attribHelper="DelimitedEnumsAttributeHelper" attribHelperInstance="new DelimitedEnumsAttributeHelper (AppFilter.FACTORY_AppFilter)"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="xxxx" /> <SINGLEREFERENCE name="Job" type="Job" dbcol="xxxx" />
......
...@@ -16,6 +16,7 @@ import oneit.utils.*; ...@@ -16,6 +16,7 @@ import oneit.utils.*;
import oneit.utils.threading.*; import oneit.utils.threading.*;
import oneit.servlets.orm.*; import oneit.servlets.orm.*;
import performa.orm.*; import performa.orm.*;
import performa.orm.types.*;
...@@ -29,10 +30,12 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -29,10 +30,12 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String dummyDetails; private String dummyDetails;
private Set<AppFilter> dummyFilter;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Details = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_Details = DefaultAttributeHelper.INSTANCE;
private static final DelimitedEnumsAttributeHelper HELPER_Filter = new DelimitedEnumsAttributeHelper (AppFilter.FACTORY_AppFilter);
...@@ -40,10 +43,11 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -40,10 +43,11 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
public SearchApplicantPersistenceMgr () public SearchApplicantPersistenceMgr ()
{ {
dummyDetails = (String)(HELPER_Details.initialise (dummyDetails)); dummyDetails = (String)(HELPER_Details.initialise (dummyDetails));
dummyFilter = (Set<AppFilter>)(HELPER_Filter.initialise (dummyFilter));
} }
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -95,6 +99,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -95,6 +99,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details)|| !it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details)||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Filter)||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.SINGLEREFERENCE_Job)) !it_does_not_matterPSet.containsAttrib(SearchApplicant.SINGLEREFERENCE_Job))
{ {
// We will need to retrieve it // We will need to retrieve it
...@@ -165,10 +170,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -165,10 +170,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " + "UPDATE {PREFIX}it_does_not_matter " +
"SET xxxx = ?, xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET xxxx = ?, xxxx = ?, xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (HELPER_Filter.getForSQL(dummyFilter, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Filter))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -403,6 +408,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -403,6 +408,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE")); it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(SearchApplicant.FIELD_Details, HELPER_Details.getFromRS(dummyDetails, r, "xxxx")); it_does_not_matterPSet.setAttrib(SearchApplicant.FIELD_Details, HELPER_Details.getFromRS(dummyDetails, r, "xxxx"));
it_does_not_matterPSet.setAttrib(SearchApplicant.FIELD_Filter, HELPER_Filter.getFromRS(dummyFilter, r, "xxxx"));
it_does_not_matterPSet.setAttrib(SearchApplicant.SINGLEREFERENCE_Job, r.getObject ("xxxx")); it_does_not_matterPSet.setAttrib(SearchApplicant.SINGLEREFERENCE_Job, r.getObject ("xxxx"));
...@@ -421,10 +427,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr ...@@ -421,10 +427,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " + "INSERT INTO {PREFIX}it_does_not_matter " +
" (xxxx, xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (xxxx, xxxx, xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))) .listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (HELPER_Filter.getForSQL(dummyFilter, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Filter))) .listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED); it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -28,6 +28,7 @@ import performa.chart.RingChart; ...@@ -28,6 +28,7 @@ import performa.chart.RingChart;
import performa.form.LinkedInOAuthLoginFP; import performa.form.LinkedInOAuthLoginFP;
import performa.orm.*; import performa.orm.*;
import performa.orm.types.*; import performa.orm.types.*;
import performa.search.SearchApplicant;
/** /**
* *
...@@ -722,4 +723,58 @@ public class Utils ...@@ -722,4 +723,58 @@ public class Utils
return contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text") 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") || contentType.contains("txt"); || contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") || contentType.contains("text/plain") || contentType.contains("txt");
} }
public static String getApplicantSortingData(SearchApplicant searchApplicant)
{
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("value: [");
if(searchApplicant.getFilter() != null)
{
for(AppFilter filter : searchApplicant.getFilter())
{
if((filter == AppFilter.REQ || (filter.getParentNode() != null && filter.getParentNode() == AppFilter.REQ)) && searchApplicant.getJob().showAssessmentCriteriaSection())
{
sb.append("'").append(filter.getName()).append("' ,");
continue;
}
DiversityQuestion question = searchApplicant.getJob().getQuestionByFilter(filter.getIsRoot() ? filter : filter.getParentNode());
if(question != null)
{
sb.append("'").append(filter.getName()).append("' ,");
}
}
}
sb.append("],");
sb.append("options: [");
for(AppFilter appFilter : AppFilter.getAppFilterArray())
{
DiversityQuestion question = searchApplicant.getJob().getQuestionByFilter(appFilter);
if((!appFilter.getIsRoot() || question == null) && (appFilter != AppFilter.REQ || (appFilter == AppFilter.REQ && !searchApplicant.getJob().showAssessmentCriteriaSection())))
{
continue;
}
sb.append("{ id: '").append(appFilter.getName()).append("',");
sb.append("label: '").append(appFilter.getDescription()).append("',");
sb.append("children: [");
for(AppFilter child : appFilter.getChildNodes())
{
sb.append("{id:'").append(child.getName()).append("', label:'").append(child.getDescription()).append("'},");
}
sb.append("]").append("},");
}
sb.append("]").append("}");
return sb.toString();
}
} }
\ No newline at end of file
...@@ -7,9 +7,11 @@ import oneit.utils.CollectionUtils; ...@@ -7,9 +7,11 @@ import oneit.utils.CollectionUtils;
import javax.servlet.http.*; import javax.servlet.http.*;
import oneit.business.content.jsp.*; import oneit.business.content.jsp.*;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.servlets.jsp.EnumSetDIH;
import oneit.servlets.jsp.ORMSimpleAssocTag; import oneit.servlets.jsp.ORMSimpleAssocTag;
import oneit.servlets.orm.DataInputHandler; import oneit.servlets.orm.DataInputHandler;
import oneit.servlets.orm.DataMap; import oneit.servlets.orm.DataMap;
import oneit.utils.EnumeratedFactory;
public class WebUtils public class WebUtils
...@@ -96,6 +98,14 @@ public class WebUtils ...@@ -96,6 +98,14 @@ public class WebUtils
} }
public static String getEnumSetKey(HttpServletRequest request, BaseBusinessClass bbc, String attributeName, EnumeratedFactory factory)
{
DataMap dataMap = DataMap.getDataMap (request, true);
EnumSetDIH eih = new EnumSetDIH(bbc, attributeName, factory);
return dataMap.storeORMHandler (eih, bbc, attributeName);
}
public static boolean descendsFrom (Article article, String parentArticleIdFilter) public static boolean descendsFrom (Article article, String parentArticleIdFilter)
{ {
if (article.getIdentifier ().equals (parentArticleIdFilter)) if (article.getIdentifier ().equals (parentArticleIdFilter))
......
...@@ -2992,6 +2992,23 @@ a.forgot-pass { ...@@ -2992,6 +2992,23 @@ a.forgot-pass {
.shorting-dropdown .form-control { .shorting-dropdown .form-control {
height: 45px; height: 45px;
} }
.appli-list-shorting .shorting-dropdown.showing{
width: 400px;
}
.vue-treeselect__control{
height: 45px !important;
}
.vue-treeselect__placeholder, .vue-treeselect__single-value {
top: 5px !important;
}
.filter-icon-btn {
display: block;
position: absolute;
background: url('../images/filter-icon.png') no-repeat center center;
width: 45px;
height: 45px;
cursor: pointer;
}
.search-input { .search-input {
background-color: rgba(255,255,255,0.5); background-color: rgba(255,255,255,0.5);
padding-right: 40px; padding-right: 40px;
...@@ -4450,6 +4467,22 @@ no-applicant.inactive a:hover,no-applicant.inactive a:hover span{ ...@@ -4450,6 +4467,22 @@ no-applicant.inactive a:hover,no-applicant.inactive a:hover span{
.appli-list-name.wider-box { .appli-list-name.wider-box {
width: 37%; width: 37%;
} }
.appli-list-name.wider-box.include-diversity {
width: 34%;
}
.appli-l.eq-second-height.diversity {
color: #4a4a4a;
font-size: 11px;
letter-spacing: 1px;
padding: 26px 10px 5px;
text-transform: uppercase;
}
.diversity .checkbox-list>label{
text-align: center;
}
.diversity .checkbox-list input[type="checkbox"]:disabled + label {
opacity: 1;
}
.appli-jcs { .appli-jcs {
color: #4a4a4a; color: #4a4a4a;
font-size: 11px; font-size: 11px;
...@@ -4554,6 +4587,9 @@ no-applicant.inactive a:hover,no-applicant.inactive a:hover span{ ...@@ -4554,6 +4587,9 @@ no-applicant.inactive a:hover,no-applicant.inactive a:hover span{
padding: 15px 23px 0; padding: 15px 23px 0;
width: 15%; width: 15%;
} }
.appli-status.include-diversity {
width: 10%;
}
.appli-list-drop{ .appli-list-drop{
float: left; float: left;
width: 100%; width: 100%;
...@@ -7692,6 +7728,62 @@ input{ ...@@ -7692,6 +7728,62 @@ input{
} }
/* /*
Start of Diversity Popup
*/
.diversity-popup{
border-radius: 4px;
background-color: #ffffff;
box-shadow: 0 0 30px 5px rgba(0, 0, 0, 0.2);
/*border: 1px solid #e8e8eb;*/
width: 55%;
height:500px;
margin: 0 auto;
text-align: center;
padding: 0;
margin-top: 150px;
}
.diversity-popup .nav-tabs{
background: #4E5258;
}
.modal-dialog.diversity{
width:100%;
}
.diversity-popup .header-bar{
background: #4E5258;
height:40px;
}
.diversity-popup .header-bar .heading{
float:left;
color:#ffffff;
font-size: 20px;
padding: 5px 20px;
}
.diversity-popup button.close{
color: #F5F7F8;
padding: 10px 20px;
opacity: 1;
}
.diversity-popup .questions{
padding-top: 40px;
}
.diversity-popup .question>label{
float:left;
padding-left: 40px;
}
.diversity-popup .question-seperator{
padding-bottom: 40px;
}
.diversity-popup .answer>span{
float:left;
padding-left: 80px;
padding-top: 10px;
}
/*
End of Diversity Popup
*/
/*
Start of CV Cover Letter Popup Start of CV Cover Letter Popup
*/ */
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
</NODE> </NODE>
<NODE name="dynamic_content_form::ADMIN_PORTAL" factory="Participant"> <NODE name="dynamic_content_form::ADMIN_PORTAL" factory="Participant">
<FORM name="*.changeDiversity" factory="Participant" class="performa.form.ChangeDiversityFP"/>
<FORM name="*.changeAssessmentCriteria" factory="Participant" class="performa.form.ChangeAssessmentCriteriaFP"/> <FORM name="*.changeAssessmentCriteria" factory="Participant" class="performa.form.ChangeAssessmentCriteriaFP"/>
<FORM name="*.changeCultureCriteria" factory="Participant" class="performa.form.ChangeCultureCriteriaFP"/> <FORM name="*.changeCultureCriteria" factory="Participant" class="performa.form.ChangeCultureCriteriaFP"/>
<FORM name="*.saveJob" factory="Participant" class="performa.form.SaveJobFP"/> <FORM name="*.saveJob" factory="Participant" class="performa.form.SaveJobFP"/>
......
...@@ -168,6 +168,21 @@ ...@@ -168,6 +168,21 @@
<oneit:toString value="<%= job.getRequireCV() ? "Yes" : "No" %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getRequireCV() ? "Yes" : "No" %>" mode="EscapeHTML"/>
</div> </div>
</div> </div>
<%
if(job.getHiringTeam().showHasDiversity())
{
%>
<div class="form-group row">
<div class="col-md-4">
<label><oneit:label GUIName="Will the Diversity module be used for this Job?" /></label>
</div>
<div class="col-md-8">
<oneit:toString value="<%= job.getDiversityIncluded() ? "Yes" : "No" %>" mode="EscapeHTML"/>
</div>
</div>
<%
}
%>
<div class="form-brack-line-sub"></div> <div class="form-brack-line-sub"></div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-4"> <div class="col-md-4">
......
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
<oneit:ormInput obj="<%= template %>" id="require-cv" attributeName="RequireCV" type="checkbox"/> <oneit:ormInput obj="<%= template %>" id="require-cv" attributeName="RequireCV" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="template.getRequireCV() != null && template.getRequireCV() ? 'checked': 'unchecked'" template="<%= template %>"> <oneit:recalcClass htmlTag="span" classScript="template.getRequireCV() != null && template.getRequireCV() ? 'checked': 'unchecked'" template="<%= template %>">
<label for="require-cv"> <label for="require-cv">
<oneit:label GUIName="Require CV and Cover Letter from Candidate" /> <oneit:label GUIName="Require CV and Cover Letter from Applicant?" />
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()}, new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST}); new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
HiringTeam hiringTeam = job.getHiringTeam(); HiringTeam hiringTeam = job.getHiringTeam();
String keyName = WebUtils.getEnumSetKey(request, searchApplicant, SearchApplicant.FIELD_Filter, AppFilter.FACTORY_AppFilter);
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
...@@ -41,6 +42,13 @@ ...@@ -41,6 +42,13 @@
$('.checkbox-list input:checkbox').not(this).prop('checked', this.checked); $('.checkbox-list input:checkbox').not(this).prop('checked', this.checked);
enableBulkEdit(); enableBulkEdit();
}); });
Vue.component('treeselect', VueTreeselect.Treeselect)
new Vue({
el: '#app',
data: <%= Utils.getApplicantSortingData(searchApplicant)%>
});
}); });
function enableBulkEdit() { function enableBulkEdit() {
...@@ -52,6 +60,9 @@ ...@@ -52,6 +60,9 @@
$('.search-icon-btn').click(function () { $('.search-icon-btn').click(function () {
$('.search-real-btn').click(); $('.search-real-btn').click();
}); });
$('.filter-icon-btn').click(function () {
$('.search-real-btn').click();
});
}); });
</script> </script>
<div class="main-applicants-filter"> <div class="main-applicants-filter">
...@@ -130,25 +141,22 @@ ...@@ -130,25 +141,22 @@
</div> </div>
<% <%
} }
%>
<div class="shorting-dropdown"> if(job.hasDiversityQuestions() || job.showAssessmentCriteriaSection())
<span class="appli-order-label">Showing</span>
<select class="form-control status-img" onChange="location=this.value">
<%
for (ApplicationFilter applicationFilter : ApplicationFilter.getApplicationFilterArray())
{ {
String optionLink = applicantsPage + "&ApplicationFilter=" + applicationFilter.getName();
%> %>
<option data-image="images/<%= applicationFilter.getName().toLowerCase() %>.png" <%= (appFilter != null && appFilter == applicationFilter ? "selected" : "" )%> value="<%= optionLink %>"> <div class="shorting-dropdown showing">
<oneit:toString value="<%= applicationFilter.getDescription() %>" mode="EscapeHTML"/> <span class="appli-order-label">Showing</span>
</option> <div id="app" style="float:left; width:80%;">
<% <treeselect name="<%= keyName %>" v-model="value" :multiple="true" :options="options" />
} </div>
%> <div style="float:right; width:20%;">
</select> <span class="filter-icon-btn" ></span>
</div>
</div> </div>
<% <%
} }
}
%> %>
</div> </div>
<div class="checkbox-list select-all"> <div class="checkbox-list select-all">
...@@ -156,5 +164,4 @@ ...@@ -156,5 +164,4 @@
<label for="select_all" class="select-all-jobs">&nbsp;&nbsp;Select all applicants</label> <label for="select_all" class="select-all-jobs">&nbsp;&nbsp;Select all applicants</label>
</div> </div>
</div> </div>
</oneit:dynIncluded> </oneit:dynIncluded>
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
<%@include file="/hotjar.jsp" %> <%@include file="/hotjar.jsp" %>
<%@page import="oneit.servlets.portability.BrowserServices"%> <%@page import="oneit.servlets.portability.BrowserServices"%>
<!--filter on applicant list-->
<script src="https://cdn.jsdelivr.net/npm/vue@^2"></script>
<script src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@0.0.38/dist/vue-treeselect.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@0.0.38/dist/vue-treeselect.min.css">
<!-- Google Tag Manager --> <!-- Google Tag Manager -->
<script> <script>
dataLayer = [{ dataLayer = [{
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()}, new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST}); new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
HiringTeam hiringTeam = job.getHiringTeam(); HiringTeam hiringTeam = job.getHiringTeam();
boolean hasDiversity = job.hasDiversityQuestions();
String hasDiversityCss = hasDiversity ? "include-diversity" : "";
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
...@@ -75,7 +77,7 @@ ...@@ -75,7 +77,7 @@
<label for="<%= appID %>"></label> <label for="<%= appID %>"></label>
</div> </div>
</div> </div>
<div class="appli-list-name appli-l eq-second-height wider-box"> <div class="appli-list-name appli-l eq-second-height wider-box <%= hasDiversityCss %>">
<% <%
if(!hiringTeam.isTrue(hiringTeam.getOnTrial()) || j < 2) if(!hiringTeam.isTrue(hiringTeam.getOnTrial()) || j < 2)
{ {
...@@ -203,7 +205,21 @@ ...@@ -203,7 +205,21 @@
</span> </span>
role fit role fit
</div> </div>
<div class="appli-status appli-l eq-second-height"> <%
if(hasDiversity)
{
%>
<div class="appli-l eq-second-height diversity">
<div class="checkbox-list">
<input type="checkbox" name="DiversityComplete" <%= jobApplication.diversityCompleted() ? "checked" : "" %> id="<%= appID + "_diversity" %>" class="applicant" disabled>
<label for="<%= appID + "_diversity" %>"></label>
</div>
diversity
</div>
<%
}
%>
<div class="appli-status appli-l eq-second-height <%= hasDiversityCss %>">
<% <%
if(jobApplication.getApplicationStatus() == ApplicationStatus.DRAFT) if(jobApplication.getApplicationStatus() == ApplicationStatus.DRAFT)
{ {
......
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
function previewCV(){ function previewCV(){
$('#pdfPreview').modal('show'); $('#pdfPreview').modal('show');
} }
function previewDiversity(){
$('#diversityPreview').modal('show');
}
</script> </script>
<div class="main-applicant-content dashboard-content-area v-applicant-area "> <div class="main-applicant-content dashboard-content-area v-applicant-area ">
<div class="applicant-header"> <div class="applicant-header">
...@@ -112,6 +116,15 @@ ...@@ -112,6 +116,15 @@
</div> </div>
<div class="main-export"> <div class="main-export">
<% <%
if(jobApplication.isDiversityIncluded())
{
%>
<a href="#" class="btn cv-cover-letter" onclick="previewDiversity()">
Diversity
</a>
<%
}
if((onTrial && isVisible) || !onTrial) if((onTrial && isVisible) || !onTrial)
{ {
if(jobApplication.getCV() != null && jobApplication.getCoverLetter() != null) if(jobApplication.getCV() != null && jobApplication.getCoverLetter() != null)
...@@ -770,4 +783,50 @@ ...@@ -770,4 +783,50 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="diversityPreview" role="dialog">
<div class="modal-dialog diversity">
<div class="modal-body diversity-popup">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<div class="header-bar">
<div class="heading">Diversity Questions</div>
</div>
<div class="container questions">
<%
for(HTDiversityQuestion question : job.getDiversityQuestions())
{
%>
<div class="question-seperator">
<div class="row">
<div class="col-md-12 question">
<label>Q. <oneit:toString value="<%= question.getQuestionText() %>" mode="EscapeHTML"/></label>
</div>
</div>
<%
DiversityQuestion originalQuestion = question.getQuestion();
CandidateDiversityAnswer candidateAnswer = candidate.getDiversityAnswerByQuestion(originalQuestion);
if(candidateAnswer != null)
{
for(AnswerOption answer : candidateAnswer.getAnswersSet())
{
%>
<div class="row">
<div class="col-md-12 answer">
<oneit:toString value="<%= answer.getAnswer().getAnswer() %>" mode="EscapeHTML"/>
</div>
</div>
<%
}
}
%>
</div>
<%
}
%>
</div>
</div>
</div>
</div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
...@@ -427,13 +427,34 @@ ...@@ -427,13 +427,34 @@
<oneit:ormInput obj="<%= job %>" id="require-cv" attributeName="RequireCV" type="checkbox"/> <oneit:ormInput obj="<%= job %>" id="require-cv" attributeName="RequireCV" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="job.getRequireCV() != null && job.getRequireCV() ? 'checked': 'unchecked'" job="<%= job %>"> <oneit:recalcClass htmlTag="span" classScript="job.getRequireCV() != null && job.getRequireCV() ? 'checked': 'unchecked'" job="<%= job %>">
<label for="require-cv"> <label for="require-cv">
<oneit:label GUIName="Require CV and Cover Letter from Candidate" /> <oneit:label GUIName="Require CV and Cover Letter from Applicant?" />
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<%
if(job.getHiringTeam().showHasDiversity())
{
%>
<div class="form-group row">
<div class="col-md-12">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= job %>" id="diversity-included" attributeName="DiversityIncluded" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="job.getDiversityIncluded() != null && job.getDiversityIncluded() ? 'checked': 'unchecked'" job="<%= job %>">
<label for="diversity-included">
<oneit:label GUIName="Will the Diversity module be used for this Job?" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
</div>
<%
}
%>
</div> </div>
<div class="form-page-section darkbg"> <div class="form-page-section darkbg">
<div class="form-group row"> <div class="form-group row">
......
...@@ -206,6 +206,23 @@ ...@@ -206,6 +206,23 @@
</span> </span>
</div> </div>
</div> </div>
<%
if(job.getHiringTeam().showHasDiversity())
{
%>
<div class="row">
<div class="col-md-4 review-medium-title">
<oneit:label GUIName="Will the Diversity module be used for this Job?" />
</div>
<div class="col-md-8">
<span class="skill-label">
<oneit:toString value="<%= job.getDiversityIncluded() ? "Yes" : "No" %>" mode="EscapeHTML" />
</span>
</div>
</div>
<%
}
%>
</div> </div>
<div class="form-brack-line-sub"></div> <div class="form-brack-line-sub"></div>
<div class="form-group job-detail-subsection"> <div class="form-group job-detail-subsection">
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_candidate_diversity_answer</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_id" type="Long" length="11" nullable="false"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_candidate_diversity_answer" indexName="idx_tl_candidate_diversity_answer_candidate_id" isUnique="false">
<column name="candidate_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_diversity_answer</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="answer" type="CLOB" nullable="false"/>
<column name="question_id" type="Long" length="11" nullable="false"/>
<column name="answer_code" type="CLOB" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_diversity_answer" indexName="idx_tl_diversity_answer_question_id" isUnique="false">
<column name="question_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_diversity_question</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_code" type="CLOB" nullable="false"/>
<column name="question_text" type="CLOB" nullable="false"/>
<column name="australia_only" type="Boolean" nullable="true"/>
<column name="multiple_answers" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_ht_diversity_question</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="question_text" type="CLOB" nullable="false"/>
<column name="is_applicable" type="Boolean" nullable="true"/>
<column name="question_id" type="Long" length="11" nullable="false"/>
<column name="hiring_team_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_ht_diversity_question" indexName="idx_tl_ht_diversity_question_hiring_team_id" isUnique="false">
<column name="hiring_team_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_hiring_team</tableName>
<column name="has_diversity" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
UPDATE tl_hiring_team SET has_diversity = 'N';
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_job</tableName>
<column name="diversity_included" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
UPDATE tl_job SET diversity_included = 'N';
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_answer_option</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="is_selected" type="Boolean" nullable="true"/>
<column name="candidate_answer_id" type="Long" length="11" nullable="false"/>
<column name="answer_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_answer_option" indexName="idx_tl_answer_option_candidate_answer_id" isUnique="false">
<column name="candidate_answer_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
applications = (JobApplication[]) searchApplicant.doSearch(); applications = (JobApplication[]) searchApplicant.doSearch();
} }
if (getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS) != null) // if (getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS) != null)
{ // {
applications = (JobApplication[])getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS); // applications = (JobApplication[])getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS);
} // }
process.setAttribute("JobApplications", applications); process.setAttribute("JobApplications", applications);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/> <FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/>
<FORM name="*.saveAndExitCulture" factory="Participant" class="performa.form.SaveAndExitCultureFP"/> <FORM name="*.saveAndExitCulture" factory="Participant" class="performa.form.SaveAndExitCultureFP"/>
<FORM name="*.saveAndExitWorkStyle" factory="Participant" class="performa.form.SaveAndExitWorkStypeFP"/> <FORM name="*.saveAndExitWorkStyle" factory="Participant" class="performa.form.SaveAndExitWorkStypeFP"/>
<FORM name="*.saveDiversityAnswers" factory="Participant" class="performa.form.SaveDiversityAnswersFP"/>
<FORM name="*.sendVerificationMail" factory="Participant" class="performa.form.SendVerificationMailFP"> <FORM name="*.sendVerificationMail" factory="Participant" class="performa.form.SendVerificationMailFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountVerificationMail"/> <AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountVerificationMail"/>
</FORM> </FORM>
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/> <RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/>
<RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/> <RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/>
<RenderMode name="DiversityQuestions" preIncludeJSP="extensions/applicantportal/diversity_questions.jsp"/>
<RenderMode name="MaskedIdentity" preIncludeJSP="extensions/applicantportal/masked_identity.jsp"/> <RenderMode name="MaskedIdentity" preIncludeJSP="extensions/applicantportal/masked_identity.jsp"/>
<RenderMode name="VerificationSent" preIncludeJSP="extensions/applicantportal/verification_sent.jsp"/> <RenderMode name="VerificationSent" preIncludeJSP="extensions/applicantportal/verification_sent.jsp"/>
<RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/> <RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
......
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