Commit a8397870 by Harsh Shah

Finish Feature-20190308

parents a049e0d3 fbe17313
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<column name="client_id" type="Long" length="11" nullable="true"/> <column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/> <column name="company_user_id" type="Long" length="11" nullable="true"/>
<column name="job_title_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE>
......
<?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_attachment</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="attachment_name" type="String" nullable="true" length="100"/>
<column name="attachment_file" type="BLOB" nullable="true"/>
<column name="email_message_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_attachment" indexName="idx_tl_attachment_email_message_id" isUnique="false"><column name="email_message_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
<column name="verification_mail_send_date" type="Date" nullable="true"/> <column name="verification_mail_send_date" type="Date" nullable="true"/>
<column name="verification_key" type="String" nullable="true" length="10"/> <column name="verification_key" type="String" nullable="true" length="10"/>
<column name="is_account_verified" type="Boolean" nullable="true"/> <column name="is_account_verified" type="Boolean" nullable="true"/>
<column name="is_password_changed" type="Boolean" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/> <column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="is_email_ingest" type="Boolean" nullable="true"/>
<column name="is_masked_email" type="Boolean" nullable="true"/>
<column name="known_as_alias" type="String" nullable="true" length="100"/>
<column name="test_input_id" type="Long" length="11" nullable="true"/> <column name="test_input_id" type="Long" length="11" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/> <column name="user_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
<?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_email_message</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="message_id" type="String" nullable="true" length="1000"/>
<column name="email_from" type="String" nullable="false" length="500"/>
<column name="email_to" type="String" nullable="false" length="500"/>
<column name="email_cc" type="String" nullable="true" length="500"/>
<column name="subject" type="String" nullable="true" length="1000"/>
<column name="description" type="CLOB" nullable="true"/>
<column name="received_date" type="Date" nullable="false"/>
<column name="job_id" type="Long" length="11" 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_ilo_job_title</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="job_title" type="String" nullable="true" length="200"/>
<column name="occupation_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<column name="occupation_id" type="Long" length="11" nullable="false"/> <column name="occupation_id" type="Long" length="11" nullable="false"/>
<column name="shortened_url_id" type="Long" length="11" nullable="true"/> <column name="shortened_url_id" type="Long" length="11" nullable="true"/>
<column name="template_id" type="Long" length="11" nullable="true"/> <column name="template_id" type="Long" length="11" nullable="true"/>
<column name="job_title_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE>
......
<?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_message_template</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="template_name" type="String" nullable="false" length="200"/>
<column name="subject" type="String" nullable="false" length="200"/>
<column name="application_status" type="String" nullable="false" length="200"/>
<column name="delay_hrs" type="Long" nullable="true"/>
<column name="delay_min" type="Long" nullable="true"/>
<column name="variance" type="Long" nullable="true"/>
<column name="business_hours_only" type="Boolean" nullable="true"/>
<column name="message_content" type="CLOB" nullable="false"/>
</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_scheduled_email</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="subject" type="String" nullable="false" length="200"/>
<column name="scheduled_date" type="Date" nullable="false"/>
<column name="application_status" type="String" nullable="false" length="200"/>
<column name="message_content" type="CLOB" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
<column name="message_template_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_scheduled_email" indexName="idx_tl_scheduled_email_job_application_id" isUnique="false"><column name="job_application_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">it_does_not_matter</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"/>
</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_sent_email</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="subject" type="String" nullable="false" length="200"/>
<column name="sent_date" type="Date" nullable="false"/>
<column name="application_status" type="String" nullable="false" length="200"/>
<column name="message_content" type="CLOB" nullable="false"/>
<column name="email_to" type="CLOB" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_sent_email" indexName="idx_tl_sent_email_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -26,7 +26,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -26,7 +26,8 @@ CREATE TABLE tl_assessment_template (
job_id numeric(12) NULL, job_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- DROP TABLE tl_attachment;
CREATE TABLE tl_attachment (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
attachment_name varchar(100) NULL,
attachment_file image NULL,
email_message_id numeric(12) NULL
);
ALTER TABLE tl_attachment ADD
CONSTRAINT PK_tl_attachment PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_attachment_email_message_id
ON tl_attachment (email_message_id);
...@@ -14,7 +14,11 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -14,7 +14,11 @@ CREATE TABLE oneit_sec_user_extension (
verification_mail_send_date datetime NULL, verification_mail_send_date datetime NULL,
verification_key varchar(10) NULL, verification_key varchar(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
is_password_changed char(1) NULL,
google_address_text varchar(300) NULL, google_address_text varchar(300) NULL,
is_email_ingest char(1) NULL,
is_masked_email char(1) NULL,
known_as_alias varchar(100) NULL,
test_input_id numeric(12) NULL, test_input_id numeric(12) NULL,
user_id numeric(12) NULL user_id numeric(12) NULL
); );
......
-- DROP TABLE tl_email_message;
CREATE TABLE tl_email_message (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
message_id varchar(1000) NULL,
email_from varchar(500) NOT NULL,
email_to varchar(500) NOT NULL,
email_cc varchar(500) NULL,
subject varchar(1000) NULL,
description text NULL,
received_date datetime NOT NULL,
job_id numeric(12) NULL
);
ALTER TABLE tl_email_message ADD
CONSTRAINT PK_tl_email_message PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
job_title varchar(200) NULL,
occupation_id numeric(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT PK_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -40,7 +40,8 @@ CREATE TABLE tl_job ( ...@@ -40,7 +40,8 @@ CREATE TABLE tl_job (
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL, shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL template_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- DROP TABLE tl_message_template;
CREATE TABLE tl_message_template (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
delay_hrs numeric(12) NULL,
delay_min numeric(12) NULL,
variance numeric(12) NULL,
business_hours_only char(1) NULL,
message_content text NOT NULL
);
ALTER TABLE tl_message_template ADD
CONSTRAINT PK_tl_message_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_scheduled_email;
CREATE TABLE tl_scheduled_email (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
subject varchar(200) NOT NULL,
scheduled_date datetime NOT NULL,
application_status varchar(200) NOT NULL,
message_content text NOT NULL,
job_application_id numeric(12) NOT NULL,
message_template_id numeric(12) NULL
);
ALTER TABLE tl_scheduled_email ADD
CONSTRAINT PK_tl_scheduled_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_scheduled_email_job_application_id
ON tl_scheduled_email (job_application_id);
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_sent_email;
CREATE TABLE tl_sent_email (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
subject varchar(200) NOT NULL,
sent_date datetime NOT NULL,
application_status varchar(200) NOT NULL,
message_content text NOT NULL,
email_to text NOT NULL,
job_application_id numeric(12) NOT NULL
);
ALTER TABLE tl_sent_email ADD
CONSTRAINT PK_tl_sent_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_sent_email_job_application_id
ON tl_sent_email (job_application_id);
...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template (
job_id number(12) NULL, job_id number(12) NULL,
client_id number(12) NULL, client_id number(12) NULL,
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
company_user_id number(12) NULL company_user_id number(12) NULL,
job_title_id number(12) NULL
); );
......
-- DROP TABLE tl_attachment;
CREATE TABLE tl_attachment (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
attachment_name varchar2(100) NULL,
attachment_file blob NULL,
email_message_id number(12) NULL
);
ALTER TABLE tl_attachment ADD
CONSTRAINT PK_tl_attachment PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_attachment_email_message_id
ON tl_attachment (email_message_id);
...@@ -15,7 +15,11 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -15,7 +15,11 @@ CREATE TABLE oneit_sec_user_extension (
verification_mail_send_date date NULL, verification_mail_send_date date NULL,
verification_key varchar2(10) NULL, verification_key varchar2(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
is_password_changed char(1) NULL,
google_address_text varchar2(300) NULL, google_address_text varchar2(300) NULL,
is_email_ingest char(1) NULL,
is_masked_email char(1) NULL,
known_as_alias varchar2(100) NULL,
test_input_id number(12) NULL, test_input_id number(12) NULL,
user_id number(12) NULL user_id number(12) NULL
); );
......
-- DROP TABLE tl_email_message;
CREATE TABLE tl_email_message (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
message_id varchar2(1000) NULL,
email_from varchar2(500) NOT NULL,
email_to varchar2(500) NOT NULL,
email_cc varchar2(500) NULL,
subject varchar2(1000) NULL,
description clob NULL,
received_date date NOT NULL,
job_id number(12) NULL
);
ALTER TABLE tl_email_message ADD
CONSTRAINT PK_tl_email_message PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
job_title varchar2(200) NULL,
occupation_id number(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT PK_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -41,7 +41,8 @@ CREATE TABLE tl_job ( ...@@ -41,7 +41,8 @@ CREATE TABLE tl_job (
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
occupation_id number(12) NOT NULL, occupation_id number(12) NOT NULL,
shortened_url_id number(12) NULL, shortened_url_id number(12) NULL,
template_id number(12) NULL template_id number(12) NULL,
job_title_id number(12) NULL
); );
......
-- DROP TABLE tl_message_template;
CREATE TABLE tl_message_template (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
template_name varchar2(200) NOT NULL,
subject varchar2(200) NOT NULL,
application_status varchar2(200) NOT NULL,
delay_hrs number(12) NULL,
delay_min number(12) NULL,
variance number(12) NULL,
business_hours_only char(1) NULL,
message_content clob NOT NULL
);
ALTER TABLE tl_message_template ADD
CONSTRAINT PK_tl_message_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_scheduled_email;
CREATE TABLE tl_scheduled_email (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
subject varchar2(200) NOT NULL,
scheduled_date date NOT NULL,
application_status varchar2(200) NOT NULL,
message_content clob NOT NULL,
job_application_id number(12) NOT NULL,
message_template_id number(12) NULL
);
ALTER TABLE tl_scheduled_email ADD
CONSTRAINT PK_tl_scheduled_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_scheduled_email_job_application_id
ON tl_scheduled_email (job_application_id);
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_sent_email;
CREATE TABLE tl_sent_email (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
subject varchar2(200) NOT NULL,
sent_date date NOT NULL,
application_status varchar2(200) NOT NULL,
message_content clob NOT NULL,
email_to clob NOT NULL,
job_application_id number(12) NOT NULL
);
ALTER TABLE tl_sent_email ADD
CONSTRAINT PK_tl_sent_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_sent_email_job_application_id
ON tl_sent_email (job_application_id);
...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template (
job_id numeric(12) NULL, job_id numeric(12) NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- @AutoRun
-- drop table tl_attachment;
CREATE TABLE tl_attachment (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
attachment_name varchar(100) NULL,
attachment_file bytea NULL,
email_message_id numeric(12) NULL
);
ALTER TABLE tl_attachment ADD
CONSTRAINT pk_tl_attachment PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_attachment_email_message_id
ON tl_attachment (email_message_id);
...@@ -15,7 +15,11 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -15,7 +15,11 @@ CREATE TABLE oneit_sec_user_extension (
verification_mail_send_date timestamp NULL, verification_mail_send_date timestamp NULL,
verification_key varchar(10) NULL, verification_key varchar(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
is_password_changed char(1) NULL,
google_address_text varchar(300) NULL, google_address_text varchar(300) NULL,
is_email_ingest char(1) NULL,
is_masked_email char(1) NULL,
known_as_alias varchar(100) NULL,
test_input_id numeric(12) NULL, test_input_id numeric(12) NULL,
user_id numeric(12) NULL user_id numeric(12) NULL
); );
......
-- @AutoRun
-- drop table tl_email_message;
CREATE TABLE tl_email_message (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
message_id varchar(1000) NULL,
email_from varchar(500) NOT NULL,
email_to varchar(500) NOT NULL,
email_cc varchar(500) NULL,
subject varchar(1000) NULL,
description text NULL,
received_date timestamp NOT NULL,
job_id numeric(12) NULL
);
ALTER TABLE tl_email_message ADD
CONSTRAINT pk_tl_email_message PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table tl_ilo_job_title;
CREATE TABLE tl_ilo_job_title (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
job_title varchar(200) NULL,
occupation_id numeric(12) NULL
);
ALTER TABLE tl_ilo_job_title ADD
CONSTRAINT pk_tl_ilo_job_title PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -41,7 +41,8 @@ CREATE TABLE tl_job ( ...@@ -41,7 +41,8 @@ CREATE TABLE tl_job (
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL, shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL template_id numeric(12) NULL,
job_title_id numeric(12) NULL
); );
......
-- @AutoRun
-- drop table tl_message_template;
CREATE TABLE tl_message_template (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
delay_hrs numeric(12) NULL,
delay_min numeric(12) NULL,
variance numeric(12) NULL,
business_hours_only char(1) NULL,
message_content text NOT NULL
);
ALTER TABLE tl_message_template ADD
CONSTRAINT pk_tl_message_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table tl_scheduled_email;
CREATE TABLE tl_scheduled_email (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
subject varchar(200) NOT NULL,
scheduled_date timestamp NOT NULL,
application_status varchar(200) NOT NULL,
message_content text NOT NULL,
job_application_id numeric(12) NOT NULL,
message_template_id numeric(12) NULL
);
ALTER TABLE tl_scheduled_email ADD
CONSTRAINT pk_tl_scheduled_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_scheduled_email_job_application_id
ON tl_scheduled_email (job_application_id);
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table tl_sent_email;
CREATE TABLE tl_sent_email (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
subject varchar(200) NOT NULL,
sent_date timestamp NOT NULL,
application_status varchar(200) NOT NULL,
message_content text NOT NULL,
email_to text NOT NULL,
job_application_id numeric(12) NOT NULL
);
ALTER TABLE tl_sent_email ADD
CONSTRAINT pk_tl_sent_email PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_sent_email_job_application_id
ON tl_sent_email (job_application_id);
package performa.batch;
import java.util.Date;
import javax.activation.DataSource;
import oneit.appservices.batch.ORMBatch;
import oneit.components.InitialisationParticipant;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.Emailer;
import oneit.email.TextDataSource;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.LessThanEqualFilter;
import oneit.utils.InitialisationException;
import oneit.utils.StringUtils;
import oneit.utils.parsers.FieldException;
import performa.orm.JobApplication;
import performa.orm.ScheduledEmail;
import performa.orm.SentEmail;
import performa.orm.types.PlaceholderOptions;
import oneit.net.LoopbackHTTP;
import oneit.utils.RandomStringGen;
import performa.orm.Candidate;
import performa.orm.Job;
import performa.utils.Utils;
public class MessagingEngineBatch extends ORMBatch implements InitialisationParticipant
{
private Emailer emailEngine;
public static LoggingArea MESSAGING_ENGINE_BATCH = LoggingArea.createLoggingArea("MessagingEngineBatch");
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "RUNNING Messaging Engine Batch");
ScheduledEmail[] scheduledEmails = ScheduledEmail.SearchByAll().andScheduledDate(new LessThanEqualFilter<>(new Date())).search(ot);
for (ScheduledEmail scheduledEmail : scheduledEmails)
{
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Starting to create email for scheduled email : " , scheduledEmail);
JobApplication jobApplication = scheduledEmail.getJobApplication();
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
// for existing users without a verification code
if( candidate.getVerificationKey() == null)
{
candidate.setVerificationKey(new RandomStringGen().generateAlphaNum(6));
}
String jobLink = LoopbackHTTP.getRemoteAccessURL()
+ Utils.APPLICANT_LINK
+ "?id=" + job.getID()
+ "&key=" + job.getRandomKey()
+ "&aid=" + candidate.getID()
+ "&pin=" + candidate.getVerificationKey();
// replace tags
String messageContent = StringUtils.replace(scheduledEmail.getMessageContent(),
new String[] {PlaceholderOptions.FIRST_NAME.getPlaceholder(),
PlaceholderOptions.SURNAME.getPlaceholder(),
PlaceholderOptions.EMAIL_ADDRESS.getPlaceholder(),
PlaceholderOptions.LOCATION.getPlaceholder(),
PlaceholderOptions.JOB_TITLE.getPlaceholder(),
PlaceholderOptions.JOB_REFERENCE.getPlaceholder(),
PlaceholderOptions.HIRING_TEAM.getPlaceholder(),
PlaceholderOptions.JOB_LINK.getPlaceholder()},
new String[] {candidate.getFirstName(),
candidate.getUser().getLastName(),
candidate.getUser().getEmail(),
StringUtils.subNulls(job.getGoogleAddressText(), ""),
job.getJobTitle(),
StringUtils.subNulls(job.getReferenceNumber(), ""),
job.getHiringTeam().getHiringTeamName(),
jobLink});
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Replaced tags of message content : " , messageContent);
TextDataSource mesgBodyDataSource = new TextDataSource(messageContent, "text/html", "");
String toEmail = candidate.getUser().getEmail();
String fromEmail = "Matchd<help@matchd.com>";
String replyToEmail = job.getCreatedBy().getUser().getEmail();
SentEmail sentEmail = SentEmail.createSentEmail(ot);
emailEngine.sendEmail(new String[] {toEmail}, fromEmail, new String[] {replyToEmail}, scheduledEmail.getSubject() , new DataSource[]{mesgBodyDataSource});
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Email sent to : " , toEmail, " from : ", fromEmail);
sentEmail.setSubject(scheduledEmail.getSubject());
sentEmail.setSentDate(new Date());
sentEmail.setApplicationStatus(scheduledEmail.getApplicationStatus());
sentEmail.setMessageContent(messageContent);
sentEmail.setEmailTo(toEmail);
sentEmail.setJobApplication(jobApplication);
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "SentEmail object created to store sent email details : " , sentEmail);
scheduledEmail.delete();
}
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "End of Messaging Engine Batch");
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailEngine = (Emailer) context.getSingleChild("EmailEngine");
}
}
\ No newline at end of file
package performa.form; package performa.form;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.logging.*; import oneit.logging.*;
import oneit.objstore.ObjectTransaction; import oneit.objstore.ObjectTransaction;
...@@ -10,6 +8,7 @@ import oneit.objstore.StorageException; ...@@ -10,6 +8,7 @@ import oneit.objstore.StorageException;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.*; import performa.orm.*;
import performa.utils.Utils; import performa.utils.Utils;
...@@ -47,14 +46,10 @@ public class ConfirmDetailsFP extends SaveFP ...@@ -47,14 +46,10 @@ public class ConfirmDetailsFP extends SaveFP
Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate); Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser, " Candidate: " , candidate);
Set<String> attribsToRestore = new HashSet<>(); request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
attribsToRestore.add("Job");
attribsToRestore.add("NewCandidate");
request.setAttribute("attribNamesToRestore", attribsToRestore);
process.setAttribute("NewCandidate",candidate);
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
......
package performa.form;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
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.objstore.ORMFormProcessor;
import oneit.utils.BusinessException;
import performa.utils.PerformaEmailFetcher;
public class RunEmailFetcherFP extends ORMFormProcessor
{
@Override
public SuccessfulResult processForm(ObjectTransaction objTran, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
LogMgr.log(PerformaEmailFetcher.LOG, LogLevel.PROCESSING1, "RunEmailFetcherFP called");
List<String> visitedNodes = new ArrayList<>();
PerformaEmailFetcher.runEmailFetcher(visitedNodes);
submission.getRequest().setAttribute("VisitedNodes", visitedNodes);
return RedisplayResult.getInstance();
}
}
\ No newline at end of file
...@@ -53,6 +53,7 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor ...@@ -53,6 +53,7 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor
{ {
CultureCriteria criteriaCopy = CultureCriteria.createCultureCriteria(newObjTran); CultureCriteria criteriaCopy = CultureCriteria.createCultureCriteria(newObjTran);
criteriaCopy.setIsApplicable(criteria.getIsApplicable());
criteriaCopy.setCultureElement(criteria.getCultureElement().getInTransaction(newObjTran)); criteriaCopy.setCultureElement(criteria.getCultureElement().getInTransaction(newObjTran));
criteriaCopy.setImportance(criteria.getImportance()); criteriaCopy.setImportance(criteria.getImportance());
......
...@@ -110,6 +110,8 @@ public class SaveJobFP extends SaveFP ...@@ -110,6 +110,8 @@ public class SaveJobFP extends SaveFP
// } // }
// } // }
BusinessObjectParser.assertFieldCondition(job.getILOJobTitle() != null , job, Job.SINGLEREFERENCE_ILOJobTitle, "mandatory", exceptions, true, request);
if(status != null && status == JobStatus.OPEN) if(status != null && status == JobStatus.OPEN)
{ {
BusinessObjectParser.assertFieldCondition(billingTeam.getCardID() != null , billingTeam, HiringTeam.FIELD_CardID, "mandatoryCardDetails", exceptions, true, request); BusinessObjectParser.assertFieldCondition(billingTeam.getCardID() != null , billingTeam, HiringTeam.FIELD_CardID, "mandatoryCardDetails", exceptions, true, request);
......
...@@ -60,7 +60,8 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -60,7 +60,8 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor
newTemplate.setOccupation(job.getOccupation().getInTransaction(newObjTran)); newTemplate.setOccupation(job.getOccupation().getInTransaction(newObjTran));
newTemplate.setRequireCV(job.getRequireCV()); newTemplate.setRequireCV(job.getRequireCV());
newTemplate.setAssessmentType(job.getAssessmentType()); newTemplate.setAssessmentType(job.getAssessmentType());
newTemplate.setLevel(job.getLevel().getInTransaction(newObjTran)); // newTemplate.setLevel(job.getLevel().getInTransaction(newObjTran));
newTemplate.setILOJobTitle(job.getILOJobTitle().getInTransaction(newObjTran));
for (WorkFlow workflow : job.getWorkFlowsSet()) for (WorkFlow workflow : job.getWorkFlowsSet())
{ {
...@@ -101,6 +102,7 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -101,6 +102,7 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
BusinessObjectParser.assertFieldCondition(job.getAssessmentTemplateName() != null, job , Job.FIELD_AssessmentTemplateName, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(job.getAssessmentTemplateName() != null, job , Job.FIELD_AssessmentTemplateName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(job.getILOJobTitle() != null , job, Job.SINGLEREFERENCE_ILOJobTitle, "mandatory", exceptions, true, request);
for(AssessmentCriteria criteria: job.getAssessmentCriteriasSet()) for(AssessmentCriteria criteria: job.getAssessmentCriteriasSet())
{ {
......
package performa.form; package performa.form;
import java.util.Date;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.components.ParticipantInitialisationContext; import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer; import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.email.ConfigurableEmailerException;
import oneit.logging.*; import oneit.logging.*;
import oneit.net.LoopbackHTTP;
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;
...@@ -17,9 +13,8 @@ import oneit.servlets.forms.*; ...@@ -17,9 +13,8 @@ import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.*; import performa.orm.*;
import performa.orm.types.RoleType; import performa.orm.types.*;
import performa.utils.Utils; import performa.utils.Utils;
import performa.utils.WebUtils;
public class SendVerificationMailFP extends SaveFP public class SendVerificationMailFP extends SaveFP
...@@ -62,13 +57,14 @@ public class SendVerificationMailFP extends SaveFP ...@@ -62,13 +57,14 @@ public class SendVerificationMailFP extends SaveFP
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getPrivacyPolicyAgreed()), candidate, Candidate.FIELD_PrivacyPolicyAgreed, "agreePrivacy", exceptions, true, request); BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getPrivacyPolicyAgreed()), candidate, Candidate.FIELD_PrivacyPolicyAgreed, "agreePrivacy", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getConditionsAgreed()), candidate, Candidate.FIELD_ConditionsAgreed, "agreeTerms", exceptions, true, request); BusinessObjectParser.assertFieldCondition(candidate.isTrue(candidate.getConditionsAgreed()), candidate, Candidate.FIELD_ConditionsAgreed, "agreeTerms", exceptions, true, request);
// BusinessObjectParser.assertFieldCondition(secUser.checkPassword(job.getPassword()), job, Job.FIELD_Password, "invalid", exceptions, true, request);
if(job.getRequireCV()) if(job.getRequireCV())
{ {
BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "uploadCV", exceptions, true, request); BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "uploadCV", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "uploadCover", exceptions, true, request); BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "uploadCover", 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);
} }
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
...@@ -83,6 +79,7 @@ public class SendVerificationMailFP extends SaveFP ...@@ -83,6 +79,7 @@ public class SendVerificationMailFP extends SaveFP
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
Candidate candidate = (Candidate) request.getAttribute("Candidate"); Candidate candidate = (Candidate) request.getAttribute("Candidate");
Company company = (Company) request.getAttribute("Company"); Company company = (Company) request.getAttribute("Company");
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
if(company != null) if(company != null)
{ {
...@@ -127,68 +124,57 @@ public class SendVerificationMailFP extends SaveFP ...@@ -127,68 +124,57 @@ public class SendVerificationMailFP extends SaveFP
companyUser.getDefaultHiringTeam().setHiringTeamName(company.getCompanyName()); companyUser.getDefaultHiringTeam().setHiringTeamName(company.getCompanyName());
} }
Utils.sendVerificationMail(companyUser, request, emailer, SendVerificationMailFP.class.getName()); Utils.sendVerificationMail(job, companyUser, request, emailer, SendVerificationMailFP.class.getName());
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending varification email.", companyUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending varification email.", companyUser);
} }
else else
{ {
sendVerificationMail(candidate, job, request); if(candidate.isTrue(candidate.getIsEmailIngest()))
{
request.setAttribute("nextPage", request.getAttribute("nextPage") + "&JobID=" + job.getID()); if(candidate.isTrue(candidate.getIsMaskedEmail()))
} {
SecUser old = (SecUser) candidate.getUser().getEarliestBackup();
return super.processForm(process, submission, params); if(CollectionUtils.equals(old.getEmail(), candidate.getUser().getEmail()))
{
throw new BusinessException("Please enter a valid email address");
} }
//set new verification key as email changed
candidate.setVerificationKey(new RandomStringGen().generateAlphaNum(6));
@Override candidate.getUser().setUserName(candidate.getUser().getEmail());
public void init(ParticipantInitialisationContext context) throws InitialisationException candidate.setIsMaskedEmail(false);
candidate.setKnownAsAlias(old.getEmail());
}
else
{ {
super.init(context); candidate.setIsAccountVerified(true);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer"));
} }
jobApplication.setApplicationStatus(ApplicationStatus.DRAFT);
}
private void sendVerificationMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException if(!candidate.isTrue(candidate.getIsPasswordChanged()))
{
if(!candidate.isTrue(candidate.getIsAccountVerified()))
{ {
try candidate.setIsPasswordChanged(true);
{ }
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending verification mail from SendVerificationMailFP to :: ", candidate);
Article verificationArticle = WebUtils.getArticleByShortCut(candidate.getTransaction(), WebUtils.APPLICANT_ACCOUNT_VERIFICATION);
RandomStringGen random = new RandomStringGen();
//set verification key and send mail time // storing candidate location in application for distance calculation to be accurate even if user edits
candidate.setVerificationKey(random.generateAlphaNum(6)); // location in the next application
candidate.setVerificationMailSendDate(new Date()); jobApplication.setGoogleAddressText(candidate.getGoogleAddressText());
}
String link = LoopbackHTTP.getRemoteAccessURL(request) return super.processForm(process, submission, params);
+ verificationArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/") }
+ "?id=" + job.getID()
+ "&key=" + job.getRandomKey()
+ "&aid=" + candidate.getID()
+ "&pin=" + candidate.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate.getUser());
Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent verification mail successfully from " + SendVerificationMailFP.class + " to :: ", candidate); @Override
} public void init(ParticipantInitialisationContext context) throws InitialisationException
catch (ConfigurableEmailerException ex)
{ {
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for Candidate :: " + candidate); super.init(context);
throw new BusinessException("We are unable to send mail. Please try again or contact Matchd for more details."); emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer"));
}
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Call from " + SendVerificationMailFP.class + ". Account is already verified for candidate :: ", candidate);
}
} }
} }
\ No newline at end of file
...@@ -2,120 +2,38 @@ package performa.form; ...@@ -2,120 +2,38 @@ package performa.form;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.email.ConfigurableEmailerException;
import oneit.logging.*; import oneit.logging.*;
import oneit.net.LoopbackHTTP;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.servlets.security.SessionSecUserDecorator; import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.*; import performa.orm.*;
import performa.utils.Utils;
import performa.utils.WebUtils;
public class VerifyIdentityFP extends SaveFP public class VerifyIdentityFP extends SaveFP
{ {
private static LoggingArea LOG = LoggingArea.createLoggingArea("VerifyIdentity"); private static LoggingArea LOG = LoggingArea.createLoggingArea("VerifyIdentity");
protected ConfigurableArticleTemplateEmailer emailer;
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
{
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication)request.getAttribute("JobApplication");
Candidate candidate = (Candidate) request.getAttribute("Candidate");
SecUser secUser = candidate.getUser();
Boolean isVerify = CollectionUtils.equals(request.getAttribute("isVerify"), Boolean.TRUE);
boolean fromCoverLetter = request.getAttribute("fromCoverLetter") != null ? (boolean) request.getAttribute("fromCoverLetter"): false;
Job job = (Job) request.getAttribute("Job");
if(isVerify)
{
BusinessObjectParser.assertFieldCondition(secUser.checkPassword(job.getPassword()) , job, Job.FIELD_Password, "invalid", exceptions, true, request);
}
if(fromCoverLetter && job.getRequireCV())
{
BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "uploadCV", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "uploadCover", exceptions, true, request);
}
return super.validate(submission, exceptions);
}
@Override @Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Boolean isVerify = CollectionUtils.equals(request.getAttribute("isVerify"), Boolean.TRUE);
Job job = (Job) request.getAttribute("Job");
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
Candidate candidate = (Candidate) request.getAttribute("Candidate"); Candidate candidate = (Candidate) request.getAttribute("Candidate");
if(isVerify) if(candidate.isTrue(candidate.getIsEmailIngest()) && candidate.getKnownAsAlias() == null && !candidate.isTrue(candidate.getIsPasswordChanged()))
{ {
SecUser secUser = candidate.getUser(); request.getSession().setAttribute (SecUser.SEC_USER_ID, candidate.getUser());
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User ", job, secUser);
candidate.setIsAccountVerified(Boolean.TRUE);
sendMail(candidate, job, request);
request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE); request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verified User ", job, secUser);
} }
// storing candidate location in application for distance calculation to be accurate even if user edits if(candidate.isFalse(candidate.getIsMaskedEmail()) && candidate.isFalse(candidate.getIsAccountVerified()))
// location in the next application
jobApplication.setGoogleAddressText(candidate.getGoogleAddressText());
return super.processForm(process, submission, params);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("ApplicantAccountCreatedEmailer"));
}
protected void sendMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException
{
try
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from VerifyIdentityFP to :: ", candidate); candidate.setIsAccountVerified(true);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User ", candidate);
Article applyJobArticle = WebUtils.getArticleByShortCut(candidate.getTransaction(), WebUtils.APPLY_JOB);
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.FORGOT_PASSWORD).toMap(), "/")
+ "&id=" + job.getID()
+ "&key=" + job.getRandomKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate.getUser());
Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent Account Created mail successfully from " + VerifyIdentityFP.class + " to :: ", candidate);
} }
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for Candidate :: " + candidate);
throw new BusinessException("We are unable to send mail. Please try again or contact Matchd for more details."); return super.processForm(process, submission, params);
}
} }
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package performa.orm; ...@@ -3,6 +3,7 @@ package performa.orm;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter; import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter; import oneit.objstore.rdbms.filters.LessThanFilter;
...@@ -11,6 +12,7 @@ import oneit.utils.CollectionUtils; ...@@ -11,6 +12,7 @@ import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform; import oneit.utils.ObjectTransform;
import oneit.utils.filter.CollectionFilter; import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter; import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException;
import performa.orm.types.AssessmentType; import performa.orm.types.AssessmentType;
import performa.orm.types.CriteriaType; import performa.orm.types.CriteriaType;
...@@ -92,4 +94,19 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate ...@@ -92,4 +94,19 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
{ {
return getAssessmentCriteraByType(criteria).size(); return getAssessmentCriteraByType(criteria).size();
} }
@Override
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
super.postILOJobTitleChange();
}
public Occupation displayOccupation()
{
return getOccupation();
}
} }
\ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" /> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" mandatory="false"/>
</TABLE> </TABLE>
......
package performa.orm;
public class Attachment extends BaseAttachment
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public Attachment ()
{
// 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="Attachment" package="performa.orm">
<TABLE name="tl_attachment" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="AttachmentName" type="String" dbcol="attachment_name" length="100" />
<ATTRIB name="AttachmentFile" type="BinaryContent" dbcol="attachment_file" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" binaryHandler="loggedin"/>
<SINGLEREFERENCE name="EmailMessage" type="EmailMessage" dbcol="email_message_id" backreferenceName="Attachments"/>
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -7,6 +7,7 @@ import java.util.Comparator; ...@@ -7,6 +7,7 @@ import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.logging.LoggingArea;
import oneit.objstore.MessageSource; import oneit.objstore.MessageSource;
import oneit.objstore.ObjectTransaction; import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
...@@ -14,9 +15,11 @@ import oneit.objstore.rdbms.filters.IsNotNullFilter; ...@@ -14,9 +15,11 @@ import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.objstore.utils.ObjstoreUtils; import oneit.objstore.utils.ObjstoreUtils;
import oneit.servlets.objstore.MessageSourceDecorator; import oneit.servlets.objstore.MessageSourceDecorator;
import oneit.servlets.process.ORMProcessState; import oneit.servlets.process.ORMProcessState;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils; import oneit.utils.CollectionUtils;
import oneit.utils.DateDiff; import oneit.utils.DateDiff;
import oneit.utils.ObjectTransform; import oneit.utils.ObjectTransform;
import oneit.utils.RandomStringGen;
import oneit.utils.StringUtils; import oneit.utils.StringUtils;
import oneit.utils.filter.*; import oneit.utils.filter.*;
import performa.utils.DistanceUtils; import performa.utils.DistanceUtils;
...@@ -25,6 +28,7 @@ import performa.utils.ExpressAnswerFilter; ...@@ -25,6 +28,7 @@ import performa.utils.ExpressAnswerFilter;
public class Candidate extends BaseCandidate public class Candidate extends BaseCandidate
{ {
public static LoggingArea LOG = LoggingArea.createLoggingArea("Candidate");
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
// This constructor should not be called // This constructor should not be called
...@@ -33,6 +37,16 @@ public class Candidate extends BaseCandidate ...@@ -33,6 +37,16 @@ public class Candidate extends BaseCandidate
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
@Override
protected void postInitNewObj() throws BusinessException
{
RandomStringGen random = new RandomStringGen();
setVerificationKey(random.generateAlphaNum(6));
super.postInitNewObj();
}
public String getFirstName() public String getFirstName()
{ {
...@@ -181,4 +195,9 @@ public class Candidate extends BaseCandidate ...@@ -181,4 +195,9 @@ public class Candidate extends BaseCandidate
Distance calculateDistance = DistanceUtils.calculateDistance(FIELD_Phone, FIELD_Phone); Distance calculateDistance = DistanceUtils.calculateDistance(FIELD_Phone, FIELD_Phone);
return false; return false;
} }
public boolean isUnverifiedEmailIngestUser()
{
return !isTrue(getIsAccountVerified()) && isTrue(getIsEmailIngest());
}
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<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"/>
<TRANSIENT name="HasValidAddress" type="Boolean" defaultValue="Boolean.FALSE"/>
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE"> <TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
...@@ -22,7 +23,11 @@ ...@@ -22,7 +23,11 @@
<ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" /> <ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" />
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/> <ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/> <ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsPasswordChanged" type="Boolean" dbcol="is_password_changed" defaultValue="Boolean.FALSE"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300"/> <ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300"/>
<ATTRIB name="IsEmailIngest" type="Boolean" dbcol="is_email_ingest" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsMaskedEmail" type="Boolean" dbcol="is_masked_email" defaultValue="Boolean.FALSE"/>
<ATTRIB name="KnownAsAlias" type="String" dbcol="known_as_alias" length="100"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates" /> <SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates" />
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/> <SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
...@@ -31,6 +36,10 @@ ...@@ -31,6 +36,10 @@
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" > <SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" >
</SEARCH> </SEARCH>
<SEARCH type="Alias" filter="known_as_alias = ?" polymorphic="TRUE" singleton="TRUE">
<PARAM name="KnownAs" type="String"/>
</SEARCH>
<SEARCH type="IdPin" paramFilter="oneit_sec_user_extension.object_id is not null" singleton="TRUE"> <SEARCH type="IdPin" paramFilter="oneit_sec_user_extension.object_id is not null" singleton="TRUE">
<PARAM name="ID" type="Long" paramFilter="object_id = ${ID} " /> <PARAM name="ID" type="Long" paramFilter="object_id = ${ID} " />
<PARAM name="Pin" type="String" paramFilter="verification_key = ${Pin}" /> <PARAM name="Pin" type="String" paramFilter="verification_key = ${Pin}" />
......
package performa.orm; package performa.orm;
import java.util.HashSet;
import java.util.Set; import java.util.Set;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.IsNotNullFilter; import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.objstore.rdbms.filters.NotEqualsFilter;
import oneit.security.SecUser;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils; import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils; import oneit.utils.StringUtils;
import oneit.utils.filter.Filter; import oneit.utils.filter.Filter;
import oneit.utils.math.NullArith; import oneit.utils.math.NullArith;
import oneit.utils.parsers.FieldException;
import performa.orm.types.JobStatus; import performa.orm.types.JobStatus;
import performa.orm.types.TimeZone;
import performa.utils.Utils; import performa.utils.Utils;
...@@ -178,4 +175,9 @@ public class Company extends BaseCompany ...@@ -178,4 +175,9 @@ public class Company extends BaseCompany
return pipelineCompany().toHiringTeams(filter).uniqueVals(); return pipelineCompany().toHiringTeams(filter).uniqueVals();
} }
public TimeZone getDefaultTimeZone()
{
return pipelineCompany().toHiringTeams().toTimeZone().val();
}
} }
\ No newline at end of file
package performa.orm;
public class EmailMessage extends BaseEmailMessage
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public EmailMessage ()
{
// 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="EmailMessage" package="performa.orm">
<MULTIPLEREFERENCE name="Attachments" type="Attachment" backreferenceName="EmailMessage"/>
<TABLE name="tl_email_message" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="MessageId" type="String" dbcol="message_id" length="1000" />
<ATTRIB name="EmailFrom" type="String" dbcol="email_from" length="500" mandatory="true"/>
<ATTRIB name="EmailTo" type="String" dbcol="email_to" length="500" mandatory="true"/>
<ATTRIB name="EmailCC" type="String" dbcol="email_cc" length="500" />
<ATTRIB name="Subject" type="String" dbcol="subject" length="1000" />
<ATTRIB name="Description" type="String" dbcol="description" />
<ATTRIB name="ReceivedDate" type="Date" dbcol="received_date" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" />
</TABLE>
<SEARCH type="All" paramFilter="tl_email_message.object_id is not null"/>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
public class ILOJobTitle extends BaseILOJobTitle
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public ILOJobTitle ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public String getToString()
{
return StringUtils.subNulls(getJobTitle(), super.getToString());
}
}
<?xml version="1.0"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="ILOJobTitle" package="performa.orm">
<IMPORT value="performa.orm.types.*" />
<TABLE name="tl_ilo_job_title" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="200" />
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" />
</TABLE>
<SEARCH type="All" paramFilter="object_id is not null" orderBy="object_id"/>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -156,7 +156,7 @@ public class Job extends BaseJob ...@@ -156,7 +156,7 @@ public class Job extends BaseJob
public Boolean jobDetailsCompleted() public Boolean jobDetailsCompleted()
{ {
return getJobTitle() != null && getJobDescription() != null && getLevel() != null; return getJobTitle() != null && getJobDescription() != null;
} }
public Boolean jobAssessmentCompleted() public Boolean jobAssessmentCompleted()
...@@ -227,7 +227,7 @@ public class Job extends BaseJob ...@@ -227,7 +227,7 @@ public class Job extends BaseJob
public int getNoOfCandidatesApplied() public int getNoOfCandidatesApplied()
{ {
Filter<JobApplication> filter = JobApplication.SearchByAll().andApplicationStatus(new NotInFilter<>(ApplicationStatus.DRAFT)); Filter<JobApplication> filter = JobApplication.SearchByAll().andApplicationStatus(new NotInFilter<>(ApplicationStatus.DRAFT, ApplicationStatus.POST_INGEST));
return pipelineJob().toJobApplications(filter).toCandidate().vals().size(); return pipelineJob().toJobApplications(filter).toCandidate().vals().size();
} }
...@@ -719,4 +719,19 @@ public class Job extends BaseJob ...@@ -719,4 +719,19 @@ public class Job extends BaseJob
return sb.toString(); return sb.toString();
} }
@Override
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
super.postILOJobTitleChange();
}
public Occupation displayOccupation()
{
return getOccupation();
}
} }
\ No newline at end of file
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/> <SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/>
<SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" /> <SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" />
<SINGLEREFERENCE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" dbcol="template_id" /> <SINGLEREFERENCE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" dbcol="template_id" />
<SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" />
</TABLE> </TABLE>
......
...@@ -17,6 +17,7 @@ import oneit.utils.math.Rounding; ...@@ -17,6 +17,7 @@ import oneit.utils.math.Rounding;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
import performa.chart.RingChart; import performa.chart.RingChart;
import performa.orm.types.*; import performa.orm.types.*;
import performa.orm.types.TimeZone;
import performa.utils.*; import performa.utils.*;
...@@ -31,6 +32,57 @@ public class JobApplication extends BaseJobApplication ...@@ -31,6 +32,57 @@ public class JobApplication extends BaseJobApplication
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
@Override
public void preCommit(boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
JobApplication old = (JobApplication) getEarliestBackup();
// when application status changed
if(getStatus() == ObjectStatus.NEW || !CollectionUtils.equals(old.getApplicationStatus(), getApplicationStatus()))
{
// delete previously scheduled emails for previous application status
Filter<ScheduledEmail> filter = ScheduledEmail.SearchByAll().andApplicationStatus(new EqualsFilter<>(old.getApplicationStatus()));
pipelineJobApplication().toScheduledEmails(filter).uniqueVals().stream().forEach((scheduledEmail) -> {
scheduledEmail.delete();
});
// create scheduled emails for new application status
MessageTemplate[] templates = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(getApplicationStatus())).search(getTransaction());
for(MessageTemplate template : templates)
{
ScheduledEmail scheduledEmail = ScheduledEmail.createScheduledEmail(getTransaction());
Date now = new Date();
int variance = MessagingUtils.randInt(0, template.getVariance());
Date scheduledDate = DateDiff.add(now, Calendar.MINUTE, template.getDelayInMin() + variance);
if(template.getBusinessHoursOnly())
{
TimeZone jobTimeZone = getJob().getHiringTeam().getCompany().getDefaultTimeZone();
Calendar cal = new GregorianCalendar();
cal.setTime(scheduledDate);
scheduledDate = MessagingUtils.getWithinBusinessHours(cal, jobTimeZone != null ? java.util.TimeZone.getTimeZone(jobTimeZone.getTimeZoneCode()) : cal.getTimeZone());
}
scheduledEmail.setScheduledDate(scheduledDate);
scheduledEmail.setSubject(template.getSubject());
scheduledEmail.setMessageContent(template.getMessageContent());
scheduledEmail.setApplicationStatus(getApplicationStatus());
scheduledEmail.setMessageTemplate(template);
addToScheduledEmails(scheduledEmail);
}
}
}
}
public static JobApplication createNewApplication(Candidate candidate, Job job) throws StorageException, FieldException public static JobApplication createNewApplication(Candidate candidate, Job job) throws StorageException, FieldException
{ {
...@@ -53,14 +105,14 @@ public class JobApplication extends BaseJobApplication ...@@ -53,14 +105,14 @@ public class JobApplication extends BaseJobApplication
if(getCV() != null) if(getCV() != null)
{ {
String contentType = getCV().getContentType(); String contentType = getCV().getContentType();
context.check(contentType.contains("msword") || contentType.contains("opendocument.text") context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text")
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CV, "invalid"); || contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CV, "invalid");
} }
if(getCoverLetter() != null) if(getCoverLetter() != null)
{ {
String contentType = getCoverLetter().getContentType(); String contentType = getCoverLetter().getContentType();
context.check(contentType.contains("msword") || contentType.contains("opendocument.text") context.check(contentType.contains("msword") || contentType.contains("doc") || contentType.contains("docx") || contentType.contains("opendocument.text")
|| contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CoverLetter, "invalid"); || contentType.contains("pdf") || contentType.contains("vnd.openxmlformats-officedocument.wordprocessingml.document") , this, FIELD_CoverLetter, "invalid");
} }
} }
...@@ -192,7 +244,7 @@ public class JobApplication extends BaseJobApplication ...@@ -192,7 +244,7 @@ public class JobApplication extends BaseJobApplication
public boolean hasStartedApplication() public boolean hasStartedApplication()
{ {
return getAssessmentCriteriaAnswersCount() > 0 || getCandidate().getCultureCriteriaAnswersCount() > 0; return getJob().getIncludeAssessmentCriteria() ? getAssessmentCriteriaAnswersCount() > 0 : getCandidate().getCultureCriteriaAnswersCount() > 0;
} }
public boolean cultureCompleted() public boolean cultureCompleted()
......
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'> <ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="JobApplication" package="performa.orm"> <BUSINESSCLASS name="JobApplication" package="performa.orm">
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="AssessmentCriteriaAnswers" type="AssessmentCriteriaAnswer" backreferenceName="JobApplication" /> <MULTIPLEREFERENCE name="AssessmentCriteriaAnswers" type="AssessmentCriteriaAnswer" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="Notes" type="Note" backreferenceName="JobApplication" /> <MULTIPLEREFERENCE name="Notes" type="Note" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="ScheduledEmails" type="ScheduledEmail" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="SentEmails" type="SentEmail" backreferenceName="JobApplication" />
<TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/> <TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="OverallRank" type="Integer" /> <TRANSIENT name="OverallRank" type="Integer" />
......
package performa.orm;
public class MessageTemplate extends BaseMessageTemplate
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public MessageTemplate ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
public int getDelayInMin()
{
return (getDelayHrs() * 60) + getDelayMin();
}
@Override
public Integer getVariance()
{
return super.getVariance() != null ? super.getVariance() : 0;
}
@Override
public Integer getDelayHrs()
{
return super.getDelayHrs() != null ? super.getDelayHrs() : 0;
}
@Override
public Integer getDelayMin()
{
return super.getDelayMin() != null ? super.getDelayMin(): 0;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<BUSINESSCLASS name="MessageTemplate" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.*"/>
<TABLE name="tl_message_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="TemplateName" type="String" dbcol="template_name" mandatory="true" length="200" />
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" defaultValue="ApplicationStatus.DRAFT" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="DelayHrs" type="Integer" dbcol="delay_hrs" mandatory="false" defaultValue="0" />
<ATTRIB name="DelayMin" type="Integer" dbcol="delay_min" mandatory="false" defaultValue="0" />
<ATTRIB name="Variance" type="Integer" dbcol="variance" mandatory="false" defaultValue="0" />
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
</TABLE>
<SEARCH type="All" paramFilter="tl_message_template.object_id is not null" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
public class ScheduledEmail extends BaseScheduledEmail
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public ScheduledEmail ()
{
// 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="ScheduledEmail" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="tl_scheduled_email" tablePrefix="object">
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="ScheduledDate" type="Date" dbcol="scheduled_date" mandatory="true" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="ScheduledEmails" mandatory="true"/>
<SINGLEREFERENCE name="MessageTemplate" type="MessageTemplate" dbcol="message_template_id" />
</TABLE>
<SEARCH type="All" paramFilter="tl_scheduled_email.object_id is not null" orderBy="tl_scheduled_email.object_id">
</SEARCH>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
public class SentEmail extends BaseSentEmail
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public SentEmail ()
{
// 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="SentEmail" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="tl_sent_email" tablePrefix="object">
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="SentDate" type="Date" dbcol="sent_date" mandatory="true" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
<ATTRIB name="EmailTo" type="String" dbcol="email_to" mandatory="true" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" backreferenceName="SentEmails" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_scheduled_email.object_id is not null" orderBy="tl_scheduled_email.object_id">
</SEARCH>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -20,6 +20,8 @@ public class ApplicationStatus extends AbstractEnumerated ...@@ -20,6 +20,8 @@ public class ApplicationStatus extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_ApplicationStatus = new ApplicationStatusFactory(); public static final EnumeratedFactory FACTORY_ApplicationStatus = new ApplicationStatusFactory();
public static final ApplicationStatus POST_INGEST = new ApplicationStatus ("POST_INGEST", "POST_INGEST", "Post Ingest", false);
public static final ApplicationStatus DRAFT = new ApplicationStatus ("DRAFT", "DRAFT", "Incomplete", false); public static final ApplicationStatus DRAFT = new ApplicationStatus ("DRAFT", "DRAFT", "Incomplete", false);
public static final ApplicationStatus SUBMITTED = new ApplicationStatus ("SUBMITTED", "SUBMITTED", "Applicant", false); public static final ApplicationStatus SUBMITTED = new ApplicationStatus ("SUBMITTED", "SUBMITTED", "Applicant", false);
...@@ -39,7 +41,7 @@ public class ApplicationStatus extends AbstractEnumerated ...@@ -39,7 +41,7 @@ public class ApplicationStatus extends AbstractEnumerated
public static final ApplicationStatus UNSUITABLE = new ApplicationStatus ("UNSUITABLE", "UNSUITABLE", "Unsuitable", false); public static final ApplicationStatus UNSUITABLE = new ApplicationStatus ("UNSUITABLE", "UNSUITABLE", "Unsuitable", false);
private static final ApplicationStatus[] allApplicationStatuss = private static final ApplicationStatus[] allApplicationStatuss =
new ApplicationStatus[] { DRAFT,SUBMITTED,SHORTLISTED,STATUS_4,STATUS_5,STATUS_6,STATUS_7,STATUS_8,UNSUITABLE}; new ApplicationStatus[] { POST_INGEST,DRAFT,SUBMITTED,SHORTLISTED,STATUS_4,STATUS_5,STATUS_6,STATUS_7,STATUS_8,UNSUITABLE};
private static ApplicationStatus[] getAllApplicationStatuss () private static ApplicationStatus[] getAllApplicationStatuss ()
...@@ -126,6 +128,7 @@ public class ApplicationStatus extends AbstractEnumerated ...@@ -126,6 +128,7 @@ public class ApplicationStatus extends AbstractEnumerated
public static void defineAdditionalData () public static void defineAdditionalData ()
{ {
POST_INGEST.SortOrder = 0;
DRAFT.SortOrder = 1; DRAFT.SortOrder = 1;
SUBMITTED.SortOrder = 2; SUBMITTED.SortOrder = 2;
SHORTLISTED.SortOrder = 3; SHORTLISTED.SortOrder = 3;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<DATA name="SortOrder" type="Integer"/> <DATA name="SortOrder" type="Integer"/>
<VALUE name="POST_INGEST" value="POST_INGEST" description="Post Ingest" SortOrder="0"/>
<VALUE name="DRAFT" value="DRAFT" description="Incomplete" SortOrder="1"/> <VALUE name="DRAFT" value="DRAFT" description="Incomplete" SortOrder="1"/>
<VALUE name="SUBMITTED" value="SUBMITTED" description="Applicant" SortOrder="2"/> <VALUE name="SUBMITTED" value="SUBMITTED" description="Applicant" SortOrder="2"/>
<VALUE name="SHORTLISTED" value="SHORTLISTED" description="Shortlisted" SortOrder="3"/> <VALUE name="SHORTLISTED" value="SHORTLISTED" description="Shortlisted" SortOrder="3"/>
......
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 PlaceholderOptions extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_PlaceholderOptions = new PlaceholderOptionsFactory();
public static final PlaceholderOptions FIRST_NAME = new PlaceholderOptions ("FIRST_NAME", "FIRST_NAME", "First Name", false);
public static final PlaceholderOptions SURNAME = new PlaceholderOptions ("SURNAME", "SURNAME", "Surname", false);
public static final PlaceholderOptions EMAIL_ADDRESS = new PlaceholderOptions ("EMAIL_ADDRESS", "EMAIL_ADDRESS", "Email Address", false);
public static final PlaceholderOptions LOCATION = new PlaceholderOptions ("LOCATION", "LOCATION", "Location", false);
public static final PlaceholderOptions HIRING_TEAM = new PlaceholderOptions ("HIRING_TEAM", "HIRING_TEAM", "Hiring Team", false);
public static final PlaceholderOptions JOB_TITLE = new PlaceholderOptions ("JOB_TITLE", "JOB_TITLE", "Job Title", false);
public static final PlaceholderOptions JOB_REFERENCE = new PlaceholderOptions ("JOB_REFERENCE", "JOB_REFERENCE", "Job Reference", false);
public static final PlaceholderOptions JOB_LINK = new PlaceholderOptions ("JOB_LINK", "JOB_LINK", "Job Link", false);
private static final PlaceholderOptions[] allPlaceholderOptionss =
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,HIRING_TEAM,JOB_TITLE,JOB_REFERENCE,JOB_LINK};
private static PlaceholderOptions[] getAllPlaceholderOptionss ()
{
return allPlaceholderOptionss;
}
private transient String Placeholder;
private PlaceholderOptions (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public String getPlaceholder()
{
return Placeholder;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allPlaceholderOptionss);
static
{
defineAdditionalData ();
}
public boolean isEqual (PlaceholderOptions other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return PlaceholderOptions.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return PlaceholderOptions.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_PlaceholderOptions;
}
public static PlaceholderOptions forName (String name)
{
if (name == null) { return null; }
PlaceholderOptions[] all = getAllPlaceholderOptionss();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static PlaceholderOptions forValue (String value)
{
if (value == null) { return null; }
PlaceholderOptions[] all = getAllPlaceholderOptionss();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllPlaceholderOptionss (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllPlaceholderOptionss());
}
public static PlaceholderOptions[] getPlaceholderOptionsArray ()
{
return (PlaceholderOptions[])getAllPlaceholderOptionss().clone ();
}
public static void defineAdditionalData ()
{
FIRST_NAME.Placeholder = "$firstName";
SURNAME.Placeholder = "$surname";
EMAIL_ADDRESS.Placeholder = "$emailAddress";
LOCATION.Placeholder = "$location";
HIRING_TEAM.Placeholder = "$hiringTeam";
JOB_TITLE.Placeholder = "$jobTitle";
JOB_REFERENCE.Placeholder = "$jobReference";
JOB_LINK.Placeholder = "$jobLink";
}
static class PlaceholderOptionsFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return PlaceholderOptions.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return PlaceholderOptions.forValue (name);
}
public Enumeration getAll ()
{
return PlaceholderOptions.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("Placeholder", ArrayFormatter.toObject(getPlaceholder()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="PlaceholderOptions">
<DATA name="Placeholder" type="String"/>
<VALUE name="FIRST_NAME" value="FIRST_NAME" description="First Name" Placeholder='"$firstName"' />
<VALUE name="SURNAME" value="SURNAME" description="Surname" Placeholder='"$surname"' />
<VALUE name="EMAIL_ADDRESS" value="EMAIL_ADDRESS" description="Email Address" Placeholder='"$emailAddress"' />
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' />
<VALUE name="HIRING_TEAM" value="HIRING_TEAM" description="Hiring Team" Placeholder='"$hiringTeam"' />
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"' />
<VALUE name="JOB_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"' />
<VALUE name="JOB_LINK" value="JOB_LINK" description="Job Link" Placeholder='"$jobLink"' />
</CONSTANT>
</ROOT>
\ No newline at end of file
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.servlets.jsp.ORMTextSearcher;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.ILikeFilter;
import performa.orm.ILOJobTitle;
public class ILOJobTitleSearcher implements ORMTextSearcher
{
public static ILOJobTitleSearcher INSTANCE = new ILOJobTitleSearcher();
@Override
public BaseBusinessClass[] search(ObjectTransaction ot, String searchTerm)
{
return ILOJobTitle.SearchByAll().andJobTitle(new ILikeFilter(searchTerm, "%", "%")).search(ot);
}
}
package performa.utils;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Random;
import java.util.TimeZone;
public class MessagingUtils
{
private static final Random rand = new Random();
public static int WORK_START_HOUR = 9;
public static int WORK_STOP_HOUR = 17;
public static int randInt(int min, int max)
{
return rand.nextInt((max - min) + 1) + min;
}
public static Date getWithinBusinessHours(Calendar cal, TimeZone timeZone)
{
while (!isWorkingDay(cal))
{
cal.add(Calendar.DAY_OF_MONTH, 1);
}
Calendar calDayStart = new GregorianCalendar();
Calendar calDayEnd = new GregorianCalendar();
calDayStart.setTime(cal.getTime());
calDayEnd.setTime(cal.getTime());
startOfWorkingDay(calDayStart, timeZone);
endOfWorkingDay(calDayEnd, timeZone);
if(cal.before(calDayStart))
{
cal.setTimeZone(timeZone);
cal.set(GregorianCalendar.HOUR_OF_DAY, WORK_START_HOUR);
}
else if(cal.after(calDayEnd))
{
cal.setTimeZone(timeZone);
cal.add(Calendar.DAY_OF_MONTH, 1);
cal.set(GregorianCalendar.HOUR_OF_DAY, WORK_START_HOUR);
while (!isWorkingDay(cal))
{
cal.add(Calendar.DAY_OF_MONTH, 1);
}
}
return cal.getTime();
}
public static void startOfWorkingDay(Calendar cal, TimeZone timeZone)
{
cal.setTimeZone(timeZone);
cal.set(GregorianCalendar.MILLISECOND, 0);
cal.set(GregorianCalendar.SECOND, 0);
cal.set(GregorianCalendar.MINUTE, 0);
cal.set(GregorianCalendar.HOUR_OF_DAY, WORK_START_HOUR);
}
public static void endOfWorkingDay(Calendar cal, TimeZone timeZone)
{
cal.setTimeZone(timeZone);
cal.set(GregorianCalendar.MILLISECOND, 0);
cal.set(GregorianCalendar.SECOND, 0);
cal.set(GregorianCalendar.MINUTE, 0);
cal.set(GregorianCalendar.HOUR_OF_DAY, WORK_STOP_HOUR);
}
public static boolean isWorkingDay(Calendar day)
{
int dayOfWeek = day.get(Calendar.DAY_OF_WEEK);
return !(dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY);
}
}
\ No newline at end of file
...@@ -43,6 +43,9 @@ public class Utils ...@@ -43,6 +43,9 @@ public class Utils
public static final String PRIV_ACCESS_APPLICANT_PORTAL = "TL_AccessApplicantPortal"; public static final String PRIV_ACCESS_APPLICANT_PORTAL = "TL_AccessApplicantPortal";
public static final String PRIV_ACCESS_COMPANY_ADMIN = "TL_AccessCompanyAdmin"; public static final String PRIV_ACCESS_COMPANY_ADMIN = "TL_AccessCompanyAdmin";
public static final String PRIV_ACCESS_COMPANY = "TL_AccessCompany"; public static final String PRIV_ACCESS_COMPANY = "TL_AccessCompany";
public static final String ADVT_CONFIG_EMAIL_EXTENSION = ConfigMgr.getKeyfileString ("advt.config.email.extension", "matchdmail.com");
public static final String APPLICANT_VERIFY_LINK = "/ApplicantPortal-Applicant_Account_Verification.htm";
public static final String APPLICANT_LINK = "/ApplicantPortal-ApplyJob.htm";
public static Role getRole(String role, ObjectTransaction transaction) public static Role getRole(String role, ObjectTransaction transaction)
{ {
...@@ -426,7 +429,7 @@ public class Utils ...@@ -426,7 +429,7 @@ public class Utils
} }
public static void sendVerificationMail(CompanyUser companyUser, HttpServletRequest request, ConfigurableArticleTemplateEmailer emailer, String callingClass) throws BusinessException public static void sendVerificationMail(Job job, CompanyUser companyUser, HttpServletRequest request, ConfigurableArticleTemplateEmailer emailer, String callingClass) throws BusinessException
{ {
if(!CollectionUtils.equals(companyUser.getIsAccountVerified(), Boolean.TRUE)) if(!CollectionUtils.equals(companyUser.getIsAccountVerified(), Boolean.TRUE))
{ {
...@@ -446,7 +449,7 @@ public class Utils ...@@ -446,7 +449,7 @@ public class Utils
+ "?id=" + companyUser.getID() + "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey(); + "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap(); Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser.getUser()); ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser.getUser(), job);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser); Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</MAP> </MAP>
<!-- AAdded only for legacy data and should never be used --> <!-- Added only for legacy data and should never be used -->
<MAP value="CREATE_JOB" description="Create Job" TemplatePage="dynamic_content_form_client.jsp"> <MAP value="CREATE_JOB" description="Create Job" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration"> <NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/> <INHERITS nodename="StandardJSP"/>
...@@ -184,8 +184,19 @@ ...@@ -184,8 +184,19 @@
</WHEN> </WHEN>
</TASK> </TASK>
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN factory="Participant" class="performa.batch.MessagingEngineBatch">
<Services factory="ConfigMgr" system="CONFIG.GLOBAL" paramname="TransactionServices"/>
<EmailEngine factory="ConfigMgr" system="CONFIG.GLOBAL" paramname="EmailEngine"/>
</RUN>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
<NODE name="schedule" class="oneit.appservices.batch.QuickSchedule">
<NODE name="period" factory="Integer" value="1"/>
</NODE> </NODE>
</WHEN>
</TASK>
</NODE>
<NODE name="CONFIG.Formatting::AdminPortal"> <NODE name="CONFIG.Formatting::AdminPortal">
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
boolean fromJob = request.getParameter("fromJob") != null ? Boolean.parseBoolean(request.getParameter("fromJob")) : false; boolean fromJob = request.getParameter("fromJob") != null ? Boolean.parseBoolean(request.getParameter("fromJob")) : false;
String nextPage = WebUtils.getSamePageInRenderMode(request, (fromJob ? "Page" : WebUtils.VIEW_APPLICANTS)); String nextPage = WebUtils.getSamePageInRenderMode(request, (fromJob ? "Page" : WebUtils.VIEW_APPLICANTS));
String advtEmail = "job"+job.getID().longID()+"@"+ Utils.ADVT_CONFIG_EMAIL_EXTENSION;
HiringTeam hiringTeam = job.getHiringTeam(); HiringTeam hiringTeam = job.getHiringTeam();
HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam(); HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
%> %>
...@@ -106,8 +108,26 @@ ...@@ -106,8 +108,26 @@
</div> </div>
<div class="job-desc-box"> <div class="job-desc-box">
<%--<div class="form-group row">
<span class="col-md-12" style="font-size: 20px;font-weight: 300;color: #1A2531;">Advertisement Configuration Email
<a class="copy-to-clipboard" onclick="copyHTMLToClip('.advtEmail')" style="margin-top: 10px;padding-top: 5px;margin-right: 10px;">
COPY TO CLIPBOARD
</a></span><br/>
<span class="col-md-12 form-control advtEmail" ><%= advtEmail %></span>
</div> --%>
<div class="sample-job-advertise"> <div class="sample-job-advertise">
<span> <span>
Advertisement Configuration Email
</span>
<a class="copy-to-clipboard" onclick="copyHTMLToClip('.advtEmail')">
COPY TO CLIPBOARD
</a>
</div>
<div style="margin-top:10px ">
<span class="form-control advtEmail" style="padding:15px"><%= advtEmail %></span>
</div>
<div class="sample-job-advertise" style="margin-top:40px">
<span>
Sample job advertisement text Sample job advertisement text
</span> </span>
<a class="copy-to-clipboard" onclick="copyHTMLToClip('.details-box')"> <a class="copy-to-clipboard" onclick="copyHTMLToClip('.details-box')">
......
...@@ -12,8 +12,32 @@ ...@@ -12,8 +12,32 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in admin portal edit job"); Debug.assertion(job != null && !toRedirect, "Invalid job in admin portal edit job");
ILOJobTitle iloJobTitle = job.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(job.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page"); String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
%> %>
<script type="text/javascript">
$(document).ready(function()
{
setupRecalc ($("form#editJob"), {'recalcOnError':true});
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').attr('placeholder','Please select a Job Title');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').addClass("form-control");
$("#occupation span").addClass("form-control");
$("#occupation span").css({"padding":"15px","display":"inline-table"});
});
</script>
<div class="container-fluid"> <div class="container-fluid">
<div class="row content"> <div class="row content">
<div class="main-content-area"> <div class="main-content-area">
...@@ -99,22 +123,32 @@ ...@@ -99,22 +123,32 @@
</div> </div>
<div class="form-page-section"> <div class="form-page-section">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-6">
<label><oneit:label GUIName="Job Type" /></label> <label><oneit:label GUIName="ILO Standard Job Title" /><a href="#" title="This is the set of International Labour Organisation job titles <br/> and is used to model the assessments applicable for this job" class="info-icon"><img src="images/info-icon.png" /></a></label><br/>
<oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/> <tagfile:ormsingleasso_autocomplete obj="<%= job %>" assocName="ILOJobTitle" cssClass="form-control" searcher="<%= ILOJobTitleSearcher.INSTANCE %>" />
</div>
<div class="col-md-6" id="occupation">
<label><oneit:label GUIName="Job Occupation Classification" /></label><br/>
<%-- <input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification"
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/> --%>
<oneit:ormInput obj="<%= job %>" attributeName="OccupationId" type="hidden"/>
<oneit:recalc mode="EscapeHTML" script="job.displayOccupation()" job="<%= job %>"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Industry Classification" /></label> <label><oneit:label GUIName="Job Type" /></label>
<oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/> <oneit:ormEnum obj="<%= job %>" attributeName="JobType" cssClass="form-control"/>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Job Occupation Classification" /></label> <label><oneit:label GUIName="Industry Classification" /></label>
<input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification" <oneit:ormEnum obj="<%= job %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/>
</div>
</div> </div>
</div> </div>
<div class="text-center form-group"> <div class="text-center form-group">
......
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
Debug.assertion(template != null && !toRedirect, "Invalid template in job templates"); Debug.assertion(template != null && !toRedirect, "Invalid template in job templates");
ILOJobTitle iloJobTitle = template.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(process.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
SecUser secUser = SecUser.getTXUser(transaction); SecUser secUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam(); HiringTeam hiringTeam = companyUser.getSelectedTeam();
...@@ -149,6 +158,12 @@ ...@@ -149,6 +158,12 @@
}); });
$('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry'); $('input[type="text"][id$="Industry"]').attr('placeholder','Please select an Industry');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').attr('placeholder','Please select a Job Title');
$('input[type="text"][id$="ILOJobTitle_autocomplete"]').addClass("form-control");
$("#occupation span").addClass("form-control");
$("#occupation span").css({"padding":"15px","display":"inline-table"});
}); });
...@@ -360,23 +375,35 @@ ...@@ -360,23 +375,35 @@
</div> </div>
<div class="form-page-section"> <div class="form-page-section">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-6">
<label><oneit:label GUIName="Job Type" /></label> <label><oneit:label GUIName="ILO Standard Job Title" /><a href="#" title="This is the set of International Labour Organisation job titles <br/> and is used to model the assessments applicable for this job" class="info-icon"><img src="images/info-icon.png" /></a></label><br/>
<oneit:ormEnum obj="<%= template %>" attributeName="JobType" cssClass="form-control"/> <tagfile:ormsingleasso_autocomplete obj="<%= template %>" assocName="ILOJobTitle" cssClass="form-control" searcher="<%= ILOJobTitleSearcher.INSTANCE %>" />
</div> </div>
<div class="col-md-6" id="occupation">
<label><oneit:label GUIName="Job Occupation Classification" /></label><br/>
<%-- <input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification"
value="<%= job.getOccupation() != null ? job.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= job %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/> --%>
<oneit:ormInput obj="<%= template %>" attributeName="OccupationId" type="hidden"/>
<oneit:recalc mode="EscapeHTML" script="template.displayOccupation()" template="<%= template %>"/>
</div> </div>
</div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Industry Classification" /></label> <label><oneit:label GUIName="Job Type" /></label>
<oneit:ormEnum obj="<%= template %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/> <oneit:ormEnum obj="<%= template %>" attributeName="JobType" cssClass="form-control"/>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label><oneit:label GUIName="Job Occupation Classification" /></label> <label><oneit:label GUIName="Industry Classification" /></label>
<input type="text" class="form-control select-occupation search-input " placeholder="Select the occupation classification" <oneit:ormEnum obj="<%= template %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
value="<%= template.getOccupation() != null ? template.getOccupation() : "Select the occupation classification"%>"></input>
<oneit:ormInput obj="<%= template %>" id="select-occupation-id" attributeName="OccupationId" type="hidden"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-12">
<div class="styled_checkboxes"> <div class="styled_checkboxes">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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