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,7 +102,8 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -101,7 +102,8 @@ 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())
{ {
BusinessObjectParser.assertFieldCondition(criteria.getName() != null, criteria , AssessmentCriteria.FIELD_Name, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(criteria.getName() != null, criteria , AssessmentCriteria.FIELD_Name, "mandatory", exceptions, true, request);
......
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
...@@ -55,20 +50,21 @@ public class SendVerificationMailFP extends SaveFP ...@@ -55,20 +50,21 @@ public class SendVerificationMailFP extends SaveFP
BusinessObjectParser.assertFieldCondition(secUser.getEmail() != null , job, Job.FIELD_Email, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(secUser.getEmail() != null , job, Job.FIELD_Email, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getEmail()), job, Job.FIELD_Email, "invalid", exceptions, true, request); BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getEmail()), job, Job.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request);
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);
...@@ -78,12 +74,13 @@ public class SendVerificationMailFP extends SaveFP ...@@ -78,12 +74,13 @@ public class SendVerificationMailFP extends SaveFP
@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();
ObjectTransaction objTran = process.getTransaction(); ObjectTransaction objTran = process.getTransaction();
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)
{ {
CompanyUser companyUser = company.getAddedByUser(); CompanyUser companyUser = company.getAddedByUser();
...@@ -127,21 +124,52 @@ public class SendVerificationMailFP extends SaveFP ...@@ -127,21 +124,52 @@ 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();
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));
candidate.getUser().setUserName(candidate.getUser().getEmail());
candidate.setIsMaskedEmail(false);
candidate.setKnownAsAlias(old.getEmail());
}
else
{
candidate.setIsAccountVerified(true);
}
jobApplication.setApplicationStatus(ApplicationStatus.DRAFT);
}
if(!candidate.isTrue(candidate.getIsPasswordChanged()))
{
candidate.setIsPasswordChanged(true);
}
// storing candidate location in application for distance calculation to be accurate even if user edits
// location in the next application
jobApplication.setGoogleAddressText(candidate.getGoogleAddressText());
} }
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
@Override @Override
public void init(ParticipantInitialisationContext context) throws InitialisationException public void init(ParticipantInitialisationContext context) throws InitialisationException
{ {
...@@ -149,46 +177,4 @@ public class SendVerificationMailFP extends SaveFP ...@@ -149,46 +177,4 @@ public class SendVerificationMailFP extends SaveFP
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer")); emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer"));
} }
private void sendVerificationMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException
{
if(!candidate.isTrue(candidate.getIsAccountVerified()))
{
try
{
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
candidate.setVerificationKey(random.generateAlphaNum(6));
candidate.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ 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);
}
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.");
}
}
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>
......
...@@ -76,7 +76,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -76,7 +76,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
} }
private String SELECT_COLUMNS = "{PREFIX}tl_assessment_template.object_id as id, {PREFIX}tl_assessment_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_assessment_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_assessment_template.template_name, {PREFIX}tl_assessment_template.job_title, {PREFIX}tl_assessment_template.job_description, {PREFIX}tl_assessment_template.ref_number, {PREFIX}tl_assessment_template.google_address_text, {PREFIX}tl_assessment_template.location_radius, {PREFIX}tl_assessment_template.remote, {PREFIX}tl_assessment_template.job_type, {PREFIX}tl_assessment_template.industry, {PREFIX}tl_assessment_template.require_cv, {PREFIX}tl_assessment_template.assessment_type, {PREFIX}tl_assessment_template.include_assessment_criteria, {PREFIX}tl_assessment_template.level_id, {PREFIX}tl_assessment_template.occupation_id, {PREFIX}tl_assessment_template.job_owner_id, {PREFIX}tl_assessment_template.job_id, {PREFIX}tl_assessment_template.client_id, {PREFIX}tl_assessment_template.hiring_team_id, {PREFIX}tl_assessment_template.company_user_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_assessment_template.object_id as id, {PREFIX}tl_assessment_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_assessment_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_assessment_template.template_name, {PREFIX}tl_assessment_template.job_title, {PREFIX}tl_assessment_template.job_description, {PREFIX}tl_assessment_template.ref_number, {PREFIX}tl_assessment_template.google_address_text, {PREFIX}tl_assessment_template.location_radius, {PREFIX}tl_assessment_template.remote, {PREFIX}tl_assessment_template.job_type, {PREFIX}tl_assessment_template.industry, {PREFIX}tl_assessment_template.require_cv, {PREFIX}tl_assessment_template.assessment_type, {PREFIX}tl_assessment_template.include_assessment_criteria, {PREFIX}tl_assessment_template.level_id, {PREFIX}tl_assessment_template.occupation_id, {PREFIX}tl_assessment_template.job_owner_id, {PREFIX}tl_assessment_template.job_id, {PREFIX}tl_assessment_template.client_id, {PREFIX}tl_assessment_template.hiring_team_id, {PREFIX}tl_assessment_template.company_user_id, {PREFIX}tl_assessment_template.job_title_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -145,7 +145,8 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -145,7 +145,8 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)|| !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)) !tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)||
!tl_assessment_templatePSet.containsAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -215,10 +216,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -215,10 +216,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_assessment_template " + "UPDATE {PREFIX}tl_assessment_template " +
"SET template_name = ?, job_title = ?, job_description = ?, ref_number = ?, google_address_text = ?, location_radius = ?, remote = ?, job_type = ?, industry = ?, require_cv = ?, assessment_type = ?, include_assessment_criteria = ?, level_id = ? , occupation_id = ? , job_owner_id = ? , job_id = ? , client_id = ? , hiring_team_id = ? , company_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET template_name = ?, job_title = ?, job_description = ?, ref_number = ?, google_address_text = ?, location_radius = ?, remote = ?, job_type = ?, industry = ?, require_cv = ?, assessment_type = ?, include_assessment_criteria = ?, level_id = ? , occupation_id = ? , job_owner_id = ? , job_id = ? , client_id = ? , hiring_team_id = ? , company_user_id = ? , job_title_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_assessment_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_assessment_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -494,6 +495,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -494,6 +495,7 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client, r.getObject ("client_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_Client, r.getObject ("client_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id")); tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id"));
tl_assessment_templatePSet.setAttrib(AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle, r.getObject ("job_title_id"));
} }
...@@ -510,10 +512,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM ...@@ -510,10 +512,10 @@ public class AssessmentCriteriaTemplatePersistenceMgr extends ObjectPersistenceM
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_assessment_template " + "INSERT INTO {PREFIX}tl_assessment_template " +
" (template_name, job_title, job_description, ref_number, google_address_text, location_radius, remote, job_type, industry, require_cv, assessment_type, include_assessment_criteria, level_id, occupation_id, job_owner_id, job_id, client_id, hiring_team_id, company_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (template_name, job_title, job_description, ref_number, google_address_text, location_radius, remote, job_type, industry, require_cv, assessment_type, include_assessment_criteria, level_id, occupation_id, job_owner_id, job_id, client_id, hiring_team_id, company_user_id, job_title_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))) .listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_TemplateName))).listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobDescription))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ReferenceNumber))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_GoogleAddressText))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Remote))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_JobType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_Industry))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_RequireCV))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_AssessmentType))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.FIELD_IncludeAssessmentCriteria))) .listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_assessment_templatePSet.getAttrib (AssessmentCriteriaTemplate.SINGLEREFERENCE_ILOJobTitle)))) .listEntry (objectID.longID ()).toList().toArray());
tl_assessment_templatePSet.setStatus (PersistentSetStatus.PROCESSED); tl_assessment_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
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
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class AttachmentPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea AttachmentPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Attachment");
// Private attributes corresponding to business object data
private String dummyAttachmentName;
private BinaryContent dummyAttachmentFile;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_AttachmentName = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_AttachmentFile = BLOBAttributeHelper.INSTANCE;
public AttachmentPersistenceMgr ()
{
dummyAttachmentName = (String)(HELPER_AttachmentName.initialise (dummyAttachmentName));
dummyAttachmentFile = (BinaryContent)(HELPER_AttachmentFile.initialise (dummyAttachmentFile));
}
private String SELECT_COLUMNS = "{PREFIX}tl_attachment.object_id as id, {PREFIX}tl_attachment.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_attachment.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_attachment.attachment_name, {PREFIX}tl_attachment.attachment_file, {PREFIX}tl_attachment.email_message_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, Attachment.REFERENCE_Attachment);
if (objectToReturn instanceof Attachment)
{
LogMgr.log (AttachmentPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a Attachment");
}
}
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(id, "tl_attachment", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_attachmentPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_attachmentPSet.containsAttrib(Attachment.FIELD_AttachmentName)||
!tl_attachmentPSet.containsAttrib(Attachment.FIELD_AttachmentFile)||
!tl_attachmentPSet.containsAttrib(Attachment.SINGLEREFERENCE_EmailMessage))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (AttachmentPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
Attachment result = new Attachment ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_attachment " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_attachment.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else if (refName.equals (Attachment.SINGLEREFERENCE_EmailMessage))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_attachment " +
"WHERE " + SELECT_JOINS + "email_message_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(objectID, "tl_attachment");
if (tl_attachmentPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_attachmentPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_attachment " +
"SET attachment_name = ?, attachment_file = ?, email_message_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_attachment.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_AttachmentName.getForSQL(dummyAttachmentName, tl_attachmentPSet.getAttrib (Attachment.FIELD_AttachmentName))).listEntry (HELPER_AttachmentFile.getForSQL(dummyAttachmentFile, tl_attachmentPSet.getAttrib (Attachment.FIELD_AttachmentFile))).listEntry (SQLManager.CheckNull((Long)(tl_attachmentPSet.getAttrib (Attachment.SINGLEREFERENCE_EmailMessage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_attachment WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_attachment", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (AttachmentPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_attachment");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_attachment for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (AttachmentPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_attachmentPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (AttachmentPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(objectID, "tl_attachment");
LogMgr.log (AttachmentPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_attachmentPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_attachmentPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_attachment " +
"WHERE tl_attachment.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_attachment WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_attachment");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_attachment for row:" + objectID;
LogMgr.log (AttachmentPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_attachmentPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, Attachment> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (Attachment.REFERENCE_Attachment.getObjectIDSpace (), r.getLong ("id"));
Attachment resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, Attachment.REFERENCE_Attachment);
if (cachedElement instanceof Attachment)
{
LogMgr.log (AttachmentPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (Attachment)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a Attachment");
}
}
else
{
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(objectID, "tl_attachment", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new Attachment ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (AttachmentPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_attachment " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(objectID, "tl_attachment", PersistentSetStatus.FETCHED);
// Object Modified
tl_attachmentPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_attachmentPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_attachmentPSet.setAttrib(Attachment.FIELD_AttachmentName, HELPER_AttachmentName.getFromRS(dummyAttachmentName, r, "attachment_name"));
tl_attachmentPSet.setAttrib(Attachment.FIELD_AttachmentFile, HELPER_AttachmentFile.getFromRS(dummyAttachmentFile, r, "attachment_file"));
tl_attachmentPSet.setAttrib(Attachment.SINGLEREFERENCE_EmailMessage, r.getObject ("email_message_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_attachmentPSet = allPSets.getPersistentSet(objectID, "tl_attachment");
if (tl_attachmentPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_attachmentPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_attachment " +
" (attachment_name, attachment_file, email_message_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_AttachmentName.getForSQL(dummyAttachmentName, tl_attachmentPSet.getAttrib (Attachment.FIELD_AttachmentName))).listEntry (HELPER_AttachmentFile.getForSQL(dummyAttachmentFile, tl_attachmentPSet.getAttrib (Attachment.FIELD_AttachmentFile))) .listEntry (SQLManager.CheckNull((Long)(tl_attachmentPSet.getAttrib (Attachment.SINGLEREFERENCE_EmailMessage)))) .listEntry (objectID.longID ()).toList().toArray());
tl_attachmentPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -62,6 +62,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -62,6 +62,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
public static final String SINGLEREFERENCE_Client = "Client"; public static final String SINGLEREFERENCE_Client = "Client";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam"; public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser"; public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser";
public static final String SINGLEREFERENCE_ILOJobTitle = "ILOJobTitle";
public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias"; public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias";
public static final String BACKREF_AssessmentCriterias = ""; public static final String BACKREF_AssessmentCriterias = "";
public static final String MULTIPLEREFERENCE_WorkFlows = "WorkFlows"; public static final String MULTIPLEREFERENCE_WorkFlows = "WorkFlows";
...@@ -111,6 +112,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -111,6 +112,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
private SingleAssociation<AssessmentCriteriaTemplate, Client> _Client; private SingleAssociation<AssessmentCriteriaTemplate, Client> _Client;
private SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> _HiringTeam; private SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> _HiringTeam;
private SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> _CompanyUser; private SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> _CompanyUser;
private SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> _ILOJobTitle;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -159,6 +161,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -159,6 +161,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
setupAssocMetaData_Client(); setupAssocMetaData_Client();
setupAssocMetaData_HiringTeam(); setupAssocMetaData_HiringTeam();
setupAssocMetaData_CompanyUser(); setupAssocMetaData_CompanyUser();
setupAssocMetaData_ILOJobTitle();
FIELD_OccupationId_Validators = (AttributeValidator[])setupAttribMetaData_OccupationId(validatorMapping).toArray (new AttributeValidator[0]); FIELD_OccupationId_Validators = (AttributeValidator[])setupAttribMetaData_OccupationId(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]); FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]); FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -317,6 +320,21 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -317,6 +320,21 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ILOJobTitle()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title_id");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "ILOJobTitle");
metaInfo.put ("type", "ILOJobTitle");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for AssessmentCriteriaTemplate.ILOJobTitle:", metaInfo);
ATTRIBUTES_METADATA_AssessmentCriteriaTemplate.put (SINGLEREFERENCE_ILOJobTitle, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_OccupationId(Map validatorMapping) private static List setupAttribMetaData_OccupationId(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -625,6 +643,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -625,6 +643,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template"); _Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template");
_HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template"); _HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template");
_CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template"); _CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template");
_ILOJobTitle = new SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_assessment_template");
_AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow); _WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow);
...@@ -643,6 +662,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -643,6 +662,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template"); _Client = new SingleAssociation<AssessmentCriteriaTemplate, Client> (this, SINGLEREFERENCE_Client, null, Client.REFERENCE_Client, "tl_assessment_template");
_HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template"); _HiringTeam = new SingleAssociation<AssessmentCriteriaTemplate, HiringTeam> (this, SINGLEREFERENCE_HiringTeam, null, HiringTeam.REFERENCE_HiringTeam, "tl_assessment_template");
_CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template"); _CompanyUser = new SingleAssociation<AssessmentCriteriaTemplate, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_assessment_template");
_ILOJobTitle = new SingleAssociation<AssessmentCriteriaTemplate, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_assessment_template");
_AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<AssessmentCriteriaTemplate, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Template, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow); _WorkFlows = new MultipleAssociation<AssessmentCriteriaTemplate, WorkFlow> (this, MULTIPLEREFERENCE_WorkFlows, WorkFlow.SINGLEREFERENCE_Template, WorkFlow.REFERENCE_WorkFlow);
...@@ -1956,6 +1976,8 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -1956,6 +1976,8 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
result.add("CompanyUser"); result.add("CompanyUser");
result.add("ILOJobTitle");
return result; return result;
} }
...@@ -1988,6 +2010,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -1988,6 +2010,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return _CompanyUser.getReferencedType (); return _CompanyUser.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return _ILOJobTitle.getReferencedType ();
} }
else else
{ {
...@@ -2023,6 +2048,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2023,6 +2048,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return null ;
} }
else else
{ {
...@@ -2058,6 +2086,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2058,6 +2086,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (); return getCompanyUser ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle ();
} }
else else
{ {
...@@ -2093,6 +2124,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2093,6 +2124,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (getType); return getCompanyUser (getType);
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle (getType);
} }
else else
{ {
...@@ -2128,6 +2162,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2128,6 +2162,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUserID (); return getCompanyUserID ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitleID ();
} }
else else
{ {
...@@ -2163,6 +2200,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2163,6 +2200,9 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
setCompanyUser ((CompanyUser)(newValue)); setCompanyUser ((CompanyUser)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
setILOJobTitle ((ILOJobTitle)(newValue));
} }
else else
{ {
...@@ -2832,6 +2872,100 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -2832,6 +2872,100 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
} }
/** /**
* Get the reference ILOJobTitle
*/
public ILOJobTitle getILOJobTitle () throws StorageException
{
assertValid();
try
{
return (ILOJobTitle)(_ILOJobTitle.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in AssessmentCriteriaTemplate:", this.getObjectID (), ", was trying to get ILOJobTitle:", getILOJobTitleID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ILOJobTitle.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public ILOJobTitle getILOJobTitle (Get getType) throws StorageException
{
assertValid();
return _ILOJobTitle.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
assertValid();
if (_ILOJobTitle == null)
{
return null;
}
else
{
return _ILOJobTitle.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preILOJobTitleChange (ILOJobTitle newILOJobTitle) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postILOJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_ILOJobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ILOJobTitle. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setILOJobTitle (ILOJobTitle newILOJobTitle) throws StorageException, FieldException
{
if (_ILOJobTitle.wouldReferencedChange (newILOJobTitle))
{
assertValid();
Debug.assertion (getWriteability_ILOJobTitle () != FieldWriteability.FALSE, "Assoc ILOJobTitle is not writeable");
preILOJobTitleChange (newILOJobTitle);
_ILOJobTitle.set (newILOJobTitle);
postILOJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings. * A list of multi assoc names e.g. list of strings.
*/ */
public List<String> getMultiAssocs() public List<String> getMultiAssocs()
...@@ -3252,6 +3386,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3252,6 +3386,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.getPersistentSets (allSets); _Client.getPersistentSets (allSets);
_HiringTeam.getPersistentSets (allSets); _HiringTeam.getPersistentSets (allSets);
_CompanyUser.getPersistentSets (allSets); _CompanyUser.getPersistentSets (allSets);
_ILOJobTitle.getPersistentSets (allSets);
} }
...@@ -3285,6 +3420,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3285,6 +3420,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.setFromPersistentSets (objectID, allSets); _Client.setFromPersistentSets (objectID, allSets);
_HiringTeam.setFromPersistentSets (objectID, allSets); _HiringTeam.setFromPersistentSets (objectID, allSets);
_CompanyUser.setFromPersistentSets (objectID, allSets); _CompanyUser.setFromPersistentSets (objectID, allSets);
_ILOJobTitle.setFromPersistentSets (objectID, allSets);
} }
...@@ -3459,6 +3595,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3459,6 +3595,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.copyFrom (sourceAssessmentCriteriaTemplate._Client, linkToGhosts); _Client.copyFrom (sourceAssessmentCriteriaTemplate._Client, linkToGhosts);
_HiringTeam.copyFrom (sourceAssessmentCriteriaTemplate._HiringTeam, linkToGhosts); _HiringTeam.copyFrom (sourceAssessmentCriteriaTemplate._HiringTeam, linkToGhosts);
_CompanyUser.copyFrom (sourceAssessmentCriteriaTemplate._CompanyUser, linkToGhosts); _CompanyUser.copyFrom (sourceAssessmentCriteriaTemplate._CompanyUser, linkToGhosts);
_ILOJobTitle.copyFrom (sourceAssessmentCriteriaTemplate._ILOJobTitle, linkToGhosts);
} }
} }
...@@ -3519,6 +3656,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3519,6 +3656,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.readExternalData(vals.get(SINGLEREFERENCE_Client)); _Client.readExternalData(vals.get(SINGLEREFERENCE_Client));
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam)); _HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
_CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser)); _CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser));
_ILOJobTitle.readExternalData(vals.get(SINGLEREFERENCE_ILOJobTitle));
_AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias)); _AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias));
_WorkFlows.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlows)); _WorkFlows.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlows));
...@@ -3552,6 +3690,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3552,6 +3690,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData()); vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData());
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData()); vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData()); vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData());
vals.put (SINGLEREFERENCE_ILOJobTitle, _ILOJobTitle.writeExternalData());
vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData());
vals.put (MULTIPLEREFERENCE_WorkFlows, _WorkFlows.writeExternalData()); vals.put (MULTIPLEREFERENCE_WorkFlows, _WorkFlows.writeExternalData());
...@@ -3624,6 +3763,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3624,6 +3763,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
_Client.compare (otherAssessmentCriteriaTemplate._Client, listener); _Client.compare (otherAssessmentCriteriaTemplate._Client, listener);
_HiringTeam.compare (otherAssessmentCriteriaTemplate._HiringTeam, listener); _HiringTeam.compare (otherAssessmentCriteriaTemplate._HiringTeam, listener);
_CompanyUser.compare (otherAssessmentCriteriaTemplate._CompanyUser, listener); _CompanyUser.compare (otherAssessmentCriteriaTemplate._CompanyUser, listener);
_ILOJobTitle.compare (otherAssessmentCriteriaTemplate._ILOJobTitle, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -3666,6 +3806,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3666,6 +3806,7 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
visitor.visitAssociation (_Client); visitor.visitAssociation (_Client);
visitor.visitAssociation (_HiringTeam); visitor.visitAssociation (_HiringTeam);
visitor.visitAssociation (_CompanyUser); visitor.visitAssociation (_CompanyUser);
visitor.visitAssociation (_ILOJobTitle);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_WorkFlows); visitor.visitAssociation (_WorkFlows);
...@@ -3704,6 +3845,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3704,6 +3845,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
visitor.visit (_CompanyUser); visitor.visit (_CompanyUser);
} }
if (scope.includes (_ILOJobTitle))
{
visitor.visit (_ILOJobTitle);
}
if (scope.includes (_AssessmentCriterias)) if (scope.includes (_AssessmentCriterias))
{ {
visitor.visit (_AssessmentCriterias); visitor.visit (_AssessmentCriterias);
...@@ -3813,6 +3958,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3813,6 +3958,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return filter.matches (getCompanyUser ()); return filter.matches (getCompanyUser ());
} }
else if (attribName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return filter.matches (getILOJobTitle ());
}
else else
{ {
return super.testFilter (attribName, filter); return super.testFilter (attribName, filter);
...@@ -3958,6 +4107,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -3958,6 +4107,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
return this; return this;
} }
public SearchAll andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_assessment_template.job_title_id", "ILOJobTitle");
return this;
}
public AssessmentCriteriaTemplate[] public AssessmentCriteriaTemplate[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -4279,6 +4434,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4279,6 +4434,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return getWriteability_CompanyUser (); return getWriteability_CompanyUser ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getWriteability_ILOJobTitle ();
}
else if (fieldName.equals (FIELD_OccupationId)) else if (fieldName.equals (FIELD_OccupationId))
{ {
return getWriteability_OccupationId (); return getWriteability_OccupationId ();
...@@ -4804,6 +4963,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4804,6 +4963,10 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return toCompanyUser (); return toCompanyUser ();
} }
if (name.equals ("ILOJobTitle"))
{
return toILOJobTitle ();
}
return super.to(name); return super.to(name);
...@@ -4877,6 +5040,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass ...@@ -4877,6 +5040,12 @@ public abstract class BaseAssessmentCriteriaTemplate extends BaseBusinessClass
{ {
return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter)); return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter));
} }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle () { return toILOJobTitle (Filter.ALL); }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle (Filter<ILOJobTitle> filter)
{
return ILOJobTitle.REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<From, ILOJobTitle> (this, new ORMSingleAssocPipe<Me, ILOJobTitle>(SINGLEREFERENCE_ILOJobTitle, filter));
}
public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias () { return toAssessmentCriterias(Filter.ALL); } public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias () { return toAssessmentCriterias(Filter.ALL); }
public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias (Filter<AssessmentCriteria> filter) public AssessmentCriteria.AssessmentCriteriaPipeLineFactory<From, AssessmentCriteria> toAssessmentCriterias (Filter<AssessmentCriteria> filter)
...@@ -5023,6 +5192,20 @@ class DummyAssessmentCriteriaTemplate extends AssessmentCriteriaTemplate ...@@ -5023,6 +5192,20 @@ class DummyAssessmentCriteriaTemplate extends AssessmentCriteriaTemplate
return CompanyUser.DUMMY_CompanyUser.getObjectID(); return CompanyUser.DUMMY_CompanyUser.getObjectID();
} }
public ILOJobTitle getILOJobTitle () throws StorageException
{
return (ILOJobTitle)(ILOJobTitle.DUMMY_ILOJobTitle);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
return ILOJobTitle.DUMMY_ILOJobTitle.getObjectID();
}
public int getAssessmentCriteriasCount () throws StorageException public int getAssessmentCriteriasCount () throws StorageException
{ {
return 0; return 0;
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
public abstract class BaseAttachment extends BaseBusinessClass
{
// Reference instance for the object
public static final Attachment REFERENCE_Attachment = new Attachment ();
// Reference instance for the object
public static final Attachment DUMMY_Attachment = new DummyAttachment ();
// Static constants corresponding to field names
public static final String FIELD_AttachmentName = "AttachmentName";
public static final String FIELD_AttachmentFile = "AttachmentFile";
public static final String SINGLEREFERENCE_EmailMessage = "EmailMessage";
public static final String BACKREF_EmailMessage = "";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<Attachment> HELPER_AttachmentName = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_AttachmentFile = BLOBAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _AttachmentName;
private BinaryContent _AttachmentFile;
// Private attributes corresponding to single references
private SingleAssociation<Attachment, EmailMessage> _EmailMessage;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_Attachment = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_AttachmentName_Validators;
private static final AttributeValidator[] FIELD_AttachmentFile_Validators;
// Arrays of behaviour decorators
private static final AttachmentBehaviourDecorator[] Attachment_BehaviourDecorators;
static
{
try
{
String tmp_EmailMessage = EmailMessage.BACKREF_Attachments;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_EmailMessage();
FIELD_AttachmentName_Validators = (AttributeValidator[])setupAttribMetaData_AttachmentName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AttachmentFile_Validators = (AttributeValidator[])setupAttribMetaData_AttachmentFile(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Attachment.initialiseReference ();
DUMMY_Attachment.initialiseReference ();
Attachment_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(Attachment.class).toArray(new AttachmentBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_EmailMessage()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "Attachments");
metaInfo.put ("dbcol", "email_message_id");
metaInfo.put ("name", "EmailMessage");
metaInfo.put ("type", "EmailMessage");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Attachment.EmailMessage:", metaInfo);
ATTRIBUTES_METADATA_Attachment.put (SINGLEREFERENCE_EmailMessage, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_AttachmentName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "attachment_name");
metaInfo.put ("length", "100");
metaInfo.put ("name", "AttachmentName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Attachment.AttachmentName:", metaInfo);
ATTRIBUTES_METADATA_Attachment.put (FIELD_AttachmentName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Attachment.class, "AttachmentName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Attachment.AttachmentName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_AttachmentFile(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "BLOBAttributeHelper");
metaInfo.put ("attribHelperInstance", "BLOBAttributeHelper.INSTANCE");
metaInfo.put ("binaryHandler", "loggedin");
metaInfo.put ("dbcol", "attachment_file");
metaInfo.put ("name", "AttachmentFile");
metaInfo.put ("type", "BinaryContent");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Attachment.AttachmentFile:", metaInfo);
ATTRIBUTES_METADATA_Attachment.put (FIELD_AttachmentFile, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Attachment.class, "AttachmentFile", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Attachment.AttachmentFile:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseAttachment ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return Attachment_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_AttachmentName = (String)(HELPER_AttachmentName.initialise (_AttachmentName));
_AttachmentFile = (BinaryContent)(HELPER_AttachmentFile.initialise (_AttachmentFile));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_EmailMessage = new SingleAssociation<Attachment, EmailMessage> (this, SINGLEREFERENCE_EmailMessage, EmailMessage.MULTIPLEREFERENCE_Attachments, EmailMessage.REFERENCE_EmailMessage, "tl_attachment");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_EmailMessage = new SingleAssociation<Attachment, EmailMessage> (this, SINGLEREFERENCE_EmailMessage, EmailMessage.MULTIPLEREFERENCE_Attachments, EmailMessage.REFERENCE_EmailMessage, "tl_attachment");
return this;
}
/**
* Get the attribute AttachmentName
*/
public String getAttachmentName ()
{
assertValid();
String valToReturn = _AttachmentName;
for (AttachmentBehaviourDecorator bhd : Attachment_BehaviourDecorators)
{
valToReturn = bhd.getAttachmentName ((Attachment)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preAttachmentNameChange (String newAttachmentName) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postAttachmentNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_AttachmentName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute AttachmentName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setAttachmentName (String newAttachmentName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_AttachmentName.compare (_AttachmentName, newAttachmentName);
try
{
for (AttachmentBehaviourDecorator bhd : Attachment_BehaviourDecorators)
{
newAttachmentName = bhd.setAttachmentName ((Attachment)this, newAttachmentName);
oldAndNewIdentical = HELPER_AttachmentName.compare (_AttachmentName, newAttachmentName);
}
if (FIELD_AttachmentName_Validators.length > 0)
{
Object newAttachmentNameObj = HELPER_AttachmentName.toObject (newAttachmentName);
if (newAttachmentNameObj != null)
{
int loopMax = FIELD_AttachmentName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Attachment.get (FIELD_AttachmentName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_AttachmentName_Validators[v].checkAttribute (this, FIELD_AttachmentName, metadata, newAttachmentNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_AttachmentName () != FieldWriteability.FALSE, "Field AttachmentName is not writeable");
preAttachmentNameChange (newAttachmentName);
markFieldChange (FIELD_AttachmentName);
_AttachmentName = newAttachmentName;
postFieldChange (FIELD_AttachmentName);
postAttachmentNameChange ();
}
}
/**
* Get the attribute AttachmentFile
*/
public BinaryContent getAttachmentFile ()
{
assertValid();
BinaryContent valToReturn = _AttachmentFile;
for (AttachmentBehaviourDecorator bhd : Attachment_BehaviourDecorators)
{
valToReturn = bhd.getAttachmentFile ((Attachment)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preAttachmentFileChange (BinaryContent newAttachmentFile) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postAttachmentFileChange () throws FieldException
{
}
public FieldWriteability getWriteability_AttachmentFile ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute AttachmentFile. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setAttachmentFile (BinaryContent newAttachmentFile) throws FieldException
{
boolean oldAndNewIdentical = HELPER_AttachmentFile.compare (_AttachmentFile, newAttachmentFile);
try
{
for (AttachmentBehaviourDecorator bhd : Attachment_BehaviourDecorators)
{
newAttachmentFile = bhd.setAttachmentFile ((Attachment)this, newAttachmentFile);
oldAndNewIdentical = HELPER_AttachmentFile.compare (_AttachmentFile, newAttachmentFile);
}
if (FIELD_AttachmentFile_Validators.length > 0)
{
Object newAttachmentFileObj = HELPER_AttachmentFile.toObject (newAttachmentFile);
if (newAttachmentFileObj != null)
{
int loopMax = FIELD_AttachmentFile_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Attachment.get (FIELD_AttachmentFile);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_AttachmentFile_Validators[v].checkAttribute (this, FIELD_AttachmentFile, metadata, newAttachmentFileObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_AttachmentFile () != FieldWriteability.FALSE, "Field AttachmentFile is not writeable");
preAttachmentFileChange (newAttachmentFile);
markFieldChange (FIELD_AttachmentFile);
_AttachmentFile = newAttachmentFile;
postFieldChange (FIELD_AttachmentFile);
postAttachmentFileChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("EmailMessage");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
return _EmailMessage.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
return EmailMessage.MULTIPLEREFERENCE_Attachments ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
return getEmailMessage ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
return getEmailMessage (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
return getEmailMessageID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_EmailMessage))
{
setEmailMessage ((EmailMessage)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference EmailMessage
*/
public EmailMessage getEmailMessage () throws StorageException
{
assertValid();
try
{
return (EmailMessage)(_EmailMessage.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Attachment:", this.getObjectID (), ", was trying to get EmailMessage:", getEmailMessageID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _EmailMessage.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public EmailMessage getEmailMessage (Get getType) throws StorageException
{
assertValid();
return _EmailMessage.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getEmailMessageID ()
{
assertValid();
if (_EmailMessage == null)
{
return null;
}
else
{
return _EmailMessage.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preEmailMessageChange (EmailMessage newEmailMessage) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postEmailMessageChange () throws FieldException
{
}
public FieldWriteability getWriteability_EmailMessage ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference EmailMessage. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setEmailMessage (EmailMessage newEmailMessage) throws StorageException, FieldException
{
if (_EmailMessage.wouldReferencedChange (newEmailMessage))
{
assertValid();
Debug.assertion (getWriteability_EmailMessage () != FieldWriteability.FALSE, "Assoc EmailMessage is not writeable");
preEmailMessageChange (newEmailMessage);
EmailMessage oldEmailMessage = getEmailMessage ();
if (oldEmailMessage != null)
{
// This is to stop validation from triggering when we are removed
_EmailMessage.set (null);
oldEmailMessage.removeFromAttachments ((Attachment)(this));
}
_EmailMessage.set (newEmailMessage);
if (newEmailMessage != null)
{
newEmailMessage.addToAttachments ((Attachment)(this));
}
postEmailMessageChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_EmailMessage.isLoaded () || getTransaction ().isObjectLoaded (_EmailMessage.getReferencedType (), getEmailMessageID ()))
{
EmailMessage referenced = getEmailMessage ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Attachments from ", getObjectID (), " to ", referenced.getObjectID ());
_EmailMessage.set (null);
referenced.removeFromAttachments ((Attachment)this);
}
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public Attachment newInstance ()
{
return new Attachment ();
}
public Attachment referenceInstance ()
{
return REFERENCE_Attachment;
}
public Attachment getInTransaction (ObjectTransaction t) throws StorageException
{
return getAttachmentByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_Attachment;
}
public String getBaseSetName ()
{
return "tl_attachment";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_attachmentPSet = allSets.getPersistentSet (myID, "tl_attachment", myPSetStatus);
tl_attachmentPSet.setAttrib (FIELD_ObjectID, myID);
tl_attachmentPSet.setAttrib (FIELD_AttachmentName, HELPER_AttachmentName.toObject (_AttachmentName)); //
tl_attachmentPSet.setAttrib (FIELD_AttachmentFile, HELPER_AttachmentFile.toObject (_AttachmentFile)); //
_EmailMessage.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_attachmentPSet = allSets.getPersistentSet (objectID, "tl_attachment");
_AttachmentName = (String)(HELPER_AttachmentName.fromObject (_AttachmentName, tl_attachmentPSet.getAttrib (FIELD_AttachmentName))); //
_AttachmentFile = (BinaryContent)(HELPER_AttachmentFile.fromObject (_AttachmentFile, tl_attachmentPSet.getAttrib (FIELD_AttachmentFile))); //
_EmailMessage.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof Attachment)
{
Attachment otherAttachment = (Attachment)other;
try
{
setAttachmentName (otherAttachment.getAttachmentName ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setAttachmentFile (otherAttachment.getAttachmentFile ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseAttachment)
{
BaseAttachment sourceAttachment = (BaseAttachment)(source);
_AttachmentName = sourceAttachment._AttachmentName;
_AttachmentFile = sourceAttachment._AttachmentFile;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseAttachment)
{
BaseAttachment sourceAttachment = (BaseAttachment)(source);
_EmailMessage.copyFrom (sourceAttachment._EmailMessage, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseAttachment)
{
BaseAttachment sourceAttachment = (BaseAttachment)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_AttachmentName = (String)(HELPER_AttachmentName.readExternal (_AttachmentName, vals.get(FIELD_AttachmentName))); //
_AttachmentFile = (BinaryContent)(HELPER_AttachmentFile.readExternal (_AttachmentFile, vals.get(FIELD_AttachmentFile))); //
_EmailMessage.readExternalData(vals.get(SINGLEREFERENCE_EmailMessage));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_AttachmentName, HELPER_AttachmentName.writeExternal (_AttachmentName));
vals.put (FIELD_AttachmentFile, HELPER_AttachmentFile.writeExternal (_AttachmentFile));
vals.put (SINGLEREFERENCE_EmailMessage, _EmailMessage.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseAttachment)
{
BaseAttachment otherAttachment = (BaseAttachment)(other);
if (!HELPER_AttachmentName.compare(this._AttachmentName, otherAttachment._AttachmentName))
{
listener.notifyFieldChange(this, other, FIELD_AttachmentName, HELPER_AttachmentName.toObject(this._AttachmentName), HELPER_AttachmentName.toObject(otherAttachment._AttachmentName));
}
if (!HELPER_AttachmentFile.compare(this._AttachmentFile, otherAttachment._AttachmentFile))
{
listener.notifyFieldChange(this, other, FIELD_AttachmentFile, HELPER_AttachmentFile.toObject(this._AttachmentFile), HELPER_AttachmentFile.toObject(otherAttachment._AttachmentFile));
}
// Compare single assocs
_EmailMessage.compare (otherAttachment._EmailMessage, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_AttachmentName, HELPER_AttachmentName.toObject(getAttachmentName()));
visitor.visitField(this, FIELD_AttachmentFile, HELPER_AttachmentFile.toObject(getAttachmentFile()));
visitor.visitAssociation (_EmailMessage);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_EmailMessage))
{
visitor.visit (_EmailMessage);
}
}
public static Attachment createAttachment (ObjectTransaction transaction) throws StorageException
{
Attachment result = new Attachment ();
result.initialiseNewObject (transaction);
return result;
}
public static Attachment getAttachmentByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (Attachment)(transaction.getObjectByID (REFERENCE_Attachment, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_AttachmentName))
{
return filter.matches (getAttachmentName ());
}
else if (attribName.equals (FIELD_AttachmentFile))
{
return filter.matches (getAttachmentFile ());
}
else if (attribName.equals (SINGLEREFERENCE_EmailMessage))
{
return filter.matches (getEmailMessage ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_AttachmentName))
{
return HELPER_AttachmentName.toObject (getAttachmentName ());
}
else if (attribName.equals (FIELD_AttachmentFile))
{
return HELPER_AttachmentFile.toObject (getAttachmentFile ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_AttachmentName))
{
return HELPER_AttachmentName;
}
else if (attribName.equals (FIELD_AttachmentFile))
{
return HELPER_AttachmentFile;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_AttachmentName))
{
setAttachmentName ((String)(HELPER_AttachmentName.fromObject (_AttachmentName, attribValue)));
}
else if (attribName.equals (FIELD_AttachmentFile))
{
setAttachmentFile ((BinaryContent)(HELPER_AttachmentFile.fromObject (_AttachmentFile, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_AttachmentName))
{
return getWriteability_AttachmentName ();
}
else if (fieldName.equals (FIELD_AttachmentFile))
{
return getWriteability_AttachmentFile ();
}
else if (fieldName.equals (SINGLEREFERENCE_EmailMessage))
{
return getWriteability_EmailMessage ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_AttachmentName () != FieldWriteability.TRUE)
{
fields.add (FIELD_AttachmentName);
}
if (getWriteability_AttachmentFile () != FieldWriteability.TRUE)
{
fields.add (FIELD_AttachmentFile);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_AttachmentName.getAttribObject (getClass (), _AttachmentName, false, FIELD_AttachmentName));
result.add(HELPER_AttachmentFile.getAttribObject (getClass (), _AttachmentFile, false, FIELD_AttachmentFile));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_Attachment.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_Attachment.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_Attachment.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_Attachment.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
{
oneit.servlets.objstore.binary.BinaryContentHandler bchandler = oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
if(bchandler != null)
{
bchandler.preCommit(willBeStored, this, "AttachmentFile");
}
else
{
LogMgr.log(BUSINESS_OBJECTS, LogLevel.SYSTEMWARNING, "Unknown BinaryContentHandler loggedin on attribute AttachmentFile");
}
}
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
if(CollectionUtils.equals(attribName, "AttachmentFile"))
{
return oneit.servlets.objstore.binary.BinaryContentServlet.getHandler("loggedin");
}
return super.getBinaryContentHandler(attribName);
}
public static class AttachmentBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<Attachment>
{
/**
* Get the attribute AttachmentName
*/
public String getAttachmentName (Attachment obj, String original)
{
return original;
}
/**
* Change the value set for attribute AttachmentName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setAttachmentName (Attachment obj, String newAttachmentName) throws FieldException
{
return newAttachmentName;
}
/**
* Get the attribute AttachmentFile
*/
public BinaryContent getAttachmentFile (Attachment obj, BinaryContent original)
{
return original;
}
/**
* Change the value set for attribute AttachmentFile.
* May modify the field beforehand
* Occurs before validation.
*/
public BinaryContent setAttachmentFile (Attachment obj, BinaryContent newAttachmentFile) throws FieldException
{
return newAttachmentFile;
}
}
public ORMPipeLine pipes()
{
return new AttachmentPipeLineFactory<Attachment, Attachment> ((Attachment)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public AttachmentPipeLineFactory<Attachment, Attachment> pipelineAttachment()
{
return (AttachmentPipeLineFactory<Attachment, Attachment>) pipes();
}
public static AttachmentPipeLineFactory<Attachment, Attachment> pipesAttachment(Collection<Attachment> items)
{
return REFERENCE_Attachment.new AttachmentPipeLineFactory<Attachment, Attachment> (items);
}
public static AttachmentPipeLineFactory<Attachment, Attachment> pipesAttachment(Attachment[] _items)
{
return pipesAttachment(Arrays.asList (_items));
}
public static AttachmentPipeLineFactory<Attachment, Attachment> pipesAttachment()
{
return pipesAttachment((Collection)null);
}
public class AttachmentPipeLineFactory<From extends BaseBusinessClass, Me extends Attachment> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> AttachmentPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public AttachmentPipeLineFactory (From seed)
{
super(seed);
}
public AttachmentPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("AttachmentName"))
{
return toAttachmentName ();
}
if (name.equals ("AttachmentFile"))
{
return toAttachmentFile ();
}
if (name.equals ("EmailMessage"))
{
return toEmailMessage ();
}
return super.to(name);
}
public PipeLine<From, String> toAttachmentName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_AttachmentName)); }
public PipeLine<From, BinaryContent> toAttachmentFile () { return pipe(new ORMAttributePipe<Me, BinaryContent>(FIELD_AttachmentFile)); }
public EmailMessage.EmailMessagePipeLineFactory<From, EmailMessage> toEmailMessage () { return toEmailMessage (Filter.ALL); }
public EmailMessage.EmailMessagePipeLineFactory<From, EmailMessage> toEmailMessage (Filter<EmailMessage> filter)
{
return EmailMessage.REFERENCE_EmailMessage.new EmailMessagePipeLineFactory<From, EmailMessage> (this, new ORMSingleAssocPipe<Me, EmailMessage>(SINGLEREFERENCE_EmailMessage, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyAttachment extends Attachment
{
// Default constructor primarily to support Externalisable
public DummyAttachment()
{
super();
}
public void assertValid ()
{
}
public EmailMessage getEmailMessage () throws StorageException
{
return (EmailMessage)(EmailMessage.DUMMY_EmailMessage);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getEmailMessageID ()
{
return EmailMessage.DUMMY_EmailMessage.getObjectID();
}
}
...@@ -46,9 +46,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -46,9 +46,14 @@ public abstract class BaseCandidate extends SecUserExtension
public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate"; public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate";
public static final String FIELD_VerificationKey = "VerificationKey"; public static final String FIELD_VerificationKey = "VerificationKey";
public static final String FIELD_IsAccountVerified = "IsAccountVerified"; public static final String FIELD_IsAccountVerified = "IsAccountVerified";
public static final String FIELD_IsPasswordChanged = "IsPasswordChanged";
public static final String FIELD_GoogleAddressText = "GoogleAddressText"; public static final String FIELD_GoogleAddressText = "GoogleAddressText";
public static final String FIELD_IsEmailIngest = "IsEmailIngest";
public static final String FIELD_IsMaskedEmail = "IsMaskedEmail";
public static final String FIELD_KnownAsAlias = "KnownAsAlias";
public static final String FIELD_PrivacyPolicyAgreed = "PrivacyPolicyAgreed"; public static final String FIELD_PrivacyPolicyAgreed = "PrivacyPolicyAgreed";
public static final String FIELD_ConditionsAgreed = "ConditionsAgreed"; public static final String FIELD_ConditionsAgreed = "ConditionsAgreed";
public static final String FIELD_HasValidAddress = "HasValidAddress";
public static final String SINGLEREFERENCE_TestInput = "TestInput"; public static final String SINGLEREFERENCE_TestInput = "TestInput";
public static final String BACKREF_TestInput = ""; public static final String BACKREF_TestInput = "";
public static final String MULTIPLEREFERENCE_TestAnalysises = "TestAnalysises"; public static final String MULTIPLEREFERENCE_TestAnalysises = "TestAnalysises";
...@@ -62,6 +67,7 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -62,6 +67,7 @@ public abstract class BaseCandidate extends SecUserExtension
// Static constants corresponding to searches // Static constants corresponding to searches
public static final String SEARCH_All = "All"; public static final String SEARCH_All = "All";
public static final String SEARCH_Alias = "Alias";
public static final String SEARCH_IdPin = "IdPin"; public static final String SEARCH_IdPin = "IdPin";
...@@ -72,9 +78,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -72,9 +78,14 @@ public abstract class BaseCandidate extends SecUserExtension
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsPasswordChanged = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsEmailIngest = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsMaskedEmail = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_KnownAsAlias = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_PrivacyPolicyAgreed = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_PrivacyPolicyAgreed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ConditionsAgreed = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_ConditionsAgreed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_HasValidAddress = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -84,9 +95,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -84,9 +95,14 @@ public abstract class BaseCandidate extends SecUserExtension
private Date _VerificationMailSendDate; private Date _VerificationMailSendDate;
private String _VerificationKey; private String _VerificationKey;
private Boolean _IsAccountVerified; private Boolean _IsAccountVerified;
private Boolean _IsPasswordChanged;
private String _GoogleAddressText; private String _GoogleAddressText;
private Boolean _IsEmailIngest;
private Boolean _IsMaskedEmail;
private String _KnownAsAlias;
private Boolean _PrivacyPolicyAgreed; private Boolean _PrivacyPolicyAgreed;
private Boolean _ConditionsAgreed; private Boolean _ConditionsAgreed;
private Boolean _HasValidAddress;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -106,13 +122,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -106,13 +122,18 @@ public abstract class BaseCandidate extends SecUserExtension
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_PrivacyPolicyAgreed_Validators; private static final AttributeValidator[] FIELD_PrivacyPolicyAgreed_Validators;
private static final AttributeValidator[] FIELD_ConditionsAgreed_Validators; private static final AttributeValidator[] FIELD_ConditionsAgreed_Validators;
private static final AttributeValidator[] FIELD_HasValidAddress_Validators;
private static final AttributeValidator[] FIELD_Phone_Validators; private static final AttributeValidator[] FIELD_Phone_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordMailSendDate_Validators; private static final AttributeValidator[] FIELD_ForgotPasswordMailSendDate_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators; private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators;
private static final AttributeValidator[] FIELD_VerificationMailSendDate_Validators; private static final AttributeValidator[] FIELD_VerificationMailSendDate_Validators;
private static final AttributeValidator[] FIELD_VerificationKey_Validators; private static final AttributeValidator[] FIELD_VerificationKey_Validators;
private static final AttributeValidator[] FIELD_IsAccountVerified_Validators; private static final AttributeValidator[] FIELD_IsAccountVerified_Validators;
private static final AttributeValidator[] FIELD_IsPasswordChanged_Validators;
private static final AttributeValidator[] FIELD_GoogleAddressText_Validators; private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
private static final AttributeValidator[] FIELD_IsEmailIngest_Validators;
private static final AttributeValidator[] FIELD_IsMaskedEmail_Validators;
private static final AttributeValidator[] FIELD_KnownAsAlias_Validators;
// Arrays of behaviour decorators // Arrays of behaviour decorators
...@@ -138,13 +159,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -138,13 +159,18 @@ public abstract class BaseCandidate extends SecUserExtension
setupAssocMetaData_TestInput(); setupAssocMetaData_TestInput();
FIELD_PrivacyPolicyAgreed_Validators = (AttributeValidator[])setupAttribMetaData_PrivacyPolicyAgreed(validatorMapping).toArray (new AttributeValidator[0]); FIELD_PrivacyPolicyAgreed_Validators = (AttributeValidator[])setupAttribMetaData_PrivacyPolicyAgreed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConditionsAgreed_Validators = (AttributeValidator[])setupAttribMetaData_ConditionsAgreed(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ConditionsAgreed_Validators = (AttributeValidator[])setupAttribMetaData_ConditionsAgreed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_HasValidAddress_Validators = (AttributeValidator[])setupAttribMetaData_HasValidAddress(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordMailSendDate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ForgotPasswordMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordMailSendDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_VerificationMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_VerificationMailSendDate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_VerificationMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_VerificationMailSendDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_VerificationKey_Validators = (AttributeValidator[])setupAttribMetaData_VerificationKey(validatorMapping).toArray (new AttributeValidator[0]); FIELD_VerificationKey_Validators = (AttributeValidator[])setupAttribMetaData_VerificationKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]); FIELD_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsPasswordChanged_Validators = (AttributeValidator[])setupAttribMetaData_IsPasswordChanged(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]); FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsEmailIngest_Validators = (AttributeValidator[])setupAttribMetaData_IsEmailIngest(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsMaskedEmail_Validators = (AttributeValidator[])setupAttribMetaData_IsMaskedEmail(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_KnownAsAlias_Validators = (AttributeValidator[])setupAttribMetaData_KnownAsAlias(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Candidate.initialiseReference (); REFERENCE_Candidate.initialiseReference ();
...@@ -267,6 +293,24 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -267,6 +293,24 @@ public abstract class BaseCandidate extends SecUserExtension
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_HasValidAddress(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "HasValidAddress");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.HasValidAddress:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_HasValidAddress, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "HasValidAddress", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.HasValidAddress:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Phone(Map validatorMapping) private static List setupAttribMetaData_Phone(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -379,6 +423,25 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -379,6 +423,25 @@ public abstract class BaseCandidate extends SecUserExtension
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_IsPasswordChanged(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_password_changed");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsPasswordChanged");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.IsPasswordChanged:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_IsPasswordChanged, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "IsPasswordChanged", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.IsPasswordChanged:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_GoogleAddressText(Map validatorMapping) private static List setupAttribMetaData_GoogleAddressText(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -397,6 +460,63 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -397,6 +460,63 @@ public abstract class BaseCandidate extends SecUserExtension
return validators; return validators;
} }
// Meta Info setup
private static List setupAttribMetaData_IsEmailIngest(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_email_ingest");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsEmailIngest");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.IsEmailIngest:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_IsEmailIngest, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "IsEmailIngest", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.IsEmailIngest:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_IsMaskedEmail(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_masked_email");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsMaskedEmail");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.IsMaskedEmail:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_IsMaskedEmail, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "IsMaskedEmail", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.IsMaskedEmail:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_KnownAsAlias(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "known_as_alias");
metaInfo.put ("length", "100");
metaInfo.put ("name", "KnownAsAlias");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.KnownAsAlias:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_KnownAsAlias, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "KnownAsAlias", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.KnownAsAlias:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION // END OF STATIC METADATA DEFINITION
...@@ -430,9 +550,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -430,9 +550,14 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate)); _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate));
_VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey)); _VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey));
_IsAccountVerified = (Boolean)(Boolean.FALSE); _IsAccountVerified = (Boolean)(Boolean.FALSE);
_IsPasswordChanged = (Boolean)(Boolean.FALSE);
_GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText)); _GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
_IsEmailIngest = (Boolean)(Boolean.FALSE);
_IsMaskedEmail = (Boolean)(Boolean.FALSE);
_KnownAsAlias = (String)(HELPER_KnownAsAlias.initialise (_KnownAsAlias));
_PrivacyPolicyAgreed = (Boolean)(Boolean.FALSE); _PrivacyPolicyAgreed = (Boolean)(Boolean.FALSE);
_ConditionsAgreed = (Boolean)(Boolean.FALSE); _ConditionsAgreed = (Boolean)(Boolean.FALSE);
_HasValidAddress = (Boolean)(Boolean.FALSE);
} }
...@@ -1056,6 +1181,104 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1056,6 +1181,104 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute IsPasswordChanged
*/
public Boolean getIsPasswordChanged ()
{
assertValid();
Boolean valToReturn = _IsPasswordChanged;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getIsPasswordChanged ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsPasswordChangedChange (Boolean newIsPasswordChanged) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsPasswordChangedChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsPasswordChanged ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsPasswordChanged. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsPasswordChanged (Boolean newIsPasswordChanged) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsPasswordChanged.compare (_IsPasswordChanged, newIsPasswordChanged);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newIsPasswordChanged = bhd.setIsPasswordChanged ((Candidate)this, newIsPasswordChanged);
oldAndNewIdentical = HELPER_IsPasswordChanged.compare (_IsPasswordChanged, newIsPasswordChanged);
}
if (FIELD_IsPasswordChanged_Validators.length > 0)
{
Object newIsPasswordChangedObj = HELPER_IsPasswordChanged.toObject (newIsPasswordChanged);
if (newIsPasswordChangedObj != null)
{
int loopMax = FIELD_IsPasswordChanged_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_IsPasswordChanged);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsPasswordChanged_Validators[v].checkAttribute (this, FIELD_IsPasswordChanged, metadata, newIsPasswordChangedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsPasswordChanged () != FieldWriteability.FALSE, "Field IsPasswordChanged is not writeable");
preIsPasswordChangedChange (newIsPasswordChanged);
markFieldChange (FIELD_IsPasswordChanged);
_IsPasswordChanged = newIsPasswordChanged;
postFieldChange (FIELD_IsPasswordChanged);
postIsPasswordChangedChange ();
}
}
/**
* Get the attribute GoogleAddressText * Get the attribute GoogleAddressText
*/ */
public String getGoogleAddressText () public String getGoogleAddressText ()
...@@ -1154,6 +1377,300 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1154,6 +1377,300 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute IsEmailIngest
*/
public Boolean getIsEmailIngest ()
{
assertValid();
Boolean valToReturn = _IsEmailIngest;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getIsEmailIngest ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsEmailIngestChange (Boolean newIsEmailIngest) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsEmailIngestChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsEmailIngest ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsEmailIngest. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsEmailIngest (Boolean newIsEmailIngest) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsEmailIngest.compare (_IsEmailIngest, newIsEmailIngest);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newIsEmailIngest = bhd.setIsEmailIngest ((Candidate)this, newIsEmailIngest);
oldAndNewIdentical = HELPER_IsEmailIngest.compare (_IsEmailIngest, newIsEmailIngest);
}
if (FIELD_IsEmailIngest_Validators.length > 0)
{
Object newIsEmailIngestObj = HELPER_IsEmailIngest.toObject (newIsEmailIngest);
if (newIsEmailIngestObj != null)
{
int loopMax = FIELD_IsEmailIngest_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_IsEmailIngest);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsEmailIngest_Validators[v].checkAttribute (this, FIELD_IsEmailIngest, metadata, newIsEmailIngestObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsEmailIngest () != FieldWriteability.FALSE, "Field IsEmailIngest is not writeable");
preIsEmailIngestChange (newIsEmailIngest);
markFieldChange (FIELD_IsEmailIngest);
_IsEmailIngest = newIsEmailIngest;
postFieldChange (FIELD_IsEmailIngest);
postIsEmailIngestChange ();
}
}
/**
* Get the attribute IsMaskedEmail
*/
public Boolean getIsMaskedEmail ()
{
assertValid();
Boolean valToReturn = _IsMaskedEmail;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getIsMaskedEmail ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsMaskedEmailChange (Boolean newIsMaskedEmail) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsMaskedEmailChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsMaskedEmail ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsMaskedEmail. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsMaskedEmail (Boolean newIsMaskedEmail) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsMaskedEmail.compare (_IsMaskedEmail, newIsMaskedEmail);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newIsMaskedEmail = bhd.setIsMaskedEmail ((Candidate)this, newIsMaskedEmail);
oldAndNewIdentical = HELPER_IsMaskedEmail.compare (_IsMaskedEmail, newIsMaskedEmail);
}
if (FIELD_IsMaskedEmail_Validators.length > 0)
{
Object newIsMaskedEmailObj = HELPER_IsMaskedEmail.toObject (newIsMaskedEmail);
if (newIsMaskedEmailObj != null)
{
int loopMax = FIELD_IsMaskedEmail_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_IsMaskedEmail);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsMaskedEmail_Validators[v].checkAttribute (this, FIELD_IsMaskedEmail, metadata, newIsMaskedEmailObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsMaskedEmail () != FieldWriteability.FALSE, "Field IsMaskedEmail is not writeable");
preIsMaskedEmailChange (newIsMaskedEmail);
markFieldChange (FIELD_IsMaskedEmail);
_IsMaskedEmail = newIsMaskedEmail;
postFieldChange (FIELD_IsMaskedEmail);
postIsMaskedEmailChange ();
}
}
/**
* Get the attribute KnownAsAlias
*/
public String getKnownAsAlias ()
{
assertValid();
String valToReturn = _KnownAsAlias;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getKnownAsAlias ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preKnownAsAliasChange (String newKnownAsAlias) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postKnownAsAliasChange () throws FieldException
{
}
public FieldWriteability getWriteability_KnownAsAlias ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute KnownAsAlias. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setKnownAsAlias (String newKnownAsAlias) throws FieldException
{
boolean oldAndNewIdentical = HELPER_KnownAsAlias.compare (_KnownAsAlias, newKnownAsAlias);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newKnownAsAlias = bhd.setKnownAsAlias ((Candidate)this, newKnownAsAlias);
oldAndNewIdentical = HELPER_KnownAsAlias.compare (_KnownAsAlias, newKnownAsAlias);
}
if (FIELD_KnownAsAlias_Validators.length > 0)
{
Object newKnownAsAliasObj = HELPER_KnownAsAlias.toObject (newKnownAsAlias);
if (newKnownAsAliasObj != null)
{
int loopMax = FIELD_KnownAsAlias_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_KnownAsAlias);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_KnownAsAlias_Validators[v].checkAttribute (this, FIELD_KnownAsAlias, metadata, newKnownAsAliasObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_KnownAsAlias () != FieldWriteability.FALSE, "Field KnownAsAlias is not writeable");
preKnownAsAliasChange (newKnownAsAlias);
markFieldChange (FIELD_KnownAsAlias);
_KnownAsAlias = newKnownAsAlias;
postFieldChange (FIELD_KnownAsAlias);
postKnownAsAliasChange ();
}
}
/**
* Get the attribute PrivacyPolicyAgreed * Get the attribute PrivacyPolicyAgreed
*/ */
public Boolean getPrivacyPolicyAgreed () public Boolean getPrivacyPolicyAgreed ()
...@@ -1322,7 +1839,105 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1322,7 +1839,105 @@ public abstract class BaseCandidate extends SecUserExtension
for (int v = 0 ; v < loopMax ; ++v) for (int v = 0 ; v < loopMax ; ++v)
{ {
FIELD_ConditionsAgreed_Validators[v].checkAttribute (this, FIELD_ConditionsAgreed, metadata, newConditionsAgreedObj); FIELD_ConditionsAgreed_Validators[v].checkAttribute (this, FIELD_ConditionsAgreed, metadata, newConditionsAgreedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ConditionsAgreed () != FieldWriteability.FALSE, "Field ConditionsAgreed is not writeable");
preConditionsAgreedChange (newConditionsAgreed);
markFieldChange (FIELD_ConditionsAgreed);
_ConditionsAgreed = newConditionsAgreed;
postFieldChange (FIELD_ConditionsAgreed);
postConditionsAgreedChange ();
}
}
/**
* Get the attribute HasValidAddress
*/
public Boolean getHasValidAddress ()
{
assertValid();
Boolean valToReturn = _HasValidAddress;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getHasValidAddress ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preHasValidAddressChange (Boolean newHasValidAddress) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postHasValidAddressChange () throws FieldException
{
}
public FieldWriteability getWriteability_HasValidAddress ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute HasValidAddress. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setHasValidAddress (Boolean newHasValidAddress) throws FieldException
{
boolean oldAndNewIdentical = HELPER_HasValidAddress.compare (_HasValidAddress, newHasValidAddress);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newHasValidAddress = bhd.setHasValidAddress ((Candidate)this, newHasValidAddress);
oldAndNewIdentical = HELPER_HasValidAddress.compare (_HasValidAddress, newHasValidAddress);
}
if (FIELD_HasValidAddress_Validators.length > 0)
{
Object newHasValidAddressObj = HELPER_HasValidAddress.toObject (newHasValidAddress);
if (newHasValidAddressObj != null)
{
int loopMax = FIELD_HasValidAddress_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_HasValidAddress);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_HasValidAddress_Validators[v].checkAttribute (this, FIELD_HasValidAddress, metadata, newHasValidAddressObj);
} }
} }
} }
...@@ -1340,12 +1955,12 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1340,12 +1955,12 @@ public abstract class BaseCandidate extends SecUserExtension
if (!oldAndNewIdentical) if (!oldAndNewIdentical)
{ {
assertValid(); assertValid();
Debug.assertion (getWriteability_ConditionsAgreed () != FieldWriteability.FALSE, "Field ConditionsAgreed is not writeable"); Debug.assertion (getWriteability_HasValidAddress () != FieldWriteability.FALSE, "Field HasValidAddress is not writeable");
preConditionsAgreedChange (newConditionsAgreed); preHasValidAddressChange (newHasValidAddress);
markFieldChange (FIELD_ConditionsAgreed); markFieldChange (FIELD_HasValidAddress);
_ConditionsAgreed = newConditionsAgreed; _HasValidAddress = newHasValidAddress;
postFieldChange (FIELD_ConditionsAgreed); postFieldChange (FIELD_HasValidAddress);
postConditionsAgreedChange (); postHasValidAddressChange ();
} }
} }
...@@ -2242,7 +2857,11 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2242,7 +2857,11 @@ public abstract class BaseCandidate extends SecUserExtension
oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject (_VerificationMailSendDate)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject (_VerificationMailSendDate)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationKey, HELPER_VerificationKey.toObject (_VerificationKey)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationKey, HELPER_VerificationKey.toObject (_VerificationKey)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsPasswordChanged, HELPER_IsPasswordChanged.toObject (_IsPasswordChanged)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject (_IsEmailIngest)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsMaskedEmail, HELPER_IsMaskedEmail.toObject (_IsMaskedEmail)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_KnownAsAlias, HELPER_KnownAsAlias.toObject (_KnownAsAlias)); //
_TestInput.getPersistentSets (allSets); _TestInput.getPersistentSets (allSets);
} }
...@@ -2264,7 +2883,11 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2264,7 +2883,11 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationMailSendDate))); // _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.fromObject (_VerificationKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationKey))); // _VerificationKey = (String)(HELPER_VerificationKey.fromObject (_VerificationKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); // _IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); //
_IsPasswordChanged = (Boolean)(HELPER_IsPasswordChanged.fromObject (_IsPasswordChanged, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsPasswordChanged))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (FIELD_GoogleAddressText))); // _GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (FIELD_GoogleAddressText))); //
_IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsEmailIngest))); //
_IsMaskedEmail = (Boolean)(HELPER_IsMaskedEmail.fromObject (_IsMaskedEmail, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsMaskedEmail))); //
_KnownAsAlias = (String)(HELPER_KnownAsAlias.fromObject (_KnownAsAlias, oneit_sec_user_extensionPSet.getAttrib (FIELD_KnownAsAlias))); //
_TestInput.setFromPersistentSets (objectID, allSets); _TestInput.setFromPersistentSets (objectID, allSets);
} }
...@@ -2337,6 +2960,15 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2337,6 +2960,15 @@ public abstract class BaseCandidate extends SecUserExtension
try try
{ {
setIsPasswordChanged (otherCandidate.getIsPasswordChanged ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setGoogleAddressText (otherCandidate.getGoogleAddressText ()); setGoogleAddressText (otherCandidate.getGoogleAddressText ());
} }
catch (FieldException ex) catch (FieldException ex)
...@@ -2344,6 +2976,33 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2344,6 +2976,33 @@ public abstract class BaseCandidate extends SecUserExtension
e.addException (ex); e.addException (ex);
} }
try
{
setIsEmailIngest (otherCandidate.getIsEmailIngest ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setIsMaskedEmail (otherCandidate.getIsMaskedEmail ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setKnownAsAlias (otherCandidate.getKnownAsAlias ());
}
catch (FieldException ex)
{
e.addException (ex);
}
} }
} }
...@@ -2365,9 +3024,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2365,9 +3024,14 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationMailSendDate = sourceCandidate._VerificationMailSendDate; _VerificationMailSendDate = sourceCandidate._VerificationMailSendDate;
_VerificationKey = sourceCandidate._VerificationKey; _VerificationKey = sourceCandidate._VerificationKey;
_IsAccountVerified = sourceCandidate._IsAccountVerified; _IsAccountVerified = sourceCandidate._IsAccountVerified;
_IsPasswordChanged = sourceCandidate._IsPasswordChanged;
_GoogleAddressText = sourceCandidate._GoogleAddressText; _GoogleAddressText = sourceCandidate._GoogleAddressText;
_IsEmailIngest = sourceCandidate._IsEmailIngest;
_IsMaskedEmail = sourceCandidate._IsMaskedEmail;
_KnownAsAlias = sourceCandidate._KnownAsAlias;
_PrivacyPolicyAgreed = sourceCandidate._PrivacyPolicyAgreed; _PrivacyPolicyAgreed = sourceCandidate._PrivacyPolicyAgreed;
_ConditionsAgreed = sourceCandidate._ConditionsAgreed; _ConditionsAgreed = sourceCandidate._ConditionsAgreed;
_HasValidAddress = sourceCandidate._HasValidAddress;
} }
} }
...@@ -2431,9 +3095,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2431,9 +3095,14 @@ public abstract class BaseCandidate extends SecUserExtension
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); // _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); // _VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); // _IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); //
_IsPasswordChanged = (Boolean)(HELPER_IsPasswordChanged.readExternal (_IsPasswordChanged, vals.get(FIELD_IsPasswordChanged))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); // _GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
_IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.readExternal (_IsEmailIngest, vals.get(FIELD_IsEmailIngest))); //
_IsMaskedEmail = (Boolean)(HELPER_IsMaskedEmail.readExternal (_IsMaskedEmail, vals.get(FIELD_IsMaskedEmail))); //
_KnownAsAlias = (String)(HELPER_KnownAsAlias.readExternal (_KnownAsAlias, vals.get(FIELD_KnownAsAlias))); //
_PrivacyPolicyAgreed = (Boolean)(HELPER_PrivacyPolicyAgreed.readExternal (_PrivacyPolicyAgreed, vals.get(FIELD_PrivacyPolicyAgreed))); // _PrivacyPolicyAgreed = (Boolean)(HELPER_PrivacyPolicyAgreed.readExternal (_PrivacyPolicyAgreed, vals.get(FIELD_PrivacyPolicyAgreed))); //
_ConditionsAgreed = (Boolean)(HELPER_ConditionsAgreed.readExternal (_ConditionsAgreed, vals.get(FIELD_ConditionsAgreed))); // _ConditionsAgreed = (Boolean)(HELPER_ConditionsAgreed.readExternal (_ConditionsAgreed, vals.get(FIELD_ConditionsAgreed))); //
_HasValidAddress = (Boolean)(HELPER_HasValidAddress.readExternal (_HasValidAddress, vals.get(FIELD_HasValidAddress))); //
_TestInput.readExternalData(vals.get(SINGLEREFERENCE_TestInput)); _TestInput.readExternalData(vals.get(SINGLEREFERENCE_TestInput));
_TestAnalysises.readExternalData(vals.get(MULTIPLEREFERENCE_TestAnalysises)); _TestAnalysises.readExternalData(vals.get(MULTIPLEREFERENCE_TestAnalysises));
_JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications)); _JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications));
...@@ -2456,9 +3125,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2456,9 +3125,14 @@ public abstract class BaseCandidate extends SecUserExtension
vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate)); vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate));
vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey)); vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey));
vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified)); vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified));
vals.put (FIELD_IsPasswordChanged, HELPER_IsPasswordChanged.writeExternal (_IsPasswordChanged));
vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText)); vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
vals.put (FIELD_IsEmailIngest, HELPER_IsEmailIngest.writeExternal (_IsEmailIngest));
vals.put (FIELD_IsMaskedEmail, HELPER_IsMaskedEmail.writeExternal (_IsMaskedEmail));
vals.put (FIELD_KnownAsAlias, HELPER_KnownAsAlias.writeExternal (_KnownAsAlias));
vals.put (FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.writeExternal (_PrivacyPolicyAgreed)); vals.put (FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.writeExternal (_PrivacyPolicyAgreed));
vals.put (FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.writeExternal (_ConditionsAgreed)); vals.put (FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.writeExternal (_ConditionsAgreed));
vals.put (FIELD_HasValidAddress, HELPER_HasValidAddress.writeExternal (_HasValidAddress));
vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData()); vals.put (SINGLEREFERENCE_TestInput, _TestInput.writeExternalData());
vals.put (MULTIPLEREFERENCE_TestAnalysises, _TestAnalysises.writeExternalData()); vals.put (MULTIPLEREFERENCE_TestAnalysises, _TestAnalysises.writeExternalData());
vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData()); vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData());
...@@ -2501,10 +3175,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2501,10 +3175,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
listener.notifyFieldChange(this, other, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(this._IsAccountVerified), HELPER_IsAccountVerified.toObject(otherCandidate._IsAccountVerified)); listener.notifyFieldChange(this, other, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(this._IsAccountVerified), HELPER_IsAccountVerified.toObject(otherCandidate._IsAccountVerified));
} }
if (!HELPER_IsPasswordChanged.compare(this._IsPasswordChanged, otherCandidate._IsPasswordChanged))
{
listener.notifyFieldChange(this, other, FIELD_IsPasswordChanged, HELPER_IsPasswordChanged.toObject(this._IsPasswordChanged), HELPER_IsPasswordChanged.toObject(otherCandidate._IsPasswordChanged));
}
if (!HELPER_GoogleAddressText.compare(this._GoogleAddressText, otherCandidate._GoogleAddressText)) if (!HELPER_GoogleAddressText.compare(this._GoogleAddressText, otherCandidate._GoogleAddressText))
{ {
listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherCandidate._GoogleAddressText)); listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherCandidate._GoogleAddressText));
} }
if (!HELPER_IsEmailIngest.compare(this._IsEmailIngest, otherCandidate._IsEmailIngest))
{
listener.notifyFieldChange(this, other, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(this._IsEmailIngest), HELPER_IsEmailIngest.toObject(otherCandidate._IsEmailIngest));
}
if (!HELPER_IsMaskedEmail.compare(this._IsMaskedEmail, otherCandidate._IsMaskedEmail))
{
listener.notifyFieldChange(this, other, FIELD_IsMaskedEmail, HELPER_IsMaskedEmail.toObject(this._IsMaskedEmail), HELPER_IsMaskedEmail.toObject(otherCandidate._IsMaskedEmail));
}
if (!HELPER_KnownAsAlias.compare(this._KnownAsAlias, otherCandidate._KnownAsAlias))
{
listener.notifyFieldChange(this, other, FIELD_KnownAsAlias, HELPER_KnownAsAlias.toObject(this._KnownAsAlias), HELPER_KnownAsAlias.toObject(otherCandidate._KnownAsAlias));
}
// Compare single assocs // Compare single assocs
_TestInput.compare (otherCandidate._TestInput, listener); _TestInput.compare (otherCandidate._TestInput, listener);
...@@ -2526,6 +3216,7 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2526,6 +3216,7 @@ public abstract class BaseCandidate extends SecUserExtension
visitor.visitField(this, FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.toObject(getPrivacyPolicyAgreed())); visitor.visitField(this, FIELD_PrivacyPolicyAgreed, HELPER_PrivacyPolicyAgreed.toObject(getPrivacyPolicyAgreed()));
visitor.visitField(this, FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.toObject(getConditionsAgreed())); visitor.visitField(this, FIELD_ConditionsAgreed, HELPER_ConditionsAgreed.toObject(getConditionsAgreed()));
visitor.visitField(this, FIELD_HasValidAddress, HELPER_HasValidAddress.toObject(getHasValidAddress()));
} }
...@@ -2540,7 +3231,11 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2540,7 +3231,11 @@ public abstract class BaseCandidate extends SecUserExtension
visitor.visitField(this, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(getVerificationMailSendDate())); visitor.visitField(this, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(getVerificationMailSendDate()));
visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey())); visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey()));
visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified())); visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified()));
visitor.visitField(this, FIELD_IsPasswordChanged, HELPER_IsPasswordChanged.toObject(getIsPasswordChanged()));
visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText())); visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
visitor.visitField(this, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(getIsEmailIngest()));
visitor.visitField(this, FIELD_IsMaskedEmail, HELPER_IsMaskedEmail.toObject(getIsMaskedEmail()));
visitor.visitField(this, FIELD_KnownAsAlias, HELPER_KnownAsAlias.toObject(getKnownAsAlias()));
visitor.visitAssociation (_TestInput); visitor.visitAssociation (_TestInput);
visitor.visitAssociation (_TestAnalysises); visitor.visitAssociation (_TestAnalysises);
visitor.visitAssociation (_JobApplications); visitor.visitAssociation (_JobApplications);
...@@ -2623,10 +3318,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2623,10 +3318,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return filter.matches (getIsAccountVerified ()); return filter.matches (getIsAccountVerified ());
} }
else if (attribName.equals (FIELD_IsPasswordChanged))
{
return filter.matches (getIsPasswordChanged ());
}
else if (attribName.equals (FIELD_GoogleAddressText)) else if (attribName.equals (FIELD_GoogleAddressText))
{ {
return filter.matches (getGoogleAddressText ()); return filter.matches (getGoogleAddressText ());
} }
else if (attribName.equals (FIELD_IsEmailIngest))
{
return filter.matches (getIsEmailIngest ());
}
else if (attribName.equals (FIELD_IsMaskedEmail))
{
return filter.matches (getIsMaskedEmail ());
}
else if (attribName.equals (FIELD_KnownAsAlias))
{
return filter.matches (getKnownAsAlias ());
}
else if (attribName.equals (SINGLEREFERENCE_TestInput)) else if (attribName.equals (SINGLEREFERENCE_TestInput))
{ {
return filter.matches (getTestInput ()); return filter.matches (getTestInput ());
...@@ -2698,12 +3409,36 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2698,12 +3409,36 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchAll andIsPasswordChanged (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_password_changed", "IsPasswordChanged");
return this;
}
public SearchAll andGoogleAddressText (QueryFilter<String> filter) public SearchAll andGoogleAddressText (QueryFilter<String> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.google_address_text", "GoogleAddressText"); filter.addFilter (context, "oneit_sec_user_extension.google_address_text", "GoogleAddressText");
return this; return this;
} }
public SearchAll andIsEmailIngest (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_email_ingest", "IsEmailIngest");
return this;
}
public SearchAll andIsMaskedEmail (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_masked_email", "IsMaskedEmail");
return this;
}
public SearchAll andKnownAsAlias (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.known_as_alias", "KnownAsAlias");
return this;
}
public SearchAll andTestInput (QueryFilter<TestInput> filter) public SearchAll andTestInput (QueryFilter<TestInput> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput"); filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
...@@ -2743,6 +3478,43 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2743,6 +3478,43 @@ public abstract class BaseCandidate extends SecUserExtension
.search (transaction); .search (transaction);
} }
public static SearchAlias SearchByAlias () { return new SearchAlias (); }
public static class SearchAlias extends SearchObject<Candidate>
{
public SearchAlias byKnownAs (String KnownAs)
{
by ("KnownAs", KnownAs);
return this;
}
public Candidate search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_Candidate, SEARCH_Alias, criteria);
Set<Candidate> typedResults = new LinkedHashSet <Candidate> ();
for (BaseBusinessClass bbcResult : results)
{
Candidate aResult = (Candidate)bbcResult;
typedResults.add (aResult);
}
return (Candidate)singletonResult(ObjstoreUtils.removeDeleted(transaction, typedResults).toArray(new BaseBusinessClass[0]), "Candidate", "");
}
}
public static Candidate searchAlias (ObjectTransaction transaction, String KnownAs) throws StorageException
{
return SearchByAlias ()
.byKnownAs (KnownAs)
.search (transaction);
}
public static SearchIdPin SearchByIdPin () { return new SearchIdPin (); } public static SearchIdPin SearchByIdPin () { return new SearchIdPin (); }
public static class SearchIdPin extends SearchObject<Candidate> public static class SearchIdPin extends SearchObject<Candidate>
...@@ -2815,12 +3587,36 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2815,12 +3587,36 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchIdPin andIsPasswordChanged (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_password_changed", "IsPasswordChanged");
return this;
}
public SearchIdPin andGoogleAddressText (QueryFilter<String> filter) public SearchIdPin andGoogleAddressText (QueryFilter<String> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.google_address_text", "GoogleAddressText"); filter.addFilter (context, "oneit_sec_user_extension.google_address_text", "GoogleAddressText");
return this; return this;
} }
public SearchIdPin andIsEmailIngest (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_email_ingest", "IsEmailIngest");
return this;
}
public SearchIdPin andIsMaskedEmail (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_masked_email", "IsMaskedEmail");
return this;
}
public SearchIdPin andKnownAsAlias (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.known_as_alias", "KnownAsAlias");
return this;
}
public SearchIdPin andTestInput (QueryFilter<TestInput> filter) public SearchIdPin andTestInput (QueryFilter<TestInput> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput"); filter.addFilter (context, "oneit_sec_user_extension.test_input_id", "TestInput");
...@@ -2892,10 +3688,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2892,10 +3688,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_IsAccountVerified.toObject (getIsAccountVerified ()); return HELPER_IsAccountVerified.toObject (getIsAccountVerified ());
} }
else if (attribName.equals (FIELD_IsPasswordChanged))
{
return HELPER_IsPasswordChanged.toObject (getIsPasswordChanged ());
}
else if (attribName.equals (FIELD_GoogleAddressText)) else if (attribName.equals (FIELD_GoogleAddressText))
{ {
return HELPER_GoogleAddressText.toObject (getGoogleAddressText ()); return HELPER_GoogleAddressText.toObject (getGoogleAddressText ());
} }
else if (attribName.equals (FIELD_IsEmailIngest))
{
return HELPER_IsEmailIngest.toObject (getIsEmailIngest ());
}
else if (attribName.equals (FIELD_IsMaskedEmail))
{
return HELPER_IsMaskedEmail.toObject (getIsMaskedEmail ());
}
else if (attribName.equals (FIELD_KnownAsAlias))
{
return HELPER_KnownAsAlias.toObject (getKnownAsAlias ());
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed)) else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{ {
return HELPER_PrivacyPolicyAgreed.toObject (getPrivacyPolicyAgreed ()); return HELPER_PrivacyPolicyAgreed.toObject (getPrivacyPolicyAgreed ());
...@@ -2904,6 +3716,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2904,6 +3716,10 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_ConditionsAgreed.toObject (getConditionsAgreed ()); return HELPER_ConditionsAgreed.toObject (getConditionsAgreed ());
} }
else if (attribName.equals (FIELD_HasValidAddress))
{
return HELPER_HasValidAddress.toObject (getHasValidAddress ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -2941,10 +3757,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2941,10 +3757,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_IsAccountVerified; return HELPER_IsAccountVerified;
} }
else if (attribName.equals (FIELD_IsPasswordChanged))
{
return HELPER_IsPasswordChanged;
}
else if (attribName.equals (FIELD_GoogleAddressText)) else if (attribName.equals (FIELD_GoogleAddressText))
{ {
return HELPER_GoogleAddressText; return HELPER_GoogleAddressText;
} }
else if (attribName.equals (FIELD_IsEmailIngest))
{
return HELPER_IsEmailIngest;
}
else if (attribName.equals (FIELD_IsMaskedEmail))
{
return HELPER_IsMaskedEmail;
}
else if (attribName.equals (FIELD_KnownAsAlias))
{
return HELPER_KnownAsAlias;
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed)) else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{ {
return HELPER_PrivacyPolicyAgreed; return HELPER_PrivacyPolicyAgreed;
...@@ -2953,6 +3785,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2953,6 +3785,10 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_ConditionsAgreed; return HELPER_ConditionsAgreed;
} }
else if (attribName.equals (FIELD_HasValidAddress))
{
return HELPER_HasValidAddress;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -2990,10 +3826,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2990,10 +3826,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue))); setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue)));
} }
else if (attribName.equals (FIELD_IsPasswordChanged))
{
setIsPasswordChanged ((Boolean)(HELPER_IsPasswordChanged.fromObject (_IsPasswordChanged, attribValue)));
}
else if (attribName.equals (FIELD_GoogleAddressText)) else if (attribName.equals (FIELD_GoogleAddressText))
{ {
setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue))); setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue)));
} }
else if (attribName.equals (FIELD_IsEmailIngest))
{
setIsEmailIngest ((Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, attribValue)));
}
else if (attribName.equals (FIELD_IsMaskedEmail))
{
setIsMaskedEmail ((Boolean)(HELPER_IsMaskedEmail.fromObject (_IsMaskedEmail, attribValue)));
}
else if (attribName.equals (FIELD_KnownAsAlias))
{
setKnownAsAlias ((String)(HELPER_KnownAsAlias.fromObject (_KnownAsAlias, attribValue)));
}
else if (attribName.equals (FIELD_PrivacyPolicyAgreed)) else if (attribName.equals (FIELD_PrivacyPolicyAgreed))
{ {
setPrivacyPolicyAgreed ((Boolean)(HELPER_PrivacyPolicyAgreed.fromObject (_PrivacyPolicyAgreed, attribValue))); setPrivacyPolicyAgreed ((Boolean)(HELPER_PrivacyPolicyAgreed.fromObject (_PrivacyPolicyAgreed, attribValue)));
...@@ -3002,6 +3854,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3002,6 +3854,10 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
setConditionsAgreed ((Boolean)(HELPER_ConditionsAgreed.fromObject (_ConditionsAgreed, attribValue))); setConditionsAgreed ((Boolean)(HELPER_ConditionsAgreed.fromObject (_ConditionsAgreed, attribValue)));
} }
else if (attribName.equals (FIELD_HasValidAddress))
{
setHasValidAddress ((Boolean)(HELPER_HasValidAddress.fromObject (_HasValidAddress, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -3046,10 +3902,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3046,10 +3902,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return getWriteability_IsAccountVerified (); return getWriteability_IsAccountVerified ();
} }
else if (fieldName.equals (FIELD_IsPasswordChanged))
{
return getWriteability_IsPasswordChanged ();
}
else if (fieldName.equals (FIELD_GoogleAddressText)) else if (fieldName.equals (FIELD_GoogleAddressText))
{ {
return getWriteability_GoogleAddressText (); return getWriteability_GoogleAddressText ();
} }
else if (fieldName.equals (FIELD_IsEmailIngest))
{
return getWriteability_IsEmailIngest ();
}
else if (fieldName.equals (FIELD_IsMaskedEmail))
{
return getWriteability_IsMaskedEmail ();
}
else if (fieldName.equals (FIELD_KnownAsAlias))
{
return getWriteability_KnownAsAlias ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_TestAnalysises)) else if (fieldName.equals (MULTIPLEREFERENCE_TestAnalysises))
{ {
return getWriteability_TestAnalysises (); return getWriteability_TestAnalysises ();
...@@ -3078,6 +3950,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3078,6 +3950,10 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return getWriteability_ConditionsAgreed (); return getWriteability_ConditionsAgreed ();
} }
else if (fieldName.equals (FIELD_HasValidAddress))
{
return getWriteability_HasValidAddress ();
}
else else
{ {
return super.getWriteable (fieldName); return super.getWriteable (fieldName);
...@@ -3118,11 +3994,31 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3118,11 +3994,31 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_IsAccountVerified); fields.add (FIELD_IsAccountVerified);
} }
if (getWriteability_IsPasswordChanged () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsPasswordChanged);
}
if (getWriteability_GoogleAddressText () != FieldWriteability.TRUE) if (getWriteability_GoogleAddressText () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_GoogleAddressText); fields.add (FIELD_GoogleAddressText);
} }
if (getWriteability_IsEmailIngest () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsEmailIngest);
}
if (getWriteability_IsMaskedEmail () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsMaskedEmail);
}
if (getWriteability_KnownAsAlias () != FieldWriteability.TRUE)
{
fields.add (FIELD_KnownAsAlias);
}
if (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.TRUE) if (getWriteability_PrivacyPolicyAgreed () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_PrivacyPolicyAgreed); fields.add (FIELD_PrivacyPolicyAgreed);
...@@ -3133,6 +4029,11 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3133,6 +4029,11 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_ConditionsAgreed); fields.add (FIELD_ConditionsAgreed);
} }
if (getWriteability_HasValidAddress () != FieldWriteability.TRUE)
{
fields.add (FIELD_HasValidAddress);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -3148,9 +4049,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3148,9 +4049,14 @@ public abstract class BaseCandidate extends SecUserExtension
result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate)); result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate));
result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey)); result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey));
result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified)); result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified));
result.add(HELPER_IsPasswordChanged.getAttribObject (getClass (), _IsPasswordChanged, false, FIELD_IsPasswordChanged));
result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText)); result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
result.add(HELPER_IsEmailIngest.getAttribObject (getClass (), _IsEmailIngest, false, FIELD_IsEmailIngest));
result.add(HELPER_IsMaskedEmail.getAttribObject (getClass (), _IsMaskedEmail, false, FIELD_IsMaskedEmail));
result.add(HELPER_KnownAsAlias.getAttribObject (getClass (), _KnownAsAlias, false, FIELD_KnownAsAlias));
result.add(HELPER_PrivacyPolicyAgreed.getAttribObject (getClass (), _PrivacyPolicyAgreed, false, FIELD_PrivacyPolicyAgreed)); result.add(HELPER_PrivacyPolicyAgreed.getAttribObject (getClass (), _PrivacyPolicyAgreed, false, FIELD_PrivacyPolicyAgreed));
result.add(HELPER_ConditionsAgreed.getAttribObject (getClass (), _ConditionsAgreed, false, FIELD_ConditionsAgreed)); result.add(HELPER_ConditionsAgreed.getAttribObject (getClass (), _ConditionsAgreed, false, FIELD_ConditionsAgreed));
result.add(HELPER_HasValidAddress.getAttribObject (getClass (), _HasValidAddress, false, FIELD_HasValidAddress));
return result; return result;
} }
...@@ -3310,6 +4216,24 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3310,6 +4216,24 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute IsPasswordChanged
*/
public Boolean getIsPasswordChanged (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsPasswordChanged.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsPasswordChanged (Candidate obj, Boolean newIsPasswordChanged) throws FieldException
{
return newIsPasswordChanged;
}
/**
* Get the attribute GoogleAddressText * Get the attribute GoogleAddressText
*/ */
public String getGoogleAddressText (Candidate obj, String original) public String getGoogleAddressText (Candidate obj, String original)
...@@ -3328,6 +4252,60 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3328,6 +4252,60 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute IsEmailIngest
*/
public Boolean getIsEmailIngest (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsEmailIngest.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsEmailIngest (Candidate obj, Boolean newIsEmailIngest) throws FieldException
{
return newIsEmailIngest;
}
/**
* Get the attribute IsMaskedEmail
*/
public Boolean getIsMaskedEmail (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsMaskedEmail.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsMaskedEmail (Candidate obj, Boolean newIsMaskedEmail) throws FieldException
{
return newIsMaskedEmail;
}
/**
* Get the attribute KnownAsAlias
*/
public String getKnownAsAlias (Candidate obj, String original)
{
return original;
}
/**
* Change the value set for attribute KnownAsAlias.
* May modify the field beforehand
* Occurs before validation.
*/
public String setKnownAsAlias (Candidate obj, String newKnownAsAlias) throws FieldException
{
return newKnownAsAlias;
}
/**
* Get the attribute PrivacyPolicyAgreed * Get the attribute PrivacyPolicyAgreed
*/ */
public Boolean getPrivacyPolicyAgreed (Candidate obj, Boolean original) public Boolean getPrivacyPolicyAgreed (Candidate obj, Boolean original)
...@@ -3363,6 +4341,24 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3363,6 +4341,24 @@ public abstract class BaseCandidate extends SecUserExtension
return newConditionsAgreed; return newConditionsAgreed;
} }
/**
* Get the attribute HasValidAddress
*/
public Boolean getHasValidAddress (Candidate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute HasValidAddress.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setHasValidAddress (Candidate obj, Boolean newHasValidAddress) throws FieldException
{
return newHasValidAddress;
}
} }
...@@ -3439,6 +4435,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3439,6 +4435,10 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return toConditionsAgreed (); return toConditionsAgreed ();
} }
if (name.equals ("HasValidAddress"))
{
return toHasValidAddress ();
}
if (name.equals ("Phone")) if (name.equals ("Phone"))
{ {
return toPhone (); return toPhone ();
...@@ -3463,10 +4463,26 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3463,10 +4463,26 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return toIsAccountVerified (); return toIsAccountVerified ();
} }
if (name.equals ("IsPasswordChanged"))
{
return toIsPasswordChanged ();
}
if (name.equals ("GoogleAddressText")) if (name.equals ("GoogleAddressText"))
{ {
return toGoogleAddressText (); return toGoogleAddressText ();
} }
if (name.equals ("IsEmailIngest"))
{
return toIsEmailIngest ();
}
if (name.equals ("IsMaskedEmail"))
{
return toIsMaskedEmail ();
}
if (name.equals ("KnownAsAlias"))
{
return toKnownAsAlias ();
}
if (name.equals ("TestInput")) if (name.equals ("TestInput"))
{ {
return toTestInput (); return toTestInput ();
...@@ -3481,6 +4497,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3481,6 +4497,8 @@ public abstract class BaseCandidate extends SecUserExtension
public PipeLine<From, Boolean> toConditionsAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ConditionsAgreed)); } public PipeLine<From, Boolean> toConditionsAgreed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_ConditionsAgreed)); }
public PipeLine<From, Boolean> toHasValidAddress () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_HasValidAddress)); }
public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); } public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); }
public PipeLine<From, Date> toForgotPasswordMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ForgotPasswordMailSendDate)); } public PipeLine<From, Date> toForgotPasswordMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ForgotPasswordMailSendDate)); }
...@@ -3493,7 +4511,15 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3493,7 +4511,15 @@ public abstract class BaseCandidate extends SecUserExtension
public PipeLine<From, Boolean> toIsAccountVerified () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsAccountVerified)); } public PipeLine<From, Boolean> toIsAccountVerified () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsAccountVerified)); }
public PipeLine<From, Boolean> toIsPasswordChanged () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsPasswordChanged)); }
public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); } public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); }
public PipeLine<From, Boolean> toIsEmailIngest () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsEmailIngest)); }
public PipeLine<From, Boolean> toIsMaskedEmail () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsMaskedEmail)); }
public PipeLine<From, String> toKnownAsAlias () { return pipe(new ORMAttributePipe<Me, String>(FIELD_KnownAsAlias)); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput () { return toTestInput (Filter.ALL); } public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput () { return toTestInput (Filter.ALL); }
public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput (Filter<TestInput> filter) public TestInput.TestInputPipeLineFactory<From, TestInput> toTestInput (Filter<TestInput> filter)
...@@ -3540,6 +4566,11 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -3540,6 +4566,11 @@ public abstract class BaseCandidate extends SecUserExtension
return true; return true;
} }
if(CollectionUtils.equals(attribName, "HasValidAddress"))
{
return true;
}
return super.isTransientAttrib(attribName); return super.isTransientAttrib(attribName);
} }
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
public abstract class BaseEmailMessage extends BaseBusinessClass
{
// Reference instance for the object
public static final EmailMessage REFERENCE_EmailMessage = new EmailMessage ();
// Reference instance for the object
public static final EmailMessage DUMMY_EmailMessage = new DummyEmailMessage ();
// Static constants corresponding to field names
public static final String FIELD_MessageId = "MessageId";
public static final String FIELD_EmailFrom = "EmailFrom";
public static final String FIELD_EmailTo = "EmailTo";
public static final String FIELD_EmailCC = "EmailCC";
public static final String FIELD_Subject = "Subject";
public static final String FIELD_Description = "Description";
public static final String FIELD_ReceivedDate = "ReceivedDate";
public static final String SINGLEREFERENCE_Job = "Job";
public static final String MULTIPLEREFERENCE_Attachments = "Attachments";
public static final String BACKREF_Attachments = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<EmailMessage> HELPER_MessageId = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_EmailFrom = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_EmailTo = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_EmailCC = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<EmailMessage> HELPER_ReceivedDate = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _MessageId;
private String _EmailFrom;
private String _EmailTo;
private String _EmailCC;
private String _Subject;
private String _Description;
private Date _ReceivedDate;
// Private attributes corresponding to single references
private SingleAssociation<EmailMessage, Job> _Job;
// Private attributes corresponding to multiple references
private MultipleAssociation<EmailMessage, Attachment> _Attachments;
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_EmailMessage = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_MessageId_Validators;
private static final AttributeValidator[] FIELD_EmailFrom_Validators;
private static final AttributeValidator[] FIELD_EmailTo_Validators;
private static final AttributeValidator[] FIELD_EmailCC_Validators;
private static final AttributeValidator[] FIELD_Subject_Validators;
private static final AttributeValidator[] FIELD_Description_Validators;
private static final AttributeValidator[] FIELD_ReceivedDate_Validators;
// Arrays of behaviour decorators
private static final EmailMessageBehaviourDecorator[] EmailMessage_BehaviourDecorators;
static
{
try
{
String tmp_Attachments = Attachment.BACKREF_EmailMessage;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_Attachments();
setupAssocMetaData_Job();
FIELD_MessageId_Validators = (AttributeValidator[])setupAttribMetaData_MessageId(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_EmailFrom_Validators = (AttributeValidator[])setupAttribMetaData_EmailFrom(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_EmailTo_Validators = (AttributeValidator[])setupAttribMetaData_EmailTo(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_EmailCC_Validators = (AttributeValidator[])setupAttribMetaData_EmailCC(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Subject_Validators = (AttributeValidator[])setupAttribMetaData_Subject(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Description_Validators = (AttributeValidator[])setupAttribMetaData_Description(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ReceivedDate_Validators = (AttributeValidator[])setupAttribMetaData_ReceivedDate(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_EmailMessage.initialiseReference ();
DUMMY_EmailMessage.initialiseReference ();
EmailMessage_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(EmailMessage.class).toArray(new EmailMessageBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_Attachments()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "EmailMessage");
metaInfo.put ("name", "Attachments");
metaInfo.put ("type", "Attachment");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.Attachments:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (MULTIPLEREFERENCE_Attachments, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_Job()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_id");
metaInfo.put ("name", "Job");
metaInfo.put ("type", "Job");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.Job:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (SINGLEREFERENCE_Job, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_MessageId(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_id");
metaInfo.put ("length", "1000");
metaInfo.put ("name", "MessageId");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.MessageId:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_MessageId, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "MessageId", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.MessageId:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_EmailFrom(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "email_from");
metaInfo.put ("length", "500");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "EmailFrom");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.EmailFrom:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_EmailFrom, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "EmailFrom", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.EmailFrom:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_EmailTo(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "email_to");
metaInfo.put ("length", "500");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "EmailTo");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.EmailTo:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_EmailTo, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "EmailTo", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.EmailTo:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_EmailCC(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "email_cc");
metaInfo.put ("length", "500");
metaInfo.put ("name", "EmailCC");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.EmailCC:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_EmailCC, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "EmailCC", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.EmailCC:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Subject(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "subject");
metaInfo.put ("length", "1000");
metaInfo.put ("name", "Subject");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.Subject:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_Subject, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "Subject", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.Subject:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Description(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "description");
metaInfo.put ("name", "Description");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.Description:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_Description, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "Description", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.Description:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ReceivedDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "received_date");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ReceivedDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for EmailMessage.ReceivedDate:", metaInfo);
ATTRIBUTES_METADATA_EmailMessage.put (FIELD_ReceivedDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(EmailMessage.class, "ReceivedDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for EmailMessage.ReceivedDate:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseEmailMessage ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return EmailMessage_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_MessageId = (String)(HELPER_MessageId.initialise (_MessageId));
_EmailFrom = (String)(HELPER_EmailFrom.initialise (_EmailFrom));
_EmailTo = (String)(HELPER_EmailTo.initialise (_EmailTo));
_EmailCC = (String)(HELPER_EmailCC.initialise (_EmailCC));
_Subject = (String)(HELPER_Subject.initialise (_Subject));
_Description = (String)(HELPER_Description.initialise (_Description));
_ReceivedDate = (Date)(HELPER_ReceivedDate.initialise (_ReceivedDate));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_Job = new SingleAssociation<EmailMessage, Job> (this, SINGLEREFERENCE_Job, null, Job.REFERENCE_Job, "tl_email_message");
_Attachments = new MultipleAssociation<EmailMessage, Attachment> (this, MULTIPLEREFERENCE_Attachments, Attachment.SINGLEREFERENCE_EmailMessage, Attachment.REFERENCE_Attachment);
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_Job = new SingleAssociation<EmailMessage, Job> (this, SINGLEREFERENCE_Job, null, Job.REFERENCE_Job, "tl_email_message");
_Attachments = new MultipleAssociation<EmailMessage, Attachment> (this, MULTIPLEREFERENCE_Attachments, Attachment.SINGLEREFERENCE_EmailMessage, Attachment.REFERENCE_Attachment);
return this;
}
/**
* Get the attribute MessageId
*/
public String getMessageId ()
{
assertValid();
String valToReturn = _MessageId;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getMessageId ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preMessageIdChange (String newMessageId) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postMessageIdChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageId ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageId. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageId (String newMessageId) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageId.compare (_MessageId, newMessageId);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newMessageId = bhd.setMessageId ((EmailMessage)this, newMessageId);
oldAndNewIdentical = HELPER_MessageId.compare (_MessageId, newMessageId);
}
if (FIELD_MessageId_Validators.length > 0)
{
Object newMessageIdObj = HELPER_MessageId.toObject (newMessageId);
if (newMessageIdObj != null)
{
int loopMax = FIELD_MessageId_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_MessageId);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageId_Validators[v].checkAttribute (this, FIELD_MessageId, metadata, newMessageIdObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageId () != FieldWriteability.FALSE, "Field MessageId is not writeable");
preMessageIdChange (newMessageId);
markFieldChange (FIELD_MessageId);
_MessageId = newMessageId;
postFieldChange (FIELD_MessageId);
postMessageIdChange ();
}
}
/**
* Get the attribute EmailFrom
*/
public String getEmailFrom ()
{
assertValid();
String valToReturn = _EmailFrom;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getEmailFrom ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preEmailFromChange (String newEmailFrom) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postEmailFromChange () throws FieldException
{
}
public FieldWriteability getWriteability_EmailFrom ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute EmailFrom. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmailFrom (String newEmailFrom) throws FieldException
{
boolean oldAndNewIdentical = HELPER_EmailFrom.compare (_EmailFrom, newEmailFrom);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newEmailFrom = bhd.setEmailFrom ((EmailMessage)this, newEmailFrom);
oldAndNewIdentical = HELPER_EmailFrom.compare (_EmailFrom, newEmailFrom);
}
BusinessObjectParser.assertFieldCondition (newEmailFrom != null, this, FIELD_EmailFrom, "mandatory");
if (FIELD_EmailFrom_Validators.length > 0)
{
Object newEmailFromObj = HELPER_EmailFrom.toObject (newEmailFrom);
if (newEmailFromObj != null)
{
int loopMax = FIELD_EmailFrom_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_EmailFrom);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_EmailFrom_Validators[v].checkAttribute (this, FIELD_EmailFrom, metadata, newEmailFromObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_EmailFrom () != FieldWriteability.FALSE, "Field EmailFrom is not writeable");
preEmailFromChange (newEmailFrom);
markFieldChange (FIELD_EmailFrom);
_EmailFrom = newEmailFrom;
postFieldChange (FIELD_EmailFrom);
postEmailFromChange ();
}
}
/**
* Get the attribute EmailTo
*/
public String getEmailTo ()
{
assertValid();
String valToReturn = _EmailTo;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getEmailTo ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preEmailToChange (String newEmailTo) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postEmailToChange () throws FieldException
{
}
public FieldWriteability getWriteability_EmailTo ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute EmailTo. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmailTo (String newEmailTo) throws FieldException
{
boolean oldAndNewIdentical = HELPER_EmailTo.compare (_EmailTo, newEmailTo);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newEmailTo = bhd.setEmailTo ((EmailMessage)this, newEmailTo);
oldAndNewIdentical = HELPER_EmailTo.compare (_EmailTo, newEmailTo);
}
BusinessObjectParser.assertFieldCondition (newEmailTo != null, this, FIELD_EmailTo, "mandatory");
if (FIELD_EmailTo_Validators.length > 0)
{
Object newEmailToObj = HELPER_EmailTo.toObject (newEmailTo);
if (newEmailToObj != null)
{
int loopMax = FIELD_EmailTo_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_EmailTo);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_EmailTo_Validators[v].checkAttribute (this, FIELD_EmailTo, metadata, newEmailToObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_EmailTo () != FieldWriteability.FALSE, "Field EmailTo is not writeable");
preEmailToChange (newEmailTo);
markFieldChange (FIELD_EmailTo);
_EmailTo = newEmailTo;
postFieldChange (FIELD_EmailTo);
postEmailToChange ();
}
}
/**
* Get the attribute EmailCC
*/
public String getEmailCC ()
{
assertValid();
String valToReturn = _EmailCC;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getEmailCC ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preEmailCCChange (String newEmailCC) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postEmailCCChange () throws FieldException
{
}
public FieldWriteability getWriteability_EmailCC ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute EmailCC. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmailCC (String newEmailCC) throws FieldException
{
boolean oldAndNewIdentical = HELPER_EmailCC.compare (_EmailCC, newEmailCC);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newEmailCC = bhd.setEmailCC ((EmailMessage)this, newEmailCC);
oldAndNewIdentical = HELPER_EmailCC.compare (_EmailCC, newEmailCC);
}
if (FIELD_EmailCC_Validators.length > 0)
{
Object newEmailCCObj = HELPER_EmailCC.toObject (newEmailCC);
if (newEmailCCObj != null)
{
int loopMax = FIELD_EmailCC_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_EmailCC);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_EmailCC_Validators[v].checkAttribute (this, FIELD_EmailCC, metadata, newEmailCCObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_EmailCC () != FieldWriteability.FALSE, "Field EmailCC is not writeable");
preEmailCCChange (newEmailCC);
markFieldChange (FIELD_EmailCC);
_EmailCC = newEmailCC;
postFieldChange (FIELD_EmailCC);
postEmailCCChange ();
}
}
/**
* Get the attribute Subject
*/
public String getSubject ()
{
assertValid();
String valToReturn = _Subject;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getSubject ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSubjectChange (String newSubject) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSubjectChange () throws FieldException
{
}
public FieldWriteability getWriteability_Subject ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Subject. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSubject (String newSubject) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newSubject = bhd.setSubject ((EmailMessage)this, newSubject);
oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
}
if (FIELD_Subject_Validators.length > 0)
{
Object newSubjectObj = HELPER_Subject.toObject (newSubject);
if (newSubjectObj != null)
{
int loopMax = FIELD_Subject_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_Subject);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Subject_Validators[v].checkAttribute (this, FIELD_Subject, metadata, newSubjectObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Subject () != FieldWriteability.FALSE, "Field Subject is not writeable");
preSubjectChange (newSubject);
markFieldChange (FIELD_Subject);
_Subject = newSubject;
postFieldChange (FIELD_Subject);
postSubjectChange ();
}
}
/**
* Get the attribute Description
*/
public String getDescription ()
{
assertValid();
String valToReturn = _Description;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getDescription ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preDescriptionChange (String newDescription) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postDescriptionChange () throws FieldException
{
}
public FieldWriteability getWriteability_Description ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Description. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDescription (String newDescription) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newDescription = bhd.setDescription ((EmailMessage)this, newDescription);
oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
}
if (FIELD_Description_Validators.length > 0)
{
Object newDescriptionObj = HELPER_Description.toObject (newDescription);
if (newDescriptionObj != null)
{
int loopMax = FIELD_Description_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_Description);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Description_Validators[v].checkAttribute (this, FIELD_Description, metadata, newDescriptionObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Description () != FieldWriteability.FALSE, "Field Description is not writeable");
preDescriptionChange (newDescription);
markFieldChange (FIELD_Description);
_Description = newDescription;
postFieldChange (FIELD_Description);
postDescriptionChange ();
}
}
/**
* Get the attribute ReceivedDate
*/
public Date getReceivedDate ()
{
assertValid();
Date valToReturn = _ReceivedDate;
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
valToReturn = bhd.getReceivedDate ((EmailMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preReceivedDateChange (Date newReceivedDate) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postReceivedDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_ReceivedDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ReceivedDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setReceivedDate (Date newReceivedDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ReceivedDate.compare (_ReceivedDate, newReceivedDate);
try
{
for (EmailMessageBehaviourDecorator bhd : EmailMessage_BehaviourDecorators)
{
newReceivedDate = bhd.setReceivedDate ((EmailMessage)this, newReceivedDate);
oldAndNewIdentical = HELPER_ReceivedDate.compare (_ReceivedDate, newReceivedDate);
}
BusinessObjectParser.assertFieldCondition (newReceivedDate != null, this, FIELD_ReceivedDate, "mandatory");
if (FIELD_ReceivedDate_Validators.length > 0)
{
Object newReceivedDateObj = HELPER_ReceivedDate.toObject (newReceivedDate);
if (newReceivedDateObj != null)
{
int loopMax = FIELD_ReceivedDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_EmailMessage.get (FIELD_ReceivedDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ReceivedDate_Validators[v].checkAttribute (this, FIELD_ReceivedDate, metadata, newReceivedDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ReceivedDate () != FieldWriteability.FALSE, "Field ReceivedDate is not writeable");
preReceivedDateChange (newReceivedDate);
markFieldChange (FIELD_ReceivedDate);
_ReceivedDate = newReceivedDate;
postFieldChange (FIELD_ReceivedDate);
postReceivedDateChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("Job");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return _Job.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return null ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJob ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJob (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJobID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
setJob ((Job)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference Job
*/
public Job getJob () throws StorageException
{
assertValid();
try
{
return (Job)(_Job.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in EmailMessage:", this.getObjectID (), ", was trying to get Job:", getJobID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Job.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Job getJob (Get getType) throws StorageException
{
assertValid();
return _Job.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobID ()
{
assertValid();
if (_Job == null)
{
return null;
}
else
{
return _Job.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preJobChange (Job newJob) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobChange () throws FieldException
{
}
public FieldWriteability getWriteability_Job ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference Job. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setJob (Job newJob) throws StorageException, FieldException
{
if (_Job.wouldReferencedChange (newJob))
{
assertValid();
Debug.assertion (getWriteability_Job () != FieldWriteability.FALSE, "Assoc Job is not writeable");
preJobChange (newJob);
_Job.set (newJob);
postJobChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
result.add("Attachments");
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
return Attachment.REFERENCE_Attachment ;
}
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
return Attachment.SINGLEREFERENCE_EmailMessage ;
}
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
return this.getAttachmentsCount();
}
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
return this.getAttachmentsAt(index);
}
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
addToAttachments((Attachment)newElement);
return;
}
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
removeFromAttachments((Attachment)oldElement);
return;
}
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
_Attachments.__loadAssociation (elements);
return;
}
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
if (MULTIPLEREFERENCE_Attachments.equals(attribName))
{
return _Attachments.isLoaded ();
}
return super.__isMultiAssocLoaded(attribName);
}
public FieldWriteability getWriteability_Attachments ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
public int getAttachmentsCount () throws StorageException
{
assertValid();
return _Attachments.getReferencedObjectsCount ();
}
public void addToAttachments (Attachment newElement) throws StorageException
{
if (_Attachments.wouldAddChange (newElement))
{
assertValid();
Debug.assertion (getWriteability_Attachments () != FieldWriteability.FALSE, "MultiAssoc Attachments is not writeable (add)");
_Attachments.appendElement (newElement);
try
{
if (newElement.getEmailMessage () != this)
{
newElement.setEmailMessage ((EmailMessage)(this));
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public void removeFromAttachments (Attachment elementToRemove) throws StorageException
{
if (_Attachments.wouldRemoveChange (elementToRemove))
{
assertValid();
Debug.assertion (getWriteability_Attachments () != FieldWriteability.FALSE, "MultiAssoc Attachments is not writeable (remove)");
_Attachments.removeElement (elementToRemove);
try
{
if (elementToRemove.getEmailMessage () != null)
{
elementToRemove.setEmailMessage (null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public Attachment getAttachmentsAt (int index) throws StorageException
{
return (Attachment)(_Attachments.getElementAt (index));
}
public SortedSet<Attachment> getAttachmentsSet () throws StorageException
{
return _Attachments.getSet ();
}
public void onDelete ()
{
try
{
for(Attachment referenced : CollectionUtils.reverse(getAttachmentsSet()))
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null EmailMessage from ", getObjectID (), " to ", referenced.getObjectID ());
referenced.setEmailMessage(null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public EmailMessage newInstance ()
{
return new EmailMessage ();
}
public EmailMessage referenceInstance ()
{
return REFERENCE_EmailMessage;
}
public EmailMessage getInTransaction (ObjectTransaction t) throws StorageException
{
return getEmailMessageByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_EmailMessage;
}
public String getBaseSetName ()
{
return "tl_email_message";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_email_messagePSet = allSets.getPersistentSet (myID, "tl_email_message", myPSetStatus);
tl_email_messagePSet.setAttrib (FIELD_ObjectID, myID);
tl_email_messagePSet.setAttrib (FIELD_MessageId, HELPER_MessageId.toObject (_MessageId)); //
tl_email_messagePSet.setAttrib (FIELD_EmailFrom, HELPER_EmailFrom.toObject (_EmailFrom)); //
tl_email_messagePSet.setAttrib (FIELD_EmailTo, HELPER_EmailTo.toObject (_EmailTo)); //
tl_email_messagePSet.setAttrib (FIELD_EmailCC, HELPER_EmailCC.toObject (_EmailCC)); //
tl_email_messagePSet.setAttrib (FIELD_Subject, HELPER_Subject.toObject (_Subject)); //
tl_email_messagePSet.setAttrib (FIELD_Description, HELPER_Description.toObject (_Description)); //
tl_email_messagePSet.setAttrib (FIELD_ReceivedDate, HELPER_ReceivedDate.toObject (_ReceivedDate)); //
_Job.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_email_messagePSet = allSets.getPersistentSet (objectID, "tl_email_message");
_MessageId = (String)(HELPER_MessageId.fromObject (_MessageId, tl_email_messagePSet.getAttrib (FIELD_MessageId))); //
_EmailFrom = (String)(HELPER_EmailFrom.fromObject (_EmailFrom, tl_email_messagePSet.getAttrib (FIELD_EmailFrom))); //
_EmailTo = (String)(HELPER_EmailTo.fromObject (_EmailTo, tl_email_messagePSet.getAttrib (FIELD_EmailTo))); //
_EmailCC = (String)(HELPER_EmailCC.fromObject (_EmailCC, tl_email_messagePSet.getAttrib (FIELD_EmailCC))); //
_Subject = (String)(HELPER_Subject.fromObject (_Subject, tl_email_messagePSet.getAttrib (FIELD_Subject))); //
_Description = (String)(HELPER_Description.fromObject (_Description, tl_email_messagePSet.getAttrib (FIELD_Description))); //
_ReceivedDate = (Date)(HELPER_ReceivedDate.fromObject (_ReceivedDate, tl_email_messagePSet.getAttrib (FIELD_ReceivedDate))); //
_Job.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof EmailMessage)
{
EmailMessage otherEmailMessage = (EmailMessage)other;
try
{
setMessageId (otherEmailMessage.getMessageId ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setEmailFrom (otherEmailMessage.getEmailFrom ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setEmailTo (otherEmailMessage.getEmailTo ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setEmailCC (otherEmailMessage.getEmailCC ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setSubject (otherEmailMessage.getSubject ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setDescription (otherEmailMessage.getDescription ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setReceivedDate (otherEmailMessage.getReceivedDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseEmailMessage)
{
BaseEmailMessage sourceEmailMessage = (BaseEmailMessage)(source);
_MessageId = sourceEmailMessage._MessageId;
_EmailFrom = sourceEmailMessage._EmailFrom;
_EmailTo = sourceEmailMessage._EmailTo;
_EmailCC = sourceEmailMessage._EmailCC;
_Subject = sourceEmailMessage._Subject;
_Description = sourceEmailMessage._Description;
_ReceivedDate = sourceEmailMessage._ReceivedDate;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseEmailMessage)
{
BaseEmailMessage sourceEmailMessage = (BaseEmailMessage)(source);
_Job.copyFrom (sourceEmailMessage._Job, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseEmailMessage)
{
BaseEmailMessage sourceEmailMessage = (BaseEmailMessage)(source);
_Attachments.copyFrom (sourceEmailMessage._Attachments, linkToGhosts);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_MessageId = (String)(HELPER_MessageId.readExternal (_MessageId, vals.get(FIELD_MessageId))); //
_EmailFrom = (String)(HELPER_EmailFrom.readExternal (_EmailFrom, vals.get(FIELD_EmailFrom))); //
_EmailTo = (String)(HELPER_EmailTo.readExternal (_EmailTo, vals.get(FIELD_EmailTo))); //
_EmailCC = (String)(HELPER_EmailCC.readExternal (_EmailCC, vals.get(FIELD_EmailCC))); //
_Subject = (String)(HELPER_Subject.readExternal (_Subject, vals.get(FIELD_Subject))); //
_Description = (String)(HELPER_Description.readExternal (_Description, vals.get(FIELD_Description))); //
_ReceivedDate = (Date)(HELPER_ReceivedDate.readExternal (_ReceivedDate, vals.get(FIELD_ReceivedDate))); //
_Job.readExternalData(vals.get(SINGLEREFERENCE_Job));
_Attachments.readExternalData(vals.get(MULTIPLEREFERENCE_Attachments));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_MessageId, HELPER_MessageId.writeExternal (_MessageId));
vals.put (FIELD_EmailFrom, HELPER_EmailFrom.writeExternal (_EmailFrom));
vals.put (FIELD_EmailTo, HELPER_EmailTo.writeExternal (_EmailTo));
vals.put (FIELD_EmailCC, HELPER_EmailCC.writeExternal (_EmailCC));
vals.put (FIELD_Subject, HELPER_Subject.writeExternal (_Subject));
vals.put (FIELD_Description, HELPER_Description.writeExternal (_Description));
vals.put (FIELD_ReceivedDate, HELPER_ReceivedDate.writeExternal (_ReceivedDate));
vals.put (SINGLEREFERENCE_Job, _Job.writeExternalData());
vals.put (MULTIPLEREFERENCE_Attachments, _Attachments.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseEmailMessage)
{
BaseEmailMessage otherEmailMessage = (BaseEmailMessage)(other);
if (!HELPER_MessageId.compare(this._MessageId, otherEmailMessage._MessageId))
{
listener.notifyFieldChange(this, other, FIELD_MessageId, HELPER_MessageId.toObject(this._MessageId), HELPER_MessageId.toObject(otherEmailMessage._MessageId));
}
if (!HELPER_EmailFrom.compare(this._EmailFrom, otherEmailMessage._EmailFrom))
{
listener.notifyFieldChange(this, other, FIELD_EmailFrom, HELPER_EmailFrom.toObject(this._EmailFrom), HELPER_EmailFrom.toObject(otherEmailMessage._EmailFrom));
}
if (!HELPER_EmailTo.compare(this._EmailTo, otherEmailMessage._EmailTo))
{
listener.notifyFieldChange(this, other, FIELD_EmailTo, HELPER_EmailTo.toObject(this._EmailTo), HELPER_EmailTo.toObject(otherEmailMessage._EmailTo));
}
if (!HELPER_EmailCC.compare(this._EmailCC, otherEmailMessage._EmailCC))
{
listener.notifyFieldChange(this, other, FIELD_EmailCC, HELPER_EmailCC.toObject(this._EmailCC), HELPER_EmailCC.toObject(otherEmailMessage._EmailCC));
}
if (!HELPER_Subject.compare(this._Subject, otherEmailMessage._Subject))
{
listener.notifyFieldChange(this, other, FIELD_Subject, HELPER_Subject.toObject(this._Subject), HELPER_Subject.toObject(otherEmailMessage._Subject));
}
if (!HELPER_Description.compare(this._Description, otherEmailMessage._Description))
{
listener.notifyFieldChange(this, other, FIELD_Description, HELPER_Description.toObject(this._Description), HELPER_Description.toObject(otherEmailMessage._Description));
}
if (!HELPER_ReceivedDate.compare(this._ReceivedDate, otherEmailMessage._ReceivedDate))
{
listener.notifyFieldChange(this, other, FIELD_ReceivedDate, HELPER_ReceivedDate.toObject(this._ReceivedDate), HELPER_ReceivedDate.toObject(otherEmailMessage._ReceivedDate));
}
// Compare single assocs
_Job.compare (otherEmailMessage._Job, listener);
// Compare multiple assocs
_Attachments.compare (otherEmailMessage._Attachments, listener);
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_MessageId, HELPER_MessageId.toObject(getMessageId()));
visitor.visitField(this, FIELD_EmailFrom, HELPER_EmailFrom.toObject(getEmailFrom()));
visitor.visitField(this, FIELD_EmailTo, HELPER_EmailTo.toObject(getEmailTo()));
visitor.visitField(this, FIELD_EmailCC, HELPER_EmailCC.toObject(getEmailCC()));
visitor.visitField(this, FIELD_Subject, HELPER_Subject.toObject(getSubject()));
visitor.visitField(this, FIELD_Description, HELPER_Description.toObject(getDescription()));
visitor.visitField(this, FIELD_ReceivedDate, HELPER_ReceivedDate.toObject(getReceivedDate()));
visitor.visitAssociation (_Job);
visitor.visitAssociation (_Attachments);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_Job))
{
visitor.visit (_Job);
}
if (scope.includes (_Attachments))
{
visitor.visit (_Attachments);
}
}
public static EmailMessage createEmailMessage (ObjectTransaction transaction) throws StorageException
{
EmailMessage result = new EmailMessage ();
result.initialiseNewObject (transaction);
return result;
}
public static EmailMessage getEmailMessageByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (EmailMessage)(transaction.getObjectByID (REFERENCE_EmailMessage, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageId))
{
return filter.matches (getMessageId ());
}
else if (attribName.equals (FIELD_EmailFrom))
{
return filter.matches (getEmailFrom ());
}
else if (attribName.equals (FIELD_EmailTo))
{
return filter.matches (getEmailTo ());
}
else if (attribName.equals (FIELD_EmailCC))
{
return filter.matches (getEmailCC ());
}
else if (attribName.equals (FIELD_Subject))
{
return filter.matches (getSubject ());
}
else if (attribName.equals (FIELD_Description))
{
return filter.matches (getDescription ());
}
else if (attribName.equals (FIELD_ReceivedDate))
{
return filter.matches (getReceivedDate ());
}
else if (attribName.equals (SINGLEREFERENCE_Job))
{
return filter.matches (getJob ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<EmailMessage>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_email_message.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_email_message.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_email_message.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andMessageId (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.message_id", "MessageId");
return this;
}
public SearchAll andEmailFrom (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.email_from", "EmailFrom");
return this;
}
public SearchAll andEmailTo (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.email_to", "EmailTo");
return this;
}
public SearchAll andEmailCC (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.email_cc", "EmailCC");
return this;
}
public SearchAll andSubject (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.subject", "Subject");
return this;
}
public SearchAll andDescription (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_email_message.description", "Description");
return this;
}
public SearchAll andReceivedDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_email_message.received_date", "ReceivedDate");
return this;
}
public SearchAll andJob (QueryFilter<Job> filter)
{
filter.addFilter (context, "tl_email_message.job_id", "Job");
return this;
}
public EmailMessage[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_EmailMessage, SEARCH_All, criteria);
Set<EmailMessage> typedResults = new LinkedHashSet <EmailMessage> ();
for (BaseBusinessClass bbcResult : results)
{
EmailMessage aResult = (EmailMessage)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new EmailMessage[0]);
}
}
public static EmailMessage[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageId))
{
return HELPER_MessageId.toObject (getMessageId ());
}
else if (attribName.equals (FIELD_EmailFrom))
{
return HELPER_EmailFrom.toObject (getEmailFrom ());
}
else if (attribName.equals (FIELD_EmailTo))
{
return HELPER_EmailTo.toObject (getEmailTo ());
}
else if (attribName.equals (FIELD_EmailCC))
{
return HELPER_EmailCC.toObject (getEmailCC ());
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject.toObject (getSubject ());
}
else if (attribName.equals (FIELD_Description))
{
return HELPER_Description.toObject (getDescription ());
}
else if (attribName.equals (FIELD_ReceivedDate))
{
return HELPER_ReceivedDate.toObject (getReceivedDate ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageId))
{
return HELPER_MessageId;
}
else if (attribName.equals (FIELD_EmailFrom))
{
return HELPER_EmailFrom;
}
else if (attribName.equals (FIELD_EmailTo))
{
return HELPER_EmailTo;
}
else if (attribName.equals (FIELD_EmailCC))
{
return HELPER_EmailCC;
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject;
}
else if (attribName.equals (FIELD_Description))
{
return HELPER_Description;
}
else if (attribName.equals (FIELD_ReceivedDate))
{
return HELPER_ReceivedDate;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_MessageId))
{
setMessageId ((String)(HELPER_MessageId.fromObject (_MessageId, attribValue)));
}
else if (attribName.equals (FIELD_EmailFrom))
{
setEmailFrom ((String)(HELPER_EmailFrom.fromObject (_EmailFrom, attribValue)));
}
else if (attribName.equals (FIELD_EmailTo))
{
setEmailTo ((String)(HELPER_EmailTo.fromObject (_EmailTo, attribValue)));
}
else if (attribName.equals (FIELD_EmailCC))
{
setEmailCC ((String)(HELPER_EmailCC.fromObject (_EmailCC, attribValue)));
}
else if (attribName.equals (FIELD_Subject))
{
setSubject ((String)(HELPER_Subject.fromObject (_Subject, attribValue)));
}
else if (attribName.equals (FIELD_Description))
{
setDescription ((String)(HELPER_Description.fromObject (_Description, attribValue)));
}
else if (attribName.equals (FIELD_ReceivedDate))
{
setReceivedDate ((Date)(HELPER_ReceivedDate.fromObject (_ReceivedDate, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_MessageId))
{
return getWriteability_MessageId ();
}
else if (fieldName.equals (FIELD_EmailFrom))
{
return getWriteability_EmailFrom ();
}
else if (fieldName.equals (FIELD_EmailTo))
{
return getWriteability_EmailTo ();
}
else if (fieldName.equals (FIELD_EmailCC))
{
return getWriteability_EmailCC ();
}
else if (fieldName.equals (FIELD_Subject))
{
return getWriteability_Subject ();
}
else if (fieldName.equals (FIELD_Description))
{
return getWriteability_Description ();
}
else if (fieldName.equals (FIELD_ReceivedDate))
{
return getWriteability_ReceivedDate ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Attachments))
{
return getWriteability_Attachments ();
}
else if (fieldName.equals (SINGLEREFERENCE_Job))
{
return getWriteability_Job ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_MessageId () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageId);
}
if (getWriteability_EmailFrom () != FieldWriteability.TRUE)
{
fields.add (FIELD_EmailFrom);
}
if (getWriteability_EmailTo () != FieldWriteability.TRUE)
{
fields.add (FIELD_EmailTo);
}
if (getWriteability_EmailCC () != FieldWriteability.TRUE)
{
fields.add (FIELD_EmailCC);
}
if (getWriteability_Subject () != FieldWriteability.TRUE)
{
fields.add (FIELD_Subject);
}
if (getWriteability_Description () != FieldWriteability.TRUE)
{
fields.add (FIELD_Description);
}
if (getWriteability_ReceivedDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_ReceivedDate);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_MessageId.getAttribObject (getClass (), _MessageId, false, FIELD_MessageId));
result.add(HELPER_EmailFrom.getAttribObject (getClass (), _EmailFrom, true, FIELD_EmailFrom));
result.add(HELPER_EmailTo.getAttribObject (getClass (), _EmailTo, true, FIELD_EmailTo));
result.add(HELPER_EmailCC.getAttribObject (getClass (), _EmailCC, false, FIELD_EmailCC));
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, false, FIELD_Subject));
result.add(HELPER_Description.getAttribObject (getClass (), _Description, false, FIELD_Description));
result.add(HELPER_ReceivedDate.getAttribObject (getClass (), _ReceivedDate, true, FIELD_ReceivedDate));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_EmailMessage.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_EmailMessage.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_EmailMessage.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_EmailMessage.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class EmailMessageBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<EmailMessage>
{
/**
* Get the attribute MessageId
*/
public String getMessageId (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute MessageId.
* May modify the field beforehand
* Occurs before validation.
*/
public String setMessageId (EmailMessage obj, String newMessageId) throws FieldException
{
return newMessageId;
}
/**
* Get the attribute EmailFrom
*/
public String getEmailFrom (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute EmailFrom.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmailFrom (EmailMessage obj, String newEmailFrom) throws FieldException
{
return newEmailFrom;
}
/**
* Get the attribute EmailTo
*/
public String getEmailTo (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute EmailTo.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmailTo (EmailMessage obj, String newEmailTo) throws FieldException
{
return newEmailTo;
}
/**
* Get the attribute EmailCC
*/
public String getEmailCC (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute EmailCC.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmailCC (EmailMessage obj, String newEmailCC) throws FieldException
{
return newEmailCC;
}
/**
* Get the attribute Subject
*/
public String getSubject (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute Subject.
* May modify the field beforehand
* Occurs before validation.
*/
public String setSubject (EmailMessage obj, String newSubject) throws FieldException
{
return newSubject;
}
/**
* Get the attribute Description
*/
public String getDescription (EmailMessage obj, String original)
{
return original;
}
/**
* Change the value set for attribute Description.
* May modify the field beforehand
* Occurs before validation.
*/
public String setDescription (EmailMessage obj, String newDescription) throws FieldException
{
return newDescription;
}
/**
* Get the attribute ReceivedDate
*/
public Date getReceivedDate (EmailMessage obj, Date original)
{
return original;
}
/**
* Change the value set for attribute ReceivedDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setReceivedDate (EmailMessage obj, Date newReceivedDate) throws FieldException
{
return newReceivedDate;
}
}
public ORMPipeLine pipes()
{
return new EmailMessagePipeLineFactory<EmailMessage, EmailMessage> ((EmailMessage)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public EmailMessagePipeLineFactory<EmailMessage, EmailMessage> pipelineEmailMessage()
{
return (EmailMessagePipeLineFactory<EmailMessage, EmailMessage>) pipes();
}
public static EmailMessagePipeLineFactory<EmailMessage, EmailMessage> pipesEmailMessage(Collection<EmailMessage> items)
{
return REFERENCE_EmailMessage.new EmailMessagePipeLineFactory<EmailMessage, EmailMessage> (items);
}
public static EmailMessagePipeLineFactory<EmailMessage, EmailMessage> pipesEmailMessage(EmailMessage[] _items)
{
return pipesEmailMessage(Arrays.asList (_items));
}
public static EmailMessagePipeLineFactory<EmailMessage, EmailMessage> pipesEmailMessage()
{
return pipesEmailMessage((Collection)null);
}
public class EmailMessagePipeLineFactory<From extends BaseBusinessClass, Me extends EmailMessage> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> EmailMessagePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public EmailMessagePipeLineFactory (From seed)
{
super(seed);
}
public EmailMessagePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Attachments"))
{
return toAttachments ();
}
if (name.equals ("MessageId"))
{
return toMessageId ();
}
if (name.equals ("EmailFrom"))
{
return toEmailFrom ();
}
if (name.equals ("EmailTo"))
{
return toEmailTo ();
}
if (name.equals ("EmailCC"))
{
return toEmailCC ();
}
if (name.equals ("Subject"))
{
return toSubject ();
}
if (name.equals ("Description"))
{
return toDescription ();
}
if (name.equals ("ReceivedDate"))
{
return toReceivedDate ();
}
if (name.equals ("Job"))
{
return toJob ();
}
return super.to(name);
}
public PipeLine<From, String> toMessageId () { return pipe(new ORMAttributePipe<Me, String>(FIELD_MessageId)); }
public PipeLine<From, String> toEmailFrom () { return pipe(new ORMAttributePipe<Me, String>(FIELD_EmailFrom)); }
public PipeLine<From, String> toEmailTo () { return pipe(new ORMAttributePipe<Me, String>(FIELD_EmailTo)); }
public PipeLine<From, String> toEmailCC () { return pipe(new ORMAttributePipe<Me, String>(FIELD_EmailCC)); }
public PipeLine<From, String> toSubject () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Subject)); }
public PipeLine<From, String> toDescription () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Description)); }
public PipeLine<From, Date> toReceivedDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ReceivedDate)); }
public Job.JobPipeLineFactory<From, Job> toJob () { return toJob (Filter.ALL); }
public Job.JobPipeLineFactory<From, Job> toJob (Filter<Job> filter)
{
return Job.REFERENCE_Job.new JobPipeLineFactory<From, Job> (this, new ORMSingleAssocPipe<Me, Job>(SINGLEREFERENCE_Job, filter));
}
public Attachment.AttachmentPipeLineFactory<From, Attachment> toAttachments () { return toAttachments(Filter.ALL); }
public Attachment.AttachmentPipeLineFactory<From, Attachment> toAttachments (Filter<Attachment> filter)
{
return Attachment.REFERENCE_Attachment.new AttachmentPipeLineFactory<From, Attachment> (this, new ORMMultiAssocPipe<Me, Attachment>(MULTIPLEREFERENCE_Attachments, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyEmailMessage extends EmailMessage
{
// Default constructor primarily to support Externalisable
public DummyEmailMessage()
{
super();
}
public void assertValid ()
{
}
public Job getJob () throws StorageException
{
return (Job)(Job.DUMMY_Job);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobID ()
{
return Job.DUMMY_Job.getObjectID();
}
public int getAttachmentsCount () throws StorageException
{
return 0;
}
public Attachment getAttachmentsAt (int index) throws StorageException
{
throw new RuntimeException ("No elements in a dummy object in association Attachments");
}
public SortedSet getAttachmentsSet () throws StorageException
{
return new TreeSet();
}
}
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseILOJobTitle extends BaseBusinessClass
{
// Reference instance for the object
public static final ILOJobTitle REFERENCE_ILOJobTitle = new ILOJobTitle ();
// Reference instance for the object
public static final ILOJobTitle DUMMY_ILOJobTitle = new DummyILOJobTitle ();
// Static constants corresponding to field names
public static final String FIELD_JobTitle = "JobTitle";
public static final String SINGLEREFERENCE_Occupation = "Occupation";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<ILOJobTitle> HELPER_JobTitle = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _JobTitle;
// Private attributes corresponding to single references
private SingleAssociation<ILOJobTitle, Occupation> _Occupation;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_ILOJobTitle = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_JobTitle_Validators;
// Arrays of behaviour decorators
private static final ILOJobTitleBehaviourDecorator[] ILOJobTitle_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_Occupation();
FIELD_JobTitle_Validators = (AttributeValidator[])setupAttribMetaData_JobTitle(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_ILOJobTitle.initialiseReference ();
DUMMY_ILOJobTitle.initialiseReference ();
ILOJobTitle_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(ILOJobTitle.class).toArray(new ILOJobTitleBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_Occupation()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "occupation_id");
metaInfo.put ("name", "Occupation");
metaInfo.put ("type", "Occupation");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ILOJobTitle.Occupation:", metaInfo);
ATTRIBUTES_METADATA_ILOJobTitle.put (SINGLEREFERENCE_Occupation, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_JobTitle(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title");
metaInfo.put ("length", "200");
metaInfo.put ("name", "JobTitle");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ILOJobTitle.JobTitle:", metaInfo);
ATTRIBUTES_METADATA_ILOJobTitle.put (FIELD_JobTitle, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ILOJobTitle.class, "JobTitle", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ILOJobTitle.JobTitle:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseILOJobTitle ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return ILOJobTitle_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_JobTitle = (String)(HELPER_JobTitle.initialise (_JobTitle));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_Occupation = new SingleAssociation<ILOJobTitle, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_ilo_job_title");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_Occupation = new SingleAssociation<ILOJobTitle, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_ilo_job_title");
return this;
}
/**
* Get the attribute JobTitle
*/
public String getJobTitle ()
{
assertValid();
String valToReturn = _JobTitle;
for (ILOJobTitleBehaviourDecorator bhd : ILOJobTitle_BehaviourDecorators)
{
valToReturn = bhd.getJobTitle ((ILOJobTitle)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preJobTitleChange (String newJobTitle) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_JobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute JobTitle. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setJobTitle (String newJobTitle) throws FieldException
{
boolean oldAndNewIdentical = HELPER_JobTitle.compare (_JobTitle, newJobTitle);
try
{
for (ILOJobTitleBehaviourDecorator bhd : ILOJobTitle_BehaviourDecorators)
{
newJobTitle = bhd.setJobTitle ((ILOJobTitle)this, newJobTitle);
oldAndNewIdentical = HELPER_JobTitle.compare (_JobTitle, newJobTitle);
}
if (FIELD_JobTitle_Validators.length > 0)
{
Object newJobTitleObj = HELPER_JobTitle.toObject (newJobTitle);
if (newJobTitleObj != null)
{
int loopMax = FIELD_JobTitle_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ILOJobTitle.get (FIELD_JobTitle);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_JobTitle_Validators[v].checkAttribute (this, FIELD_JobTitle, metadata, newJobTitleObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_JobTitle () != FieldWriteability.FALSE, "Field JobTitle is not writeable");
preJobTitleChange (newJobTitle);
markFieldChange (FIELD_JobTitle);
_JobTitle = newJobTitle;
postFieldChange (FIELD_JobTitle);
postJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("Occupation");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return _Occupation.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return null ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupation ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupation (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
return getOccupationID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Occupation))
{
setOccupation ((Occupation)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference Occupation
*/
public Occupation getOccupation () throws StorageException
{
assertValid();
try
{
return (Occupation)(_Occupation.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in ILOJobTitle:", this.getObjectID (), ", was trying to get Occupation:", getOccupationID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Occupation.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Occupation getOccupation (Get getType) throws StorageException
{
assertValid();
return _Occupation.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getOccupationID ()
{
assertValid();
if (_Occupation == null)
{
return null;
}
else
{
return _Occupation.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preOccupationChange (Occupation newOccupation) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postOccupationChange () throws FieldException
{
}
public FieldWriteability getWriteability_Occupation ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference Occupation. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setOccupation (Occupation newOccupation) throws StorageException, FieldException
{
if (_Occupation.wouldReferencedChange (newOccupation))
{
assertValid();
Debug.assertion (getWriteability_Occupation () != FieldWriteability.FALSE, "Assoc Occupation is not writeable");
preOccupationChange (newOccupation);
_Occupation.set (newOccupation);
postOccupationChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public ILOJobTitle newInstance ()
{
return new ILOJobTitle ();
}
public ILOJobTitle referenceInstance ()
{
return REFERENCE_ILOJobTitle;
}
public ILOJobTitle getInTransaction (ObjectTransaction t) throws StorageException
{
return getILOJobTitleByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_ILOJobTitle;
}
public String getBaseSetName ()
{
return "tl_ilo_job_title";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_ilo_job_titlePSet = allSets.getPersistentSet (myID, "tl_ilo_job_title", myPSetStatus);
tl_ilo_job_titlePSet.setAttrib (FIELD_ObjectID, myID);
tl_ilo_job_titlePSet.setAttrib (FIELD_JobTitle, HELPER_JobTitle.toObject (_JobTitle)); //
_Occupation.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_ilo_job_titlePSet = allSets.getPersistentSet (objectID, "tl_ilo_job_title");
_JobTitle = (String)(HELPER_JobTitle.fromObject (_JobTitle, tl_ilo_job_titlePSet.getAttrib (FIELD_JobTitle))); //
_Occupation.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof ILOJobTitle)
{
ILOJobTitle otherILOJobTitle = (ILOJobTitle)other;
try
{
setJobTitle (otherILOJobTitle.getJobTitle ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
_JobTitle = sourceILOJobTitle._JobTitle;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
_Occupation.copyFrom (sourceILOJobTitle._Occupation, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseILOJobTitle)
{
BaseILOJobTitle sourceILOJobTitle = (BaseILOJobTitle)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_JobTitle = (String)(HELPER_JobTitle.readExternal (_JobTitle, vals.get(FIELD_JobTitle))); //
_Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_JobTitle, HELPER_JobTitle.writeExternal (_JobTitle));
vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseILOJobTitle)
{
BaseILOJobTitle otherILOJobTitle = (BaseILOJobTitle)(other);
if (!HELPER_JobTitle.compare(this._JobTitle, otherILOJobTitle._JobTitle))
{
listener.notifyFieldChange(this, other, FIELD_JobTitle, HELPER_JobTitle.toObject(this._JobTitle), HELPER_JobTitle.toObject(otherILOJobTitle._JobTitle));
}
// Compare single assocs
_Occupation.compare (otherILOJobTitle._Occupation, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_JobTitle, HELPER_JobTitle.toObject(getJobTitle()));
visitor.visitAssociation (_Occupation);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_Occupation))
{
visitor.visit (_Occupation);
}
}
public static ILOJobTitle createILOJobTitle (ObjectTransaction transaction) throws StorageException
{
ILOJobTitle result = new ILOJobTitle ();
result.initialiseNewObject (transaction);
return result;
}
public static ILOJobTitle getILOJobTitleByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (ILOJobTitle)(transaction.getObjectByID (REFERENCE_ILOJobTitle, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return filter.matches (getJobTitle ());
}
else if (attribName.equals (SINGLEREFERENCE_Occupation))
{
return filter.matches (getOccupation ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<ILOJobTitle>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_ilo_job_title.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andJobTitle (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_ilo_job_title.job_title", "JobTitle");
return this;
}
public SearchAll andOccupation (QueryFilter<Occupation> filter)
{
filter.addFilter (context, "tl_ilo_job_title.occupation_id", "Occupation");
return this;
}
public ILOJobTitle[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_ILOJobTitle, SEARCH_All, criteria);
Set<ILOJobTitle> typedResults = new LinkedHashSet <ILOJobTitle> ();
for (BaseBusinessClass bbcResult : results)
{
ILOJobTitle aResult = (ILOJobTitle)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ILOJobTitle[0]);
}
}
public static ILOJobTitle[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return HELPER_JobTitle.toObject (getJobTitle ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
return HELPER_JobTitle;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_JobTitle))
{
setJobTitle ((String)(HELPER_JobTitle.fromObject (_JobTitle, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_JobTitle))
{
return getWriteability_JobTitle ();
}
else if (fieldName.equals (SINGLEREFERENCE_Occupation))
{
return getWriteability_Occupation ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_JobTitle () != FieldWriteability.TRUE)
{
fields.add (FIELD_JobTitle);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_JobTitle.getAttribObject (getClass (), _JobTitle, false, FIELD_JobTitle));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_ILOJobTitle.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_ILOJobTitle.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_ILOJobTitle.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_ILOJobTitle.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class ILOJobTitleBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<ILOJobTitle>
{
/**
* Get the attribute JobTitle
*/
public String getJobTitle (ILOJobTitle obj, String original)
{
return original;
}
/**
* Change the value set for attribute JobTitle.
* May modify the field beforehand
* Occurs before validation.
*/
public String setJobTitle (ILOJobTitle obj, String newJobTitle) throws FieldException
{
return newJobTitle;
}
}
public ORMPipeLine pipes()
{
return new ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> ((ILOJobTitle)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipelineILOJobTitle()
{
return (ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle>) pipes();
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle(Collection<ILOJobTitle> items)
{
return REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> (items);
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle(ILOJobTitle[] _items)
{
return pipesILOJobTitle(Arrays.asList (_items));
}
public static ILOJobTitlePipeLineFactory<ILOJobTitle, ILOJobTitle> pipesILOJobTitle()
{
return pipesILOJobTitle((Collection)null);
}
public class ILOJobTitlePipeLineFactory<From extends BaseBusinessClass, Me extends ILOJobTitle> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> ILOJobTitlePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ILOJobTitlePipeLineFactory (From seed)
{
super(seed);
}
public ILOJobTitlePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("JobTitle"))
{
return toJobTitle ();
}
if (name.equals ("Occupation"))
{
return toOccupation ();
}
return super.to(name);
}
public PipeLine<From, String> toJobTitle () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobTitle)); }
public Occupation.OccupationPipeLineFactory<From, Occupation> toOccupation () { return toOccupation (Filter.ALL); }
public Occupation.OccupationPipeLineFactory<From, Occupation> toOccupation (Filter<Occupation> filter)
{
return Occupation.REFERENCE_Occupation.new OccupationPipeLineFactory<From, Occupation> (this, new ORMSingleAssocPipe<Me, Occupation>(SINGLEREFERENCE_Occupation, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyILOJobTitle extends ILOJobTitle
{
// Default constructor primarily to support Externalisable
public DummyILOJobTitle()
{
super();
}
public void assertValid ()
{
}
public Occupation getOccupation () throws StorageException
{
return (Occupation)(Occupation.DUMMY_Occupation);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getOccupationID ()
{
return Occupation.DUMMY_Occupation.getObjectID();
}
}
...@@ -94,6 +94,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -94,6 +94,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String SINGLEREFERENCE_Occupation = "Occupation"; public static final String SINGLEREFERENCE_Occupation = "Occupation";
public static final String SINGLEREFERENCE_ShortenedURL = "ShortenedURL"; public static final String SINGLEREFERENCE_ShortenedURL = "ShortenedURL";
public static final String SINGLEREFERENCE_AssessmentTemplate = "AssessmentTemplate"; public static final String SINGLEREFERENCE_AssessmentTemplate = "AssessmentTemplate";
public static final String SINGLEREFERENCE_ILOJobTitle = "ILOJobTitle";
public static final String MULTIPLEREFERENCE_JobApplications = "JobApplications"; public static final String MULTIPLEREFERENCE_JobApplications = "JobApplications";
public static final String BACKREF_JobApplications = ""; public static final String BACKREF_JobApplications = "";
public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias"; public static final String MULTIPLEREFERENCE_AssessmentCriterias = "AssessmentCriterias";
...@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass
private SingleAssociation<Job, Occupation> _Occupation; private SingleAssociation<Job, Occupation> _Occupation;
private SingleAssociation<Job, ShortenedURL> _ShortenedURL; private SingleAssociation<Job, ShortenedURL> _ShortenedURL;
private SingleAssociation<Job, AssessmentCriteriaTemplate> _AssessmentTemplate; private SingleAssociation<Job, AssessmentCriteriaTemplate> _AssessmentTemplate;
private SingleAssociation<Job, ILOJobTitle> _ILOJobTitle;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -294,6 +296,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -294,6 +296,7 @@ public abstract class BaseJob extends BaseBusinessClass
setupAssocMetaData_Occupation(); setupAssocMetaData_Occupation();
setupAssocMetaData_ShortenedURL(); setupAssocMetaData_ShortenedURL();
setupAssocMetaData_AssessmentTemplate(); setupAssocMetaData_AssessmentTemplate();
setupAssocMetaData_ILOJobTitle();
FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Password_Validators = (AttributeValidator[])setupAttribMetaData_Password(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]); FIELD_ConfirmPassword_Validators = (AttributeValidator[])setupAttribMetaData_ConfirmPassword(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -559,6 +562,20 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -559,6 +562,20 @@ public abstract class BaseJob extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ILOJobTitle()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "job_title_id");
metaInfo.put ("name", "ILOJobTitle");
metaInfo.put ("type", "ILOJobTitle");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.ILOJobTitle:", metaInfo);
ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_ILOJobTitle, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Email(Map validatorMapping) private static List setupAttribMetaData_Email(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -1390,6 +1407,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1390,6 +1407,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job"); _Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job"); _ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job");
_AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job"); _AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job");
_ILOJobTitle = new SingleAssociation<Job, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_job");
_JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication); _JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication);
_AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria); _CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria);
...@@ -1414,6 +1432,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1414,6 +1432,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job"); _Occupation = new SingleAssociation<Job, Occupation> (this, SINGLEREFERENCE_Occupation, null, Occupation.REFERENCE_Occupation, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job"); _ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "tl_job");
_AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job"); _AssessmentTemplate = new SingleAssociation<Job, AssessmentCriteriaTemplate> (this, SINGLEREFERENCE_AssessmentTemplate, null, AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate, "tl_job");
_ILOJobTitle = new SingleAssociation<Job, ILOJobTitle> (this, SINGLEREFERENCE_ILOJobTitle, null, ILOJobTitle.REFERENCE_ILOJobTitle, "tl_job");
_JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication); _JobApplications = new MultipleAssociation<Job, JobApplication> (this, MULTIPLEREFERENCE_JobApplications, JobApplication.SINGLEREFERENCE_Job, JobApplication.REFERENCE_JobApplication);
_AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria); _AssessmentCriterias = new MultipleAssociation<Job, AssessmentCriteria> (this, MULTIPLEREFERENCE_AssessmentCriterias, AssessmentCriteria.SINGLEREFERENCE_Job, AssessmentCriteria.REFERENCE_AssessmentCriteria);
_CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria); _CultureCriterias = new MultipleAssociation<Job, CultureCriteria> (this, MULTIPLEREFERENCE_CultureCriterias, CultureCriteria.SINGLEREFERENCE_Job, CultureCriteria.REFERENCE_CultureCriteria);
...@@ -5384,6 +5403,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5384,6 +5403,8 @@ public abstract class BaseJob extends BaseBusinessClass
result.add("AssessmentTemplate"); result.add("AssessmentTemplate");
result.add("ILOJobTitle");
return result; return result;
} }
...@@ -5428,6 +5449,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5428,6 +5449,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return _AssessmentTemplate.getReferencedType (); return _AssessmentTemplate.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return _ILOJobTitle.getReferencedType ();
} }
else else
{ {
...@@ -5466,6 +5490,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5466,6 +5490,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return null ;
} }
else else
{ {
...@@ -5513,6 +5540,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5513,6 +5540,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplate (); return getAssessmentTemplate ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle ();
} }
else else
{ {
...@@ -5560,6 +5590,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5560,6 +5590,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplate (getType); return getAssessmentTemplate (getType);
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitle (getType);
} }
else else
{ {
...@@ -5607,6 +5640,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5607,6 +5640,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
return getAssessmentTemplateID (); return getAssessmentTemplateID ();
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getILOJobTitleID ();
} }
else else
{ {
...@@ -5654,6 +5690,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5654,6 +5690,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate)) }else if (assocName.equals (SINGLEREFERENCE_AssessmentTemplate))
{ {
setAssessmentTemplate ((AssessmentCriteriaTemplate)(newValue)); setAssessmentTemplate ((AssessmentCriteriaTemplate)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ILOJobTitle))
{
setILOJobTitle ((ILOJobTitle)(newValue));
} }
else else
{ {
...@@ -6712,6 +6751,100 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6712,6 +6751,100 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the reference ILOJobTitle
*/
public ILOJobTitle getILOJobTitle () throws StorageException
{
assertValid();
try
{
return (ILOJobTitle)(_ILOJobTitle.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get ILOJobTitle:", getILOJobTitleID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ILOJobTitle.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public ILOJobTitle getILOJobTitle (Get getType) throws StorageException
{
assertValid();
return _ILOJobTitle.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
assertValid();
if (_ILOJobTitle == null)
{
return null;
}
else
{
return _ILOJobTitle.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preILOJobTitleChange (ILOJobTitle newILOJobTitle) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postILOJobTitleChange () throws FieldException
{
}
public FieldWriteability getWriteability_ILOJobTitle ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ILOJobTitle. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setILOJobTitle (ILOJobTitle newILOJobTitle) throws StorageException, FieldException
{
if (_ILOJobTitle.wouldReferencedChange (newILOJobTitle))
{
assertValid();
Debug.assertion (getWriteability_ILOJobTitle () != FieldWriteability.FALSE, "Assoc ILOJobTitle is not writeable");
preILOJobTitleChange (newILOJobTitle);
_ILOJobTitle.set (newILOJobTitle);
postILOJobTitleChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings. * A list of multi assoc names e.g. list of strings.
*/ */
public List<String> getMultiAssocs() public List<String> getMultiAssocs()
...@@ -7404,6 +7537,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7404,6 +7537,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.getPersistentSets (allSets); _Occupation.getPersistentSets (allSets);
_ShortenedURL.getPersistentSets (allSets); _ShortenedURL.getPersistentSets (allSets);
_AssessmentTemplate.getPersistentSets (allSets); _AssessmentTemplate.getPersistentSets (allSets);
_ILOJobTitle.getPersistentSets (allSets);
} }
...@@ -7451,6 +7585,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7451,6 +7585,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.setFromPersistentSets (objectID, allSets); _Occupation.setFromPersistentSets (objectID, allSets);
_ShortenedURL.setFromPersistentSets (objectID, allSets); _ShortenedURL.setFromPersistentSets (objectID, allSets);
_AssessmentTemplate.setFromPersistentSets (objectID, allSets); _AssessmentTemplate.setFromPersistentSets (objectID, allSets);
_ILOJobTitle.setFromPersistentSets (objectID, allSets);
} }
...@@ -7773,6 +7908,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7773,6 +7908,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.copyFrom (sourceJob._Occupation, linkToGhosts); _Occupation.copyFrom (sourceJob._Occupation, linkToGhosts);
_ShortenedURL.copyFrom (sourceJob._ShortenedURL, linkToGhosts); _ShortenedURL.copyFrom (sourceJob._ShortenedURL, linkToGhosts);
_AssessmentTemplate.copyFrom (sourceJob._AssessmentTemplate, linkToGhosts); _AssessmentTemplate.copyFrom (sourceJob._AssessmentTemplate, linkToGhosts);
_ILOJobTitle.copyFrom (sourceJob._ILOJobTitle, linkToGhosts);
} }
} }
...@@ -7866,6 +8002,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7866,6 +8002,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation)); _Occupation.readExternalData(vals.get(SINGLEREFERENCE_Occupation));
_ShortenedURL.readExternalData(vals.get(SINGLEREFERENCE_ShortenedURL)); _ShortenedURL.readExternalData(vals.get(SINGLEREFERENCE_ShortenedURL));
_AssessmentTemplate.readExternalData(vals.get(SINGLEREFERENCE_AssessmentTemplate)); _AssessmentTemplate.readExternalData(vals.get(SINGLEREFERENCE_AssessmentTemplate));
_ILOJobTitle.readExternalData(vals.get(SINGLEREFERENCE_ILOJobTitle));
_JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications)); _JobApplications.readExternalData(vals.get(MULTIPLEREFERENCE_JobApplications));
_AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias)); _AssessmentCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriterias));
_CultureCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_CultureCriterias)); _CultureCriterias.readExternalData(vals.get(MULTIPLEREFERENCE_CultureCriterias));
...@@ -7932,6 +8069,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7932,6 +8069,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData()); vals.put (SINGLEREFERENCE_Occupation, _Occupation.writeExternalData());
vals.put (SINGLEREFERENCE_ShortenedURL, _ShortenedURL.writeExternalData()); vals.put (SINGLEREFERENCE_ShortenedURL, _ShortenedURL.writeExternalData());
vals.put (SINGLEREFERENCE_AssessmentTemplate, _AssessmentTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_AssessmentTemplate, _AssessmentTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_ILOJobTitle, _ILOJobTitle.writeExternalData());
vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData()); vals.put (MULTIPLEREFERENCE_JobApplications, _JobApplications.writeExternalData());
vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_AssessmentCriterias, _AssessmentCriterias.writeExternalData());
vals.put (MULTIPLEREFERENCE_CultureCriterias, _CultureCriterias.writeExternalData()); vals.put (MULTIPLEREFERENCE_CultureCriterias, _CultureCriterias.writeExternalData());
...@@ -8062,6 +8200,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8062,6 +8200,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Occupation.compare (otherJob._Occupation, listener); _Occupation.compare (otherJob._Occupation, listener);
_ShortenedURL.compare (otherJob._ShortenedURL, listener); _ShortenedURL.compare (otherJob._ShortenedURL, listener);
_AssessmentTemplate.compare (otherJob._AssessmentTemplate, listener); _AssessmentTemplate.compare (otherJob._AssessmentTemplate, listener);
_ILOJobTitle.compare (otherJob._ILOJobTitle, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -8137,6 +8276,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8137,6 +8276,7 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitAssociation (_Occupation); visitor.visitAssociation (_Occupation);
visitor.visitAssociation (_ShortenedURL); visitor.visitAssociation (_ShortenedURL);
visitor.visitAssociation (_AssessmentTemplate); visitor.visitAssociation (_AssessmentTemplate);
visitor.visitAssociation (_ILOJobTitle);
visitor.visitAssociation (_JobApplications); visitor.visitAssociation (_JobApplications);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_CultureCriterias); visitor.visitAssociation (_CultureCriterias);
...@@ -8193,6 +8333,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8193,6 +8333,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
visitor.visit (_AssessmentTemplate); visitor.visit (_AssessmentTemplate);
} }
if (scope.includes (_ILOJobTitle))
{
visitor.visit (_ILOJobTitle);
}
if (scope.includes (_JobApplications)) if (scope.includes (_JobApplications))
{ {
visitor.visit (_JobApplications); visitor.visit (_JobApplications);
...@@ -8366,6 +8510,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8366,6 +8510,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return filter.matches (getAssessmentTemplate ()); return filter.matches (getAssessmentTemplate ());
} }
else if (attribName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return filter.matches (getILOJobTitle ());
}
else else
{ {
return super.testFilter (attribName, filter); return super.testFilter (attribName, filter);
...@@ -8595,6 +8743,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8595,6 +8743,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchAll andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -8856,6 +9010,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -8856,6 +9010,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchJobKey andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job search (ObjectTransaction transaction) throws StorageException public Job search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -9111,6 +9271,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9111,6 +9271,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchCompany andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -9367,6 +9533,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -9367,6 +9533,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchDetails andILOJobTitle (QueryFilter<ILOJobTitle> filter)
{
filter.addFilter (context, "tl_job.job_title_id", "ILOJobTitle");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -10077,6 +10249,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -10077,6 +10249,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return getWriteability_AssessmentTemplate (); return getWriteability_AssessmentTemplate ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ILOJobTitle))
{
return getWriteability_ILOJobTitle ();
}
else if (fieldName.equals (FIELD_Email)) else if (fieldName.equals (FIELD_Email))
{ {
return getWriteability_Email (); return getWriteability_Email ();
...@@ -11450,6 +11626,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11450,6 +11626,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return toAssessmentTemplate (); return toAssessmentTemplate ();
} }
if (name.equals ("ILOJobTitle"))
{
return toILOJobTitle ();
}
return super.to(name); return super.to(name);
...@@ -11601,6 +11781,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -11601,6 +11781,12 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate.new AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> (this, new ORMSingleAssocPipe<Me, AssessmentCriteriaTemplate>(SINGLEREFERENCE_AssessmentTemplate, filter)); return AssessmentCriteriaTemplate.REFERENCE_AssessmentCriteriaTemplate.new AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> (this, new ORMSingleAssocPipe<Me, AssessmentCriteriaTemplate>(SINGLEREFERENCE_AssessmentTemplate, filter));
} }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle () { return toILOJobTitle (Filter.ALL); }
public ILOJobTitle.ILOJobTitlePipeLineFactory<From, ILOJobTitle> toILOJobTitle (Filter<ILOJobTitle> filter)
{
return ILOJobTitle.REFERENCE_ILOJobTitle.new ILOJobTitlePipeLineFactory<From, ILOJobTitle> (this, new ORMSingleAssocPipe<Me, ILOJobTitle>(SINGLEREFERENCE_ILOJobTitle, filter));
}
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); } public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter) public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter)
...@@ -11900,6 +12086,20 @@ class DummyJob extends Job ...@@ -11900,6 +12086,20 @@ class DummyJob extends Job
return AssessmentCriteriaTemplate.DUMMY_AssessmentCriteriaTemplate.getObjectID(); return AssessmentCriteriaTemplate.DUMMY_AssessmentCriteriaTemplate.getObjectID();
} }
public ILOJobTitle getILOJobTitle () throws StorageException
{
return (ILOJobTitle)(ILOJobTitle.DUMMY_ILOJobTitle);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getILOJobTitleID ()
{
return ILOJobTitle.DUMMY_ILOJobTitle.getObjectID();
}
public int getJobApplicationsCount () throws StorageException public int getJobApplicationsCount () throws StorageException
{ {
return 0; return 0;
......
...@@ -63,6 +63,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -63,6 +63,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
public static final String BACKREF_AssessmentCriteriaAnswers = ""; public static final String BACKREF_AssessmentCriteriaAnswers = "";
public static final String MULTIPLEREFERENCE_Notes = "Notes"; public static final String MULTIPLEREFERENCE_Notes = "Notes";
public static final String BACKREF_Notes = ""; public static final String BACKREF_Notes = "";
public static final String MULTIPLEREFERENCE_ScheduledEmails = "ScheduledEmails";
public static final String BACKREF_ScheduledEmails = "";
public static final String MULTIPLEREFERENCE_SentEmails = "SentEmails";
public static final String BACKREF_SentEmails = "";
// Static constants corresponding to searches // Static constants corresponding to searches
public static final String SEARCH_All = "All"; public static final String SEARCH_All = "All";
...@@ -113,6 +117,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -113,6 +117,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
private MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> _AssessmentCriteriaAnswers; private MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> _AssessmentCriteriaAnswers;
private MultipleAssociation<JobApplication, Note> _Notes; private MultipleAssociation<JobApplication, Note> _Notes;
private MultipleAssociation<JobApplication, ScheduledEmail> _ScheduledEmails;
private MultipleAssociation<JobApplication, SentEmail> _SentEmails;
// Map of maps of metadata // Map of maps of metadata
...@@ -145,6 +151,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -145,6 +151,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
String tmp_AssessmentCriteriaAnswers = AssessmentCriteriaAnswer.BACKREF_JobApplication; String tmp_AssessmentCriteriaAnswers = AssessmentCriteriaAnswer.BACKREF_JobApplication;
String tmp_Notes = Note.BACKREF_JobApplication; String tmp_Notes = Note.BACKREF_JobApplication;
String tmp_ScheduledEmails = ScheduledEmail.BACKREF_JobApplication;
String tmp_SentEmails = SentEmail.BACKREF_JobApplication;
String tmp_Candidate = Candidate.BACKREF_JobApplications; String tmp_Candidate = Candidate.BACKREF_JobApplications;
String tmp_Job = Job.BACKREF_JobApplications; String tmp_Job = Job.BACKREF_JobApplications;
...@@ -152,6 +160,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -152,6 +160,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
setupAssocMetaData_AssessmentCriteriaAnswers(); setupAssocMetaData_AssessmentCriteriaAnswers();
setupAssocMetaData_Notes(); setupAssocMetaData_Notes();
setupAssocMetaData_ScheduledEmails();
setupAssocMetaData_SentEmails();
setupAssocMetaData_WorkFlow(); setupAssocMetaData_WorkFlow();
setupAssocMetaData_Candidate(); setupAssocMetaData_Candidate();
setupAssocMetaData_Job(); setupAssocMetaData_Job();
...@@ -212,6 +222,34 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -212,6 +222,34 @@ public abstract class BaseJobApplication extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ScheduledEmails()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "JobApplication");
metaInfo.put ("name", "ScheduledEmails");
metaInfo.put ("type", "ScheduledEmail");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.ScheduledEmails:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_ScheduledEmails, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_SentEmails()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "JobApplication");
metaInfo.put ("name", "SentEmails");
metaInfo.put ("type", "SentEmail");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.SentEmails:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (MULTIPLEREFERENCE_SentEmails, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_WorkFlow() private static void setupAssocMetaData_WorkFlow()
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -577,6 +615,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -577,6 +615,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application"); _Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application");
_AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer); _AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer);
_Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note); _Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note);
_ScheduledEmails = new MultipleAssociation<JobApplication, ScheduledEmail> (this, MULTIPLEREFERENCE_ScheduledEmails, ScheduledEmail.SINGLEREFERENCE_JobApplication, ScheduledEmail.REFERENCE_ScheduledEmail);
_SentEmails = new MultipleAssociation<JobApplication, SentEmail> (this, MULTIPLEREFERENCE_SentEmails, SentEmail.SINGLEREFERENCE_JobApplication, SentEmail.REFERENCE_SentEmail);
} }
...@@ -591,6 +631,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -591,6 +631,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application"); _Job = new SingleAssociation<JobApplication, Job> (this, SINGLEREFERENCE_Job, Job.MULTIPLEREFERENCE_JobApplications, Job.REFERENCE_Job, "tl_job_application");
_AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer); _AssessmentCriteriaAnswers = new MultipleAssociation<JobApplication, AssessmentCriteriaAnswer> (this, MULTIPLEREFERENCE_AssessmentCriteriaAnswers, AssessmentCriteriaAnswer.SINGLEREFERENCE_JobApplication, AssessmentCriteriaAnswer.REFERENCE_AssessmentCriteriaAnswer);
_Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note); _Notes = new MultipleAssociation<JobApplication, Note> (this, MULTIPLEREFERENCE_Notes, Note.SINGLEREFERENCE_JobApplication, Note.REFERENCE_Note);
_ScheduledEmails = new MultipleAssociation<JobApplication, ScheduledEmail> (this, MULTIPLEREFERENCE_ScheduledEmails, ScheduledEmail.SINGLEREFERENCE_JobApplication, ScheduledEmail.REFERENCE_ScheduledEmail);
_SentEmails = new MultipleAssociation<JobApplication, SentEmail> (this, MULTIPLEREFERENCE_SentEmails, SentEmail.SINGLEREFERENCE_JobApplication, SentEmail.REFERENCE_SentEmail);
return this; return this;
...@@ -2450,6 +2492,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2450,6 +2492,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
result.add("Notes"); result.add("Notes");
result.add("ScheduledEmails");
result.add("SentEmails");
return result; return result;
} }
...@@ -2471,6 +2517,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2471,6 +2517,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return Note.REFERENCE_Note ; return Note.REFERENCE_Note ;
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
return ScheduledEmail.REFERENCE_ScheduledEmail ;
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
return SentEmail.REFERENCE_SentEmail ;
}
return super.getMultiAssocReferenceInstance(attribName); return super.getMultiAssocReferenceInstance(attribName);
} }
...@@ -2489,6 +2545,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2489,6 +2545,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return Note.SINGLEREFERENCE_JobApplication ; return Note.SINGLEREFERENCE_JobApplication ;
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
return ScheduledEmail.SINGLEREFERENCE_JobApplication ;
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
return SentEmail.SINGLEREFERENCE_JobApplication ;
}
return super.getMultiAssocBackReference(attribName); return super.getMultiAssocBackReference(attribName);
} }
...@@ -2510,6 +2576,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2510,6 +2576,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this.getNotesCount(); return this.getNotesCount();
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
return this.getScheduledEmailsCount();
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
return this.getSentEmailsCount();
}
return super.getMultiAssocCount(attribName); return super.getMultiAssocCount(attribName);
} }
...@@ -2531,6 +2607,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2531,6 +2607,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this.getNotesAt(index); return this.getNotesAt(index);
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
return this.getScheduledEmailsAt(index);
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
return this.getSentEmailsAt(index);
}
return super.getMultiAssocAt(attribName, index); return super.getMultiAssocAt(attribName, index);
} }
...@@ -2556,6 +2642,20 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2556,6 +2642,20 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return; return;
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
addToScheduledEmails((ScheduledEmail)newElement);
return;
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
addToSentEmails((SentEmail)newElement);
return;
}
super.addToMultiAssoc(attribName, newElement); super.addToMultiAssoc(attribName, newElement);
} }
...@@ -2580,6 +2680,20 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2580,6 +2680,20 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return; return;
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
removeFromScheduledEmails((ScheduledEmail)oldElement);
return;
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
removeFromSentEmails((SentEmail)oldElement);
return;
}
super.removeFromMultiAssoc(attribName, oldElement); super.removeFromMultiAssoc(attribName, oldElement);
} }
...@@ -2600,6 +2714,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2600,6 +2714,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return; return;
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
_ScheduledEmails.__loadAssociation (elements);
return;
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
_SentEmails.__loadAssociation (elements);
return;
}
super.__loadMultiAssoc(attribName, elements); super.__loadMultiAssoc(attribName, elements);
} }
...@@ -2618,6 +2744,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2618,6 +2744,16 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return _Notes.isLoaded (); return _Notes.isLoaded ();
} }
if (MULTIPLEREFERENCE_ScheduledEmails.equals(attribName))
{
return _ScheduledEmails.isLoaded ();
}
if (MULTIPLEREFERENCE_SentEmails.equals(attribName))
{
return _SentEmails.isLoaded ();
}
return super.__isMultiAssocLoaded(attribName); return super.__isMultiAssocLoaded(attribName);
} }
...@@ -2762,6 +2898,144 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2762,6 +2898,144 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return _Notes.getSet (); return _Notes.getSet ();
} }
public FieldWriteability getWriteability_ScheduledEmails ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
public int getScheduledEmailsCount () throws StorageException
{
assertValid();
return _ScheduledEmails.getReferencedObjectsCount ();
}
public void addToScheduledEmails (ScheduledEmail newElement) throws StorageException
{
if (_ScheduledEmails.wouldAddChange (newElement))
{
assertValid();
Debug.assertion (getWriteability_ScheduledEmails () != FieldWriteability.FALSE, "MultiAssoc ScheduledEmails is not writeable (add)");
_ScheduledEmails.appendElement (newElement);
try
{
if (newElement.getJobApplication () != this)
{
newElement.setJobApplication ((JobApplication)(this));
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public void removeFromScheduledEmails (ScheduledEmail elementToRemove) throws StorageException
{
if (_ScheduledEmails.wouldRemoveChange (elementToRemove))
{
assertValid();
Debug.assertion (getWriteability_ScheduledEmails () != FieldWriteability.FALSE, "MultiAssoc ScheduledEmails is not writeable (remove)");
_ScheduledEmails.removeElement (elementToRemove);
try
{
if (elementToRemove.getJobApplication () != null)
{
elementToRemove.setJobApplication (null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public ScheduledEmail getScheduledEmailsAt (int index) throws StorageException
{
return (ScheduledEmail)(_ScheduledEmails.getElementAt (index));
}
public SortedSet<ScheduledEmail> getScheduledEmailsSet () throws StorageException
{
return _ScheduledEmails.getSet ();
}
public FieldWriteability getWriteability_SentEmails ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
public int getSentEmailsCount () throws StorageException
{
assertValid();
return _SentEmails.getReferencedObjectsCount ();
}
public void addToSentEmails (SentEmail newElement) throws StorageException
{
if (_SentEmails.wouldAddChange (newElement))
{
assertValid();
Debug.assertion (getWriteability_SentEmails () != FieldWriteability.FALSE, "MultiAssoc SentEmails is not writeable (add)");
_SentEmails.appendElement (newElement);
try
{
if (newElement.getJobApplication () != this)
{
newElement.setJobApplication ((JobApplication)(this));
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public void removeFromSentEmails (SentEmail elementToRemove) throws StorageException
{
if (_SentEmails.wouldRemoveChange (elementToRemove))
{
assertValid();
Debug.assertion (getWriteability_SentEmails () != FieldWriteability.FALSE, "MultiAssoc SentEmails is not writeable (remove)");
_SentEmails.removeElement (elementToRemove);
try
{
if (elementToRemove.getJobApplication () != null)
{
elementToRemove.setJobApplication (null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public SentEmail getSentEmailsAt (int index) throws StorageException
{
return (SentEmail)(_SentEmails.getElementAt (index));
}
public SortedSet<SentEmail> getSentEmailsSet () throws StorageException
{
return _SentEmails.getSet ();
}
public void onDelete () public void onDelete ()
...@@ -2808,6 +3082,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -2808,6 +3082,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
referenced.setJobApplication(null); referenced.setJobApplication(null);
} }
for(ScheduledEmail referenced : CollectionUtils.reverse(getScheduledEmailsSet()))
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
referenced.setJobApplication(null);
}
for(SentEmail referenced : CollectionUtils.reverse(getSentEmailsSet()))
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null JobApplication from ", getObjectID (), " to ", referenced.getObjectID ());
referenced.setJobApplication(null);
}
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -3044,6 +3330,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3044,6 +3330,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_AssessmentCriteriaAnswers.copyFrom (sourceJobApplication._AssessmentCriteriaAnswers, linkToGhosts); _AssessmentCriteriaAnswers.copyFrom (sourceJobApplication._AssessmentCriteriaAnswers, linkToGhosts);
_Notes.copyFrom (sourceJobApplication._Notes, linkToGhosts); _Notes.copyFrom (sourceJobApplication._Notes, linkToGhosts);
_ScheduledEmails.copyFrom (sourceJobApplication._ScheduledEmails, linkToGhosts);
_SentEmails.copyFrom (sourceJobApplication._SentEmails, linkToGhosts);
} }
} }
...@@ -3087,6 +3375,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3087,6 +3375,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_Job.readExternalData(vals.get(SINGLEREFERENCE_Job)); _Job.readExternalData(vals.get(SINGLEREFERENCE_Job));
_AssessmentCriteriaAnswers.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriteriaAnswers)); _AssessmentCriteriaAnswers.readExternalData(vals.get(MULTIPLEREFERENCE_AssessmentCriteriaAnswers));
_Notes.readExternalData(vals.get(MULTIPLEREFERENCE_Notes)); _Notes.readExternalData(vals.get(MULTIPLEREFERENCE_Notes));
_ScheduledEmails.readExternalData(vals.get(MULTIPLEREFERENCE_ScheduledEmails));
_SentEmails.readExternalData(vals.get(MULTIPLEREFERENCE_SentEmails));
} }
...@@ -3117,6 +3407,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3117,6 +3407,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Job, _Job.writeExternalData()); vals.put (SINGLEREFERENCE_Job, _Job.writeExternalData());
vals.put (MULTIPLEREFERENCE_AssessmentCriteriaAnswers, _AssessmentCriteriaAnswers.writeExternalData()); vals.put (MULTIPLEREFERENCE_AssessmentCriteriaAnswers, _AssessmentCriteriaAnswers.writeExternalData());
vals.put (MULTIPLEREFERENCE_Notes, _Notes.writeExternalData()); vals.put (MULTIPLEREFERENCE_Notes, _Notes.writeExternalData());
vals.put (MULTIPLEREFERENCE_ScheduledEmails, _ScheduledEmails.writeExternalData());
vals.put (MULTIPLEREFERENCE_SentEmails, _SentEmails.writeExternalData());
} }
...@@ -3168,6 +3460,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3168,6 +3460,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
// Compare multiple assocs // Compare multiple assocs
_AssessmentCriteriaAnswers.compare (otherJobApplication._AssessmentCriteriaAnswers, listener); _AssessmentCriteriaAnswers.compare (otherJobApplication._AssessmentCriteriaAnswers, listener);
_Notes.compare (otherJobApplication._Notes, listener); _Notes.compare (otherJobApplication._Notes, listener);
_ScheduledEmails.compare (otherJobApplication._ScheduledEmails, listener);
_SentEmails.compare (otherJobApplication._SentEmails, listener);
} }
} }
...@@ -3204,6 +3498,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3204,6 +3498,8 @@ public abstract class BaseJobApplication extends BaseBusinessClass
visitor.visitAssociation (_Job); visitor.visitAssociation (_Job);
visitor.visitAssociation (_AssessmentCriteriaAnswers); visitor.visitAssociation (_AssessmentCriteriaAnswers);
visitor.visitAssociation (_Notes); visitor.visitAssociation (_Notes);
visitor.visitAssociation (_ScheduledEmails);
visitor.visitAssociation (_SentEmails);
} }
...@@ -3232,6 +3528,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3232,6 +3528,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{ {
visitor.visit (_Notes); visitor.visit (_Notes);
} }
if (scope.includes (_ScheduledEmails))
{
visitor.visit (_ScheduledEmails);
}
if (scope.includes (_SentEmails))
{
visitor.visit (_SentEmails);
}
} }
...@@ -3918,6 +4222,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -3918,6 +4222,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{ {
return getWriteability_Notes (); return getWriteability_Notes ();
} }
else if (fieldName.equals (MULTIPLEREFERENCE_ScheduledEmails))
{
return getWriteability_ScheduledEmails ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_SentEmails))
{
return getWriteability_SentEmails ();
}
else if (fieldName.equals (SINGLEREFERENCE_Candidate)) else if (fieldName.equals (SINGLEREFERENCE_Candidate))
{ {
return getWriteability_Candidate (); return getWriteability_Candidate ();
...@@ -4459,6 +4771,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -4459,6 +4771,14 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{ {
return toNotes (); return toNotes ();
} }
if (name.equals ("ScheduledEmails"))
{
return toScheduledEmails ();
}
if (name.equals ("SentEmails"))
{
return toSentEmails ();
}
if (name.equals ("AppProcessOption")) if (name.equals ("AppProcessOption"))
{ {
return toAppProcessOption (); return toAppProcessOption ();
...@@ -4590,6 +4910,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass ...@@ -4590,6 +4910,18 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{ {
return Note.REFERENCE_Note.new NotePipeLineFactory<From, Note> (this, new ORMMultiAssocPipe<Me, Note>(MULTIPLEREFERENCE_Notes, filter)); return Note.REFERENCE_Note.new NotePipeLineFactory<From, Note> (this, new ORMMultiAssocPipe<Me, Note>(MULTIPLEREFERENCE_Notes, filter));
} }
public ScheduledEmail.ScheduledEmailPipeLineFactory<From, ScheduledEmail> toScheduledEmails () { return toScheduledEmails(Filter.ALL); }
public ScheduledEmail.ScheduledEmailPipeLineFactory<From, ScheduledEmail> toScheduledEmails (Filter<ScheduledEmail> filter)
{
return ScheduledEmail.REFERENCE_ScheduledEmail.new ScheduledEmailPipeLineFactory<From, ScheduledEmail> (this, new ORMMultiAssocPipe<Me, ScheduledEmail>(MULTIPLEREFERENCE_ScheduledEmails, filter));
}
public SentEmail.SentEmailPipeLineFactory<From, SentEmail> toSentEmails () { return toSentEmails(Filter.ALL); }
public SentEmail.SentEmailPipeLineFactory<From, SentEmail> toSentEmails (Filter<SentEmail> filter)
{
return SentEmail.REFERENCE_SentEmail.new SentEmailPipeLineFactory<From, SentEmail> (this, new ORMMultiAssocPipe<Me, SentEmail>(MULTIPLEREFERENCE_SentEmails, filter));
}
} }
...@@ -4737,6 +5069,40 @@ class DummyJobApplication extends JobApplication ...@@ -4737,6 +5069,40 @@ class DummyJobApplication extends JobApplication
return new TreeSet(); return new TreeSet();
} }
public int getScheduledEmailsCount () throws StorageException
{
return 0;
}
public ScheduledEmail getScheduledEmailsAt (int index) throws StorageException
{
throw new RuntimeException ("No elements in a dummy object in association ScheduledEmails");
}
public SortedSet getScheduledEmailsSet () throws StorageException
{
return new TreeSet();
}
public int getSentEmailsCount () throws StorageException
{
return 0;
}
public SentEmail getSentEmailsAt (int index) throws StorageException
{
throw new RuntimeException ("No elements in a dummy object in association SentEmails");
}
public SortedSet getSentEmailsSet () throws StorageException
{
return new TreeSet();
}
} }
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
import performa.orm.*;
public abstract class BaseMessageTemplate extends BaseBusinessClass
{
// Reference instance for the object
public static final MessageTemplate REFERENCE_MessageTemplate = new MessageTemplate ();
// Reference instance for the object
public static final MessageTemplate DUMMY_MessageTemplate = new DummyMessageTemplate ();
// Static constants corresponding to field names
public static final String FIELD_TemplateName = "TemplateName";
public static final String FIELD_Subject = "Subject";
public static final String FIELD_ApplicationStatus = "ApplicationStatus";
public static final String FIELD_DelayHrs = "DelayHrs";
public static final String FIELD_DelayMin = "DelayMin";
public static final String FIELD_Variance = "Variance";
public static final String FIELD_BusinessHoursOnly = "BusinessHoursOnly";
public static final String FIELD_MessageContent = "MessageContent";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<MessageTemplate> HELPER_TemplateName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<MessageTemplate, ApplicationStatus> HELPER_ApplicationStatus = new EnumeratedAttributeHelper<MessageTemplate, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper<MessageTemplate> HELPER_DelayHrs = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_DelayMin = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_Variance = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _TemplateName;
private String _Subject;
private ApplicationStatus _ApplicationStatus;
private Integer _DelayHrs;
private Integer _DelayMin;
private Integer _Variance;
private Boolean _BusinessHoursOnly;
private String _MessageContent;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_MessageTemplate = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_TemplateName_Validators;
private static final AttributeValidator[] FIELD_Subject_Validators;
private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
private static final AttributeValidator[] FIELD_DelayHrs_Validators;
private static final AttributeValidator[] FIELD_DelayMin_Validators;
private static final AttributeValidator[] FIELD_Variance_Validators;
private static final AttributeValidator[] FIELD_BusinessHoursOnly_Validators;
private static final AttributeValidator[] FIELD_MessageContent_Validators;
// Arrays of behaviour decorators
private static final MessageTemplateBehaviourDecorator[] MessageTemplate_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_TemplateName_Validators = (AttributeValidator[])setupAttribMetaData_TemplateName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Subject_Validators = (AttributeValidator[])setupAttribMetaData_Subject(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_DelayHrs_Validators = (AttributeValidator[])setupAttribMetaData_DelayHrs(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_DelayMin_Validators = (AttributeValidator[])setupAttribMetaData_DelayMin(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Variance_Validators = (AttributeValidator[])setupAttribMetaData_Variance(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_BusinessHoursOnly_Validators = (AttributeValidator[])setupAttribMetaData_BusinessHoursOnly(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageContent_Validators = (AttributeValidator[])setupAttribMetaData_MessageContent(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_MessageTemplate.initialiseReference ();
DUMMY_MessageTemplate.initialiseReference ();
MessageTemplate_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(MessageTemplate.class).toArray(new MessageTemplateBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_TemplateName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "template_name");
metaInfo.put ("length", "200");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "TemplateName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.TemplateName:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_TemplateName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "TemplateName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.TemplateName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Subject(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "subject");
metaInfo.put ("length", "200");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Subject");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.Subject:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_Subject, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "Subject", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.Subject:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ApplicationStatus(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "application_status");
metaInfo.put ("defaultValue", "ApplicationStatus.DRAFT");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ApplicationStatus");
metaInfo.put ("type", "ApplicationStatus");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.ApplicationStatus:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_ApplicationStatus, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "ApplicationStatus", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.ApplicationStatus:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_DelayHrs(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "delay_hrs");
metaInfo.put ("defaultValue", "0");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "DelayHrs");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.DelayHrs:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_DelayHrs, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "DelayHrs", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.DelayHrs:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_DelayMin(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "delay_min");
metaInfo.put ("defaultValue", "0");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "DelayMin");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.DelayMin:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_DelayMin, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "DelayMin", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.DelayMin:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Variance(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "variance");
metaInfo.put ("defaultValue", "0");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "Variance");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.Variance:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_Variance, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "Variance", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.Variance:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_BusinessHoursOnly(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "business_hours_only");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "BusinessHoursOnly");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.BusinessHoursOnly:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_BusinessHoursOnly, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "BusinessHoursOnly", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.BusinessHoursOnly:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_MessageContent(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_content");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "MessageContent");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.MessageContent:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_MessageContent, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "MessageContent", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.MessageContent:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseMessageTemplate ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return MessageTemplate_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_TemplateName = (String)(HELPER_TemplateName.initialise (_TemplateName));
_Subject = (String)(HELPER_Subject.initialise (_Subject));
_ApplicationStatus = (ApplicationStatus)(ApplicationStatus.DRAFT);
_DelayHrs = (Integer)(0);
_DelayMin = (Integer)(0);
_Variance = (Integer)(0);
_BusinessHoursOnly = (Boolean)(Boolean.FALSE);
_MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute TemplateName
*/
public String getTemplateName ()
{
assertValid();
String valToReturn = _TemplateName;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getTemplateName ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preTemplateNameChange (String newTemplateName) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postTemplateNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_TemplateName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute TemplateName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setTemplateName (String newTemplateName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_TemplateName.compare (_TemplateName, newTemplateName);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newTemplateName = bhd.setTemplateName ((MessageTemplate)this, newTemplateName);
oldAndNewIdentical = HELPER_TemplateName.compare (_TemplateName, newTemplateName);
}
BusinessObjectParser.assertFieldCondition (newTemplateName != null, this, FIELD_TemplateName, "mandatory");
if (FIELD_TemplateName_Validators.length > 0)
{
Object newTemplateNameObj = HELPER_TemplateName.toObject (newTemplateName);
if (newTemplateNameObj != null)
{
int loopMax = FIELD_TemplateName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_TemplateName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_TemplateName_Validators[v].checkAttribute (this, FIELD_TemplateName, metadata, newTemplateNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_TemplateName () != FieldWriteability.FALSE, "Field TemplateName is not writeable");
preTemplateNameChange (newTemplateName);
markFieldChange (FIELD_TemplateName);
_TemplateName = newTemplateName;
postFieldChange (FIELD_TemplateName);
postTemplateNameChange ();
}
}
/**
* Get the attribute Subject
*/
public String getSubject ()
{
assertValid();
String valToReturn = _Subject;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getSubject ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSubjectChange (String newSubject) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSubjectChange () throws FieldException
{
}
public FieldWriteability getWriteability_Subject ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Subject. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSubject (String newSubject) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newSubject = bhd.setSubject ((MessageTemplate)this, newSubject);
oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
}
BusinessObjectParser.assertFieldCondition (newSubject != null, this, FIELD_Subject, "mandatory");
if (FIELD_Subject_Validators.length > 0)
{
Object newSubjectObj = HELPER_Subject.toObject (newSubject);
if (newSubjectObj != null)
{
int loopMax = FIELD_Subject_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_Subject);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Subject_Validators[v].checkAttribute (this, FIELD_Subject, metadata, newSubjectObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Subject () != FieldWriteability.FALSE, "Field Subject is not writeable");
preSubjectChange (newSubject);
markFieldChange (FIELD_Subject);
_Subject = newSubject;
postFieldChange (FIELD_Subject);
postSubjectChange ();
}
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus ()
{
assertValid();
ApplicationStatus valToReturn = _ApplicationStatus;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getApplicationStatus ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preApplicationStatusChange (ApplicationStatus newApplicationStatus) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postApplicationStatusChange () throws FieldException
{
}
public FieldWriteability getWriteability_ApplicationStatus ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ApplicationStatus. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setApplicationStatus (ApplicationStatus newApplicationStatus) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newApplicationStatus = bhd.setApplicationStatus ((MessageTemplate)this, newApplicationStatus);
oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
}
BusinessObjectParser.assertFieldCondition (newApplicationStatus != null, this, FIELD_ApplicationStatus, "mandatory");
if (FIELD_ApplicationStatus_Validators.length > 0)
{
Object newApplicationStatusObj = HELPER_ApplicationStatus.toObject (newApplicationStatus);
if (newApplicationStatusObj != null)
{
int loopMax = FIELD_ApplicationStatus_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_ApplicationStatus);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ApplicationStatus_Validators[v].checkAttribute (this, FIELD_ApplicationStatus, metadata, newApplicationStatusObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ApplicationStatus () != FieldWriteability.FALSE, "Field ApplicationStatus is not writeable");
preApplicationStatusChange (newApplicationStatus);
markFieldChange (FIELD_ApplicationStatus);
_ApplicationStatus = newApplicationStatus;
postFieldChange (FIELD_ApplicationStatus);
postApplicationStatusChange ();
}
}
/**
* Get the attribute DelayHrs
*/
public Integer getDelayHrs ()
{
assertValid();
Integer valToReturn = _DelayHrs;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getDelayHrs ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preDelayHrsChange (Integer newDelayHrs) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postDelayHrsChange () throws FieldException
{
}
public FieldWriteability getWriteability_DelayHrs ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute DelayHrs. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDelayHrs (Integer newDelayHrs) throws FieldException
{
boolean oldAndNewIdentical = HELPER_DelayHrs.compare (_DelayHrs, newDelayHrs);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newDelayHrs = bhd.setDelayHrs ((MessageTemplate)this, newDelayHrs);
oldAndNewIdentical = HELPER_DelayHrs.compare (_DelayHrs, newDelayHrs);
}
if (FIELD_DelayHrs_Validators.length > 0)
{
Object newDelayHrsObj = HELPER_DelayHrs.toObject (newDelayHrs);
if (newDelayHrsObj != null)
{
int loopMax = FIELD_DelayHrs_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_DelayHrs);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_DelayHrs_Validators[v].checkAttribute (this, FIELD_DelayHrs, metadata, newDelayHrsObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_DelayHrs () != FieldWriteability.FALSE, "Field DelayHrs is not writeable");
preDelayHrsChange (newDelayHrs);
markFieldChange (FIELD_DelayHrs);
_DelayHrs = newDelayHrs;
postFieldChange (FIELD_DelayHrs);
postDelayHrsChange ();
}
}
/**
* Get the attribute DelayMin
*/
public Integer getDelayMin ()
{
assertValid();
Integer valToReturn = _DelayMin;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getDelayMin ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preDelayMinChange (Integer newDelayMin) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postDelayMinChange () throws FieldException
{
}
public FieldWriteability getWriteability_DelayMin ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute DelayMin. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDelayMin (Integer newDelayMin) throws FieldException
{
boolean oldAndNewIdentical = HELPER_DelayMin.compare (_DelayMin, newDelayMin);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newDelayMin = bhd.setDelayMin ((MessageTemplate)this, newDelayMin);
oldAndNewIdentical = HELPER_DelayMin.compare (_DelayMin, newDelayMin);
}
if (FIELD_DelayMin_Validators.length > 0)
{
Object newDelayMinObj = HELPER_DelayMin.toObject (newDelayMin);
if (newDelayMinObj != null)
{
int loopMax = FIELD_DelayMin_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_DelayMin);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_DelayMin_Validators[v].checkAttribute (this, FIELD_DelayMin, metadata, newDelayMinObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_DelayMin () != FieldWriteability.FALSE, "Field DelayMin is not writeable");
preDelayMinChange (newDelayMin);
markFieldChange (FIELD_DelayMin);
_DelayMin = newDelayMin;
postFieldChange (FIELD_DelayMin);
postDelayMinChange ();
}
}
/**
* Get the attribute Variance
*/
public Integer getVariance ()
{
assertValid();
Integer valToReturn = _Variance;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getVariance ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preVarianceChange (Integer newVariance) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postVarianceChange () throws FieldException
{
}
public FieldWriteability getWriteability_Variance ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Variance. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setVariance (Integer newVariance) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Variance.compare (_Variance, newVariance);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newVariance = bhd.setVariance ((MessageTemplate)this, newVariance);
oldAndNewIdentical = HELPER_Variance.compare (_Variance, newVariance);
}
if (FIELD_Variance_Validators.length > 0)
{
Object newVarianceObj = HELPER_Variance.toObject (newVariance);
if (newVarianceObj != null)
{
int loopMax = FIELD_Variance_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_Variance);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Variance_Validators[v].checkAttribute (this, FIELD_Variance, metadata, newVarianceObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Variance () != FieldWriteability.FALSE, "Field Variance is not writeable");
preVarianceChange (newVariance);
markFieldChange (FIELD_Variance);
_Variance = newVariance;
postFieldChange (FIELD_Variance);
postVarianceChange ();
}
}
/**
* Get the attribute BusinessHoursOnly
*/
public Boolean getBusinessHoursOnly ()
{
assertValid();
Boolean valToReturn = _BusinessHoursOnly;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getBusinessHoursOnly ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preBusinessHoursOnlyChange (Boolean newBusinessHoursOnly) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postBusinessHoursOnlyChange () throws FieldException
{
}
public FieldWriteability getWriteability_BusinessHoursOnly ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute BusinessHoursOnly. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setBusinessHoursOnly (Boolean newBusinessHoursOnly) throws FieldException
{
boolean oldAndNewIdentical = HELPER_BusinessHoursOnly.compare (_BusinessHoursOnly, newBusinessHoursOnly);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newBusinessHoursOnly = bhd.setBusinessHoursOnly ((MessageTemplate)this, newBusinessHoursOnly);
oldAndNewIdentical = HELPER_BusinessHoursOnly.compare (_BusinessHoursOnly, newBusinessHoursOnly);
}
if (FIELD_BusinessHoursOnly_Validators.length > 0)
{
Object newBusinessHoursOnlyObj = HELPER_BusinessHoursOnly.toObject (newBusinessHoursOnly);
if (newBusinessHoursOnlyObj != null)
{
int loopMax = FIELD_BusinessHoursOnly_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_BusinessHoursOnly);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_BusinessHoursOnly_Validators[v].checkAttribute (this, FIELD_BusinessHoursOnly, metadata, newBusinessHoursOnlyObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_BusinessHoursOnly () != FieldWriteability.FALSE, "Field BusinessHoursOnly is not writeable");
preBusinessHoursOnlyChange (newBusinessHoursOnly);
markFieldChange (FIELD_BusinessHoursOnly);
_BusinessHoursOnly = newBusinessHoursOnly;
postFieldChange (FIELD_BusinessHoursOnly);
postBusinessHoursOnlyChange ();
}
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent ()
{
assertValid();
String valToReturn = _MessageContent;
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getMessageContent ((MessageTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preMessageContentChange (String newMessageContent) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postMessageContentChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageContent ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageContent. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageContent (String newMessageContent) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newMessageContent = bhd.setMessageContent ((MessageTemplate)this, newMessageContent);
oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
}
BusinessObjectParser.assertFieldCondition (newMessageContent != null, this, FIELD_MessageContent, "mandatory");
if (FIELD_MessageContent_Validators.length > 0)
{
Object newMessageContentObj = HELPER_MessageContent.toObject (newMessageContent);
if (newMessageContentObj != null)
{
int loopMax = FIELD_MessageContent_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_MessageContent);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageContent_Validators[v].checkAttribute (this, FIELD_MessageContent, metadata, newMessageContentObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageContent () != FieldWriteability.FALSE, "Field MessageContent is not writeable");
preMessageContentChange (newMessageContent);
markFieldChange (FIELD_MessageContent);
_MessageContent = newMessageContent;
postFieldChange (FIELD_MessageContent);
postMessageContentChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public MessageTemplate newInstance ()
{
return new MessageTemplate ();
}
public MessageTemplate referenceInstance ()
{
return REFERENCE_MessageTemplate;
}
public MessageTemplate getInTransaction (ObjectTransaction t) throws StorageException
{
return getMessageTemplateByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_MessageTemplate;
}
public String getBaseSetName ()
{
return "tl_message_template";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_message_templatePSet = allSets.getPersistentSet (myID, "tl_message_template", myPSetStatus);
tl_message_templatePSet.setAttrib (FIELD_ObjectID, myID);
tl_message_templatePSet.setAttrib (FIELD_TemplateName, HELPER_TemplateName.toObject (_TemplateName)); //
tl_message_templatePSet.setAttrib (FIELD_Subject, HELPER_Subject.toObject (_Subject)); //
tl_message_templatePSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
tl_message_templatePSet.setAttrib (FIELD_DelayHrs, HELPER_DelayHrs.toObject (_DelayHrs)); //
tl_message_templatePSet.setAttrib (FIELD_DelayMin, HELPER_DelayMin.toObject (_DelayMin)); //
tl_message_templatePSet.setAttrib (FIELD_Variance, HELPER_Variance.toObject (_Variance)); //
tl_message_templatePSet.setAttrib (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject (_BusinessHoursOnly)); //
tl_message_templatePSet.setAttrib (FIELD_MessageContent, HELPER_MessageContent.toObject (_MessageContent)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_message_templatePSet = allSets.getPersistentSet (objectID, "tl_message_template");
_TemplateName = (String)(HELPER_TemplateName.fromObject (_TemplateName, tl_message_templatePSet.getAttrib (FIELD_TemplateName))); //
_Subject = (String)(HELPER_Subject.fromObject (_Subject, tl_message_templatePSet.getAttrib (FIELD_Subject))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_message_templatePSet.getAttrib (FIELD_ApplicationStatus))); //
_DelayHrs = (Integer)(HELPER_DelayHrs.fromObject (_DelayHrs, tl_message_templatePSet.getAttrib (FIELD_DelayHrs))); //
_DelayMin = (Integer)(HELPER_DelayMin.fromObject (_DelayMin, tl_message_templatePSet.getAttrib (FIELD_DelayMin))); //
_Variance = (Integer)(HELPER_Variance.fromObject (_Variance, tl_message_templatePSet.getAttrib (FIELD_Variance))); //
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.fromObject (_BusinessHoursOnly, tl_message_templatePSet.getAttrib (FIELD_BusinessHoursOnly))); //
_MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_message_templatePSet.getAttrib (FIELD_MessageContent))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof MessageTemplate)
{
MessageTemplate otherMessageTemplate = (MessageTemplate)other;
try
{
setTemplateName (otherMessageTemplate.getTemplateName ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setSubject (otherMessageTemplate.getSubject ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setApplicationStatus (otherMessageTemplate.getApplicationStatus ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setDelayHrs (otherMessageTemplate.getDelayHrs ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setDelayMin (otherMessageTemplate.getDelayMin ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setVariance (otherMessageTemplate.getVariance ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setBusinessHoursOnly (otherMessageTemplate.getBusinessHoursOnly ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setMessageContent (otherMessageTemplate.getMessageContent ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseMessageTemplate)
{
BaseMessageTemplate sourceMessageTemplate = (BaseMessageTemplate)(source);
_TemplateName = sourceMessageTemplate._TemplateName;
_Subject = sourceMessageTemplate._Subject;
_ApplicationStatus = sourceMessageTemplate._ApplicationStatus;
_DelayHrs = sourceMessageTemplate._DelayHrs;
_DelayMin = sourceMessageTemplate._DelayMin;
_Variance = sourceMessageTemplate._Variance;
_BusinessHoursOnly = sourceMessageTemplate._BusinessHoursOnly;
_MessageContent = sourceMessageTemplate._MessageContent;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseMessageTemplate)
{
BaseMessageTemplate sourceMessageTemplate = (BaseMessageTemplate)(source);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseMessageTemplate)
{
BaseMessageTemplate sourceMessageTemplate = (BaseMessageTemplate)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_TemplateName = (String)(HELPER_TemplateName.readExternal (_TemplateName, vals.get(FIELD_TemplateName))); //
_Subject = (String)(HELPER_Subject.readExternal (_Subject, vals.get(FIELD_Subject))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
_DelayHrs = (Integer)(HELPER_DelayHrs.readExternal (_DelayHrs, vals.get(FIELD_DelayHrs))); //
_DelayMin = (Integer)(HELPER_DelayMin.readExternal (_DelayMin, vals.get(FIELD_DelayMin))); //
_Variance = (Integer)(HELPER_Variance.readExternal (_Variance, vals.get(FIELD_Variance))); //
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.readExternal (_BusinessHoursOnly, vals.get(FIELD_BusinessHoursOnly))); //
_MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_TemplateName, HELPER_TemplateName.writeExternal (_TemplateName));
vals.put (FIELD_Subject, HELPER_Subject.writeExternal (_Subject));
vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
vals.put (FIELD_DelayHrs, HELPER_DelayHrs.writeExternal (_DelayHrs));
vals.put (FIELD_DelayMin, HELPER_DelayMin.writeExternal (_DelayMin));
vals.put (FIELD_Variance, HELPER_Variance.writeExternal (_Variance));
vals.put (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.writeExternal (_BusinessHoursOnly));
vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseMessageTemplate)
{
BaseMessageTemplate otherMessageTemplate = (BaseMessageTemplate)(other);
if (!HELPER_TemplateName.compare(this._TemplateName, otherMessageTemplate._TemplateName))
{
listener.notifyFieldChange(this, other, FIELD_TemplateName, HELPER_TemplateName.toObject(this._TemplateName), HELPER_TemplateName.toObject(otherMessageTemplate._TemplateName));
}
if (!HELPER_Subject.compare(this._Subject, otherMessageTemplate._Subject))
{
listener.notifyFieldChange(this, other, FIELD_Subject, HELPER_Subject.toObject(this._Subject), HELPER_Subject.toObject(otherMessageTemplate._Subject));
}
if (!HELPER_ApplicationStatus.compare(this._ApplicationStatus, otherMessageTemplate._ApplicationStatus))
{
listener.notifyFieldChange(this, other, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(this._ApplicationStatus), HELPER_ApplicationStatus.toObject(otherMessageTemplate._ApplicationStatus));
}
if (!HELPER_DelayHrs.compare(this._DelayHrs, otherMessageTemplate._DelayHrs))
{
listener.notifyFieldChange(this, other, FIELD_DelayHrs, HELPER_DelayHrs.toObject(this._DelayHrs), HELPER_DelayHrs.toObject(otherMessageTemplate._DelayHrs));
}
if (!HELPER_DelayMin.compare(this._DelayMin, otherMessageTemplate._DelayMin))
{
listener.notifyFieldChange(this, other, FIELD_DelayMin, HELPER_DelayMin.toObject(this._DelayMin), HELPER_DelayMin.toObject(otherMessageTemplate._DelayMin));
}
if (!HELPER_Variance.compare(this._Variance, otherMessageTemplate._Variance))
{
listener.notifyFieldChange(this, other, FIELD_Variance, HELPER_Variance.toObject(this._Variance), HELPER_Variance.toObject(otherMessageTemplate._Variance));
}
if (!HELPER_BusinessHoursOnly.compare(this._BusinessHoursOnly, otherMessageTemplate._BusinessHoursOnly))
{
listener.notifyFieldChange(this, other, FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject(this._BusinessHoursOnly), HELPER_BusinessHoursOnly.toObject(otherMessageTemplate._BusinessHoursOnly));
}
if (!HELPER_MessageContent.compare(this._MessageContent, otherMessageTemplate._MessageContent))
{
listener.notifyFieldChange(this, other, FIELD_MessageContent, HELPER_MessageContent.toObject(this._MessageContent), HELPER_MessageContent.toObject(otherMessageTemplate._MessageContent));
}
// Compare single assocs
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_TemplateName, HELPER_TemplateName.toObject(getTemplateName()));
visitor.visitField(this, FIELD_Subject, HELPER_Subject.toObject(getSubject()));
visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
visitor.visitField(this, FIELD_DelayHrs, HELPER_DelayHrs.toObject(getDelayHrs()));
visitor.visitField(this, FIELD_DelayMin, HELPER_DelayMin.toObject(getDelayMin()));
visitor.visitField(this, FIELD_Variance, HELPER_Variance.toObject(getVariance()));
visitor.visitField(this, FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject(getBusinessHoursOnly()));
visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static MessageTemplate createMessageTemplate (ObjectTransaction transaction) throws StorageException
{
MessageTemplate result = new MessageTemplate ();
result.initialiseNewObject (transaction);
return result;
}
public static MessageTemplate getMessageTemplateByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (MessageTemplate)(transaction.getObjectByID (REFERENCE_MessageTemplate, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_TemplateName))
{
return filter.matches (getTemplateName ());
}
else if (attribName.equals (FIELD_Subject))
{
return filter.matches (getSubject ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return filter.matches (getApplicationStatus ());
}
else if (attribName.equals (FIELD_DelayHrs))
{
return filter.matches (getDelayHrs ());
}
else if (attribName.equals (FIELD_DelayMin))
{
return filter.matches (getDelayMin ());
}
else if (attribName.equals (FIELD_Variance))
{
return filter.matches (getVariance ());
}
else if (attribName.equals (FIELD_BusinessHoursOnly))
{
return filter.matches (getBusinessHoursOnly ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return filter.matches (getMessageContent ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<MessageTemplate>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_message_template.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_message_template.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_message_template.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andTemplateName (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_message_template.template_name", "TemplateName");
return this;
}
public SearchAll andSubject (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_message_template.subject", "Subject");
return this;
}
public SearchAll andApplicationStatus (QueryFilter<ApplicationStatus> filter)
{
filter.addFilter (context, "tl_message_template.application_status", "ApplicationStatus");
return this;
}
public SearchAll andDelayHrs (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_message_template.delay_hrs", "DelayHrs");
return this;
}
public SearchAll andDelayMin (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_message_template.delay_min", "DelayMin");
return this;
}
public SearchAll andVariance (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_message_template.variance", "Variance");
return this;
}
public SearchAll andBusinessHoursOnly (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_message_template.business_hours_only", "BusinessHoursOnly");
return this;
}
public SearchAll andMessageContent (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_message_template.message_content", "MessageContent");
return this;
}
public MessageTemplate[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_MessageTemplate, SEARCH_All, criteria);
Set<MessageTemplate> typedResults = new LinkedHashSet <MessageTemplate> ();
for (BaseBusinessClass bbcResult : results)
{
MessageTemplate aResult = (MessageTemplate)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new MessageTemplate[0]);
}
}
public static MessageTemplate[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_TemplateName))
{
return HELPER_TemplateName.toObject (getTemplateName ());
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject.toObject (getSubject ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus.toObject (getApplicationStatus ());
}
else if (attribName.equals (FIELD_DelayHrs))
{
return HELPER_DelayHrs.toObject (getDelayHrs ());
}
else if (attribName.equals (FIELD_DelayMin))
{
return HELPER_DelayMin.toObject (getDelayMin ());
}
else if (attribName.equals (FIELD_Variance))
{
return HELPER_Variance.toObject (getVariance ());
}
else if (attribName.equals (FIELD_BusinessHoursOnly))
{
return HELPER_BusinessHoursOnly.toObject (getBusinessHoursOnly ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent.toObject (getMessageContent ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_TemplateName))
{
return HELPER_TemplateName;
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject;
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus;
}
else if (attribName.equals (FIELD_DelayHrs))
{
return HELPER_DelayHrs;
}
else if (attribName.equals (FIELD_DelayMin))
{
return HELPER_DelayMin;
}
else if (attribName.equals (FIELD_Variance))
{
return HELPER_Variance;
}
else if (attribName.equals (FIELD_BusinessHoursOnly))
{
return HELPER_BusinessHoursOnly;
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_TemplateName))
{
setTemplateName ((String)(HELPER_TemplateName.fromObject (_TemplateName, attribValue)));
}
else if (attribName.equals (FIELD_Subject))
{
setSubject ((String)(HELPER_Subject.fromObject (_Subject, attribValue)));
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
setApplicationStatus ((ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, attribValue)));
}
else if (attribName.equals (FIELD_DelayHrs))
{
setDelayHrs ((Integer)(HELPER_DelayHrs.fromObject (_DelayHrs, attribValue)));
}
else if (attribName.equals (FIELD_DelayMin))
{
setDelayMin ((Integer)(HELPER_DelayMin.fromObject (_DelayMin, attribValue)));
}
else if (attribName.equals (FIELD_Variance))
{
setVariance ((Integer)(HELPER_Variance.fromObject (_Variance, attribValue)));
}
else if (attribName.equals (FIELD_BusinessHoursOnly))
{
setBusinessHoursOnly ((Boolean)(HELPER_BusinessHoursOnly.fromObject (_BusinessHoursOnly, attribValue)));
}
else if (attribName.equals (FIELD_MessageContent))
{
setMessageContent ((String)(HELPER_MessageContent.fromObject (_MessageContent, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_TemplateName))
{
return getWriteability_TemplateName ();
}
else if (fieldName.equals (FIELD_Subject))
{
return getWriteability_Subject ();
}
else if (fieldName.equals (FIELD_ApplicationStatus))
{
return getWriteability_ApplicationStatus ();
}
else if (fieldName.equals (FIELD_DelayHrs))
{
return getWriteability_DelayHrs ();
}
else if (fieldName.equals (FIELD_DelayMin))
{
return getWriteability_DelayMin ();
}
else if (fieldName.equals (FIELD_Variance))
{
return getWriteability_Variance ();
}
else if (fieldName.equals (FIELD_BusinessHoursOnly))
{
return getWriteability_BusinessHoursOnly ();
}
else if (fieldName.equals (FIELD_MessageContent))
{
return getWriteability_MessageContent ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_TemplateName () != FieldWriteability.TRUE)
{
fields.add (FIELD_TemplateName);
}
if (getWriteability_Subject () != FieldWriteability.TRUE)
{
fields.add (FIELD_Subject);
}
if (getWriteability_ApplicationStatus () != FieldWriteability.TRUE)
{
fields.add (FIELD_ApplicationStatus);
}
if (getWriteability_DelayHrs () != FieldWriteability.TRUE)
{
fields.add (FIELD_DelayHrs);
}
if (getWriteability_DelayMin () != FieldWriteability.TRUE)
{
fields.add (FIELD_DelayMin);
}
if (getWriteability_Variance () != FieldWriteability.TRUE)
{
fields.add (FIELD_Variance);
}
if (getWriteability_BusinessHoursOnly () != FieldWriteability.TRUE)
{
fields.add (FIELD_BusinessHoursOnly);
}
if (getWriteability_MessageContent () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageContent);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_TemplateName.getAttribObject (getClass (), _TemplateName, true, FIELD_TemplateName));
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, true, FIELD_Subject));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
result.add(HELPER_DelayHrs.getAttribObject (getClass (), _DelayHrs, false, FIELD_DelayHrs));
result.add(HELPER_DelayMin.getAttribObject (getClass (), _DelayMin, false, FIELD_DelayMin));
result.add(HELPER_Variance.getAttribObject (getClass (), _Variance, false, FIELD_Variance));
result.add(HELPER_BusinessHoursOnly.getAttribObject (getClass (), _BusinessHoursOnly, false, FIELD_BusinessHoursOnly));
result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_MessageTemplate.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_MessageTemplate.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_MessageTemplate.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_MessageTemplate.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class MessageTemplateBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<MessageTemplate>
{
/**
* Get the attribute TemplateName
*/
public String getTemplateName (MessageTemplate obj, String original)
{
return original;
}
/**
* Change the value set for attribute TemplateName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setTemplateName (MessageTemplate obj, String newTemplateName) throws FieldException
{
return newTemplateName;
}
/**
* Get the attribute Subject
*/
public String getSubject (MessageTemplate obj, String original)
{
return original;
}
/**
* Change the value set for attribute Subject.
* May modify the field beforehand
* Occurs before validation.
*/
public String setSubject (MessageTemplate obj, String newSubject) throws FieldException
{
return newSubject;
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus (MessageTemplate obj, ApplicationStatus original)
{
return original;
}
/**
* Change the value set for attribute ApplicationStatus.
* May modify the field beforehand
* Occurs before validation.
*/
public ApplicationStatus setApplicationStatus (MessageTemplate obj, ApplicationStatus newApplicationStatus) throws FieldException
{
return newApplicationStatus;
}
/**
* Get the attribute DelayHrs
*/
public Integer getDelayHrs (MessageTemplate obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute DelayHrs.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setDelayHrs (MessageTemplate obj, Integer newDelayHrs) throws FieldException
{
return newDelayHrs;
}
/**
* Get the attribute DelayMin
*/
public Integer getDelayMin (MessageTemplate obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute DelayMin.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setDelayMin (MessageTemplate obj, Integer newDelayMin) throws FieldException
{
return newDelayMin;
}
/**
* Get the attribute Variance
*/
public Integer getVariance (MessageTemplate obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute Variance.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setVariance (MessageTemplate obj, Integer newVariance) throws FieldException
{
return newVariance;
}
/**
* Get the attribute BusinessHoursOnly
*/
public Boolean getBusinessHoursOnly (MessageTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute BusinessHoursOnly.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setBusinessHoursOnly (MessageTemplate obj, Boolean newBusinessHoursOnly) throws FieldException
{
return newBusinessHoursOnly;
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent (MessageTemplate obj, String original)
{
return original;
}
/**
* Change the value set for attribute MessageContent.
* May modify the field beforehand
* Occurs before validation.
*/
public String setMessageContent (MessageTemplate obj, String newMessageContent) throws FieldException
{
return newMessageContent;
}
}
public ORMPipeLine pipes()
{
return new MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> ((MessageTemplate)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> pipelineMessageTemplate()
{
return (MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate>) pipes();
}
public static MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> pipesMessageTemplate(Collection<MessageTemplate> items)
{
return REFERENCE_MessageTemplate.new MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> (items);
}
public static MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> pipesMessageTemplate(MessageTemplate[] _items)
{
return pipesMessageTemplate(Arrays.asList (_items));
}
public static MessageTemplatePipeLineFactory<MessageTemplate, MessageTemplate> pipesMessageTemplate()
{
return pipesMessageTemplate((Collection)null);
}
public class MessageTemplatePipeLineFactory<From extends BaseBusinessClass, Me extends MessageTemplate> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> MessageTemplatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public MessageTemplatePipeLineFactory (From seed)
{
super(seed);
}
public MessageTemplatePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("TemplateName"))
{
return toTemplateName ();
}
if (name.equals ("Subject"))
{
return toSubject ();
}
if (name.equals ("ApplicationStatus"))
{
return toApplicationStatus ();
}
if (name.equals ("DelayHrs"))
{
return toDelayHrs ();
}
if (name.equals ("DelayMin"))
{
return toDelayMin ();
}
if (name.equals ("Variance"))
{
return toVariance ();
}
if (name.equals ("BusinessHoursOnly"))
{
return toBusinessHoursOnly ();
}
if (name.equals ("MessageContent"))
{
return toMessageContent ();
}
return super.to(name);
}
public PipeLine<From, String> toTemplateName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_TemplateName)); }
public PipeLine<From, String> toSubject () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Subject)); }
public PipeLine<From, ApplicationStatus> toApplicationStatus () { return pipe(new ORMAttributePipe<Me, ApplicationStatus>(FIELD_ApplicationStatus)); }
public PipeLine<From, Integer> toDelayHrs () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_DelayHrs)); }
public PipeLine<From, Integer> toDelayMin () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_DelayMin)); }
public PipeLine<From, Integer> toVariance () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_Variance)); }
public PipeLine<From, Boolean> toBusinessHoursOnly () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_BusinessHoursOnly)); }
public PipeLine<From, String> toMessageContent () { return pipe(new ORMAttributePipe<Me, String>(FIELD_MessageContent)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyMessageTemplate extends MessageTemplate
{
// Default constructor primarily to support Externalisable
public DummyMessageTemplate()
{
super();
}
public void assertValid ()
{
}
}
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseScheduledEmail extends BaseBusinessClass
{
// Reference instance for the object
public static final ScheduledEmail REFERENCE_ScheduledEmail = new ScheduledEmail ();
// Reference instance for the object
public static final ScheduledEmail DUMMY_ScheduledEmail = new DummyScheduledEmail ();
// Static constants corresponding to field names
public static final String FIELD_Subject = "Subject";
public static final String FIELD_ScheduledDate = "ScheduledDate";
public static final String FIELD_ApplicationStatus = "ApplicationStatus";
public static final String FIELD_MessageContent = "MessageContent";
public static final String SINGLEREFERENCE_JobApplication = "JobApplication";
public static final String BACKREF_JobApplication = "";
public static final String SINGLEREFERENCE_MessageTemplate = "MessageTemplate";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<ScheduledEmail> HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<ScheduledEmail> HELPER_ScheduledDate = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<ScheduledEmail, ApplicationStatus> HELPER_ApplicationStatus = new EnumeratedAttributeHelper<ScheduledEmail, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper<ScheduledEmail> HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _Subject;
private Date _ScheduledDate;
private ApplicationStatus _ApplicationStatus;
private String _MessageContent;
// Private attributes corresponding to single references
private SingleAssociation<ScheduledEmail, JobApplication> _JobApplication;
private SingleAssociation<ScheduledEmail, MessageTemplate> _MessageTemplate;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_ScheduledEmail = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Subject_Validators;
private static final AttributeValidator[] FIELD_ScheduledDate_Validators;
private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
private static final AttributeValidator[] FIELD_MessageContent_Validators;
// Arrays of behaviour decorators
private static final ScheduledEmailBehaviourDecorator[] ScheduledEmail_BehaviourDecorators;
static
{
try
{
String tmp_JobApplication = JobApplication.BACKREF_ScheduledEmails;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_JobApplication();
setupAssocMetaData_MessageTemplate();
FIELD_Subject_Validators = (AttributeValidator[])setupAttribMetaData_Subject(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ScheduledDate_Validators = (AttributeValidator[])setupAttribMetaData_ScheduledDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageContent_Validators = (AttributeValidator[])setupAttribMetaData_MessageContent(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_ScheduledEmail.initialiseReference ();
DUMMY_ScheduledEmail.initialiseReference ();
ScheduledEmail_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(ScheduledEmail.class).toArray(new ScheduledEmailBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_JobApplication()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "ScheduledEmails");
metaInfo.put ("dbcol", "job_application_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobApplication");
metaInfo.put ("type", "JobApplication");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.JobApplication:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (SINGLEREFERENCE_JobApplication, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_MessageTemplate()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_template_id");
metaInfo.put ("name", "MessageTemplate");
metaInfo.put ("type", "MessageTemplate");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.MessageTemplate:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (SINGLEREFERENCE_MessageTemplate, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Subject(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "subject");
metaInfo.put ("length", "200");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Subject");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.Subject:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (FIELD_Subject, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ScheduledEmail.class, "Subject", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ScheduledEmail.Subject:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ScheduledDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "scheduled_date");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ScheduledDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.ScheduledDate:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (FIELD_ScheduledDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ScheduledEmail.class, "ScheduledDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ScheduledEmail.ScheduledDate:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ApplicationStatus(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "application_status");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ApplicationStatus");
metaInfo.put ("type", "ApplicationStatus");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.ApplicationStatus:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (FIELD_ApplicationStatus, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ScheduledEmail.class, "ApplicationStatus", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ScheduledEmail.ApplicationStatus:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_MessageContent(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_content");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "MessageContent");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ScheduledEmail.MessageContent:", metaInfo);
ATTRIBUTES_METADATA_ScheduledEmail.put (FIELD_MessageContent, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ScheduledEmail.class, "MessageContent", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ScheduledEmail.MessageContent:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseScheduledEmail ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return ScheduledEmail_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_Subject = (String)(HELPER_Subject.initialise (_Subject));
_ScheduledDate = (Date)(HELPER_ScheduledDate.initialise (_ScheduledDate));
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (_ApplicationStatus));
_MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_JobApplication = new SingleAssociation<ScheduledEmail, JobApplication> (this, SINGLEREFERENCE_JobApplication, JobApplication.MULTIPLEREFERENCE_ScheduledEmails, JobApplication.REFERENCE_JobApplication, "tl_scheduled_email");
_MessageTemplate = new SingleAssociation<ScheduledEmail, MessageTemplate> (this, SINGLEREFERENCE_MessageTemplate, null, MessageTemplate.REFERENCE_MessageTemplate, "tl_scheduled_email");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_JobApplication = new SingleAssociation<ScheduledEmail, JobApplication> (this, SINGLEREFERENCE_JobApplication, JobApplication.MULTIPLEREFERENCE_ScheduledEmails, JobApplication.REFERENCE_JobApplication, "tl_scheduled_email");
_MessageTemplate = new SingleAssociation<ScheduledEmail, MessageTemplate> (this, SINGLEREFERENCE_MessageTemplate, null, MessageTemplate.REFERENCE_MessageTemplate, "tl_scheduled_email");
return this;
}
/**
* Get the attribute Subject
*/
public String getSubject ()
{
assertValid();
String valToReturn = _Subject;
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
valToReturn = bhd.getSubject ((ScheduledEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSubjectChange (String newSubject) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSubjectChange () throws FieldException
{
}
public FieldWriteability getWriteability_Subject ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Subject. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSubject (String newSubject) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
try
{
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
newSubject = bhd.setSubject ((ScheduledEmail)this, newSubject);
oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
}
BusinessObjectParser.assertFieldCondition (newSubject != null, this, FIELD_Subject, "mandatory");
if (FIELD_Subject_Validators.length > 0)
{
Object newSubjectObj = HELPER_Subject.toObject (newSubject);
if (newSubjectObj != null)
{
int loopMax = FIELD_Subject_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ScheduledEmail.get (FIELD_Subject);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Subject_Validators[v].checkAttribute (this, FIELD_Subject, metadata, newSubjectObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Subject () != FieldWriteability.FALSE, "Field Subject is not writeable");
preSubjectChange (newSubject);
markFieldChange (FIELD_Subject);
_Subject = newSubject;
postFieldChange (FIELD_Subject);
postSubjectChange ();
}
}
/**
* Get the attribute ScheduledDate
*/
public Date getScheduledDate ()
{
assertValid();
Date valToReturn = _ScheduledDate;
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
valToReturn = bhd.getScheduledDate ((ScheduledEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preScheduledDateChange (Date newScheduledDate) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postScheduledDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_ScheduledDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ScheduledDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setScheduledDate (Date newScheduledDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ScheduledDate.compare (_ScheduledDate, newScheduledDate);
try
{
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
newScheduledDate = bhd.setScheduledDate ((ScheduledEmail)this, newScheduledDate);
oldAndNewIdentical = HELPER_ScheduledDate.compare (_ScheduledDate, newScheduledDate);
}
BusinessObjectParser.assertFieldCondition (newScheduledDate != null, this, FIELD_ScheduledDate, "mandatory");
if (FIELD_ScheduledDate_Validators.length > 0)
{
Object newScheduledDateObj = HELPER_ScheduledDate.toObject (newScheduledDate);
if (newScheduledDateObj != null)
{
int loopMax = FIELD_ScheduledDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ScheduledEmail.get (FIELD_ScheduledDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ScheduledDate_Validators[v].checkAttribute (this, FIELD_ScheduledDate, metadata, newScheduledDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ScheduledDate () != FieldWriteability.FALSE, "Field ScheduledDate is not writeable");
preScheduledDateChange (newScheduledDate);
markFieldChange (FIELD_ScheduledDate);
_ScheduledDate = newScheduledDate;
postFieldChange (FIELD_ScheduledDate);
postScheduledDateChange ();
}
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus ()
{
assertValid();
ApplicationStatus valToReturn = _ApplicationStatus;
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
valToReturn = bhd.getApplicationStatus ((ScheduledEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preApplicationStatusChange (ApplicationStatus newApplicationStatus) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postApplicationStatusChange () throws FieldException
{
}
public FieldWriteability getWriteability_ApplicationStatus ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ApplicationStatus. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setApplicationStatus (ApplicationStatus newApplicationStatus) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
try
{
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
newApplicationStatus = bhd.setApplicationStatus ((ScheduledEmail)this, newApplicationStatus);
oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
}
BusinessObjectParser.assertFieldCondition (newApplicationStatus != null, this, FIELD_ApplicationStatus, "mandatory");
if (FIELD_ApplicationStatus_Validators.length > 0)
{
Object newApplicationStatusObj = HELPER_ApplicationStatus.toObject (newApplicationStatus);
if (newApplicationStatusObj != null)
{
int loopMax = FIELD_ApplicationStatus_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ScheduledEmail.get (FIELD_ApplicationStatus);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ApplicationStatus_Validators[v].checkAttribute (this, FIELD_ApplicationStatus, metadata, newApplicationStatusObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ApplicationStatus () != FieldWriteability.FALSE, "Field ApplicationStatus is not writeable");
preApplicationStatusChange (newApplicationStatus);
markFieldChange (FIELD_ApplicationStatus);
_ApplicationStatus = newApplicationStatus;
postFieldChange (FIELD_ApplicationStatus);
postApplicationStatusChange ();
}
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent ()
{
assertValid();
String valToReturn = _MessageContent;
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
valToReturn = bhd.getMessageContent ((ScheduledEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preMessageContentChange (String newMessageContent) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postMessageContentChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageContent ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageContent. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageContent (String newMessageContent) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
try
{
for (ScheduledEmailBehaviourDecorator bhd : ScheduledEmail_BehaviourDecorators)
{
newMessageContent = bhd.setMessageContent ((ScheduledEmail)this, newMessageContent);
oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
}
BusinessObjectParser.assertFieldCondition (newMessageContent != null, this, FIELD_MessageContent, "mandatory");
if (FIELD_MessageContent_Validators.length > 0)
{
Object newMessageContentObj = HELPER_MessageContent.toObject (newMessageContent);
if (newMessageContentObj != null)
{
int loopMax = FIELD_MessageContent_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ScheduledEmail.get (FIELD_MessageContent);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageContent_Validators[v].checkAttribute (this, FIELD_MessageContent, metadata, newMessageContentObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageContent () != FieldWriteability.FALSE, "Field MessageContent is not writeable");
preMessageContentChange (newMessageContent);
markFieldChange (FIELD_MessageContent);
_MessageContent = newMessageContent;
postFieldChange (FIELD_MessageContent);
postMessageContentChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("JobApplication");
result.add("MessageTemplate");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return _JobApplication.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
return _MessageTemplate.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return JobApplication.MULTIPLEREFERENCE_ScheduledEmails ;
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
return null ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplication ();
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
return getMessageTemplate ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplication (getType);
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
return getMessageTemplate (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplicationID ();
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
return getMessageTemplateID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
setJobApplication ((JobApplication)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_MessageTemplate))
{
setMessageTemplate ((MessageTemplate)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference JobApplication
*/
public JobApplication getJobApplication () throws StorageException
{
assertValid();
try
{
return (JobApplication)(_JobApplication.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in ScheduledEmail:", this.getObjectID (), ", was trying to get JobApplication:", getJobApplicationID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _JobApplication.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public JobApplication getJobApplication (Get getType) throws StorageException
{
assertValid();
return _JobApplication.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobApplicationID ()
{
assertValid();
if (_JobApplication == null)
{
return null;
}
else
{
return _JobApplication.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preJobApplicationChange (JobApplication newJobApplication) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobApplicationChange () throws FieldException
{
}
public FieldWriteability getWriteability_JobApplication ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference JobApplication. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJobApplication != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
if (_JobApplication.wouldReferencedChange (newJobApplication))
{
assertValid();
Debug.assertion (getWriteability_JobApplication () != FieldWriteability.FALSE, "Assoc JobApplication is not writeable");
preJobApplicationChange (newJobApplication);
JobApplication oldJobApplication = getJobApplication ();
if (oldJobApplication != null)
{
// This is to stop validation from triggering when we are removed
_JobApplication.set (null);
oldJobApplication.removeFromScheduledEmails ((ScheduledEmail)(this));
}
_JobApplication.set (newJobApplication);
if (newJobApplication != null)
{
newJobApplication.addToScheduledEmails ((ScheduledEmail)(this));
}
postJobApplicationChange ();
}
}
/**
* Get the reference MessageTemplate
*/
public MessageTemplate getMessageTemplate () throws StorageException
{
assertValid();
try
{
return (MessageTemplate)(_MessageTemplate.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in ScheduledEmail:", this.getObjectID (), ", was trying to get MessageTemplate:", getMessageTemplateID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _MessageTemplate.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public MessageTemplate getMessageTemplate (Get getType) throws StorageException
{
assertValid();
return _MessageTemplate.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getMessageTemplateID ()
{
assertValid();
if (_MessageTemplate == null)
{
return null;
}
else
{
return _MessageTemplate.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preMessageTemplateChange (MessageTemplate newMessageTemplate) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postMessageTemplateChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageTemplate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference MessageTemplate. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setMessageTemplate (MessageTemplate newMessageTemplate) throws StorageException, FieldException
{
if (_MessageTemplate.wouldReferencedChange (newMessageTemplate))
{
assertValid();
Debug.assertion (getWriteability_MessageTemplate () != FieldWriteability.FALSE, "Assoc MessageTemplate is not writeable");
preMessageTemplateChange (newMessageTemplate);
_MessageTemplate.set (newMessageTemplate);
postMessageTemplateChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_JobApplication.isLoaded () || getTransaction ().isObjectLoaded (_JobApplication.getReferencedType (), getJobApplicationID ()))
{
JobApplication referenced = getJobApplication ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null ScheduledEmails from ", getObjectID (), " to ", referenced.getObjectID ());
_JobApplication.set (null);
referenced.removeFromScheduledEmails ((ScheduledEmail)this);
}
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public ScheduledEmail newInstance ()
{
return new ScheduledEmail ();
}
public ScheduledEmail referenceInstance ()
{
return REFERENCE_ScheduledEmail;
}
public ScheduledEmail getInTransaction (ObjectTransaction t) throws StorageException
{
return getScheduledEmailByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_ScheduledEmail;
}
public String getBaseSetName ()
{
return "tl_scheduled_email";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_scheduled_emailPSet = allSets.getPersistentSet (myID, "tl_scheduled_email", myPSetStatus);
tl_scheduled_emailPSet.setAttrib (FIELD_ObjectID, myID);
tl_scheduled_emailPSet.setAttrib (FIELD_Subject, HELPER_Subject.toObject (_Subject)); //
tl_scheduled_emailPSet.setAttrib (FIELD_ScheduledDate, HELPER_ScheduledDate.toObject (_ScheduledDate)); //
tl_scheduled_emailPSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
tl_scheduled_emailPSet.setAttrib (FIELD_MessageContent, HELPER_MessageContent.toObject (_MessageContent)); //
_JobApplication.getPersistentSets (allSets);
_MessageTemplate.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_scheduled_emailPSet = allSets.getPersistentSet (objectID, "tl_scheduled_email");
_Subject = (String)(HELPER_Subject.fromObject (_Subject, tl_scheduled_emailPSet.getAttrib (FIELD_Subject))); //
_ScheduledDate = (Date)(HELPER_ScheduledDate.fromObject (_ScheduledDate, tl_scheduled_emailPSet.getAttrib (FIELD_ScheduledDate))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_scheduled_emailPSet.getAttrib (FIELD_ApplicationStatus))); //
_MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_scheduled_emailPSet.getAttrib (FIELD_MessageContent))); //
_JobApplication.setFromPersistentSets (objectID, allSets);
_MessageTemplate.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof ScheduledEmail)
{
ScheduledEmail otherScheduledEmail = (ScheduledEmail)other;
try
{
setSubject (otherScheduledEmail.getSubject ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setScheduledDate (otherScheduledEmail.getScheduledDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setApplicationStatus (otherScheduledEmail.getApplicationStatus ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setMessageContent (otherScheduledEmail.getMessageContent ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseScheduledEmail)
{
BaseScheduledEmail sourceScheduledEmail = (BaseScheduledEmail)(source);
_Subject = sourceScheduledEmail._Subject;
_ScheduledDate = sourceScheduledEmail._ScheduledDate;
_ApplicationStatus = sourceScheduledEmail._ApplicationStatus;
_MessageContent = sourceScheduledEmail._MessageContent;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseScheduledEmail)
{
BaseScheduledEmail sourceScheduledEmail = (BaseScheduledEmail)(source);
_JobApplication.copyFrom (sourceScheduledEmail._JobApplication, linkToGhosts);
_MessageTemplate.copyFrom (sourceScheduledEmail._MessageTemplate, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseScheduledEmail)
{
BaseScheduledEmail sourceScheduledEmail = (BaseScheduledEmail)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
context.check (getJobApplicationID() != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_Subject = (String)(HELPER_Subject.readExternal (_Subject, vals.get(FIELD_Subject))); //
_ScheduledDate = (Date)(HELPER_ScheduledDate.readExternal (_ScheduledDate, vals.get(FIELD_ScheduledDate))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
_MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); //
_JobApplication.readExternalData(vals.get(SINGLEREFERENCE_JobApplication));
_MessageTemplate.readExternalData(vals.get(SINGLEREFERENCE_MessageTemplate));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_Subject, HELPER_Subject.writeExternal (_Subject));
vals.put (FIELD_ScheduledDate, HELPER_ScheduledDate.writeExternal (_ScheduledDate));
vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent));
vals.put (SINGLEREFERENCE_JobApplication, _JobApplication.writeExternalData());
vals.put (SINGLEREFERENCE_MessageTemplate, _MessageTemplate.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseScheduledEmail)
{
BaseScheduledEmail otherScheduledEmail = (BaseScheduledEmail)(other);
if (!HELPER_Subject.compare(this._Subject, otherScheduledEmail._Subject))
{
listener.notifyFieldChange(this, other, FIELD_Subject, HELPER_Subject.toObject(this._Subject), HELPER_Subject.toObject(otherScheduledEmail._Subject));
}
if (!HELPER_ScheduledDate.compare(this._ScheduledDate, otherScheduledEmail._ScheduledDate))
{
listener.notifyFieldChange(this, other, FIELD_ScheduledDate, HELPER_ScheduledDate.toObject(this._ScheduledDate), HELPER_ScheduledDate.toObject(otherScheduledEmail._ScheduledDate));
}
if (!HELPER_ApplicationStatus.compare(this._ApplicationStatus, otherScheduledEmail._ApplicationStatus))
{
listener.notifyFieldChange(this, other, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(this._ApplicationStatus), HELPER_ApplicationStatus.toObject(otherScheduledEmail._ApplicationStatus));
}
if (!HELPER_MessageContent.compare(this._MessageContent, otherScheduledEmail._MessageContent))
{
listener.notifyFieldChange(this, other, FIELD_MessageContent, HELPER_MessageContent.toObject(this._MessageContent), HELPER_MessageContent.toObject(otherScheduledEmail._MessageContent));
}
// Compare single assocs
_JobApplication.compare (otherScheduledEmail._JobApplication, listener);
_MessageTemplate.compare (otherScheduledEmail._MessageTemplate, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Subject, HELPER_Subject.toObject(getSubject()));
visitor.visitField(this, FIELD_ScheduledDate, HELPER_ScheduledDate.toObject(getScheduledDate()));
visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent()));
visitor.visitAssociation (_JobApplication);
visitor.visitAssociation (_MessageTemplate);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_JobApplication))
{
visitor.visit (_JobApplication);
}
if (scope.includes (_MessageTemplate))
{
visitor.visit (_MessageTemplate);
}
}
public static ScheduledEmail createScheduledEmail (ObjectTransaction transaction) throws StorageException
{
ScheduledEmail result = new ScheduledEmail ();
result.initialiseNewObject (transaction);
return result;
}
public static ScheduledEmail getScheduledEmailByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (ScheduledEmail)(transaction.getObjectByID (REFERENCE_ScheduledEmail, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return filter.matches (getSubject ());
}
else if (attribName.equals (FIELD_ScheduledDate))
{
return filter.matches (getScheduledDate ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return filter.matches (getApplicationStatus ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return filter.matches (getMessageContent ());
}
else if (attribName.equals (SINGLEREFERENCE_JobApplication))
{
return filter.matches (getJobApplication ());
}
else if (attribName.equals (SINGLEREFERENCE_MessageTemplate))
{
return filter.matches (getMessageTemplate ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<ScheduledEmail>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_scheduled_email.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_scheduled_email.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_scheduled_email.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andSubject (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_scheduled_email.subject", "Subject");
return this;
}
public SearchAll andScheduledDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_scheduled_email.scheduled_date", "ScheduledDate");
return this;
}
public SearchAll andApplicationStatus (QueryFilter<ApplicationStatus> filter)
{
filter.addFilter (context, "tl_scheduled_email.application_status", "ApplicationStatus");
return this;
}
public SearchAll andMessageContent (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_scheduled_email.message_content", "MessageContent");
return this;
}
public SearchAll andJobApplication (QueryFilter<JobApplication> filter)
{
filter.addFilter (context, "tl_scheduled_email.job_application_id", "JobApplication");
return this;
}
public SearchAll andMessageTemplate (QueryFilter<MessageTemplate> filter)
{
filter.addFilter (context, "tl_scheduled_email.message_template_id", "MessageTemplate");
return this;
}
public ScheduledEmail[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_ScheduledEmail, SEARCH_All, criteria);
Set<ScheduledEmail> typedResults = new LinkedHashSet <ScheduledEmail> ();
for (BaseBusinessClass bbcResult : results)
{
ScheduledEmail aResult = (ScheduledEmail)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ScheduledEmail[0]);
}
}
public static ScheduledEmail[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject.toObject (getSubject ());
}
else if (attribName.equals (FIELD_ScheduledDate))
{
return HELPER_ScheduledDate.toObject (getScheduledDate ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus.toObject (getApplicationStatus ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent.toObject (getMessageContent ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject;
}
else if (attribName.equals (FIELD_ScheduledDate))
{
return HELPER_ScheduledDate;
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus;
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
setSubject ((String)(HELPER_Subject.fromObject (_Subject, attribValue)));
}
else if (attribName.equals (FIELD_ScheduledDate))
{
setScheduledDate ((Date)(HELPER_ScheduledDate.fromObject (_ScheduledDate, attribValue)));
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
setApplicationStatus ((ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, attribValue)));
}
else if (attribName.equals (FIELD_MessageContent))
{
setMessageContent ((String)(HELPER_MessageContent.fromObject (_MessageContent, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_Subject))
{
return getWriteability_Subject ();
}
else if (fieldName.equals (FIELD_ScheduledDate))
{
return getWriteability_ScheduledDate ();
}
else if (fieldName.equals (FIELD_ApplicationStatus))
{
return getWriteability_ApplicationStatus ();
}
else if (fieldName.equals (FIELD_MessageContent))
{
return getWriteability_MessageContent ();
}
else if (fieldName.equals (SINGLEREFERENCE_JobApplication))
{
return getWriteability_JobApplication ();
}
else if (fieldName.equals (SINGLEREFERENCE_MessageTemplate))
{
return getWriteability_MessageTemplate ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_Subject () != FieldWriteability.TRUE)
{
fields.add (FIELD_Subject);
}
if (getWriteability_ScheduledDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_ScheduledDate);
}
if (getWriteability_ApplicationStatus () != FieldWriteability.TRUE)
{
fields.add (FIELD_ApplicationStatus);
}
if (getWriteability_MessageContent () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageContent);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, true, FIELD_Subject));
result.add(HELPER_ScheduledDate.getAttribObject (getClass (), _ScheduledDate, true, FIELD_ScheduledDate));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_ScheduledEmail.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_ScheduledEmail.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_ScheduledEmail.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_ScheduledEmail.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class ScheduledEmailBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<ScheduledEmail>
{
/**
* Get the attribute Subject
*/
public String getSubject (ScheduledEmail obj, String original)
{
return original;
}
/**
* Change the value set for attribute Subject.
* May modify the field beforehand
* Occurs before validation.
*/
public String setSubject (ScheduledEmail obj, String newSubject) throws FieldException
{
return newSubject;
}
/**
* Get the attribute ScheduledDate
*/
public Date getScheduledDate (ScheduledEmail obj, Date original)
{
return original;
}
/**
* Change the value set for attribute ScheduledDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setScheduledDate (ScheduledEmail obj, Date newScheduledDate) throws FieldException
{
return newScheduledDate;
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus (ScheduledEmail obj, ApplicationStatus original)
{
return original;
}
/**
* Change the value set for attribute ApplicationStatus.
* May modify the field beforehand
* Occurs before validation.
*/
public ApplicationStatus setApplicationStatus (ScheduledEmail obj, ApplicationStatus newApplicationStatus) throws FieldException
{
return newApplicationStatus;
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent (ScheduledEmail obj, String original)
{
return original;
}
/**
* Change the value set for attribute MessageContent.
* May modify the field beforehand
* Occurs before validation.
*/
public String setMessageContent (ScheduledEmail obj, String newMessageContent) throws FieldException
{
return newMessageContent;
}
}
public ORMPipeLine pipes()
{
return new ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> ((ScheduledEmail)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> pipelineScheduledEmail()
{
return (ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail>) pipes();
}
public static ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> pipesScheduledEmail(Collection<ScheduledEmail> items)
{
return REFERENCE_ScheduledEmail.new ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> (items);
}
public static ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> pipesScheduledEmail(ScheduledEmail[] _items)
{
return pipesScheduledEmail(Arrays.asList (_items));
}
public static ScheduledEmailPipeLineFactory<ScheduledEmail, ScheduledEmail> pipesScheduledEmail()
{
return pipesScheduledEmail((Collection)null);
}
public class ScheduledEmailPipeLineFactory<From extends BaseBusinessClass, Me extends ScheduledEmail> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> ScheduledEmailPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ScheduledEmailPipeLineFactory (From seed)
{
super(seed);
}
public ScheduledEmailPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Subject"))
{
return toSubject ();
}
if (name.equals ("ScheduledDate"))
{
return toScheduledDate ();
}
if (name.equals ("ApplicationStatus"))
{
return toApplicationStatus ();
}
if (name.equals ("MessageContent"))
{
return toMessageContent ();
}
if (name.equals ("JobApplication"))
{
return toJobApplication ();
}
if (name.equals ("MessageTemplate"))
{
return toMessageTemplate ();
}
return super.to(name);
}
public PipeLine<From, String> toSubject () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Subject)); }
public PipeLine<From, Date> toScheduledDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ScheduledDate)); }
public PipeLine<From, ApplicationStatus> toApplicationStatus () { return pipe(new ORMAttributePipe<Me, ApplicationStatus>(FIELD_ApplicationStatus)); }
public PipeLine<From, String> toMessageContent () { return pipe(new ORMAttributePipe<Me, String>(FIELD_MessageContent)); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplication () { return toJobApplication (Filter.ALL); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplication (Filter<JobApplication> filter)
{
return JobApplication.REFERENCE_JobApplication.new JobApplicationPipeLineFactory<From, JobApplication> (this, new ORMSingleAssocPipe<Me, JobApplication>(SINGLEREFERENCE_JobApplication, filter));
}
public MessageTemplate.MessageTemplatePipeLineFactory<From, MessageTemplate> toMessageTemplate () { return toMessageTemplate (Filter.ALL); }
public MessageTemplate.MessageTemplatePipeLineFactory<From, MessageTemplate> toMessageTemplate (Filter<MessageTemplate> filter)
{
return MessageTemplate.REFERENCE_MessageTemplate.new MessageTemplatePipeLineFactory<From, MessageTemplate> (this, new ORMSingleAssocPipe<Me, MessageTemplate>(SINGLEREFERENCE_MessageTemplate, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyScheduledEmail extends ScheduledEmail
{
// Default constructor primarily to support Externalisable
public DummyScheduledEmail()
{
super();
}
public void assertValid ()
{
}
public JobApplication getJobApplication () throws StorageException
{
return (JobApplication)(JobApplication.DUMMY_JobApplication);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobApplicationID ()
{
return JobApplication.DUMMY_JobApplication.getObjectID();
}
public MessageTemplate getMessageTemplate () throws StorageException
{
return (MessageTemplate)(MessageTemplate.DUMMY_MessageTemplate);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getMessageTemplateID ()
{
return MessageTemplate.DUMMY_MessageTemplate.getObjectID();
}
}
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseSentEmail extends BaseBusinessClass
{
// Reference instance for the object
public static final SentEmail REFERENCE_SentEmail = new SentEmail ();
// Reference instance for the object
public static final SentEmail DUMMY_SentEmail = new DummySentEmail ();
// Static constants corresponding to field names
public static final String FIELD_Subject = "Subject";
public static final String FIELD_SentDate = "SentDate";
public static final String FIELD_ApplicationStatus = "ApplicationStatus";
public static final String FIELD_MessageContent = "MessageContent";
public static final String FIELD_EmailTo = "EmailTo";
public static final String SINGLEREFERENCE_JobApplication = "JobApplication";
public static final String BACKREF_JobApplication = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<SentEmail> HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<SentEmail> HELPER_SentDate = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<SentEmail, ApplicationStatus> HELPER_ApplicationStatus = new EnumeratedAttributeHelper<SentEmail, ApplicationStatus> (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper<SentEmail> HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<SentEmail> HELPER_EmailTo = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _Subject;
private Date _SentDate;
private ApplicationStatus _ApplicationStatus;
private String _MessageContent;
private String _EmailTo;
// Private attributes corresponding to single references
private SingleAssociation<SentEmail, JobApplication> _JobApplication;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_SentEmail = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Subject_Validators;
private static final AttributeValidator[] FIELD_SentDate_Validators;
private static final AttributeValidator[] FIELD_ApplicationStatus_Validators;
private static final AttributeValidator[] FIELD_MessageContent_Validators;
private static final AttributeValidator[] FIELD_EmailTo_Validators;
// Arrays of behaviour decorators
private static final SentEmailBehaviourDecorator[] SentEmail_BehaviourDecorators;
static
{
try
{
String tmp_JobApplication = JobApplication.BACKREF_SentEmails;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_JobApplication();
FIELD_Subject_Validators = (AttributeValidator[])setupAttribMetaData_Subject(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_SentDate_Validators = (AttributeValidator[])setupAttribMetaData_SentDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicationStatus_Validators = (AttributeValidator[])setupAttribMetaData_ApplicationStatus(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageContent_Validators = (AttributeValidator[])setupAttribMetaData_MessageContent(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_EmailTo_Validators = (AttributeValidator[])setupAttribMetaData_EmailTo(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_SentEmail.initialiseReference ();
DUMMY_SentEmail.initialiseReference ();
SentEmail_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(SentEmail.class).toArray(new SentEmailBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static void setupAssocMetaData_JobApplication()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "SentEmails");
metaInfo.put ("dbcol", "job_application_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "JobApplication");
metaInfo.put ("type", "JobApplication");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.JobApplication:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (SINGLEREFERENCE_JobApplication, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Subject(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "subject");
metaInfo.put ("length", "200");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Subject");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.Subject:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (FIELD_Subject, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SentEmail.class, "Subject", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SentEmail.Subject:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_SentDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "sent_date");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "SentDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.SentDate:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (FIELD_SentDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SentEmail.class, "SentDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SentEmail.SentDate:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ApplicationStatus(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "application_status");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "ApplicationStatus");
metaInfo.put ("type", "ApplicationStatus");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.ApplicationStatus:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (FIELD_ApplicationStatus, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SentEmail.class, "ApplicationStatus", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SentEmail.ApplicationStatus:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_MessageContent(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "message_content");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "MessageContent");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.MessageContent:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (FIELD_MessageContent, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SentEmail.class, "MessageContent", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SentEmail.MessageContent:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_EmailTo(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "email_to");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "EmailTo");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SentEmail.EmailTo:", metaInfo);
ATTRIBUTES_METADATA_SentEmail.put (FIELD_EmailTo, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SentEmail.class, "EmailTo", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SentEmail.EmailTo:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseSentEmail ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return SentEmail_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_Subject = (String)(HELPER_Subject.initialise (_Subject));
_SentDate = (Date)(HELPER_SentDate.initialise (_SentDate));
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (_ApplicationStatus));
_MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent));
_EmailTo = (String)(HELPER_EmailTo.initialise (_EmailTo));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_JobApplication = new SingleAssociation<SentEmail, JobApplication> (this, SINGLEREFERENCE_JobApplication, JobApplication.MULTIPLEREFERENCE_SentEmails, JobApplication.REFERENCE_JobApplication, "tl_sent_email");
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_JobApplication = new SingleAssociation<SentEmail, JobApplication> (this, SINGLEREFERENCE_JobApplication, JobApplication.MULTIPLEREFERENCE_SentEmails, JobApplication.REFERENCE_JobApplication, "tl_sent_email");
return this;
}
/**
* Get the attribute Subject
*/
public String getSubject ()
{
assertValid();
String valToReturn = _Subject;
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
valToReturn = bhd.getSubject ((SentEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSubjectChange (String newSubject) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSubjectChange () throws FieldException
{
}
public FieldWriteability getWriteability_Subject ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Subject. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSubject (String newSubject) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
try
{
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
newSubject = bhd.setSubject ((SentEmail)this, newSubject);
oldAndNewIdentical = HELPER_Subject.compare (_Subject, newSubject);
}
BusinessObjectParser.assertFieldCondition (newSubject != null, this, FIELD_Subject, "mandatory");
if (FIELD_Subject_Validators.length > 0)
{
Object newSubjectObj = HELPER_Subject.toObject (newSubject);
if (newSubjectObj != null)
{
int loopMax = FIELD_Subject_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SentEmail.get (FIELD_Subject);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Subject_Validators[v].checkAttribute (this, FIELD_Subject, metadata, newSubjectObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Subject () != FieldWriteability.FALSE, "Field Subject is not writeable");
preSubjectChange (newSubject);
markFieldChange (FIELD_Subject);
_Subject = newSubject;
postFieldChange (FIELD_Subject);
postSubjectChange ();
}
}
/**
* Get the attribute SentDate
*/
public Date getSentDate ()
{
assertValid();
Date valToReturn = _SentDate;
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
valToReturn = bhd.getSentDate ((SentEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSentDateChange (Date newSentDate) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSentDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_SentDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute SentDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSentDate (Date newSentDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_SentDate.compare (_SentDate, newSentDate);
try
{
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
newSentDate = bhd.setSentDate ((SentEmail)this, newSentDate);
oldAndNewIdentical = HELPER_SentDate.compare (_SentDate, newSentDate);
}
BusinessObjectParser.assertFieldCondition (newSentDate != null, this, FIELD_SentDate, "mandatory");
if (FIELD_SentDate_Validators.length > 0)
{
Object newSentDateObj = HELPER_SentDate.toObject (newSentDate);
if (newSentDateObj != null)
{
int loopMax = FIELD_SentDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SentEmail.get (FIELD_SentDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_SentDate_Validators[v].checkAttribute (this, FIELD_SentDate, metadata, newSentDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_SentDate () != FieldWriteability.FALSE, "Field SentDate is not writeable");
preSentDateChange (newSentDate);
markFieldChange (FIELD_SentDate);
_SentDate = newSentDate;
postFieldChange (FIELD_SentDate);
postSentDateChange ();
}
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus ()
{
assertValid();
ApplicationStatus valToReturn = _ApplicationStatus;
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
valToReturn = bhd.getApplicationStatus ((SentEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preApplicationStatusChange (ApplicationStatus newApplicationStatus) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postApplicationStatusChange () throws FieldException
{
}
public FieldWriteability getWriteability_ApplicationStatus ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ApplicationStatus. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setApplicationStatus (ApplicationStatus newApplicationStatus) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
try
{
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
newApplicationStatus = bhd.setApplicationStatus ((SentEmail)this, newApplicationStatus);
oldAndNewIdentical = HELPER_ApplicationStatus.compare (_ApplicationStatus, newApplicationStatus);
}
BusinessObjectParser.assertFieldCondition (newApplicationStatus != null, this, FIELD_ApplicationStatus, "mandatory");
if (FIELD_ApplicationStatus_Validators.length > 0)
{
Object newApplicationStatusObj = HELPER_ApplicationStatus.toObject (newApplicationStatus);
if (newApplicationStatusObj != null)
{
int loopMax = FIELD_ApplicationStatus_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SentEmail.get (FIELD_ApplicationStatus);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ApplicationStatus_Validators[v].checkAttribute (this, FIELD_ApplicationStatus, metadata, newApplicationStatusObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ApplicationStatus () != FieldWriteability.FALSE, "Field ApplicationStatus is not writeable");
preApplicationStatusChange (newApplicationStatus);
markFieldChange (FIELD_ApplicationStatus);
_ApplicationStatus = newApplicationStatus;
postFieldChange (FIELD_ApplicationStatus);
postApplicationStatusChange ();
}
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent ()
{
assertValid();
String valToReturn = _MessageContent;
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
valToReturn = bhd.getMessageContent ((SentEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preMessageContentChange (String newMessageContent) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postMessageContentChange () throws FieldException
{
}
public FieldWriteability getWriteability_MessageContent ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute MessageContent. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setMessageContent (String newMessageContent) throws FieldException
{
boolean oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
try
{
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
newMessageContent = bhd.setMessageContent ((SentEmail)this, newMessageContent);
oldAndNewIdentical = HELPER_MessageContent.compare (_MessageContent, newMessageContent);
}
BusinessObjectParser.assertFieldCondition (newMessageContent != null, this, FIELD_MessageContent, "mandatory");
if (FIELD_MessageContent_Validators.length > 0)
{
Object newMessageContentObj = HELPER_MessageContent.toObject (newMessageContent);
if (newMessageContentObj != null)
{
int loopMax = FIELD_MessageContent_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SentEmail.get (FIELD_MessageContent);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_MessageContent_Validators[v].checkAttribute (this, FIELD_MessageContent, metadata, newMessageContentObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_MessageContent () != FieldWriteability.FALSE, "Field MessageContent is not writeable");
preMessageContentChange (newMessageContent);
markFieldChange (FIELD_MessageContent);
_MessageContent = newMessageContent;
postFieldChange (FIELD_MessageContent);
postMessageContentChange ();
}
}
/**
* Get the attribute EmailTo
*/
public String getEmailTo ()
{
assertValid();
String valToReturn = _EmailTo;
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
valToReturn = bhd.getEmailTo ((SentEmail)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preEmailToChange (String newEmailTo) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postEmailToChange () throws FieldException
{
}
public FieldWriteability getWriteability_EmailTo ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute EmailTo. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmailTo (String newEmailTo) throws FieldException
{
boolean oldAndNewIdentical = HELPER_EmailTo.compare (_EmailTo, newEmailTo);
try
{
for (SentEmailBehaviourDecorator bhd : SentEmail_BehaviourDecorators)
{
newEmailTo = bhd.setEmailTo ((SentEmail)this, newEmailTo);
oldAndNewIdentical = HELPER_EmailTo.compare (_EmailTo, newEmailTo);
}
BusinessObjectParser.assertFieldCondition (newEmailTo != null, this, FIELD_EmailTo, "mandatory");
if (FIELD_EmailTo_Validators.length > 0)
{
Object newEmailToObj = HELPER_EmailTo.toObject (newEmailTo);
if (newEmailToObj != null)
{
int loopMax = FIELD_EmailTo_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SentEmail.get (FIELD_EmailTo);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_EmailTo_Validators[v].checkAttribute (this, FIELD_EmailTo, metadata, newEmailToObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_EmailTo () != FieldWriteability.FALSE, "Field EmailTo is not writeable");
preEmailToChange (newEmailTo);
markFieldChange (FIELD_EmailTo);
_EmailTo = newEmailTo;
postFieldChange (FIELD_EmailTo);
postEmailToChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("JobApplication");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return _JobApplication.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return JobApplication.MULTIPLEREFERENCE_SentEmails ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplication ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplication (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
return getJobApplicationID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_JobApplication))
{
setJobApplication ((JobApplication)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference JobApplication
*/
public JobApplication getJobApplication () throws StorageException
{
assertValid();
try
{
return (JobApplication)(_JobApplication.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in SentEmail:", this.getObjectID (), ", was trying to get JobApplication:", getJobApplicationID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _JobApplication.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public JobApplication getJobApplication (Get getType) throws StorageException
{
assertValid();
return _JobApplication.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobApplicationID ()
{
assertValid();
if (_JobApplication == null)
{
return null;
}
else
{
return _JobApplication.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preJobApplicationChange (JobApplication newJobApplication) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobApplicationChange () throws FieldException
{
}
public FieldWriteability getWriteability_JobApplication ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference JobApplication. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setJobApplication (JobApplication newJobApplication) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newJobApplication != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
if (_JobApplication.wouldReferencedChange (newJobApplication))
{
assertValid();
Debug.assertion (getWriteability_JobApplication () != FieldWriteability.FALSE, "Assoc JobApplication is not writeable");
preJobApplicationChange (newJobApplication);
JobApplication oldJobApplication = getJobApplication ();
if (oldJobApplication != null)
{
// This is to stop validation from triggering when we are removed
_JobApplication.set (null);
oldJobApplication.removeFromSentEmails ((SentEmail)(this));
}
_JobApplication.set (newJobApplication);
if (newJobApplication != null)
{
newJobApplication.addToSentEmails ((SentEmail)(this));
}
postJobApplicationChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_JobApplication.isLoaded () || getTransaction ().isObjectLoaded (_JobApplication.getReferencedType (), getJobApplicationID ()))
{
JobApplication referenced = getJobApplication ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null SentEmails from ", getObjectID (), " to ", referenced.getObjectID ());
_JobApplication.set (null);
referenced.removeFromSentEmails ((SentEmail)this);
}
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public SentEmail newInstance ()
{
return new SentEmail ();
}
public SentEmail referenceInstance ()
{
return REFERENCE_SentEmail;
}
public SentEmail getInTransaction (ObjectTransaction t) throws StorageException
{
return getSentEmailByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_SentEmail;
}
public String getBaseSetName ()
{
return "tl_sent_email";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_sent_emailPSet = allSets.getPersistentSet (myID, "tl_sent_email", myPSetStatus);
tl_sent_emailPSet.setAttrib (FIELD_ObjectID, myID);
tl_sent_emailPSet.setAttrib (FIELD_Subject, HELPER_Subject.toObject (_Subject)); //
tl_sent_emailPSet.setAttrib (FIELD_SentDate, HELPER_SentDate.toObject (_SentDate)); //
tl_sent_emailPSet.setAttrib (FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject (_ApplicationStatus)); //
tl_sent_emailPSet.setAttrib (FIELD_MessageContent, HELPER_MessageContent.toObject (_MessageContent)); //
tl_sent_emailPSet.setAttrib (FIELD_EmailTo, HELPER_EmailTo.toObject (_EmailTo)); //
_JobApplication.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_sent_emailPSet = allSets.getPersistentSet (objectID, "tl_sent_email");
_Subject = (String)(HELPER_Subject.fromObject (_Subject, tl_sent_emailPSet.getAttrib (FIELD_Subject))); //
_SentDate = (Date)(HELPER_SentDate.fromObject (_SentDate, tl_sent_emailPSet.getAttrib (FIELD_SentDate))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, tl_sent_emailPSet.getAttrib (FIELD_ApplicationStatus))); //
_MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_sent_emailPSet.getAttrib (FIELD_MessageContent))); //
_EmailTo = (String)(HELPER_EmailTo.fromObject (_EmailTo, tl_sent_emailPSet.getAttrib (FIELD_EmailTo))); //
_JobApplication.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof SentEmail)
{
SentEmail otherSentEmail = (SentEmail)other;
try
{
setSubject (otherSentEmail.getSubject ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setSentDate (otherSentEmail.getSentDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setApplicationStatus (otherSentEmail.getApplicationStatus ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setMessageContent (otherSentEmail.getMessageContent ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setEmailTo (otherSentEmail.getEmailTo ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseSentEmail)
{
BaseSentEmail sourceSentEmail = (BaseSentEmail)(source);
_Subject = sourceSentEmail._Subject;
_SentDate = sourceSentEmail._SentDate;
_ApplicationStatus = sourceSentEmail._ApplicationStatus;
_MessageContent = sourceSentEmail._MessageContent;
_EmailTo = sourceSentEmail._EmailTo;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseSentEmail)
{
BaseSentEmail sourceSentEmail = (BaseSentEmail)(source);
_JobApplication.copyFrom (sourceSentEmail._JobApplication, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseSentEmail)
{
BaseSentEmail sourceSentEmail = (BaseSentEmail)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
context.check (getJobApplicationID() != null, this, SINGLEREFERENCE_JobApplication, "mandatory");
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_Subject = (String)(HELPER_Subject.readExternal (_Subject, vals.get(FIELD_Subject))); //
_SentDate = (Date)(HELPER_SentDate.readExternal (_SentDate, vals.get(FIELD_SentDate))); //
_ApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.readExternal (_ApplicationStatus, vals.get(FIELD_ApplicationStatus))); //
_MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); //
_EmailTo = (String)(HELPER_EmailTo.readExternal (_EmailTo, vals.get(FIELD_EmailTo))); //
_JobApplication.readExternalData(vals.get(SINGLEREFERENCE_JobApplication));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_Subject, HELPER_Subject.writeExternal (_Subject));
vals.put (FIELD_SentDate, HELPER_SentDate.writeExternal (_SentDate));
vals.put (FIELD_ApplicationStatus, HELPER_ApplicationStatus.writeExternal (_ApplicationStatus));
vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent));
vals.put (FIELD_EmailTo, HELPER_EmailTo.writeExternal (_EmailTo));
vals.put (SINGLEREFERENCE_JobApplication, _JobApplication.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseSentEmail)
{
BaseSentEmail otherSentEmail = (BaseSentEmail)(other);
if (!HELPER_Subject.compare(this._Subject, otherSentEmail._Subject))
{
listener.notifyFieldChange(this, other, FIELD_Subject, HELPER_Subject.toObject(this._Subject), HELPER_Subject.toObject(otherSentEmail._Subject));
}
if (!HELPER_SentDate.compare(this._SentDate, otherSentEmail._SentDate))
{
listener.notifyFieldChange(this, other, FIELD_SentDate, HELPER_SentDate.toObject(this._SentDate), HELPER_SentDate.toObject(otherSentEmail._SentDate));
}
if (!HELPER_ApplicationStatus.compare(this._ApplicationStatus, otherSentEmail._ApplicationStatus))
{
listener.notifyFieldChange(this, other, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(this._ApplicationStatus), HELPER_ApplicationStatus.toObject(otherSentEmail._ApplicationStatus));
}
if (!HELPER_MessageContent.compare(this._MessageContent, otherSentEmail._MessageContent))
{
listener.notifyFieldChange(this, other, FIELD_MessageContent, HELPER_MessageContent.toObject(this._MessageContent), HELPER_MessageContent.toObject(otherSentEmail._MessageContent));
}
if (!HELPER_EmailTo.compare(this._EmailTo, otherSentEmail._EmailTo))
{
listener.notifyFieldChange(this, other, FIELD_EmailTo, HELPER_EmailTo.toObject(this._EmailTo), HELPER_EmailTo.toObject(otherSentEmail._EmailTo));
}
// Compare single assocs
_JobApplication.compare (otherSentEmail._JobApplication, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Subject, HELPER_Subject.toObject(getSubject()));
visitor.visitField(this, FIELD_SentDate, HELPER_SentDate.toObject(getSentDate()));
visitor.visitField(this, FIELD_ApplicationStatus, HELPER_ApplicationStatus.toObject(getApplicationStatus()));
visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent()));
visitor.visitField(this, FIELD_EmailTo, HELPER_EmailTo.toObject(getEmailTo()));
visitor.visitAssociation (_JobApplication);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_JobApplication))
{
visitor.visit (_JobApplication);
}
}
public static SentEmail createSentEmail (ObjectTransaction transaction) throws StorageException
{
SentEmail result = new SentEmail ();
result.initialiseNewObject (transaction);
return result;
}
public static SentEmail getSentEmailByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (SentEmail)(transaction.getObjectByID (REFERENCE_SentEmail, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return filter.matches (getSubject ());
}
else if (attribName.equals (FIELD_SentDate))
{
return filter.matches (getSentDate ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return filter.matches (getApplicationStatus ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return filter.matches (getMessageContent ());
}
else if (attribName.equals (FIELD_EmailTo))
{
return filter.matches (getEmailTo ());
}
else if (attribName.equals (SINGLEREFERENCE_JobApplication))
{
return filter.matches (getJobApplication ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<SentEmail>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_sent_email.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_sent_email.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_sent_email.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andSubject (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_sent_email.subject", "Subject");
return this;
}
public SearchAll andSentDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_sent_email.sent_date", "SentDate");
return this;
}
public SearchAll andApplicationStatus (QueryFilter<ApplicationStatus> filter)
{
filter.addFilter (context, "tl_sent_email.application_status", "ApplicationStatus");
return this;
}
public SearchAll andMessageContent (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_sent_email.message_content", "MessageContent");
return this;
}
public SearchAll andEmailTo (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_sent_email.email_to", "EmailTo");
return this;
}
public SearchAll andJobApplication (QueryFilter<JobApplication> filter)
{
filter.addFilter (context, "tl_sent_email.job_application_id", "JobApplication");
return this;
}
public SentEmail[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_SentEmail, SEARCH_All, criteria);
Set<SentEmail> typedResults = new LinkedHashSet <SentEmail> ();
for (BaseBusinessClass bbcResult : results)
{
SentEmail aResult = (SentEmail)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new SentEmail[0]);
}
}
public static SentEmail[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject.toObject (getSubject ());
}
else if (attribName.equals (FIELD_SentDate))
{
return HELPER_SentDate.toObject (getSentDate ());
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus.toObject (getApplicationStatus ());
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent.toObject (getMessageContent ());
}
else if (attribName.equals (FIELD_EmailTo))
{
return HELPER_EmailTo.toObject (getEmailTo ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
return HELPER_Subject;
}
else if (attribName.equals (FIELD_SentDate))
{
return HELPER_SentDate;
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
return HELPER_ApplicationStatus;
}
else if (attribName.equals (FIELD_MessageContent))
{
return HELPER_MessageContent;
}
else if (attribName.equals (FIELD_EmailTo))
{
return HELPER_EmailTo;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Subject))
{
setSubject ((String)(HELPER_Subject.fromObject (_Subject, attribValue)));
}
else if (attribName.equals (FIELD_SentDate))
{
setSentDate ((Date)(HELPER_SentDate.fromObject (_SentDate, attribValue)));
}
else if (attribName.equals (FIELD_ApplicationStatus))
{
setApplicationStatus ((ApplicationStatus)(HELPER_ApplicationStatus.fromObject (_ApplicationStatus, attribValue)));
}
else if (attribName.equals (FIELD_MessageContent))
{
setMessageContent ((String)(HELPER_MessageContent.fromObject (_MessageContent, attribValue)));
}
else if (attribName.equals (FIELD_EmailTo))
{
setEmailTo ((String)(HELPER_EmailTo.fromObject (_EmailTo, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_Subject))
{
return getWriteability_Subject ();
}
else if (fieldName.equals (FIELD_SentDate))
{
return getWriteability_SentDate ();
}
else if (fieldName.equals (FIELD_ApplicationStatus))
{
return getWriteability_ApplicationStatus ();
}
else if (fieldName.equals (FIELD_MessageContent))
{
return getWriteability_MessageContent ();
}
else if (fieldName.equals (FIELD_EmailTo))
{
return getWriteability_EmailTo ();
}
else if (fieldName.equals (SINGLEREFERENCE_JobApplication))
{
return getWriteability_JobApplication ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_Subject () != FieldWriteability.TRUE)
{
fields.add (FIELD_Subject);
}
if (getWriteability_SentDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_SentDate);
}
if (getWriteability_ApplicationStatus () != FieldWriteability.TRUE)
{
fields.add (FIELD_ApplicationStatus);
}
if (getWriteability_MessageContent () != FieldWriteability.TRUE)
{
fields.add (FIELD_MessageContent);
}
if (getWriteability_EmailTo () != FieldWriteability.TRUE)
{
fields.add (FIELD_EmailTo);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_Subject.getAttribObject (getClass (), _Subject, true, FIELD_Subject));
result.add(HELPER_SentDate.getAttribObject (getClass (), _SentDate, true, FIELD_SentDate));
result.add(HELPER_ApplicationStatus.getAttribObject (getClass (), _ApplicationStatus, true, FIELD_ApplicationStatus));
result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent));
result.add(HELPER_EmailTo.getAttribObject (getClass (), _EmailTo, true, FIELD_EmailTo));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_SentEmail.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_SentEmail.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_SentEmail.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_SentEmail.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class SentEmailBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<SentEmail>
{
/**
* Get the attribute Subject
*/
public String getSubject (SentEmail obj, String original)
{
return original;
}
/**
* Change the value set for attribute Subject.
* May modify the field beforehand
* Occurs before validation.
*/
public String setSubject (SentEmail obj, String newSubject) throws FieldException
{
return newSubject;
}
/**
* Get the attribute SentDate
*/
public Date getSentDate (SentEmail obj, Date original)
{
return original;
}
/**
* Change the value set for attribute SentDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setSentDate (SentEmail obj, Date newSentDate) throws FieldException
{
return newSentDate;
}
/**
* Get the attribute ApplicationStatus
*/
public ApplicationStatus getApplicationStatus (SentEmail obj, ApplicationStatus original)
{
return original;
}
/**
* Change the value set for attribute ApplicationStatus.
* May modify the field beforehand
* Occurs before validation.
*/
public ApplicationStatus setApplicationStatus (SentEmail obj, ApplicationStatus newApplicationStatus) throws FieldException
{
return newApplicationStatus;
}
/**
* Get the attribute MessageContent
*/
public String getMessageContent (SentEmail obj, String original)
{
return original;
}
/**
* Change the value set for attribute MessageContent.
* May modify the field beforehand
* Occurs before validation.
*/
public String setMessageContent (SentEmail obj, String newMessageContent) throws FieldException
{
return newMessageContent;
}
/**
* Get the attribute EmailTo
*/
public String getEmailTo (SentEmail obj, String original)
{
return original;
}
/**
* Change the value set for attribute EmailTo.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmailTo (SentEmail obj, String newEmailTo) throws FieldException
{
return newEmailTo;
}
}
public ORMPipeLine pipes()
{
return new SentEmailPipeLineFactory<SentEmail, SentEmail> ((SentEmail)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public SentEmailPipeLineFactory<SentEmail, SentEmail> pipelineSentEmail()
{
return (SentEmailPipeLineFactory<SentEmail, SentEmail>) pipes();
}
public static SentEmailPipeLineFactory<SentEmail, SentEmail> pipesSentEmail(Collection<SentEmail> items)
{
return REFERENCE_SentEmail.new SentEmailPipeLineFactory<SentEmail, SentEmail> (items);
}
public static SentEmailPipeLineFactory<SentEmail, SentEmail> pipesSentEmail(SentEmail[] _items)
{
return pipesSentEmail(Arrays.asList (_items));
}
public static SentEmailPipeLineFactory<SentEmail, SentEmail> pipesSentEmail()
{
return pipesSentEmail((Collection)null);
}
public class SentEmailPipeLineFactory<From extends BaseBusinessClass, Me extends SentEmail> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> SentEmailPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public SentEmailPipeLineFactory (From seed)
{
super(seed);
}
public SentEmailPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Subject"))
{
return toSubject ();
}
if (name.equals ("SentDate"))
{
return toSentDate ();
}
if (name.equals ("ApplicationStatus"))
{
return toApplicationStatus ();
}
if (name.equals ("MessageContent"))
{
return toMessageContent ();
}
if (name.equals ("EmailTo"))
{
return toEmailTo ();
}
if (name.equals ("JobApplication"))
{
return toJobApplication ();
}
return super.to(name);
}
public PipeLine<From, String> toSubject () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Subject)); }
public PipeLine<From, Date> toSentDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_SentDate)); }
public PipeLine<From, ApplicationStatus> toApplicationStatus () { return pipe(new ORMAttributePipe<Me, ApplicationStatus>(FIELD_ApplicationStatus)); }
public PipeLine<From, String> toMessageContent () { return pipe(new ORMAttributePipe<Me, String>(FIELD_MessageContent)); }
public PipeLine<From, String> toEmailTo () { return pipe(new ORMAttributePipe<Me, String>(FIELD_EmailTo)); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplication () { return toJobApplication (Filter.ALL); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplication (Filter<JobApplication> filter)
{
return JobApplication.REFERENCE_JobApplication.new JobApplicationPipeLineFactory<From, JobApplication> (this, new ORMSingleAssocPipe<Me, JobApplication>(SINGLEREFERENCE_JobApplication, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummySentEmail extends SentEmail
{
// Default constructor primarily to support Externalisable
public DummySentEmail()
{
super();
}
public void assertValid ()
{
}
public JobApplication getJobApplication () throws StorageException
{
return (JobApplication)(JobApplication.DUMMY_JobApplication);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobApplicationID ()
{
return JobApplication.DUMMY_JobApplication.getObjectID();
}
}
...@@ -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
...@@ -32,6 +36,16 @@ public class Candidate extends BaseCandidate ...@@ -32,6 +36,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}" />
......
...@@ -33,7 +33,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -33,7 +33,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
private Date dummyVerificationMailSendDate; private Date dummyVerificationMailSendDate;
private String dummyVerificationKey; private String dummyVerificationKey;
private Boolean dummyIsAccountVerified; private Boolean dummyIsAccountVerified;
private Boolean dummyIsPasswordChanged;
private String dummyGoogleAddressText; private String dummyGoogleAddressText;
private Boolean dummyIsEmailIngest;
private Boolean dummyIsMaskedEmail;
private String dummyKnownAsAlias;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -43,7 +47,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -43,7 +47,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsPasswordChanged = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsEmailIngest = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsMaskedEmail = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_KnownAsAlias = DefaultAttributeHelper.INSTANCE;
...@@ -56,11 +64,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -56,11 +64,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate)); dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate));
dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey)); dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey));
dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified)); dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified));
dummyIsPasswordChanged = (Boolean)(HELPER_IsPasswordChanged.initialise (dummyIsPasswordChanged));
dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText)); dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText));
dummyIsEmailIngest = (Boolean)(HELPER_IsEmailIngest.initialise (dummyIsEmailIngest));
dummyIsMaskedEmail = (Boolean)(HELPER_IsMaskedEmail.initialise (dummyIsMaskedEmail));
dummyKnownAsAlias = (String)(HELPER_KnownAsAlias.initialise (dummyKnownAsAlias));
} }
private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.google_address_text, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.is_password_changed, {PREFIX}oneit_sec_user_extension.google_address_text, {PREFIX}oneit_sec_user_extension.is_email_ingest, {PREFIX}oneit_sec_user_extension.is_masked_email, {PREFIX}oneit_sec_user_extension.known_as_alias, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -118,7 +130,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -118,7 +130,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationMailSendDate)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationKey)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationKey)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsAccountVerified)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsAccountVerified)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsPasswordChanged)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_GoogleAddressText)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_GoogleAddressText)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsEmailIngest)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsMaskedEmail)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_KnownAsAlias)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_TestInput)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_TestInput)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_User)) !oneit_sec_user_extensionPSet.containsAttrib(Candidate.SINGLEREFERENCE_User))
{ {
...@@ -219,10 +235,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -219,10 +235,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}oneit_sec_user_extension " + "UPDATE {PREFIX}oneit_sec_user_extension " +
"SET phone = ?, forgot_password_mail_send_date = ?, forgot_password_key = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, google_address_text = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET phone = ?, forgot_password_mail_send_date = ?, forgot_password_key = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, is_password_changed = ?, google_address_text = ?, is_email_ingest = ?, is_masked_email = ?, known_as_alias = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_IsPasswordChanged.getForSQL(dummyIsPasswordChanged, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsPasswordChanged))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsEmailIngest))).listEntry (HELPER_IsMaskedEmail.getForSQL(dummyIsMaskedEmail, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsMaskedEmail))).listEntry (HELPER_KnownAsAlias.getForSQL(dummyKnownAsAlias, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_KnownAsAlias))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -310,6 +326,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -310,6 +326,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{ {
throw new RuntimeException ("NOT implemented: executeSearchQueryAll"); throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
} }
public ResultSet executeSearchQueryAlias (SQLManager sqlMgr, String KnownAs) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAlias");
}
public ResultSet executeSearchQueryIdPin (SQLManager sqlMgr, Long ID, String Pin) throws SQLException public ResultSet executeSearchQueryIdPin (SQLManager sqlMgr, Long ID, String Pin) throws SQLException
{ {
throw new RuntimeException ("NOT implemented: executeSearchQueryIdPin"); throw new RuntimeException ("NOT implemented: executeSearchQueryIdPin");
...@@ -494,6 +514,37 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -494,6 +514,37 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
return results; return results;
} }
else if (searchType.equals (Candidate.SEARCH_Alias))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter:
filter = "known_as_alias = ?"
+ " ";
searchParams = new Object[] { criteria.get ("KnownAs") };
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (Candidate.SEARCH_IdPin)) else if (searchType.equals (Candidate.SEARCH_IdPin))
{ {
// Local scope for transformed variables // Local scope for transformed variables
...@@ -591,7 +642,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -591,7 +642,11 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsPasswordChanged, HELPER_IsPasswordChanged.getFromRS(dummyIsPasswordChanged, r, "is_password_changed"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsEmailIngest, HELPER_IsEmailIngest.getFromRS(dummyIsEmailIngest, r, "is_email_ingest"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsMaskedEmail, HELPER_IsMaskedEmail.getFromRS(dummyIsMaskedEmail, r, "is_masked_email"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_KnownAsAlias, HELPER_KnownAsAlias.getFromRS(dummyKnownAsAlias, r, "known_as_alias"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_TestInput, r.getObject ("test_input_id")); oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_TestInput, r.getObject ("test_input_id"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_User, r.getObject ("user_id")); oneit_sec_user_extensionPSet.setAttrib(Candidate.SINGLEREFERENCE_User, r.getObject ("user_id"));
...@@ -611,10 +666,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -611,10 +666,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}oneit_sec_user_extension " + "INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (phone, forgot_password_mail_send_date, forgot_password_key, verification_mail_send_date, verification_key, is_account_verified, google_address_text, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " + " (phone, forgot_password_mail_send_date, forgot_password_key, verification_mail_send_date, verification_key, is_account_verified, is_password_changed, google_address_text, is_email_ingest, is_masked_email, known_as_alias, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray()); CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (HELPER_IsPasswordChanged.getForSQL(dummyIsPasswordChanged, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsPasswordChanged))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_GoogleAddressText))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsEmailIngest))).listEntry (HELPER_IsMaskedEmail.getForSQL(dummyIsMaskedEmail, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsMaskedEmail))).listEntry (HELPER_KnownAsAlias.getForSQL(dummyKnownAsAlias, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_KnownAsAlias))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED); oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
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 java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class EmailMessagePersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea EmailMessagePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "EmailMessage");
// Private attributes corresponding to business object data
private String dummyMessageId;
private String dummyEmailFrom;
private String dummyEmailTo;
private String dummyEmailCC;
private String dummySubject;
private String dummyDescription;
private Date dummyReceivedDate;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_MessageId = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_EmailFrom = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_EmailTo = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_EmailCC = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ReceivedDate = DefaultAttributeHelper.INSTANCE;
public EmailMessagePersistenceMgr ()
{
dummyMessageId = (String)(HELPER_MessageId.initialise (dummyMessageId));
dummyEmailFrom = (String)(HELPER_EmailFrom.initialise (dummyEmailFrom));
dummyEmailTo = (String)(HELPER_EmailTo.initialise (dummyEmailTo));
dummyEmailCC = (String)(HELPER_EmailCC.initialise (dummyEmailCC));
dummySubject = (String)(HELPER_Subject.initialise (dummySubject));
dummyDescription = (String)(HELPER_Description.initialise (dummyDescription));
dummyReceivedDate = (Date)(HELPER_ReceivedDate.initialise (dummyReceivedDate));
}
private String SELECT_COLUMNS = "{PREFIX}tl_email_message.object_id as id, {PREFIX}tl_email_message.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_email_message.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_email_message.message_id, {PREFIX}tl_email_message.email_from, {PREFIX}tl_email_message.email_to, {PREFIX}tl_email_message.email_cc, {PREFIX}tl_email_message.subject, {PREFIX}tl_email_message.description, {PREFIX}tl_email_message.received_date, {PREFIX}tl_email_message.job_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, EmailMessage.REFERENCE_EmailMessage);
if (objectToReturn instanceof EmailMessage)
{
LogMgr.log (EmailMessagePersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a EmailMessage");
}
}
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(id, "tl_email_message", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_email_messagePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_MessageId)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_EmailFrom)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_EmailTo)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_EmailCC)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_Subject)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_Description)||
!tl_email_messagePSet.containsAttrib(EmailMessage.FIELD_ReceivedDate)||
!tl_email_messagePSet.containsAttrib(EmailMessage.SINGLEREFERENCE_Job))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (EmailMessagePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
EmailMessage result = new EmailMessage ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_email_message " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_email_message.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(objectID, "tl_email_message");
if (tl_email_messagePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_email_messagePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_email_message " +
"SET message_id = ?, email_from = ?, email_to = ?, email_cc = ?, subject = ?, description = ?, received_date = ?, job_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_email_message.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_MessageId.getForSQL(dummyMessageId, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_MessageId))).listEntry (HELPER_EmailFrom.getForSQL(dummyEmailFrom, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailFrom))).listEntry (HELPER_EmailTo.getForSQL(dummyEmailTo, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailTo))).listEntry (HELPER_EmailCC.getForSQL(dummyEmailCC, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailCC))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_Subject))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_Description))).listEntry (HELPER_ReceivedDate.getForSQL(dummyReceivedDate, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_ReceivedDate))).listEntry (SQLManager.CheckNull((Long)(tl_email_messagePSet.getAttrib (EmailMessage.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_email_message WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_email_message", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (EmailMessagePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_email_message");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_email_message for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (EmailMessagePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_email_messagePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (EmailMessagePersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(objectID, "tl_email_message");
LogMgr.log (EmailMessagePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_email_messagePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_email_messagePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_email_message " +
"WHERE tl_email_message.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_email_message WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_email_message");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_email_message for row:" + objectID;
LogMgr.log (EmailMessagePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_email_messagePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, EmailMessage> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (EmailMessage.REFERENCE_EmailMessage.getObjectIDSpace (), r.getLong ("id"));
EmailMessage resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, EmailMessage.REFERENCE_EmailMessage);
if (cachedElement instanceof EmailMessage)
{
LogMgr.log (EmailMessagePersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (EmailMessage)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a EmailMessage");
}
}
else
{
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(objectID, "tl_email_message", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new EmailMessage ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (EmailMessagePersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_email_message " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (EmailMessage.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_email_message.object_id is not null
String preFilter = "(tl_email_message.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_email_message " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(objectID, "tl_email_message", PersistentSetStatus.FETCHED);
// Object Modified
tl_email_messagePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_email_messagePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_MessageId, HELPER_MessageId.getFromRS(dummyMessageId, r, "message_id"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_EmailFrom, HELPER_EmailFrom.getFromRS(dummyEmailFrom, r, "email_from"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_EmailTo, HELPER_EmailTo.getFromRS(dummyEmailTo, r, "email_to"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_EmailCC, HELPER_EmailCC.getFromRS(dummyEmailCC, r, "email_cc"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_Subject, HELPER_Subject.getFromRS(dummySubject, r, "subject"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_Description, HELPER_Description.getFromRS(dummyDescription, r, "description"));
tl_email_messagePSet.setAttrib(EmailMessage.FIELD_ReceivedDate, HELPER_ReceivedDate.getFromRS(dummyReceivedDate, r, "received_date"));
tl_email_messagePSet.setAttrib(EmailMessage.SINGLEREFERENCE_Job, r.getObject ("job_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_email_messagePSet = allPSets.getPersistentSet(objectID, "tl_email_message");
if (tl_email_messagePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_email_messagePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_email_message " +
" (message_id, email_from, email_to, email_cc, subject, description, received_date, job_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_MessageId.getForSQL(dummyMessageId, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_MessageId))).listEntry (HELPER_EmailFrom.getForSQL(dummyEmailFrom, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailFrom))).listEntry (HELPER_EmailTo.getForSQL(dummyEmailTo, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailTo))).listEntry (HELPER_EmailCC.getForSQL(dummyEmailCC, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_EmailCC))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_Subject))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_Description))).listEntry (HELPER_ReceivedDate.getForSQL(dummyReceivedDate, tl_email_messagePSet.getAttrib (EmailMessage.FIELD_ReceivedDate))) .listEntry (SQLManager.CheckNull((Long)(tl_email_messagePSet.getAttrib (EmailMessage.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
tl_email_messagePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
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
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class ILOJobTitlePersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea ILOJobTitlePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "ILOJobTitle");
// Private attributes corresponding to business object data
private String dummyJobTitle;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_JobTitle = DefaultAttributeHelper.INSTANCE;
public ILOJobTitlePersistenceMgr ()
{
dummyJobTitle = (String)(HELPER_JobTitle.initialise (dummyJobTitle));
}
private String SELECT_COLUMNS = "{PREFIX}tl_ilo_job_title.object_id as id, {PREFIX}tl_ilo_job_title.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_ilo_job_title.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_ilo_job_title.job_title, {PREFIX}tl_ilo_job_title.occupation_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, ILOJobTitle.REFERENCE_ILOJobTitle);
if (objectToReturn instanceof ILOJobTitle)
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a ILOJobTitle");
}
}
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(id, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_ilo_job_titlePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_ilo_job_titlePSet.containsAttrib(ILOJobTitle.FIELD_JobTitle)||
!tl_ilo_job_titlePSet.containsAttrib(ILOJobTitle.SINGLEREFERENCE_Occupation))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
ILOJobTitle result = new ILOJobTitle ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_ilo_job_title " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_ilo_job_title.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_ilo_job_title " +
"SET job_title = ?, occupation_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_ilo_job_title.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.FIELD_JobTitle))).listEntry (SQLManager.CheckNull((Long)(tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.SINGLEREFERENCE_Occupation)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_ilo_job_title WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_ilo_job_title", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (ILOJobTitlePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_ilo_job_title");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_ilo_job_title for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (ILOJobTitlePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_ilo_job_title " +
"WHERE tl_ilo_job_title.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_ilo_job_title WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_ilo_job_title");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_ilo_job_title for row:" + objectID;
LogMgr.log (ILOJobTitlePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, ILOJobTitle> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (ILOJobTitle.REFERENCE_ILOJobTitle.getObjectIDSpace (), r.getLong ("id"));
ILOJobTitle resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, ILOJobTitle.REFERENCE_ILOJobTitle);
if (cachedElement instanceof ILOJobTitle)
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (ILOJobTitle)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a ILOJobTitle");
}
}
else
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new ILOJobTitle ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (ILOJobTitlePersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_ilo_job_title " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (ILOJobTitle.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: object_id is not null
String preFilter = "(object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_ilo_job_title " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title", PersistentSetStatus.FETCHED);
// Object Modified
tl_ilo_job_titlePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_ilo_job_titlePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_ilo_job_titlePSet.setAttrib(ILOJobTitle.FIELD_JobTitle, HELPER_JobTitle.getFromRS(dummyJobTitle, r, "job_title"));
tl_ilo_job_titlePSet.setAttrib(ILOJobTitle.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_ilo_job_titlePSet = allPSets.getPersistentSet(objectID, "tl_ilo_job_title");
if (tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_ilo_job_titlePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_ilo_job_title " +
" (job_title, occupation_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.FIELD_JobTitle))) .listEntry (SQLManager.CheckNull((Long)(tl_ilo_job_titlePSet.getAttrib (ILOJobTitle.SINGLEREFERENCE_Occupation)))) .listEntry (objectID.longID ()).toList().toArray());
tl_ilo_job_titlePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -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,7 +32,58 @@ public class JobApplication extends BaseJobApplication ...@@ -31,7 +32,58 @@ 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
{ {
JobApplication jobApplication = createJobApplication(job.getTransaction()); JobApplication jobApplication = createJobApplication(job.getTransaction());
...@@ -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" />
......
...@@ -115,7 +115,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -115,7 +115,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
} }
private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.postcode, {PREFIX}tl_job.location_radius, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.require_cv, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.last_edited, {PREFIX}tl_job.is_ppj, {PREFIX}tl_job.industry, {PREFIX}tl_job.culture_statement, {PREFIX}tl_job.draft_location, {PREFIX}tl_job.google_address_text, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.job_owner_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.hiring_team_id, {PREFIX}tl_job.occupation_id, {PREFIX}tl_job.shortened_url_id, {PREFIX}tl_job.template_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.postcode, {PREFIX}tl_job.location_radius, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.require_cv, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.last_edited, {PREFIX}tl_job.is_ppj, {PREFIX}tl_job.industry, {PREFIX}tl_job.culture_statement, {PREFIX}tl_job.draft_location, {PREFIX}tl_job.google_address_text, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.job_owner_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.hiring_team_id, {PREFIX}tl_job.occupation_id, {PREFIX}tl_job.shortened_url_id, {PREFIX}tl_job.template_id, {PREFIX}tl_job.job_title_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -198,7 +198,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -198,7 +198,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_HiringTeam)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_HiringTeam)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Occupation)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Occupation)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ShortenedURL)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ShortenedURL)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_AssessmentTemplate)) !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_AssessmentTemplate)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ILOJobTitle))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -278,10 +279,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -278,10 +279,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job " + "UPDATE {PREFIX}tl_job " +
"SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, postcode = ?, location_radius = ?, state = ?, country = ?, require_cv = ?, manually_closed = ?, last_edited = ?, is_ppj = ?, industry = ?, culture_statement = ?, draft_location = ?, google_address_text = ?, level_id = ? , client_id = ? , job_owner_id = ? , company_user_id = ? , hiring_team_id = ? , occupation_id = ? , shortened_url_id = ? , template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, postcode = ?, location_radius = ?, state = ?, country = ?, require_cv = ?, manually_closed = ?, last_edited = ?, is_ppj = ?, industry = ?, culture_statement = ?, draft_location = ?, google_address_text = ?, level_id = ? , client_id = ? , job_owner_id = ? , company_user_id = ? , hiring_team_id = ? , occupation_id = ? , shortened_url_id = ? , template_id = ? , job_title_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_job.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ILOJobTitle)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -735,6 +736,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -735,6 +736,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Occupation, r.getObject ("occupation_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ShortenedURL, r.getObject ("shortened_url_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ShortenedURL, r.getObject ("shortened_url_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_AssessmentTemplate, r.getObject ("template_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_AssessmentTemplate, r.getObject ("template_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ILOJobTitle, r.getObject ("job_title_id"));
} }
...@@ -751,10 +753,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -751,10 +753,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job " + "INSERT INTO {PREFIX}tl_job " +
" (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, postcode, location_radius, state, country, require_cv, manually_closed, last_edited, is_ppj, industry, culture_statement, draft_location, google_address_text, level_id, client_id, job_owner_id, company_user_id, hiring_team_id, occupation_id, shortened_url_id, template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, postcode, location_radius, state, country, require_cv, manually_closed, last_edited, is_ppj, industry, culture_statement, draft_location, google_address_text, level_id, client_id, job_owner_id, company_user_id, hiring_team_id, occupation_id, shortened_url_id, template_id, job_title_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_jobPSet.getAttrib (Job.FIELD_PostCode))).listEntry (HELPER_ExpectedCandidateRadius.getForSQL(dummyExpectedCandidateRadius, tl_jobPSet.getAttrib (Job.FIELD_ExpectedCandidateRadius))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_RequireCV.getForSQL(dummyRequireCV, tl_jobPSet.getAttrib (Job.FIELD_RequireCV))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_jobPSet.getAttrib (Job.FIELD_Industry))).listEntry (HELPER_CultureStatement.getForSQL(dummyCultureStatement, tl_jobPSet.getAttrib (Job.FIELD_CultureStatement))).listEntry (HELPER_DraftLocation.getForSQL(dummyDraftLocation, tl_jobPSet.getAttrib (Job.FIELD_DraftLocation))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_jobPSet.getAttrib (Job.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_JobOwner)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CreatedBy)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_HiringTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Occupation)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_AssessmentTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ILOJobTitle)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED); tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
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;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
import performa.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea MessageTemplatePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "MessageTemplate");
// Private attributes corresponding to business object data
private String dummyTemplateName;
private String dummySubject;
private ApplicationStatus dummyApplicationStatus;
private Integer dummyDelayHrs;
private Integer dummyDelayMin;
private Integer dummyVariance;
private Boolean dummyBusinessHoursOnly;
private String dummyMessageContent;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_TemplateName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicationStatus = new EnumeratedAttributeHelper (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper HELPER_DelayHrs = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_DelayMin = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Variance = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
public MessageTemplatePersistenceMgr ()
{
dummyTemplateName = (String)(HELPER_TemplateName.initialise (dummyTemplateName));
dummySubject = (String)(HELPER_Subject.initialise (dummySubject));
dummyApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (dummyApplicationStatus));
dummyDelayHrs = (Integer)(HELPER_DelayHrs.initialise (dummyDelayHrs));
dummyDelayMin = (Integer)(HELPER_DelayMin.initialise (dummyDelayMin));
dummyVariance = (Integer)(HELPER_Variance.initialise (dummyVariance));
dummyBusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.initialise (dummyBusinessHoursOnly));
dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent));
}
private String SELECT_COLUMNS = "{PREFIX}tl_message_template.object_id as id, {PREFIX}tl_message_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_message_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_message_template.template_name, {PREFIX}tl_message_template.subject, {PREFIX}tl_message_template.application_status, {PREFIX}tl_message_template.delay_hrs, {PREFIX}tl_message_template.delay_min, {PREFIX}tl_message_template.variance, {PREFIX}tl_message_template.business_hours_only, {PREFIX}tl_message_template.message_content, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, MessageTemplate.REFERENCE_MessageTemplate);
if (objectToReturn instanceof MessageTemplate)
{
LogMgr.log (MessageTemplatePersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a MessageTemplate");
}
}
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(id, "tl_message_template", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_message_templatePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_TemplateName)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_Subject)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_ApplicationStatus)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_DelayHrs)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_DelayMin)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_Variance)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_BusinessHoursOnly)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_MessageContent))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (MessageTemplatePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
MessageTemplate result = new MessageTemplate ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_message_template " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_message_template.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(objectID, "tl_message_template");
if (tl_message_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_message_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_message_template " +
"SET template_name = ?, subject = ?, application_status = ?, delay_hrs = ?, delay_min = ?, variance = ?, business_hours_only = ?, message_content = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_message_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_message_template WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_message_template", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (MessageTemplatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_message_template");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_message_template for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (MessageTemplatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (MessageTemplatePersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(objectID, "tl_message_template");
LogMgr.log (MessageTemplatePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_message_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_message_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_message_template " +
"WHERE tl_message_template.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_message_template WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_message_template");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_message_template for row:" + objectID;
LogMgr.log (MessageTemplatePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, MessageTemplate> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (MessageTemplate.REFERENCE_MessageTemplate.getObjectIDSpace (), r.getLong ("id"));
MessageTemplate resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, MessageTemplate.REFERENCE_MessageTemplate);
if (cachedElement instanceof MessageTemplate)
{
LogMgr.log (MessageTemplatePersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (MessageTemplate)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a MessageTemplate");
}
}
else
{
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(objectID, "tl_message_template", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new MessageTemplate ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (MessageTemplatePersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_message_template " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (MessageTemplate.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_message_template.object_id is not null
String preFilter = "(tl_message_template.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_message_template " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(objectID, "tl_message_template", PersistentSetStatus.FETCHED);
// Object Modified
tl_message_templatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_message_templatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_TemplateName, HELPER_TemplateName.getFromRS(dummyTemplateName, r, "template_name"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_Subject, HELPER_Subject.getFromRS(dummySubject, r, "subject"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_DelayHrs, HELPER_DelayHrs.getFromRS(dummyDelayHrs, r, "delay_hrs"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_DelayMin, HELPER_DelayMin.getFromRS(dummyDelayMin, r, "delay_min"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_Variance, HELPER_Variance.getFromRS(dummyVariance, r, "variance"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.getFromRS(dummyBusinessHoursOnly, r, "business_hours_only"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_MessageContent, HELPER_MessageContent.getFromRS(dummyMessageContent, r, "message_content"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_message_templatePSet = allPSets.getPersistentSet(objectID, "tl_message_template");
if (tl_message_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_message_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_message_template " +
" (template_name, subject, application_status, delay_hrs, delay_min, variance, business_hours_only, message_content, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))) .listEntry (objectID.longID ()).toList().toArray());
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
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;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class ScheduledEmailPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea ScheduledEmailPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "ScheduledEmail");
// Private attributes corresponding to business object data
private String dummySubject;
private Date dummyScheduledDate;
private ApplicationStatus dummyApplicationStatus;
private String dummyMessageContent;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ScheduledDate = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicationStatus = new EnumeratedAttributeHelper (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
public ScheduledEmailPersistenceMgr ()
{
dummySubject = (String)(HELPER_Subject.initialise (dummySubject));
dummyScheduledDate = (Date)(HELPER_ScheduledDate.initialise (dummyScheduledDate));
dummyApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (dummyApplicationStatus));
dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent));
}
private String SELECT_COLUMNS = "{PREFIX}tl_scheduled_email.object_id as id, {PREFIX}tl_scheduled_email.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_scheduled_email.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_scheduled_email.subject, {PREFIX}tl_scheduled_email.scheduled_date, {PREFIX}tl_scheduled_email.application_status, {PREFIX}tl_scheduled_email.message_content, {PREFIX}tl_scheduled_email.job_application_id, {PREFIX}tl_scheduled_email.message_template_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, ScheduledEmail.REFERENCE_ScheduledEmail);
if (objectToReturn instanceof ScheduledEmail)
{
LogMgr.log (ScheduledEmailPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a ScheduledEmail");
}
}
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(id, "tl_scheduled_email", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_scheduled_emailPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.FIELD_Subject)||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.FIELD_ScheduledDate)||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.FIELD_ApplicationStatus)||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.FIELD_MessageContent)||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.SINGLEREFERENCE_JobApplication)||
!tl_scheduled_emailPSet.containsAttrib(ScheduledEmail.SINGLEREFERENCE_MessageTemplate))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (ScheduledEmailPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
ScheduledEmail result = new ScheduledEmail ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_scheduled_email " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_scheduled_email.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else if (refName.equals (ScheduledEmail.SINGLEREFERENCE_JobApplication))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_scheduled_email " +
"WHERE " + SELECT_JOINS + "job_application_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(objectID, "tl_scheduled_email");
if (tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_scheduled_email " +
"SET subject = ?, scheduled_date = ?, application_status = ?, message_content = ?, job_application_id = ? , message_template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_scheduled_email.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Subject.getForSQL(dummySubject, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_Subject))).listEntry (HELPER_ScheduledDate.getForSQL(dummyScheduledDate, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_ScheduledDate))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_ApplicationStatus))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_MessageContent))).listEntry (SQLManager.CheckNull((Long)(tl_scheduled_emailPSet.getAttrib (ScheduledEmail.SINGLEREFERENCE_JobApplication)))).listEntry (SQLManager.CheckNull((Long)(tl_scheduled_emailPSet.getAttrib (ScheduledEmail.SINGLEREFERENCE_MessageTemplate)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_scheduled_email WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_scheduled_email", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (ScheduledEmailPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_scheduled_email");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_scheduled_email for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (ScheduledEmailPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_scheduled_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (ScheduledEmailPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(objectID, "tl_scheduled_email");
LogMgr.log (ScheduledEmailPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_scheduled_email " +
"WHERE tl_scheduled_email.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_scheduled_email WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_scheduled_email");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_scheduled_email for row:" + objectID;
LogMgr.log (ScheduledEmailPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_scheduled_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, ScheduledEmail> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (ScheduledEmail.REFERENCE_ScheduledEmail.getObjectIDSpace (), r.getLong ("id"));
ScheduledEmail resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, ScheduledEmail.REFERENCE_ScheduledEmail);
if (cachedElement instanceof ScheduledEmail)
{
LogMgr.log (ScheduledEmailPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (ScheduledEmail)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a ScheduledEmail");
}
}
else
{
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(objectID, "tl_scheduled_email", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new ScheduledEmail ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (ScheduledEmailPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_scheduled_email " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (ScheduledEmail.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_scheduled_email.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_scheduled_email.object_id is not null
String preFilter = "(tl_scheduled_email.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_scheduled_email " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(objectID, "tl_scheduled_email", PersistentSetStatus.FETCHED);
// Object Modified
tl_scheduled_emailPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_scheduled_emailPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.FIELD_Subject, HELPER_Subject.getFromRS(dummySubject, r, "subject"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.FIELD_ScheduledDate, HELPER_ScheduledDate.getFromRS(dummyScheduledDate, r, "scheduled_date"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.FIELD_MessageContent, HELPER_MessageContent.getFromRS(dummyMessageContent, r, "message_content"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.SINGLEREFERENCE_JobApplication, r.getObject ("job_application_id"));
tl_scheduled_emailPSet.setAttrib(ScheduledEmail.SINGLEREFERENCE_MessageTemplate, r.getObject ("message_template_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_scheduled_emailPSet = allPSets.getPersistentSet(objectID, "tl_scheduled_email");
if (tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_scheduled_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_scheduled_email " +
" (subject, scheduled_date, application_status, message_content, job_application_id, message_template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Subject.getForSQL(dummySubject, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_Subject))).listEntry (HELPER_ScheduledDate.getForSQL(dummyScheduledDate, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_ScheduledDate))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_ApplicationStatus))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_scheduled_emailPSet.getAttrib (ScheduledEmail.FIELD_MessageContent))) .listEntry (SQLManager.CheckNull((Long)(tl_scheduled_emailPSet.getAttrib (ScheduledEmail.SINGLEREFERENCE_JobApplication)))).listEntry (SQLManager.CheckNull((Long)(tl_scheduled_emailPSet.getAttrib (ScheduledEmail.SINGLEREFERENCE_MessageTemplate)))) .listEntry (objectID.longID ()).toList().toArray());
tl_scheduled_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
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
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class SentEmailPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea SentEmailPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "SentEmail");
// Private attributes corresponding to business object data
private String dummySubject;
private Date dummySentDate;
private ApplicationStatus dummyApplicationStatus;
private String dummyMessageContent;
private String dummyEmailTo;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Subject = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_SentDate = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicationStatus = new EnumeratedAttributeHelper (ApplicationStatus.FACTORY_ApplicationStatus);
private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_EmailTo = DefaultAttributeHelper.INSTANCE;
public SentEmailPersistenceMgr ()
{
dummySubject = (String)(HELPER_Subject.initialise (dummySubject));
dummySentDate = (Date)(HELPER_SentDate.initialise (dummySentDate));
dummyApplicationStatus = (ApplicationStatus)(HELPER_ApplicationStatus.initialise (dummyApplicationStatus));
dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent));
dummyEmailTo = (String)(HELPER_EmailTo.initialise (dummyEmailTo));
}
private String SELECT_COLUMNS = "{PREFIX}tl_sent_email.object_id as id, {PREFIX}tl_sent_email.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_sent_email.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_sent_email.subject, {PREFIX}tl_sent_email.sent_date, {PREFIX}tl_sent_email.application_status, {PREFIX}tl_sent_email.message_content, {PREFIX}tl_sent_email.email_to, {PREFIX}tl_sent_email.job_application_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, SentEmail.REFERENCE_SentEmail);
if (objectToReturn instanceof SentEmail)
{
LogMgr.log (SentEmailPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a SentEmail");
}
}
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(id, "tl_sent_email", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_sent_emailPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_sent_emailPSet.containsAttrib(SentEmail.FIELD_Subject)||
!tl_sent_emailPSet.containsAttrib(SentEmail.FIELD_SentDate)||
!tl_sent_emailPSet.containsAttrib(SentEmail.FIELD_ApplicationStatus)||
!tl_sent_emailPSet.containsAttrib(SentEmail.FIELD_MessageContent)||
!tl_sent_emailPSet.containsAttrib(SentEmail.FIELD_EmailTo)||
!tl_sent_emailPSet.containsAttrib(SentEmail.SINGLEREFERENCE_JobApplication))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (SentEmailPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
SentEmail result = new SentEmail ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_sent_email " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_sent_email.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else if (refName.equals (SentEmail.SINGLEREFERENCE_JobApplication))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_sent_email " +
"WHERE " + SELECT_JOINS + "job_application_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(objectID, "tl_sent_email");
if (tl_sent_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_sent_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_sent_email " +
"SET subject = ?, sent_date = ?, application_status = ?, message_content = ?, email_to = ?, job_application_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_sent_email.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Subject.getForSQL(dummySubject, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_Subject))).listEntry (HELPER_SentDate.getForSQL(dummySentDate, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_SentDate))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_ApplicationStatus))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_MessageContent))).listEntry (HELPER_EmailTo.getForSQL(dummyEmailTo, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_EmailTo))).listEntry (SQLManager.CheckNull((Long)(tl_sent_emailPSet.getAttrib (SentEmail.SINGLEREFERENCE_JobApplication)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_sent_email WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_sent_email", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (SentEmailPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_sent_email");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_sent_email for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (SentEmailPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_sent_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (SentEmailPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(objectID, "tl_sent_email");
LogMgr.log (SentEmailPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_sent_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_sent_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_sent_email " +
"WHERE tl_sent_email.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_sent_email WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_sent_email");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_sent_email for row:" + objectID;
LogMgr.log (SentEmailPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_sent_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, SentEmail> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (SentEmail.REFERENCE_SentEmail.getObjectIDSpace (), r.getLong ("id"));
SentEmail resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, SentEmail.REFERENCE_SentEmail);
if (cachedElement instanceof SentEmail)
{
LogMgr.log (SentEmailPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (SentEmail)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a SentEmail");
}
}
else
{
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(objectID, "tl_sent_email", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new SentEmail ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (SentEmailPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_sent_email " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (SentEmail.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_scheduled_email.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_scheduled_email.object_id is not null
String preFilter = "(tl_scheduled_email.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_sent_email " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(objectID, "tl_sent_email", PersistentSetStatus.FETCHED);
// Object Modified
tl_sent_emailPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_sent_emailPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_sent_emailPSet.setAttrib(SentEmail.FIELD_Subject, HELPER_Subject.getFromRS(dummySubject, r, "subject"));
tl_sent_emailPSet.setAttrib(SentEmail.FIELD_SentDate, HELPER_SentDate.getFromRS(dummySentDate, r, "sent_date"));
tl_sent_emailPSet.setAttrib(SentEmail.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
tl_sent_emailPSet.setAttrib(SentEmail.FIELD_MessageContent, HELPER_MessageContent.getFromRS(dummyMessageContent, r, "message_content"));
tl_sent_emailPSet.setAttrib(SentEmail.FIELD_EmailTo, HELPER_EmailTo.getFromRS(dummyEmailTo, r, "email_to"));
tl_sent_emailPSet.setAttrib(SentEmail.SINGLEREFERENCE_JobApplication, r.getObject ("job_application_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_sent_emailPSet = allPSets.getPersistentSet(objectID, "tl_sent_email");
if (tl_sent_emailPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_sent_emailPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_sent_email " +
" (subject, sent_date, application_status, message_content, email_to, job_application_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Subject.getForSQL(dummySubject, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_Subject))).listEntry (HELPER_SentDate.getForSQL(dummySentDate, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_SentDate))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_ApplicationStatus))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_MessageContent))).listEntry (HELPER_EmailTo.getForSQL(dummyEmailTo, tl_sent_emailPSet.getAttrib (SentEmail.FIELD_EmailTo))) .listEntry (SQLManager.CheckNull((Long)(tl_sent_emailPSet.getAttrib (SentEmail.SINGLEREFERENCE_JobApplication)))) .listEntry (objectID.longID ()).toList().toArray());
tl_sent_emailPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -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
package performa.utils;
import java.io.*;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.search.*;
import oneit.appservices.config.ConfigMgr;
import oneit.components.*;
import oneit.email.EmailFetcher;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.services.*;
import oneit.security.SecUser;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import performa.orm.*;
import performa.orm.types.ApplicationStatus;
public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
{
private static final String SERVER_NAME = ConfigMgr.getKeyfileString("imap.server.name");
private static final String SERVER_PORT = ConfigMgr.getKeyfileString("imap.server.port");
private static final String SERVER_PROTOCOL = ConfigMgr.getKeyfileString("imap.server.protocol", "imaps");
private static final String ACC_USER_NAME = ConfigMgr.getKeyfileString("imap.email.acc.username");
private static final String ACC_PASSWORD = ConfigMgr.getKeyfileString("imap.email.acc.password");
private static final boolean SYNC_ALL_EXISTING_EMAILS = ConfigMgr.getKeyfileBoolean("sync.all.existing.emails", true);
private static final Integer SYNC_EMAILS_SINCE_MINUTES = ConfigMgr.getKeyfileInt("sync.emails.since.minutes", 30*60); //Applicable only when SYNC_ALL_EXISTING_EMAILS is false.
public static final LoggingArea LOG = LoggingArea.createLoggingArea("PerformaEmailFetcher");
@Override
public void run()
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside Run of PerformaEmailFetcher");
List<String> visitedNodes = new ArrayList<>();
runEmailFetcher(visitedNodes);
}
public static void runEmailFetcher(List<String> visitedNodes)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Executing email fetcher Name:", SERVER_NAME, " Port:"+ SERVER_PORT, " Protocol:"+ SERVER_PROTOCOL, " UserName:", ACC_USER_NAME);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Email syncing details:: Sync All:", SYNC_ALL_EXISTING_EMAILS, " Sync from last:"+ SYNC_EMAILS_SINCE_MINUTES);
if(StringUtils.subBlanks(SERVER_NAME) != null && StringUtils.subBlanks(SERVER_PORT) != null &&
StringUtils.subBlanks(ACC_USER_NAME) != null && StringUtils.subBlanks(ACC_PASSWORD) != null)
{
final Object[] dummyContainer = new Object[1];
Store store = null;
try
{
TransactionServices.run(new TransactionTask()
{
@Override
public void run(ObjectTransaction objTran) throws FieldException, StorageException
{
EmailMessage[] emailMessages = EmailMessage.searchAll(objTran);
dummyContainer[0] = EmailMessage.pipesEmailMessage(emailMessages).toMessageId().uniqueVals();
}
});
Set<String> messageIDs = new HashSet();
if(dummyContainer[0] != null)
{
messageIDs = (Set<String>)dummyContainer[0];
}
Session session = Session.getInstance(getEMailProperties());
store = session.getStore(SERVER_PROTOCOL);
store.connect(SERVER_NAME, ACC_USER_NAME, ACC_PASSWORD);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Mail connection done successfully");
Folder[] folders = store.getDefaultFolder().list("*");
for (Folder folder : folders)
{
if ((folder.getType() & Folder.HOLDS_MESSAGES) != 0)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Processing folder " + folder.getFullName());
visitedNodes.add(folder.getFullName());
processFolder(folder, messageIDs, visitedNodes);
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Skipping folder " + folder.getFullName());
}
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Email fetcher batch completed successfully.");
}
catch (Exception e)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, e, "Email Fetcher : error occurred");
}
finally
{
try
{
if (store != null)
{
store.close();
}
}
catch (Exception e2)
{
LogMgr.log(LOG, LogLevel.BUSINESS2, "Email Fetcher : Problem closing email store", e2);
}
}
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Email fetcher batch skipped as server propertied not defined.");
}
}
private static Properties getEMailProperties()
{
Properties properties = System.getProperties();
// Mail-server-properties will be configured based on given emailServerProtocol i.e. imap(s) or pop3(s)
properties.put("mail.store.protocol", SERVER_PROTOCOL);
properties.put("mail." + SERVER_PROTOCOL +".host", SERVER_NAME);
properties.put("mail." + SERVER_PROTOCOL +".port", SERVER_PORT);
properties.put("mail." + SERVER_PROTOCOL +".starttls.enable", "true");
return properties;
}
private static void processFolder(Folder folder, Set<String> messageIDs, List<String> visitedNodes) throws Exception
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "processFolder called for ", folder != null ? folder.getName() : "");
if(folder != null)
{
try
{
readMessagesInFolder(folder, messageIDs);
for(Folder subfolder : folder.list())
{
visitedNodes.add(subfolder.getFullName());
processFolder(subfolder, messageIDs, visitedNodes);
}
}
catch (Exception e)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, e, "Email Fetcher : error occurred");
throw e;
}
finally
{
try
{
folder.close(true);
}
catch (Exception ex2)
{
LogMgr.log(LOG, LogLevel.BUSINESS2, "Email Fetcher : Problem closing email store", ex2);
}
}
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "processFolder completed for ", folder != null ? folder.getName() : "");
}
private static void readMessagesInFolder(Folder folder, Set<String> messageIDs) throws MessagingException
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "readMessagesInFolder called for ", folder.getName());
UIDFolder uidFolder = (UIDFolder)folder;
try
{
folder.open(Folder.READ_ONLY);
}
catch(Exception ex)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Skipping messages for folder ", folder.getName(), " as unable to open same.");
return;
}
Message[] messages;
SearchTerm searchTerm = getSearchTerm();
if(searchTerm == null)
{
messages = folder.getMessages();
}
else
{
messages = folder.search(searchTerm);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Number of messages to be processed in ", folder.getName(), ": ", messages.length);
for(Message message : messages)
{
processMessage(message, uidFolder, messageIDs);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "readMessagesInFolder completed for ", folder.getName());
}
private static SearchTerm getSearchTerm ()
{
if(!SYNC_ALL_EXISTING_EMAILS)
{
SearchTerm receivedFrom = new ReceivedDateTerm(ComparisonTerm.GE, getSyncingFromDate());
SearchTerm sentFrom = new SentDateTerm(ComparisonTerm.GE, getSyncingFromDate());
return new AndTerm(receivedFrom, sentFrom);
}
return null;
}
public static void processMessage(Message message, UIDFolder uidFolder, final Set<String> messageIDs)
{
LogMgr.log(LOG, LogLevel.PROCESSING2 , "processMessage called");
String tmpFromAdress = null;
String tmpReplyTo = null;
String tmpFirstName = null;
String tmpLastName = null;
String tmpEmailText;
String tmpSubject;
Date tmpSentDate;
String tmpRecipient = null;
String tmpJobId = null;
String tmpMessageID = null;
List<FileBinaryContent> tmpContents;
final String fromAddress;
final String firstName;
final String lastName;
final String replyTo;
final String recipient;
final String subject;
final Date sentDate;
final String emailText;
final String jobIdentifier;
final String messageID;
final List<FileBinaryContent> contents;
try
{
if(message.getFrom() != null && message.getFrom().length > 0)
{
tmpFromAdress = ((InternetAddress) message.getFrom()[0]).getAddress();
}
tmpSubject = message.getSubject();
tmpSentDate = message.getReceivedDate();
tmpMessageID = ((MimeMessage)message).getMessageID();
if(message.getReplyTo() != null && message.getReplyTo().length > 0)
{
tmpReplyTo = ((InternetAddress) message.getReplyTo()[0]).getAddress();
String name = ((InternetAddress) message.getReplyTo()[0]).getPersonal();
tmpFirstName = getFirstName(name);
tmpLastName = getLastName(name);
}
LogMgr.log(LOG, LogLevel.PROCESSING2 , "Mail Subject:" + tmpSubject, " Address:", tmpFromAdress, " MessageId:", tmpMessageID);
LogMgr.log(LOG, LogLevel.PROCESSING2 , "Mail Details: Received ", message.getReceivedDate(), " Sent:", message.getSentDate());
if(message.getAllRecipients() != null && message.getAllRecipients().length > 0)
{
tmpRecipient = ((InternetAddress) message.getAllRecipients()[0]).getAddress();
}
if(StringUtils.subBlanks(tmpRecipient) != null)
{
tmpJobId = getJobIdentifierFromEmail(tmpRecipient);
}
tmpEmailText = EmailFetcher.getText(message, new ArrayList<>());
tmpContents = getAttachments(message);
}
catch (MessagingException | IOException ex)
{
LogMgr.log(LOG, LogLevel.PROCESSING2 , "Batch Email Fetcher : Mail message composing error", ex);
throw new NestedException(ex);
}
fromAddress = tmpFromAdress;
firstName = tmpFirstName;
lastName = tmpLastName;
replyTo = tmpReplyTo;
subject = tmpSubject;
sentDate = tmpSentDate;
jobIdentifier = tmpJobId;
recipient = tmpRecipient;
contents = tmpContents;
emailText = tmpEmailText;
messageID = tmpMessageID;
try
{
if(!messageIDs.contains(messageID))
{
TransactionServices.run(new TransactionTask()
{
@Override
public void run(ObjectTransaction objTran) throws FieldException, StorageException
{
if (jobIdentifier != null && !jobIdentifier.isEmpty() && StringUtils.isNumber(jobIdentifier))
{
Job job = Job.getJobByID(objTran, Long.parseLong(jobIdentifier));
if (job != null)
{
createEmailMessage(objTran, job);
if(fromAddress.contains("indeedemail.com"))
{
handleIndeedEmail(objTran, job);
}
else if(fromAddress.contains("seek.com.au"))
{
// handle seek email
if(replyTo == null || replyTo.isEmpty())
{
// might have to check email body if reply to is not set
return;
}
handleSeekEmail(objTran, job);
}
}
}
}
private void handleSeekEmail(ObjectTransaction objTran, Job job) throws StorageException, FieldException
{
SecUser secUser = SecUser.searchNAME(objTran, replyTo);
boolean newUser = false;
if(secUser == null)
{
newUser = true;
secUser = SecUser.createSecUser(objTran);
secUser.setUserName(replyTo);
secUser.setEmail(replyTo);
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
secUser.setFirstName(firstName);
secUser.setLastName(lastName);
}
Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
if(newUser)
{
candidate.setIsEmailIngest(true);
}
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
if(contents.size() > 0)
{
jobApplication.setCV(contents.get(0));
}
if(contents.size() > 1)
{
jobApplication.setCoverLetter(contents.get(1));
}
}
private void handleIndeedEmail(ObjectTransaction objTran, Job job) throws StorageException, FieldException
{
// handle indeed email
Candidate candidate = Candidate.searchAlias(objTran, fromAddress);
SecUser secUser = SecUser.searchNAME(objTran, fromAddress);
boolean newUser = false;
if(candidate != null)
{
secUser = candidate.getUser();
}
if(secUser == null)
{
secUser = SecUser.createSecUser(objTran);
newUser = true;
secUser.setUserName(fromAddress);
secUser.setEmail(fromAddress);
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
secUser.setFirstName(firstName);
secUser.setLastName(lastName);
}
if(candidate == null)
{
candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
}
if(newUser)
{
candidate.setIsEmailIngest(true);
candidate.setIsMaskedEmail(true);
}
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
if(contents.size() > 0)
{
jobApplication.setCV(contents.get(0));
}
}
private void createEmailMessage(ObjectTransaction objTran, Job job) throws StorageException, FieldException
{
EmailMessage emailMessage = EmailMessage.createEmailMessage(objTran);
emailMessage.setMessageId(messageID);
emailMessage.setEmailFrom(fromAddress);
emailMessage.setEmailTo(recipient);
emailMessage.setSubject(subject);
emailMessage.setDescription(emailText);
emailMessage.setReceivedDate(sentDate);
emailMessage.setJob(job);
for (FileBinaryContent content : contents)
{
Attachment attachment = Attachment.createAttachment(objTran);
attachment.setAttachmentFile(content);
emailMessage.addToAttachments(attachment);
}
}
});
LogMgr.log(LOG, LogLevel.PROCESSING2 , "processMessage completed successfully");
messageIDs.add(messageID);
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING2 , "Message already synced or doesnt have valid sent time ", sentDate);
}
}
catch (Exception e)
{
LogMgr.log(LOG, LogLevel.PROCESSING2 , e, "Batch Email Fetcher : Error in creating the email message ");
}
}
private static String getFirstName(String name)
{
return ((name.split("\\w+").length > 1) && (name.lastIndexOf(' ') > 0 )) ? name.substring(0, name.lastIndexOf(' ')) : name;
}
private static String getLastName(String name)
{
return ((name.split("\\w+").length > 1) && (name.lastIndexOf(' ') > 0 )) ? name.substring(name.lastIndexOf(" ")+1) : "";
}
public static String getJobIdentifierFromEmail(String strReceipient)
{
int index = strReceipient.indexOf('@');
return strReceipient.substring(0, index).replace("job", "");
}
private static List<FileBinaryContent> getAttachments(Message message) throws IOException, MessagingException
{
List<FileBinaryContent> contents = new ArrayList<>();
if(message.getContentType() != null && message.getContentType().contains("multipart"))
{
Multipart multipart = (Multipart)message.getContent();
byte[] bytes = null;
for (int j = 0; j < multipart.getCount(); j++)
{
BodyPart bodyPart = multipart.getBodyPart(j);
if(Part.ATTACHMENT.equalsIgnoreCase(bodyPart.getDisposition()) && bodyPart.getFileName() != null && !bodyPart.getFileName().isEmpty())
{
bytes = IOUtils.readInputStreamToBytes(bodyPart.getInputStream());
FileBinaryContent binaryContent = new FileBinaryContent(bodyPart.getContentType(), bytes, bodyPart.getFileName());
contents.add(binaryContent);
}
}
}
return contents;
}
private static Date getSyncingFromDate()
{
return DateDiff.before(new Date(), SYNC_EMAILS_SINCE_MINUTES, Calendar.MINUTE);
}
@Override
public void init (ParticipantInitialisationContext context) throws InitialisationException
{
}
public static final void main (String[] args) throws Exception
{
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imap");
props.setProperty("mail.imap.starttls.enable", "true");
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imap");
session.setDebug(true);
store.connect("imap.oneit.com.au", args[0], args[1]);
//store.connect("p3plcpnl0293.prod.phx3.secureserver.net", 143, args[0], "password123");
System.out.println(store);
Folder[] f = store.getDefaultFolder().list();
for(Folder fd:f)
{
System.out.println(">> "+fd.getName());
}
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (true)
{
String folderName = br.readLine();
folderName = folderName.trim();
Folder folder = store.getFolder(folderName);
for(Folder fd:folder.list())
{
System.out.println(">> "+fd.getName());
}
}
}
}
...@@ -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,9 +184,20 @@ ...@@ -184,9 +184,20 @@
</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>
</WHEN>
</TASK>
</NODE> </NODE>
<NODE name="CONFIG.Formatting::AdminPortal"> <NODE name="CONFIG.Formatting::AdminPortal">
<PARAM name="PerformaDateFormatter" factory="Participant" class="oneit.utils.text.DateFormatterFactory" <PARAM name="PerformaDateFormatter" factory="Participant" class="oneit.utils.text.DateFormatterFactory"
......
...@@ -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')">
......
...@@ -11,9 +11,33 @@ ...@@ -11,9 +11,33 @@
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
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,24 +123,34 @@ ...@@ -99,24 +123,34 @@
</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">
<oneit:button value="Cancel and go to your jobs" name="gotoPage" cssClass="btn btn-primary largeBtn grey" <oneit:button value="Cancel and go to your jobs" name="gotoPage" cssClass="btn btn-primary largeBtn grey"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
......
...@@ -12,6 +12,15 @@ ...@@ -12,6 +12,15 @@
String samePage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB_TEMP); String samePage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB_TEMP);
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);
...@@ -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 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>
<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">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
String applicantsPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS); String applicantsPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
List<JobApplication> applications = (List<JobApplication>) getData(request, "applications"); List<JobApplication> applications = (List<JobApplication>) getData(request, "applications");
int noOfIncomplete = job.getNoOfCandidatesFor(ApplicationStatus.DRAFT); int noOfIncomplete = job.getNoOfCandidatesFor(ApplicationStatus.DRAFT, ApplicationStatus.POST_INGEST);
int noOfUnsuitable = job.getNoOfCandidatesFor(ApplicationStatus.UNSUITABLE); int noOfUnsuitable = job.getNoOfCandidatesFor(ApplicationStatus.UNSUITABLE);
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
......
...@@ -26,6 +26,16 @@ ...@@ -26,6 +26,16 @@
$('.save-application' + id).click(); $('.save-application' + id).click();
}); });
}); });
function copyHTMLToClip(ele) {
var aux = document.createElement("textarea");
aux.value = $(ele).text().trim();
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
alert("link copied to clipboard");
};
</script> </script>
<div class="view-appli-list"> <div class="view-appli-list">
<% <%
...@@ -33,8 +43,9 @@ ...@@ -33,8 +43,9 @@
for(JobApplication jobApplication : applications) for(JobApplication jobApplication : applications)
{ {
double roleFitVal = jobApplication.getCandidate().roleFitCompletedPercentage(job); Candidate candidate = jobApplication.getCandidate();
double cultureVal = jobApplication.getCandidate().cultureCompletedPercentage(job); double roleFitVal = candidate.roleFitCompletedPercentage(job);
double cultureVal = candidate.cultureCompletedPercentage(job);
double criteriaVal = jobApplication.requirementCompletedPercentage(); double criteriaVal = jobApplication.requirementCompletedPercentage();
String roleFit = FormatUtils.stringify(roleFitVal, "PercentageWholeNumber", "0"); String roleFit = FormatUtils.stringify(roleFitVal, "PercentageWholeNumber", "0");
String culture = FormatUtils.stringify(cultureVal, "PercentageWholeNumber", "0"); String culture = FormatUtils.stringify(cultureVal, "PercentageWholeNumber", "0");
...@@ -57,41 +68,63 @@ ...@@ -57,41 +68,63 @@
<div class="appli-list-name appli-l eq-second-height wider-box"> <div class="appli-list-name appli-l eq-second-height wider-box">
<oneit:button value=" " name="gotoPage" cssClass="<%= jobApplication.getID() + ""%>" skin="link" <oneit:button value=" " name="gotoPage" cssClass="<%= jobApplication.getID() + ""%>" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).toMap())
.toMap() %>"> .toMap() %>">
<oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" /> <%
</oneit:button> if(jobApplication.isTrue(candidate.getIsEmailIngest()))
<div class="appli-int-status"> {
<span> %>
<a href="<%= "mailto:" + jobApplication.getCandidate().getUser().getEmail() %>">Email</a> <span style="padding-right: 5px;"><img src="images/email-ingest-icon.jpg"></span>
</span> <%
<oneit:toString value="<%= jobApplication.getCandidate().getPhone() %>" mode="EscapeHTML" /> }
<span><img src="images/clip_icon.png"></span>
<%
if(jobApplication.getCV() != null)
{
%>
<span>
<a target='blank' href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
CV
</a>
</span>
<%
}
if(jobApplication.getCoverLetter() != null) String jobLink = LoopbackHTTP.getRemoteAccessURL()
{ + Utils.APPLICANT_LINK
%> + "?id=" + job.getID()
<span> + "&key=" + job.getRandomKey()
<a target='blank' href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'> + "&aid=" + candidate.getID()
Cover Letter + "&pin=" + candidate.getVerificationKey();
</a> %>
</span> <oneit:toString value="<%= candidate %>" mode="EscapeHTML" />
<% <span style="float:right; padding-right: 5px;">
} <a style="float:right; padding-right: 10px;" onclick="copyHTMLToClip('.<%= jobApplication.getID().toString() + "link"%>')">
%> <img src="images/copy-icon.jpg">
</div> <span style="display:none;" class='<%= jobApplication.getID().toString() + "link"%>'>
<%= jobLink %>
</span>
</a>
</span>
</oneit:button>
<div class="appli-int-status">
<span>
<a href="<%= "mailto:" + candidate.getUser().getEmail() %>">Email</a>
</span>
<oneit:toString value="<%= candidate.getPhone() %>" mode="EscapeHTML" />
<span><img src="images/clip_icon.png"></span>
<%
if(jobApplication.getCV() != null)
{
%>
<span>
<a target='blank' href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
CV
</a>
</span>
<%
}
if(jobApplication.getCoverLetter() != null)
{
%>
<span>
<a target='blank' href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'>
Cover Letter
</a>
</span>
<%
}
%>
</div>
</div> </div>
<% <%
String widthClass = "appli-jcs2"; String widthClass = "appli-jcs2";
...@@ -147,10 +180,17 @@ ...@@ -147,10 +180,17 @@
role fit role fit
</div> </div>
<div class="appli-status appli-l eq-second-height"> <div class="appli-status appli-l eq-second-height">
<div class="appli-list-drop"> <%
<tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlow" cssClass="form-control app-process" if(jobApplication.getApplicationStatus() == ApplicationStatus.DRAFT)
options="<%= sortedWorkFlows.toArray(new WorkFlow[0]) %>"/> {
</div> %>
<div class="appli-list-drop">
<tagfile:ormsingleasso_select obj="<%= jobApplication %>" assocName="WorkFlow" cssClass="form-control app-process"
options="<%= sortedWorkFlows.toArray(new WorkFlow[0]) %>"/>
</div>
<%
}
%>
</div> </div>
<oneit:button name="changeApplicationStatus" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>" <oneit:button name="changeApplicationStatus" value=" " cssClass="<%= "save-application" + jobApplication.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
......
...@@ -123,16 +123,22 @@ ...@@ -123,16 +123,22 @@
.toMap() %>"> .toMap() %>">
EDIT JOB EDIT JOB
</oneit:button> </oneit:button>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("ShowList", showList)
.mapEntry("ApplicantPage", applicantPage)
.mapEntry("Applications", applications)
.mapEntry("Detailed", false)
.mapEntry("WorkFlow", workFlow)
.toMap() %>">
EXPORT APPLICANT REPORT
</oneit:button>
<% <%
if(!applicantPage || !job.isExpressJob())
{
%>
<oneit:button value=" " cssClass="job-edit-menu-item" name="downloadApplicantReport" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("ShowList", showList)
.mapEntry("ApplicantPage", applicantPage)
.mapEntry("Applications", applications)
.mapEntry("Detailed", false)
.mapEntry("WorkFlow", workFlow)
.toMap() %>">
EXPORT APPLICANT REPORT
</oneit:button>
<%
}
if(applicantPage) if(applicantPage)
{ {
%> %>
......
...@@ -6,10 +6,19 @@ ...@@ -6,10 +6,19 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page"); String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
ILOJobTitle iloJobTitle = job.getILOJobTitle();
if(iloJobTitle == null)
{
iloJobTitle = ILOJobTitle.createILOJobTitle(process.getTransaction());
}
Debug.assertion (iloJobTitle != null, "ILOJobTitle is null in admin portal create job");
SecUser txUser = SecUser.getTXUser(process.getTransaction()); SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
...@@ -144,6 +153,13 @@ ...@@ -144,6 +153,13 @@
}); });
$('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"});
}); });
...@@ -368,21 +384,34 @@ ...@@ -368,21 +384,34 @@
</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 class="form-group row"> <div class="form-group row">
......
...@@ -178,6 +178,16 @@ ...@@ -178,6 +178,16 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4 review-medium-title"> <div class="col-md-4 review-medium-title">
<oneit:label GUIName="ILO Job Title" />
</div>
<div class="col-md-8">
<span class="skill-label">
<oneit:toString value="<%= job.getILOJobTitle()%>" mode="EscapeHTML" nullValue="" />
</span>
</div>
</div>
<div class="row">
<div class="col-md-4 review-medium-title">
<oneit:label GUIName="Job Occupation Classification" /> <oneit:label GUIName="Job Occupation Classification" />
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_assessment_template</tableName>
<column name="job_title_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
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Account Created Mail">
<createSpecificIdentifier factory='String' value='JMZDIPT76HCPJ5FDHSTH0G95R5BZX4'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="JMZDIPT76HCPJ5FDHSTH0G95R5BZX4"/>
</articleIdentifiers>
<createdLabel factory="String" value="JMZDIPT76HCPJ5FDHSTH0G95R5BZX4"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] You've joined ${HiringTeam:HiringTeamName} on Matchd!"/>
<NODE name="Shortcuts" factory="String" value="AccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Welcome! You&rsquo;re now a full member of the ${HiringTeam:HiringTeamName} team on Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use ${SecUser:UserName}&nbsp;along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Welcome! You&rsquo;re now a full member of the ${HiringTeam:HiringTeamName} team on Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use ${SecUser:UserName}&nbsp;along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Account Verification Mail">
<createSpecificIdentifier factory='String' value='I90Q26LQURCWXZZFP21EWM3EHUGXTJ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
</articleIdentifiers>
<createdLabel factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="AccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi,</p>
<p>Thank-you for your application to ${Job:JobTitle}.<br>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.</p>
<p>Please verify this email address and continue your application by clicking this link.&nbsp;</p>
<p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi,</p><p>Thank-you for your application to ${Job:JobTitle}.&nbsp;</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.<br>Please verify this email address and continue your application by clicking this link.&nbsp;</p><p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Applicant Account Created Mail">
<createSpecificIdentifier factory='String' value='0QBF1OPIDVFDHJVKG22GUAY0OXAXPP'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
</articleIdentifiers>
<createdLabel factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Welcome to Matchd!"/>
<NODE name="Shortcuts" factory="String" value="ApplicantAccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Applicant Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Company Account Verification Mail">
<createSpecificIdentifier factory='String' value='P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
</articleIdentifiers>
<createdLabel factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="CompanyAccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Company Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Thank you for choosing Matchd! &nbsp;</p>
<p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account. Please verify this email address by clicking this link:</p>
<p>
<a href="${link}">Verify now</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Thank you for choosing Matchd! &nbsp;</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account. Please verify this email address by clicking this link:</p><p>
<a href="${link}">Verify now</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Email Changed Mail">
<createSpecificIdentifier factory='String' value='180CNU1NHZCIJRIAM7PWFGKDEHD5QQ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="180CNU1NHZCIJRIAM7PWFGKDEHD5QQ"/>
</articleIdentifiers>
<createdLabel factory="String" value="180CNU1NHZCIJRIAM7PWFGKDEHD5QQ"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address (change)"/>
<NODE name="Shortcuts" factory="String" value="EmailChangedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Email Changed Mail"/>
<NODE name="ShortTitle" factory="String" value="Email Changed Mail"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi&nbsp;${SecUser:FirstName},</p>
<p>You entered <strong>${SecUser:Email}</strong> as your new email address for your Matchd account.</p>
<p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can verify this new email address using this link:</p>
<p>
<a href="${link}">Verify now</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi&nbsp;${SecUser:FirstName},</p><p>You entered <strong>${SecUser:Email}</strong> as your new email address for your Matchd account.</p><p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can verify this new email address using this link:</p><p>
<a href="${link}">Verify now</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Invitation Mail">
<createSpecificIdentifier factory='String' value='UDQKBSOIBW9O2ET72SI93FJJ6SUWF3'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="UDQKBSOIBW9O2ET72SI93FJJ6SUWF3"/>
</articleIdentifiers>
<createdLabel factory="String" value="UDQKBSOIBW9O2ET72SI93FJJ6SUWF3"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] You've been invited to join ${HiringTeam:HiringTeamName} on Matchd"/>
<NODE name="Shortcuts" factory="String" value="InvitationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Invitation Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>${SecUser:FirstName}&nbsp;${SecUser:LastName}&nbsp;has invited you to join the ${HiringTeam:HiringTeamName} team on Matchd.</p>
<p>
<a href="${link}">Click here</a>&nbsp;to accept ${SecUser:FirstName}&rsquo;s invitation.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>${SecUser:FirstName}&nbsp;${SecUser:LastName}&nbsp;has invited you to join the ${HiringTeam:HiringTeamName} team on Matchd.</p><p>
<a href="${link}">Click here</a>&nbsp;to accept ${SecUser:FirstName}&rsquo;s invitation.</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Owner Account Created Mail">
<createSpecificIdentifier factory='String' value='GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3"/>
</articleIdentifiers>
<createdLabel factory="String" value="GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Welcome to Matchd, ${HiringTeam:HiringTeamName}!"/>
<NODE name="Shortcuts" factory="String" value="OwnerAccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Owner Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi&nbsp;${SecUser:FirstName},</p>
<p>Welcome to Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong>&nbsp;along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
<p>Now, let&rsquo;s get going and <a href="${create_job_link}">set up a job</a>!</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi&nbsp;${SecUser:FirstName},</p><p>Welcome to Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong>&nbsp;along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p><p>Now, let&rsquo;s get going and <a href="${create_job_link}">set up a job</a>!</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Reset Code Email">
<createSpecificIdentifier factory='String' value='WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO"/>
</articleIdentifiers>
<createdLabel factory="String" value="WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="&quot;Matchd&quot; &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Reset your password"/>
<NODE name="Shortcuts" factory="String" value="ResetCodeEmail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Reset Code Email"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>We&rsquo;ve received a request to reset your password.</p>
<p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can reset your password using this link:</p>
<p>
<a href="${url}">Reset your password</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>We&rsquo;ve received a request to reset your password.</p><p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can reset your password using this link:</p><p>
<a href="${url}">Reset your password</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Account Created Mail">
<createSpecificIdentifier factory='String' value='JMZDIPT76HCPJ5FDHSTH0G95R5BZX4'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="JMZDIPT76HCPJ5FDHSTH0G95R5BZX4"/>
</articleIdentifiers>
<createdLabel factory="String" value="JMZDIPT76HCPJ5FDHSTH0G95R5BZX4"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] You've joined ${HiringTeam:HiringTeamName} on Matchd!"/>
<NODE name="Shortcuts" factory="String" value="AccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Welcome! You&rsquo;re now a full member of the ${HiringTeam:HiringTeamName} team on Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use ${SecUser:UserName}&nbsp;along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Welcome! You&rsquo;re now a full member of the ${HiringTeam:HiringTeamName} team on Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use ${SecUser:UserName}&nbsp;along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Account Verification Mail">
<createSpecificIdentifier factory='String' value='I90Q26LQURCWXZZFP21EWM3EHUGXTJ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
</articleIdentifiers>
<createdLabel factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="AccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi,</p>
<p>Thank-you for your application to ${Job:JobTitle}.<br>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.</p>
<p>Please verify this email address and continue your application by clicking this link.&nbsp;</p>
<p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi,</p><p>Thank-you for your application to ${Job:JobTitle}.&nbsp;</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.<br>Please verify this email address and continue your application by clicking this link.&nbsp;</p><p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Applicant Account Created Mail">
<createSpecificIdentifier factory='String' value='0QBF1OPIDVFDHJVKG22GUAY0OXAXPP'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
</articleIdentifiers>
<createdLabel factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Welcome to Matchd!"/>
<NODE name="Shortcuts" factory="String" value="ApplicantAccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Applicant Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Company Account Verification Mail">
<createSpecificIdentifier factory='String' value='P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
</articleIdentifiers>
<createdLabel factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="CompanyAccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Company Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Thank you for choosing Matchd! &nbsp;</p>
<p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account. Please verify this email address by clicking this link:</p>
<p>
<a href="${link}">Verify now</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Thank you for choosing Matchd! &nbsp;</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account. Please verify this email address by clicking this link:</p><p>
<a href="${link}">Verify now</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Email Changed Mail">
<createSpecificIdentifier factory='String' value='180CNU1NHZCIJRIAM7PWFGKDEHD5QQ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="180CNU1NHZCIJRIAM7PWFGKDEHD5QQ"/>
</articleIdentifiers>
<createdLabel factory="String" value="180CNU1NHZCIJRIAM7PWFGKDEHD5QQ"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address (change)"/>
<NODE name="Shortcuts" factory="String" value="EmailChangedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Email Changed Mail"/>
<NODE name="ShortTitle" factory="String" value="Email Changed Mail"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi&nbsp;${SecUser:FirstName},</p>
<p>You entered <strong>${SecUser:Email}</strong> as your new email address for your Matchd account.</p>
<p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can verify this new email address using this link:</p>
<p>
<a href="${link}">Verify now</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi&nbsp;${SecUser:FirstName},</p><p>You entered <strong>${SecUser:Email}</strong> as your new email address for your Matchd account.</p><p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can verify this new email address using this link:</p><p>
<a href="${link}">Verify now</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Invitation Mail">
<createSpecificIdentifier factory='String' value='UDQKBSOIBW9O2ET72SI93FJJ6SUWF3'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="UDQKBSOIBW9O2ET72SI93FJJ6SUWF3"/>
</articleIdentifiers>
<createdLabel factory="String" value="UDQKBSOIBW9O2ET72SI93FJJ6SUWF3"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] You've been invited to join ${HiringTeam:HiringTeamName} on Matchd"/>
<NODE name="Shortcuts" factory="String" value="InvitationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Invitation Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>${SecUser:FirstName}&nbsp;${SecUser:LastName}&nbsp;has invited you to join the ${HiringTeam:HiringTeamName} team on Matchd.</p>
<p>
<a href="${link}">Click here</a>&nbsp;to accept ${SecUser:FirstName}&rsquo;s invitation.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>${SecUser:FirstName}&nbsp;${SecUser:LastName}&nbsp;has invited you to join the ${HiringTeam:HiringTeamName} team on Matchd.</p><p>
<a href="${link}">Click here</a>&nbsp;to accept ${SecUser:FirstName}&rsquo;s invitation.</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Owner Account Created Mail">
<createSpecificIdentifier factory='String' value='GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3"/>
</articleIdentifiers>
<createdLabel factory="String" value="GKHZ94OVGDV0PK8GFPTFKCDUAPBRU3"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Welcome to Matchd, ${HiringTeam:HiringTeamName}!"/>
<NODE name="Shortcuts" factory="String" value="OwnerAccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Owner Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi&nbsp;${SecUser:FirstName},</p>
<p>Welcome to Matchd!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong>&nbsp;along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
<p>Now, let&rsquo;s get going and <a href="${create_job_link}">set up a job</a>!</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi&nbsp;${SecUser:FirstName},</p><p>Welcome to Matchd!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Matchd, be sure to use <strong>${SecUser:UserName}</strong>&nbsp;along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p><p>Now, let&rsquo;s get going and <a href="${create_job_link}">set up a job</a>!</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Reset Code Email">
<createSpecificIdentifier factory='String' value='WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO"/>
</articleIdentifiers>
<createdLabel factory="String" value="WFDXIOQKNEMOGB6ZGPF8XV08WZZAHO"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="Matchd &lt;help@matchd.com&gt;"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Reset your password"/>
<NODE name="Shortcuts" factory="String" value="ResetCodeEmail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Reset Code Email"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>We&rsquo;ve received a request to reset your password.</p>
<p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can reset your password using this link:</p>
<p>
<a href="${url}">Reset your password</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>We&rsquo;ve received a request to reset your password.</p><p>If you didn&rsquo;t make the request, just ignore this message. Otherwise, you can reset your password using this link:</p><p>
<a href="${url}">Reset your password</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
} }
boolean isApplicantPage = workflowStatus == ApplicationStatus.SUBMITTED; boolean isApplicantPage = workflowStatus == ApplicationStatus.SUBMITTED;
boolean isDraftPage = workflowStatus == ApplicationStatus.DRAFT;
// handle application filter (showing dropdown) // handle application filter (showing dropdown)
if(parameterMap.containsKey("ApplicationFilter") && !request.getParameter("ApplicationFilter").isEmpty()) if(parameterMap.containsKey("ApplicationFilter") && !request.getParameter("ApplicationFilter").isEmpty())
...@@ -101,10 +102,11 @@ ...@@ -101,10 +102,11 @@
// filter applicants by status // filter applicants by status
oneit.utils.filter.Filter<JobApplication> filter = JobApplication.SearchByAll().andApplicationStatus(new EqualsFilter<>(workflowStatus)); oneit.utils.filter.Filter<JobApplication> filter = JobApplication.SearchByAll().andApplicationStatus(new EqualsFilter<>(workflowStatus));
oneit.utils.filter.Filter<JobApplication> applicantFilter = JobApplication.SearchByAll().andApplicationStatus(new NotEqualsFilter<>(ApplicationStatus.DRAFT)); oneit.utils.filter.Filter<JobApplication> applicantFilter = JobApplication.SearchByAll().andApplicationStatus(new NotInFilter<>(ApplicationStatus.DRAFT, ApplicationStatus.POST_INGEST));
oneit.utils.filter.Filter<JobApplication> draftFilter = JobApplication.SearchByAll().andApplicationStatus(new InFilter<>(ApplicationStatus.DRAFT, ApplicationStatus.POST_INGEST));
// if Applicant Status, then show all application completed applicants // if Applicant Status, then show all application completed applicants
applicantList = new ArrayList<>(CollectionFilter.filter(applicantList, isApplicantPage ? applicantFilter : filter)); applicantList = new ArrayList<>(CollectionFilter.filter(applicantList, isDraftPage ? draftFilter : (isApplicantPage ? applicantFilter : filter)));
if(appFilter != ApplicationFilter.ALL_APPLICATIONS) if(appFilter != ApplicationFilter.ALL_APPLICATIONS)
{ {
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
<NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant"> <NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant">
<FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/> <FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/>
<FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"> <FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"/>
<ApplicantAccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="ApplicantAccountCreatedMail"/>
</FORM>
<FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/> <FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/>
<FORM name="*.validateApplication" factory="Participant" class="performa.form.ValidateApplicationFP"/> <FORM name="*.validateApplication" factory="Participant" class="performa.form.ValidateApplicationFP"/>
<FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/> <FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/>
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/> <RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/>
<RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/> <RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/>
<RenderMode name="PasswordPage" preIncludeJSP="extensions/applicantportal/password_page.jsp"/>
<RenderMode name="ConfirmDetails" preIncludeJSP="extensions/applicantportal/confirm_details.jsp"/>
<RenderMode name="VerificationSent" preIncludeJSP="extensions/applicantportal/verification_sent.jsp"/> <RenderMode name="VerificationSent" preIncludeJSP="extensions/applicantportal/verification_sent.jsp"/>
<RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/> <RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
<RenderMode name="ResetPassword" preIncludeJSP="extensions/applicantportal/reset_password.jsp"/> <RenderMode name="ResetPassword" preIncludeJSP="extensions/applicantportal/reset_password.jsp"/>
...@@ -36,19 +34,15 @@ ...@@ -36,19 +34,15 @@
</MAP> </MAP>
<!-- Added only for legacy data and should never be used -->
<MAP value="APPLICANT_ACCOUNT_VERIFICATION" description="Applicant Account Verification" TemplatePage="dynamic_content_form.jsp"> <MAP value="APPLICANT_ACCOUNT_VERIFICATION" description="Applicant Account Verification" TemplatePage="dynamic_content_form.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"/>
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/password_page.jsp"/>
<!--<RenderMode name="PasswordPage" preIncludeJSP="extensions/applicantportal/password_page.jsp"/>-->
<RenderMode name="AuthError" preIncludeJSP="extensions/applicantportal/auth_error.jsp"/>
</NODE> </NODE>
</MAP> </MAP>
<MAP value="JOB_APLICATION" description="Job Application" TemplatePage="dynamic_content_form_applicant.jsp"> <MAP value="JOB_APLICATION" description="Job Application" TemplatePage="dynamic_content_form_applicant.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration"> <NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
...@@ -56,8 +50,6 @@ ...@@ -56,8 +50,6 @@
<INHERITS nodename="StandardJSP"/> <INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/application_outline.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/applicantportal/application_outline.jsp"/>
<RenderMode name="ConfirmDetails" preIncludeJSP="extensions/applicantportal/confirm_details.jsp"/>
<RenderMode name="CoverLetter" preIncludeJSP="extensions/applicantportal/cv_cover_letter.jsp"/>
<RenderMode name="SelectionCriteria" preIncludeJSP="extensions/applicantportal/selection_criteria.jsp"/> <RenderMode name="SelectionCriteria" preIncludeJSP="extensions/applicantportal/selection_criteria.jsp"/>
<RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/applicantportal/workplace_culture.jsp"/> <RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/applicantportal/workplace_culture.jsp"/>
<RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/applicantportal/job_match_assessment.jsp"/> <RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/applicantportal/job_match_assessment.jsp"/>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<oneit:dynIncluded>
<div style="width: 50%; margin: 0px auto 0px auto; text-align: center">
<h3>Authentication Error</h3>
<p><span>Access expired.</span></p>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria") + "&JobID=" + job.getID().toString();
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
JobApplication jobApplication = JobApplication.searchCandidateJob(objTran, candidate, job);
boolean redirectUser = jobApplication != null;
if(jobApplication == null)
{
jobApplication = JobApplication.createNewApplication(candidate, job);
}
process.setAttribute("JobApplication", jobApplication);
Boolean isSelectionComplete = jobApplication.selectionCompleted();
Boolean isCultureComplete = jobApplication.cultureCompleted();
Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
if(!isSelectionComplete)
{
nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
}
else if(!isCultureComplete)
{
nextPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
}
else if(!isAssesmentComplete)
{
nextPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment");
}
nextPage = nextPage +"&JobApplicationID="+ jobApplication.getID().toString();
if(redirectUser)
{
response.sendRedirect(nextPage);
}
BinaryContent logo = job.getLogo();
%>
<oneit:form name="confirmDetails" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
recalcFunction = setupRecalc ($("form#confirmDetails"), {'recalcOnError':true});
});
</script>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function(){
$('.attach-icon-btn').click(function(){
$(this).parent().find("input").click();
});
$("input:file").change(function (){
var fullPath = $(this).val();
var filename = fullPath.replace(/^.*[\\\/]/, '');
$(this).parents(".form-control").append(filename);
});
});
</script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=AIzaSyCaBh-MsMb8BBYJD_NcFzoCmygQbt5-QSw"></script>
<oneit:script>
<oneit:script src="/scripts/google_address.js"/>
</oneit:script>
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="apply-job-logo-header signinpage">
<div>
<div class="logo-img">
<%
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
</div>
<div class="header-title">
<%= job.getTeamName() %>
</div>
</div>
</div>
<div class="main-verify-identity">
<div class="pl-confirm text-center">Please confirm your details to continue</div>
<div class="main-box-layout main-verify-step-2">
<div class="form-group text-left">
<label>Email Address</label>
<%
if(secUser.getEmail() == null)
{
%>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true"/>
<%
}
else
{
%>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" disabled="true" readonly="true" style="text-transform: lowercase" required="true"/>
<%
}
%>
</div>
<div class="row">
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="FirstName" cssClass="form-control second-style" required="true"/>
</div>
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="LastName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="LastName" cssClass="form-control second-style" required="true"/>
</div>
</div>
<div class="form-group text-left">
<label><oneit:ormlabel obj="<%= candidate %>" field="Phone" /></label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="Phone" cssClass="form-control second-style" required="true"/>
</div>
<%
if(job.getRequireCV() == Boolean.TRUE)
{
%>
<div class="form-group text-left relative-parent ">
<label>Upload your CV</label>
<div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CV" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div>
</div>
<div class="form-group text-left relative-parent">
<label>Upload your Cover Letter</label>
<div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CoverLetter" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div>
</div>
<% } %>
<hr class="seperate-line">
<div class="form-group text-left">
<label>Location</label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" />
</div>
<%
if(job.getRemote())
{
%>
<div class="form-group text-left" style="margin-top: 30px;">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= jobApplication %>" id="prefer-remote" attributeName="PreferRemote" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="jobApplication.getPreferRemote() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="prefer-remote">
<oneit:label GUIName="I would prefer to work remotely" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<%
}
%>
<oneit:recalcClass htmlTag="div" classScript="jobApplication.isFarFromJob() ? 'show': 'hide'" jobApplication="<%= jobApplication %>">
<div class="relocate-warning-box">
<p>
We noticed that your location is different to the location of the job (<%= job.getGoogleAddressText() %>).
</p>
<p>
Are you prepared to relocate for this position?
</p>
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= jobApplication %>" id="happy-to-relocate" attributeName="HappyToRelocate" type="checkbox" />
<oneit:recalcClass htmlTag="span" classScript="jobApplication.getHappyToRelocate() ? 'checked': 'unchecked'" jobApplication="<%= jobApplication %>">
<label for="happy-to-relocate">
<oneit:label GUIName="Yes, I am happy to relocate"/>
</label>
</oneit:recalcClass>
</div>
</div>
<span class="warning-icon"></span>
</div>
</oneit:recalcClass>
<div class="text-center">
<oneit:button value="Verify and proceed" name="verifyIdentity" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job",job)
.mapEntry("Candidate",candidate)
.mapEntry("fromCoverLetter", true)
.mapEntry("JobApplication",jobApplication)
.mapEntry("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.toMap() %>"/>
</div>
</div>
</div>
<script>
addGoogleAddressListener('#<%= "gAddress_"+ candidate.getObjectID() %>');
</script>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
String currentPage = WebUtils.getSamePageInRenderMode(request, "CoverLetter");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
JobApplication jobApplication = JobApplication.searchCandidateJob(objTran, candidate, job);
Debug.assertion(jobApplication != null, "Invalid Job Application in applicant portal");
if(process.getAttribute("JobApplicationID") == null)
{
process.setAttribute("JobApplicationID" , jobApplication.getID().longValue());
}
process.setAttribute("JobApplication" , jobApplication);
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function(){
$('.attach-icon-btn').click(function(){
$(this).parent().find("input").click();
});
$("input:file").change(function (){
var fullPath = $(this).val();
var filename = fullPath.replace(/^.*[\\\/]/, '');
$(this).parents(".form-control").append(filename);
});
});
</script>
<style>
.main-verify-identity .second-style {
font-size: 14px;
line-height: 40px;
}
</style>
<div class="apply-job-logo-header signinpage">
<div>
<div class="logo-img">
<%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
</div>
<div class="header-title">
<%= job.getTeamName() %>
</div>
</div>
</div>
<oneit:form name="editApplication" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-verify-identity">
<div class="pl-confirm text-center">
Great! Now let's attach your CV and Cover Letter<br/><br/>
Uploading your files in PDF format is strongly recommended</div>
<div class="main-box-layout main-verify-step-2">
<div class="form-group text-left relative-parent ">
<label>Upload your CV</label>
<div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CV" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div>
</div>
<div class="form-group text-left relative-parent">
<label>Upload your Cover Letter</label>
<div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CoverLetter" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div>
</div>
<div class="text-center">
<oneit:button value="Attach and proceed" name="validateApplication" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("fromCoverLetter", true)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"/>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -5,14 +5,54 @@ ...@@ -5,14 +5,54 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
String nextPage = WebUtils.getSamePageInRenderMode(request, "SignIn"); String nextPage = WebUtils.getSamePageInRenderMode(request, "SignIn");
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String id = request.getParameter("id"); String id = request.getParameter("id");
String key = request.getParameter("key"); String key = request.getParameter("key");
String candidateId = request.getParameter("aid");
String pin = request.getParameter("pin");
SecUser secUser = null;
Candidate candidate = null;
SecUser loggedInUser = SecUser.getTXUser(transaction);
if(id != null && key != null) if(id != null && key != null)
{ {
job = Job.searchJobKey(transaction, Long.parseLong(id), key); job = Job.searchJobKey(transaction, Long.parseLong(id), key);
process.setAttribute("Job", job);
}
if(job != null && candidateId != null && pin != null)
{
candidate = Candidate.searchIdPin(transaction, Long.parseLong(candidateId), pin);
if(candidate != null)
{
secUser = candidate.getUser();
String navigateTo = WebUtils.getSamePageInRenderMode(request, "SignIn") + "&UserName=" + secUser.getEmail();
if((loggedInUser != null && loggedInUser == secUser) || candidate.isUnverifiedEmailIngestUser() || !candidate.isTrue(candidate.getIsPasswordChanged()))
{
navigateTo = WebUtils.getSamePageInRenderMode(request,"VerifyIdentity");
}
navigateTo = navigateTo + "&JobID=" + job.getID().toString();
%>
<oneit:form name="navigateJob" method="post" enctype="multipart/form-data">
<oneit:button value=" " name="verifyIdentity" cssClass="verifyIdentity" style="display:none;"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", navigateTo)
.mapEntry("Candidate", candidate)
.mapEntry("Job", job)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.toMap() %>"/>
</oneit:form>
<script type="text/javascript">
$(".verifyIdentity").click();
</script>
<%
}
} }
if(job != null) if(job != null)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#completeAssessment = Please complete your experience. #completeAssessment = Please complete your experience.
#emailExists = An account already exists with this email address. #emailExists = An account already exists with this email address.
#existsInOtherCompany = An account with this email address is already associated with another company. #existsInOtherCompany = An account with this email address is already associated with another company.
#emailSent = A verification email has been sent to you. Please check your email. #emailSent = Please check your email for further details.
#alreadyApplied = You have already applied for this job. #alreadyApplied = You have already applied for this job.
#uploadCover = Please upload your Cover Letter. #uploadCover = Please upload your Cover Letter.
#uploadCV = Please upload your CV. #uploadCV = Please upload your CV.
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate");
SecUser secUser = null;
boolean toRedirect = false;
String id = request.getParameter("id");
String key = request.getParameter("key");
String candidateId = request.getParameter("aid");
String pin = request.getParameter("pin");
Boolean isVerify = Boolean.FALSE;
if(id != null || key != null || candidateId != null || pin != null)
{
isVerify = Boolean.TRUE;
if(candidateId != null && pin != null)
{
candidate = Candidate.searchIdPin(transaction, Long.parseLong(candidateId), pin);
if(candidate != null && candidate.getIsAccountVerified() != Boolean.TRUE)
{
secUser = candidate.getUser();
process.setAttribute("NewCandidate", candidate);
}
}
if(id != null && key != null)
{
job = Job.searchJobKey(transaction, Long.parseLong(id), key);
process.setAttribute("Job", job);
}
}
else
{
toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
}
//INVALID REQUEST FOR VERIFY CANDIDATE
if(isVerify && (job == null || secUser == null))
{
response.sendRedirect(WebUtils.getSamePageInRenderMode(request, "AuthError"));
return; //Else it will continue execution and throws NPE.
}
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
JobApplication jobApplication = JobApplication.searchCandidateJob(transaction, candidate, job);
Article applyJobArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.JOB_APPLICATION);
String nextPage = applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", job.getIncludeAssessmentCriteria() ? "SelectionCriteria" : "WorkplaceCulture").toMap());
process.setAttribute("JobApplication", jobApplication);
%>
<style>
.pwd-verify-identity .second-style {
font-size: 14px;
/*line-height: 40px;*/
}
.pl-verify {margin: 8.3% auto 9px !important}
body {background-color: #e9ecef !important}
</style>
<div class="apply-job-logo-header signinpage">
<div>
<div class="logo-img">
<%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
</div>
<div class="header-title">
<%= job.getTeamName() %>
</div>
</div>
</div>
<oneit:form name="editApplication" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="pwd-verify-identity">
<div class="pl-verify">Please enter your password to continue your application</div>
<div id="overlay">
<div class="modal-dialog">
<div class="modal-body main-password-popup">
<div class="form-group text-left pwd-box">
<label class="pwd-label">Password</label>
<oneit:ormInput obj="<%= job %>" type="password" attributeName="Password" cssClass="form-control second-style pwd-input-box" autofocus="true"/>
</div>
<div class="create-y-f-job">
<oneit:button value="Verify and proceed" name="verifyIdentity" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job",job)
.mapEntry("Candidate",candidate)
.mapEntry("JobApplication",jobApplication)
.mapEntry("isVerify",Boolean.TRUE)
.mapEntry("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.toMap() %>"/>
</div>
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
{criteriaID : criteriaID, answerOption: answerOption, note: note}, {criteriaID : criteriaID, answerOption: answerOption, note: note},
function () {}, function () {},
function (jqXHR, textStatus, errorThrown) { function (jqXHR, textStatus, errorThrown) {
console.log("entered");
if (jqXHR.status == 0) { if (jqXHR.status == 0) {
log("Empty Response. Status : " + jqXHR.status); log("Empty Response. Status : " + jqXHR.status);
} else { } else {
......
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
Debug.assertion(job != null, "Job is null in applicant portal"); Debug.assertion(job != null, "Job is null in applicant portal");
if(request.getParameter("UserName")!=null)
{
String userName = (String) request.getParameter("UserName");
job.setEmail(userName);
}
process.setAttribute("Job", job);
String socialLoginNextPage = nextPage + "&JobID=" + job.getID().toString(); String socialLoginNextPage = nextPage + "&JobID=" + job.getID().toString();
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -47,7 +56,10 @@ ...@@ -47,7 +56,10 @@
$(this).change(); $(this).change();
}); });
$('input[name$=Email]').focus(); if($('input[name$=Email]').val() === '')
{
$('input[name$=Email]').focus();
}
}); });
function validate() { function validate() {
...@@ -97,7 +109,7 @@ ...@@ -97,7 +109,7 @@
} }
</style> </style>
<div class="apply-job-logo-header signinpage"> <div class="apply-job-logo-header signinpage">
<div class="box-sizing-border-box"> <div class="box-sizing-border-box">
<div class="logo-img"> <div class="logo-img">
<% <%
BinaryContent logo = job.getLogo(); BinaryContent logo = job.getLogo();
...@@ -181,7 +193,7 @@ ...@@ -181,7 +193,7 @@
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"/> .toMap() %>"/>
<oneit:button value="Sign in" name="signIn" cssClass="box-btn sign-in-btn" <oneit:button value="Sign in" name="signIn" cssClass="box-btn sign-in-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", confirmPage)
.mapEntry("Job",job) .mapEntry("Job",job)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"/> .toMap() %>"/>
...@@ -196,6 +208,7 @@ ...@@ -196,6 +208,7 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", confirmPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", confirmPage)
.mapEntry("Job",job) .mapEntry("Job",job)
.mapEntry("restartProcess", Boolean.TRUE) .mapEntry("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false) .mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.toMap() %>"/> .toMap() %>"/>
</div> </div>
......
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Account Verification Mail">
<createSpecificIdentifier factory='String' value='I90Q26LQURCWXZZFP21EWM3EHUGXTJ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
</articleIdentifiers>
<createdLabel factory="String" value="I90Q26LQURCWXZZFP21EWM3EHUGXTJ"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="help@matchd.com"/>
<NODE name="EmailSubject" factory="String" value="[Matchd] Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="AccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi,</p>
<p>Thank-you for your application to ${Job:JobTitle}.<br>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.</p>
<p>Please verify this email address and continue your application by clicking this link.&nbsp;</p>
<p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p>
<p>Thanks,</p>
<p>The Matchd Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi,</p><p>Thank-you for your application to ${Job:JobTitle}.&nbsp;</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Matchd account.<br>Please verify this email address and continue your application by clicking this link.&nbsp;</p><p>
<a href="${link}">Verify and continue now&nbsp;</a>
</p><p>Thanks,</p><p>The Matchd Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">oneit_sec_user_extension</tableName>
<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"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">oneit_sec_user_extension</tableName>
<column name="is_password_changed" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
ObjectTransaction objTran = process.getTransaction (); Job job = (Job) process.getAttribute("Job");
String currentPage = WebUtils.getSamePageInRenderMode(request, "SignIn");
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "Page");
Job job = (Job) process.getAttribute("Job");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate");
if(request.getParameter("JobID")!=null) if(request.getParameter("JobID")!=null)
{ {
...@@ -45,12 +41,12 @@ ...@@ -45,12 +41,12 @@
</div> </div>
<div class="main-verify-identity"> <div class="main-verify-identity">
<div class="pl-verify">Please verify your identity before applying to:</div> <div class="pl-verify">Thank-you for your application to:</div>
<div class="verify-i-title"> <div class="verify-i-title">
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
</div> </div>
<div class="main-box-layout verify-i-setpone"> <div class="main-box-layout verify-i-setpone">
<div class="box-label">Sent! Check your email now</div> <div class="box-label">We will get in touch with you soon</div>
</div> </div>
</div> </div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
...@@ -5,31 +5,63 @@ ...@@ -5,31 +5,63 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
Candidate candidate = (Candidate) process.getAttribute("NewCandidate"); boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String successPage = WebUtils.getSamePageInRenderMode(request, "VerificationSent");
SecUser secUser = null;
boolean toRedirect = false;
if(candidate != null)
{
secUser = candidate.getUser();
process.setAttribute("NewCandidate", candidate);
}
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal"); Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Debug.assertion(secUser != null, "Invalid candidate in applicant portal");
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
Debug.assertion(candidate != null, "Invalid candidate in applicant portal"); Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
String successPage = WebUtils.getSamePageInRenderMode(request, "VerificationSent") + "&JobID=" + job.getID();
JobApplication jobApplication = JobApplication.searchCandidateJob(transaction, candidate, job); JobApplication jobApplication = JobApplication.searchCandidateJob(transaction, candidate, job);
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page"); boolean redirectUser = jobApplication != null && jobApplication.getApplicationStatus() == ApplicationStatus.DRAFT;
if(jobApplication == null) if(jobApplication == null)
{ {
jobApplication = JobApplication.createNewApplication(candidate, job); jobApplication = JobApplication.createNewApplication(candidate, job);
} }
Boolean isSelectionComplete = jobApplication.selectionCompleted();
Boolean isCultureComplete = jobApplication.cultureCompleted();
Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
Article jobApplicationArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOB_APPLICATION);
String nextPage = jobApplicationArticle.getLink(request);
if(!jobApplication.hasStartedApplication())
{
nextPage = WebUtils.getArticleLink(request, transaction, WebUtils.JOB_APPLICATION, "Page") + "&JobID="+ job.getID().toString();
}
else if(!isSelectionComplete)
{
nextPage = LoopbackHTTP.getRemoteAccessURL(request)
+ jobApplicationArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "SelectionCriteria").toMap(), "/");
}
else if(!isCultureComplete)
{
nextPage = LoopbackHTTP.getRemoteAccessURL(request)
+ jobApplicationArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "WorkplaceCulture").toMap(), "/");
}
else if(!isAssesmentComplete)
{
nextPage = LoopbackHTTP.getRemoteAccessURL(request)
+ jobApplicationArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "JobMatchAssessment").toMap(), "/");
}
if(redirectUser)
{
response.sendRedirect(candidate.isFalse(candidate.getIsAccountVerified()) ? successPage : nextPage +"&JobApplicationID="+ jobApplication.getID().toString());
}
candidate.setHasValidAddress(candidate.getGoogleAddressText() != null);
process.setAttribute("JobApplication", jobApplication); process.setAttribute("JobApplication", jobApplication);
process.setAttribute("JobApplicationID", jobApplication.getID().longID());
%> %>
<oneit:script> <oneit:script>
<oneit:script src="/scripts/password_strength_lightweight.js"/> <oneit:script src="/scripts/password_strength_lightweight.js"/>
...@@ -47,21 +79,17 @@ ...@@ -47,21 +79,17 @@
</style> </style>
<oneit:form name="signIn" method="post" enctype="multipart/form-data"> <oneit:form name="signIn" method="post" enctype="multipart/form-data">
<%
String passkey = Utils.getPwdKeyOfSecUser(request, secUser, true);
%>
<script type="text/javascript"> <script type="text/javascript">
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
var interval ; var interval ;
$(document).ready(function() { $(document).ready(function() {
recalcFunction = setupRecalc ($("form#signIn"), {'recalcOnError':true}); recalcFunction = setupRecalc ($("form#signIn"), {'recalcOnError':true});
$(".fileLink").hide();
interval = setInterval(function() { validate(); }, 500); interval = setInterval(function() { validate(); }, 500);
validate(); validate();
$('input').on('change keyup', function() { validate(); }); $('input').on('change keyup', function() { validate(); });
$('#myPassword').strength_meter({
"inputName" : "<%= passkey %>"
});
}); });
function validate() { function validate() {
...@@ -94,7 +122,12 @@ ...@@ -94,7 +122,12 @@
$("input:file").change(function (){ $("input:file").change(function (){
var fullPath = $(this).val(); var fullPath = $(this).val();
var filename = fullPath.replace(/^.*[\\\/]/, ''); var filename = fullPath.replace(/^.*[\\\/]/, '');
$(this).parents(".form-control").append(filename);
if (filename)
{
$(this).parents(".fileInput").siblings(".new-file-link").text(filename);
$(this).parents(".fileInput").siblings(".new-file-link").removeAttr("href");
}
}); });
}); });
</script> </script>
...@@ -129,21 +162,49 @@ ...@@ -129,21 +162,49 @@
<div class="main-box-layout main-verify-step-2"> <div class="main-box-layout main-verify-step-2">
<div class="form-group text-left"> <div class="form-group text-left">
<label>Email Address</label> <label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control second-style" disabled="true" readonly="true"/> <%
</div> if(secUser.getEmail() == null || (candidate.isUnverifiedEmailIngestUser() && candidate.isTrue(candidate.getIsMaskedEmail())))
{
<div class="form-group text-left email"> %>
<label style="display: none;"><oneit:ormlabel obj="<%= secUser %>" field="Email" /></label> <oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true"/>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control"/> <%
</div> }
<div class="form-group text-left" id="myPassword"> else
<label>Password</label> {
</div> %>
<div class="form-group text-left"> <oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control second-style" disabled="true" readonly="true"/>
<label>Confirm password</label> <%
<oneit:input type="password" name="<%= passkey + 2 %>" class="form-control second-style reset-pw"/> }
%>
</div> </div>
<%
if(!candidate.isTrue(candidate.getIsPasswordChanged()))
{
String passkey = Utils.getPwdKeyOfSecUser(request, secUser, true);
%>
<script type="text/javascript">
$(document).ready(function() {
$('#myPassword').strength_meter({
"inputName" : "<%= passkey %>"
});
});
</script>
<div class="form-group text-left email">
<label style="display: none;"><oneit:ormlabel obj="<%= secUser %>" field="Email" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control"/>
</div>
<div class="form-group text-left" id="myPassword">
<label>Password</label>
</div>
<div class="form-group text-left">
<label>Confirm password</label>
<oneit:input type="password" name="<%= passkey + 2 %>" class="form-control second-style reset-pw"/>
</div>
<%
}
%>
<div class="row"> <div class="row">
<div class="form-group text-left col-sm-6 col-xs-12"> <div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label> <label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label>
...@@ -163,18 +224,24 @@ ...@@ -163,18 +224,24 @@
{ {
%> %>
<div class="form-group text-left relative-parent "> <div class="form-group text-left relative-parent ">
<label>Upload your CV</label> <label>Upload your CV (PDF preferred)</label>
<div class="form-control second-style"> <div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CV" cssClass="hide"/> <a target='blank' class="new-file-link" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
<div class="attach-icon-btn"></div> <%= jobApplication.getCV() != null ? "Click to View File" : "" %>
</a>
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CV" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div> </div>
</div> </div>
<div class="form-group text-left relative-parent"> <div class="form-group text-left relative-parent">
<label>Upload your Cover Letter</label> <label>Upload your Cover Letter (PDF preferred)</label>
<div class="form-control second-style"> <div class="form-control second-style">
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CoverLetter" cssClass="hide"/> <a target='blank' class="new-file-link" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'>
<div class="attach-icon-btn"></div> <%= jobApplication.getCoverLetter() != null ? "Click to View File" : "" %>
</div> </a>
<oneit:ormInput obj="<%= jobApplication %>" type="file" attributeName="CoverLetter" cssClass="hide"/>
<div class="attach-icon-btn"></div>
</div>
</div> </div>
<% <%
} }
...@@ -182,7 +249,10 @@ ...@@ -182,7 +249,10 @@
<hr class="seperate-line"> <hr class="seperate-line">
<div class="form-group text-left"> <div class="form-group text-left">
<label>Location</label> <label>Location</label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" /> <div class="googleAddress">
<oneit:ormInput obj="<%= candidate %>" class="has-valid-address" attributeName="HasValidAddress" type="checkbox"/>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" />
</div>
</div> </div>
<div class="form-group text-left" style="margin-top: 30px;"> <div class="form-group text-left" style="margin-top: 30px;">
<div class="styled_checkboxes"> <div class="styled_checkboxes">
...@@ -225,7 +295,7 @@ ...@@ -225,7 +295,7 @@
<oneit:recalcClass htmlTag="span" classScript="candidate.showPrivacyPolicyAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>"> <oneit:recalcClass htmlTag="span" classScript="candidate.showPrivacyPolicyAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<label for="privacy-policy-agreed"> <label for="privacy-policy-agreed">
<oneit:label GUIName="I have read and agree to the " /> <oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/privacy/" target="_blank" class="privacy-link">Privacy Policy</a> <a href="https://www.matchd.com/privacy/" target="_blank" class="privacy-link">Privacy Policy</a>
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
...@@ -238,14 +308,13 @@ ...@@ -238,14 +308,13 @@
<oneit:recalcClass htmlTag="span" classScript="candidate.showConditionsAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>"> <oneit:recalcClass htmlTag="span" classScript="candidate.showConditionsAgreed() ? 'checked': 'unchecked'" candidate="<%= candidate %>">
<label for="conditions-agreed"> <label for="conditions-agreed">
<oneit:label GUIName="I have read and agree to the " /> <oneit:label GUIName="I have read and agree to the " />
<a href="https://www.talentology.com/terms-of-service/" target="_blank" class="privacy-link">Terms & Conditions</a> <a href="https://www.matchd.com/terms-of-service/" target="_blank" class="privacy-link">Terms & Conditions</a>
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
</div> </div>
</div> </div>
<div class="text-center"> <div class="text-center">
<oneit:button value="Submit" name="sendVerificationMail" cssClass="box-btn send-link-btn" <oneit:button value="Submit" name="sendVerificationMail" cssClass="box-btn send-link-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", successPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", successPage)
.mapEntry("Job",job) .mapEntry("Job",job)
......
...@@ -20,4 +20,17 @@ ...@@ -20,4 +20,17 @@
<DATA class="oneit.servlets.orm.RunSearchExecutorDF"/> <DATA class="oneit.servlets.orm.RunSearchExecutorDF"/>
</NODE> </NODE>
<NODE name="editMessageTemplate_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
</NODE>
<NODE name="listMessageTemplate_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
</NODE>
<NODE name="test_imap_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
<FORM name="*.runEmailFetcher" factory="Participant" class="performa.form.RunEmailFetcherFP"/>
</NODE>
</OBJECTS> </OBJECTS>
\ No newline at end of file
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<!-- <TOPMENU name="MENU.TEST_ANALYSIS" desc="Test Analysis" sortOrder="100" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" <!-- <TOPMENU name="MENU.TEST_ANALYSIS" desc="Test Analysis" sortOrder="100" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element"
link="/extensions/performa/testAnalysis.jsp"/> --> link="/extensions/performa/testAnalysis.jsp"/> -->
<CHILD name="Performa.SetupPlans" desc="Setup Plans" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/setupPlans.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" /> <CHILD name="Performa.SetupPlans" desc="Setup Plans" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/setupPlans.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.MessageTemplate" desc="Message Template" sortOrder="20" toplevel="ADMIN" priv="admin" link="/extensions/performa/listMessageTemplate.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
</NODE> </NODE>
</NODE> </NODE>
...@@ -31,4 +31,17 @@ ...@@ -31,4 +31,17 @@
<NODE name="DashboardTypes::Performa"> <NODE name="DashboardTypes::Performa">
<MAP value="HOME_TL" description="HomePage" JSP="/extensions/performa/editor/additionalHomePage.jsp" /> <MAP value="HOME_TL" description="HomePage" JSP="/extensions/performa/editor/additionalHomePage.jsp" />
</NODE> </NODE>
<NODE name="WEB_BATCH::Email">
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask">
<RUN class="performa.utils.PerformaEmailFetcher" factory="Participant">
</RUN>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
<NODE name="schedule" class="oneit.appservices.batch.QuickSchedule">
<NODE name="period" factory="Integer" value="5"/>
</NODE>
</WHEN>
</TASK>
</NODE>
</OBJECTS> </OBJECTS>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%@ page import="oneit.business.content.editor.gui.*" %>
<%! protected String getName (ServletConfig config) { return "editMessageTemplate_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "MessageTemplate", MessageTemplate.REFERENCE_MessageTemplate);
MessageTemplate messageTemplate = (MessageTemplate) process.getAttribute("MessageTemplate");
if (toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
if (toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(messageTemplate != null, "MessageTemplate is null in Edit Message Template", "404");
String continuePage = "editMessageTemplate.jsp?MessageTemplateID=" + messageTemplate.getObjectID();
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "MessageTemplate").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "Message Template");
%>
<%@include file="/editor/header.jsp" %>
<script>
function insertAtCaret(myValue) {
myValue = myValue.trim();
id = $("textarea").attr("id");
CKEDITOR.instances[id].insertText(myValue);
};
</script>
<style>
textarea[id^=MessageContent] {
width:70%;
}
</style>
<oneit:layout_total widths="<%= new double[] {2, 3, 7} %>" skin="bootstrap">
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="TemplateName"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="TemplateName" style="width:90%" />
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="Subject"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="Subject" style="width:90%" />
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="ApplicationStatus"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormEnum obj="<%= messageTemplate %>" attributeName="ApplicationStatus"
enums="<%= Arrays.asList(new ApplicationStatus[]{ApplicationStatus.POST_INGEST, ApplicationStatus.DRAFT, ApplicationStatus.SUBMITTED, ApplicationStatus.SHORTLISTED, ApplicationStatus.UNSUITABLE}) %>"/>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="DelayHrs"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="DelayHrs" style="width:30%" /><span>Hours</span> &nbsp;
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="DelayMin" style="width:30%" /><span>Mins</span>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="Variance"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="Variance" style="width:30%" /><span>Mins</span>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_field width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field=""/>
</oneit:layout_field>
<oneit:layout_field width="1">
<oneit:ormInput type="checkbox" obj="<%= messageTemplate %>" attributeName="BusinessHoursOnly" /><span>Business Hours Only</span>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:ormlabel obj="<%= messageTemplate %>" field="PlaceholderVariable"/></oneit:layout_label>
<oneit:layout_field width="1">
<oneit:skin tagName="button_group">
<oneit:skin tagName="button_dropdown" label="Placeholder Variable" class="btn btn-default">
<%
for(PlaceholderOptions option : PlaceholderOptions.getPlaceholderOptionsArray())
{
%>
<li><oneit:button value="<%= option.getDescription() %>" cssClass=" " name="<%= option.getDescription() %>" skin="link" onClick="<%=" insertAtCaret('"+ option.getPlaceholder() +"'); return false;"%>" /></li>
<% } %>
</oneit:skin>
</oneit:skin>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"></oneit:layout_label>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="MessageContent"/>
</oneit:layout_label>
<oneit:layout_field width="2">
<tagfile:htmleditor obj="<%= messageTemplate %>" attribName="MessageContent" id="texteditor"
toolbarSet="<%= EditorGUIOptions.Default %>"/>
</oneit:layout_field>
</oneit:skin>
</oneit:layout_total>
<div class="bottomButtons" hidden="true">
<oneit:button value="Save" name="save" cssClass="BUTTON_PRIMARY"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "listMessageTemplate.jsp").toMap() %>"/>
<oneit:button value="Cancel" name="cancel" cssClass="BUTTON_SECONDARY" showIfReadOnly="true"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "listMessageTemplate.jsp")
.mapEntry (UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
</div>
<%@include file="/editor/footer.jsp" %>
\ No newline at end of file
<%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*, performa.search.*"%> <%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*, performa.search.*"%>
<%@ page import="com.stripe.model.*"%> <%@ page import="com.stripe.model.*"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.*, oneit.objstore.utils.ObjstoreUtils "%> <%@ page import="oneit.objstore.rdbms.filters.*, oneit.servlets.security.SessionSecUserDecorator, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.*, oneit.objstore.utils.ObjstoreUtils "%>
<%@ page import="oneit.utils.text.FormatUtils, oneit.utils.math.*"%> <%@ page import="oneit.utils.text.FormatUtils, oneit.utils.math.*, oneit.net.LoopbackHTTP"%>
<%@ page import="oneit.servlets.objstore.binary.*"%> <%@ page import="oneit.servlets.objstore.binary.*,oneit.servlets.jsp.ormtable.*"%>
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "listMessageTemplate_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
MessageTemplate[] messageTemplates = MessageTemplate.SearchByAll().search(objTran);
process.setAttribute ("MessageTemplates", messageTemplates);
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "listMessageTemplate").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "List Message Template");
%>
<%@include file="/editor/header.jsp" %>
<style>
.tbl-width{width:50%}
</style>
<div class="bottomButtons" hidden="true">
<oneit:button value="Add" cssClass="BUTTON_ACTION primarybut" name="gotoPage"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "editMessageTemplate.jsp")
.mapEntry("ignoreProcess", Boolean.TRUE)
.toMap() %>" />
</div>
<%
if (messageTemplates != null)
{
if (messageTemplates.length == 0)
{
%>
<b>No Message Templates found - please try again.</b>
<%
}
else
{
%>
<%--<b>Results (<%= messageTemplates.length %>)</b> --%>
<oneit:skin tagName="layout_search_results">
<oneit:table name="MessageTemplateTable" sortable="true" cssClass="cougartable tbl-width" notgrid="true">
<oneit:colheader label="Template Name" width="48" />
<oneit:colheader label="Email Subject" width="48" />
<oneit:colheader label="" width="4" cssClass="nosort nofilter" />
<%
for (MessageTemplate msgTemp : messageTemplates)
{
%>
<oneit:row rowObj="<%= msgTemp %>">
<oneit:col><oneit:toString value="<%= msgTemp.getTemplateName() %>" mode="EscapeHTML" /></oneit:col>
<oneit:col><oneit:toString value="<%= msgTemp.getSubject() %>" mode="EscapeHTML" /></oneit:col>
<oneit:col><a class="data-link " href="editMessageTemplate.jsp?MessageTemplateID=<%= msgTemp.getObjectID() %>">>></a></oneit:col>
</oneit:row>
<%
}
%>
</oneit:table>
</oneit:skin>
<%
}
}
%>
<%@include file="/editor/footer.jsp" %>
\ No newline at end of file
MessageTemplate.ApplicationStatus = Application Status
MessageTemplate.MessageContent = Message Content
MessageTemplate.PlaceholderVariable = Placeholder Variable
MessageTemplate.DelayHrs = Delay
MessageTemplate.TemplateName = Template Name
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="../../../editor/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "test_imap_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "test_imap").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "Test IMAP");
List<String> visitedNodes = (List<String>) request.getAttribute("VisitedNodes");
request.setAttribute("VisitedNodes", null);
%>
<%@include file="/editor/header.jsp" %>
<%
if(visitedNodes != null)
{
%>
<h3>Folders Visited</h3>
<%
for(String node : visitedNodes)
{
%>
<oneit:toString value="<%= node%>" mode="EscapeHTML"/> <br/>
<%
}
}
%>
<div class="bottomButtons" hidden="true">
<oneit:button value="Run" name="runEmailFetcher" cssClass="BUTTON_PRIMARY"
requestAttribs="<%= CollectionUtils.EMPTY_MAP %>"/>
</div>
<%@include file="/editor/footer.jsp" %>
\ 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_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="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">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
<?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
<?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.RedefineTableOperation">
<tableName factory="String">tl_job</tableName>
<column name="job_title_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.RedefineTableOperation">
<tableName factory="String">tl_message_template</tableName>
<column name="template_name" type="String" nullable="true" length="200"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
update oneit_sec_user_extension set is_password_changed = 'Y' where is_account_verified='Y';
\ No newline at end of file
Add following properties. Please confirm username and password before release.
Also check whether email account has third party application access.
run extensions/performa/testIMAP.jsp to test fetcher
imap.server.name=imap.gmail.com
imap.server.port=993
imap.email.acc.username=
imap.email.acc.password=
\ No newline at end of file
...@@ -30,6 +30,12 @@ function addGoogleAddressListener(domSelector) ...@@ -30,6 +30,12 @@ function addGoogleAddressListener(domSelector)
parentDiv.find("." + component).val(''); parentDiv.find("." + component).val('');
} }
} }
if($(this).val() && trim($(this).val()))
{
var parentDiv = $(domSelector).closest('.googleAddress');
parentDiv.find(".has-valid-address").prop("checked",false);
}
}) })
$(domSelector).keypress(function(e) { $(domSelector).keypress(function(e) {
...@@ -43,6 +49,9 @@ function addGoogleAddressListener(domSelector) ...@@ -43,6 +49,9 @@ function addGoogleAddressListener(domSelector)
place = autocomplete.getPlace(); place = autocomplete.getPlace();
googleAutoComplete[domSelector] = place; googleAutoComplete[domSelector] = place;
placeChanged(domSelector); placeChanged(domSelector);
var parentDiv = $(domSelector).closest('.googleAddress');
parentDiv.find(".has-valid-address").prop("checked",true);
}); });
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp"> <SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp">
<WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms"> <WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms">
<OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="55062a5b1839912e7c07656e8027575c5a4c42e0"/> <OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="c52c4159bf7a1a1f38b983dd073923508e2ba111"/>
</WEBAPP> </WEBAPP>
<PARAMETER name="key.file"/> <PARAMETER name="key.file"/>
......
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