Commit cdd05b35 by Harsh Shah

Finish Release-20170926

parents 8161664b 4f975674
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
<property name="nodelete.appwar" value="${nodelete}"/> <property name="nodelete.appwar" value="${nodelete}"/>
<path id="cmsWebApp.lib"> <path id="cmsWebApp.lib">
<pathelement location="${build.target.dir}/overlay/CougarCMS8.2/bin/cmsWebApp"/> <pathelement location="${build.target.dir}/overlay/CougarCMS8.2/bin/cmsWebApp"/>
<fileset dir="${cmsWebApp.lib.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
<exclude name="**/.new*"/>
</fileset>
</path>
<target name="copylib">
<jsync todir="${cmsWebApp.lib.dir}" flatten="true">
<fileset dir="${build.target.dir}/overlay/CougarCMS8.2/lib/cmsWebApp"> <fileset dir="${build.target.dir}/overlay/CougarCMS8.2/lib/cmsWebApp">
<include name="**/*.jar"/> <include name="**/*.jar"/>
<include name="**/*.zip"/> <include name="**/*.zip"/>
...@@ -32,20 +40,14 @@ ...@@ -32,20 +40,14 @@
<include name="*/lib-no-deploy/*.zip"/> <include name="*/lib-no-deploy/*.zip"/>
<exclude name="*/lib/.new*"/> <exclude name="*/lib/.new*"/>
</fileset> </fileset>
<fileset dir="${libnodeploy.dir}"> <fileset dir="../../CougarCMS8.2/cmsWebApp/lib-no-deploy">
<include name="**/*.jar"/> <include name="**/*.jar"/>
<include name="**/*.zip"/> <include name="**/*.zip"/>
</fileset> </fileset>
<fileset dir="../../CougarCMS8.2/cmsWebApp/lib-no-deploy"> <fileset dir="${libnodeploy.dir}">
<include name="**/*.jar"/> <include name="**/*.jar"/>
<include name="**/*.zip"/> <include name="**/*.zip"/>
</fileset> </fileset>
</path>
<target name="copylib">
<jsync todir="${cmsWebApp.lib.dir}">
<fileset dir="${lib.dir}">
<exclude name="**/.new*"/>
</fileset>
</jsync> </jsync>
</target> </target>
<target name="execute-overlays"> <target name="execute-overlays">
......
<?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">oneit_sec_user_extension</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="object_type" type="String" nullable="false" length="30"/>
<column name="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_user_id" isUnique="false"><column name="user_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_industry</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="NAME" type="String" nullable="false" length="200"/>
<column name="VALUE" type="String" nullable="false" length="200"/>
<column name="DESCRIPTION" type="String" nullable="true" length="200"/>
<column name="SORT_ORDER" type="Long" nullable="false"/>
<column name="DISABLED" type="Boolean" nullable="false"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="object_type" type="String" nullable="false" length="30"/> <column name="object_type" type="String" nullable="false" length="30"/>
<column name="phone" type="String" nullable="true" length="30"/> <column name="phone" type="String" nullable="true" length="30"/>
<column name="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
<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"/>
......
<?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_client</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="client_name" type="String" nullable="false" length="100"/>
<column name="client_logo" type="BLOB" nullable="true"/>
<column name="email" type="String" nullable="true" length="100"/>
<column name="contact_name" type="String" nullable="true" length="100"/>
<column name="contact_surname" type="String" nullable="true" length="100"/>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="company_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_client" indexName="idx_tl_client_company_id" isUnique="false"><column name="company_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_company</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="company_name" type="String" nullable="false" length="100"/>
<column name="company_logo" type="BLOB" nullable="true"/>
<column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="is_verified" type="Boolean" nullable="true"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
<column name="added_by_user_id" type="Long" length="11" 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">oneit_sec_user_extension</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="object_type" type="String" nullable="false" length="30"/>
<column name="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
<column name="role_type" type="String" nullable="true" length="200"/>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="verification_mail_send_date" type="Date" nullable="true"/>
<column name="verification_key" type="String" nullable="true" length="10"/>
<column name="is_account_verified" type="Boolean" nullable="true"/>
<column name="is_email_changed" type="Boolean" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_user_id" isUnique="false"><column name="user_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_company_id" isUnique="false"><column name="company_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -24,7 +24,10 @@ ...@@ -24,7 +24,10 @@
<column name="state" type="String" nullable="true" length="200"/> <column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/> <column name="country" type="String" nullable="true" length="200"/>
<column name="level_id" type="Long" length="11" nullable="false"/> <column name="level_id" type="Long" length="11" nullable="false"/>
<column name="secuser_id" type="Long" length="11" nullable="true"/> <column name="client_id" type="Long" length="11" nullable="true"/>
<column name="company_user_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></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL ,
forgot_password_mail_send_date datetime NULL,
forgot_password_key varchar(10) NULL,
user_id numeric(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
-- DROP TABLE tl_industry;
CREATE TABLE tl_industry (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
NAME varchar(200) NOT NULL,
VALUE varchar(200) NOT NULL,
DESCRIPTION varchar(200) NULL,
SORT_ORDER numeric(12) NOT NULL ,
DISABLED char(1) NOT NULL
);
ALTER TABLE tl_industry ADD
CONSTRAINT PK_tl_industry PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -9,6 +9,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -9,6 +9,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL , , object_type varchar(30) NOT NULL ,
phone varchar(30) NULL, phone varchar(30) NULL,
forgot_password_mail_send_date datetime NULL,
forgot_password_key varchar(10) NULL,
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,
......
-- DROP TABLE tl_client;
CREATE TABLE tl_client (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
client_name varchar(100) NOT NULL,
client_logo image NULL,
email varchar(100) NULL,
contact_name varchar(100) NULL,
contact_surname varchar(100) NULL,
phone varchar(30) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
time_zone varchar(200) NULL,
company_id numeric(12) NOT NULL
);
ALTER TABLE tl_client ADD
CONSTRAINT PK_tl_client PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_client_company_id
ON tl_client (company_id);
-- DROP TABLE tl_company;
CREATE TABLE tl_company (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
company_name varchar(100) NOT NULL,
company_logo image NULL,
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
is_verified char(1) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
added_by_user_id numeric(12) NOT NULL
);
ALTER TABLE tl_company ADD
CONSTRAINT PK_tl_company PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL ,
forgot_password_mail_send_date datetime NULL,
forgot_password_key varchar(10) NULL,
role_type varchar(200) NULL,
phone varchar(30) NULL,
verification_mail_send_date datetime NULL,
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
CREATE INDEX idx_oneit_sec_user_extension_company_id
ON oneit_sec_user_extension (company_id);
...@@ -24,7 +24,8 @@ CREATE TABLE tl_job ( ...@@ -24,7 +24,8 @@ CREATE TABLE tl_job (
state varchar(200) NULL, state varchar(200) NULL,
country varchar(200) NULL, country varchar(200) NULL,
level_id numeric(12) NOT NULL, level_id numeric(12) NOT NULL,
secuser_id numeric(12) NULL client_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -36,4 +37,6 @@ ALTER TABLE tl_job ADD ...@@ -36,4 +37,6 @@ ALTER TABLE tl_job ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_tl_job_client_id
ON tl_job (client_id);
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL ,
forgot_password_mail_send_date date NULL,
forgot_password_key varchar2(10) NULL,
user_id number(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
-- DROP TABLE tl_industry;
CREATE TABLE tl_industry (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
NAME varchar2(200) NOT NULL,
VALUE varchar2(200) NOT NULL,
DESCRIPTION varchar2(200) NULL,
SORT_ORDER number(12) NOT NULL ,
DISABLED char(1) NOT NULL
);
ALTER TABLE tl_industry ADD
CONSTRAINT PK_tl_industry PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL , , object_type varchar2(30) NOT NULL ,
phone varchar2(30) NULL, phone varchar2(30) NULL,
forgot_password_mail_send_date date NULL,
forgot_password_key varchar2(10) NULL,
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,
......
-- DROP TABLE tl_client;
CREATE TABLE tl_client (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
client_name varchar2(100) NOT NULL,
client_logo blob NULL,
email varchar2(100) NULL,
contact_name varchar2(100) NULL,
contact_surname varchar2(100) NULL,
phone varchar2(30) NULL,
state varchar2(200) NULL,
country varchar2(200) NULL,
post_code varchar2(10) NULL,
city varchar2(100) NULL,
time_zone varchar2(200) NULL,
company_id number(12) NOT NULL
);
ALTER TABLE tl_client ADD
CONSTRAINT PK_tl_client PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_client_company_id
ON tl_client (company_id);
-- DROP TABLE tl_company;
CREATE TABLE tl_company (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
company_name varchar2(100) NOT NULL,
company_logo blob NULL,
hiring_team_type varchar2(200) NULL,
industry varchar2(200) NULL,
time_zone varchar2(200) NULL,
is_verified char(1) NULL,
state varchar2(200) NULL,
country varchar2(200) NULL,
post_code varchar2(10) NULL,
city varchar2(100) NULL,
has_client_support char(1) NULL,
added_by_user_id number(12) NOT NULL
);
ALTER TABLE tl_company ADD
CONSTRAINT PK_tl_company PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL ,
forgot_password_mail_send_date date NULL,
forgot_password_key varchar2(10) NULL,
role_type varchar2(200) NULL,
phone varchar2(30) NULL,
verification_mail_send_date date NULL,
verification_key varchar2(10) NULL,
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id number(12) NULL,
company_id number(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT PK_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
CREATE INDEX idx_oneit_sec_user_extension_company_id
ON oneit_sec_user_extension (company_id);
...@@ -25,7 +25,8 @@ CREATE TABLE tl_job ( ...@@ -25,7 +25,8 @@ CREATE TABLE tl_job (
state varchar2(200) NULL, state varchar2(200) NULL,
country varchar2(200) NULL, country varchar2(200) NULL,
level_id number(12) NOT NULL, level_id number(12) NOT NULL,
secuser_id number(12) NULL client_id number(12) NULL,
company_user_id number(12) NULL
); );
...@@ -37,4 +38,6 @@ ALTER TABLE tl_job ADD ...@@ -37,4 +38,6 @@ ALTER TABLE tl_job ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_tl_job_client_id
ON tl_job (client_id);
-- @AutoRun
-- drop table oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL ,
forgot_password_mail_send_date timestamp NULL,
forgot_password_key varchar(10) NULL,
user_id numeric(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT pk_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
-- @AutoRun
-- drop table tl_industry;
CREATE TABLE tl_industry (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
NAME varchar(200) NOT NULL,
VALUE varchar(200) NOT NULL,
DESCRIPTION varchar(200) NULL,
SORT_ORDER numeric(12) NOT NULL ,
DISABLED char(1) NOT NULL
);
ALTER TABLE tl_industry ADD
CONSTRAINT pk_tl_industry PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL , , object_type varchar(30) NOT NULL ,
phone varchar(30) NULL, phone varchar(30) NULL,
forgot_password_mail_send_date timestamp NULL,
forgot_password_key varchar(10) NULL,
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,
......
-- @AutoRun
-- drop table tl_client;
CREATE TABLE tl_client (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
client_name varchar(100) NOT NULL,
client_logo bytea NULL,
email varchar(100) NULL,
contact_name varchar(100) NULL,
contact_surname varchar(100) NULL,
phone varchar(30) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
time_zone varchar(200) NULL,
company_id numeric(12) NOT NULL
);
ALTER TABLE tl_client ADD
CONSTRAINT pk_tl_client PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_client_company_id
ON tl_client (company_id);
-- @AutoRun
-- drop table tl_company;
CREATE TABLE tl_company (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
company_name varchar(100) NOT NULL,
company_logo bytea NULL,
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
is_verified char(1) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
added_by_user_id numeric(12) NOT NULL
);
ALTER TABLE tl_company ADD
CONSTRAINT pk_tl_company PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table oneit_sec_user_extension;
CREATE TABLE oneit_sec_user_extension (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL ,
forgot_password_mail_send_date timestamp NULL,
forgot_password_key varchar(10) NULL,
role_type varchar(200) NULL,
phone varchar(30) NULL,
verification_mail_send_date timestamp NULL,
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
);
ALTER TABLE oneit_sec_user_extension ADD
CONSTRAINT pk_oneit_sec_user_extension PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_oneit_sec_user_extension_user_id
ON oneit_sec_user_extension (user_id);
CREATE INDEX idx_oneit_sec_user_extension_company_id
ON oneit_sec_user_extension (company_id);
...@@ -25,7 +25,8 @@ CREATE TABLE tl_job ( ...@@ -25,7 +25,8 @@ CREATE TABLE tl_job (
state varchar(200) NULL, state varchar(200) NULL,
country varchar(200) NULL, country varchar(200) NULL,
level_id numeric(12) NOT NULL, level_id numeric(12) NOT NULL,
secuser_id numeric(12) NULL client_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -37,4 +38,6 @@ ALTER TABLE tl_job ADD ...@@ -37,4 +38,6 @@ ALTER TABLE tl_job ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_tl_job_client_id
ON tl_job (client_id);
package performa.form;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableEmailer;
import oneit.logging.*;
import oneit.net.LoopbackHTTP;
import oneit.objstore.*;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.utils.*;
import performa.orm.*;
import performa.utils.*;
public class ForgotPasswordFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("ForgotPasswordFP");
protected int DEFAULT_PASSWORD_LENGTH = 6;
protected ConfigurableEmailer resetCodeEmailer;
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
Job job = (Job) process.getAttribute("Job");
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
String email = job != null ? job.getEmail() : (companyUser != null ? companyUser.getEmail() : null);
Debug.assertion(StringUtils.subBlanks(email) != null, "Email not avaialble");
email = StringUtils.trim(email);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send pasword reset link email.", email);
SecUser secUser = SecUser.searchNAME (objTran, email);
if(secUser == null)
{
SecUser[] userSearch = SecUser.SearchByALL().andEmail(new EqualsFilter<>(email)).search(objTran);
if(userSearch.length>0)
{
secUser = userSearch[0];
}
}
if(secUser != null)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ForgotPasswordFP for send reset pasword link mail to ", email);
Map emailParams;
companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser != null)
{
if(companyUser.getForgotPasswordKey() == null)
{
String resetCode = new RandomStringGen().generateHumanAlphaNum(DEFAULT_PASSWORD_LENGTH);
companyUser.setForgotPasswordKey(resetCode);
}
companyUser.setForgotPasswordMailSendDate(new Date());
emailParams = CollectionUtils.mapEntry("resetcode", companyUser.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL() + "/extensions/adminportal/reset_password.jsp"
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getForgotPasswordKey()).toMap();
}
else
{
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
if(candidate == null)
{
throw new BusinessException("Sorry, we don't recognize that email address.");
}
Article applyJobArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.APPLY_JOB);
if(candidate.getForgotPasswordKey() == null)
{
String resetCode = new RandomStringGen().generateHumanAlphaNum(DEFAULT_PASSWORD_LENGTH);
candidate.setForgotPasswordKey(resetCode);
}
candidate.setForgotPasswordMailSendDate(new Date());
emailParams = CollectionUtils.mapEntry("resetcode", candidate.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.RESET_PASSWORD).toMap(), "/")
+ "&id=" + candidate.getID()
+ "&key=" + candidate.getForgotPasswordKey()
+ "&jid=" + job.getID()).toMap();
}
ObjectTransform transform = Utils.createCompoundTransform(emailParams, secUser);
try
{
Utils.sendMail(resetCodeEmailer, transform, new String[]{email}, null, secUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Reset code email sent to :: ", email);
}
catch(Exception e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while sending email");
throw new BusinessException("Mail can not be sent. Please contact administrator.");
}
}
else
{
throw new BusinessException("Sorry, we don't recognize that email address.");
}
return super.processForm(process, submission, params);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
resetCodeEmailer = (ConfigurableEmailer)(context.getSingleChild("ResetCodeEmailer"));
}
}
\ No newline at end of file
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package performa.form;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr;
import oneit.security.oauth.form.BaseOAuthLoginFP;
import oneit.servlets.forms.*;
import oneit.utils.CollectionUtils;
/**
*
* @author Pradip Sabhadiya
*/
public class LinkedInOAuthLoginFP extends BaseOAuthLoginFP
{
public static final String LINKEDIN_CLIENTID_ATTR_NAME = "linkedin.clientId";
public static final String LINKEDIN_CLIENTSECRET_ATTR_NAME = "linkedin.clientSecret";
public static final String LINKEDIN_APP_OAUTH_URL = "https://www.linkedin.com/oauth/v2/authorization";
public static final String LINKEDIN_ACCESS_TOKEN_URL = "https://www.linkedin.com/oauth/v2/accessToken";
public static final String LINKEDIN_PROFILE_FROM_TOKEN_URL = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address)";
@Override
public String getOAuthLoginURL(SubmissionDetails submission, String token)
{
String appId = ConfigMgr.getKeyfileString(LINKEDIN_CLIENTID_ATTR_NAME);
String callbackURL = getCallbackURL(submission.getRequest());
return LINKEDIN_APP_OAUTH_URL
+ HTTPRequestDetails.getParamStringURL(CollectionUtils.mapEntry("client_id", appId)
.mapEntry("redirect_uri", callbackURL)
.mapEntry("scope", "r_basicprofile,r_emailaddress")
.mapEntry("response_type", "code")
.mapEntry("state", token).toMap());
}
public static String getCallbackURL(HttpServletRequest request)
{
String urlFirstBit = request.getScheme () + "://" + request.getServerName () + ":" + request.getServerPort ();
return HTTPRequestDetails.getFullURL(urlFirstBit + request.getContextPath() + "/linkedinCallback", new String[0]);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package performa.form;
import java.io.*;
import java.net.*;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr;
import oneit.components.ParticipantInitialisationContext;
import oneit.logging.*;
import oneit.security.oauth.decorator.OAuthCallbackDecorator;
import oneit.security.oauth.utils.BaseOAuthLoginHandler;
import oneit.servlets.forms.HTTPRequestDetails;
import oneit.utils.*;
import org.json.*;
/**
*
* @author Pradip Sabhadiya
*/
public class LinkedInOAuthLoginHandler extends BaseOAuthLoginHandler
{
protected static final LoggingArea LOG = LoggingArea.createLoggingArea("BaseOAuthLoginHandler");
@Override
public void validateRequest(HttpServletRequest request)
{
LogMgr.log(LOG, LogLevel.DEBUG3, "Validation LinkedIn callback request");
String state = request.getParameter("state");
String token = (String) request.getSession().getAttribute(OAuthCallbackDecorator.TOKEN_ATTRIB_NAME);
Debug.assertion(CollectionUtils.equals(state, token), "Unothorized access to callback url.");
}
@Override
public OAuthLoginInfo getProfileInfo(HttpServletRequest request) throws Exception
{
LogMgr.log(LOG, LogLevel.DEBUG3, "Getting profile data from callback");
String accessToken = getAccessToken(request);
try
{
String profileURL = LinkedInOAuthLoginFP.LINKEDIN_PROFILE_FROM_TOKEN_URL
+ HTTPRequestDetails.getParamStringURL(CollectionUtils.mapEntry("oauth2_access_token", accessToken).mapEntry("format", "json").toMap());
JSONObject json = executeURL(profileURL);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Profile Data found ", json);
OAuthLoginInfo loginInfo = new OAuthLoginInfo();
loginInfo.setId(json.getString("id"));
loginInfo.setFirstName(json.getString("firstName"));
if (json.has("emailAddress"))
{
loginInfo.setEmail(json.getString("emailAddress"));
}
if (json.has("lastName"))
{
loginInfo.setLastName(json.getString("lastName"));
}
return loginInfo;
}
catch (Exception e)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, "Exception occured in getProfileInfo");
throw new NestedException(e, "ERROR while getting user data.");
}
}
public String getAccessToken(HttpServletRequest request) throws Exception
{
String code = request.getParameter("code");
String appId = ConfigMgr.getKeyfileString(LinkedInOAuthLoginFP.LINKEDIN_CLIENTID_ATTR_NAME);
String appSecret = ConfigMgr.getKeyfileString(LinkedInOAuthLoginFP.LINKEDIN_CLIENTSECRET_ATTR_NAME);
String callbackURL = LinkedInOAuthLoginFP.getCallbackURL(request);
@SuppressWarnings("unchecked")
String accessTokenURL = LinkedInOAuthLoginFP.LINKEDIN_ACCESS_TOKEN_URL
+ HTTPRequestDetails.getParamStringURL(CollectionUtils.mapEntry("grant_type", "authorization_code")
.mapEntry("code", code)
.mapEntry("redirect_uri", callbackURL)
.mapEntry("client_id", appId)
.mapEntry("client_secret", appSecret).toMap());
JSONObject data = executeURL(accessTokenURL, "POST");
if(!data.has("access_token"))
{
throw new RuntimeException("ERROR: Access Token Invalid: " + data);
}
return data.getString("access_token");
}
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
context.setObject(this);
}
public static JSONObject executeURL(String urlString)
{
return executeURL(urlString, null);
}
public static JSONObject executeURL(String urlString, String method)
{
LogMgr.log(LoggingArea.ALL, LogLevel.DEBUG3, "Executing url ", urlString);
try
{
URL url = new URL(urlString);
URLConnection urlConnection = url.openConnection();
if(StringUtils.subBlanks(method) != null && method.toUpperCase().equals("POST"))
{
urlConnection.setDoOutput(true);
}
BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
return new JSONObject(IOUtils.readerToString(in));
}
catch (IOException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.SYSTEMERROR1, "Error in Executing url ", urlString, e);
throw new NestedException(e);
}
catch(JSONException je)
{
LogMgr.log(LoggingArea.ALL, LogLevel.SYSTEMERROR1, "Error in Parsing Json Data", urlString, je);
throw new NestedException(je);
}
}
}
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.InitialisationException;
import oneit.utils.MultiException;
import oneit.utils.StringUtils;
import performa.orm.CompanyUser;
import performa.utils.Utils;
public class ResendVerificationFP extends SaveFP
{
protected ConfigurableArticleTemplateEmailer emailer;
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
if(!companyUser.isLoggedViaSocial())
{
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getUserName()), secUser, SecUser.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(secUser.getTransaction(), secUser.getUserName(), companyUser), secUser, SecUser.FIELD_UserName, "emailExists", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(secUser.getTransaction(), secUser.getEmail(), companyUser), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
}
return super.validate(submission, exceptions);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Inside ResendVerificationFP resending verification email to company user : ", companyUser);
if(companyUser != null)
{
Utils.sendEmailChangedMail(companyUser, request, emailer, ResendVerificationFP.class.getName());
}
return super.processForm(process, submission, params);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer"));
}
}
\ No newline at end of file
package performa.form;
import java.util.Map;
import oneit.logging.*;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.utils.*;
import performa.orm.Candidate;
import performa.orm.CompanyUser;
public class ResetPasswordFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("ResetPasswordFP");
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
SecUser user = (SecUser) process.getAttribute("SecUser");
CompanyUser companyUser = user.getExtension(CompanyUser.REFERENCE_CompanyUser);
Candidate candidate = user.getExtension(Candidate.REFERENCE_Candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ResetPasswordFP user:", user," companyUser:", companyUser, " candidate:", candidate);
if(companyUser != null)
{
companyUser.setForgotPasswordKey(null);
}
else if (candidate != null)
{
candidate.setForgotPasswordKey(null);
}
return super.processForm(process, submission, params);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
super.validate(process, submission, exceptions, params);
SecUser user = (SecUser) process.getAttribute("SecUser");
Debug.assertion(user != null, "No user found for rest password. Call from " + getClass().getName());
BusinessObjectParser.assertFieldCondition(user.getPassword().length() >= 8, user, SecUser.FIELD_Password, exceptions, true, submission.getRequest());
}
}
\ No newline at end of file
package performa.form;
import java.util.Map;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import performa.orm.Client;
public class SaveClientFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
Client client = (Client) process.getAttribute("Client");
LogMgr.log(Client.LOG, LogLevel.PROCESSING1,"In SaveClientFP saving client : ", client );
if(CollectionUtils.equals(client.getIsLogoDeleted(), Boolean.TRUE))
{
client.setClientLogo(null);
LogMgr.log(Client.LOG, LogLevel.PROCESSING1,"In SaveClientFP setting client logo to null of client : ", client );
}
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import performa.orm.Company;
public class SaveCompanyFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
Company company = process.getAttribute("Company") != null ? (Company) process.getAttribute("Company") : (Company) request.getAttribute("Company");
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP saving company : ", company );
if(CollectionUtils.equals(company.getIsLogoDeleted(), Boolean.TRUE))
{
company.setCompanyLogo(null);
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP setting comany logo to null of company : ", company );
}
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
...@@ -66,6 +66,11 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -66,6 +66,11 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor
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);
for(AssessmentCriteria criteria: job.getAssessmentCriteriasSet())
{
BusinessObjectParser.assertFieldCondition(criteria.getName() != null, criteria , AssessmentCriteria.FIELD_Name, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
} }
} }
\ No newline at end of file
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.RedisplayResult;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.InitialisationException;
import oneit.utils.MultiException;
import oneit.utils.StringUtils;
import performa.orm.CompanyUser;
import performa.utils.Utils;
public class SaveUserDetailsFP extends SaveFP
{
protected ConfigurableArticleTemplateEmailer emailer;
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1,"In SaveUserDetailsFP saving CompanyUser : ", companyUser );
SecUser oldSecUser = (SecUser) secUser.getEarliestBackup();
if(oldSecUser != null)
{
if(!companyUser.isLoggedViaSocial() && !CollectionUtils.equals(oldSecUser.getUserName(), secUser.getUserName()))
{
if(companyUser.getConfirmPassword() == null)
{
submission.getRequest().setAttribute("EmailChanged", true);
return RedisplayResult.getInstance();
}
else
{
boolean validPassword = secUser.checkPassword(companyUser.getConfirmPassword());
if(!validPassword)
{
submission.getRequest().setAttribute("EmailChanged", false);
companyUser.setConfirmPassword(null);
}
BusinessObjectParser.assertFieldCondition(validPassword, companyUser, CompanyUser.FIELD_ConfirmPassword, "passwordNotMatch");
if(validPassword)
{
companyUser.setIsAccountVerified(Boolean.FALSE);
companyUser.setIsEmailChanged(Boolean.TRUE);
Utils.sendEmailChangedMail(companyUser, request, emailer, SaveUserDetailsFP.class.getName());
}
}
}
else if (companyUser.isLoggedViaSocial() && !CollectionUtils.equals(oldSecUser.getEmail(), secUser.getEmail()))
{
//send email verification mail
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1,"Sending email resetted mail", companyUser );
companyUser.setIsEmailChanged(Boolean.TRUE);
Utils.sendEmailChangedMail(companyUser, request, emailer, SaveUserDetailsFP.class.getName());
}
}
return super.processForm(process, submission, params);
}
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
if(!companyUser.isLoggedViaSocial())
{
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getUserName()), secUser, SecUser.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(secUser.getTransaction(), secUser.getUserName(), companyUser), secUser, SecUser.FIELD_UserName, "emailExists", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(secUser.getTransaction(), secUser.getEmail(), companyUser), secUser, SecUser.FIELD_Email, "emailExists", 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);
return super.validate(submission, exceptions);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountVerificationEmailer"));
}
}
\ No newline at end of file
package performa.form;
import java.util.Date;
import java.util.Map;
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.net.LoopbackHTTP;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*;
import performa.intercom.utils.IntercomUtils;
import performa.orm.*;
import performa.utils.Utils;
import performa.utils.WebUtils;
public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("SendCompanyUserInvites");
protected ConfigurableArticleTemplateEmailer emailer;
protected ConfigurableArticleTemplateEmailer invitationEmailer;
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Company company = (Company) process.getAttribute("Company");
for(CompanyUser cUser : company.getUsersSet())
{
if(!CollectionUtils.equals(cUser, company.getAddedByUser()))
{
SecUser secUser = cUser.getUser();
BusinessObjectParser.assertFieldCondition(secUser.getEmail()!=null, secUser, SecUser.FIELD_Email, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(process.getTransaction(), secUser.getEmail()), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
}
}
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
Company company = (Company) process.getAttribute("Company");
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
String nextPage = (String) request.getAttribute("nextPage");
Boolean socialLogin = CollectionUtils.equals(process.getAttribute("socialLogin"), Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing Company User", companyUser, secUser);
companyUser.setIsAccountVerified(Boolean.TRUE);
company.setIsVerified(Boolean.TRUE);
sendAccountCreatedMail(companyUser, request);
if(!socialLogin)
{
secUser.setAttribute("md5:" + SecUser.FIELD_Password, companyUser.getPassword());
request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Password resetted", companyUser, secUser);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing Company User finished", companyUser, secUser);
//process user invitations
for(CompanyUser cUser : company.getUsersSet())
{
if(!CollectionUtils.equals(cUser, companyUser))
{
Tuple.T2<SecUser, Boolean> userdata = Utils.getSecUserForCompanyIfAvailable(cUser);
SecUser sUser = userdata.get0();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send invitaion email.", cUser);
if(!userdata.get1()) //check user availablility
{
sUser.setUserName(sUser.getEmail().toLowerCase());
}
sUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
sUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", sUser);
sendInvitationMail(cUser, request);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending invitation email.", cUser);
}
}
// Create company and the first user of it in intercom
performa.intercom.resources.Company intercomCompany = IntercomUtils.createIntercomCompany(company);
IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany);
process.completeAndRestart();
return new ProcessRedirectResult(nextPage, new String[0]);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountCreatedEmailer"));
invitationEmailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("InvitationEmailer"));
}
private void sendAccountCreatedMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from SendCompanyUserInvitesFP to :: ", companyUser);
Map defaultParams = CollectionUtils.EMPTY_MAP;
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent Account Created mail successfully from " + SendCompanyUserInvitesFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for CompanyUser :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
private void sendInvitationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
if(!companyUser.isTrue(companyUser.getIsAccountVerified()))
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending invitation mail from SendVerificationMailFP to :: ", companyUser);
Article invitationArticle = WebUtils.getArticleByShortCut(companyUser.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION);
RandomStringGen random = new RandomStringGen();
//set invitation key and send mail time
companyUser.setVerificationKey(random.generateAlphaNum(6));
companyUser.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ invitationArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(invitationEmailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent invitation mail successfully from " + SendVerificationMailFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for Candidate :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Call from " + SendVerificationMailFP.class + ". Account is already verified for candidate :: ", companyUser);
}
}
}
\ No newline at end of file
package performa.form;
import java.util.Date;
import java.util.Map;
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.net.LoopbackHTTP;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.utils.*;
import performa.orm.*;
import performa.utils.Utils;
import performa.utils.WebUtils;
public class SendUserInvitationFP extends SaveFP
{
private static LoggingArea LOG = LoggingArea.createLoggingArea("SendUserInvitationFP");
protected ConfigurableArticleTemplateEmailer invitationEmailer;
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Company company = (Company) process.getAttribute("Company");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
if(resendUser!=null)
{
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(resendUser.getUser().getUserName()), resendUser, resendUser.FIELD_ObjectID, "invalidEmail", exceptions, false, request);
}
else
{
BusinessObjectParser.assertFieldCondition(company.getUserEmail()!=null, company, Company.FIELD_UserEmail, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(process.getTransaction(), company.getUserEmail()), company, Company.FIELD_UserEmail, "emailExists", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(company.getRoleType()!=null, company, Company.FIELD_RoleType, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
Company company = (Company) process.getAttribute("Company");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
if(resendUser!=null)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to re-sending invitaion email.", resendUser);
sendInvitationMail(resendUser, request);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of re-sending invitation email.", resendUser);
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company);
SecUser secUser = SecUser.searchNAME(objTran, company.getUserEmail());
if(secUser == null)
{
secUser = SecUser.createSecUser(objTran);
secUser.setUserName(company.getUserEmail().toLowerCase());
}
CompanyUser newComUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
secUser.setEmail(secUser.getUserName());
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
secUser.setFirstName(company.getFirstName());
secUser.setLastName(company.getLastName());
newComUser.setCompany(company);
newComUser.setRole(company.getRoleType());
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser);
sendInvitationMail(newComUser, request);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending invitation email.", secUser);
}
return super.processForm(process, submission, params);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
invitationEmailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("InvitationEmailer"));
}
protected void sendInvitationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
if(!companyUser.isTrue(companyUser.getIsAccountVerified()))
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending invitation mail from SendUserInvitationFP to :: ", companyUser);
Article invitationArticle = WebUtils.getArticleByShortCut(companyUser.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION);
//set invitation key and send mail time
if(companyUser.getVerificationKey()==null)
{
RandomStringGen random = new RandomStringGen();
companyUser.setVerificationKey(random.generateAlphaNum(6));
}
companyUser.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ invitationArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(invitationEmailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent invitation mail successfully from " + SendUserInvitationFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for Candidate :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Call from " + SendUserInvitationFP.class + ". Account is already verified for candidate :: ", companyUser);
}
}
}
\ No newline at end of file
...@@ -17,24 +17,37 @@ import oneit.servlets.forms.*; ...@@ -17,24 +17,37 @@ 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.utils.Utils; import performa.utils.Utils;
import performa.utils.WebUtils; import performa.utils.WebUtils;
public class SendVerificationMailFP extends SaveFP public class SendVerificationMailFP extends SaveFP
{ {
private static LoggingArea LOG = LoggingArea.createLoggingArea("SendVerificationLink"); private static final LoggingArea LOG = LoggingArea.createLoggingArea("SendVerificationLink");
private static final String DEFAULT_PASSWORD = "Talentology123";
protected ConfigurableArticleTemplateEmailer emailer; protected ConfigurableArticleTemplateEmailer emailer;
@Override @Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
Company company = (Company) request.getAttribute("Company");
Debug.assertion(company != null || job!=null, "BO not avaialble");
BusinessObjectParser.assertFieldCondition(!job.isEmailFound(), job, Job.FIELD_Email, "emailExists", exceptions, true, request); if(company!=null)
{
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(process.getTransaction(), secUser.getEmail()), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(!job.isEmailFound(), job, Job.FIELD_Email, "emailExists", exceptions, true, request);
}
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
} }
...@@ -46,33 +59,87 @@ public class SendVerificationMailFP extends SaveFP ...@@ -46,33 +59,87 @@ public class SendVerificationMailFP extends SaveFP
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");
String email = job.getEmail(); Company company = (Company) request.getAttribute("Company");
Debug.assertion(email != null, "Email not avaialble"); if(company!=null)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", job , email); CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
SecUser secUser = SecUser.searchNAME(objTran, email); SecUser availableSecUser = SecUser.searchNAME(objTran, secUser.getEmail());
Debug.assertion(secUser == null, "user available", email); LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", companyUser);
if(availableSecUser!=null)
{
if(availableSecUser.getExtension(CompanyUser.REFERENCE_CompanyUser)!=null)
{
Debug.assertion(false, "user available", availableSecUser);
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "SecUser available", availableSecUser);
availableSecUser.addToExtensions(companyUser);
//remove new sec user obj
secUser.removeFromExtensions(companyUser);
secUser.delete();
}
}
else
{
secUser.setUserName(secUser.getEmail().toLowerCase());
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside SendVerificationMailFP for send account verification mail for ", email); //set default to admin
companyUser.setRole(RoleType.ADMIN);
Utils.sendVerificationMail(companyUser, request, emailer, SendVerificationMailFP.class.getName());
SecUser newSecUser = SecUser.createSecUser(objTran); LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending varification email.", companyUser);
}
else
{
String email = job.getEmail();
newSecUser.setUserName(email.toLowerCase()); Debug.assertion(email != null, "Email not avaialble");
newSecUser.setAttribute("md5:" + SecUser.FIELD_Password, DEFAULT_PASSWORD);
email = email.toLowerCase();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", job , email);
SecUser secUser = SecUser.searchNAME(objTran, email);
if(secUser!=null)
{
Debug.assertion(secUser.getExtension(Candidate.REFERENCE_Candidate)==null, "user available", email, secUser);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", newSecUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside SendVerificationMailFP for send account verification mail for ", email);
if(secUser==null)
{
secUser = SecUser.createSecUser(objTran);
newSecUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran)); secUser.setUserName(email);
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
}
Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser);
Candidate candidate = newSecUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate); sendVerificationMail(candidate, job, request);
sendVerificationMail(candidate, job, request); request.setAttribute("nextPage", request.getAttribute("nextPage") + "&JobID=" + job.getID());
}
request.setAttribute("nextPage", request.getAttribute("nextPage") + "&JobID=" + job.getID());
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
...@@ -87,9 +154,9 @@ public class SendVerificationMailFP extends SaveFP ...@@ -87,9 +154,9 @@ public class SendVerificationMailFP extends SaveFP
} }
protected void sendVerificationMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException private void sendVerificationMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException
{ {
if(candidate.getIsAccountVerified()!=Boolean.TRUE) if(!candidate.isTrue(candidate.getIsAccountVerified()))
{ {
try try
{ {
......
...@@ -7,6 +7,7 @@ import oneit.security.SecUser; ...@@ -7,6 +7,7 @@ import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails; import oneit.servlets.forms.SubmissionDetails;
import oneit.utils.MultiException; import oneit.utils.MultiException;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
import performa.orm.CompanyUser;
import performa.utils.Utils; import performa.utils.Utils;
/** /**
...@@ -19,8 +20,10 @@ public class UserLoginFP extends LoginProcessor ...@@ -19,8 +20,10 @@ public class UserLoginFP extends LoginProcessor
protected void checkUserCanLogin(ObjectTransaction trans, SecUser userToCheck, SubmissionDetails submission, Map requestParams) throws FieldException, MultiException protected void checkUserCanLogin(ObjectTransaction trans, SecUser userToCheck, SubmissionDetails submission, Map requestParams) throws FieldException, MultiException
{ {
super.checkUserCanLogin(trans, userToCheck, submission, requestParams); super.checkUserCanLogin(trans, userToCheck, submission, requestParams);
CompanyUser companyUser = userToCheck.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(!Utils.checkAdminPortalAccess(userToCheck)) if(!Utils.checkAdminPortalAccess(userToCheck) || companyUser == null || !companyUser.isTrue(companyUser.getIsAccountVerified()))
{ {
throw new FieldException("You're not an authorised user to access this portal.", SecUser.FIELD_UserName); throw new FieldException("You're not an authorised user to access this portal.", SecUser.FIELD_UserName);
} }
......
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr;
import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.email.ConfigurableEmailerException;
import oneit.logging.*;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.validator.AttributeValidator;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import performa.intercom.utils.IntercomUtils;
import performa.orm.*;
import performa.utils.Utils;
import performa.utils.WebUtils;
public class VerifyCompanyUserFP extends ORMProcessFormProcessor
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("VerifyCompanyUser");
protected ConfigurableArticleTemplateEmailer emailer;
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
Boolean socialLogin = (Boolean) request.getAttribute("socialLogin");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
if(socialLogin)
{
BusinessObjectParser.assertFieldCondition(secUser.getEmail()!=null, secUser, SecUser.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(secUser.getTransaction(), secUser.getEmail()), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getUserName()), secUser, SecUser.FIELD_Email, "invalid", 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);
if(!company.isTrue(company.getIsVerified()))
{
BusinessObjectParser.assertFieldCondition(company.getCompanyName()!=null, company, Company.FIELD_CompanyName, "mandatory", exceptions, true, request);
}
if(!socialLogin)
{
BusinessObjectParser.assertFieldCondition(companyUser.getPassword()!= null, companyUser, CompanyUser.FIELD_Password, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(companyUser.getConfirmPassword()!= null, companyUser, CompanyUser.FIELD_ConfirmPassword, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(CollectionUtils.equals(companyUser.getPassword(), companyUser.getConfirmPassword()), companyUser, CompanyUser.FIELD_ConfirmPassword, "passwordNotMatch", exceptions, true, request);
//to validate password
AttributeValidator passwordValidator = (AttributeValidator)(ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "PasswordValidator", null));
try
{
//execute if not null
if (passwordValidator != null)
{
passwordValidator.validate (null, secUser, "Password", companyUser.getPassword());
}
}
catch (FieldException e)
{
exceptions.addException(new FieldException(e, CompanyUser.FIELD_Password));
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
String nextPage = (String) request.getAttribute("nextPage");
Boolean socialLogin = (Boolean) request.getAttribute("socialLogin");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User", companyUser, secUser);
if(CollectionUtils.equals(companyUser.getPassword(), companyUser.getConfirmPassword()))
{
if(!company.isTrue(company.getIsVerified()) && CollectionUtils.equals(company.getAddedByUser(), companyUser))
{
process.setAttribute("Company", company);
process.setAttribute("socialLogin", socialLogin);
return new ProcessRedirectResult(nextPage, new String[0]);
}
else
{
nextPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request);
// Create company user in intercom
performa.intercom.resources.Company intercomCompany = IntercomUtils.findCompanyByID(company);
IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany);
}
if(!socialLogin)
{
secUser.setAttribute("md5:" + SecUser.FIELD_Password, companyUser.getPassword());
}
companyUser.setIsAccountVerified(Boolean.TRUE);
sendMail(companyUser, request);
request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Password resetted", companyUser, secUser);
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User finished", companyUser, secUser);
process.completeAndRestart();
return new ProcessRedirectResult(nextPage, new String[0]);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountCreatedEmailer"));
}
protected void sendMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from VerifyCompanyUserFP to :: ", companyUser);
Map defaultParams = CollectionUtils.EMPTY_MAP;
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent Account Created mail successfully from " + VerifyCompanyUserFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for CompanyUser :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ import oneit.servlets.forms.*; ...@@ -13,6 +13,7 @@ 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.intercom.utils.IntercomUtils;
import performa.orm.*; import performa.orm.*;
import performa.utils.Utils; import performa.utils.Utils;
...@@ -73,6 +74,9 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor ...@@ -73,6 +74,9 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor
candidate.setIsAccountVerified(Boolean.TRUE); candidate.setIsAccountVerified(Boolean.TRUE);
sendMail(candidate, request); sendMail(candidate, request);
// Create a applicant user in intercom
IntercomUtils.createIntercomUser(secUser, "Applicant", null);
request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser); request.getSession().setAttribute (SecUser.SEC_USER_ID, secUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE); request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
......
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Admin extends TypedData implements Replier {
private static final Map<String, String> SENTINEL = Maps.newHashMap();
public static final String TYPE_NOBODY = "nobody_admin";
// don't make public for now
static AdminCollection list(Map<String, String> params)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(params, "admins", AdminCollection.class);
}
public static AdminCollection list()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(SENTINEL, "admins", AdminCollection.class);
}
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "admin";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("email")
private String email;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("open")
private long open;
@JsonProperty("closed")
private long closed;
public Admin() {
}
@JsonIgnore
public String getReplyType() {
return getType() + "_reply";
}
public String getType() {
return type;
}
@JsonIgnore
public boolean isNobody() {
return TYPE_NOBODY.equalsIgnoreCase(getType());
}
@JsonIgnore
public boolean isSomebody() {
return (!isNobody()) && (getId() != null);
}
public String getId() {
return id;
}
public Admin setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public long getOpen() {
return open;
}
public long getClosed() {
return closed;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Admin admin = (Admin) o;
if (closed != admin.closed) return false;
if (createdAt != admin.createdAt) return false;
if (open != admin.open) return false;
if (updatedAt != admin.updatedAt) return false;
if (email != null ? !email.equals(admin.email) : admin.email != null) return false;
if (id != null ? !id.equals(admin.id) : admin.id != null) return false;
if (name != null ? !name.equals(admin.name) : admin.name != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(admin.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (int) (open ^ (open >>> 32));
result = 31 * result + (int) (closed ^ (closed >>> 32));
return result;
}
@Override
public String toString() {
return "Admin{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", email='" + email + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
"} " + super.toString();
}
}
package performa.intercom.resources;
import performa.intercom.resources.Admin;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AdminCollection extends TypedDataCollection<Admin> implements Iterator<Admin> {
protected TypedDataCollectionIterator<Admin> iterator;
public AdminCollection() {
type = "company.list";
iterator = new TypedDataCollectionIterator<Admin>(this);
}
@Override
public AdminCollection nextPage() {
return fetchNextPage(AdminCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("admins")
@Override
public List<Admin> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Admin next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AdminMessage extends TypedData {
@JsonProperty("type")
private final String type = "admin_message";
@JsonProperty("id")
private String id;
@JsonProperty("message_type")
private String messageType;
@JsonProperty("subject")
private String subject=""; // Set default to blank string so null pointer exception won't thrown if messageType = inapp and subject not set
@JsonProperty("body")
private String body;
@JsonProperty("template")
private String template="plain"; // Set default to plain so null pointer exception won't thrown if messageType = inapp and template not set
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("from")
private Admin admin;
@JsonProperty("to")
private User user;
public AdminMessage() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
@SuppressWarnings("UnusedReturnValue")
@VisibleForTesting
AdminMessage setId(String id) {
this.id = id;
return this;
}
public String getMessageType() {
return messageType;
}
public AdminMessage setMessageType(String messageType) {
this.messageType = messageType;
return this;
}
public String getSubject() {
return subject;
}
public AdminMessage setSubject(String subject) {
this.subject = subject;
return this;
}
public String getBody() {
return body;
}
public AdminMessage setBody(String body) {
this.body = body;
return this;
}
public String getTemplate() {
return template;
}
public AdminMessage setTemplate(String template) {
this.template = template;
return this;
}
public long getCreatedAt() {
return createdAt;
}
@SuppressWarnings("UnusedReturnValue")
public AdminMessage setCreatedAt(long createdAt) {
this.createdAt = createdAt;
return this;
}
public Admin getAdmin() {
return admin;
}
public AdminMessage setAdmin(Admin admin) {
this.admin = admin;
return this;
}
public User getUser() {
return user;
}
public AdminMessage setUser(User user) {
this.user = user;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AdminMessage message = (AdminMessage) o;
if (createdAt != message.createdAt) return false;
if (admin != null ? !admin.equals(message.admin) : message.admin != null) return false;
if (body != null ? !body.equals(message.body) : message.body != null) return false;
if (id != null ? !id.equals(message.id) : message.id != null) return false;
if (messageType != null ? !messageType.equals(message.messageType) : message.messageType != null) return false;
if (subject != null ? !subject.equals(message.subject) : message.subject != null) return false;
if (template != null ? !template.equals(message.template) : message.template != null) return false;
if (!type.equals(message.type)) return false;
//noinspection RedundantIfStatement
if (user != null ? !user.equals(message.user) : message.user != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (messageType != null ? messageType.hashCode() : 0);
result = 31 * result + (subject != null ? subject.hashCode() : 0);
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (template != null ? template.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (admin != null ? admin.hashCode() : 0);
result = 31 * result + (user != null ? user.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "AdminMessage{" +
"id='" + id + '\'' +
", messageType='" + messageType + '\'' +
", subject='" + subject + '\'' +
", body='" + body + '\'' +
", template='" + template + '\'' +
", createdAt=" + createdAt +
", admin=" + admin +
", user=" + user +
"} " + super.toString();
}
}
package performa.intercom.resources;
import performa.intercom.resources.Admin;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
class AdminMessageResponse extends TypedData {
@JsonProperty("id")
private String id;
@JsonProperty("message_type")
private String messageType;
@JsonProperty("subject")
private String subject;
@JsonProperty("body")
private String body;
@JsonProperty("template")
private String template;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("owner")
private Admin admin;
@JsonProperty("to")
private User user;
public AdminMessageResponse() {
}
public String getType() {
return "admin_message";
}
public String getId() {
return id;
}
public AdminMessageResponse setId(String id) {
this.id = id;
return this;
}
public String getMessageType() {
return messageType;
}
public AdminMessageResponse setMessageType(String messageType) {
this.messageType = messageType;
return this;
}
public String getSubject() {
return subject;
}
public AdminMessageResponse setSubject(String subject) {
this.subject = subject;
return this;
}
public String getBody() {
return body;
}
public AdminMessageResponse setBody(String body) {
this.body = body;
return this;
}
public String getTemplate() {
return template;
}
public AdminMessageResponse setTemplate(String template) {
this.template = template;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public AdminMessageResponse setCreatedAt(long createdAt) {
this.createdAt = createdAt;
return this;
}
public long getUpdatedAt() {
return updatedAt;
}
public AdminMessageResponse setUpdatedAt(long updatedAt) {
this.updatedAt = updatedAt;
return this;
}
public Admin getAdmin() {
return admin;
}
public AdminMessageResponse setAdmin(Admin admin) {
this.admin = admin;
return this;
}
public User getUser() {
return user;
}
public AdminMessageResponse setUser(User user) {
this.user = user;
return this;
}
}
package performa.intercom.resources;
import performa.intercom.resources.Admin;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AdminReply extends Reply<Admin> {
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
static class AdminStringReply {
private AdminReply reply;
public AdminStringReply(AdminReply reply) {
this.reply = reply;
}
@JsonProperty("type")
public String getType() {
return reply.getType();
}
@JsonProperty("message_type")
public String getMessageType() {
return reply.getMessageType();
}
@JsonProperty("body")
public String getBody() {
return reply.getBody();
}
@JsonProperty("admin_id")
public String getAdminID() {
return reply.getFrom().getId();
}
@JsonProperty("assignee_id")
public String getAssigneeID() {
return reply.getAssigneeID();
}
@JsonProperty("attachment_urls")
private String[] getAttachmentUrls() {
return reply.getAttachmentUrls();
}
}
@JsonProperty("assignee_id")
private String assigneeID;
public AdminReply(Admin admin) {
this.from = admin;
}
public Reply<Admin> setMessageType(String messageType) {
return setMessageReplyType(messageType);
}
public String getAssigneeID() {
return assigneeID;
}
public Reply<Admin> setAssigneeID(String assigneeID) {
this.assigneeID = assigneeID;
this.setMessageType(Conversation.MESSAGE_TYPE_ASSIGNMENT);
return this;
}
@Override
public String toString() {
return "AdminReply{} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Author extends TypedData {
@JsonProperty("type")
private String type;
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("email")
private String email;
@JsonProperty("user_id")
private String userId;
public Author() {
}
public String getType() {
return type;
}
@JsonIgnore
public boolean isUser() {
return "user".equalsIgnoreCase(getType());
}
@JsonIgnore
public boolean isAdmin() {
return "admin".equalsIgnoreCase(getType());
}
public String getId() {
return id;
}
public Author setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public Author setName(String name) {
this.name = name;
return this;
}
public String getEmail() {
return email;
}
public Author setEmail(String email) {
this.email = email;
return this;
}
public String getUserId() {
return userId;
}
public Author setUserId(String userId) {
this.userId = userId;
return this;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (userId != null ? userId.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Author author = (Author) o;
if (email != null ? !email.equals(author.email) : author.email != null) return false;
if (id != null ? !id.equals(author.id) : author.id != null) return false;
if (name != null ? !name.equals(author.name) : author.name != null) return false;
//noinspection RedundantIfStatement
if (userId != null ? !userId.equals(author.userId) : author.userId != null) return false;
return true;
}
@Override
public String toString() {
return "Author{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", email='" + email + '\'' +
", userId='" + userId + '\'' +
"} " + super.toString();
}
}
package performa.intercom.resources;
public class AuthorizationException extends IntercomException {
private static final long serialVersionUID = 2917082281352001861L;
public AuthorizationException(String message) {
super(message);
}
public AuthorizationException(String message, Throwable cause) {
super(message, cause);
}
public AuthorizationException(ErrorCollection errorCollection) {
super(errorCollection);
}
public AuthorizationException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.net.URI;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class Avatar extends TypedData {
@JsonProperty("type")
private final String type = "avatar";
@JsonProperty("image_url")
private URI imageURL;
Avatar() {
}
public String getType() {
return type;
}
public URI getImageURL() {
return imageURL;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Avatar avatar = (Avatar) o;
if (imageURL != null ? !imageURL.equals(avatar.imageURL) : avatar.imageURL != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(avatar.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (imageURL != null ? imageURL.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Avatar{" +
"type='" + type + '\'' +
", imageURL=" + imageURL +
"} " + super.toString();
}
}
package performa.intercom.resources;
public class ClientException extends IntercomException {
private static final long serialVersionUID = -2111295679006526646L;
public ClientException(String message) {
super(message);
}
public ClientException(String message, Throwable cause) {
super(message, cause);
}
public ClientException(ErrorCollection errorCollection) {
super(errorCollection);
}
public ClientException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Company extends TypedData {
private static final Map<String, String> SENTINEL = Maps.newHashMap();
public static Company find(String id) throws InvalidException, AuthorizationException {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("companies").path(id).build());
return resource.get(Company.class);
}
public static Company find(Map<String, String> params) throws InvalidException, AuthorizationException {
if (!params.containsKey("company_id") && !params.containsKey("name")) {
throw new InvalidException("a company find must include a company_id or name parameter");
}
return DataResource.find(params, "companies", Company.class);
}
public static Company create(Company company) throws InvalidException, AuthorizationException {
return update(company);
}
public static Company update(Company company) throws InvalidException, AuthorizationException {
// because the data is asymmetric on the plan field
final CompanyWithStringPlan entity = new CompanyWithStringPlan();
entity.setCompanyID(company.getCompanyID());
entity.setName(company.getName());
entity.setSessionCount(company.getSessionCount());
entity.setMonthlySpend(company.getMonthlySpend());
entity.setRemoteCreatedAt(company.getRemoteCreatedAt());
if(company.getCustomAttributes() != null) {
entity.getCustomAttributes().putAll(company.getCustomAttributes());
}
if(company.getPlan() !=null ) {
entity.setPlan(company.getPlan().getName());
}
return DataResource.update(entity, "companies", Company.class);
}
public static Company delete(String id) throws InvalidException, AuthorizationException {
return DataResource.delete(id, "companies", Company.class);
}
public static CompanyCollection list(Map<String, String> params) throws InvalidException, AuthorizationException {
return DataResource.list(params, "companies", CompanyCollection.class);
}
public static CompanyCollection list() throws InvalidException, AuthorizationException {
return DataResource.list(SENTINEL, "companies", CompanyCollection.class);
}
public static ScrollableCompanyCollection scroll()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.scroll(null, "companies", ScrollableCompanyCollection.class);
}
public static UserCollection listUsers(Map<String, String> params) throws InvalidException, AuthorizationException {
URI usersURI;
if (params.containsKey("company_id")) {
usersURI = UriBuilder.newBuilder()
.path("companies")
.query("company_id", params.get("company_id"))
.query("type", "users")
.build();
} else if (params.containsKey("id")) {
usersURI = UriBuilder.newBuilder()
.path("companies")
.path(params.get("id"))
.path("users")
.build();
} else {
throw new InvalidException("a company user list query must supply a company_id or id parameter");
}
final HttpClient resource = new HttpClient(usersURI);
return resource.get(UserCollection.class);
}
@SuppressWarnings("UnusedDeclaration")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonIgnoreProperties(ignoreUnknown = true)
public static class Plan extends TypedData {
@JsonProperty("type")
protected String type;
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
public Plan() {
type = "plan";
}
public Plan(String name) {
this();
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Plan plan = (Plan) o;
if (id != null ? !id.equals(plan.id) : plan.id != null) return false;
//noinspection RedundantIfStatement
if (name != null ? !name.equals(plan.name) : plan.name != null) return false;
return true;
}
@Override
public String toString() {
return "Plan{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
"} " + super.toString();
}
}
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "company";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("company_id")
private String companyID;
@JsonProperty("session_count")
private int sessionCount;
@JsonProperty("monthly_spend")
private float monthlySpend;
@JsonProperty("remote_created_at")
private long remoteCreatedAt;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("plan")
private Plan plan;
@JsonProperty("user_count")
private Integer userCount;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("segments")
private SegmentCollection segmentCollection = new SegmentCollection();
@JsonProperty("tags")
private TagCollection tagCollection = new TagCollection();
private Boolean untag;
public Company() {
}
public Company untag() {
untag = Boolean.TRUE;
return this;
}
public String getType() {
return type;
}
public String getId() {
return id;
}
@VisibleForTesting
Company setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public Company setName(String name) {
this.name = name;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public String getCompanyID() {
return companyID;
}
public Company setCompanyID(String companyID) {
this.companyID = companyID;
return this;
}
public int getSessionCount() {
return sessionCount;
}
/**
* Deprecated. The Intercom API does not support changing the
* session value for a company. Calling this method has no
* effect.
*
* @param sessionCount this value is ignored
* @return the company object
*/
@Deprecated
public Company setSessionCount(int sessionCount) {
return this;
}
public long getRemoteCreatedAt() {
return remoteCreatedAt;
}
public Company setRemoteCreatedAt(long remoteCreatedAt) {
this.remoteCreatedAt = remoteCreatedAt;
return this;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public Company setCustomAttributes(Map<String, CustomAttribute> customAttributes) {
this.customAttributes = customAttributes;
return this;
}
public Company addCustomAttribute(CustomAttribute customAttribute) {
this.customAttributes.put(customAttribute.getName(), customAttribute);
return this;
}
public Plan getPlan() {
return plan;
}
public Company setPlan(Plan plan) {
this.plan = plan;
return this;
}
public Integer getUserCount() {
return userCount;
}
public float getMonthlySpend() {
return monthlySpend;
}
public Company setMonthlySpend(float monthlySpend) {
this.monthlySpend = monthlySpend;
return this;
}
public SegmentCollection getSegmentCollection() {
return segmentCollection;
}
public TagCollection getTagCollection() {
return tagCollection;
}
boolean isUntag() {
return untag == null ? false : untag;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Company company = (Company) o;
if (createdAt != company.createdAt) return false;
if (Float.compare(company.monthlySpend, monthlySpend) != 0) return false;
if (remoteCreatedAt != company.remoteCreatedAt) return false;
if (sessionCount != company.sessionCount) return false;
if (updatedAt != company.updatedAt) return false;
if (companyID != null ? !companyID.equals(company.companyID) : company.companyID != null) return false;
if (customAttributes != null ? !customAttributes.equals(company.customAttributes) : company.customAttributes != null)
return false;
if (id != null ? !id.equals(company.id) : company.id != null) return false;
if (name != null ? !name.equals(company.name) : company.name != null) return false;
if (plan != null ? !plan.equals(company.plan) : company.plan != null) return false;
if (segmentCollection != null ? !segmentCollection.equals(company.segmentCollection) : company.segmentCollection != null)
return false;
if (tagCollection != null ? !tagCollection.equals(company.tagCollection) : company.tagCollection != null)
return false;
if (!type.equals(company.type)) return false;
if (untag != null ? !untag.equals(company.untag) : company.untag != null) return false;
//noinspection RedundantIfStatement
if (userCount != null ? !userCount.equals(company.userCount) : company.userCount != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (companyID != null ? companyID.hashCode() : 0);
result = 31 * result + sessionCount;
result = 31 * result + (monthlySpend != +0.0f ? Float.floatToIntBits(monthlySpend) : 0);
result = 31 * result + (int) (remoteCreatedAt ^ (remoteCreatedAt >>> 32));
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (plan != null ? plan.hashCode() : 0);
result = 31 * result + (userCount != null ? userCount.hashCode() : 0);
result = 31 * result + (customAttributes != null ? customAttributes.hashCode() : 0);
result = 31 * result + (segmentCollection != null ? segmentCollection.hashCode() : 0);
result = 31 * result + (tagCollection != null ? tagCollection.hashCode() : 0);
result = 31 * result + (untag != null ? untag.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Company{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", companyID='" + companyID + '\'' +
", sessionCount=" + sessionCount +
", monthlySpend=" + monthlySpend +
", remoteCreatedAt=" + remoteCreatedAt +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", plan=" + plan +
", customAttributes=" + customAttributes +
", segmentCollection=" + segmentCollection +
", tagCollection=" + tagCollection +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class CompanyCollection extends TypedDataCollection<Company> implements Iterator<Company> {
protected TypedDataCollectionIterator<Company> iterator;
@JsonProperty("total_count")
private long totalCount;
public CompanyCollection() {
type = "company.list";
iterator = new TypedDataCollectionIterator<Company>(this);
}
public CompanyCollection(List<Company> companies) {
this();
this.page = companies;
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("companies")
@Override
public List<Company> getPage() {
return super.getPage();
}
public long getTotalCount() {
return totalCount;
}
@Override
public CompanyCollection nextPage() {
return fetchNextPage(CompanyCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public Company next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
@Override
public String toString() {
return "CompanyCollection{" +
", totalCount=" + totalCount +
"} " + super.toString();
}
void addCompany(Company company) {
page.add(company);
}
}
package performa.intercom.resources;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import java.util.List;
class CompanyUpdateBuilder {
/**
* Provide restrictions on the company data that can be sent via a user update
*/
static List<CompanyWithStringPlan> buildUserUpdateCompanies(CompanyCollection add, CompanyCollection remove) {
final List<CompanyWithStringPlan> updatableCompanies = Lists.newArrayList();
if (add != null) {
final List<Company> companies = add.getPage();
for (Company company : companies) {
if (!isCompanyInList(company, remove)) {
updatableCompanies.add(prepareUpdatableCompany(company));
}
}
}
if (remove != null) {
final List<Company> companies = remove.getPage();
for (Company company : companies) {
updatableCompanies.add(prepareUpdatableCompany(company).setRemove(Boolean.TRUE));
}
}
return updatableCompanies;
}
private static boolean isCompanyInList(final Company company, CompanyCollection companyCollection) {
if (companyCollection == null) {
return false;
}
return Iterables.any(companyCollection.getPage(), new Predicate<Company>() {
@Override
public boolean apply(Company e) {
return Objects.equal(company.getCompanyID(), e.getCompanyID())
|| Objects.equal(company.getId(), e.getId());
}
});
}
private static CompanyWithStringPlan prepareUpdatableCompany(Company company) {
final CompanyWithStringPlan updatableCompany = new CompanyWithStringPlan();
updatableCompany.setId(company.getId());
updatableCompany.setCompanyID(company.getCompanyID());
updatableCompany.setName(company.getName());
updatableCompany.setSessionCount(company.getSessionCount());
updatableCompany.setMonthlySpend(company.getMonthlySpend());
updatableCompany.setRemoteCreatedAt(company.getRemoteCreatedAt());
if (company.getCustomAttributes() != null) {
updatableCompany.getCustomAttributes().putAll(company.getCustomAttributes());
}
if (company.getPlan() != null) {
updatableCompany.setPlan(company.getPlan().getName());
}
return updatableCompany;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonIgnoreProperties(ignoreUnknown = true)
class CompanyWithStringPlan extends TypedData {
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("company_id")
private String companyID;
@JsonProperty("session_count")
private int sessionCount;
@JsonProperty("monthly_spend")
private float monthlySpend;
@JsonProperty("remote_created_at")
private long remoteCreatedAt;
@JsonProperty("plan")
private String plan;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("remove")
@JsonInclude(JsonInclude.Include.NON_NULL)
private Boolean remove;
public CompanyWithStringPlan() {
}
public String getType() {
return "company";
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCompanyID() {
return companyID;
}
public void setCompanyID(String companyID) {
this.companyID = companyID;
}
public Integer getSessionCount() {
return sessionCount;
}
public void setSessionCount(Integer sessionCount) {
this.sessionCount = sessionCount;
}
public float getMonthlySpend() {
return monthlySpend;
}
public void setMonthlySpend(float monthlySpend) {
this.monthlySpend = monthlySpend;
}
public long getRemoteCreatedAt() {
return remoteCreatedAt;
}
public void setRemoteCreatedAt(long remoteCreatedAt) {
this.remoteCreatedAt = remoteCreatedAt;
}
public String getPlan() {
return plan;
}
public void setPlan(String plan) {
this.plan = plan;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public void setCustomAttributes(Map<String, CustomAttribute> customAttributes) {
this.customAttributes = customAttributes;
}
public Boolean getRemove() {
return remove;
}
public CompanyWithStringPlan setRemove(Boolean remove) {
this.remove = remove;
return this;
}
}
package performa.intercom.resources;
import com.google.common.collect.Lists;
class Conditions {
/**
* Ensures that an object reference passed as a parameter to the calling
* method is not null. Variant of Guava's Preconditions that returns an
* InvalidException containing an ErrorCollection
*
* @param reference an object reference
* @param errorMessage the exception message to use if the check fails
* @return the non-null reference that was validated
* @throws InvalidException if {@code reference} is null
*/
public static <T> T checkNotNull(T reference, String errorMessage) {
if (reference == null) {
throw new InvalidException(
new ErrorCollection(
Lists.newArrayList(
new Error("invalid", "item method must be supplied"))));
}
return reference;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class Contact extends TypedData implements Replier {
private static final Map<String, String> SENTINEL = Maps.newHashMap();
public static Contact findByID(String id)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return new HttpClient(contactURI(id)).get(Contact.class);
}
public static Contact findByUserID(String userID)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
final Map<String, String> params = Maps.newHashMap();
params.put("user_id", userID);
return DataResource.find(params, "contacts", Contact.class);
}
public static ContactCollection listByEmail(String email)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
final Map<String, String> params = Maps.newHashMap();
params.put("email", email);
return list(params);
}
public static ContactCollection list(Map<String, String> params)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(params, "contacts", ContactCollection.class);
}
public static ContactCollection list()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(SENTINEL, "contacts", ContactCollection.class);
}
public static ScrollableContactCollection scroll()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.scroll(null, "contacts", ScrollableContactCollection.class);
}
public static Contact create(Contact c)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.create(ContactUpdate.buildFrom(c), "contacts", Contact.class);
}
public static Contact update(Contact c)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.update(ContactUpdate.buildFrom(c), "contacts", Contact.class);
}
public static Contact delete(Contact c)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.delete(c.getID(), "contacts", Contact.class);
}
public static User convert(Contact c, User u)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.post(ContactConvertBuilder.buildConvert(c, u), convertURI(), User.class);
}
private static URI contactURI(String id) {
return UriBuilder.newBuilder().path("contacts").path(id).build();
}
private static URI convertURI() {
return UriBuilder.newBuilder().path("contacts").path("convert").build();
}
static class ContactConvertBuilder {
static ContactConvert buildConvert(Contact c, User u) throws InvalidException {
return new ContactConvertBuilder().build(c, u);
}
ContactConvert build(Contact c, User u) throws InvalidException {
return new ContactConvert(buildConvertContact(c), buildConvertUser(u));
}
HashMap<String, String> buildConvertUser(User u) {
final HashMap<String, String> convertUser = Maps.newHashMap();
if (u.getId() != null) {
convertUser.put("id", u.getId());
}
if (u.getUserId() != null) {
convertUser.put("user_id", u.getUserId());
}
if (u.getEmail() != null) {
convertUser.put("email", u.getEmail());
}
checkValidConvertContact(convertUser);
return convertUser;
}
void checkValidConvertContact(HashMap<String, String> convertUser) {
if ((!convertUser.containsKey("id")) && (!convertUser.containsKey("user_id")) && (!convertUser.containsKey("email"))) {
throw new InvalidException("a convert user must include at least one of, an id, user_id or email parameter");
}
}
HashMap<String, String> buildConvertContact(Contact c) {
final HashMap<String, String> convertContact = Maps.newHashMap();
if (c.getID() != null) {
convertContact.put("id", c.getID());
}
if (c.getUserID() != null) {
convertContact.put("user_id", c.getUserID());
}
checkValidConvertUser(convertContact);
return convertContact;
}
void checkValidConvertUser(HashMap<String, String> convertContact) {
if ((!convertContact.containsKey("id")) && (!convertContact.containsKey("user_id"))) {
throw new InvalidException("a convert contact must include at least one of, an id or a user_id parameter");
}
}
}
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
static class ContactConvert {
@JsonProperty("contact")
private Map<String, String> contact;
@JsonProperty("user")
private Map<String, String> user;
public ContactConvert() {
}
public ContactConvert(Map<String, String> contact, Map<String, String> user) {
this.contact = contact;
this.user = user;
}
public Map<String, String> getContact() {
return contact;
}
public void setContact(Map<String, String> contact) {
this.contact = contact;
}
public Map<String, String> getUser() {
return user;
}
public void setUser(Map<String, String> user) {
this.user = user;
}
}
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
static class ContactUpdate extends TypedData {
static ContactUpdate buildFrom(Contact c) {
final ContactUpdate contactUpdate = new ContactUpdate();
contactUpdate.id = c.getID(); // propagated, noset
contactUpdate.userID = c.getUserID(); // propagated, noset
contactUpdate.email = c.getEmail();
contactUpdate.phone = c.getPhone();
contactUpdate.name = c.getName();
contactUpdate.lastSeenIP = c.getLastSeenIP();
contactUpdate.customAttributes = c.getCustomAttributes();
contactUpdate.lastRequestAt = c.getLastRequestAt();
contactUpdate.unsubscribedFromEmails = c.getUnsubscribedFromEmails();
return contactUpdate;
}
@JsonProperty("type")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private String type;
@JsonProperty("id")
private String id;
@JsonProperty("user_id")
private String userID;
@JsonProperty("email")
private String email;
@JsonProperty("phone")
private String phone;
@JsonProperty("name")
private String name;
@JsonProperty("last_seen_ip")
private String lastSeenIP;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("last_seen_user_agent")
private String lastSeenUserAgent;
@JsonProperty("companies")
private List<CompanyWithStringPlan> companyCollection;
@JsonProperty("last_request_at")
private long lastRequestAt;
@JsonProperty("signed_up_at")
private long signedUpAt;
/*
* Making these Booleans allows us to send true or false as set
* values leaving null the ignored field for NON_DEFAULT. A
* primitive would result in false not being sent
*/
@JsonProperty("unsubscribed_from_emails")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean unsubscribedFromEmails;
@JsonProperty("update_last_request_at")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean updateLastRequestAt;
@JsonProperty("new_session")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean newSession;
public ContactUpdate() {
}
public String getType() {
return type;
}
public String getID() {
return id;
}
public String getUserID() {
return userID;
}
public String getEmail() {
return email;
}
public String getPhone() {
return phone;
}
public String getName() {
return name;
}
public String getLastSeenIP() {
return lastSeenIP;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public String getLastSeenUserAgent() {
return lastSeenUserAgent;
}
public List<CompanyWithStringPlan> getCompanyCollection() {
return companyCollection;
}
public long getLastRequestAt() {
return lastRequestAt;
}
public Boolean getUnsubscribedFromEmails() {
return unsubscribedFromEmails;
}
public Boolean isUpdateLastRequestAt() {
return updateLastRequestAt;
}
public Boolean isNewSession() {
return newSession;
}
}
@JsonProperty("type")
@JsonInclude(JsonInclude.Include.ALWAYS)
private final String type = "contact";
@JsonProperty("id")
private String id;
@JsonProperty("user_id")
private String userID;
@JsonProperty("email")
private String email;
@JsonProperty("phone")
private String phone;
@JsonProperty("name")
private String name;
@JsonProperty("pseudonym")
private String pseudonym;
@JsonProperty("avatar")
private Avatar avatar;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("unsubscribed_from_emails")
private Boolean unsubscribedFromEmails;
@JsonProperty("session_count")
private int sessionCount;
@JsonProperty("last_request_at")
private long lastRequestAt;
@JsonProperty("last_seen_ip")
private String lastSeenIP;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("user_agent_data")
private String userAgentData;
@JsonProperty("location_data")
private LocationData locationData;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("companies")
private CompanyCollection companyCollection = new CompanyCollection();
@JsonProperty("social_profiles")
private SocialProfileCollection socialProfileCollection = new SocialProfileCollection();
@JsonProperty("segments")
private SegmentCollection segmentCollection = new SegmentCollection();
@JsonProperty("tags")
private TagCollection tagCollection = new TagCollection();
@JsonProperty("update_last_request_at")
private Boolean updateLastRequestAt;
@JsonProperty("new_session")
private Boolean newSession;
private Boolean untag;
public Contact() {
}
public Contact untag() {
untag = Boolean.TRUE;
return this;
}
boolean isUntag() {
return untag == null ? false : untag;
}
@JsonIgnore
public String getReplyType() {
return getType() + "_reply";
}
public String getType() {
return type;
}
public String getID() {
return id;
}
@VisibleForTesting
Contact setID(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public Contact setName(String name) {
this.name = name;
return this;
}
public String getPseudonym() {
return pseudonym;
}
public String getEmail() {
return email;
}
public Contact setEmail(String email) {
this.email = email;
return this;
}
public String getPhone() {
return phone;
}
public Contact setPhone(String phone) {
this.phone = phone;
return this;
}
public String getUserID() {
return userID;
}
public Avatar getAvatar() {
return avatar;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public Boolean getUnsubscribedFromEmails() {
return unsubscribedFromEmails;
}
public Contact setUnsubscribedFromEmails(boolean unsubscribedFromEmails) {
this.unsubscribedFromEmails = unsubscribedFromEmails;
return this;
}
public int getSessionCount() {
return sessionCount;
}
public long getLastRequestAt() {
return lastRequestAt;
}
public Contact setLastRequestAt(long lastRequestAt) {
this.lastRequestAt = lastRequestAt;
return this;
}
public String getLastSeenIP() {
return lastSeenIP;
}
public Contact setLastSeenIP(String lastSeenIP) {
this.lastSeenIP = lastSeenIP;
return this;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public Contact setCustomAttributes(Map<String, CustomAttribute> customAttributes) {
this.customAttributes = customAttributes;
return this;
}
public Contact addCustomAttribute(CustomAttribute customAttribute) {
this.customAttributes.put(customAttribute.getName(), customAttribute);
return this;
}
public String getUserAgentData() {
return userAgentData;
}
public LocationData getLocationData() {
return locationData;
}
public CompanyCollection getCompanyCollection() {
return companyCollection;
}
public SocialProfileCollection getSocialProfileCollection() {
return socialProfileCollection;
}
public SegmentCollection getSegmentCollection() {
return segmentCollection;
}
public TagCollection getTagCollection() {
return tagCollection;
}
public Boolean isUpdateLastRequestAt() {
return updateLastRequestAt;
}
public Boolean isNewSession() {
return newSession;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Contact contact = (Contact) o;
if (createdAt != contact.createdAt) return false;
if (updatedAt != contact.updatedAt) return false;
if (sessionCount != contact.sessionCount) return false;
if (lastRequestAt != contact.lastRequestAt) return false;
if (!type.equals(contact.type)) return false;
if (id != null ? !id.equals(contact.id) : contact.id != null) return false;
if (name != null ? !name.equals(contact.name) : contact.name != null) return false;
if (email != null ? !email.equals(contact.email) : contact.email != null) return false;
if (phone != null ? !phone.equals(contact.phone) : contact.phone != null) return false;
if (userID != null ? !userID.equals(contact.userID) : contact.userID != null) return false;
if (avatar != null ? !avatar.equals(contact.avatar) : contact.avatar != null) return false;
if (unsubscribedFromEmails != null ? !unsubscribedFromEmails.equals(contact.unsubscribedFromEmails) : contact.unsubscribedFromEmails != null)
return false;
if (lastSeenIP != null ? !lastSeenIP.equals(contact.lastSeenIP) : contact.lastSeenIP != null) return false;
if (customAttributes != null ? !customAttributes.equals(contact.customAttributes) : contact.customAttributes != null)
return false;
if (userAgentData != null ? !userAgentData.equals(contact.userAgentData) : contact.userAgentData != null)
return false;
if (locationData != null ? !locationData.equals(contact.locationData) : contact.locationData != null)
return false;
if (companyCollection != null ? !companyCollection.equals(contact.companyCollection) : contact.companyCollection != null)
return false;
if (socialProfileCollection != null ? !socialProfileCollection.equals(contact.socialProfileCollection) : contact.socialProfileCollection != null)
return false;
if (segmentCollection != null ? !segmentCollection.equals(contact.segmentCollection) : contact.segmentCollection != null)
return false;
if (tagCollection != null ? !tagCollection.equals(contact.tagCollection) : contact.tagCollection != null)
return false;
if (updateLastRequestAt != null ? !updateLastRequestAt.equals(contact.updateLastRequestAt) : contact.updateLastRequestAt != null)
return false;
//noinspection SimplifiableIfStatement
if (newSession != null ? !newSession.equals(contact.newSession) : contact.newSession != null) return false;
return !(untag != null ? !untag.equals(contact.untag) : contact.untag != null);
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
result = 31 * result + (userID != null ? userID.hashCode() : 0);
result = 31 * result + (avatar != null ? avatar.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (unsubscribedFromEmails != null ? unsubscribedFromEmails.hashCode() : 0);
result = 31 * result + sessionCount;
result = 31 * result + (int) (lastRequestAt ^ (lastRequestAt >>> 32));
result = 31 * result + (lastSeenIP != null ? lastSeenIP.hashCode() : 0);
result = 31 * result + (customAttributes != null ? customAttributes.hashCode() : 0);
result = 31 * result + (userAgentData != null ? userAgentData.hashCode() : 0);
result = 31 * result + (locationData != null ? locationData.hashCode() : 0);
result = 31 * result + (companyCollection != null ? companyCollection.hashCode() : 0);
result = 31 * result + (socialProfileCollection != null ? socialProfileCollection.hashCode() : 0);
result = 31 * result + (segmentCollection != null ? segmentCollection.hashCode() : 0);
result = 31 * result + (tagCollection != null ? tagCollection.hashCode() : 0);
result = 31 * result + (updateLastRequestAt != null ? updateLastRequestAt.hashCode() : 0);
result = 31 * result + (newSession != null ? newSession.hashCode() : 0);
result = 31 * result + (untag != null ? untag.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Contact{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", name='" + name + '\'' +
", email='" + email + '\'' +
", phone='" + phone + '\'' +
", userID='" + userID + '\'' +
", avatar=" + avatar +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", unsubscribedFromEmails=" + unsubscribedFromEmails +
", sessionCount=" + sessionCount +
", lastRequestAt=" + lastRequestAt +
", lastSeenIP='" + lastSeenIP + '\'' +
", customAttributes=" + customAttributes +
", userAgentData='" + userAgentData + '\'' +
", locationData=" + locationData +
", companyCollection=" + companyCollection +
", socialProfileCollection=" + socialProfileCollection +
", segmentCollection=" + segmentCollection +
", tagCollection=" + tagCollection +
", updateLastRequestAt=" + updateLastRequestAt +
", newSession=" + newSession +
", untag=" + untag +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ContactCollection extends TypedDataCollection<Contact> implements Iterator<Contact> {
protected TypedDataCollectionIterator<Contact> iterator;
public ContactCollection() {
iterator = new TypedDataCollectionIterator<Contact>(this);
}
public ContactCollection(List<Contact> contacts) {
this();
this.page = contacts;
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("contacts")
@Override
public List<Contact> getPage() {
return super.getPage();
}
@Override
public ContactCollection nextPage() {
return fetchNextPage(ContactCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public Contact next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ContactMessage extends TypedMessage<Contact, ContactMessage> {
public ContactMessage() {
}
@Override
public String toString() {
return "ContactMessage{} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Conversation extends TypedData {
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
private static final List<String> DISPLAY_AS_FORMATS = Lists.newArrayList("plaintext", "html");
static final String MESSAGE_TYPE_ASSIGNMENT = "assignment";
static final String MESSAGE_TYPE_COMMENT = "comment";
static final String MESSAGE_TYPE_NOTE = "note";
static final String MESSAGE_TYPE_CLOSE = "close";
static final String MESSAGE_TYPE_OPEN = "open";
static final List<String> MESSAGE_TYPES = Lists.newArrayList(
MESSAGE_TYPE_ASSIGNMENT,
MESSAGE_TYPE_COMMENT,
MESSAGE_TYPE_NOTE,
MESSAGE_TYPE_CLOSE,
MESSAGE_TYPE_OPEN
);
public static Conversation find(String id) throws InvalidException, AuthorizationException {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("conversations").path(id).build());
return resource.get(Conversation.class);
}
public static ConversationCollection list() throws InvalidException, AuthorizationException {
return DataResource.list(SENTINEL, "conversations", ConversationCollection.class);
}
public static ConversationCollection list(Map<String, String> params) throws InvalidException, AuthorizationException {
validateListRequest(params);
return DataResource.list(params, "conversations", ConversationCollection.class);
}
public static Conversation reply(String id, UserReply reply) {
validateUserReplyRequest(reply);
final URI uri = UriBuilder.newBuilder()
.path("conversations")
.path(id)
.path("reply")
.build();
return new HttpClient(uri)
.post(Conversation.class, new UserReply.UserStringReply(reply));
}
public static Conversation reply(String id, AdminReply reply) {
validateAdminReplyRequest(reply);
final URI uri = UriBuilder.newBuilder()
.path("conversations")
.path(id)
.path("reply")
.build();
return new HttpClient(uri)
.post(Conversation.class, new AdminReply.AdminStringReply(reply));
}
public static UserMessage create(UserMessage message) {
return DataResource.create(message, "messages", UserMessage.class);
}
public static ContactMessage create(ContactMessage message) {
return DataResource.create(message, "messages", ContactMessage.class);
}
public static AdminMessage create(AdminMessage message) throws InvalidException {
if ((!message.getTemplate().equals("plain")) && (!message.getTemplate().equals("personal"))) {
throw new InvalidException("The template must be either personal or plain");
}
if ((!message.getMessageType().equals("email")) && (!message.getMessageType().equals("inapp"))) {
throw new InvalidException("The message type must be either email or inapp");
}
/*
the message api is asymmetric because reasons. this wraps the response
type so we only expose AdminMessage in the client surface
*/
final AdminMessageResponse adminMessageResponse =
DataResource.create(message, "messages", AdminMessageResponse.class);
AdminMessage response = new AdminMessage();
response.setAdmin(adminMessageResponse.getAdmin());
response.setBody(adminMessageResponse.getBody());
response.setCreatedAt(adminMessageResponse.getCreatedAt());
response.setId(adminMessageResponse.getId());
response.setMessageType(adminMessageResponse.getMessageType());
response.setSubject(adminMessageResponse.getSubject());
response.setTemplate(adminMessageResponse.getTemplate());
// user returns null
// response.setUser(adminMessageResponse.getFrom());
return response;
}
static void validateAdminReplyRequest(AdminReply reply) {
validateMessageType(reply);
if (reply.getAssigneeID() != null
&& !"assignment".equals(reply.getMessageType())) {
throw new InvalidException("an assignee id can be set only for a message type of assignment");
}
if (("note".equals(reply.getMessageType()) || "comment".equals(reply.getMessageType()))
&& (isNullOrBlank(reply.getBody()))
) {
throw new InvalidException("a comment or note reply must have a body");
}
}
static boolean isNullOrBlank(String s) {
return s == null || s.trim().length() == 0;
}
static void validateUserReplyRequest(UserReply reply) {
if (! "comment".equals(reply.getMessageType())) {
throw new InvalidException("a user reply must have a message type of comment");
}
}
static void validateMessageType(Reply reply) {
if(! MESSAGE_TYPES.contains(reply.getMessageType())) {
throw new InvalidException(
"A reply message type must be one of "
+ Joiner.on(", ").join(MESSAGE_TYPES));
}
}
static void validateListRequest(Map<String, String> params) {
if (!params.containsKey("type")) {
throw new InvalidException("a user or admin type must be supplied for a conversation query");
}
if (isAdminQuery(params)
&& !(params.containsKey("admin_id"))) {
throw new InvalidException("an admin_id must be supplied for an admin conversation query");
}
if (params.containsKey("display_as")) {
if (!DISPLAY_AS_FORMATS.contains(params.get("display_as"))) {
throw new InvalidException(
"A display_as parameter must have one of the values "
+ Joiner.on(", ").join(DISPLAY_AS_FORMATS));
}
}
if (isUserQuery(params)
&& (!params.containsKey("intercom_user_id")
&& !params.containsKey("user_id")
&& !params.containsKey("email"))) {
throw new InvalidException(
"One of intercom_user_id, user_id or email must be supplied for a user conversation query");
}
}
private static boolean isUserQuery(Map<String, String> params) {
return params.containsKey("type") && params.get("type").equals("user");
}
private static boolean isAdminQuery(Map<String, String> params) {
return params.containsKey("type") && params.get("type").equals("admin");
}
@JsonProperty("type")
private final String type = "conversation";
@JsonProperty("id")
private String id;
@JsonProperty("conversation_message")
private ConversationMessage conversationMessage;
@JsonProperty("user")
private User user;
@JsonProperty("assignee")
private Admin assignee;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("conversation_parts")
private ConversationPartCollection conversationPartCollection;
@JsonProperty("open")
private boolean open;
@JsonProperty("read")
private boolean read;
@JsonProperty("links")
private Map<String, URI> links;
public Conversation() {
}
public String getType() {
return type;
}
public Admin getCurrentAssignee() {
Admin assignee = null;
if (getAssignee() != null) {
assignee = getAssignee();
} else if (getMostRecentConversationPart() != null && getMostRecentConversationPart().getAssignedTo() != null) {
assignee = getMostRecentConversationPart().getAssignedTo();
}
return assignee;
}
public Optional<ConversationPart> getFirstConversationPart() {
return Optional.fromNullable(getConversationPartCollection().getPage().get(0));
}
public ConversationPart getMostRecentConversationPart() {
final ConversationPartCollection conversationParts = getConversationPartCollection();
final List<ConversationPart> items = conversationParts.getPage();
if (items.isEmpty()) {
return null;
} else {
return items.get(items.size() - 1);
}
}
public String getId() {
return id;
}
public ConversationMessage getConversationMessage() {
return conversationMessage;
}
public User getUser() {
return user;
}
public Admin getAssignee() {
return assignee;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public ConversationPartCollection getConversationPartCollection() {
if (conversationPartCollection == null) {
conversationPartCollection = find(this.getId()).getConversationPartCollection();
}
return conversationPartCollection;
}
public boolean getOpen() {
return open;
}
public boolean getRead() {
return read;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Conversation that = (Conversation) o;
if (createdAt != that.createdAt) return false;
if (open != that.open) return false;
if (read != that.read) return false;
if (updatedAt != that.updatedAt) return false;
if (assignee != null ? !assignee.equals(that.assignee) : that.assignee != null) return false;
if (conversationMessage != null ? !conversationMessage.equals(that.conversationMessage) : that.conversationMessage != null)
return false;
if (conversationPartCollection != null ? !conversationPartCollection.equals(that.conversationPartCollection) : that.conversationPartCollection != null)
return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (links != null ? !links.equals(that.links) : that.links != null) return false;
if (!type.equals(that.type)) return false;
//noinspection RedundantIfStatement
if (user != null ? !user.equals(that.user) : that.user != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (conversationMessage != null ? conversationMessage.hashCode() : 0);
result = 31 * result + (user != null ? user.hashCode() : 0);
result = 31 * result + (assignee != null ? assignee.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (conversationPartCollection != null ? conversationPartCollection.hashCode() : 0);
result = 31 * result + (open ? 1 : 0);
result = 31 * result + (read ? 1 : 0);
result = 31 * result + (links != null ? links.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Conversation{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", conversationMessage=" + conversationMessage +
", user=" + user +
", assignee=" + assignee +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", conversationPartCollection=" + conversationPartCollection +
", open=" + open +
", read=" + read +
", links=" + links +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationCollection extends TypedDataCollection<Conversation> implements Iterator<Conversation> {
protected TypedDataCollectionIterator<Conversation> iterator;
public ConversationCollection() {
type = "conversation.list";
iterator = new TypedDataCollectionIterator<Conversation>(this);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("conversations")
public List<Conversation> getPage() {
return super.getPage();
}
@Override
public ConversationCollection nextPage() {
return fetchNextPage(ConversationCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public Conversation next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationMessage extends TypedData {
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "conversation_message";
@JsonProperty
private String subject;
@JsonProperty
private String body;
@JsonProperty
private Author author;
public ConversationMessage() {
}
public String getType() {
return type;
}
public String getSubject() {
return subject;
}
public String getBody() {
return body;
}
public Author getAuthor() {
return author;
}
@Override
public int hashCode() {
int result = subject != null ? subject.hashCode() : 0;
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (author != null ? author.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConversationMessage that = (ConversationMessage) o;
if (author != null ? !author.equals(that.author) : that.author != null) return false;
if (body != null ? !body.equals(that.body) : that.body != null) return false;
//noinspection RedundantIfStatement
if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false;
return true;
}
@Override
public String toString() {
return "ConversationMessage{" +
"type='" + type + '\'' +
", subject='" + subject + '\'' +
", body='" + body + '\'' +
", author=" + author +
"} " + super.toString();
}
}
package performa.intercom.resources;
import performa.intercom.resources.Admin;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationPart extends TypedData {
@JsonProperty("type")
private final String type = "conversation_part";
@JsonProperty
private String id;
@JsonProperty("part_type")
private String partType;
@JsonProperty
private String body;
@JsonProperty
private Author author;
@JsonProperty("assigned_to")
private Admin assignedTo;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("notified_at")
private long NotifiedAt;
public ConversationPart() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public String getPartType() {
return partType;
}
public String getBody() {
return body;
}
public Author getAuthor() {
return author;
}
public Admin getAssignedTo() {
return assignedTo;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public long getNotifiedAt() {
return NotifiedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConversationPart that = (ConversationPart) o;
if (NotifiedAt != that.NotifiedAt) return false;
if (createdAt != that.createdAt) return false;
if (updatedAt != that.updatedAt) return false;
if (assignedTo != null ? !assignedTo.equals(that.assignedTo) : that.assignedTo != null) return false;
if (author != null ? !author.equals(that.author) : that.author != null) return false;
if (body != null ? !body.equals(that.body) : that.body != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (partType != null ? !partType.equals(that.partType) : that.partType != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(that.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (partType != null ? partType.hashCode() : 0);
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (author != null ? author.hashCode() : 0);
result = 31 * result + (assignedTo != null ? assignedTo.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (int) (NotifiedAt ^ (NotifiedAt >>> 32));
return result;
}
@Override
public String toString() {
return "ConversationPart{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", partType='" + partType + '\'' +
", body='" + body + '\'' +
", author=" + author +
", assignedTo=" + assignedTo +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", NotifiedAt=" + NotifiedAt +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationPartCollection extends TypedDataCollection<ConversationPart> {
public ConversationPartCollection() {
type = "conversation_part.list";
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("conversation_parts")
public List<ConversationPart> getPage() {
return super.getPage();
}
@Override
public ConversationPartCollection nextPage() {
return new ConversationPartCollection();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.TreeNode;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;
import java.util.Map;
class CountItemDeserializer extends StdDeserializer<Counts.CountItem> {
private static final long serialVersionUID = 8226175715446656115L;
public CountItemDeserializer() {
super(Counts.CountItem.class);
}
@Override
public Counts.CountItem deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
final TreeNode treeNode = jp.getCodec().readTree(jp);
final Map.Entry<String, JsonNode> next = ((ObjectNode) treeNode).fields().next();
return new Counts.CountItem(next.getKey(), next.getValue().asLong());
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
class CountItemSerializer extends StdSerializer<Counts.CountItem> {
public CountItemSerializer() {
super(Counts.CountItem.class);
}
@Override
public void serialize(Counts.CountItem value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
jgen.writeStartObject();
jgen.writeNumberField(value.getName(), value.getValue());
jgen.writeEndObject();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Counts {
static Counts countQuery(Map<String, String> query) {
final URI build = UriBuilder.newBuilder()
.path("counts")
.query(query)
.build();
final HttpClient resource = new HttpClient(build);
return resource.get(Counts.class);
}
public static Counts.Totals appTotals() throws InvalidException, AuthorizationException {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("counts").build());
return resource.get(Totals.class);
}
// public static Long userCount() throws InvalidException, AuthorizationException{
// final HashMap<String, String> params = Maps.newHashMap();
// params.put("type", "user");
// return countQuery(params).getUser().getUser();
// }
public static List<CountItem> userTags() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "user");
params.put("count", "tag");
return countQuery(params).getUser().getTags();
}
public static List<CountItem> userSegments() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "user");
params.put("count", "segment");
return countQuery(params).getUser().getSegments();
}
public static Counts.Conversation conversationTotals() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "conversation");
return countQuery(params).getConversation();
}
public static Counts.Conversation conversationAdmins() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "conversation");
params.put("count", "admin");
return countQuery(params).getConversation();
}
// public static Long companyCount() throws InvalidException, AuthorizationException{
// final HashMap<String, String> params = Maps.newHashMap();
// params.put("type", "company");
// return countQuery(params).getCompany().getCompanies();
// }
public static List<CountItem> companySegments() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "company");
params.put("count", "segment");
return countQuery(params).getCompany().getSegments();
}
public static List<CountItem> companyTags() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "company");
params.put("count", "tag");
return countQuery(params).getCompany().getTags();
}
public static List<CountItem> companyUsers() throws InvalidException, AuthorizationException {
final HashMap<String, String> params = Maps.newHashMap();
params.put("type", "company");
params.put("count", "user");
return countQuery(params).getCompany().getUsers();
}
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Totals {
@JsonProperty("company")
private CountItem company;
@JsonProperty("segment")
private CountItem segment;
@JsonProperty("tag")
private CountItem tag;
@JsonProperty("user")
private CountItem user;
public CountItem getCompany() {
return company;
}
public CountItem getSegment() {
return segment;
}
public CountItem getTag() {
return tag;
}
public CountItem getUser() {
return user;
}
@Override
public String toString() {
return "Totals{" +
"company=" + company +
", segment=" + segment +
", tag=" + tag +
", user=" + user +
'}';
}
}
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class CountItem {
private String name;
private long value;
public CountItem(String name, long value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public long getValue() {
return value;
}
@Override
public String toString() {
return "CountItem{" +
"name='" + name + '\'' +
", value=" + value +
'}';
}
}
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Conversation {
@JsonProperty("admin")
List<Admin> admins;
@JsonProperty("assigned")
private long assigned;
@JsonProperty("closed")
private long closed;
@JsonProperty("open")
private long open;
@JsonProperty("unassigned")
private long unassigned;
Conversation() {
}
public List<Admin> getAdmins() {
return admins;
}
public long getAssigned() {
return assigned;
}
public long getClosed() {
return closed;
}
public long getOpen() {
return open;
}
public long getUnassigned() {
return unassigned;
}
@Override
public String toString() {
return "Conversation{" +
"assigned=" + assigned +
", closed=" + closed +
", open=" + open +
", unassigned=" + unassigned +
", admins=" + admins +
'}';
}
}
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class User {
@JsonProperty("user")
private long user;
@JsonProperty("tag")
private List<CountItem> tags;
@JsonProperty("segment")
private List<CountItem> segments;
User() {
}
public long getUser() {
return user;
}
public List<CountItem> getTags() {
return tags;
}
public List<CountItem> getSegments() {
return segments;
}
@Override
public String toString() {
return "User{" +
"user=" + user +
", tags=" + tags +
", segments=" + segments +
'}';
}
}
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Company {
@JsonProperty("company")
private long companies;
@JsonProperty("tag")
private List<CountItem> tags;
@JsonProperty("user")
private List<CountItem> users;
@JsonProperty("segment")
private List<CountItem> segments;
Company() {
}
public long getCompanies() {
return companies;
}
public List<CountItem> getTags() {
return tags;
}
public List<CountItem> getUsers() {
return users;
}
public List<CountItem> getSegments() {
return segments;
}
@Override
public String toString() {
return "Company{" +
"companies=" + companies +
", tags=" + tags +
", users=" + users +
", segments=" + segments +
'}';
}
}
@JsonProperty("type")
private String type = "count";
@JsonProperty("company")
private Counts.Company company;
@JsonProperty("user")
private Counts.User user;
@JsonProperty("conversation")
private Counts.Conversation conversation;
public String getType() {
return type;
}
public Company getCompany() {
return company;
}
public User getUser() {
return user;
}
public Conversation getConversation() {
return conversation;
}
@Override
public String toString() {
return "Counts{" +
"type='" + type + '\'' +
", company=" + company +
", user=" + user +
", conversation=" + conversation +
'}';
}
}
package performa.intercom.resources;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.ArrayList;
@SuppressWarnings("UnusedDeclaration")
public class CustomAttribute<T> {
@SuppressWarnings("unchecked")
private static final ArrayList<? extends Class<? extends Serializable>> CLASSES = Lists.newArrayList(String.class, Long.class, Float.class, Double.class, Boolean.class, Integer.class);
public static StringAttribute newStringAttribute(String name, String value) {
return new StringAttribute(name, value);
}
public static BooleanAttribute newBooleanAttribute(String name, boolean value) {
return new BooleanAttribute(name, value);
}
public static DoubleAttribute newDoubleAttribute(String name, double value) {
return new DoubleAttribute(name, value);
}
public static LongAttribute newLongAttribute(String name, long value) {
return new LongAttribute(name, value);
}
public static IntegerAttribute newIntegerAttribute(String name, int value) {
return new IntegerAttribute(name, value);
}
public static FloatAttribute newFloatAttribute(String name, float value) {
return new FloatAttribute(name, value);
}
public static class StringAttribute extends CustomAttribute<String> {
private StringAttribute(String name, String value) {
super(name, value, String.class);
}
private StringAttribute(String name, String value, Class<String> clazz) {
super(name, value, clazz);
}
}
public static class BooleanAttribute extends CustomAttribute<Boolean> {
private BooleanAttribute(String name, boolean value) {
super(name, value, Boolean.class);
}
private BooleanAttribute(String name, boolean value, Class<Boolean> clazz) {
super(name, value, clazz);
}
}
public static class DoubleAttribute extends CustomAttribute<Double> {
private DoubleAttribute(String name, double value, Class<Double> clazz) {
super(name, value, clazz);
}
private DoubleAttribute(String name, double value) {
super(name, value, Double.class);
}
}
public static class FloatAttribute extends CustomAttribute<Float> {
private FloatAttribute(String name, float value, Class<Float> clazz) {
super(name, value, clazz);
}
private FloatAttribute(String name, float value) {
super(name, value, Float.class);
}
}
public static class IntegerAttribute extends CustomAttribute<Integer> {
private IntegerAttribute(String name, int value) {
super(name, value, Integer.class);
}
private IntegerAttribute(String name, int value, Class<Integer> clazz) {
super(name, value, clazz);
}
}
public static class LongAttribute extends CustomAttribute<Long> {
public LongAttribute(String name, long value, Class<Long> clazz) {
super(name, value, clazz);
}
public LongAttribute(String name, long value) {
super(name, value, Long.class);
}
}
private String name;
private T value;
private Class<T> clazz;
public CustomAttribute(String name, T value, Class<T> clazz) {
//noinspection SuspiciousMethodCalls
if (!CLASSES.contains(clazz)) {
throw new InvalidException(String.format("cannot accept class type [%s] for custom attribute", clazz.getName()));
}
this.name = name;
this.value = value;
this.clazz = clazz;
}
public Class<T> getValueClass() {
return clazz;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
public <C> C as(Class<C> c) {
//noinspection unchecked
return (C) getValue();
}
public long longValue() {
return as(Long.class);
}
public String textValue() {
return as(String.class);
}
public boolean booleanValue() {
return as(Boolean.class);
}
public float floatValue() {
return as(Float.class);
}
public double doubleValue() {
return as(Double.class);
}
public int integerValue() {
return as(Integer.class);
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (value != null ? value.hashCode() : 0);
result = 31 * result + (clazz != null ? clazz.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CustomAttribute that = (CustomAttribute) o;
if (clazz != null ? !clazz.equals(that.clazz) : that.clazz != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
//noinspection RedundantIfStatement
if (value != null ? !value.equals(that.value) : that.value != null) return false;
return true;
}
@Override
public String toString() {
return "CustomAttribute{" +
"name='" + name + '\'' +
", value=" + value +
", clazz=" + clazz +
'}';
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.JsonNodeType;
import com.fasterxml.jackson.databind.node.NumericNode;
import com.fasterxml.jackson.databind.node.ValueNode;
import java.io.IOException;
class CustomAttributeDeserializer extends StdDeserializer<CustomAttribute> {
private static final long serialVersionUID = 5069924730975394938L;
public CustomAttributeDeserializer() {
super(CustomAttribute.class);
}
@Override
public CustomAttribute deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
CustomAttribute cda = null;
final String currentName = jp.getParsingContext().getCurrentName();
final ObjectMapper mapper = (ObjectMapper) jp.getCodec();
final ValueNode vNode = mapper.readTree(jp);
if (vNode.asToken().isScalarValue()) {
if (vNode.getNodeType() == JsonNodeType.BOOLEAN) {
cda = new CustomAttribute<Boolean>(currentName, vNode.asBoolean(), Boolean.class);
} else if (vNode.getNodeType() == JsonNodeType.STRING) {
cda = new CustomAttribute<String>(currentName, vNode.asText(), String.class);
} else if (vNode.getNodeType() == JsonNodeType.NUMBER) {
final NumericNode nNode = (NumericNode) vNode;
if (currentName.endsWith("_at")) {
cda = new CustomAttribute<Long>(currentName, vNode.longValue(), Long.class);
} else if (nNode.isInt()) {
cda = new CustomAttribute<Integer>(currentName, vNode.intValue(), Integer.class);
} else if (nNode.isFloat()) {
cda = new CustomAttribute<Float>(currentName, vNode.floatValue(), Float.class);
} else if (nNode.isDouble()) {
cda = new CustomAttribute<Double>(currentName, vNode.doubleValue(), Double.class);
} else if (nNode.isLong()) {
cda = new CustomAttribute<Long>(currentName, vNode.longValue(), Long.class);
} else {
cda = new CustomAttribute<String>(currentName, vNode.asText(), String.class);
}
} else {
cda = new CustomAttribute<String>(currentName, vNode.asText(), String.class);
}
}
return cda;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
class CustomAttributeSerializer extends StdSerializer<CustomAttribute> {
public CustomAttributeSerializer() {
super(CustomAttribute.class);
}
@Override
public void serialize(CustomAttribute value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
// the field name has already been written
jgen.writeObject(value.getValue());
}
}
package performa.intercom.resources;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.List;
import java.util.Map;
abstract class DataResource {
@SuppressWarnings("SameParameterValue")
public static <T> T find(String id, String collectionPath, Class<T> c) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).path(id).build());
return resource.get(c);
}
public static <T> T find(Map<String, String> params, String collectionPath, Class<T> c) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).query(params).build());
return resource.get(c);
}
public static <T, R> R create(T entity, String collectionPath, Class<R> response) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).build());
return resource.post(response, entity);
}
public static <T, R> R create(T entity, List<String> paths, Class<R> response) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(paths).build());
return resource.post(response, entity);
}
public static <T, R> R update(T entity, String collectionPath, Class<R> response) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).build());
return resource.post(response, entity);
}
public static <T, R> R post(T entity, URI path, Class<R> response) {
final HttpClient resource = new HttpClient(path);
return resource.post(response, entity);
}
public static <T, R> R updatePut(T entity, URI collectionPath, Class<R> response) {
final HttpClient resource = new HttpClient(collectionPath);
return resource.put(response, entity);
}
@SuppressWarnings("SameParameterValue")
public static <T, R> R update(T entity, String collectionPath, String id, Class<R> response) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).path(id).build());
return resource.post(response, entity);
}
public static <T> T delete(String id, String collectionPath, Class<T> c) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).path(id).build());
return resource.delete(c);
}
public static <C> C list(Map<String, String> params, String collectionPath, Class<C> c) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).query(params).build());
return resource.get(c);
}
public static <C> C scroll(String scrollParam, String collectionPath, Class<C> c) {
Map<String, String> params = Maps.newHashMap();
if (!Strings.isNullOrEmpty(scrollParam)) {
params.put("scroll_param", scrollParam);
}
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath + "/scroll").query(params).build());
return resource.get(c);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Error extends TypedData {
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "error";
@JsonProperty("code")
private String code;
@JsonProperty("message")
private String message;
public Error() {
}
public Error(String code, String message) {
this.code = code;
this.message = message;
}
public String getType() {
return type;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public int hashCode() {
int result = code != null ? code.hashCode() : 0;
result = 31 * result + (message != null ? message.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Error error = (Error) o;
if (code != null ? !code.equals(error.code) : error.code != null) return false;
//noinspection RedundantIfStatement
if (message != null ? !message.equals(error.message) : error.message != null) return false;
return true;
}
@Override
public String toString() {
return getType() + "{" +
"code='" + code + '\'' +
", message='" + message + '\'' +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public final class ErrorCollection {
@JsonProperty("errors")
private List<Error> errors;
// for jackson
ErrorCollection() {
}
public ErrorCollection(List<Error> errors) {
Preconditions.checkNotNull(errors, "cannot create an error collection with a null error list");
Preconditions.checkArgument(errors.size() > 0, "cannot create an error collection with an empty error list");
this.errors = errors;
}
public List<Error> getErrors() {
return errors;
}
public String getType() {
return "error.list";
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class Event extends TypedData {
private static final List<String> BULK_METHODS = Lists.newArrayList("post");
private static final ArrayList<String> BULK_PATHS = Lists.newArrayListWithExpectedSize(2);
static {
BULK_PATHS.add("bulk");
BULK_PATHS.add("events");
}
public static void create(Event event) throws InvalidException, AuthorizationException {
validateCreateEvent(event);
if (event.getCreatedAt() == 0L) {
event.setCreatedAt(System.currentTimeMillis() / 1000);
}
DataResource.create(event, "events", Void.class);
}
public static Job submit(List<JobItem<Event>> items)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return submit(items, null);
}
public static Job submit(List<JobItem<Event>> items, Job job)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return Job.submit(validateJobItems(items), job, BULK_PATHS);
}
public static JobItemCollection<Event> listJobErrorFeed(String jobID)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return Job.listJobErrorFeed(jobID, Event.class);
}
@VisibleForTesting
static List<JobItem<Event>> validateJobItems(List<JobItem<Event>> items) {
final JobSupport jobSupport = new JobSupport();
for (JobItem<Event> item : items) {
jobSupport.validateJobItem(item, BULK_METHODS);
validateCreateEvent(item.getData());
}
return items;
}
private static final ErrorCollection INVALID_NAME = new ErrorCollection(
Lists.newArrayList(
new Error("invalid", "an event must supply an event name")));
private static final ErrorCollection INVALID_USER = new ErrorCollection(
Lists.newArrayList(
new Error("invalid", "an event must supply either an email or a user id")));
@VisibleForTesting
static void validateCreateEvent(Event event) {
if (Strings.isNullOrEmpty(event.getEventName())) {
throw new InvalidException(INVALID_NAME);
}
if (Strings.isNullOrEmpty(event.getUserID())
&& Strings.isNullOrEmpty(event.getEmail())) {
throw new InvalidException(INVALID_USER);
}
}
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "event";
@JsonProperty("event_name")
private String eventName;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("email")
private String email;
@JsonProperty("user_id")
private String userID;
@JsonProperty("metadata")
private Map<String, Object> metadata = Maps.newHashMap();
public Event() {
}
public String getType() {
return type;
}
public String getEventName() {
return eventName;
}
public Event setEventName(String eventName) {
this.eventName = eventName;
return this;
}
public long getCreatedAt() {
return createdAt;
}
@SuppressWarnings("UnusedReturnValue")
public Event setCreatedAt(long createdAt) {
this.createdAt = createdAt;
return this;
}
public String getEmail() {
return email;
}
public Event setEmail(String email) {
this.email = email;
return this;
}
public String getUserID() {
return userID;
}
public Event setUserID(String userID) {
this.userID = userID;
return this;
}
public Event putMetadata(String name, String value) {
metadata.put(name, value);
return this;
}
public Event putMetadata(String name, boolean value) {
metadata.put(name, value);
return this;
}
public Event putMetadata(String name, int value) {
metadata.put(name, value);
return this;
}
public Event putMetadata(String name, double value) {
metadata.put(name, value);
return this;
}
public Event putMetadata(String name, long value) {
metadata.put(name, value);
return this;
}
public Event putMetadata(String name, float value) {
metadata.put(name, value);
return this;
}
public Map<String, Object> getMetadata() {
return metadata;
}
public Event setMetadata(Map<String, Object> metadata) {
this.metadata = metadata;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Event event = (Event) o;
if (createdAt != event.createdAt) return false;
if (email != null ? !email.equals(event.email) : event.email != null) return false;
if (eventName != null ? !eventName.equals(event.eventName) : event.eventName != null) return false;
if (metadata != null ? !metadata.equals(event.metadata) : event.metadata != null) return false;
if (!type.equals(event.type)) return false;
//noinspection RedundantIfStatement
if (userID != null ? !userID.equals(event.userID) : event.userID != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (eventName != null ? eventName.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (userID != null ? userID.hashCode() : 0);
result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Event{" +
"type='" + type + '\'' +
", eventName='" + eventName + '\'' +
", createdAt=" + createdAt +
", email='" + email + '\'' +
", userID='" + userID + '\'' +
", metadata=" + metadata +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.CharStreams;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
class HttpClient {
private static final Logger logger = LoggerFactory.getLogger("intercom-java");
private static final String CLIENT_AGENT_DETAILS = clientAgentDetails();
private static final String USER_AGENT = Intercom.USER_AGENT;
private static final String UTF_8 = "UTF-8";
private static final String APPLICATION_JSON = "application/json";
public static final String RATE_LIMIT_HEADER = "X-RateLimit-Limit";
public static final String RATE_LIMIT_REMAINING_HEADER = "X-RateLimit-Remaining";
public static final String RATE_LIMIT_RESET_HEADER = "X-RateLimit-Reset";
private static String clientAgentDetails() {
final HashMap<String, String> map = Maps.newHashMap();
final ArrayList<String> propKeys = Lists.newArrayList(
"os.arch", "os.name", "os.version",
"user.language", "user.timezone",
"java.class.version", "java.runtime.version", "java.version",
"java.vm.name", "java.vm.vendor", "java.vm.version");
for (String propKey : propKeys) {
map.put(propKey, System.getProperty(propKey));
}
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
MapperSupport.objectMapper().disable(SerializationFeature.INDENT_OUTPUT).writeValue(baos, map);
} catch (IOException e) {
logger.warn(String.format("could not serialize client agent details [%s]", e.getMessage()), e);
}
return baos.toString();
}
private final ObjectMapper objectMapper;
private final URI uri;
private final Map<String, String> headers;
private final HttpConnectorSupplier connection = Intercom.getHttpConnectorSupplier();
public HttpClient(URI uri) {
this(uri, Maps.<String, String>newHashMap());
}
private HttpClient(URI uri, Map<String, String> headers) {
this.uri = uri;
this.headers = headers;
this.objectMapper = MapperSupport.objectMapper();
}
public <T> T get(Class<T> reqres) throws IntercomException {
return get(getJavaType(reqres));
}
<T> T get(JavaType responseType) throws IntercomException {
return executeHttpMethod("GET", null, responseType);
}
public <T> T delete(Class<T> reqres) {
return executeHttpMethod("DELETE", null, getJavaType(reqres));
}
public <T, E> T put(Class<T> reqres, E entity) {
headers.put("Content-Type", APPLICATION_JSON);
return executeHttpMethod("PUT", (E) entity, getJavaType(reqres));
}
public <T, E> T post(Class<T> reqres, E entity) {
headers.put("Content-Type", APPLICATION_JSON);
return executeHttpMethod("POST", entity, getJavaType(reqres));
}
private <T, E> T executeHttpMethod(String method, E entity, JavaType responseType) {
HttpURLConnection conn = null;
try {
conn = initializeConnection(uri, method);
if(entity != null) {
prepareRequestEntity(entity, conn);
}
return runRequest(uri, responseType, conn);
} catch (IOException e) {
return throwLocalException(e);
} finally {
IOUtils.disconnectQuietly(conn);
}
}
private <T> JavaType getJavaType(Class<T> reqres) {
return objectMapper.getTypeFactory().constructType(reqres);
}
// trick java with a dummy return
private <T> T throwLocalException(IOException e) {
throw new IntercomException(String.format("Local exception calling [%s]. Check connectivity and settings. [%s]", uri.toASCIIString(), e.getMessage()), e);
}
private void prepareRequestEntity(Object entity, HttpURLConnection conn) throws IOException {
conn.setDoOutput(true);
OutputStream stream = null;
try {
stream = conn.getOutputStream();
if (logger.isDebugEnabled()) {
logger.info(String.format("api server request --\n%s\n-- ", objectMapper.writeValueAsString(entity)));
}
objectMapper.writeValue(stream, entity);
} finally {
IOUtils.closeQuietly(stream);
}
}
private HttpURLConnection initializeConnection(URI uri, String method) throws IOException {
HttpURLConnection conn = connection.connect(uri);
conn.setRequestMethod(method);
conn = prepareConnection(conn);
conn = applyHeaders(conn);
return conn;
}
private <T> T runRequest(URI uri, JavaType javaType, HttpURLConnection conn) throws IOException {
conn.connect();
final int responseCode = conn.getResponseCode();
if (responseCode >= 200 && responseCode < 300) {
return handleSuccess(javaType, conn, responseCode);
} else {
return handleError(uri, conn, responseCode);
}
}
private <T> T handleError(URI uri, HttpURLConnection conn, int responseCode) throws IOException {
ErrorCollection errors;
try {
errors = objectMapper.readValue(conn.getErrorStream(), ErrorCollection.class);
} catch (IOException e) {
errors = createUnprocessableErrorResponse(e);
}
if (logger.isDebugEnabled()) {
logger.debug("error json follows --\n{}\n-- ", objectMapper.writeValueAsString(errors));
}
return throwException(responseCode, errors, conn);
}
private <T> T handleSuccess(JavaType javaType, HttpURLConnection conn, int responseCode) throws IOException {
if (shouldSkipResponseEntity(javaType, conn, responseCode)) {
return null;
} else {
return readEntity(conn, responseCode, javaType);
}
}
private boolean shouldSkipResponseEntity(JavaType javaType, HttpURLConnection conn, int responseCode) {
return responseCode == 204 || Void.class.equals(javaType.getRawClass()) || "DELETE".equals(conn.getRequestMethod());
}
private <T> T readEntity(HttpURLConnection conn, int responseCode, JavaType javaType) throws IOException {
final InputStream entityStream = conn.getInputStream();
try {
if (logger.isDebugEnabled()) {
final String text = CharStreams.toString(new InputStreamReader(entityStream));
logger.debug("api server response status[{}] --\n{}\n-- ", responseCode, text);
return objectMapper.readValue(text, javaType);
} else {
return objectMapper.readValue(entityStream, javaType);
}
} finally {
IOUtils.closeQuietly(entityStream);
}
}
private <T> T throwException(int responseCode, ErrorCollection errors, HttpURLConnection conn) {
// bind some well known response codes to exceptions
if (responseCode == 403 || responseCode == 401) {
throw new AuthorizationException(errors);
} else if (responseCode == 429) {
throw new RateLimitException(errors, Ints.tryParse(conn.getHeaderField(RATE_LIMIT_HEADER)),
Ints.tryParse(conn.getHeaderField(RATE_LIMIT_REMAINING_HEADER)),
Longs.tryParse(conn.getHeaderField(RATE_LIMIT_RESET_HEADER)));
} else if (responseCode == 404) {
throw new NotFoundException(errors);
} else if (responseCode == 422) {
throw new InvalidException(errors);
} else if (responseCode == 400 || responseCode == 405 || responseCode == 406) {
throw new ClientException(errors);
} else if (responseCode == 500 || responseCode == 503) {
throw new ServerException(errors);
} else {
throw new IntercomException(errors);
}
}
private HttpURLConnection applyHeaders(HttpURLConnection conn) {
for (Map.Entry<String, String> entry : createHeaders().entrySet()) {
conn.setRequestProperty(entry.getKey(), entry.getValue());
}
for (Map.Entry<String, String> entry : createAuthorizationHeaders().entrySet()) {
conn.setRequestProperty(entry.getKey(), entry.getValue());
}
return conn;
}
// todo: expose this config
private HttpURLConnection prepareConnection(HttpURLConnection conn) {
conn.setConnectTimeout(Intercom.getConnectionTimeout());
conn.setReadTimeout(Intercom.getRequestTimeout());
conn.setUseCaches(Intercom.isRequestUsingCaches());
return conn;
}
private Map<String, String> createAuthorizationHeaders() {
switch (Intercom.getAuthKeyType()) {
case API_KEY:
headers.put("Authorization", "Basic " + generateAuthString(Intercom.getAppID(),Intercom.getApiKey()));
break;
case TOKEN:
headers.put("Authorization", "Basic " + generateAuthString(Intercom.getToken(),""));
break;
}
return headers;
}
private String generateAuthString(String username, String password) {
return Base64.encodeBase64String((username + ":" + password).getBytes());
}
private Map<String, String> createHeaders() {
headers.put("User-Agent", USER_AGENT);
headers.put("X-Client-Platform-Details", CLIENT_AGENT_DETAILS);
headers.put("Accept-Charset", UTF_8);
headers.put("Accept", APPLICATION_JSON);
return headers;
}
private ErrorCollection createUnprocessableErrorResponse(IOException e) {
ErrorCollection errors;
final long grepCode = getGrepCode();
final String msg = String.format("could not parse error response: [%s]", e.getLocalizedMessage());
logger.error(String.format("[%016x] %s", grepCode, msg), e);
Error err = new Error("unprocessable_entity", String.format("%s logged with code [%016x]", msg, grepCode));
errors = new ErrorCollection(Lists.newArrayList(err));
return errors;
}
private long getGrepCode() {
return ThreadLocalRandom.current().nextLong();
}
}
package performa.intercom.resources;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
public interface HttpConnectorSupplier {
HttpURLConnection connect(URI uri) throws IOException;
HttpConnectorSupplier defaultSupplier = new HttpConnectorSupplier() {
public HttpURLConnection connect(URI uri) throws IOException {
return (HttpURLConnection) uri.toURL().openConnection();
}
};
}
package performa.intercom.resources;
import org.slf4j.LoggerFactory;
import java.io.Closeable;
import java.net.HttpURLConnection;
class IOUtils {
private static final org.slf4j.Logger logger = LoggerFactory.getLogger("intercom-java");
/**
* Close a HttpURLConnection, ignores checked Exceptions and nulls,
* but rethrows RuntimeExceptions.
*
* @param connection the connection to disconnect
*/
public static void disconnectQuietly(HttpURLConnection connection) {
if (connection != null) {
try {
connection.disconnect();
} catch (RuntimeException rethrow) {
throw rethrow;
} catch (Exception e) {
logger.warn(e.getMessage());
}
}
}
/**
* Close a stream, ignores checked Exceptions and nulls,
* but rethrows RuntimeExceptions.
*
* @param stream the object to close
*/
public static void closeQuietly(Closeable stream) {
if (stream != null) {
try {
stream.close();
} catch (RuntimeException rethrow) {
throw rethrow;
} catch (Exception e) {
logger.warn(e.getMessage());
}
}
}
}
package performa.intercom.resources;
import java.net.URI;
public class Intercom {
private static final URI API_BASE_URI = URI.create("https://api.intercom.io/");
private static volatile URI apiBaseURI = API_BASE_URI;
private static volatile AuthKeyType authKeyType = AuthKeyType.API_KEY;
enum AuthKeyType {
API_KEY,
TOKEN
}
private static final String VERSION = "2.2.7";
public static final String USER_AGENT = "intercom-java/" + Intercom.VERSION;
private static volatile String apiKey;
private static volatile String token;
private static volatile String appID;
private static volatile int connectionTimeout = 3 * 1000;
private static volatile int requestTimeout = 60 * 1000;
private static volatile boolean requestUsingCaches = false;
private static volatile HttpConnectorSupplier httpConnectorSupplier = HttpConnectorSupplier.defaultSupplier;
public static long currentTimestamp() {
return System.currentTimeMillis()/1000;
}
public static int getConnectionTimeout() {
return connectionTimeout;
}
@SuppressWarnings("UnusedDeclaration")
public static void setConnectionTimeout(int connectionTimeout) {
Intercom.connectionTimeout = connectionTimeout;
}
public static int getRequestTimeout() {
return requestTimeout;
}
@SuppressWarnings("UnusedDeclaration")
public static void setRequestTimeout(int requestTimeout) {
Intercom.requestTimeout = requestTimeout;
}
public static boolean isRequestUsingCaches() {
return requestUsingCaches;
}
public static void setRequestUsingCaches(boolean requestUsingCaches) {
Intercom.requestUsingCaches = requestUsingCaches;
}
public static HttpConnectorSupplier getHttpConnectorSupplier() {
return httpConnectorSupplier;
}
public static void setHttpConnectorSupplier(HttpConnectorSupplier supplier) {
Intercom.httpConnectorSupplier = supplier;
}
public static String getAppID() {
return appID;
}
public static void setAppID(String appID) {
Intercom.appID = appID;
}
public static void setToken(String token) {
authKeyType = AuthKeyType.TOKEN;
Intercom.token = token;
}
public static String getApiKey() {
return Intercom.apiKey;
}
public static void setApiKey(String apiKey) {
authKeyType = AuthKeyType.API_KEY;
Intercom.apiKey = apiKey;
}
public static URI getApiBaseURI() {
return Intercom.apiBaseURI;
}
public static void setApiBaseURI(URI apiBaseURI) {
Intercom.apiBaseURI = apiBaseURI;
}
static AuthKeyType getAuthKeyType() {
return authKeyType;
}
public static String getToken() {
return token;
}
}
package performa.intercom.resources;
public class IntercomException extends RuntimeException {
private static final long serialVersionUID = -2723350106062183796L;
private ErrorCollection errorCollection;
@SuppressWarnings("WeakerAccess")
public IntercomException(String message) {
super(message);
}
public IntercomException(String message, Throwable cause) {
super(message, cause);
}
public IntercomException(ErrorCollection errorCollection) {
this(getMessage(errorCollection));
this.errorCollection = errorCollection;
}
public static String getMessage(ErrorCollection errorCollection) {
String message = "Could not read error message from server";
if(errorCollection!=null
&& errorCollection.getErrors() != null
&& errorCollection.getErrors().size() > 0
&& errorCollection.getErrors().get(0) != null
&& errorCollection.getErrors().get(0).getMessage() != null){
message = errorCollection.getErrors().get(0).getMessage();
}
return message;
}
@SuppressWarnings("WeakerAccess")
public IntercomException(ErrorCollection errorCollection, Throwable cause) {
this(getMessage(errorCollection), cause);
this.errorCollection = errorCollection;
}
public ErrorCollection getErrorCollection() {
return errorCollection;
}
public Error getFirstError() {
return errorCollection.getErrors().get(0);
}
}
package performa.intercom.resources;
public class InvalidException extends IntercomException {
private static final long serialVersionUID = -2111295679006526646L;
public InvalidException(String message) {
super(message);
}
public InvalidException(String message, Throwable cause) {
super(message, cause);
}
public InvalidException(ErrorCollection errorCollection) {
super(errorCollection);
}
public InvalidException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class Job extends TypedData {
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
public static Job find(String id)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return find(id, SENTINEL);
}
public static Job find(String id, Map<String, String> params)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return new HttpClient(
UriBuilder.newBuilder().path("jobs").path(id).query(params).build()
).get(Job.class);
}
public static Job update(Job job)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.post(
job,
UriBuilder.newBuilder().path("jobs").path(job.getID()).build(),
Job.class);
}
static <T extends TypedData> Job submit(List<JobItem<T>> items, List<String> bulkPaths)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return submit(items, null, bulkPaths);
}
static <T extends TypedData> Job submit(List<JobItem<T>> items, Job job, List<String> bulkPaths)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.create(new JobItemRequest<T>(items, job), bulkPaths, Job.class);
}
static <T extends TypedData> JobItemCollection<T> listJobErrorFeed(String jobID, Class<T> c)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
final URI feedURI = UriBuilder.newBuilder()
.path("jobs")
.path(jobID)
.path("error")
.build();
final HttpClient resource = new HttpClient(feedURI);
final TypeReference<JobItemCollection<T>> typeReference =
new TypeReference<JobItemCollection<T>>() {
};
final JavaType type = MapperSupport
.objectMapper()
.getTypeFactory()
.constructParametricType(JobItemCollection.class, c);
return resource.get(type);
}
@JsonProperty("type")
private final String type = "job";
@JsonProperty("id")
private String id;
@JsonProperty("app_id")
private String appID;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("completed_at")
private long completedAt;
@JsonProperty("closing_at")
private long closingAt;
@JsonProperty("name")
private String name;
@JsonProperty("state")
private String state;
@JsonProperty("tasks")
private List<JobTask> tasks;
@JsonProperty("links")
private Map<String, URI> links;
public Job() {
}
public String getType() {
return type;
}
public String getID() {
return id;
}
public Job setID(String id) {
this.id = id;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public long getCompletedAt() {
return completedAt;
}
public String getName() {
return name;
}
public Job setName(String name) {
this.name = name;
return this;
}
public String getState() {
return state;
}
public String getAppID() {
return appID;
}
public Map<String, URI> getLinks() {
return links;
}
public long getClosingAt() {
return closingAt;
}
public Job setClosingAt(long closingAt) {
this.closingAt = closingAt;
return this;
}
public List<JobTask> getTasks() {
return tasks;
}
@Override
public String toString() {
return "Job{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", appID='" + appID + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", completedAt=" + completedAt +
", name='" + name + '\'' +
", state='" + state + '\'' +
", links=" + links +
"} " + super.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Job job = (Job) o;
if (createdAt != job.createdAt) return false;
if (updatedAt != job.updatedAt) return false;
if (completedAt != job.completedAt) return false;
//noinspection ConstantConditions
if (type != null ? !type.equals(job.type) : job.type != null) return false;
if (id != null ? !id.equals(job.id) : job.id != null) return false;
if (appID != null ? !appID.equals(job.appID) : job.appID != null) return false;
if (name != null ? !name.equals(job.name) : job.name != null) return false;
//noinspection SimplifiableIfStatement
if (state != null ? !state.equals(job.state) : job.state != null) return false;
return !(links != null ? !links.equals(job.links) : job.links != null);
}
@Override
public int hashCode() {
@SuppressWarnings("ConstantConditions") int result = type != null ? type.hashCode() : 0;
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (appID != null ? appID.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (int) (completedAt ^ (completedAt >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (links != null ? links.hashCode() : 0);
return result;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class JobItem<T extends TypedData> extends TypedData {
@JsonProperty("type")
private final String type = "job_item";
@JsonProperty("id")
private String id;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("method")
private String method;
@JsonProperty("data_type")
private String dataType;
@JsonProperty("error")
private Error error;
@JsonProperty("data")
private T data;
public JobItem() {
}
public JobItem(String method, T data) {
this(method, data, null);
}
JobItem(String method, T data, String dataType) {
Conditions.checkNotNull(method, "item method must be supplied");
Conditions.checkNotNull(data, "item data must be supplied");
this.method = method;
this.data = data;
this.dataType = dataType;
if (dataType == null) {
this.dataType = data.getType();
}
Conditions.checkNotNull(data, "item dataType must be supplied");
}
public String getType() {
return type;
}
public String getID() {
return id;
}
public long getUpdatedAt() {
return updatedAt;
}
public String getMethod() {
return method;
}
public JobItem<T> setMethod(String method) {
this.method = method;
return this;
}
public Error getError() {
return error;
}
public T getData() {
return data;
}
public JobItem<T> setData(T data) {
this.data = data;
return this;
}
public String getDataType() {
return dataType;
}
@Override
public String toString() {
return "JobItem{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", updatedAt=" + updatedAt +
", method='" + method + '\'' +
", dataType='" + dataType + '\'' +
", error=" + error +
", data=" + data +
"} " + super.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JobItem<?> jobItem = (JobItem<?>) o;
if (updatedAt != jobItem.updatedAt) return false;
//noinspection ConstantConditions
if (type != null ? !type.equals(jobItem.type) : jobItem.type != null) return false;
if (id != null ? !id.equals(jobItem.id) : jobItem.id != null) return false;
if (method != null ? !method.equals(jobItem.method) : jobItem.method != null) return false;
if (dataType != null ? !dataType.equals(jobItem.dataType) : jobItem.dataType != null) return false;
//noinspection SimplifiableIfStatement
if (error != null ? !error.equals(jobItem.error) : jobItem.error != null) return false;
return !(data != null ? !data.equals(jobItem.data) : jobItem.data != null);
}
@Override
public int hashCode() {
@SuppressWarnings("ConstantConditions") int result = type != null ? type.hashCode() : 0;
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (method != null ? method.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
result = 31 * result + (error != null ? error.hashCode() : 0);
result = 31 * result + (data != null ? data.hashCode() : 0);
return result;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class JobItemCollection<T extends TypedData>
extends TypedDataCollection<JobItem<T>>
implements Iterator<JobItem<T>> {
protected TypedDataCollectionIterator<JobItem<T>> iterator;
public JobItemCollection() {
iterator = new TypedDataCollectionIterator<JobItem<T>>(this);
}
public JobItemCollection(List<JobItem<T>> items) {
this();
this.page = items;
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("items")
@Override
public List<JobItem<T>> getPage() {
return super.getPage();
}
@Override
public JobItemCollection<T> nextPage() {
return fetchNextPage(JobItemCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public JobItem<T> next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
class JobItemRequest<T extends TypedData> extends TypedData {
@JsonProperty("items")
private List<JobItem<T>> items;
@JsonProperty("job")
@JsonInclude(JsonInclude.Include.NON_NULL)
private Job job;
public JobItemRequest(List<JobItem<T>> items, Job job) {
this.items = items;
this.job = job;
}
public List<JobItem<T>> getItems() {
return items;
}
public Job getJob() {
return job;
}
@Override
String getType() {
return "job_item.list";
}
}
package performa.intercom.resources;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import java.util.List;
class JobSupport {
public void validateJobItem(JobItem item, List<String> methods) {
if (!methods.contains(item.getMethod())) {
final String message = String.format(
"job method [%s] not allowed, must be one of "
+ Joiner.on(", ").join(methods), item.getMethod()
);
throw new InvalidException(
new ErrorCollection(
Lists.newArrayList(
new Error("invalid", message))));
}
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class JobTask extends TypedData {
@JsonProperty("type")
private final String type = "job_task";
@JsonProperty("id")
private String id;
@JsonProperty("completed_at")
private Long completedAt;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("item_count")
private long itemCount;
@Override
public String getType() {
return type;
}
public String getID() {
return id;
}
public Long getCompletedAt() {
return completedAt;
}
public long getCreatedAt() {
return createdAt;
}
public long getItemCount() {
return itemCount;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class LocationData extends TypedData {
@JsonProperty("type")
private final String type = "location_data";
@JsonProperty("city_name")
private String city_Name;
@JsonProperty("continent_code")
private String continentCode;
@JsonProperty("country_code")
private String countryCode;
@JsonProperty("country_name")
private String countryName;
@JsonProperty("latitude")
private float latitude;
@JsonProperty("longitude")
private float longitude;
@JsonProperty("postal_code")
private String postalCode;
@JsonProperty("region_name")
private String regionName;
@JsonProperty("timezone")
private String timezone;
public LocationData() {
}
public String getType() {
return type;
}
public String getCity_Name() {
return city_Name;
}
public String getContinentCode() {
return continentCode;
}
public String getCountryCode() {
return countryCode;
}
public String getCountryName() {
return countryName;
}
public float getLatitude() {
return latitude;
}
public float getLongitude() {
return longitude;
}
public String getPostalCode() {
return postalCode;
}
public String getRegionName() {
return regionName;
}
public String getTimezone() {
return timezone;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LocationData that = (LocationData) o;
if (Float.compare(that.latitude, latitude) != 0) return false;
if (Float.compare(that.longitude, longitude) != 0) return false;
if (city_Name != null ? !city_Name.equals(that.city_Name) : that.city_Name != null) return false;
if (continentCode != null ? !continentCode.equals(that.continentCode) : that.continentCode != null)
return false;
if (countryCode != null ? !countryCode.equals(that.countryCode) : that.countryCode != null) return false;
if (countryName != null ? !countryName.equals(that.countryName) : that.countryName != null) return false;
if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) return false;
if (regionName != null ? !regionName.equals(that.regionName) : that.regionName != null) return false;
if (timezone != null ? !timezone.equals(that.timezone) : that.timezone != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(that.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (city_Name != null ? city_Name.hashCode() : 0);
result = 31 * result + (continentCode != null ? continentCode.hashCode() : 0);
result = 31 * result + (countryCode != null ? countryCode.hashCode() : 0);
result = 31 * result + (countryName != null ? countryName.hashCode() : 0);
result = 31 * result + (latitude != +0.0f ? Float.floatToIntBits(latitude) : 0);
result = 31 * result + (longitude != +0.0f ? Float.floatToIntBits(longitude) : 0);
result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
result = 31 * result + (regionName != null ? regionName.hashCode() : 0);
result = 31 * result + (timezone != null ? timezone.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "LocationData{" +
"type='" + type + '\'' +
", city_Name='" + city_Name + '\'' +
", continentCode='" + continentCode + '\'' +
", countryCode='" + countryCode + '\'' +
", countryName='" + countryName + '\'' +
", latitude=" + latitude +
", longitude=" + longitude +
", postalCode='" + postalCode + '\'' +
", regionName='" + regionName + '\'' +
", timezone='" + timezone + '\'' +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
public class MapperSupport {
public static ObjectMapper objectMapper() {
return Holder.INSTANCE;
}
private static class Holder {
private static final ObjectMapper INSTANCE = new Holder().configure(new ObjectMapper());
private ObjectMapper configure(ObjectMapper om) {
return om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true)
.configure(SerializationFeature.INDENT_OUTPUT, true)
.configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, false)
.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false)
.registerModule(customAttributeModule());
}
private SimpleModule customAttributeModule() {
final SimpleModule customAttributeModule = new SimpleModule(
"IntercomClientModule",
new Version(1, 0, 0, null, "", "")
);
customAttributeModule.addDeserializer(CustomAttribute.class, new CustomAttributeDeserializer());
customAttributeModule.addSerializer(CustomAttribute.class, new CustomAttributeSerializer());
customAttributeModule.addDeserializer(Subscription.Topic.class, new TopicDeserializer());
customAttributeModule.addSerializer(Subscription.Topic.class, new TopicSerializer());
customAttributeModule.addSerializer(Counts.CountItem.class, new CountItemSerializer());
customAttributeModule.addDeserializer(Counts.CountItem.class, new CountItemDeserializer());
return customAttributeModule;
}
}
}
package performa.intercom.resources;
public class NotFoundException extends IntercomException {
private static final long serialVersionUID = 2917082281352001861L;
public NotFoundException(String message) {
super(message);
}
public NotFoundException(String message, Throwable cause) {
super(message, cause);
}
public NotFoundException(ErrorCollection errorCollection) {
super(errorCollection);
}
public NotFoundException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Note extends TypedData {
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
public static Note find(String id) throws InvalidException, AuthorizationException {
return DataResource.find(id, "notes", Note.class);
}
public static Note create(Note note) throws InvalidException, AuthorizationException {
return DataResource.create(note, "notes", Note.class);
}
public static NoteCollection list(Map<String, String> params) throws InvalidException, AuthorizationException {
if ((!params.containsKey("email")) && (!params.containsKey("id")) && (!params.containsKey("user_id")) && (!params.containsKey("intercom_user_id"))) {
throw new InvalidException("a notes query must include an email, user_id or intercom_user_id parameter");
}
return DataResource.list(params, "notes", NoteCollection.class);
}
@JsonProperty("type")
private final String type = "note";
@JsonProperty("id")
private String id;
@JsonProperty("body")
private String body;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("user")
private User user;
@JsonProperty("author")
private Author author;
public Note() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public String getBody() {
return body;
}
public Note setBody(String body) {
this.body = body;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public User getUser() {
return user;
}
public Note setUser(User user) {
this.user = user;
return this;
}
public Author getAuthor() {
return author;
}
public Note setAuthor(Author author) {
this.author = author;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Note note = (Note) o;
if (createdAt != note.createdAt) return false;
if (author != null ? !author.equals(note.author) : note.author != null) return false;
if (body != null ? !body.equals(note.body) : note.body != null) return false;
if (id != null ? !id.equals(note.id) : note.id != null) return false;
if (!type.equals(note.type)) return false;
//noinspection RedundantIfStatement
if (user != null ? !user.equals(note.user) : note.user != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (user != null ? user.hashCode() : 0);
result = 31 * result + (author != null ? author.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Note{" +
"id='" + id + '\'' +
", body='" + body + '\'' +
", createdAt=" + createdAt +
", user=" + user +
", author=" + author +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class NoteCollection extends TypedDataCollection<Note> implements Iterator<Note> {
protected TypedDataCollectionIterator<Note> iterator;
public NoteCollection() {
iterator = new TypedDataCollectionIterator<Note>(this);
}
@Override
public NoteCollection nextPage() {
return fetchNextPage(NoteCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("notes")
@Override
public List<Note> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Note next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties({"intercom"})
public class Notification extends TypedData {
public static Notification readJSON(String json) throws InvalidException {
try {
return MapperSupport.objectMapper().readValue(json, Notification.class);
} catch (IOException e) {
throw new InvalidException("could not parse json string [" + e.getMessage() + "]", e);
}
}
public static Notification readJSON(InputStream json) throws InvalidException {
try {
return MapperSupport.objectMapper().readValue(json, Notification.class);
} catch (IOException e) {
throw new InvalidException("could not parse json stream [" + e.getMessage() + "]", e);
}
}
@JsonProperty("type")
private final String type = "notification_event";
@JsonProperty("id")
private String id;
@JsonProperty("topic")
private String topic;
@JsonProperty("app_id")
private String appID;
@JsonProperty("data")
private NotificationData data;
@JsonProperty("delivery_status")
private String deliveryStatus;
@JsonProperty("delivery_attempts")
private int deliveryAttempts;
@JsonProperty("delivered_at")
private long deliveredAt;
@JsonProperty("first_sent_at")
private long firstSentAt;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty
private Map<String, URI> links = Maps.newHashMap();
@JsonProperty("self")
private URI self;
public Notification() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public String getAppID() {
return appID;
}
public void setAppID(String appID) {
this.appID = appID;
}
public NotificationData getData() {
return data;
}
public void setData(NotificationData data) {
this.data = data;
}
public String getDeliveryStatus() {
return deliveryStatus;
}
public void setDeliveryStatus(String deliveryStatus) {
this.deliveryStatus = deliveryStatus;
}
public int getDeliveryAttempts() {
return deliveryAttempts;
}
public void setDeliveryAttempts(int deliveryAttempts) {
this.deliveryAttempts = deliveryAttempts;
}
public long getDeliveredAt() {
return deliveredAt;
}
public void setDeliveredAt(long deliveredAt) {
this.deliveredAt = deliveredAt;
}
public long getFirstSentAt() {
return firstSentAt;
}
public void setFirstSentAt(long firstSentAt) {
this.firstSentAt = firstSentAt;
}
public long getCreatedAt() {
return createdAt;
}
public Map<String, URI> getLinks() {
return links;
}
public void setLinks(Map<String, URI> links) {
this.links = links;
}
public URI getSelf() {
return self;
}
public void setSelf(URI self) {
this.self = self;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (topic != null ? topic.hashCode() : 0);
result = 31 * result + (appID != null ? appID.hashCode() : 0);
result = 31 * result + (data != null ? data.hashCode() : 0);
result = 31 * result + (deliveryStatus != null ? deliveryStatus.hashCode() : 0);
result = 31 * result + deliveryAttempts;
result = 31 * result + (int) (deliveredAt ^ (deliveredAt >>> 32));
result = 31 * result + (int) (firstSentAt ^ (firstSentAt >>> 32));
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (links != null ? links.hashCode() : 0);
result = 31 * result + (self != null ? self.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Notification that = (Notification) o;
if (createdAt != that.createdAt) return false;
if (deliveredAt != that.deliveredAt) return false;
if (deliveryAttempts != that.deliveryAttempts) return false;
if (firstSentAt != that.firstSentAt) return false;
if (appID != null ? !appID.equals(that.appID) : that.appID != null) return false;
if (data != null ? !data.equals(that.data) : that.data != null) return false;
if (deliveryStatus != null ? !deliveryStatus.equals(that.deliveryStatus) : that.deliveryStatus != null)
return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (links != null ? !links.equals(that.links) : that.links != null) return false;
if (self != null ? !self.equals(that.self) : that.self != null) return false;
//noinspection RedundantIfStatement
if (topic != null ? !topic.equals(that.topic) : that.topic != null) return false;
return true;
}
@Override
public String toString() {
return "Notification{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", topic='" + topic + '\'' +
", appID='" + appID + '\'' +
", data=" + data +
", deliveryStatus='" + deliveryStatus + '\'' +
", deliveryAttempts=" + deliveryAttempts +
", deliveredAt=" + deliveredAt +
", firstSentAt=" + firstSentAt +
", createdAt=" + createdAt +
", links=" + links +
", self=" + self +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class NotificationCollection extends TypedDataCollection<Notification> implements Iterator<Notification> {
protected TypedDataCollectionIterator<Notification> iterator;
public NotificationCollection() {
type = "notification.list";
iterator = new TypedDataCollectionIterator<Notification>(this);
}
@Override
public NotificationCollection nextPage() {
return fetchNextPage(NotificationCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("notifications")
@Override
public List<Notification> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Notification next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class NotificationData extends TypedData {
@JsonProperty("type")
protected String type;
@JsonProperty
private Map item;
public NotificationData() {
type = "notification_event_data";
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map getItem() {
return item;
}
public void setItem(Map item) {
this.item = item;
}
@Override
public int hashCode() {
return item != null ? item.hashCode() : 0;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NotificationData that = (NotificationData) o;
//noinspection RedundantIfStatement
if (item != null ? !item.equals(that.item) : that.item != null) return false;
return true;
}
@Override
public String toString() {
return "NotificationData{" +
"type='" + type + '\'' +
", item=" + item +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class NotificationError extends Notification {
@JsonProperty("http_request")
private RequestResponseCapture capture;
public RequestResponseCapture getCapture() {
return capture;
}
public void setCapture(RequestResponseCapture capture) {
this.capture = capture;
}
@Override
public String toString() {
return "NotificationError{" +
"capture=" + capture +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class NotificationErrorCollection extends TypedDataCollection<NotificationError> implements Iterator<NotificationError> {
protected TypedDataCollectionIterator<NotificationError> iterator;
public NotificationErrorCollection() {
type = "notification.list";
iterator = new TypedDataCollectionIterator<NotificationError>(this);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("notifications")
@Override
public List<NotificationError> getPage() {
return super.getPage();
}
@Override
public NotificationErrorCollection nextPage() {
return fetchNextPage(NotificationErrorCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public NotificationError next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
public class RateLimitException extends IntercomException {
private static final long serialVersionUID = -6100754169056165622L;
private int rateLimit;
private int remainingRequests;
private long resetTime;
public RateLimitException(String message) {
super(message);
}
public RateLimitException(String message, Throwable cause) {
super(message, cause);
}
public RateLimitException(ErrorCollection errorCollection) {
super(errorCollection);
}
public RateLimitException(ErrorCollection errorCollection, int rateLimit,
int remainingRequests, long resetTime) {
super(errorCollection);
this.rateLimit = rateLimit;
this.remainingRequests = remainingRequests;
this.resetTime = resetTime;
}
public RateLimitException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
public int getRateLimit() {
return rateLimit;
}
public void setRateLimit(int rateLimit) {
this.rateLimit = rateLimit;
}
public int getRemainingRequests() {
return remainingRequests;
}
public void setRemainingRequests(int remainingRequests) {
this.remainingRequests = remainingRequests;
}
public long getResetTime() {
return resetTime;
}
public void setResetTime(long resetTime) {
this.resetTime = resetTime;
}
}
package performa.intercom.resources;
interface Replier {
String getReplyType();
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
class Reply<T extends Replier> extends TypedData {
@JsonProperty("message_type")
private String messageType = "comment";
@JsonProperty("body")
private String body;
@JsonProperty("attachment_urls")
private String[] attachmentUrls;
@JsonProperty("from")
T from;
Reply() {
}
@JsonProperty("type")
String getType() {
return from.getReplyType();
}
String getBody() {
return body;
}
public Reply<T> setBody(String body) {
this.body = body;
return this;
}
public String[] getAttachmentUrls() {
return attachmentUrls;
}
public Reply<T> setAttachmentUrls(String[] attachmentUrls) {
this.attachmentUrls = attachmentUrls;
return this;
}
T getFrom() {
return from;
}
@SuppressWarnings("UnusedDeclaration")
public Reply<T> setFrom(T from) {
this.from = from;
return this;
}
String getMessageType() {
return messageType;
}
Reply<T> setMessageReplyType(String messageType) {
this.messageType = messageType;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Reply reply = (Reply) o;
if (body != null ? !body.equals(reply.body) : reply.body != null) return false;
if (from != null ? !from.equals(reply.from) : reply.from != null) return false;
//noinspection RedundantIfStatement
if (!messageType.equals(reply.messageType)) return false;
return true;
}
@Override
public int hashCode() {
int result = messageType.hashCode();
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (from != null ? from.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Reply{" +
"messageType='" + messageType + '\'' +
", body='" + body + '\'' +
", from=" + from +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import java.net.URI;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RequestResponseCapture {
@JsonProperty("request_method")
private String requestMethod;
@JsonProperty("request_uri")
private URI requestURI;
@JsonProperty("request_headers")
private Map<String, String> requestHeaders;
@JsonProperty("response_status_code")
private int responseStatusCode;
@JsonProperty("response_headers")
private Map<String, String> responseHeaders;
@JsonProperty("response_entity")
private String responseEntity;
@JsonProperty("request_entity")
private String requestEntity;
public RequestResponseCapture() {
}
public String getRequestMethod() {
return requestMethod;
}
public URI getRequestURI() {
return requestURI;
}
public Map<String, String> getRequestHeaders() {
return ImmutableMap.<String, String>builder().putAll(requestHeaders).build();
}
public int getResponseStatusCode() {
return responseStatusCode;
}
public Map<String, String> getResponseHeaders() {
return ImmutableMap.<String, String>builder().putAll(responseHeaders).build();
}
public String getResponseEntity() {
return responseEntity;
}
public String getRequestEntity() {
return requestEntity;
}
}
\ No newline at end of file
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class ScrollableCompanyCollection extends ScrollableTypedDataCollection<Company> {
@Override
public ScrollableCompanyCollection scroll() {
return DataResource.scroll(getScrollParam(), "companies", ScrollableCompanyCollection.class);
}
@JsonProperty("companies")
@Override
public List<Company> getPage() {
return super.getPage();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class ScrollableContactCollection extends ScrollableTypedDataCollection<Contact> {
@Override
public ScrollableContactCollection scroll() {
return DataResource.scroll(getScrollParam(), "contacts", ScrollableContactCollection.class);
}
@JsonProperty("contacts")
@Override
public List<Contact> getPage() {
return super.getPage();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Lists;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public abstract class ScrollableTypedDataCollection<T extends TypedData> extends TypedData {
protected List<T> page = Lists.newArrayList();
@JsonProperty("scroll_param")
protected String scrollParam;
@JsonProperty("type")
protected String type;
public String getScrollParam() {
return scrollParam;
}
public String getType() {
return type;
}
public abstract ScrollableTypedDataCollection<T> scroll();
public List<T> getPage() {
return page;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class ScrollableUserCollection extends ScrollableTypedDataCollection<User> {
@Override
public ScrollableUserCollection scroll() {
return DataResource.scroll(getScrollParam(), "users", ScrollableUserCollection.class);
}
@JsonProperty("users")
@Override
public List<User> getPage() {
return super.getPage();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.util.HashMap;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Segment extends TypedData {
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
public static Segment find(String id) throws InvalidException, AuthorizationException {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("segments").path(id).build());
return resource.get(Segment.class);
}
public static SegmentCollection list() throws InvalidException, AuthorizationException {
return DataResource.list(SENTINEL, "segments", SegmentCollection.class);
}
public static Segment update(Segment segment) throws InvalidException, AuthorizationException {
if (segment.getId() == null) {
throw new InvalidException("segment updates must supply an id");
}
return DataResource.update(segment, "segments", Segment.class);
}
@JsonProperty("type")
private final String type = "segment";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@SuppressWarnings("WeakerAccess")
public Segment() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public Segment setName(String name) {
this.name = name;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Segment segment = (Segment) o;
if (createdAt != segment.createdAt) return false;
if (updatedAt != segment.updatedAt) return false;
if (id != null ? !id.equals(segment.id) : segment.id != null) return false;
if (name != null ? !name.equals(segment.name) : segment.name != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(segment.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
return result;
}
@Override
public String toString() {
return "Segment{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SegmentCollection extends TypedDataCollection<Segment> implements Iterator<Segment> {
protected TypedDataCollectionIterator<Segment> iterator;
public SegmentCollection() {
type = "segment.list";
iterator = new TypedDataCollectionIterator<Segment>(this);
}
@Override
public SegmentCollection nextPage() {
return fetchNextPage(SegmentCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("segments")
@Override
public List<Segment> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Segment next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
@Override
public String toString() {
return "SegmentCollection{" +
"} " + super.toString();
}
}
package performa.intercom.resources;
public class ServerException extends IntercomException {
private static final long serialVersionUID = 7823280575981918941L;
public ServerException(String message) {
super(message);
}
public ServerException(String message, Throwable cause) {
super(message, cause);
}
public ServerException(ErrorCollection errorCollection) {
super(errorCollection);
}
public ServerException(ErrorCollection errorCollection, Throwable cause) {
super(errorCollection, cause);
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.net.URI;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SocialProfile extends TypedData {
@JsonProperty("type")
private final String type = "social_profile";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("username")
private String username;
@JsonProperty("url")
@JsonDeserialize(using = URIDeserializer.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
private URI url;
public SocialProfile() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public String getUsername() {
return username;
}
public URI getUrl() {
return url;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (username != null ? username.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SocialProfile that = (SocialProfile) o;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
//noinspection RedundantIfStatement
if (username != null ? !username.equals(that.username) : that.username != null) return false;
return true;
}
@Override
public String toString() {
return "SocialProfile{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", name='" + name + '\'' +
", username='" + username + '\'' +
", url=" + url +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SocialProfileCollection extends TypedData {
@JsonProperty("type")
private String type = "social_profile.list";
@JsonProperty("social_profiles")
private List<SocialProfile> socialProfiles = Lists.newArrayList();
SocialProfileCollection() {
}
public String getType() {
return type;
}
public List<SocialProfile> getSocialProfiles() {
return socialProfiles == null ? null : ImmutableList.<SocialProfile>builder().addAll(socialProfiles).build();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SocialProfileCollection that = (SocialProfileCollection) o;
if (socialProfiles != null ? !socialProfiles.equals(that.socialProfiles) : that.socialProfiles != null)
return false;
//noinspection RedundantIfStatement
if (type != null ? !type.equals(that.type) : that.type != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (socialProfiles != null ? socialProfiles.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "SocialProfileCollection{" +
"type='" + type + '\'' +
", socialProfiles=" + socialProfiles +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Subscription extends TypedData {
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
public static Subscription create(Subscription subscription) throws InvalidException, AuthorizationException {
return DataResource.create(subscription, "subscriptions", Subscription.class);
}
public static Subscription update(Subscription subscription) throws InvalidException, AuthorizationException {
return DataResource.update(subscription, "subscriptions", subscription.getId(), Subscription.class);
}
public static Subscription delete(Subscription subscription) throws InvalidException, AuthorizationException {
return DataResource.delete(subscription.getId(), "subscriptions", Subscription.class);
}
public static Subscription find(String id) throws InvalidException, AuthorizationException {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("subscriptions").path(id).build());
return resource.get(Subscription.class);
}
public static SubscriptionCollection list() throws InvalidException, AuthorizationException {
return DataResource.list(SENTINEL, "subscriptions", SubscriptionCollection.class);
}
public static NotificationCollection sentFeed(String id) throws InvalidException, AuthorizationException {
final URI feedURI = UriBuilder.newBuilder()
.path("subscriptions")
.path(id)
.path("sent")
.build();
final HttpClient resource = new HttpClient(feedURI);
return resource.get(NotificationCollection.class);
}
public static NotificationErrorCollection errorFeed(String id) throws InvalidException, AuthorizationException {
final URI feedURI = UriBuilder.newBuilder()
.path("subscriptions")
.path(id)
.path("error")
.build();
final HttpClient resource = new HttpClient(feedURI);
return resource.get(NotificationErrorCollection.class);
}
@SuppressWarnings("UnusedDeclaration")
public static class Topic {
private static final String SUBTYPE_WILDCARD = "*";
private static final String TEXT = "text";
private final static String COMPANY_NAME = "company";
private final static String CONVERSATION_NAME = "conversation";
private static final String USER_NAME = "user";
public static final Topic PING = new Topic("ping", SUBTYPE_WILDCARD);
public static final Topic COMPANY = new Topic(COMPANY_NAME, SUBTYPE_WILDCARD);
public static final Topic COMPANY_CREATED = new Topic(COMPANY_NAME, "created");
public static final Topic CONVERSATION = new Topic(CONVERSATION_NAME, SUBTYPE_WILDCARD);
public static final Topic CONVERSATION_USER_CREATED = new Topic(CONVERSATION_NAME, "user.created");
public static final Topic CONVERSATION_USER_REPLY = new Topic(CONVERSATION_NAME, "user.replied");
public static final Topic CONVERSATION_ADMIN_REPLY = new Topic(CONVERSATION_NAME, "admin.replied");
public static final Topic CONVERSATION_ADMIN_ASSIGNED = new Topic(CONVERSATION_NAME, "admin.assigned");
public static final Topic CONVERSATION_ADMIN_CLOSED = new Topic(CONVERSATION_NAME, "admin.closed");
public static final Topic CONVERSATION_ADMIN_OPEN = new Topic(CONVERSATION_NAME, "admin.open");
public static final Topic CONVERSATION_ADMIN_NOTED = new Topic(CONVERSATION_NAME, "admin.noted");
public static final Topic USER = new Topic(USER_NAME, SUBTYPE_WILDCARD);
public static final Topic USER_CREATED = new Topic(USER_NAME, "created");
public static final Topic USER_UNSUBSCRIBED = new Topic(USER_NAME, "unsubscribed");
public static final Topic USER_TAG_CREATED = new Topic(USER_NAME, "tag.created");
public static final Topic USER_TAG_DELETED = new Topic(USER_NAME, "tag.deleted");
public static final Topic ALL_TOPIC = valueOf("all");
public static Topic valueOf(String type) throws IllegalArgumentException {
if (type.contains(".")) {
final String[] split = type.split("\\.", 2); // fragile: assume one dot
return new Topic(split[0], split[1]);
} else {
return new Topic(type);
}
}
private String type;
private String subType;
private String toString;
public Topic(String type) {
this(type, SUBTYPE_WILDCARD);
}
public Topic(String type, String subType) {
Preconditions.checkArgument(type != null, "type part cannot be null");
Preconditions.checkArgument(subType != null, "subType part cannot be null");
this.type = type;
this.subType = subType;
// memo the string representation
if (SUBTYPE_WILDCARD.equals(subType)) {
toString = type;
} else {
toString = type + "." + subType;
}
}
public String getType() {
return type;
}
public String getSubType() {
return subType;
}
public boolean isCompatible(String type) {
return this.isCompatible(valueOf(type));
}
public boolean isCompatible(Topic other) {
if (other == null) {
return false;
}
//noinspection SimplifiableIfStatement
if (type.equalsIgnoreCase(other.type) && (subType.equals(SUBTYPE_WILDCARD) || other.subType.equals(SUBTYPE_WILDCARD))) {
return true;
} else {
return this.type.equalsIgnoreCase(other.type) && this.subType.equalsIgnoreCase(other.subType);
}
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (subType != null ? subType.hashCode() : 0);
return result;
}
@Override
public String toString() {
return toString;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Topic Topic = (Topic) o;
if (subType != null ? !subType.equals(Topic.subType) : Topic.subType != null) {
return false;
}
//noinspection RedundantIfStatement
if (type != null ? !type.equals(Topic.type) : Topic.type != null) {
return false;
}
return true;
}
}
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
private final String type = "notification_subscription";
@JsonProperty("id")
private String id;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("service_type")
private final String serviceType = "web";
@JsonProperty("app_id")
private String appID;
@JsonProperty("url")
private URI url;
@JsonProperty("self")
private URI self;
@JsonProperty("topics")
private List<Topic> topics = Lists.newArrayList();
@JsonProperty("metadata")
private Map<String, ArrayList<String>> metadata = Maps.newHashMap();
@JsonProperty("active")
private boolean active;
@JsonProperty("hub_secret")
private String hubSecret;
@JsonProperty("mode")
private String mode = "point";
@JsonProperty("links")
private Map<String, URI> links = Maps.newHashMap();
@JsonProperty("notes")
private List<String> notes = Lists.newArrayList();
public Subscription() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public String getServiceType() {
return serviceType;
}
public String getAppID() {
return appID;
}
public void setAppID(String appID) {
this.appID = appID;
}
public URI getUrl() {
return url;
}
public void setUrl(URI url) {
this.url = url;
}
public URI getSelf() {
return self;
}
public List<Topic> getTopics() {
return topics;
}
public void setTopics(List<Topic> topics) {
this.topics = topics;
}
public void addTopic(Topic topic) {
this.topics.add(topic);
}
public boolean getActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public Map<String, ArrayList<String>> getMetadata() {
return metadata;
}
public void setMetadata(Map<String, ArrayList<String>> metadata) {
this.metadata = metadata;
}
public String getHubSecret() {
return hubSecret;
}
public void setHubSecret(String hubSecret) {
this.hubSecret = hubSecret;
}
public String getMode() {
return mode;
}
public List<String> getNotes() {
return notes;
}
public void setNotes(List<String> notes) {
this.notes = notes;
}
@JsonIgnore
public String getURLString() {
return url.toASCIIString();
}
@JsonIgnore
public boolean requiresSignature() {
return getHubSecret() != null;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Subscription that = (Subscription) o;
if (active != that.active) return false;
if (createdAt != that.createdAt) return false;
if (updatedAt != that.updatedAt) return false;
if (appID != null ? !appID.equals(that.appID) : that.appID != null) return false;
if (hubSecret != null ? !hubSecret.equals(that.hubSecret) : that.hubSecret != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (links != null ? !links.equals(that.links) : that.links != null) return false;
if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false;
if (mode != null ? !mode.equals(that.mode) : that.mode != null) return false;
if (notes != null ? !notes.equals(that.notes) : that.notes != null) return false;
if (self != null ? !self.equals(that.self) : that.self != null) return false;
if (!serviceType.equals(that.serviceType)) return false;
if (topics != null ? !topics.equals(that.topics) : that.topics != null) return false;
if (!type.equals(that.type)) return false;
//noinspection RedundantIfStatement
if (url != null ? !url.equals(that.url) : that.url != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (serviceType.hashCode());
result = 31 * result + (appID != null ? appID.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (self != null ? self.hashCode() : 0);
result = 31 * result + (topics != null ? topics.hashCode() : 0);
result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
result = 31 * result + (active ? 1 : 0);
result = 31 * result + (hubSecret != null ? hubSecret.hashCode() : 0);
result = 31 * result + (mode != null ? mode.hashCode() : 0);
result = 31 * result + (links != null ? links.hashCode() : 0);
result = 31 * result + (notes != null ? notes.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Subscription{" +
"id='" + id + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", serviceType='" + serviceType + '\'' +
", appID='" + appID + '\'' +
", url=" + url +
", self=" + self +
", topics=" + topics +
", metadata=" + metadata +
", active=" + active +
", hubSecret='" + hubSecret + '\'' +
", mode='" + mode + '\'' +
", links=" + links +
", notes=" + notes +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SubscriptionCollection extends TypedDataCollection<Subscription> implements Iterator<Subscription> {
protected TypedDataCollectionIterator<Subscription> iterator;
public SubscriptionCollection() {
iterator = new TypedDataCollectionIterator<Subscription>(this);
}
@Override
public SubscriptionCollection nextPage() {
return fetchNextPage(SubscriptionCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("items")
@Override
public List<Subscription> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Subscription next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
@Override
public String toString() {
return "SubscriptionCollection{" +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Tag extends TypedData {
private static final Logger logger = LoggerFactory.getLogger("intercom-java");
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
public static Tag tag(Tag tag, User... users) throws InvalidException, AuthorizationException {
return tag(tag, new UserCollection(Lists.newArrayList(users)));
}
public static Tag tag(Tag tag, Company... companies) throws InvalidException, AuthorizationException {
return tag(tag, new CompanyCollection(Lists.newArrayList(companies)));
}
static Tag tag(Tag tag, UserCollection users) throws InvalidException, AuthorizationException {
TaggableCollection taggableCollection = createTagTypedCollection(tag, users);
return DataResource.create(taggableCollection, "tags", Tag.class);
}
static Tag tag(Tag tag, CompanyCollection companies) throws InvalidException, AuthorizationException {
TaggableCollection taggableCollection = createTagTypedCollection(tag, companies);
return DataResource.create(taggableCollection, "tags", Tag.class);
}
public static Tag create(Tag tag) throws InvalidException, AuthorizationException {
return DataResource.create(tag, "tags", Tag.class);
}
public static Tag update(Tag tag) throws InvalidException, AuthorizationException {
if (tag.getId() == null) {
throw new InvalidException("tag updates must supply an id");
}
return DataResource.update(tag, "tags", Tag.class);
}
public static Tag delete(String id) throws InvalidException, AuthorizationException {
return DataResource.delete(id, "tags", Tag.class);
}
public static Tag delete(Tag tag) throws InvalidException, AuthorizationException {
return delete(tag.getId());
}
public static TagCollection list() throws InvalidException, AuthorizationException {
return DataResource.list(SENTINEL, "tags", TagCollection.class);
}
@VisibleForTesting
static TaggableCollection createTagTypedCollection(Tag tag, UserCollection users) {
TaggableCollection taggableCollection = new TaggableCollection();
taggableCollection.setName(tag.getName());
taggableCollection.setId(tag.getId());
final List<Map<String, Object>> usersLite = Lists.newArrayList();
final List<User> pageItems = users.getPage();
for (User user : pageItems) {
Map<String, Object> userMap = Maps.newHashMap();
final String id = user.getId();
final String email = user.getEmail();
final String userId = user.getUserId();
if (user.isUntag()) {
userMap.put("untag", true);
}
if (!Strings.isNullOrEmpty(id)) {
userMap.put("id", id);
usersLite.add(userMap);
} else if (!Strings.isNullOrEmpty(email)) {
userMap.put("email", email);
usersLite.add(userMap);
} else if (!Strings.isNullOrEmpty(userId)) {
userMap.put("user_id", userId);
usersLite.add(userMap);
} else {
logger.warn("no identifiers found for user tag target, skipping [" + tag + "] [" + user.toString() + "]");
}
}
taggableCollection.setUsers(usersLite);
return taggableCollection;
}
@VisibleForTesting
static TaggableCollection createTagTypedCollection(Tag tag, CompanyCollection companies) {
TaggableCollection taggableCollection = new TaggableCollection();
taggableCollection.setName(tag.getName());
taggableCollection.setId(tag.getId());
final List<Map<String, Object>> companiesLite = Lists.newArrayList();
final List<Company> pageItems = companies.getPage();
for (Company company : pageItems) {
Map<String, Object> companyMap = Maps.newHashMap();
final String companyID = company.getCompanyID();
final String id = company.getId();
final String name = company.getName();
if (company.isUntag()) {
companyMap.put("untag", true);
}
if (!Strings.isNullOrEmpty(companyID)) {
companyMap.put("company_id", companyID);
companiesLite.add(companyMap);
} else if (!Strings.isNullOrEmpty(id)) {
companyMap.put("id", id);
companiesLite.add(companyMap);
} else if (!Strings.isNullOrEmpty(name)) {
companyMap.put("name", name);
companiesLite.add(companyMap);
} else {
logger.warn("no identifiers found for company tag target, skipping [" + tag + "] [" + company.toString() + "]");
}
taggableCollection.setCompanies(companiesLite);
}
return taggableCollection;
}
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
static class TaggableCollection extends Tag {
@JsonProperty("users")
private List<Map<String, Object>> users;
@JsonProperty("companies")
private List<Map<String, Object>> companies;
public List<Map<String, Object>> getUsers() {
return users;
}
public void setUsers(List<Map<String, Object>> usersLite) {
this.users = usersLite;
}
public List<Map<String, Object>> getCompanies() {
return companies;
}
public void setCompanies(List<Map<String, Object>> companies) {
this.companies = companies;
}
}
@JsonProperty("type")
private final String type = "tag";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
public Tag() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
@SuppressWarnings("UnusedReturnValue")
@VisibleForTesting
Tag setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public Tag setName(String name) {
this.name = name;
return this;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tag tag = (Tag) o;
if (createdAt != tag.createdAt) return false;
if (updatedAt != tag.updatedAt) return false;
if (id != null ? !id.equals(tag.id) : tag.id != null) return false;
if (name != null ? !name.equals(tag.name) : tag.name != null) return false;
//noinspection RedundantIfStatement
if (!type.equals(tag.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
return result;
}
@Override
public String toString() {
return "Tag{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class TagCollection extends TypedDataCollection<Tag> implements Iterator<Tag> {
protected TypedDataCollectionIterator<Tag> iterator;
public TagCollection() {
iterator = new TypedDataCollectionIterator<Tag>(this);
}
@Override
public TagCollection nextPage() {
return fetchNextPage(TagCollection.class);
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("tags")
@Override
public List<Tag> getPage() {
return super.getPage();
}
public boolean hasNext() {
return iterator.hasNext();
}
public Tag next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
@Override
public String toString() {
return "TagCollection{" +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.ValueNode;
import java.io.IOException;
class TopicDeserializer extends StdDeserializer<Subscription.Topic> {
private static final long serialVersionUID = 7679767772794559452L;
public TopicDeserializer() {
super(CustomAttribute.class);
}
@Override
public Subscription.Topic deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
final ObjectMapper mapper = (ObjectMapper) jp.getCodec();
final ValueNode vNode = mapper.readTree(jp);
return Subscription.Topic.valueOf(vNode.asText());
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
class TopicSerializer extends StdSerializer<Subscription.Topic> {
public TopicSerializer() {
super(Subscription.Topic.class);
}
@Override
public void serialize(Subscription.Topic value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
jgen.writeObject(value.toString());
}
}
package performa.intercom.resources;
class TypedData {
String getType() {
throw new UnsupportedOperationException();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties({"page"})
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public abstract class TypedDataCollection<T extends TypedData> extends TypedData {
public static final String NEXT_PAGE_REL = "next";
protected List<T> page = Lists.newArrayList();
@JsonProperty("pages")
protected Map<String, URI> pages = Maps.newHashMap();
@JsonProperty("type")
protected String type;
public abstract TypedDataCollection<T> nextPage();
public boolean hasNextPage() {
return pages.containsKey("next") && pages.get("next") != null;
}
public List<T> getPage() {
return ImmutableList.<T>builder().addAll(page).build();
}
protected <C extends TypedDataCollection<T>> C fetchNextPage(Class<C> typeReference) {
if (hasNextPage()) {
final URI next = UriBuilder.newBuilder(pages.get(TypedDataCollection.NEXT_PAGE_REL)).build();
final HttpClient resource = new HttpClient(next);
return resource.get(typeReference);
} else {
return null;
}
}
public Map<String, URI> getPages() {
return ImmutableMap.<String, URI>builder().putAll(pages).build();
}
public String getType() {
return type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TypedDataCollection that = (TypedDataCollection) o;
if (page != null ? !page.equals(that.page) : that.page != null) return false;
if (pages != null ? !pages.equals(that.pages) : that.pages != null) return false;
//noinspection RedundantIfStatement
if (type != null ? !type.equals(that.type) : that.type != null) return false;
return true;
}
@Override
public int hashCode() {
int result = page != null ? page.hashCode() : 0;
result = 31 * result + (pages != null ? pages.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
}
@Override
public String toString() {
return getType() + "{" +
"page=" + page +
"} " + super.toString();
}
}
package performa.intercom.resources;
import java.util.Iterator;
import java.util.NoSuchElementException;
class TypedDataCollectionIterator<T extends TypedData> implements Iterator<T> {
private TypedDataCollection<T> rollingCollection;
private int pos;
public TypedDataCollectionIterator(TypedDataCollection<T> startingCollection) {
this.rollingCollection = startingCollection;
this.pos = 0;
}
public boolean hasNext() {
if (pos == rollingCollection.getPage().size()) {
if (rollingCollection.hasNextPage()) {
rollingCollection = rollingCollection.nextPage();
pos = 0;
if (rollingCollection.getPage().size() == 0) {
// if new page is empty
return false;
}
return true;
} else {
return false;
}
} else {
return pos <= rollingCollection.getPage().size();
}
}
public T next() {
iterate();
final T t = rollingCollection.getPage().get(pos);
pos++;
return t;
}
private void iterate() {
if (pos == rollingCollection.getPage().size()) {
if (rollingCollection.hasNextPage()) {
rollingCollection = rollingCollection.nextPage();
pos = 0;
} else {
throw new NoSuchElementException();
}
}
}
public void remove() {
throw new UnsupportedOperationException();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
abstract class TypedMessage<F, T extends TypedMessage> extends TypedData {
@SuppressWarnings("FieldCanBeLocal")
@JsonProperty("type")
protected final String type = "user_message";
@JsonProperty("message_type")
protected String messageType;
@JsonProperty("id")
protected String id;
@JsonProperty("body")
protected String body;
@JsonProperty("created_at")
protected long createdAt;
protected F from;
public TypedMessage() {
}
public String getType() {
return type;
}
public F getFrom() {
return from;
}
public T setFrom(F from) {
this.from = from;
return (T)this;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getId() {
return id;
}
public String getBody() {
return body;
}
public T setBody(String body) {
this.body = body;
return (T)this;
}
public long getCreatedAt() {
return createdAt;
}
public T setCreatedAt(long createdAt) {
this.createdAt = createdAt;
return (T)this;
}
@Override
public String toString() {
return "TypedMessage{" +
"type='" + type + '\'' +
", messageType='" + messageType + '\'' +
", id='" + id + '\'' +
", body='" + body + '\'' +
", createdAt=" + createdAt +
", from=" + from +
"} " + super.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TypedMessage<?, ?> that = (TypedMessage<?, ?>) o;
if (createdAt != that.createdAt) return false;
if (type != null ? !type.equals(that.type) : that.type != null) return false;
if (messageType != null ? !messageType.equals(that.messageType) : that.messageType != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (body != null ? !body.equals(that.body) : that.body != null) return false;
return !(from != null ? !from.equals(that.from) : that.from != null);
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (messageType != null ? messageType.hashCode() : 0);
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (from != null ? from.hashCode() : 0);
return result;
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.ValueNode;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
class URIDeserializer extends StdDeserializer<URI> {
public URIDeserializer() {
super(URI.class);
}
@Override
public URI deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
final ObjectMapper mapper = (ObjectMapper) jp.getCodec();
final ValueNode vNode = mapper.readTree(jp);
URI uri = null;
try {
uri = new URI(vNode.asText());
} catch (URISyntaxException ignored) {
}
if (uri == null) {
try {
final URL url = new URL(vNode.asText());
uri = new URI(url.getProtocol(), url.getHost(), url.getPath(), url.getQuery(), url.getRef());
} catch (MalformedURLException ignored) {
} catch (URISyntaxException ignored) {
}
}
return uri;
}
}
package performa.intercom.resources;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
class UriBuilder {
public static UriBuilder newBuilder() {
return new UriBuilder(Intercom.getApiBaseURI());
}
public static UriBuilder newBuilder(String uri) {
return new UriBuilder(uri);
}
public static UriBuilder newBuilder(URI uri) {
return new UriBuilder(uri);
}
private StringBuilder uri;
private TreeMap<String, String> paramsMap; // treemap to simplify testing
private UriBuilder(String uri) {
try {
this.uri = new StringBuilder(new URI(uri).toASCIIString());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
private UriBuilder(URI uri) {
this.uri = new StringBuilder(uri.toASCIIString());
}
public String buildString() {
return build().toASCIIString();
}
public URI build() {
if (paramsMap != null) {
uri.append("?");
final StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
if (sb.lastIndexOf("&") == sb.length() - 1) {
sb.deleteCharAt(sb.length() - 1);
}
uri.append(sb);
}
try {
return new URI(uri.toString());
} catch (URISyntaxException e) {
throw new IntercomException("could not create api url", e);
}
}
public UriBuilder path(String path) {
uri.append("/").append(urlEncode(path));
return this;
}
public UriBuilder path(List<String> path) {
List<String> urlEncoded = Lists.newArrayList();
for (String s : path) {
urlEncoded.add(urlEncode(s));
}
uri.append("/").append(Joiner.on("/").join(urlEncoded));
return this;
}
public UriBuilder query(String param, String value) {
if (paramsMap == null) {
paramsMap = Maps.newTreeMap();
}
paramsMap.put(urlEncode(param), urlEncode(value));
return this;
}
public UriBuilder query(Map<String, String> params) {
for (Map.Entry<String, String> entry : params.entrySet()) {
query(entry.getKey(), entry.getValue());
}
return this;
}
private String urlEncode(String param) {
try {
// URLEncoder is a html forms encoder not a percent encoder
return java.net.URLEncoder.encode(param, Charsets.UTF_8.name()).replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
throw new IntercomException("could not encode url param " + param, e);
}
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class User extends TypedData implements Replier {
private static final Map<String, String> SENTINEL = Maps.newHashMap();
private static final ArrayList<String> BULK_PATHS = Lists.newArrayListWithExpectedSize(2);
static {
BULK_PATHS.add("bulk");
BULK_PATHS.add("users");
}
private static List<CompanyWithStringPlan> buildUserUpdateCompanies(User user) {
return CompanyUpdateBuilder.buildUserUpdateCompanies(user.getCompanyCollection(), user.getRemoveCompanyCollection());
}
public static User find(String id)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
final URI users = UriBuilder.newBuilder().path("users").path(id).build();
final HttpClient resource = new HttpClient(users);
return resource.get(User.class);
}
public static User find(Map<String, String> params)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
if ((!params.containsKey("email")) && (!params.containsKey("user_id"))) {
throw new InvalidException("a user find must include an email or user_id parameter");
}
return DataResource.find(params, "users", User.class);
}
public static User create(User user)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.create(UserUpdate.buildFrom(user), "users", User.class);
}
public static User update(User user) throws InvalidException, AuthorizationException {
// only send fields the server allows for update
return DataResource.update(UserUpdate.buildFrom(user), "users", User.class);
}
public static User delete(String id)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.delete(id, "users", User.class);
}
public static UserCollection list(Map<String, String> params)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(params, "users", UserCollection.class);
}
public static UserCollection list()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.list(SENTINEL, "users", UserCollection.class);
}
public static ScrollableUserCollection scroll()
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return DataResource.scroll(null, "users", ScrollableUserCollection.class);
}
public static Job submit(final List<JobItem<User>> items)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return submit(items, null);
}
public static Job submit(final List<JobItem<User>> items, Job job)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return Job.submit(UserUpdate.validateAndConvertJobItems(items), job, BULK_PATHS);
}
public static JobItemCollection<User> listJobErrorFeed(String jobID)
throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException {
return Job.listJobErrorFeed(jobID, User.class);
}
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
static class UserUpdate extends TypedData {
private static final List<String> BULK_METHODS = Lists.newArrayList("post", "delete");
static UserUpdate buildFrom(User user) {
final UserUpdate userUpdate = new UserUpdate();
userUpdate.userId = user.getUserId();
userUpdate.email = user.getEmail();
userUpdate.phone = user.getPhone();
userUpdate.id = user.getId();
userUpdate.remoteCreatedAt = user.getRemoteCreatedAt();
userUpdate.name = user.getName();
userUpdate.lastSeenIp = user.getLastSeenIp();
userUpdate.customAttributes = user.getCustomAttributes();
userUpdate.lastSeenUserAgent = user.getUserAgentData();
if(! buildUserUpdateCompanies(user).isEmpty()) {
userUpdate.companyCollection = buildUserUpdateCompanies(user);
}
userUpdate.lastRequestAt = user.getLastRequestAt();
userUpdate.signedUpAt = user.getSignedUpAt();
userUpdate.unsubscribedFromEmails = user.getUnsubscribedFromEmails();
userUpdate.updateLastRequestAt = user.isUpdateLastRequestAt();
userUpdate.newSession = user.isNewSession();
return userUpdate;
}
static List<JobItem<UserUpdate>> validateAndConvertJobItems(List<JobItem<User>> items) {
final List<JobItem<UserUpdate>> updateItems = Lists.newArrayList();
final JobSupport jobSupport = new JobSupport();
for (JobItem<User> item : items) {
jobSupport.validateJobItem(item, BULK_METHODS);
final JobItem<UserUpdate> jobItem = new JobItem<UserUpdate>(item.getMethod(), buildFrom(item.getData()), item.getData().getType());
updateItems.add(jobItem);
}
return updateItems;
}
@JsonProperty("type")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private String type;
@JsonProperty("id")
private String id;
@JsonProperty("user_id")
private String userId;
@JsonProperty("email")
private String email;
@JsonProperty("phone")
private String phone;
@JsonProperty("remote_created_at")
private long remoteCreatedAt;
@JsonProperty("name")
private String name;
@JsonProperty("last_seen_ip")
private String lastSeenIp;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("last_seen_user_agent")
private String lastSeenUserAgent;
@JsonProperty("companies")
private List<CompanyWithStringPlan> companyCollection;
@JsonProperty("last_request_at")
private long lastRequestAt;
@JsonProperty("signed_up_at")
private long signedUpAt;
/**
* Making this a Boolean allows us to send true or false as set
* values leaving null the ignored field for NON_DEFAULT. A
* primitive would result in false not being sent
*/
@JsonProperty("unsubscribed_from_emails")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean unsubscribedFromEmails;
/**
* Making this a Boolean allows us to send true or false as set
* values leaving null the ignored field for NON_DEFAULT. A
* primitive would result in false not being sent
*/
@JsonProperty("update_last_request_at")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean updateLastRequestAt;
/**
* Making this a Boolean allows us to send true or false as set
* values leaving null the ignored field for NON_DEFAULT. A
* primitive would result in false not being sent
*/
@JsonProperty("new_session")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private Boolean newSession;
public UserUpdate() {
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public String getUserId() {
return userId;
}
public String getEmail() {
return email;
}
public String getPhone() {
return phone;
}
public long getRemoteCreatedAt() {
return remoteCreatedAt;
}
public String getName() {
return name;
}
public String getLastSeenIp() {
return lastSeenIp;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public String getLastSeenUserAgent() {
return lastSeenUserAgent;
}
public List<CompanyWithStringPlan> getCompanyCollection() {
return companyCollection;
}
public long getLastRequestAt() {
return lastRequestAt;
}
public long getSignedUpAt() {
return signedUpAt;
}
public Boolean getUnsubscribedFromEmails() {
return unsubscribedFromEmails;
}
public Boolean isUpdateLastRequestAt() {
return updateLastRequestAt;
}
public Boolean isNewSession() {
return newSession;
}
}
@JsonProperty("type")
@JsonInclude(JsonInclude.Include.ALWAYS)
private final String type = "user";
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("email")
private String email;
@JsonProperty("phone")
private String phone;
@JsonProperty("user_id")
private String userId;
@JsonProperty("pseudonym")
private String pseudonym;
@JsonProperty("avatar")
private Avatar avatar;
@JsonProperty("created_at")
private long createdAt;
@JsonProperty("updated_at")
private long updatedAt;
@JsonProperty("remote_created_at")
private long remoteCreatedAt;
@JsonProperty("unsubscribed_from_emails")
private Boolean unsubscribedFromEmails;
@JsonProperty("session_count")
private int sessionCount;
@JsonProperty("last_request_at")
private long lastRequestAt;
@JsonProperty("signed_up_at")
private long signedUpAt;
@JsonProperty("last_seen_ip")
private String lastSeenIp;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("custom_attributes")
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@JsonProperty("user_agent_data")
private String userAgentData;
@JsonProperty("location_data")
private LocationData locationData;
@JsonIgnoreProperties(ignoreUnknown = false)
@JsonProperty("companies")
private CompanyCollection companyCollection = new CompanyCollection();
@JsonProperty("social_profiles")
private SocialProfileCollection socialProfileCollection = new SocialProfileCollection();
@JsonProperty("segments")
private SegmentCollection segmentCollection = new SegmentCollection();
@JsonProperty("tags")
private TagCollection tagCollection = new TagCollection();
@JsonProperty("update_last_request_at")
private Boolean updateLastRequestAt;
@JsonProperty("new_session")
private Boolean newSession;
private Boolean untag;
private CompanyCollection removeCompanyCollection = new CompanyCollection();
public User() {
}
public User untag() {
untag = Boolean.TRUE;
return this;
}
boolean isUntag() {
return untag == null ? false : untag;
}
@JsonIgnore
public String getReplyType() {
return getType() + "_reply";
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public User setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public User setName(String name) {
this.name = name;
return this;
}
public String getEmail() {
return email;
}
public User setEmail(String email) {
this.email = email;
return this;
}
public String getPhone() {
return phone;
}
public User setPhone(String phone) {
this.phone = phone;
return this;
}
public String getUserId() {
return userId;
}
public User setUserId(String userId) {
this.userId = userId;
return this;
}
public String getPseudonym() {
return pseudonym;
}
public Avatar getAvatar() {
return avatar;
}
public long getCreatedAt() {
return createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public long getRemoteCreatedAt() {
return remoteCreatedAt;
}
public User setRemoteCreatedAt(long remoteCreatedAt) {
this.remoteCreatedAt = remoteCreatedAt;
return this;
}
public Boolean getUnsubscribedFromEmails() {
return unsubscribedFromEmails;
}
public User setUnsubscribedFromEmails(boolean unsubscribedFromEmails) {
this.unsubscribedFromEmails = unsubscribedFromEmails;
return this;
}
public int getSessionCount() {
return sessionCount;
}
public long getLastRequestAt() {
return lastRequestAt;
}
public User setLastRequestAt(long lastRequestAt) {
this.lastRequestAt = lastRequestAt;
return this;
}
public long getSignedUpAt() {
return signedUpAt;
}
public User setSignedUpAt(long signedUpAt) {
this.signedUpAt = signedUpAt;
return this;
}
public String getLastSeenIp() {
return lastSeenIp;
}
public User setLastSeenIp(String lastSeenIp) {
this.lastSeenIp = lastSeenIp;
return this;
}
public Map<String, CustomAttribute> getCustomAttributes() {
return customAttributes;
}
public User setCustomAttributes(Map<String, CustomAttribute> customAttributes) {
this.customAttributes = customAttributes;
return this;
}
public User addCustomAttribute(CustomAttribute customAttribute) {
this.customAttributes.put(customAttribute.getName(), customAttribute);
return this;
}
public String getUserAgentData() {
return userAgentData;
}
public User setUserAgentData(String userAgentData) {
this.userAgentData = userAgentData;
return this;
}
public LocationData getLocationData() {
return locationData;
}
public CompanyCollection getCompanyCollection() {
return companyCollection;
}
public User setCompanyCollection(CompanyCollection companyCollection) {
this.companyCollection = companyCollection;
return this;
}
public User addCompany(Company company) {
// sneak past the immutable list
this.companyCollection.addCompany(company);
return this;
}
public User removeCompany(Company company) {
this.removeCompanyCollection.addCompany(company);
return this;
}
public SocialProfileCollection getSocialProfileCollection() {
return socialProfileCollection;
}
public SegmentCollection getSegmentCollection() {
return segmentCollection;
}
public TagCollection getTagCollection() {
return tagCollection;
}
public Boolean isUpdateLastRequestAt() {
return updateLastRequestAt;
}
public User setUpdateLastRequestAt(boolean updateLastRequestAt) {
this.updateLastRequestAt = updateLastRequestAt;
return this;
}
public Boolean isNewSession() {
return newSession;
}
public User setNewSession(boolean newSession) {
this.newSession = newSession;
return this;
}
CompanyCollection getRemoveCompanyCollection() {
return removeCompanyCollection;
}
void setRemoveCompanyCollection(CompanyCollection removeCompanyCollection) {
this.removeCompanyCollection = removeCompanyCollection;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
if (createdAt != user.createdAt) return false;
if (lastRequestAt != user.lastRequestAt) return false;
if (signedUpAt != user.signedUpAt) return false;
if (newSession != user.newSession) return false;
if (remoteCreatedAt != user.remoteCreatedAt) return false;
if (sessionCount != user.sessionCount) return false;
if (unsubscribedFromEmails != user.unsubscribedFromEmails) return false;
if (updateLastRequestAt != user.updateLastRequestAt) return false;
if (updatedAt != user.updatedAt) return false;
if (avatar != null ? !avatar.equals(user.avatar) : user.avatar != null) return false;
if (companyCollection != null ? !companyCollection.equals(user.companyCollection) : user.companyCollection != null)
return false;
if (customAttributes != null ? !customAttributes.equals(user.customAttributes) : user.customAttributes != null)
return false;
if (email != null ? !email.equals(user.email) : user.email != null) return false;
if (phone != null ? !phone.equals(user.phone) : user.phone != null) return false;
if (id != null ? !id.equals(user.id) : user.id != null) return false;
if (lastSeenIp != null ? !lastSeenIp.equals(user.lastSeenIp) : user.lastSeenIp != null) return false;
if (locationData != null ? !locationData.equals(user.locationData) : user.locationData != null) return false;
if (name != null ? !name.equals(user.name) : user.name != null) return false;
if (segmentCollection != null ? !segmentCollection.equals(user.segmentCollection) : user.segmentCollection != null)
return false;
if (socialProfileCollection != null ? !socialProfileCollection.equals(user.socialProfileCollection) : user.socialProfileCollection != null)
return false;
if (tagCollection != null ? !tagCollection.equals(user.tagCollection) : user.tagCollection != null)
return false;
if (!type.equals(user.type)) return false;
if (untag != null ? !untag.equals(user.untag) : user.untag != null) return false;
if (userAgentData != null ? !userAgentData.equals(user.userAgentData) : user.userAgentData != null)
return false;
//noinspection RedundantIfStatement
if (userId != null ? !userId.equals(user.userId) : user.userId != null) return false;
return true;
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
result = 31 * result + (userId != null ? userId.hashCode() : 0);
result = 31 * result + (pseudonym != null ? pseudonym.hashCode() : 0);
result = 31 * result + (avatar != null ? avatar.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
result = 31 * result + (int) (remoteCreatedAt ^ (remoteCreatedAt >>> 32));
result = 31 * result + (unsubscribedFromEmails != null ? unsubscribedFromEmails.hashCode() : 0);
result = 31 * result + sessionCount;
result = 31 * result + (int) (lastRequestAt ^ (lastRequestAt >>> 32));
result = 31 * result + (int) (signedUpAt ^ (signedUpAt >>> 32));
result = 31 * result + (lastSeenIp != null ? lastSeenIp.hashCode() : 0);
result = 31 * result + (customAttributes != null ? customAttributes.hashCode() : 0);
result = 31 * result + (userAgentData != null ? userAgentData.hashCode() : 0);
result = 31 * result + (locationData != null ? locationData.hashCode() : 0);
result = 31 * result + (companyCollection != null ? companyCollection.hashCode() : 0);
result = 31 * result + (socialProfileCollection != null ? socialProfileCollection.hashCode() : 0);
result = 31 * result + (segmentCollection != null ? segmentCollection.hashCode() : 0);
result = 31 * result + (tagCollection != null ? tagCollection.hashCode() : 0);
result = 31 * result + (updateLastRequestAt != null ? updateLastRequestAt.hashCode() : 0);
result = 31 * result + (newSession != null ? newSession.hashCode() : 0);
result = 31 * result + (untag != null ? untag.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "User{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", name='" + name + '\'' +
", email='" + email + '\'' +
", phone='" + phone + '\'' +
", userId='" + userId + '\'' +
", avatar=" + avatar +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", remoteCreatedAt=" + remoteCreatedAt +
", unsubscribedFromEmails=" + unsubscribedFromEmails +
", sessionCount=" + sessionCount +
", lastRequestAt=" + lastRequestAt +
", signedUpAt=" + signedUpAt +
", lastSeenIp='" + lastSeenIp + '\'' +
", customAttributes=" + customAttributes +
", userAgentData='" + userAgentData + '\'' +
", locationData=" + locationData +
", companyCollection=" + companyCollection +
", socialProfileCollection=" + socialProfileCollection +
", segmentCollection=" + segmentCollection +
", tagCollection=" + tagCollection +
", updateLastRequestAt=" + updateLastRequestAt +
", newSession=" + newSession +
", untag=" + untag +
"} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserCollection extends TypedDataCollection<User> implements Iterator<User> {
protected TypedDataCollectionIterator<User> iterator;
public UserCollection() {
iterator = new TypedDataCollectionIterator<User>(this);
}
public UserCollection(List<User> users) {
this();
this.page = users;
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("users")
@Override
public List<User> getPage() {
return super.getPage();
}
@Override
public UserCollection nextPage() {
return fetchNextPage(UserCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public User next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class UserMessage extends TypedMessage<User, UserMessage> {
public UserMessage() {
}
@JsonIgnore
@Deprecated
public UserMessage setUser(User user) {
this.from = user;
return this;
}
@Override
public String toString() {
return "UserMessage{} " + super.toString();
}
}
package performa.intercom.resources;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class UserReply extends Reply<User> {
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
static class UserStringReply {
private UserReply reply;
public UserStringReply(UserReply reply) {
this.reply = reply;
}
@JsonProperty("type")
public String getType() {
return reply.getType();
}
@SuppressWarnings("SameReturnValue")
@JsonProperty("message_type")
public String getMessageType() {
return "comment";
}
@JsonProperty("body")
public String getBody() {
return reply.getBody();
}
@JsonProperty("intercom_user_id")
public String getIntercomUserID() {
return reply.getFrom().getId();
}
@JsonProperty("user_id")
public String getUserID() {
return reply.getFrom().getUserId();
}
@JsonProperty("email")
public String getEmail() {
return reply.getFrom().getEmail();
}
@JsonProperty("attachment_urls")
private String[] getAttachmentUrls() {
return reply.getAttachmentUrls();
}
}
public UserReply(User user) {
this.from = user;
}
@Override
public String toString() {
return "UserReply{} " + super.toString();
}
}
package performa.intercom.utils;
import java.util.HashMap;
import java.util.Map;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.security.SecUser;
import performa.intercom.resources.Company;
import performa.intercom.resources.CustomAttribute;
import performa.intercom.resources.Intercom;
import performa.intercom.resources.User;
public class IntercomUtils
{
static
{
Intercom.setToken(ConfigMgr.getKeyfileString("intercom.token", ""));
}
public static User createIntercomUser(SecUser secUser, String role, Company company)
{
try
{
User user = new User();
user.setUserId(secUser.getIdentification());
user.setEmail(secUser.getUserName());
user.setName(secUser.getName());
user.addCustomAttribute(CustomAttribute.newStringAttribute("role", role));
if(company != null)
{
user.addCompany(company);
}
return User.create(user);
}
catch (Exception e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while creating a user in intercom");
return null;
}
}
public static Company createIntercomCompany(performa.orm.Company company)
{
try
{
Company intercomCompany = new Company();
intercomCompany.setName(company.getCompanyName());
intercomCompany.setCompanyID(company.getID().toString());
return Company.create(intercomCompany);
}
catch (Exception e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while creating a company in intercom");
return null;
}
}
public static Company findCompanyByID(performa.orm.Company company)
{
try
{
Map<String, String> map = new HashMap<>();
map.put("company_id", company.getID().toString());
Company intercomCompany = Company.find(map);
if(intercomCompany == null)
{
intercomCompany = createIntercomCompany(company);
}
return intercomCompany;
}
catch (Exception e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while fetching a company by id from intercom");
return null;
}
}
}
...@@ -41,6 +41,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -41,6 +41,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Static constants corresponding to field names // Static constants corresponding to field names
public static final String FIELD_Phone = "Phone"; public static final String FIELD_Phone = "Phone";
public static final String FIELD_ForgotPasswordMailSendDate = "ForgotPasswordMailSendDate";
public static final String FIELD_ForgotPasswordKey = "ForgotPasswordKey";
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";
...@@ -62,6 +64,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -62,6 +64,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ForgotPasswordMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
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;
...@@ -69,6 +73,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -69,6 +73,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String _Phone; private String _Phone;
private Date _ForgotPasswordMailSendDate;
private String _ForgotPasswordKey;
private Date _VerificationMailSendDate; private Date _VerificationMailSendDate;
private String _VerificationKey; private String _VerificationKey;
private Boolean _IsAccountVerified; private Boolean _IsAccountVerified;
...@@ -90,6 +96,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -90,6 +96,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Arrays of validators for each attribute // Arrays of validators for each attribute
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_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;
...@@ -117,6 +125,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -117,6 +125,8 @@ public abstract class BaseCandidate extends SecUserExtension
setupAssocMetaData_ProfileAssessmentAnswers(); setupAssocMetaData_ProfileAssessmentAnswers();
setupAssocMetaData_TestInput(); setupAssocMetaData_TestInput();
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_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]);
...@@ -225,6 +235,43 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -225,6 +235,43 @@ public abstract class BaseCandidate extends SecUserExtension
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_ForgotPasswordMailSendDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "forgot_password_mail_send_date");
metaInfo.put ("name", "ForgotPasswordMailSendDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.ForgotPasswordMailSendDate:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_ForgotPasswordMailSendDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "ForgotPasswordMailSendDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.ForgotPasswordMailSendDate:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ForgotPasswordKey(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "forgot_password_key");
metaInfo.put ("length", "10");
metaInfo.put ("name", "ForgotPasswordKey");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.ForgotPasswordKey:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_ForgotPasswordKey, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "ForgotPasswordKey", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.ForgotPasswordKey:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_VerificationMailSendDate(Map validatorMapping) private static List setupAttribMetaData_VerificationMailSendDate(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -308,6 +355,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -308,6 +355,8 @@ public abstract class BaseCandidate extends SecUserExtension
_Phone = (String)(HELPER_Phone.initialise (_Phone)); _Phone = (String)(HELPER_Phone.initialise (_Phone));
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.initialise (_ForgotPasswordMailSendDate));
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (_ForgotPasswordKey));
_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);
...@@ -444,6 +493,202 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -444,6 +493,202 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute ForgotPasswordMailSendDate
*/
public Date getForgotPasswordMailSendDate ()
{
assertValid();
Date valToReturn = _ForgotPasswordMailSendDate;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getForgotPasswordMailSendDate ((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 preForgotPasswordMailSendDateChange (Date newForgotPasswordMailSendDate) 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 postForgotPasswordMailSendDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_ForgotPasswordMailSendDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ForgotPasswordMailSendDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setForgotPasswordMailSendDate (Date newForgotPasswordMailSendDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ForgotPasswordMailSendDate.compare (_ForgotPasswordMailSendDate, newForgotPasswordMailSendDate);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newForgotPasswordMailSendDate = bhd.setForgotPasswordMailSendDate ((Candidate)this, newForgotPasswordMailSendDate);
oldAndNewIdentical = HELPER_ForgotPasswordMailSendDate.compare (_ForgotPasswordMailSendDate, newForgotPasswordMailSendDate);
}
if (FIELD_ForgotPasswordMailSendDate_Validators.length > 0)
{
Object newForgotPasswordMailSendDateObj = HELPER_ForgotPasswordMailSendDate.toObject (newForgotPasswordMailSendDate);
if (newForgotPasswordMailSendDateObj != null)
{
int loopMax = FIELD_ForgotPasswordMailSendDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_ForgotPasswordMailSendDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ForgotPasswordMailSendDate_Validators[v].checkAttribute (this, FIELD_ForgotPasswordMailSendDate, metadata, newForgotPasswordMailSendDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ForgotPasswordMailSendDate () != FieldWriteability.FALSE, "Field ForgotPasswordMailSendDate is not writeable");
preForgotPasswordMailSendDateChange (newForgotPasswordMailSendDate);
markFieldChange (FIELD_ForgotPasswordMailSendDate);
_ForgotPasswordMailSendDate = newForgotPasswordMailSendDate;
postFieldChange (FIELD_ForgotPasswordMailSendDate);
postForgotPasswordMailSendDateChange ();
}
}
/**
* Get the attribute ForgotPasswordKey
*/
public String getForgotPasswordKey ()
{
assertValid();
String valToReturn = _ForgotPasswordKey;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getForgotPasswordKey ((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 preForgotPasswordKeyChange (String newForgotPasswordKey) 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 postForgotPasswordKeyChange () throws FieldException
{
}
public FieldWriteability getWriteability_ForgotPasswordKey ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ForgotPasswordKey. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setForgotPasswordKey (String newForgotPasswordKey) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ForgotPasswordKey.compare (_ForgotPasswordKey, newForgotPasswordKey);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newForgotPasswordKey = bhd.setForgotPasswordKey ((Candidate)this, newForgotPasswordKey);
oldAndNewIdentical = HELPER_ForgotPasswordKey.compare (_ForgotPasswordKey, newForgotPasswordKey);
}
if (FIELD_ForgotPasswordKey_Validators.length > 0)
{
Object newForgotPasswordKeyObj = HELPER_ForgotPasswordKey.toObject (newForgotPasswordKey);
if (newForgotPasswordKeyObj != null)
{
int loopMax = FIELD_ForgotPasswordKey_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_ForgotPasswordKey);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ForgotPasswordKey_Validators[v].checkAttribute (this, FIELD_ForgotPasswordKey, metadata, newForgotPasswordKeyObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ForgotPasswordKey () != FieldWriteability.FALSE, "Field ForgotPasswordKey is not writeable");
preForgotPasswordKeyChange (newForgotPasswordKey);
markFieldChange (FIELD_ForgotPasswordKey);
_ForgotPasswordKey = newForgotPasswordKey;
postFieldChange (FIELD_ForgotPasswordKey);
postForgotPasswordKeyChange ();
}
}
/**
* Get the attribute VerificationMailSendDate * Get the attribute VerificationMailSendDate
*/ */
public Date getVerificationMailSendDate () public Date getVerificationMailSendDate ()
...@@ -1625,6 +1870,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1625,6 +1870,8 @@ public abstract class BaseCandidate extends SecUserExtension
oneit_sec_user_extensionPSet.setAttrib (FIELD_ObjectID, myID); oneit_sec_user_extensionPSet.setAttrib (FIELD_ObjectID, myID);
oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject (_ForgotPasswordMailSendDate)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject (_ForgotPasswordKey)); //
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)); //
...@@ -1644,6 +1891,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1644,6 +1891,8 @@ public abstract class BaseCandidate extends SecUserExtension
PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (objectID, "oneit_sec_user_extension"); PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (objectID, "oneit_sec_user_extension");
_Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); // _Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); //
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.fromObject (_ForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_ForgotPasswordMailSendDate))); //
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.fromObject (_ForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_ForgotPasswordKey))); //
_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))); //
...@@ -1674,6 +1923,24 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1674,6 +1923,24 @@ public abstract class BaseCandidate extends SecUserExtension
try try
{ {
setForgotPasswordMailSendDate (otherCandidate.getForgotPasswordMailSendDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setForgotPasswordKey (otherCandidate.getForgotPasswordKey ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setVerificationMailSendDate (otherCandidate.getVerificationMailSendDate ()); setVerificationMailSendDate (otherCandidate.getVerificationMailSendDate ());
} }
catch (FieldException ex) catch (FieldException ex)
...@@ -1715,6 +1982,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1715,6 +1982,8 @@ public abstract class BaseCandidate extends SecUserExtension
BaseCandidate sourceCandidate = (BaseCandidate)(source); BaseCandidate sourceCandidate = (BaseCandidate)(source);
_Phone = sourceCandidate._Phone; _Phone = sourceCandidate._Phone;
_ForgotPasswordMailSendDate = sourceCandidate._ForgotPasswordMailSendDate;
_ForgotPasswordKey = sourceCandidate._ForgotPasswordKey;
_VerificationMailSendDate = sourceCandidate._VerificationMailSendDate; _VerificationMailSendDate = sourceCandidate._VerificationMailSendDate;
_VerificationKey = sourceCandidate._VerificationKey; _VerificationKey = sourceCandidate._VerificationKey;
_IsAccountVerified = sourceCandidate._IsAccountVerified; _IsAccountVerified = sourceCandidate._IsAccountVerified;
...@@ -1776,6 +2045,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1776,6 +2045,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.readExternalData(vals); super.readExternalData(vals);
_Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); // _Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); //
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.readExternal (_ForgotPasswordMailSendDate, vals.get(FIELD_ForgotPasswordMailSendDate))); //
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.readExternal (_ForgotPasswordKey, vals.get(FIELD_ForgotPasswordKey))); //
_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))); //
...@@ -1796,6 +2067,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1796,6 +2067,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.writeExternalData(vals); super.writeExternalData(vals);
vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone)); vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone));
vals.put (FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.writeExternal (_ForgotPasswordMailSendDate));
vals.put (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.writeExternal (_ForgotPasswordKey));
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));
...@@ -1821,6 +2094,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1821,6 +2094,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone)); listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone));
} }
if (!HELPER_ForgotPasswordMailSendDate.compare(this._ForgotPasswordMailSendDate, otherCandidate._ForgotPasswordMailSendDate))
{
listener.notifyFieldChange(this, other, FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject(this._ForgotPasswordMailSendDate), HELPER_ForgotPasswordMailSendDate.toObject(otherCandidate._ForgotPasswordMailSendDate));
}
if (!HELPER_ForgotPasswordKey.compare(this._ForgotPasswordKey, otherCandidate._ForgotPasswordKey))
{
listener.notifyFieldChange(this, other, FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject(this._ForgotPasswordKey), HELPER_ForgotPasswordKey.toObject(otherCandidate._ForgotPasswordKey));
}
if (!HELPER_VerificationMailSendDate.compare(this._VerificationMailSendDate, otherCandidate._VerificationMailSendDate)) if (!HELPER_VerificationMailSendDate.compare(this._VerificationMailSendDate, otherCandidate._VerificationMailSendDate))
{ {
listener.notifyFieldChange(this, other, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(this._VerificationMailSendDate), HELPER_VerificationMailSendDate.toObject(otherCandidate._VerificationMailSendDate)); listener.notifyFieldChange(this, other, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(this._VerificationMailSendDate), HELPER_VerificationMailSendDate.toObject(otherCandidate._VerificationMailSendDate));
...@@ -1861,6 +2142,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1861,6 +2142,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.visitAttributes (visitor); super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone())); visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone()));
visitor.visitField(this, FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject(getForgotPasswordMailSendDate()));
visitor.visitField(this, FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject(getForgotPasswordKey()));
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()));
...@@ -1926,6 +2209,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1926,6 +2209,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return filter.matches (getPhone ()); return filter.matches (getPhone ());
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return filter.matches (getForgotPasswordMailSendDate ());
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return filter.matches (getForgotPasswordKey ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return filter.matches (getVerificationMailSendDate ()); return filter.matches (getVerificationMailSendDate ());
...@@ -1979,6 +2270,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1979,6 +2270,18 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchAll andForgotPasswordMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_mail_send_date", "ForgotPasswordMailSendDate");
return this;
}
public SearchAll andForgotPasswordKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_key", "ForgotPasswordKey");
return this;
}
public SearchAll andVerificationMailSendDate (QueryFilter<Date> filter) public SearchAll andVerificationMailSendDate (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate"); filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
...@@ -2078,6 +2381,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2078,6 +2381,18 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchIdPin andForgotPasswordMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_mail_send_date", "ForgotPasswordMailSendDate");
return this;
}
public SearchIdPin andForgotPasswordKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_key", "ForgotPasswordKey");
return this;
}
public SearchIdPin andVerificationMailSendDate (QueryFilter<Date> filter) public SearchIdPin andVerificationMailSendDate (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate"); filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
...@@ -2147,6 +2462,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2147,6 +2462,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_Phone.toObject (getPhone ()); return HELPER_Phone.toObject (getPhone ());
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return HELPER_ForgotPasswordMailSendDate.toObject (getForgotPasswordMailSendDate ());
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return HELPER_ForgotPasswordKey.toObject (getForgotPasswordKey ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return HELPER_VerificationMailSendDate.toObject (getVerificationMailSendDate ()); return HELPER_VerificationMailSendDate.toObject (getVerificationMailSendDate ());
...@@ -2176,6 +2499,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2176,6 +2499,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_Phone; return HELPER_Phone;
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return HELPER_ForgotPasswordMailSendDate;
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return HELPER_ForgotPasswordKey;
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return HELPER_VerificationMailSendDate; return HELPER_VerificationMailSendDate;
...@@ -2205,6 +2536,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2205,6 +2536,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue))); setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue)));
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
setForgotPasswordMailSendDate ((Date)(HELPER_ForgotPasswordMailSendDate.fromObject (_ForgotPasswordMailSendDate, attribValue)));
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
setForgotPasswordKey ((String)(HELPER_ForgotPasswordKey.fromObject (_ForgotPasswordKey, attribValue)));
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
setVerificationMailSendDate ((Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, attribValue))); setVerificationMailSendDate ((Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, attribValue)));
...@@ -2241,6 +2580,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2241,6 +2580,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return getWriteability_Phone (); return getWriteability_Phone ();
} }
else if (fieldName.equals (FIELD_ForgotPasswordMailSendDate))
{
return getWriteability_ForgotPasswordMailSendDate ();
}
else if (fieldName.equals (FIELD_ForgotPasswordKey))
{
return getWriteability_ForgotPasswordKey ();
}
else if (fieldName.equals (FIELD_VerificationMailSendDate)) else if (fieldName.equals (FIELD_VerificationMailSendDate))
{ {
return getWriteability_VerificationMailSendDate (); return getWriteability_VerificationMailSendDate ();
...@@ -2288,6 +2635,16 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2288,6 +2635,16 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_Phone); fields.add (FIELD_Phone);
} }
if (getWriteability_ForgotPasswordMailSendDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_ForgotPasswordMailSendDate);
}
if (getWriteability_ForgotPasswordKey () != FieldWriteability.TRUE)
{
fields.add (FIELD_ForgotPasswordKey);
}
if (getWriteability_VerificationMailSendDate () != FieldWriteability.TRUE) if (getWriteability_VerificationMailSendDate () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_VerificationMailSendDate); fields.add (FIELD_VerificationMailSendDate);
...@@ -2313,6 +2670,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2313,6 +2670,8 @@ public abstract class BaseCandidate extends SecUserExtension
result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone)); result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone));
result.add(HELPER_ForgotPasswordMailSendDate.getAttribObject (getClass (), _ForgotPasswordMailSendDate, false, FIELD_ForgotPasswordMailSendDate));
result.add(HELPER_ForgotPasswordKey.getAttribObject (getClass (), _ForgotPasswordKey, false, FIELD_ForgotPasswordKey));
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));
...@@ -2385,6 +2744,42 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2385,6 +2744,42 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute ForgotPasswordMailSendDate
*/
public Date getForgotPasswordMailSendDate (Candidate obj, Date original)
{
return original;
}
/**
* Change the value set for attribute ForgotPasswordMailSendDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setForgotPasswordMailSendDate (Candidate obj, Date newForgotPasswordMailSendDate) throws FieldException
{
return newForgotPasswordMailSendDate;
}
/**
* Get the attribute ForgotPasswordKey
*/
public String getForgotPasswordKey (Candidate obj, String original)
{
return original;
}
/**
* Change the value set for attribute ForgotPasswordKey.
* May modify the field beforehand
* Occurs before validation.
*/
public String setForgotPasswordKey (Candidate obj, String newForgotPasswordKey) throws FieldException
{
return newForgotPasswordKey;
}
/**
* Get the attribute VerificationMailSendDate * Get the attribute VerificationMailSendDate
*/ */
public Date getVerificationMailSendDate (Candidate obj, Date original) public Date getVerificationMailSendDate (Candidate obj, Date original)
...@@ -2510,6 +2905,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2510,6 +2905,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return toPhone (); return toPhone ();
} }
if (name.equals ("ForgotPasswordMailSendDate"))
{
return toForgotPasswordMailSendDate ();
}
if (name.equals ("ForgotPasswordKey"))
{
return toForgotPasswordKey ();
}
if (name.equals ("VerificationMailSendDate")) if (name.equals ("VerificationMailSendDate"))
{ {
return toVerificationMailSendDate (); return toVerificationMailSendDate ();
...@@ -2534,6 +2937,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2534,6 +2937,10 @@ public abstract class BaseCandidate extends SecUserExtension
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, String> toForgotPasswordKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ForgotPasswordKey)); }
public PipeLine<From, Date> toVerificationMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_VerificationMailSendDate)); } public PipeLine<From, Date> toVerificationMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_VerificationMailSendDate)); }
public PipeLine<From, String> toVerificationKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_VerificationKey)); } public PipeLine<From, String> toVerificationKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_VerificationKey)); }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -76,7 +76,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -76,7 +76,9 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String SINGLEREFERENCE_CultureTemplate = "CultureTemplate"; public static final String SINGLEREFERENCE_CultureTemplate = "CultureTemplate";
public static final String SINGLEREFERENCE_JobTemplate = "JobTemplate"; public static final String SINGLEREFERENCE_JobTemplate = "JobTemplate";
public static final String SINGLEREFERENCE_Level = "Level"; public static final String SINGLEREFERENCE_Level = "Level";
public static final String SINGLEREFERENCE_SecUser = "SecUser"; public static final String SINGLEREFERENCE_Client = "Client";
public static final String BACKREF_Client = "";
public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser";
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";
...@@ -87,6 +89,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -87,6 +89,7 @@ public abstract class BaseJob extends BaseBusinessClass
// 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_JobKey = "JobKey"; public static final String SEARCH_JobKey = "JobKey";
public static final String SEARCH_Company = "Company";
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -156,7 +159,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -156,7 +159,8 @@ public abstract class BaseJob extends BaseBusinessClass
private SingleAssociation<Job, CultureCriteriaTemplate> _CultureTemplate; private SingleAssociation<Job, CultureCriteriaTemplate> _CultureTemplate;
private SingleAssociation<Job, Job> _JobTemplate; private SingleAssociation<Job, Job> _JobTemplate;
private SingleAssociation<Job, Level> _Level; private SingleAssociation<Job, Level> _Level;
private SingleAssociation<Job, SecUser> _SecUser; private SingleAssociation<Job, Client> _Client;
private SingleAssociation<Job, CompanyUser> _CompanyUser;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -210,6 +214,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -210,6 +214,7 @@ public abstract class BaseJob extends BaseBusinessClass
String tmp_JobApplications = JobApplication.BACKREF_Job; String tmp_JobApplications = JobApplication.BACKREF_Job;
String tmp_AssessmentCriterias = AssessmentCriteria.BACKREF_Job; String tmp_AssessmentCriterias = AssessmentCriteria.BACKREF_Job;
String tmp_CultureCriterias = CultureCriteria.BACKREF_Job; String tmp_CultureCriterias = CultureCriteria.BACKREF_Job;
String tmp_Client = Client.BACKREF_Jobs;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping")); Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
...@@ -220,7 +225,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -220,7 +225,8 @@ public abstract class BaseJob extends BaseBusinessClass
setupAssocMetaData_CultureTemplate(); setupAssocMetaData_CultureTemplate();
setupAssocMetaData_JobTemplate(); setupAssocMetaData_JobTemplate();
setupAssocMetaData_Level(); setupAssocMetaData_Level();
setupAssocMetaData_SecUser(); setupAssocMetaData_Client();
setupAssocMetaData_CompanyUser();
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]);
...@@ -360,16 +366,31 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -360,16 +366,31 @@ public abstract class BaseJob extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_SecUser() private static void setupAssocMetaData_Client()
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "secuser_id"); metaInfo.put ("backreferenceName", "Jobs");
metaInfo.put ("name", "SecUser"); metaInfo.put ("dbcol", "client_id");
metaInfo.put ("type", "SecUser"); metaInfo.put ("name", "Client");
metaInfo.put ("type", "Client");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.SecUser:", metaInfo); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.Client:", metaInfo);
ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_SecUser, Collections.unmodifiableMap (metaInfo)); ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_Client, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static void setupAssocMetaData_CompanyUser()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "company_user_id");
metaInfo.put ("name", "CompanyUser");
metaInfo.put ("type", "CompanyUser");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.CompanyUser:", metaInfo);
ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_CompanyUser, Collections.unmodifiableMap (metaInfo));
} }
...@@ -960,7 +981,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -960,7 +981,8 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate = new SingleAssociation<Job, CultureCriteriaTemplate> (this, SINGLEREFERENCE_CultureTemplate, null, CultureCriteriaTemplate.REFERENCE_CultureCriteriaTemplate, ""); _CultureTemplate = new SingleAssociation<Job, CultureCriteriaTemplate> (this, SINGLEREFERENCE_CultureTemplate, null, CultureCriteriaTemplate.REFERENCE_CultureCriteriaTemplate, "");
_JobTemplate = new SingleAssociation<Job, Job> (this, SINGLEREFERENCE_JobTemplate, null, Job.REFERENCE_Job, ""); _JobTemplate = new SingleAssociation<Job, Job> (this, SINGLEREFERENCE_JobTemplate, null, Job.REFERENCE_Job, "");
_Level = new SingleAssociation<Job, Level> (this, SINGLEREFERENCE_Level, null, Level.REFERENCE_Level, "tl_job"); _Level = new SingleAssociation<Job, Level> (this, SINGLEREFERENCE_Level, null, Level.REFERENCE_Level, "tl_job");
_SecUser = new SingleAssociation<Job, SecUser> (this, SINGLEREFERENCE_SecUser, null, SecUser.REFERENCE_SecUser, "tl_job"); _Client = new SingleAssociation<Job, Client> (this, SINGLEREFERENCE_Client, Client.MULTIPLEREFERENCE_Jobs, Client.REFERENCE_Client, "tl_job");
_CompanyUser = new SingleAssociation<Job, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "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);
...@@ -977,7 +999,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -977,7 +999,8 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate = new SingleAssociation<Job, CultureCriteriaTemplate> (this, SINGLEREFERENCE_CultureTemplate, null, CultureCriteriaTemplate.REFERENCE_CultureCriteriaTemplate, ""); _CultureTemplate = new SingleAssociation<Job, CultureCriteriaTemplate> (this, SINGLEREFERENCE_CultureTemplate, null, CultureCriteriaTemplate.REFERENCE_CultureCriteriaTemplate, "");
_JobTemplate = new SingleAssociation<Job, Job> (this, SINGLEREFERENCE_JobTemplate, null, Job.REFERENCE_Job, ""); _JobTemplate = new SingleAssociation<Job, Job> (this, SINGLEREFERENCE_JobTemplate, null, Job.REFERENCE_Job, "");
_Level = new SingleAssociation<Job, Level> (this, SINGLEREFERENCE_Level, null, Level.REFERENCE_Level, "tl_job"); _Level = new SingleAssociation<Job, Level> (this, SINGLEREFERENCE_Level, null, Level.REFERENCE_Level, "tl_job");
_SecUser = new SingleAssociation<Job, SecUser> (this, SINGLEREFERENCE_SecUser, null, SecUser.REFERENCE_SecUser, "tl_job"); _Client = new SingleAssociation<Job, Client> (this, SINGLEREFERENCE_Client, Client.MULTIPLEREFERENCE_Jobs, Client.REFERENCE_Client, "tl_job");
_CompanyUser = new SingleAssociation<Job, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "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);
...@@ -3756,7 +3779,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3756,7 +3779,9 @@ public abstract class BaseJob extends BaseBusinessClass
result.add("Level"); result.add("Level");
result.add("SecUser"); result.add("Client");
result.add("CompanyUser");
return result; return result;
...@@ -3781,9 +3806,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3781,9 +3806,12 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_Level)) }else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
return _Level.getReferencedType (); return _Level.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{ {
return _SecUser.getReferencedType (); return _Client.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{
return _CompanyUser.getReferencedType ();
} }
else else
{ {
...@@ -3801,7 +3829,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3801,7 +3829,10 @@ public abstract class BaseJob extends BaseBusinessClass
else if (assocName.equals (SINGLEREFERENCE_Level)) else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{
return Client.MULTIPLEREFERENCE_Jobs ;
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return null ; return null ;
} }
...@@ -3830,9 +3861,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3830,9 +3861,12 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_Level)) }else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
return getLevel (); return getLevel ();
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{ {
return getSecUser (); return getClient ();
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{
return getCompanyUser ();
} }
else else
{ {
...@@ -3859,9 +3893,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3859,9 +3893,12 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_Level)) }else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
return getLevel (getType); return getLevel (getType);
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{
return getClient (getType);
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getSecUser (getType); return getCompanyUser (getType);
} }
else else
{ {
...@@ -3888,9 +3925,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3888,9 +3925,12 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_Level)) }else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
return getLevelID (); return getLevelID ();
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{ {
return getSecUserID (); return getClientID ();
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{
return getCompanyUserID ();
} }
else else
{ {
...@@ -3917,9 +3957,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3917,9 +3957,12 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_Level)) }else if (assocName.equals (SINGLEREFERENCE_Level))
{ {
setLevel ((Level)(newValue)); setLevel ((Level)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_SecUser)) }else if (assocName.equals (SINGLEREFERENCE_Client))
{
setClient ((Client)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
setSecUser ((SecUser)(newValue)); setCompanyUser ((CompanyUser)(newValue));
} }
else else
{ {
...@@ -4307,20 +4350,20 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4307,20 +4350,20 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the reference SecUser * Get the reference Client
*/ */
public SecUser getSecUser () throws StorageException public Client getClient () throws StorageException
{ {
assertValid(); assertValid();
try try
{ {
return (SecUser)(_SecUser.get ()); return (Client)(_Client.get ());
} }
catch (ClassCastException e) catch (ClassCastException e)
{ {
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get SecUser:", getSecUserID ()); LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get Client:", getClientID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _SecUser.get ().getClass ()); LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Client.get ().getClass ());
throw e; throw e;
} }
} }
...@@ -4329,27 +4372,27 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4329,27 +4372,27 @@ public abstract class BaseJob extends BaseBusinessClass
/** /**
* Get the object id for the referenced object. Does not force a DB access. * Get the object id for the referenced object. Does not force a DB access.
*/ */
public SecUser getSecUser (Get getType) throws StorageException public Client getClient (Get getType) throws StorageException
{ {
assertValid(); assertValid();
return _SecUser.get(getType); return _Client.get(getType);
} }
/** /**
* Get the object id for the referenced object. Does not force a DB access. * Get the object id for the referenced object. Does not force a DB access.
*/ */
public Long getSecUserID () public Long getClientID ()
{ {
assertValid(); assertValid();
if (_SecUser == null) if (_Client == null)
{ {
return null; return null;
} }
else else
{ {
return _SecUser.getID (); return _Client.getID ();
} }
} }
...@@ -4357,7 +4400,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4357,7 +4400,7 @@ public abstract class BaseJob extends BaseBusinessClass
* Called prior to the assoc changing. Subclasses need not call super. If a field exception * 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. * is thrown, the attribute change will fail. The new value is different to the old value.
*/ */
protected void preSecUserChange (SecUser newSecUser) throws FieldException protected void preClientChange (Client newClient) throws FieldException
{ {
} }
...@@ -4367,36 +4410,143 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4367,36 +4410,143 @@ public abstract class BaseJob extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it * If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back * may lead to the TX being rolled back
*/ */
protected void postSecUserChange () throws FieldException protected void postClientChange () throws FieldException
{ {
} }
public FieldWriteability getWriteability_SecUser () public FieldWriteability getWriteability_Client ()
{ {
return getFieldWritabilityUtil (FieldWriteability.TRUE); return getFieldWritabilityUtil (FieldWriteability.TRUE);
} }
/** /**
* Set the reference SecUser. Checks to ensure a new value * Set the reference Client. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it. * has been supplied. If so, marks the reference as altered and sets it.
*/ */
public void setSecUser (SecUser newSecUser) throws StorageException, FieldException public void setClient (Client newClient) throws StorageException, FieldException
{ {
if (_SecUser.wouldReferencedChange (newSecUser)) if (_Client.wouldReferencedChange (newClient))
{ {
assertValid(); assertValid();
Debug.assertion (getWriteability_SecUser () != FieldWriteability.FALSE, "Assoc SecUser is not writeable"); Debug.assertion (getWriteability_Client () != FieldWriteability.FALSE, "Assoc Client is not writeable");
preSecUserChange (newSecUser); preClientChange (newClient);
Client oldClient = getClient ();
if (oldClient != null)
{
// This is to stop validation from triggering when we are removed
_Client.set (null);
oldClient.removeFromJobs ((Job)(this));
}
_Client.set (newClient);
if (newClient != null)
{
newClient.addToJobs ((Job)(this));
}
postClientChange ();
}
}
/**
* Get the reference CompanyUser
*/
public CompanyUser getCompanyUser () throws StorageException
{
assertValid();
try
{
return (CompanyUser)(_CompanyUser.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get CompanyUser:", getCompanyUserID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _CompanyUser.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public CompanyUser getCompanyUser (Get getType) throws StorageException
{
assertValid();
return _CompanyUser.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getCompanyUserID ()
{
assertValid();
if (_CompanyUser == null)
{
return null;
}
else
{
return _CompanyUser.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 preCompanyUserChange (CompanyUser newCompanyUser) 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 postCompanyUserChange () throws FieldException
{
}
public FieldWriteability getWriteability_CompanyUser ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference CompanyUser. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setCompanyUser (CompanyUser newCompanyUser) throws StorageException, FieldException
{
if (_CompanyUser.wouldReferencedChange (newCompanyUser))
{
assertValid();
Debug.assertion (getWriteability_CompanyUser () != FieldWriteability.FALSE, "Assoc CompanyUser is not writeable");
preCompanyUserChange (newCompanyUser);
_SecUser.set (newSecUser); _CompanyUser.set (newCompanyUser);
postSecUserChange (); postCompanyUserChange ();
} }
} }
...@@ -4846,6 +4996,20 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4846,6 +4996,20 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
try try
{ {
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_Client.isLoaded () || getTransaction ().isObjectLoaded (_Client.getReferencedType (), getClientID ()))
{
Client referenced = getClient ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Jobs from ", getObjectID (), " to ", referenced.getObjectID ());
_Client.set (null);
referenced.removeFromJobs ((Job)this);
}
}
for(JobApplication referenced : CollectionUtils.reverse(getJobApplicationsSet())) for(JobApplication referenced : CollectionUtils.reverse(getJobApplicationsSet()))
{ {
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Job from ", getObjectID (), " to ", referenced.getObjectID ()); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Job from ", getObjectID (), " to ", referenced.getObjectID ());
...@@ -4940,7 +5104,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4940,7 +5104,8 @@ public abstract class BaseJob extends BaseBusinessClass
tl_jobPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); // tl_jobPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); //
tl_jobPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); // tl_jobPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); //
_Level.getPersistentSets (allSets); _Level.getPersistentSets (allSets);
_SecUser.getPersistentSets (allSets); _Client.getPersistentSets (allSets);
_CompanyUser.getPersistentSets (allSets);
} }
...@@ -4971,7 +5136,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4971,7 +5136,8 @@ public abstract class BaseJob extends BaseBusinessClass
_State = (State)(HELPER_State.fromObject (_State, tl_jobPSet.getAttrib (FIELD_State))); // _State = (State)(HELPER_State.fromObject (_State, tl_jobPSet.getAttrib (FIELD_State))); //
_Country = (Countries)(HELPER_Country.fromObject (_Country, tl_jobPSet.getAttrib (FIELD_Country))); // _Country = (Countries)(HELPER_Country.fromObject (_Country, tl_jobPSet.getAttrib (FIELD_Country))); //
_Level.setFromPersistentSets (objectID, allSets); _Level.setFromPersistentSets (objectID, allSets);
_SecUser.setFromPersistentSets (objectID, allSets); _Client.setFromPersistentSets (objectID, allSets);
_CompanyUser.setFromPersistentSets (objectID, allSets);
} }
...@@ -5185,7 +5351,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5185,7 +5351,8 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate.copyFrom (sourceJob._CultureTemplate, linkToGhosts); _CultureTemplate.copyFrom (sourceJob._CultureTemplate, linkToGhosts);
_JobTemplate.copyFrom (sourceJob._JobTemplate, linkToGhosts); _JobTemplate.copyFrom (sourceJob._JobTemplate, linkToGhosts);
_Level.copyFrom (sourceJob._Level, linkToGhosts); _Level.copyFrom (sourceJob._Level, linkToGhosts);
_SecUser.copyFrom (sourceJob._SecUser, linkToGhosts); _Client.copyFrom (sourceJob._Client, linkToGhosts);
_CompanyUser.copyFrom (sourceJob._CompanyUser, linkToGhosts);
} }
} }
...@@ -5259,7 +5426,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5259,7 +5426,8 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate.readExternalData(vals.get(SINGLEREFERENCE_CultureTemplate)); _CultureTemplate.readExternalData(vals.get(SINGLEREFERENCE_CultureTemplate));
_JobTemplate.readExternalData(vals.get(SINGLEREFERENCE_JobTemplate)); _JobTemplate.readExternalData(vals.get(SINGLEREFERENCE_JobTemplate));
_Level.readExternalData(vals.get(SINGLEREFERENCE_Level)); _Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
_SecUser.readExternalData(vals.get(SINGLEREFERENCE_SecUser)); _Client.readExternalData(vals.get(SINGLEREFERENCE_Client));
_CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser));
_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));
...@@ -5306,7 +5474,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5306,7 +5474,8 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (SINGLEREFERENCE_CultureTemplate, _CultureTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_CultureTemplate, _CultureTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_JobTemplate, _JobTemplate.writeExternalData()); vals.put (SINGLEREFERENCE_JobTemplate, _JobTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData()); vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
vals.put (SINGLEREFERENCE_SecUser, _SecUser.writeExternalData()); vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData());
vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.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());
...@@ -5389,7 +5558,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5389,7 +5558,8 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate.compare (otherJob._CultureTemplate, listener); _CultureTemplate.compare (otherJob._CultureTemplate, listener);
_JobTemplate.compare (otherJob._JobTemplate, listener); _JobTemplate.compare (otherJob._JobTemplate, listener);
_Level.compare (otherJob._Level, listener); _Level.compare (otherJob._Level, listener);
_SecUser.compare (otherJob._SecUser, listener); _Client.compare (otherJob._Client, listener);
_CompanyUser.compare (otherJob._CompanyUser, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -5445,7 +5615,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5445,7 +5615,8 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitAssociation (_CultureTemplate); visitor.visitAssociation (_CultureTemplate);
visitor.visitAssociation (_JobTemplate); visitor.visitAssociation (_JobTemplate);
visitor.visitAssociation (_Level); visitor.visitAssociation (_Level);
visitor.visitAssociation (_SecUser); visitor.visitAssociation (_Client);
visitor.visitAssociation (_CompanyUser);
visitor.visitAssociation (_JobApplications); visitor.visitAssociation (_JobApplications);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_CultureCriterias); visitor.visitAssociation (_CultureCriterias);
...@@ -5473,9 +5644,13 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5473,9 +5644,13 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
visitor.visit (_Level); visitor.visit (_Level);
} }
if (scope.includes (_SecUser)) if (scope.includes (_Client))
{
visitor.visit (_Client);
}
if (scope.includes (_CompanyUser))
{ {
visitor.visit (_SecUser); visitor.visit (_CompanyUser);
} }
if (scope.includes (_JobApplications)) if (scope.includes (_JobApplications))
{ {
...@@ -5578,9 +5753,13 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5578,9 +5753,13 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return filter.matches (getLevel ()); return filter.matches (getLevel ());
} }
else if (attribName.equals (SINGLEREFERENCE_SecUser)) else if (attribName.equals (SINGLEREFERENCE_Client))
{
return filter.matches (getClient ());
}
else if (attribName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return filter.matches (getSecUser ()); return filter.matches (getCompanyUser ());
} }
else else
{ {
...@@ -5709,9 +5888,15 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5709,9 +5888,15 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchAll andSecUser (QueryFilter<SecUser> filter) public SearchAll andClient (QueryFilter<Client> filter)
{
filter.addFilter (context, "tl_job.client_id", "Client");
return this;
}
public SearchAll andCompanyUser (QueryFilter<CompanyUser> filter)
{ {
filter.addFilter (context, "tl_job.secuser_id", "SecUser"); filter.addFilter (context, "tl_job.company_user_id", "CompanyUser");
return this; return this;
} }
...@@ -5874,9 +6059,15 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5874,9 +6059,15 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchJobKey andSecUser (QueryFilter<SecUser> filter) public SearchJobKey andClient (QueryFilter<Client> filter)
{ {
filter.addFilter (context, "tl_job.secuser_id", "SecUser"); filter.addFilter (context, "tl_job.client_id", "Client");
return this;
}
public SearchJobKey andCompanyUser (QueryFilter<CompanyUser> filter)
{
filter.addFilter (context, "tl_job.company_user_id", "CompanyUser");
return this; return this;
} }
...@@ -5907,6 +6098,172 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5907,6 +6098,172 @@ public abstract class BaseJob extends BaseBusinessClass
.search (transaction); .search (transaction);
} }
public static SearchCompany SearchByCompany () { return new SearchCompany (); }
public static class SearchCompany extends SearchObject<Job>
{
public SearchCompany byCompany (Company Company)
{
by ("Company", Company);
return this;
}
public SearchCompany andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_job.object_id", FIELD_ObjectID);
return this;
}
public SearchCompany andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchCompany andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchCompany andJobTitle (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.job_title", "JobTitle");
return this;
}
public SearchCompany andJobDescription (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.job_description", "JobDescription");
return this;
}
public SearchCompany andJobStatus (QueryFilter<JobStatus> filter)
{
filter.addFilter (context, "tl_job.job_status", "JobStatus");
return this;
}
public SearchCompany andOpenDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.open_date", "OpenDate");
return this;
}
public SearchCompany andApplyBy (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.apply_by", "ApplyBy");
return this;
}
public SearchCompany andIncludeAssessmentCriteria (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job.include_assessment_criteria", "IncludeAssessmentCriteria");
return this;
}
public SearchCompany andAssessmentType (QueryFilter<AssessmentType> filter)
{
filter.addFilter (context, "tl_job.assessment_type", "AssessmentType");
return this;
}
public SearchCompany andRandomKey (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.random_key", "RandomKey");
return this;
}
public SearchCompany andJobType (QueryFilter<JobType> filter)
{
filter.addFilter (context, "tl_job.job_type", "JobType");
return this;
}
public SearchCompany andReferenceNumber (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.ref_number", "ReferenceNumber");
return this;
}
public SearchCompany andLastStatusChangeDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.last_status_change_date", "LastStatusChangeDate");
return this;
}
public SearchCompany andRemote (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job.remote", "Remote");
return this;
}
public SearchCompany andCity (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_job.city", "City");
return this;
}
public SearchCompany andState (QueryFilter<State> filter)
{
filter.addFilter (context, "tl_job.state", "State");
return this;
}
public SearchCompany andCountry (QueryFilter<Countries> filter)
{
filter.addFilter (context, "tl_job.country", "Country");
return this;
}
public SearchCompany andLevel (QueryFilter<Level> filter)
{
filter.addFilter (context, "tl_job.level_id", "Level");
return this;
}
public SearchCompany andClient (QueryFilter<Client> filter)
{
filter.addFilter (context, "tl_job.client_id", "Client");
return this;
}
public SearchCompany andCompanyUser (QueryFilter<CompanyUser> filter)
{
filter.addFilter (context, "tl_job.company_user_id", "CompanyUser");
return this;
}
public Job[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_Job, SEARCH_Company, criteria);
Set<Job> typedResults = new LinkedHashSet <Job> ();
for (BaseBusinessClass bbcResult : results)
{
Job aResult = (Job)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new Job[0]);
}
}
public static Job[]
searchCompany (ObjectTransaction transaction, Company Company) throws StorageException
{
return SearchByCompany ()
.byCompany (Company)
.search (transaction);
}
public Object getAttribute (String attribName) public Object getAttribute (String attribName)
...@@ -6373,9 +6730,13 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6373,9 +6730,13 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return getWriteability_Level (); return getWriteability_Level ();
} }
else if (fieldName.equals (SINGLEREFERENCE_SecUser)) else if (fieldName.equals (SINGLEREFERENCE_Client))
{ {
return getWriteability_SecUser (); return getWriteability_Client ();
}
else if (fieldName.equals (SINGLEREFERENCE_CompanyUser))
{
return getWriteability_CompanyUser ();
} }
else if (fieldName.equals (FIELD_Email)) else if (fieldName.equals (FIELD_Email))
{ {
...@@ -7374,9 +7735,13 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7374,9 +7735,13 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return toLevel (); return toLevel ();
} }
if (name.equals ("SecUser")) if (name.equals ("Client"))
{
return toClient ();
}
if (name.equals ("CompanyUser"))
{ {
return toSecUser (); return toCompanyUser ();
} }
...@@ -7463,11 +7828,17 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7463,11 +7828,17 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_Level, filter)); return Level.REFERENCE_Level.new LevelPipeLineFactory<From, Level> (this, new ORMSingleAssocPipe<Me, Level>(SINGLEREFERENCE_Level, filter));
} }
public SecUser.SecUserPipeLineFactory<From, SecUser> toSecUser () { return toSecUser (Filter.ALL); } public Client.ClientPipeLineFactory<From, Client> toClient () { return toClient (Filter.ALL); }
public Client.ClientPipeLineFactory<From, Client> toClient (Filter<Client> filter)
{
return Client.REFERENCE_Client.new ClientPipeLineFactory<From, Client> (this, new ORMSingleAssocPipe<Me, Client>(SINGLEREFERENCE_Client, filter));
}
public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toCompanyUser () { return toCompanyUser (Filter.ALL); }
public SecUser.SecUserPipeLineFactory<From, SecUser> toSecUser (Filter<SecUser> filter) public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toCompanyUser (Filter<CompanyUser> filter)
{ {
return SecUser.REFERENCE_SecUser.new SecUserPipeLineFactory<From, SecUser> (this, new ORMSingleAssocPipe<Me, SecUser>(SINGLEREFERENCE_SecUser, filter)); return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter));
} }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); } public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); }
...@@ -7654,18 +8025,32 @@ class DummyJob extends Job ...@@ -7654,18 +8025,32 @@ class DummyJob extends Job
return Level.DUMMY_Level.getObjectID(); return Level.DUMMY_Level.getObjectID();
} }
public SecUser getSecUser () throws StorageException public Client getClient () throws StorageException
{
return (Client)(Client.DUMMY_Client);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getClientID ()
{
return Client.DUMMY_Client.getObjectID();
}
public CompanyUser getCompanyUser () throws StorageException
{ {
return (SecUser)(SecUser.DUMMY_SecUser); return (CompanyUser)(CompanyUser.DUMMY_CompanyUser);
} }
/** /**
* Get the object id for the referenced object. Does not force a DB access. * Get the object id for the referenced object. Does not force a DB access.
*/ */
public Long getSecUserID () public Long getCompanyUserID ()
{ {
return SecUser.DUMMY_SecUser.getObjectID(); return CompanyUser.DUMMY_CompanyUser.getObjectID();
} }
public int getJobApplicationsCount () throws StorageException public int getJobApplicationsCount () throws StorageException
......
...@@ -132,4 +132,23 @@ public class Candidate extends BaseCandidate ...@@ -132,4 +132,23 @@ public class Candidate extends BaseCandidate
new ObjectTransform[] {CultureCriteriaAnswer.pipesCultureCriteriaAnswer().toObjectID()}, new ObjectTransform[] {CultureCriteriaAnswer.pipesCultureCriteriaAnswer().toObjectID()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR}); new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR});
} }
public static Candidate getCandidateForForgotPassword(ObjectTransaction transaction, String userIDStr, String code)
{
userIDStr = StringUtils.subBlanks(userIDStr);
code = StringUtils.subBlanks(code);
if(userIDStr != null && code!=null)
{
Candidate candidate = Candidate.getCandidateByID(transaction, Long.parseLong(userIDStr));
if(candidate != null && CollectionUtils.equals(candidate.getForgotPasswordKey(), code))
{
return candidate;
}
}
return null;
}
} }
\ No newline at end of file
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE"> <TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="Phone" type="String" dbcol="phone" length="30"/> <ATTRIB name="Phone" type="String" dbcol="phone" length="30"/>
<ATTRIB name="ForgotPasswordMailSendDate" type="Date" dbcol="forgot_password_mail_send_date" />
<ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" /> <ATTRIB name="ForgotPasswordKey" type="String" dbcol="forgot_password_key" length="10"/>
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/> <ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" />
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/> <ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
<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'/>
......
...@@ -28,6 +28,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -28,6 +28,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String dummyPhone; private String dummyPhone;
private Date dummyForgotPasswordMailSendDate;
private String dummyForgotPasswordKey;
private Date dummyVerificationMailSendDate; private Date dummyVerificationMailSendDate;
private String dummyVerificationKey; private String dummyVerificationKey;
private Boolean dummyIsAccountVerified; private Boolean dummyIsAccountVerified;
...@@ -35,6 +37,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -35,6 +37,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ForgotPasswordMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
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;
...@@ -45,13 +49,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -45,13 +49,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
public CandidatePersistenceMgr () public CandidatePersistenceMgr ()
{ {
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone)); dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
dummyForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.initialise (dummyForgotPasswordMailSendDate));
dummyForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (dummyForgotPasswordKey));
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));
} }
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.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {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.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
...@@ -104,6 +110,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -104,6 +110,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
if (false || if (false ||
!oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || !oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_Phone)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_Phone)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_ForgotPasswordMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_ForgotPasswordKey)||
!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)||
...@@ -207,10 +215,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -207,10 +215,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 = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, 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 = ?, 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_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 (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 (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)
{ {
...@@ -574,6 +582,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -574,6 +582,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE")); oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.getFromRS(dummyForgotPasswordMailSendDate, r, "forgot_password_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.getFromRS(dummyForgotPasswordKey, r, "forgot_password_key"));
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"));
...@@ -596,10 +606,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -596,10 +606,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, verification_mail_send_date, verification_key, is_account_verified, 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, 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_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 (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 (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;
import oneit.logging.LoggingArea;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.utils.StringUtils;
import oneit.utils.filter.Filter;
import performa.orm.types.JobStatus;
public class Client extends BaseClient
{
private static final long serialVersionUID = 0L;
public static LoggingArea LOG = LoggingArea.createLoggingArea("Client");
// This constructor should not be called
public Client ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
public int getApplicationCountByStatus(JobStatus jobStatus)
{
Filter<Job> filter = Job.SearchByAll().andJobStatus(new EqualsFilter<>(jobStatus));
return pipelineClient().toJobs(filter).toJobApplications().uniqueVals().size();
}
@Override
public String getToString()
{
return StringUtils.subNulls(getClientName(), super.getToString());
}
}
\ 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="Client" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.types.TimeZone"/>
<IMPORT value="oneit.business.shopping.orm.*"/>
<MULTIPLEREFERENCE name="Jobs" type="Job" backreferenceName="Client" />
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TABLE name="tl_client" tablePrefix="object">
<ATTRIB name="ClientName" type="String" dbcol="client_name" mandatory="true" length="100"/>
<ATTRIB name="ClientLogo" type="BinaryContent" dbcol="client_logo" mandatory="false" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
<ATTRIB name="Email" type="String" dbcol="email" mandatory="false" length="100" validators="Email" />
<ATTRIB name="ContactName" type="String" dbcol="contact_name" mandatory="false" length="100"/>
<ATTRIB name="ContactSurname" type="String" dbcol="contact_surname" mandatory="false" length="100"/>
<ATTRIB name="Phone" type="String" dbcol="phone" mandatory="false" length="30" />
<ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" backreferenceName="Clients" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_client.object_id is not null" orderBy="tl_client.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.*;
import performa.orm.types.TimeZone;
import oneit.business.shopping.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea ClientPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Client");
// Private attributes corresponding to business object data
private String dummyClientName;
private BinaryContent dummyClientLogo;
private String dummyEmail;
private String dummyContactName;
private String dummyContactSurname;
private String dummyPhone;
private State dummyState;
private Countries dummyCountry;
private String dummyPostCode;
private String dummyCity;
private TimeZone dummyTimeZone;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_ClientName = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_ClientLogo = BLOBAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Email = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ContactName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ContactSurname = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State);
private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_City = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_TimeZone = new EnumeratedAttributeHelper (TimeZone.FACTORY_TimeZone);
public ClientPersistenceMgr ()
{
dummyClientName = (String)(HELPER_ClientName.initialise (dummyClientName));
dummyClientLogo = (BinaryContent)(HELPER_ClientLogo.initialise (dummyClientLogo));
dummyEmail = (String)(HELPER_Email.initialise (dummyEmail));
dummyContactName = (String)(HELPER_ContactName.initialise (dummyContactName));
dummyContactSurname = (String)(HELPER_ContactSurname.initialise (dummyContactSurname));
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
dummyState = (State)(HELPER_State.initialise (dummyState));
dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry));
dummyPostCode = (String)(HELPER_PostCode.initialise (dummyPostCode));
dummyCity = (String)(HELPER_City.initialise (dummyCity));
dummyTimeZone = (TimeZone)(HELPER_TimeZone.initialise (dummyTimeZone));
}
private String SELECT_COLUMNS = "{PREFIX}tl_client.object_id as id, {PREFIX}tl_client.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_client.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_client.client_name, {PREFIX}tl_client.client_logo, {PREFIX}tl_client.email, {PREFIX}tl_client.contact_name, {PREFIX}tl_client.contact_surname, {PREFIX}tl_client.phone, {PREFIX}tl_client.state, {PREFIX}tl_client.country, {PREFIX}tl_client.post_code, {PREFIX}tl_client.city, {PREFIX}tl_client.time_zone, {PREFIX}tl_client.company_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, Client.REFERENCE_Client);
if (objectToReturn instanceof Client)
{
LogMgr.log (ClientPersistence, 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 Client");
}
}
PersistentSet tl_clientPSet = allPSets.getPersistentSet(id, "tl_client", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_clientPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_clientPSet.containsAttrib(Client.FIELD_ClientName)||
!tl_clientPSet.containsAttrib(Client.FIELD_ClientLogo)||
!tl_clientPSet.containsAttrib(Client.FIELD_Email)||
!tl_clientPSet.containsAttrib(Client.FIELD_ContactName)||
!tl_clientPSet.containsAttrib(Client.FIELD_ContactSurname)||
!tl_clientPSet.containsAttrib(Client.FIELD_Phone)||
!tl_clientPSet.containsAttrib(Client.FIELD_State)||
!tl_clientPSet.containsAttrib(Client.FIELD_Country)||
!tl_clientPSet.containsAttrib(Client.FIELD_PostCode)||
!tl_clientPSet.containsAttrib(Client.FIELD_City)||
!tl_clientPSet.containsAttrib(Client.FIELD_TimeZone)||
!tl_clientPSet.containsAttrib(Client.SINGLEREFERENCE_Company))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (ClientPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
Client result = new Client ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_client " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_client.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 (Client.SINGLEREFERENCE_Company))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_client " +
"WHERE " + SELECT_JOINS + "company_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_clientPSet = allPSets.getPersistentSet(objectID, "tl_client");
if (tl_clientPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_clientPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_client " +
"SET client_name = ?, client_logo = ?, email = ?, contact_name = ?, contact_surname = ?, phone = ?, state = ?, country = ?, post_code = ?, city = ?, time_zone = ?, company_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_client.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_ClientName.getForSQL(dummyClientName, tl_clientPSet.getAttrib (Client.FIELD_ClientName))).listEntry (HELPER_ClientLogo.getForSQL(dummyClientLogo, tl_clientPSet.getAttrib (Client.FIELD_ClientLogo))).listEntry (HELPER_Email.getForSQL(dummyEmail, tl_clientPSet.getAttrib (Client.FIELD_Email))).listEntry (HELPER_ContactName.getForSQL(dummyContactName, tl_clientPSet.getAttrib (Client.FIELD_ContactName))).listEntry (HELPER_ContactSurname.getForSQL(dummyContactSurname, tl_clientPSet.getAttrib (Client.FIELD_ContactSurname))).listEntry (HELPER_Phone.getForSQL(dummyPhone, tl_clientPSet.getAttrib (Client.FIELD_Phone))).listEntry (HELPER_State.getForSQL(dummyState, tl_clientPSet.getAttrib (Client.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_clientPSet.getAttrib (Client.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_clientPSet.getAttrib (Client.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_clientPSet.getAttrib (Client.FIELD_City))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_clientPSet.getAttrib (Client.FIELD_TimeZone))).listEntry (SQLManager.CheckNull((Long)(tl_clientPSet.getAttrib (Client.SINGLEREFERENCE_Company)))).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_client 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_client", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (ClientPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_client");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_client for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (ClientPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_clientPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (ClientPersistence, 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_clientPSet = allPSets.getPersistentSet(objectID, "tl_client");
LogMgr.log (ClientPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_clientPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_clientPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_client " +
"WHERE tl_client.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_client WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_client");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_client for row:" + objectID;
LogMgr.log (ClientPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_clientPSet.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, Client> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (Client.REFERENCE_Client.getObjectIDSpace (), r.getLong ("id"));
Client 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, Client.REFERENCE_Client);
if (cachedElement instanceof Client)
{
LogMgr.log (ClientPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (Client)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a Client");
}
}
else
{
PersistentSet tl_clientPSet = allPSets.getPersistentSet(objectID, "tl_client", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new Client ();
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 (ClientPersistence, 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_client " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (Client.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_client.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_client.object_id is not null
String preFilter = "(tl_client.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_client " + 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_clientPSet = allPSets.getPersistentSet(objectID, "tl_client", PersistentSetStatus.FETCHED);
// Object Modified
tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_clientPSet.setAttrib(Client.FIELD_ClientName, HELPER_ClientName.getFromRS(dummyClientName, r, "client_name"));
tl_clientPSet.setAttrib(Client.FIELD_ClientLogo, HELPER_ClientLogo.getFromRS(dummyClientLogo, r, "client_logo"));
tl_clientPSet.setAttrib(Client.FIELD_Email, HELPER_Email.getFromRS(dummyEmail, r, "email"));
tl_clientPSet.setAttrib(Client.FIELD_ContactName, HELPER_ContactName.getFromRS(dummyContactName, r, "contact_name"));
tl_clientPSet.setAttrib(Client.FIELD_ContactSurname, HELPER_ContactSurname.getFromRS(dummyContactSurname, r, "contact_surname"));
tl_clientPSet.setAttrib(Client.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
tl_clientPSet.setAttrib(Client.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state"));
tl_clientPSet.setAttrib(Client.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_clientPSet.setAttrib(Client.FIELD_PostCode, HELPER_PostCode.getFromRS(dummyPostCode, r, "post_code"));
tl_clientPSet.setAttrib(Client.FIELD_City, HELPER_City.getFromRS(dummyCity, r, "city"));
tl_clientPSet.setAttrib(Client.FIELD_TimeZone, HELPER_TimeZone.getFromRS(dummyTimeZone, r, "time_zone"));
tl_clientPSet.setAttrib(Client.SINGLEREFERENCE_Company, r.getObject ("company_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_clientPSet = allPSets.getPersistentSet(objectID, "tl_client");
if (tl_clientPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_clientPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_client " +
" (client_name, client_logo, email, contact_name, contact_surname, phone, state, country, post_code, city, time_zone, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_ClientName.getForSQL(dummyClientName, tl_clientPSet.getAttrib (Client.FIELD_ClientName))).listEntry (HELPER_ClientLogo.getForSQL(dummyClientLogo, tl_clientPSet.getAttrib (Client.FIELD_ClientLogo))).listEntry (HELPER_Email.getForSQL(dummyEmail, tl_clientPSet.getAttrib (Client.FIELD_Email))).listEntry (HELPER_ContactName.getForSQL(dummyContactName, tl_clientPSet.getAttrib (Client.FIELD_ContactName))).listEntry (HELPER_ContactSurname.getForSQL(dummyContactSurname, tl_clientPSet.getAttrib (Client.FIELD_ContactSurname))).listEntry (HELPER_Phone.getForSQL(dummyPhone, tl_clientPSet.getAttrib (Client.FIELD_Phone))).listEntry (HELPER_State.getForSQL(dummyState, tl_clientPSet.getAttrib (Client.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_clientPSet.getAttrib (Client.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_clientPSet.getAttrib (Client.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_clientPSet.getAttrib (Client.FIELD_City))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_clientPSet.getAttrib (Client.FIELD_TimeZone))) .listEntry (SQLManager.CheckNull((Long)(tl_clientPSet.getAttrib (Client.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).toList().toArray());
tl_clientPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm;
import oneit.logging.LoggingArea;
import oneit.security.SecUser;
import oneit.utils.CollectionUtils;
import oneit.utils.parsers.FieldException;
public class Company extends BaseCompany
{
private static final long serialVersionUID = 0L;
public static LoggingArea LOG = LoggingArea.createLoggingArea("Company");
// This constructor should not be called
public Company ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
public boolean showHasClientSupport()
{
return isTrue(getHasClientSupport());
}
//This logic moved from invite_users.jsp
public boolean createDefaultUser() throws FieldException
{
boolean addUser = true;
for (CompanyUser cUser : getUsersSet())
{
if(!CollectionUtils.equals(cUser, getAddedByUser()))
{
addUser = false;
}
}
if(addUser)
{
SecUser secUser = SecUser.createSecUser(getTransaction());
CompanyUser companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
addToUsers(companyUser);
}
return addUser;
}
}
\ 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="Company" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.types.TimeZone"/>
<IMPORT value="oneit.business.shopping.orm.*"/>
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/>
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/>
<TRANSIENT name="UserEmail" type="String" validators="Email" />
<TRANSIENT name="FirstName" type="String"/>
<TRANSIENT name="LastName" type="String"/>
<TRANSIENT name="RoleType" type="RoleType" defaultValue="RoleType.STANDARD" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TABLE name="tl_company" tablePrefix="object">
<ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100" />
<ATTRIB name="CompanyLogo" type="BinaryContent" dbcol="company_logo" mandatory="false" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
<ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="IsVerified" type="Boolean" dbcol="is_verified" defaultValue="Boolean.FALSE"/>
<ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_company.object_id is not null" >
</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.*;
import performa.orm.types.TimeZone;
import oneit.business.shopping.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea CompanyPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "Company");
// Private attributes corresponding to business object data
private String dummyCompanyName;
private BinaryContent dummyCompanyLogo;
private HiringTeamType dummyHiringTeamType;
private Industry dummyIndustry;
private TimeZone dummyTimeZone;
private Boolean dummyIsVerified;
private State dummyState;
private Countries dummyCountry;
private String dummyPostCode;
private String dummyCity;
private Boolean dummyHasClientSupport;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_CompanyName = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_CompanyLogo = BLOBAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_HiringTeamType = new EnumeratedAttributeHelper (HiringTeamType.FACTORY_HiringTeamType);
private static final EnumeratedAttributeHelper HELPER_Industry = new EnumeratedAttributeHelper (Industry.FACTORY_Industry);
private static final EnumeratedAttributeHelper HELPER_TimeZone = new EnumeratedAttributeHelper (TimeZone.FACTORY_TimeZone);
private static final DefaultAttributeHelper HELPER_IsVerified = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State);
private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_City = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_HasClientSupport = DefaultAttributeHelper.INSTANCE;
public CompanyPersistenceMgr ()
{
dummyCompanyName = (String)(HELPER_CompanyName.initialise (dummyCompanyName));
dummyCompanyLogo = (BinaryContent)(HELPER_CompanyLogo.initialise (dummyCompanyLogo));
dummyHiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (dummyHiringTeamType));
dummyIndustry = (Industry)(HELPER_Industry.initialise (dummyIndustry));
dummyTimeZone = (TimeZone)(HELPER_TimeZone.initialise (dummyTimeZone));
dummyIsVerified = (Boolean)(HELPER_IsVerified.initialise (dummyIsVerified));
dummyState = (State)(HELPER_State.initialise (dummyState));
dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry));
dummyPostCode = (String)(HELPER_PostCode.initialise (dummyPostCode));
dummyCity = (String)(HELPER_City.initialise (dummyCity));
dummyHasClientSupport = (Boolean)(HELPER_HasClientSupport.initialise (dummyHasClientSupport));
}
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.company_logo, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.added_by_user_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, Company.REFERENCE_Company);
if (objectToReturn instanceof Company)
{
LogMgr.log (CompanyPersistence, 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 Company");
}
}
PersistentSet tl_companyPSet = allPSets.getPersistentSet(id, "tl_company", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_companyPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_companyPSet.containsAttrib(Company.FIELD_CompanyName)||
!tl_companyPSet.containsAttrib(Company.FIELD_CompanyLogo)||
!tl_companyPSet.containsAttrib(Company.FIELD_HiringTeamType)||
!tl_companyPSet.containsAttrib(Company.FIELD_Industry)||
!tl_companyPSet.containsAttrib(Company.FIELD_TimeZone)||
!tl_companyPSet.containsAttrib(Company.FIELD_IsVerified)||
!tl_companyPSet.containsAttrib(Company.FIELD_State)||
!tl_companyPSet.containsAttrib(Company.FIELD_Country)||
!tl_companyPSet.containsAttrib(Company.FIELD_PostCode)||
!tl_companyPSet.containsAttrib(Company.FIELD_City)||
!tl_companyPSet.containsAttrib(Company.FIELD_HasClientSupport)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_AddedByUser))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (CompanyPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
Company result = new Company ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_company " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_company.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_companyPSet = allPSets.getPersistentSet(objectID, "tl_company");
if (tl_companyPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_companyPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_company " +
"SET company_name = ?, company_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).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_company 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_company", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (CompanyPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_company");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_company for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (CompanyPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (CompanyPersistence, 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_companyPSet = allPSets.getPersistentSet(objectID, "tl_company");
LogMgr.log (CompanyPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_companyPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_companyPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_company " +
"WHERE tl_company.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_company WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_company");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_company for row:" + objectID;
LogMgr.log (CompanyPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_companyPSet.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, Company> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (Company.REFERENCE_Company.getObjectIDSpace (), r.getLong ("id"));
Company 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, Company.REFERENCE_Company);
if (cachedElement instanceof Company)
{
LogMgr.log (CompanyPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (Company)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a Company");
}
}
else
{
PersistentSet tl_companyPSet = allPSets.getPersistentSet(objectID, "tl_company", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new Company ();
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 (CompanyPersistence, 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_company " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (Company.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_company.object_id is not null
String preFilter = "(tl_company.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_company " + 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_companyPSet = allPSets.getPersistentSet(objectID, "tl_company", PersistentSetStatus.FETCHED);
// Object Modified
tl_companyPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_companyPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_companyPSet.setAttrib(Company.FIELD_CompanyName, HELPER_CompanyName.getFromRS(dummyCompanyName, r, "company_name"));
tl_companyPSet.setAttrib(Company.FIELD_CompanyLogo, HELPER_CompanyLogo.getFromRS(dummyCompanyLogo, r, "company_logo"));
tl_companyPSet.setAttrib(Company.FIELD_HiringTeamType, HELPER_HiringTeamType.getFromRS(dummyHiringTeamType, r, "hiring_team_type"));
tl_companyPSet.setAttrib(Company.FIELD_Industry, HELPER_Industry.getFromRS(dummyIndustry, r, "industry"));
tl_companyPSet.setAttrib(Company.FIELD_TimeZone, HELPER_TimeZone.getFromRS(dummyTimeZone, r, "time_zone"));
tl_companyPSet.setAttrib(Company.FIELD_IsVerified, HELPER_IsVerified.getFromRS(dummyIsVerified, r, "is_verified"));
tl_companyPSet.setAttrib(Company.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state"));
tl_companyPSet.setAttrib(Company.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_companyPSet.setAttrib(Company.FIELD_PostCode, HELPER_PostCode.getFromRS(dummyPostCode, r, "post_code"));
tl_companyPSet.setAttrib(Company.FIELD_City, HELPER_City.getFromRS(dummyCity, r, "city"));
tl_companyPSet.setAttrib(Company.FIELD_HasClientSupport, HELPER_HasClientSupport.getFromRS(dummyHasClientSupport, r, "has_client_support"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_AddedByUser, r.getObject ("added_by_user_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_companyPSet = allPSets.getPersistentSet(objectID, "tl_company");
if (tl_companyPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_companyPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_company " +
" (company_name, company_logo, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray());
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm;
import oneit.logging.LoggingArea;
import oneit.objstore.*;
import oneit.security.SecUser;
import oneit.security.jsp.SecUserToNameTransform;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.RoleType;
import performa.utils.Utils;
public class CompanyUser extends BaseCompanyUser
{
private static final long serialVersionUID = 0L;
public static LoggingArea LOG = LoggingArea.createLoggingArea("CompanyUser");
public static final String DEFAULT_PASSWORD = "Talentology123";
// This constructor should not be called
public CompanyUser ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
public static CompanyUser getCompanyUserForForgotPassword(ObjectTransaction transaction, String userIDStr, String code)
{
userIDStr = StringUtils.subBlanks(userIDStr);
code = StringUtils.subBlanks(code);
if(userIDStr != null && code!=null)
{
CompanyUser companyUser = CompanyUser.getCompanyUserByID(transaction, Long.parseLong(userIDStr));
if(companyUser != null && CollectionUtils.equals(companyUser.getForgotPasswordKey(), code))
{
return companyUser;
}
}
return null;
}
@Override
public String getToString()
{
return SecUserToNameTransform.INSTANCE.transform(getUser());
}
@Override
protected void postRoleChange() throws FieldException
{
SecUser secUser = getUser();
if(getRole()==RoleType.ADMIN)
{
if(secUser.hasRole(Utils.ROLE_COMPANY_USER))
{
secUser.removeRole(Utils.getRole(Utils.ROLE_COMPANY_USER, getTransaction()));
}
secUser.addRole(Utils.getRole(Utils.ROLE_COMPANY_ADMIN, getTransaction()));
}
else if(getRole()==RoleType.STANDARD)
{
if(secUser.hasRole(Utils.ROLE_COMPANY_ADMIN))
{
secUser.removeRole(Utils.getRole(Utils.ROLE_COMPANY_ADMIN, getTransaction()));
}
secUser.addRole(Utils.getRole(Utils.ROLE_COMPANY_USER, getTransaction()));
}
super.postRoleChange();
}
@Override
public FieldWriteability getWriteability_Role()
{
if(CollectionUtils.equals(getCompany().getAddedByUser(),this))
{
return FieldWriteability.NOT_IN_GUI;
}
return super.getWriteability_Role();
}
public Boolean emailExists()
{
if(getEmail() != null)
{
SecUser user = SecUser.searchNAME(getTransaction(), getEmail().toLowerCase());
return user != null && user.getExtension(CompanyUser.REFERENCE_CompanyUser) != null;
}
return Boolean.FALSE;
}
public String getEmailAddressFromUser()
{
return StringUtils.isEmailAddress(getUser().getUserName()) ? getUser().getUserName() : getUser().getEmail();
}
public Boolean isLoggedViaSocial()
{
return !StringUtils.isEmailAddress(getUser().getUserName());
}
}
\ 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="CompanyUser" package="performa.orm" superclass="SecUserExtension">
<IMPORT value="oneit.security.*" />
<IMPORT value="performa.orm.types.*"/>
<TRANSIENT name="Email" type="String" validators="Email" />
<TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/>
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="ForgotPasswordMailSendDate" type="Date" dbcol="forgot_password_mail_send_date" />
<ATTRIB name="ForgotPasswordKey" type="String" dbcol="forgot_password_key" length="10"/>
<ATTRIB name="Role" type="RoleType" dbcol="role_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Phone" type="String" dbcol="phone" mandatory="false" length="30" />
<ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" />
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsEmailChanged" type="Boolean" dbcol="is_email_changed" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" backreferenceName="Users"/>
</TABLE>
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" >
</SEARCH>
<SEARCH type="AllCompanyUsers" paramFilter="oneit_sec_user_extension.object_id is not null">
<PARAM name="ReferenceExtension" type="SecUserExtension" transform="context.getTag (ReferenceExtension)" paramFilter="oneit_sec_user_extension.object_type = ${ReferenceExtension}"/>
</SEARCH>
<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="Pin" type="String" paramFilter="verification_key = ${Pin}" />
</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 oneit.security.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
{
private static final LoggingArea CompanyUserPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "CompanyUser");
// Private attributes corresponding to business object data
private Date dummyForgotPasswordMailSendDate;
private String dummyForgotPasswordKey;
private RoleType dummyRole;
private String dummyPhone;
private Date dummyVerificationMailSendDate;
private String dummyVerificationKey;
private Boolean dummyIsAccountVerified;
private Boolean dummyIsEmailChanged;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_ForgotPasswordMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_Role = new EnumeratedAttributeHelper (RoleType.FACTORY_RoleType);
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsEmailChanged = DefaultAttributeHelper.INSTANCE;
public CompanyUserPersistenceMgr ()
{
dummyForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.initialise (dummyForgotPasswordMailSendDate));
dummyForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (dummyForgotPasswordKey));
dummyRole = (RoleType)(HELPER_Role.initialise (dummyRole));
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate));
dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey));
dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified));
dummyIsEmailChanged = (Boolean)(HELPER_IsEmailChanged.initialise (dummyIsEmailChanged));
}
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.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.role_type, {PREFIX}oneit_sec_user_extension.phone, {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_email_changed, {PREFIX}oneit_sec_user_extension.user_id, {PREFIX}oneit_sec_user_extension.company_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, CompanyUser.REFERENCE_CompanyUser);
if (objectToReturn instanceof CompanyUser)
{
LogMgr.log (CompanyUserPersistence, 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 CompanyUser");
}
}
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(id, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
String objectType = null;
// Check for persistent sets already prefetched
if (false ||
!oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_ForgotPasswordMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_ForgotPasswordKey)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_Role)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_Phone)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_VerificationMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_VerificationKey)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_IsAccountVerified)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_IsEmailChanged)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.SINGLEREFERENCE_User)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.SINGLEREFERENCE_Company))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (CompanyUserPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Polymorphic */
objectType = (String)(oneit_sec_user_extensionPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (CompanyUser.REFERENCE_CompanyUser, objectType) != CompanyUser.REFERENCE_CompanyUser)
{
idsToFetch.add (id.longValue());
}
else
{
CompanyUser result = new CompanyUser ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "{PREFIX}oneit_sec_user_extension.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 (CompanyUser.SINGLEREFERENCE_User))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "user_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else if (refName.equals (CompanyUser.SINGLEREFERENCE_Company))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE " + SELECT_JOINS + "company_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 oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}oneit_sec_user_extension " +
"SET forgot_password_mail_send_date = ?, forgot_password_key = ?, role_type = ?, phone = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, is_email_changed = ?, user_id = ? , company_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsAccountVerified))).listEntry (HELPER_IsEmailChanged.getForSQL(dummyIsEmailChanged, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsEmailChanged))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))).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}oneit_sec_user_extension 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[] { "oneit_sec_user_extension", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (CompanyUserPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "oneit_sec_user_extension");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:oneit_sec_user_extension for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (CompanyUserPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (CompanyUserPersistence, 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 oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
LogMgr.log (CompanyUserPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}oneit_sec_user_extension " +
"WHERE oneit_sec_user_extension.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}oneit_sec_user_extension WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "oneit_sec_user_extension");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:oneit_sec_user_extension for row:" + objectID;
LogMgr.log (CompanyUserPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public ResultSet executeSearchQueryAllCompanyUsers (SQLManager sqlMgr, SecUserExtension ReferenceExtension) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAllCompanyUsers");
}
public ResultSet executeSearchQueryIdPin (SQLManager sqlMgr, Long ID, String Pin) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryIdPin");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, CompanyUser> results = new LinkedHashMap ();
MultiHashtable<String,ObjectID> needsRefetch = new MultiHashtable ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (CompanyUser.REFERENCE_CompanyUser.getObjectIDSpace (), r.getLong ("id"));
CompanyUser 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, CompanyUser.REFERENCE_CompanyUser);
if (cachedElement instanceof CompanyUser)
{
LogMgr.log (CompanyUserPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (CompanyUser)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a CompanyUser");
}
}
else
{
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
String objectType = (String)(oneit_sec_user_extensionPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (CompanyUser.REFERENCE_CompanyUser, objectType) != CompanyUser.REFERENCE_CompanyUser)
{
needsRefetch.add (objectType, objectID); // We will fetch these later
resultElement = new CompanyUser ();
resultElement.initialiseGhost (objectID);
}
else
{
resultElement = new CompanyUser ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
}
results.put (objectID, resultElement);
}
for (String objectType : needsRefetch.keySet())
{
BaseBusinessClass referenceObject = context.getReferenceObject (CompanyUser.REFERENCE_CompanyUser, objectType);
ObjectPersistenceMgr persistenceMgr = context.getPersistenceMgr (referenceObject);
ResourceCheckpoint checkpoint = sqlMgr.getCheckpoint();
Set<BaseBusinessClass> objsRefetched = persistenceMgr.fetchByIDs(new HashSet (needsRefetch.getValuesForKey (objectType)), allPSets, context, sqlMgr);
checkpoint.releaseNewResources();
for (BaseBusinessClass objRefetched : objsRefetched)
{
results.put (objRefetched.getID (), (CompanyUser)objRefetched);
}
}
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 (CompanyUserPersistence, 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}oneit_sec_user_extension " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (CompanyUser.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.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}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 (CompanyUser.SEARCH_AllCompanyUsers))
{
// Local scope for transformed variables
{
if (criteria.containsKey("ReferenceExtension"))
{
SecUserExtension ReferenceExtension = (SecUserExtension)(criteria.get("ReferenceExtension"));
criteria.put ("ReferenceExtension", context.getTag (ReferenceExtension));
}
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
+ " ";
if (criteria.containsKey("ReferenceExtension"))
{
preFilter += " AND (oneit_sec_user_extension.object_type = ${ReferenceExtension}) ";
preFilter += "";
}
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}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 (CompanyUser.SEARCH_IdPin))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
+ " ";
if (criteria.containsKey("ID"))
{
preFilter += " AND (object_id = ${ID} ) ";
preFilter += "";
}
if (criteria.containsKey("Pin"))
{
preFilter += " AND (verification_key = ${Pin}) ";
preFilter += "";
}
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}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
{
BaseBusinessClass[] resultsArray = super.find(searchType, allPSets, criteria, context, sqlMgr);
Vector results = new Vector ();
for (int x = 0 ; x < resultsArray.length ; ++x)
{
if (resultsArray[x] instanceof CompanyUser)
{
results.add (resultsArray[x]);
}
else
{
// Ignore
}
}
resultsArray = new BaseBusinessClass[results.size ()];
results.copyInto (resultsArray);
return resultsArray;
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension", PersistentSetStatus.FETCHED);
// Object Modified
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.getFromRS(dummyForgotPasswordMailSendDate, r, "forgot_password_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.getFromRS(dummyForgotPasswordKey, r, "forgot_password_key"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_Role, HELPER_Role.getFromRS(dummyRole, r, "role_type"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_IsEmailChanged, HELPER_IsEmailChanged.getFromRS(dummyIsEmailChanged, r, "is_email_changed"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.SINGLEREFERENCE_User, r.getObject ("user_id"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.SINGLEREFERENCE_Company, r.getObject ("company_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet oneit_sec_user_extensionPSet = allPSets.getPersistentSet(objectID, "oneit_sec_user_extension");
if (oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.PROCESSED &&
oneit_sec_user_extensionPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (forgot_password_mail_send_date, forgot_password_key, role_type, phone, verification_mail_send_date, verification_key, is_account_verified, is_email_changed, user_id, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsAccountVerified))).listEntry (HELPER_IsEmailChanged.getForSQL(dummyIsEmailChanged, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsEmailChanged))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm; package performa.orm;
import oneit.utils.StringUtils;
public class CultureNarrative extends BaseCultureNarrative public class CultureNarrative extends BaseCultureNarrative
{ {
...@@ -16,4 +18,10 @@ public class CultureNarrative extends BaseCultureNarrative ...@@ -16,4 +18,10 @@ public class CultureNarrative extends BaseCultureNarrative
{ {
return "CultureNarrative"; return "CultureNarrative";
} }
@Override
public String getToString()
{
return StringUtils.subNulls(getNotes(), super.getToString());
}
} }
\ No newline at end of file
...@@ -53,7 +53,11 @@ public class Job extends BaseJob ...@@ -53,7 +53,11 @@ public class Job extends BaseJob
public void initAttribs() throws BusinessException public void initAttribs() throws BusinessException
{ {
setRandomKey(RandomStringGen.getRandomStringGen().generateAlphaNum(4)); setRandomKey(RandomStringGen.getRandomStringGen().generateAlphaNum(4));
setSecUser(SecUser.getTXUser(getTransaction()));
//TODO: verify
SecUser txUser = SecUser.getTXUser(getTransaction());
setCompanyUser(txUser.getExtension(CompanyUser.REFERENCE_CompanyUser));
} }
...@@ -89,6 +93,11 @@ public class Job extends BaseJob ...@@ -89,6 +93,11 @@ public class Job extends BaseJob
return FieldWriteability.NOT_IN_GUI; return FieldWriteability.NOT_IN_GUI;
} }
if(getJobStatus() == JobStatus.FILLED)
{
return FieldWriteability.NOT_IN_GUI;
}
return super.getWriteability_JobStatus(); return super.getWriteability_JobStatus();
} }
...@@ -371,11 +380,11 @@ public class Job extends BaseJob ...@@ -371,11 +380,11 @@ public class Job extends BaseJob
return getApplyBy() != null && DateDiff.endOfDay(getApplyBy()).before(DateDiff.getToday()); return getApplyBy() != null && DateDiff.endOfDay(getApplyBy()).before(DateDiff.getToday());
} }
public List<AppProcessOption> getValidProcessOptions(String tabNumber) public List<AppProcessOption> getValidProcessOptions(boolean isShortlist)
{ {
List<AppProcessOption> options = new ArrayList<>(); List<AppProcessOption> options = new ArrayList<>();
if(tabNumber == null || CollectionUtils.equals(tabNumber, "1")) if(!isShortlist)
{ {
options.add(AppProcessOption.TO_SHORTLIST); options.add(AppProcessOption.TO_SHORTLIST);
} }
...@@ -391,7 +400,16 @@ public class Job extends BaseJob ...@@ -391,7 +400,16 @@ public class Job extends BaseJob
StringBuilder title = new StringBuilder(); StringBuilder title = new StringBuilder();
title.append("Talentology - "); title.append("Talentology - ");
// TODO: add company / client name
if(isClientAvailable())
{
title.append(getClient()).append(" - ");
}
else if(getCompanyUser() != null && getCompanyUser().getCompany() != null)
{
title.append(getCompanyUser().getCompany()).append(" - ");
}
title.append(getJobTitle()).append(" "); title.append(getJobTitle()).append(" ");
if(getReferenceNumber() != null) if(getReferenceNumber() != null)
...@@ -445,4 +463,40 @@ public class Job extends BaseJob ...@@ -445,4 +463,40 @@ public class Job extends BaseJob
return Boolean.FALSE; return Boolean.FALSE;
} }
public Boolean isClientAvailable()
{
return getClient() != null && getCompanyUser() != null && isTrue(getCompanyUser().getCompany().getHasClientSupport());
}
public BinaryContent getLogo()
{
if(isClientAvailable() && getClient().getClientLogo()!= null)
{
return getClient().getClientLogo();
}
else if(getCompanyUser() != null && getCompanyUser().getCompany().getCompanyLogo() != null)
{
return getCompanyUser().getCompany().getCompanyLogo();
}
return null;
}
public List<JobStatus> getAvailableStatus()
{
if(getJobStatus() == JobStatus.OPEN)
{
return Arrays.asList(new JobStatus[]{JobStatus.COMPLETE, JobStatus.FILLED});
}
else if(getJobStatus() == JobStatus.COMPLETE)
{
return Arrays.asList(new JobStatus[]{JobStatus.FILLED});
}
return Arrays.asList(new JobStatus[]{JobStatus.OPEN, JobStatus.COMPLETE, JobStatus.FILLED});
}
} }
\ No newline at end of file
...@@ -47,9 +47,10 @@ ...@@ -47,9 +47,10 @@
<ATTRIB name="State" type="State" dbcol="state" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="State" type="State" dbcol="state" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="Country" type="Countries" dbcol="country" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="true"/> <SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="true"/>
<SINGLEREFERENCE name="SecUser" type="SecUser" dbcol="secuser_id" /> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" />
</TABLE> </TABLE>
<SEARCH type="All" paramFilter="tl_job.object_id is not null" orderBy="tl_job.object_id" /> <SEARCH type="All" paramFilter="tl_job.object_id is not null" orderBy="tl_job.object_id" />
...@@ -59,6 +60,11 @@ ...@@ -59,6 +60,11 @@
<PARAM name="Key" type="String" paramFilter="random_key = ${Key}" /> <PARAM name="Key" type="String" paramFilter="random_key = ${Key}" />
</SEARCH> </SEARCH>
<SEARCH type="Company" paramFilter="tl_job.object_id is not null" orderBy="tl_job.object_id">
<TABLE name="oneit_sec_user_extension" join="oneit_sec_user_extension.object_id = tl_job.company_user_id"/>
<TABLE name="tl_company" join="tl_company.object_id = oneit_sec_user_extension.company_id"/>
<PARAM name="Company" type="Company" transform="Company.getObjectID ()" paramFilter="tl_company.object_id = ${Company}"/>
</SEARCH>
</BUSINESSCLASS> </BUSINESSCLASS>
</ROOT> </ROOT>
\ No newline at end of file
...@@ -307,12 +307,12 @@ public class JobApplication extends BaseJobApplication ...@@ -307,12 +307,12 @@ public class JobApplication extends BaseJobApplication
public Double getRoleFitScore() public Double getRoleFitScore()
{ {
return getRoleFit() != null ? (Double)getRoleFit().get(null) : 0d; return getRoleFit() != null && getRoleFit().get(null) != null ? ((Tuple.T2<Double, ColorCode>)getRoleFit().get(null)).get0() : 0d;
} }
public Long getCultureFitScore() public Long getCultureFitScore()
{ {
return getCultureFit() != null ? (Long) getCultureFit().get(null) : 0; return getCultureFit() != null && getCultureFit().get(null) != null ? ((Tuple.T2<Long, Set<Tuple.T3>>)getCultureFit().get(null)).get0() : 0L;
} }
public Long getRequirementFitScore() public Long getRequirementFitScore()
...@@ -325,7 +325,7 @@ public class JobApplication extends BaseJobApplication ...@@ -325,7 +325,7 @@ public class JobApplication extends BaseJobApplication
{ {
JobApplication jobTopper = getJob() != null ? getJob().getTopper() : null; JobApplication jobTopper = getJob() != null ? getJob().getTopper() : null;
Double myScore = getRoleFitScore(); Double myScore = getRoleFitScore();
Double topScore = jobTopper.getRoleFitScore(); Double topScore = jobTopper != null ? jobTopper.getRoleFitScore() : null;
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2); return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2);
} }
...@@ -464,4 +464,24 @@ public class JobApplication extends BaseJobApplication ...@@ -464,4 +464,24 @@ public class JobApplication extends BaseJobApplication
{ {
return (CollectionUtils.equals(candidate, getCandidate()) && CollectionUtils.equals(job, getJob())); return (CollectionUtils.equals(candidate, getCandidate()) && CollectionUtils.equals(job, getJob()));
} }
public MultiHashtable<CultureClass, CultureCriteriaAnswer> getCultureAnswersByClass()
{
MultiHashtable<CultureClass, CultureCriteriaAnswer> answersByClass = new MultiHashtable<>();
answersByClass.groupValues(getCandidate().getCultureCriteriaAnswersSet(), CultureCriteriaAnswer.pipesCultureCriteriaAnswer().toCultureElement().toCultureClass());
return answersByClass;
}
public MultiHashtable<Importance, AssessmentCriteriaAnswer> getRequirementAnswersByImportance()
{
MultiHashtable<Importance, AssessmentCriteriaAnswer> answersByImportance = new MultiHashtable<>();
answersByImportance.groupValues(getAssessmentCriteriaAnswersSet(), AssessmentCriteriaAnswer.pipesAssessmentCriteriaAnswer().toAssessmentCriteria().toImportance());
return answersByImportance;
}
} }
\ No newline at end of file
...@@ -86,7 +86,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -86,7 +86,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.state, {PREFIX}tl_job.country, {PREFIX}tl_job.level_id, {PREFIX}tl_job.secuser_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.state, {PREFIX}tl_job.country, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.company_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
...@@ -153,7 +153,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -153,7 +153,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!tl_jobPSet.containsAttrib(Job.FIELD_State)|| !tl_jobPSet.containsAttrib(Job.FIELD_State)||
!tl_jobPSet.containsAttrib(Job.FIELD_Country)|| !tl_jobPSet.containsAttrib(Job.FIELD_Country)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Level)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Level)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_SecUser)) !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Client)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_CompanyUser))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -199,6 +200,16 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -199,6 +200,16 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
throw new RuntimeException (); throw new RuntimeException ();
} }
else if (refName.equals (Job.SINGLEREFERENCE_Client))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_job " +
"WHERE " + SELECT_JOINS + "client_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else else
{ {
throw new IllegalArgumentException ("Illegal reference type:" + refName); throw new IllegalArgumentException ("Illegal reference type:" + refName);
...@@ -223,10 +234,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -223,10 +234,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 = ?, state = ?, country = ?, level_id = ? , secuser_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 = ?, state = ?, country = ?, level_id = ? , client_id = ? , company_user_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_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))).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_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).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_CompanyUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -318,6 +329,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -318,6 +329,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{ {
throw new RuntimeException ("NOT implemented: executeSearchQueryJobKey"); throw new RuntimeException ("NOT implemented: executeSearchQueryJobKey");
} }
public ResultSet executeSearchQueryCompany (SQLManager sqlMgr, Company Company) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryCompany");
}
...@@ -519,6 +534,56 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -519,6 +534,56 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
return results; return results;
} }
else if (searchType.equals (Job.SEARCH_Company))
{
// Local scope for transformed variables
{
if (criteria.containsKey("Company"))
{
Company Company = (Company)(criteria.get("Company"));
criteria.put ("Company", Company.getObjectID ());
}
}
String orderBy = " ORDER BY tl_job.object_id";
String tables = ", oneit_sec_user_extension, tl_company ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_job.object_id is not null
String preFilter = "(tl_job.object_id is not null)"
+ " AND (oneit_sec_user_extension.object_id = tl_job.company_user_id) AND (tl_company.object_id = oneit_sec_user_extension.company_id) ";
if (criteria.containsKey("Company"))
{
preFilter += " AND (tl_company.object_id = ${Company}) ";
preFilter += "";
}
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_job " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else else
{ {
...@@ -555,7 +620,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -555,7 +620,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
tl_jobPSet.setAttrib(Job.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country")); tl_jobPSet.setAttrib(Job.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Level, r.getObject ("level_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Level, r.getObject ("level_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_SecUser, r.getObject ("secuser_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Client, r.getObject ("client_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id"));
} }
...@@ -572,10 +638,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -572,10 +638,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, state, country, level_id, secuser_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, state, country, level_id, client_id, company_user_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_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_SecUser)))) .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_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))) .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_CompanyUser)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED); tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
package performa.orm.types;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import oneit.appservices.dbenums.*;
public class BO_Industry extends BaseBO_Industry
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public BO_Industry ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
package performa.orm.types;
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 oneit.appservices.dbenums.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class BO_IndustryPersistenceMgr extends AbstractEnumeratedBOPersistenceMgr
{
private static final LoggingArea BO_IndustryPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "BO_Industry");
// Private attributes corresponding to business object data
private String dummyName;
private String dummyValue;
private String dummyDescription;
private long dummySortOrder;
private boolean dummyDisabled;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Name = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Value = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_SortOrder = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Disabled = DefaultAttributeHelper.INSTANCE;
public BO_IndustryPersistenceMgr ()
{
dummyName = (String)(HELPER_Name.initialise (dummyName));
dummyValue = (String)(HELPER_Value.initialise (dummyValue));
dummyDescription = (String)(HELPER_Description.initialise (dummyDescription));
dummySortOrder = (long)(HELPER_SortOrder.initialise (dummySortOrder));
dummyDisabled = (boolean)(HELPER_Disabled.initialise (dummyDisabled));
}
private String SELECT_COLUMNS = "{PREFIX}tl_industry.Object_id as id, {PREFIX}tl_industry.Object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_industry.Object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_industry.NAME, {PREFIX}tl_industry.VALUE, {PREFIX}tl_industry.DESCRIPTION, {PREFIX}tl_industry.SORT_ORDER, {PREFIX}tl_industry.DISABLED, 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, BO_Industry.REFERENCE_BO_Industry);
if (objectToReturn instanceof BO_Industry)
{
LogMgr.log (BO_IndustryPersistence, 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 BO_Industry");
}
}
PersistentSet tl_industryPSet = allPSets.getPersistentSet(id, "tl_industry", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_industryPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_industryPSet.containsAttrib(BO_Industry.FIELD_Name)||
!tl_industryPSet.containsAttrib(BO_Industry.FIELD_Value)||
!tl_industryPSet.containsAttrib(BO_Industry.FIELD_Description)||
!tl_industryPSet.containsAttrib(BO_Industry.FIELD_SortOrder)||
!tl_industryPSet.containsAttrib(BO_Industry.FIELD_Disabled))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (BO_IndustryPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
BO_Industry result = new BO_Industry ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_industry " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_industry.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_industryPSet = allPSets.getPersistentSet(objectID, "tl_industry");
if (tl_industryPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_industryPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_industry " +
"SET NAME = ?, VALUE = ?, DESCRIPTION = ?, SORT_ORDER = ?, DISABLED = ? , Object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_industry.Object_id = ? AND " + getConcurrencyCheck (sqlMgr, "Object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_industryPSet.getAttrib (BO_Industry.FIELD_Name))).listEntry (HELPER_Value.getForSQL(dummyValue, tl_industryPSet.getAttrib (BO_Industry.FIELD_Value))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_industryPSet.getAttrib (BO_Industry.FIELD_Description))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_industryPSet.getAttrib (BO_Industry.FIELD_SortOrder))).listEntry (HELPER_Disabled.getForSQL(dummyDisabled, tl_industryPSet.getAttrib (BO_Industry.FIELD_Disabled))).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_industry 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_industry", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (BO_IndustryPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_industry");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_industry for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (BO_IndustryPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_industryPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (BO_IndustryPersistence, 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_industryPSet = allPSets.getPersistentSet(objectID, "tl_industry");
LogMgr.log (BO_IndustryPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_industryPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_industryPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_industry " +
"WHERE tl_industry.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_industry WHERE Object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_industry");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_industry for row:" + objectID;
LogMgr.log (BO_IndustryPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_industryPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryALL (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryALL");
}
public ResultSet executeSearchQueryBY_NAME (SQLManager sqlMgr, String name) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryBY_NAME");
}
public ResultSet executeSearchQueryBY_VALUE (SQLManager sqlMgr, String value) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryBY_VALUE");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, BO_Industry> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (BO_Industry.REFERENCE_BO_Industry.getObjectIDSpace (), r.getLong ("id"));
BO_Industry 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, BO_Industry.REFERENCE_BO_Industry);
if (cachedElement instanceof BO_Industry)
{
LogMgr.log (BO_IndustryPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (BO_Industry)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a BO_Industry");
}
}
else
{
PersistentSet tl_industryPSet = allPSets.getPersistentSet(objectID, "tl_industry", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new BO_Industry ();
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 (BO_IndustryPersistence, 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_industry " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (BO_Industry.SEARCH_ALL))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter:
filter = "object_id IS NOT NULL"
+ " ";
searchParams = new Object[] { };
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_industry " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (BO_Industry.SEARCH_BY_NAME))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter:
filter = "NAME = ?"
+ " ";
searchParams = new Object[] { criteria.get ("name") };
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_industry " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (BO_Industry.SEARCH_BY_VALUE))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter:
filter = "VALUE = ?"
+ " ";
searchParams = new Object[] { criteria.get ("value") };
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_industry " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
BaseBusinessClass[] resultsArray = super.find(searchType, allPSets, criteria, context, sqlMgr);
Vector results = new Vector ();
for (int x = 0 ; x < resultsArray.length ; ++x)
{
if (resultsArray[x] instanceof BO_Industry)
{
results.add (resultsArray[x]);
}
else
{
// Ignore
}
}
resultsArray = new BaseBusinessClass[results.size ()];
results.copyInto (resultsArray);
return resultsArray;
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_industryPSet = allPSets.getPersistentSet(objectID, "tl_industry", PersistentSetStatus.FETCHED);
// Object Modified
tl_industryPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_industryPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_industryPSet.setAttrib(BO_Industry.FIELD_Name, HELPER_Name.getFromRS(dummyName, r, "NAME"));
tl_industryPSet.setAttrib(BO_Industry.FIELD_Value, HELPER_Value.getFromRS(dummyValue, r, "VALUE"));
tl_industryPSet.setAttrib(BO_Industry.FIELD_Description, HELPER_Description.getFromRS(dummyDescription, r, "DESCRIPTION"));
tl_industryPSet.setAttrib(BO_Industry.FIELD_SortOrder, HELPER_SortOrder.getFromRS(dummySortOrder, r, "SORT_ORDER"));
tl_industryPSet.setAttrib(BO_Industry.FIELD_Disabled, HELPER_Disabled.getFromRS(dummyDisabled, r, "DISABLED"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_industryPSet = allPSets.getPersistentSet(objectID, "tl_industry");
if (tl_industryPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_industryPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_industry " +
" (NAME, VALUE, DESCRIPTION, SORT_ORDER, DISABLED, Object_id, Object_LAST_UPDATED_DATE, Object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_industryPSet.getAttrib (BO_Industry.FIELD_Name))).listEntry (HELPER_Value.getForSQL(dummyValue, tl_industryPSet.getAttrib (BO_Industry.FIELD_Value))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_industryPSet.getAttrib (BO_Industry.FIELD_Description))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_industryPSet.getAttrib (BO_Industry.FIELD_SortOrder))).listEntry (HELPER_Disabled.getForSQL(dummyDisabled, tl_industryPSet.getAttrib (BO_Industry.FIELD_Disabled))) .listEntry (objectID.longID ()).toList().toArray());
tl_industryPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
/*
* 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.types;
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 oneit.appservices.dbenums.*;
public abstract class BaseBO_Industry extends AbstractEnumeratedBO
{
// Reference instance for the object
public static final BO_Industry REFERENCE_BO_Industry = new BO_Industry ();
// Reference instance for the object
public static final BO_Industry DUMMY_BO_Industry = new DummyBO_Industry ();
// Static constants corresponding to field names
public static final String FIELD_Disabled = "Disabled";
// Static constants corresponding to searches
public static final String SEARCH_ALL = "ALL";
public static final String SEARCH_BY_NAME = "BY_NAME";
public static final String SEARCH_BY_VALUE = "BY_VALUE";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<BO_Industry> HELPER_Disabled = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private boolean _Disabled;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_BO_Industry = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Disabled_Validators;
// Arrays of behaviour decorators
private static final BO_IndustryBehaviourDecorator[] BO_Industry_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_Disabled_Validators = (AttributeValidator[])setupAttribMetaData_Disabled(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_BO_Industry.initialiseReference ();
DUMMY_BO_Industry.initialiseReference ();
BO_Industry_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(BO_Industry.class).toArray(new BO_IndustryBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_Disabled(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "DISABLED");
metaInfo.put ("name", "Disabled");
metaInfo.put ("type", "boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for BO_Industry.Disabled:", metaInfo);
ATTRIBUTES_METADATA_BO_Industry.put (FIELD_Disabled, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(BO_Industry.class, "Disabled", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for BO_Industry.Disabled:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseBO_Industry ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return BO_Industry_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_Disabled = (boolean)(HELPER_Disabled.initialise (_Disabled));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute Disabled
*/
public boolean getDisabled ()
{
assertValid();
boolean valToReturn = _Disabled;
for (BO_IndustryBehaviourDecorator bhd : BO_Industry_BehaviourDecorators)
{
valToReturn = bhd.getDisabled ((BO_Industry)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 preDisabledChange (boolean newDisabled) 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 postDisabledChange () throws FieldException
{
}
public FieldWriteability getWriteability_Disabled ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Disabled. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDisabled (boolean newDisabled) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Disabled.compare (_Disabled, newDisabled);
try
{
for (BO_IndustryBehaviourDecorator bhd : BO_Industry_BehaviourDecorators)
{
newDisabled = bhd.setDisabled ((BO_Industry)this, newDisabled);
oldAndNewIdentical = HELPER_Disabled.compare (_Disabled, newDisabled);
}
if (FIELD_Disabled_Validators.length > 0)
{
Object newDisabledObj = HELPER_Disabled.toObject (newDisabled);
if (newDisabledObj != null)
{
int loopMax = FIELD_Disabled_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_BO_Industry.get (FIELD_Disabled);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Disabled_Validators[v].checkAttribute (this, FIELD_Disabled, metadata, newDisabledObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Disabled () != FieldWriteability.FALSE, "Field Disabled is not writeable");
preDisabledChange (newDisabled);
markFieldChange (FIELD_Disabled);
_Disabled = newDisabled;
postFieldChange (FIELD_Disabled);
postDisabledChange ();
}
}
/**
* 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 BO_Industry newInstance ()
{
return new BO_Industry ();
}
public BO_Industry referenceInstance ()
{
return REFERENCE_BO_Industry;
}
public BO_Industry getInTransaction (ObjectTransaction t) throws StorageException
{
return getBO_IndustryByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_BO_Industry;
}
public String getBaseSetName ()
{
return "tl_industry";
}
/**
* 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_industryPSet = allSets.getPersistentSet (myID, "tl_industry", myPSetStatus);
tl_industryPSet.setAttrib (FIELD_ObjectID, myID);
tl_industryPSet.setAttrib (FIELD_Disabled, HELPER_Disabled.toObject (_Disabled)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_industryPSet = allSets.getPersistentSet (objectID, "tl_industry");
_Disabled = (boolean)(HELPER_Disabled.fromObject (_Disabled, tl_industryPSet.getAttrib (FIELD_Disabled))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof BO_Industry)
{
BO_Industry otherBO_Industry = (BO_Industry)other;
try
{
setDisabled (otherBO_Industry.getDisabled ());
}
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 BaseBO_Industry)
{
BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(source);
_Disabled = sourceBO_Industry._Disabled;
}
}
/**
* 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 BaseBO_Industry)
{
BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(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 BaseBO_Industry)
{
BaseBO_Industry sourceBO_Industry = (BaseBO_Industry)(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);
_Disabled = (boolean)(HELPER_Disabled.readExternal (_Disabled, vals.get(FIELD_Disabled))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_Disabled, HELPER_Disabled.writeExternal (_Disabled));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseBO_Industry)
{
BaseBO_Industry otherBO_Industry = (BaseBO_Industry)(other);
if (!HELPER_Disabled.compare(this._Disabled, otherBO_Industry._Disabled))
{
listener.notifyFieldChange(this, other, FIELD_Disabled, HELPER_Disabled.toObject(this._Disabled), HELPER_Disabled.toObject(otherBO_Industry._Disabled));
}
// 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_Disabled, HELPER_Disabled.toObject(getDisabled()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static BO_Industry createBO_Industry (ObjectTransaction transaction) throws StorageException
{
BO_Industry result = new BO_Industry ();
result.initialiseNewObject (transaction);
return result;
}
public static BO_Industry getBO_IndustryByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (BO_Industry)(transaction.getObjectByID (REFERENCE_BO_Industry, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Disabled))
{
return filter.matches (getDisabled ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchALL SearchByALL () { return new SearchALL (); }
public static class SearchALL extends SearchObject<BO_Industry>
{
public BO_Industry[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_ALL, criteria);
Set<BO_Industry> typedResults = new LinkedHashSet <BO_Industry> ();
for (BaseBusinessClass bbcResult : results)
{
BO_Industry aResult = (BO_Industry)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
}
}
public static BO_Industry[]
searchALL (ObjectTransaction transaction) throws StorageException
{
return SearchByALL ()
.search (transaction);
}
public static SearchBY_NAME SearchByBY_NAME () { return new SearchBY_NAME (); }
public static class SearchBY_NAME extends SearchObject<BO_Industry>
{
public SearchBY_NAME byName (String name)
{
by ("name", name);
return this;
}
public BO_Industry[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_BY_NAME, criteria);
Set<BO_Industry> typedResults = new LinkedHashSet <BO_Industry> ();
for (BaseBusinessClass bbcResult : results)
{
BO_Industry aResult = (BO_Industry)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
}
}
public static BO_Industry[]
searchBY_NAME (ObjectTransaction transaction, String name) throws StorageException
{
return SearchByBY_NAME ()
.byName (name)
.search (transaction);
}
public static SearchBY_VALUE SearchByBY_VALUE () { return new SearchBY_VALUE (); }
public static class SearchBY_VALUE extends SearchObject<BO_Industry>
{
public SearchBY_VALUE byValue (String value)
{
by ("value", value);
return this;
}
public BO_Industry[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_BO_Industry, SEARCH_BY_VALUE, criteria);
Set<BO_Industry> typedResults = new LinkedHashSet <BO_Industry> ();
for (BaseBusinessClass bbcResult : results)
{
BO_Industry aResult = (BO_Industry)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new BO_Industry[0]);
}
}
public static BO_Industry[]
searchBY_VALUE (ObjectTransaction transaction, String value) throws StorageException
{
return SearchByBY_VALUE ()
.byValue (value)
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Disabled))
{
return HELPER_Disabled.toObject (getDisabled ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Disabled))
{
return HELPER_Disabled;
}
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_Disabled))
{
setDisabled ((boolean)(HELPER_Disabled.fromObject (_Disabled, 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_Disabled))
{
return getWriteability_Disabled ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_Disabled () != FieldWriteability.TRUE)
{
fields.add (FIELD_Disabled);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_Disabled.getAttribObject (getClass (), _Disabled, false, FIELD_Disabled));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_BO_Industry.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_BO_Industry.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_BO_Industry.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_BO_Industry.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 BO_IndustryBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<BO_Industry>
{
/**
* Get the attribute Disabled
*/
public boolean getDisabled (BO_Industry obj, boolean original)
{
return original;
}
/**
* Change the value set for attribute Disabled.
* May modify the field beforehand
* Occurs before validation.
*/
public boolean setDisabled (BO_Industry obj, boolean newDisabled) throws FieldException
{
return newDisabled;
}
}
public ORMPipeLine pipes()
{
return new BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> ((BO_Industry)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> pipelineBO_Industry()
{
return (BO_IndustryPipeLineFactory<BO_Industry, BO_Industry>) pipes();
}
public static BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> pipesBO_Industry(Collection<BO_Industry> items)
{
return REFERENCE_BO_Industry.new BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> (items);
}
public static BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> pipesBO_Industry(BO_Industry[] _items)
{
return pipesBO_Industry(Arrays.asList (_items));
}
public static BO_IndustryPipeLineFactory<BO_Industry, BO_Industry> pipesBO_Industry()
{
return pipesBO_Industry((Collection)null);
}
public class BO_IndustryPipeLineFactory<From extends BaseBusinessClass, Me extends BO_Industry> extends AbstractEnumeratedBOPipeLineFactory<From, Me>
{
public <Prev> BO_IndustryPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public BO_IndustryPipeLineFactory (From seed)
{
super(seed);
}
public BO_IndustryPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Disabled"))
{
return toDisabled ();
}
return super.to(name);
}
public PipeLine<From, Boolean> toDisabled () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_Disabled)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyBO_Industry extends BO_Industry
{
// Default constructor primarily to support Externalisable
public DummyBO_Industry()
{
super();
}
public void assertValid ()
{
}
}
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 ClientSortOption extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_ClientSortOption = new ClientSortOptionFactory();
public static final ClientSortOption ALPHA_A_Z = new ClientSortOption ("ALPHA_A_Z", "ALPHA_A_Z", "A-Z", false);
public static final ClientSortOption ALPHA_Z_A = new ClientSortOption ("ALPHA_Z_A", "ALPHA_Z_A", "Z-A", false);
public static final ClientSortOption OPEN_JOBS = new ClientSortOption ("OPEN_JOBS", "OPEN_JOBS", "Open Jobs", false);
public static final ClientSortOption FILLED_JOBS = new ClientSortOption ("FILLED_JOBS", "FILLED_JOBS", "Filled Jobs", false);
private static final ClientSortOption[] allClientSortOptions =
new ClientSortOption[] { ALPHA_A_Z,ALPHA_Z_A,OPEN_JOBS,FILLED_JOBS};
private static ClientSortOption[] getAllClientSortOptions ()
{
return allClientSortOptions;
}
private ClientSortOption (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allClientSortOptions);
static
{
defineAdditionalData ();
}
public boolean isEqual (ClientSortOption other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return ClientSortOption.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return ClientSortOption.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_ClientSortOption;
}
public static ClientSortOption forName (String name)
{
if (name == null) { return null; }
ClientSortOption[] all = getAllClientSortOptions();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static ClientSortOption forValue (String value)
{
if (value == null) { return null; }
ClientSortOption[] all = getAllClientSortOptions();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllClientSortOptions (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllClientSortOptions());
}
public static ClientSortOption[] getClientSortOptionArray ()
{
return (ClientSortOption[])getAllClientSortOptions().clone ();
}
public static void defineAdditionalData ()
{
}
static class ClientSortOptionFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return ClientSortOption.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return ClientSortOption.forValue (name);
}
public Enumeration getAll ()
{
return ClientSortOption.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="ClientSortOption">
<VALUE name="ALPHA_A_Z" value="ALPHA_A_Z" description="A-Z"/>
<VALUE name="ALPHA_Z_A" value="ALPHA_Z_A" description="Z-A"/>
<VALUE name="OPEN_JOBS" value="OPEN_JOBS" description="Open Jobs"/>
<VALUE name="FILLED_JOBS" value="FILLED_JOBS" description="Filled Jobs"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
...@@ -41,6 +41,8 @@ public class ColorCode extends AbstractEnumerated ...@@ -41,6 +41,8 @@ public class ColorCode extends AbstractEnumerated
private transient String CSSClass; private transient String CSSClass;
private transient String DotCSSClass;
private ColorCode (String name, String value, String description, boolean disabled) private ColorCode (String name, String value, String description, boolean disabled)
{ {
super (name, value, description, disabled); super (name, value, description, disabled);
...@@ -60,6 +62,11 @@ public class ColorCode extends AbstractEnumerated ...@@ -60,6 +62,11 @@ public class ColorCode extends AbstractEnumerated
{ {
return CSSClass; return CSSClass;
} }
public String getDotCSSClass()
{
return DotCSSClass;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allColorCodes); public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allColorCodes);
...@@ -131,12 +138,15 @@ public class ColorCode extends AbstractEnumerated ...@@ -131,12 +138,15 @@ public class ColorCode extends AbstractEnumerated
RED.ColorRank = 3; RED.ColorRank = 3;
RED.RatingScore = 0; RED.RatingScore = 0;
RED.CSSClass = "red-b"; RED.CSSClass = "red-b";
RED.DotCSSClass = "red-dot";
AMBER.ColorRank = 2; AMBER.ColorRank = 2;
AMBER.RatingScore = 5; AMBER.RatingScore = 5;
AMBER.CSSClass = "yellow-b"; AMBER.CSSClass = "yellow-b";
AMBER.DotCSSClass = "yellow-dot";
GREEN.ColorRank = 1; GREEN.ColorRank = 1;
GREEN.RatingScore = 10; GREEN.RatingScore = 10;
GREEN.CSSClass = "green-b"; GREEN.CSSClass = "green-b";
GREEN.DotCSSClass = "green-dot";
} }
...@@ -167,6 +177,7 @@ public class ColorCode extends AbstractEnumerated ...@@ -167,6 +177,7 @@ public class ColorCode extends AbstractEnumerated
attribs.put ("ColorRank", ArrayFormatter.toObject(getColorRank())); attribs.put ("ColorRank", ArrayFormatter.toObject(getColorRank()));
attribs.put ("RatingScore", ArrayFormatter.toObject(getRatingScore())); attribs.put ("RatingScore", ArrayFormatter.toObject(getRatingScore()));
attribs.put ("CSSClass", ArrayFormatter.toObject(getCSSClass())); attribs.put ("CSSClass", ArrayFormatter.toObject(getCSSClass()));
attribs.put ("DotCSSClass", ArrayFormatter.toObject(getDotCSSClass()));
return attribs; return attribs;
} }
......
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
<DATA name="ColorRank" type="Integer"/> <DATA name="ColorRank" type="Integer"/>
<DATA name="RatingScore" type="Integer"/> <DATA name="RatingScore" type="Integer"/>
<DATA name="CSSClass" type="String"/> <DATA name="CSSClass" type="String"/>
<DATA name="DotCSSClass" type="String"/>
<VALUE name="RED" value="RED" description="Red" ColorRank="3" RatingScore="0" CSSClass='"red-b"'/> <VALUE name="RED" value="RED" description="Red" ColorRank="3" RatingScore="0" CSSClass='"red-b"' DotCSSClass='"red-dot"'/>
<VALUE name="AMBER" value="AMBER" description="Amber" ColorRank="2" RatingScore="5" CSSClass='"yellow-b"'/> <VALUE name="AMBER" value="AMBER" description="Amber" ColorRank="2" RatingScore="5" CSSClass='"yellow-b"' DotCSSClass='"yellow-dot"'/>
<VALUE name="GREEN" value="GREEN" description="Green" ColorRank="1" RatingScore="10" CSSClass='"green-b"'/> <VALUE name="GREEN" value="GREEN" description="Green" ColorRank="1" RatingScore="10" CSSClass='"green-b"' DotCSSClass='"green-dot"'/>
</CONSTANT> </CONSTANT>
</ROOT> </ROOT>
\ No newline at end of file
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 HiringTeamType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_HiringTeamType = new HiringTeamTypeFactory();
public static final HiringTeamType SMB = new HiringTeamType ("SMB", "SMB", "Small or medium business that hires occassionally", false);
public static final HiringTeamType HR = new HiringTeamType ("HR", "HR", "Hiring / HR department within a large organisation", false);
public static final HiringTeamType AGENCY = new HiringTeamType ("AGENCY", "AGENCY", "Agency recruiting on behalf of clients", false);
private static final HiringTeamType[] allHiringTeamTypes =
new HiringTeamType[] { SMB,HR,AGENCY};
private static HiringTeamType[] getAllHiringTeamTypes ()
{
return allHiringTeamTypes;
}
private HiringTeamType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allHiringTeamTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (HiringTeamType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return HiringTeamType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return HiringTeamType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_HiringTeamType;
}
public static HiringTeamType forName (String name)
{
if (name == null) { return null; }
HiringTeamType[] all = getAllHiringTeamTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static HiringTeamType forValue (String value)
{
if (value == null) { return null; }
HiringTeamType[] all = getAllHiringTeamTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllHiringTeamTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllHiringTeamTypes());
}
public static HiringTeamType[] getHiringTeamTypeArray ()
{
return (HiringTeamType[])getAllHiringTeamTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class HiringTeamTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return HiringTeamType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return HiringTeamType.forValue (name);
}
public Enumeration getAll ()
{
return HiringTeamType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="HiringTeamType">
<VALUE name="SMB" value="SMB" description="Small or medium business that hires occassionally"/>
<VALUE name="HR" value="HR" description="Hiring / HR department within a large organisation"/>
<VALUE name="AGENCY" value="AGENCY" description="Agency recruiting on behalf of clients"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
import oneit.appservices.dbenums.*;
/**
* 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 Industry extends oneit.appservices.dbenums.AbstractEnumeratedDBConstant
{
public static final EnumeratedFactory FACTORY_Industry = new IndustryFactory();
public static final oneit.logging.LoggingArea LOG_Industry = oneit.logging.LoggingArea.createLoggingArea(DB_ENUM, "Industry");
private static Industry[] allIndustrys;
private static boolean isStaticDBEnum = false;
private static boolean reloadRegistered = false;
private static boolean reloadRequired = false;
public static boolean isMaintainable()
{
return !isStaticDBEnum;
}
public static boolean isReloadable()
{
return true;
}
public static void reloadOnNextGet()
{
reloadRequired = true;
}
public static String getReloadCheckTable()
{
return "tl_industry";
}
private static synchronized Industry[] getAllIndustrys ()
{
if (allIndustrys == null)
{
// look in general config for a static override
oneit.appservices.dbenums.DBEnumStaticOptions staticOverride = (oneit.appservices.dbenums.DBEnumStaticOptions)oneit.appservices.config.ConfigMgr.getConfigObject("CONFIG.GLOBAL", "DBEnumStaticOverride:performa.orm.types.Industry", null);
if(staticOverride != null)
{
// if there are items in the DB, email a SYSTEMERROR, since this is likely to cause major confusion/or is a sign of an error condition
oneit.objstore.ObjectTransaction transaction = getTransaction ();
BO_Industry[] boInstances;
try
{
boInstances = BO_Industry.searchALL (transaction);
if(boInstances.length > 0)
{
oneit.logging.LogMgr.log (LOG_Industry, oneit.logging.LogLevel.BUSINESS1, "DB Enumerated Type performa.orm.types.Industry conflict: Either delete entries in tl_industry database table or remove the entries for performa.orm.types.Industry from CONFIG.GLOBAL:DBEnumStaticOverrides");
}
}
// allow the situation when the table does not even exist
catch(Exception e)
{
oneit.logging.LogMgr.log (LOG_Industry, oneit.logging.LogLevel.TRACE, e, "DB Enumerated Type performa.orm.types.Industry, could not load values from DB table. This is not a problem, since the enum is loading from config.");
}
finally
{
transaction.releaseResources();
}
// Load the static items.
allIndustrys = new Industry[staticOverride.getLength()];
oneit.objstore.BaseBusinessClass referenceObj = BO_Industry.REFERENCE_BO_Industry;
for(int staticIndex=0; staticIndex < staticOverride.getLength(); staticIndex++)
{
String name = staticOverride.getName(staticIndex);
String value = staticOverride.getValue(staticIndex);
String description = staticOverride.getDescription(staticIndex);
boolean disabled = staticOverride.getDisabled(staticIndex);
allIndustrys[staticIndex] = new Industry(name, value, description, disabled);
allIndustrys[staticIndex].SortOrder = staticOverride.getPrimitiveLong(referenceObj, "SortOrder", staticIndex, 0);
}
// set a flag so we can determine that this DBEnum has been loaded statically
// this should be used to disable access to screens which manipulate the BO.
isStaticDBEnum = true;
}
else
{
if(isReloadable() && !reloadRegistered)
{
DBEnumReloader.getDBEnumReloader().registerDBEnum(Industry.class);
reloadRegistered = true;
}
allIndustrys = loadFromDatabase();
}
}
else if(reloadRequired)
{
reloadRequired = false;
reloadFromDatabase();
}
return allIndustrys;
}
private static Industry[] loadFromDatabase()
{
Industry[] newIndustrys = new Industry[0];
oneit.objstore.ObjectTransaction transaction = getTransaction ();
BO_Industry[] boInstances;
try
{
oneit.logging.LogMgr.log (LOG_Industry, oneit.logging.LogLevel.DEBUG1, "Staring search to populate instances");
boInstances = BO_Industry.searchALL (transaction);
oneit.logging.LogMgr.log (LOG_Industry, oneit.logging.LogLevel.DEBUG1, "Instances returned:", new Integer (boInstances.length));
newIndustrys = new Industry[boInstances.length];
for (int boIndex = 0 ; boIndex < boInstances.length ; ++boIndex)
{
BO_Industry bo = boInstances[boIndex];
boolean disabled = bo.getDisabled ();
newIndustrys[boIndex] = new Industry (bo.getName (), bo.getValue (), bo.getDescription (), disabled);
newIndustrys[boIndex].SortOrder = bo.getSortOrder(); //
}
java.util.Arrays.sort (newIndustrys);
transaction.commit();
transaction.commitResources();
return newIndustrys;
}
catch (Exception e)
{
throw new oneit.utils.NestedException (e);
}
finally
{
transaction.releaseResources();
}
}
private static void reloadFromDatabase()
{
if(!isReloadable())
{
return;
}
// get the existing ones in a map, by value
Industry[] reloadedItems = loadFromDatabase();
Map existingItemsByValue = CollectionUtils.group(allIndustrys,
new ObjectTransform[] {AbstractEnumerated.TRANSFORM_TO_VALUE},
new Comparator[] { null},
CollectionUtils.GROUP_DONT_COMPARE_CHILDREN);
List newItemsList = new ArrayList();
for(int i=0; i < reloadedItems.length; i++)
{
List oldVerionList = (List)existingItemsByValue.remove(reloadedItems[i].getValue());
Industry oldVersion = (oldVerionList == null || oldVerionList.isEmpty()) ? null : (Industry)oldVerionList.iterator().next();
if(oldVersion != null)
{
oldVersion.disabled = reloadedItems[i].disabled;
oldVersion.description = reloadedItems[i].description;
oldVersion.SortOrder = reloadedItems[i].SortOrder;
newItemsList.add(oldVersion);
}
else
{
newItemsList.add(reloadedItems[i]);
}
}
// add any old ones which have not been covered
// There should not be any, since deletion is not allowed
// but we need to make sure...
for(Iterator it=existingItemsByValue.entrySet().iterator(); it.hasNext(); )
{
newItemsList.add(it.next());
}
allIndustrys = (Industry[])newItemsList.toArray(new Industry[0]);
oneit.logging.LogMgr.log(LOG_Industry, oneit.logging.LogLevel.PROCESSING1, "Completed Reload for Industry");
}
public BO_Industry getIndustryBO (oneit.objstore.ObjectTransaction objTran)
{
BO_Industry[] theBOs = BO_Industry.searchBY_VALUE (objTran, getValue());
if (theBOs.length >= 1)
{
return theBOs[0];
}
else
{
throw new IllegalArgumentException ("No such Industry value:" + getValue ());
}
}
private transient long SortOrder;
private Industry (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public long getSortOrder()
{
return SortOrder;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allIndustrys);
static
{
defineAdditionalData ();
}
public boolean isEqual (Industry other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return Industry.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return Industry.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_Industry;
}
public static Industry forName (String name)
{
if (name == null) { return null; }
Industry[] all = getAllIndustrys();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static Industry forValue (String value)
{
if (value == null) { return null; }
Industry[] all = getAllIndustrys();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllIndustrys (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllIndustrys());
}
public static Industry[] getIndustryArray ()
{
return (Industry[])getAllIndustrys().clone ();
}
public static void defineAdditionalData ()
{
}
static class IndustryFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return Industry.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return Industry.forValue (name);
}
public Enumeration getAll ()
{
return Industry.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("SortOrder", ArrayFormatter.toObject(getSortOrder()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<DB_ENUM name="Industry" package="performa.orm.types" table="tl_industry" supportsDisabled="true" reloadable="true">
</DB_ENUM>
</ROOT>
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 RoleType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_RoleType = new RoleTypeFactory();
public static final RoleType ADMIN = new RoleType ("ADMIN", "ADMIN", "Admin", false);
public static final RoleType STANDARD = new RoleType ("STANDARD", "STANDARD", "Standard", false);
private static final RoleType[] allRoleTypes =
new RoleType[] { ADMIN,STANDARD};
private static RoleType[] getAllRoleTypes ()
{
return allRoleTypes;
}
private RoleType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allRoleTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (RoleType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return RoleType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return RoleType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_RoleType;
}
public static RoleType forName (String name)
{
if (name == null) { return null; }
RoleType[] all = getAllRoleTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static RoleType forValue (String value)
{
if (value == null) { return null; }
RoleType[] all = getAllRoleTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllRoleTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllRoleTypes());
}
public static RoleType[] getRoleTypeArray ()
{
return (RoleType[])getAllRoleTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class RoleTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return RoleType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return RoleType.forValue (name);
}
public Enumeration getAll ()
{
return RoleType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="RoleType">
<VALUE name="ADMIN" value="ADMIN" description="Admin"/>
<VALUE name="STANDARD" value="STANDARD" description="Standard"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
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 TimeZone extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_TimeZone = new TimeZoneFactory();
public static final TimeZone T001 = new TimeZone ("T001", "T001", "(GMT -11) Midway", false);
public static final TimeZone T002 = new TimeZone ("T002", "T002", "(GMT -11) Niue", false);
public static final TimeZone T003 = new TimeZone ("T003", "T003", "(GMT -11) Pago Pago", false);
public static final TimeZone T004 = new TimeZone ("T004", "T004", "(GMT -10) Adak", false);
public static final TimeZone T005 = new TimeZone ("T005", "T005", "(GMT -10) Honolulu", false);
public static final TimeZone T006 = new TimeZone ("T006", "T006", "(GMT -10) Johnston", false);
public static final TimeZone T007 = new TimeZone ("T007", "T007", "(GMT -10) Rarotonga", false);
public static final TimeZone T008 = new TimeZone ("T008", "T008", "(GMT -10) Tahiti", false);
public static final TimeZone T009 = new TimeZone ("T009", "T009", "(GMT -9:30) Marquesas", false);
public static final TimeZone T010 = new TimeZone ("T010", "T010", "(GMT -9) Anchorage", false);
public static final TimeZone T011 = new TimeZone ("T011", "T011", "(GMT -9) Juneau", false);
public static final TimeZone T012 = new TimeZone ("T012", "T012", "(GMT -9) Metlakatla", false);
public static final TimeZone T013 = new TimeZone ("T013", "T013", "(GMT -9) Nome", false);
public static final TimeZone T014 = new TimeZone ("T014", "T014", "(GMT -9) Sitka", false);
public static final TimeZone T015 = new TimeZone ("T015", "T015", "(GMT -9) Yakutat", false);
public static final TimeZone T016 = new TimeZone ("T016", "T016", "(GMT -9) Gambier", false);
public static final TimeZone T017 = new TimeZone ("T017", "T017", "(GMT -8) Dawson", false);
public static final TimeZone T018 = new TimeZone ("T018", "T018", "(GMT -8) Los Angeles", false);
public static final TimeZone T019 = new TimeZone ("T019", "T019", "(GMT -8) Tijuana", false);
public static final TimeZone T020 = new TimeZone ("T020", "T020", "(GMT -8) Vancouver", false);
public static final TimeZone T021 = new TimeZone ("T021", "T021", "(GMT -8) Whitehorse", false);
public static final TimeZone T022 = new TimeZone ("T022", "T022", "(GMT -8) Pitcairn", false);
public static final TimeZone T023 = new TimeZone ("T023", "T023", "(GMT -7) Boise", false);
public static final TimeZone T024 = new TimeZone ("T024", "T024", "(GMT -7) Cambridge Bay", false);
public static final TimeZone T025 = new TimeZone ("T025", "T025", "(GMT -7) Chihuahua", false);
public static final TimeZone T026 = new TimeZone ("T026", "T026", "(GMT -7) Creston", false);
public static final TimeZone T027 = new TimeZone ("T027", "T027", "(GMT -7) Dawson Creek", false);
public static final TimeZone T028 = new TimeZone ("T028", "T028", "(GMT -7) Denver", false);
public static final TimeZone T029 = new TimeZone ("T029", "T029", "(GMT -7) Edmonton", false);
public static final TimeZone T030 = new TimeZone ("T030", "T030", "(GMT -7) Fort Nelson", false);
public static final TimeZone T031 = new TimeZone ("T031", "T031", "(GMT -7) Hermosillo", false);
public static final TimeZone T032 = new TimeZone ("T032", "T032", "(GMT -7) Inuvik", false);
public static final TimeZone T033 = new TimeZone ("T033", "T033", "(GMT -7) Mazatlan", false);
public static final TimeZone T034 = new TimeZone ("T034", "T034", "(GMT -7) Ojinaga", false);
public static final TimeZone T035 = new TimeZone ("T035", "T035", "(GMT -7) Phoenix", false);
public static final TimeZone T036 = new TimeZone ("T036", "T036", "(GMT -7) Yellowknife", false);
public static final TimeZone T037 = new TimeZone ("T037", "T037", "(GMT -6) Bahia Banderas", false);
public static final TimeZone T038 = new TimeZone ("T038", "T038", "(GMT -6) Belize", false);
public static final TimeZone T039 = new TimeZone ("T039", "T039", "(GMT -6) Chicago", false);
public static final TimeZone T040 = new TimeZone ("T040", "T040", "(GMT -6) Costa Rica", false);
public static final TimeZone T041 = new TimeZone ("T041", "T041", "(GMT -6) El Salvador", false);
public static final TimeZone T042 = new TimeZone ("T042", "T042", "(GMT -6) Guatemala", false);
public static final TimeZone T043 = new TimeZone ("T043", "T043", "(GMT -6) Knox", false);
public static final TimeZone T044 = new TimeZone ("T044", "T044", "(GMT -6) Tell City", false);
public static final TimeZone T045 = new TimeZone ("T045", "T045", "(GMT -6) Managua", false);
public static final TimeZone T046 = new TimeZone ("T046", "T046", "(GMT -6) Matamoros", false);
public static final TimeZone T047 = new TimeZone ("T047", "T047", "(GMT -6) Menominee", false);
public static final TimeZone T048 = new TimeZone ("T048", "T048", "(GMT -6) Merida", false);
public static final TimeZone T049 = new TimeZone ("T049", "T049", "(GMT -6) Mexico City", false);
public static final TimeZone T050 = new TimeZone ("T050", "T050", "(GMT -6) Monterrey", false);
public static final TimeZone T051 = new TimeZone ("T051", "T051", "(GMT -6) Beulah", false);
public static final TimeZone T052 = new TimeZone ("T052", "T052", "(GMT -6) Center", false);
public static final TimeZone T053 = new TimeZone ("T053", "T053", "(GMT -6) New Salem", false);
public static final TimeZone T054 = new TimeZone ("T054", "T054", "(GMT -6) Rainy River", false);
public static final TimeZone T055 = new TimeZone ("T055", "T055", "(GMT -6) Rankin Inlet", false);
public static final TimeZone T056 = new TimeZone ("T056", "T056", "(GMT -6) Regina", false);
public static final TimeZone T057 = new TimeZone ("T057", "T057", "(GMT -6) Resolute", false);
public static final TimeZone T058 = new TimeZone ("T058", "T058", "(GMT -6) Swift Current", false);
public static final TimeZone T059 = new TimeZone ("T059", "T059", "(GMT -6) Tegucigalpa", false);
public static final TimeZone T060 = new TimeZone ("T060", "T060", "(GMT -6) Winnipeg", false);
public static final TimeZone T061 = new TimeZone ("T061", "T061", "(GMT -6) Easter", false);
public static final TimeZone T062 = new TimeZone ("T062", "T062", "(GMT -6) Galapagos", false);
public static final TimeZone T063 = new TimeZone ("T063", "T063", "(GMT -5) Atikokan", false);
public static final TimeZone T064 = new TimeZone ("T064", "T064", "(GMT -5) Bogota", false);
public static final TimeZone T065 = new TimeZone ("T065", "T065", "(GMT -5) Cancun", false);
public static final TimeZone T066 = new TimeZone ("T066", "T066", "(GMT -5) Cayman", false);
public static final TimeZone T067 = new TimeZone ("T067", "T067", "(GMT -5) Detroit", false);
public static final TimeZone T068 = new TimeZone ("T068", "T068", "(GMT -5) Eirunepe", false);
public static final TimeZone T069 = new TimeZone ("T069", "T069", "(GMT -5) Guayaquil", false);
public static final TimeZone T070 = new TimeZone ("T070", "T070", "(GMT -5) Havana", false);
public static final TimeZone T071 = new TimeZone ("T071", "T071", "(GMT -5) Indianapolis", false);
public static final TimeZone T072 = new TimeZone ("T072", "T072", "(GMT -5) Marengo", false);
public static final TimeZone T073 = new TimeZone ("T073", "T073", "(GMT -5) Petersburg", false);
public static final TimeZone T074 = new TimeZone ("T074", "T074", "(GMT -5) Vevay", false);
public static final TimeZone T075 = new TimeZone ("T075", "T075", "(GMT -5) Vincennes", false);
public static final TimeZone T076 = new TimeZone ("T076", "T076", "(GMT -5) Winamac", false);
public static final TimeZone T077 = new TimeZone ("T077", "T077", "(GMT -5) Iqaluit", false);
public static final TimeZone T078 = new TimeZone ("T078", "T078", "(GMT -5) Jamaica", false);
public static final TimeZone T079 = new TimeZone ("T079", "T079", "(GMT -5) Louisville", false);
public static final TimeZone T080 = new TimeZone ("T080", "T080", "(GMT -5) Monticello", false);
public static final TimeZone T081 = new TimeZone ("T081", "T081", "(GMT -5) Lima", false);
public static final TimeZone T082 = new TimeZone ("T082", "T082", "(GMT -5) Nassau", false);
public static final TimeZone T083 = new TimeZone ("T083", "T083", "(GMT -5) New York", false);
public static final TimeZone T084 = new TimeZone ("T084", "T084", "(GMT -5) Nipigon", false);
public static final TimeZone T085 = new TimeZone ("T085", "T085", "(GMT -5) Panama", false);
public static final TimeZone T086 = new TimeZone ("T086", "T086", "(GMT -5) Pangnirtung", false);
public static final TimeZone T087 = new TimeZone ("T087", "T087", "(GMT -5) Port-au-Prince", false);
public static final TimeZone T088 = new TimeZone ("T088", "T088", "(GMT -5) Rio Branco", false);
public static final TimeZone T089 = new TimeZone ("T089", "T089", "(GMT -5) Thunder Bay", false);
public static final TimeZone T090 = new TimeZone ("T090", "T090", "(GMT -5) Toronto", false);
public static final TimeZone T091 = new TimeZone ("T091", "T091", "(GMT -4) Anguilla", false);
public static final TimeZone T092 = new TimeZone ("T092", "T092", "(GMT -4) Antigua", false);
public static final TimeZone T093 = new TimeZone ("T093", "T093", "(GMT -4) Aruba", false);
public static final TimeZone T094 = new TimeZone ("T094", "T094", "(GMT -4) Asuncion", false);
public static final TimeZone T095 = new TimeZone ("T095", "T095", "(GMT -4) Barbados", false);
public static final TimeZone T096 = new TimeZone ("T096", "T096", "(GMT -4) Blanc-Sablon", false);
public static final TimeZone T097 = new TimeZone ("T097", "T097", "(GMT -4) Boa Vista", false);
public static final TimeZone T098 = new TimeZone ("T098", "T098", "(GMT -4) Campo Grande", false);
public static final TimeZone T099 = new TimeZone ("T099", "T099", "(GMT -4) Caracas", false);
public static final TimeZone T100 = new TimeZone ("T100", "T100", "(GMT -4) Cuiaba", false);
public static final TimeZone T101 = new TimeZone ("T101", "T101", "(GMT -4) Curacao", false);
public static final TimeZone T102 = new TimeZone ("T102", "T102", "(GMT -4) Dominica", false);
public static final TimeZone T103 = new TimeZone ("T103", "T103", "(GMT -4) Glace Bay", false);
public static final TimeZone T104 = new TimeZone ("T104", "T104", "(GMT -4) Goose Bay", false);
public static final TimeZone T105 = new TimeZone ("T105", "T105", "(GMT -4) Grand Turk", false);
public static final TimeZone T106 = new TimeZone ("T106", "T106", "(GMT -4) Grenada", false);
public static final TimeZone T107 = new TimeZone ("T107", "T107", "(GMT -4) Guadeloupe", false);
public static final TimeZone T108 = new TimeZone ("T108", "T108", "(GMT -4) Guyana", false);
public static final TimeZone T109 = new TimeZone ("T109", "T109", "(GMT -4) Halifax", false);
public static final TimeZone T110 = new TimeZone ("T110", "T110", "(GMT -4) Kralendijk", false);
public static final TimeZone T111 = new TimeZone ("T111", "T111", "(GMT -4) La Paz", false);
public static final TimeZone T112 = new TimeZone ("T112", "T112", "(GMT -4) Lower Princes", false);
public static final TimeZone T113 = new TimeZone ("T113", "T113", "(GMT -4) Manaus", false);
public static final TimeZone T114 = new TimeZone ("T114", "T114", "(GMT -4) Marigot", false);
public static final TimeZone T115 = new TimeZone ("T115", "T115", "(GMT -4) Martinique", false);
public static final TimeZone T116 = new TimeZone ("T116", "T116", "(GMT -4) Moncton", false);
public static final TimeZone T117 = new TimeZone ("T117", "T117", "(GMT -4) Montserrat", false);
public static final TimeZone T118 = new TimeZone ("T118", "T118", "(GMT -4) Porto Velho", false);
public static final TimeZone T119 = new TimeZone ("T119", "T119", "(GMT -4) Port of Spain", false);
public static final TimeZone T120 = new TimeZone ("T120", "T120", "(GMT -4) Puerto Rico", false);
public static final TimeZone T121 = new TimeZone ("T121", "T121", "(GMT -4) Santiago", false);
public static final TimeZone T122 = new TimeZone ("T122", "T122", "(GMT -4) Santo Domingo", false);
public static final TimeZone T123 = new TimeZone ("T123", "T123", "(GMT -4) St Barthelemy", false);
public static final TimeZone T124 = new TimeZone ("T124", "T124", "(GMT -4) St Kitts", false);
public static final TimeZone T125 = new TimeZone ("T125", "T125", "(GMT -4) St Lucia", false);
public static final TimeZone T126 = new TimeZone ("T126", "T126", "(GMT -4) St Thomas", false);
public static final TimeZone T127 = new TimeZone ("T127", "T127", "(GMT -4) St Vincent", false);
public static final TimeZone T128 = new TimeZone ("T128", "T128", "(GMT -4) Thule", false);
public static final TimeZone T129 = new TimeZone ("T129", "T129", "(GMT -4) Tortola", false);
public static final TimeZone T130 = new TimeZone ("T130", "T130", "(GMT -4) Palmer", false);
public static final TimeZone T131 = new TimeZone ("T131", "T131", "(GMT -4) Bermuda", false);
public static final TimeZone T132 = new TimeZone ("T132", "T132", "(GMT -3:30) St Johns", false);
public static final TimeZone T133 = new TimeZone ("T133", "T133", "(GMT -3) Araguaina", false);
public static final TimeZone T134 = new TimeZone ("T134", "T134", "(GMT -3) Buenos Aires", false);
public static final TimeZone T135 = new TimeZone ("T135", "T135", "(GMT -3) Catamarca", false);
public static final TimeZone T136 = new TimeZone ("T136", "T136", "(GMT -3) Cordoba", false);
public static final TimeZone T137 = new TimeZone ("T137", "T137", "(GMT -3) Jujuy", false);
public static final TimeZone T138 = new TimeZone ("T138", "T138", "(GMT -3) La Rioja", false);
public static final TimeZone T139 = new TimeZone ("T139", "T139", "(GMT -3) Mendoza", false);
public static final TimeZone T140 = new TimeZone ("T140", "T140", "(GMT -3) Rio Gallegos", false);
public static final TimeZone T141 = new TimeZone ("T141", "T141", "(GMT -3) Salta", false);
public static final TimeZone T142 = new TimeZone ("T142", "T142", "(GMT -3) San Juan", false);
public static final TimeZone T143 = new TimeZone ("T143", "T143", "(GMT -3) San Luis", false);
public static final TimeZone T144 = new TimeZone ("T144", "T144", "(GMT -3) Tucuman", false);
public static final TimeZone T145 = new TimeZone ("T145", "T145", "(GMT -3) Ushuaia", false);
public static final TimeZone T146 = new TimeZone ("T146", "T146", "(GMT -3) Bahia", false);
public static final TimeZone T147 = new TimeZone ("T147", "T147", "(GMT -3) Belem", false);
public static final TimeZone T148 = new TimeZone ("T148", "T148", "(GMT -3) Cayenne", false);
public static final TimeZone T149 = new TimeZone ("T149", "T149", "(GMT -3) Fortaleza", false);
public static final TimeZone T150 = new TimeZone ("T150", "T150", "(GMT -3) Godthab", false);
public static final TimeZone T151 = new TimeZone ("T151", "T151", "(GMT -3) Maceio", false);
public static final TimeZone T152 = new TimeZone ("T152", "T152", "(GMT -3) Miquelon", false);
public static final TimeZone T153 = new TimeZone ("T153", "T153", "(GMT -3) Montevideo", false);
public static final TimeZone T154 = new TimeZone ("T154", "T154", "(GMT -3) Paramaribo", false);
public static final TimeZone T155 = new TimeZone ("T155", "T155", "(GMT -3) Recife", false);
public static final TimeZone T156 = new TimeZone ("T156", "T156", "(GMT -3) Santarem", false);
public static final TimeZone T157 = new TimeZone ("T157", "T157", "(GMT -3) Sao Paulo", false);
public static final TimeZone T158 = new TimeZone ("T158", "T158", "(GMT -3) Rothera", false);
public static final TimeZone T159 = new TimeZone ("T159", "T159", "(GMT -3) Stanley", false);
public static final TimeZone T160 = new TimeZone ("T160", "T160", "(GMT -2) Noronha", false);
public static final TimeZone T161 = new TimeZone ("T161", "T161", "(GMT -2) South Georgia", false);
public static final TimeZone T162 = new TimeZone ("T162", "T162", "(GMT -1) Scoresbysund", false);
public static final TimeZone T163 = new TimeZone ("T163", "T163", "(GMT -1) Azores", false);
public static final TimeZone T164 = new TimeZone ("T164", "T164", "(GMT -1) Cape Verde", false);
public static final TimeZone T165 = new TimeZone ("T165", "T165", "(GMT +0) Abidjan", false);
public static final TimeZone T166 = new TimeZone ("T166", "T166", "(GMT +0) Accra", false);
public static final TimeZone T167 = new TimeZone ("T167", "T167", "(GMT +0) Bamako", false);
public static final TimeZone T168 = new TimeZone ("T168", "T168", "(GMT +0) Banjul", false);
public static final TimeZone T169 = new TimeZone ("T169", "T169", "(GMT +0) Bissau", false);
public static final TimeZone T170 = new TimeZone ("T170", "T170", "(GMT +0) Casablanca", false);
public static final TimeZone T171 = new TimeZone ("T171", "T171", "(GMT +0) Conakry", false);
public static final TimeZone T172 = new TimeZone ("T172", "T172", "(GMT +0) Dakar", false);
public static final TimeZone T173 = new TimeZone ("T173", "T173", "(GMT +0) El Aaiun", false);
public static final TimeZone T174 = new TimeZone ("T174", "T174", "(GMT +0) Freetown", false);
public static final TimeZone T175 = new TimeZone ("T175", "T175", "(GMT +0) Lome", false);
public static final TimeZone T176 = new TimeZone ("T176", "T176", "(GMT +0) Monrovia", false);
public static final TimeZone T177 = new TimeZone ("T177", "T177", "(GMT +0) Nouakchott", false);
public static final TimeZone T178 = new TimeZone ("T178", "T178", "(GMT +0) Ouagadougou", false);
public static final TimeZone T179 = new TimeZone ("T179", "T179", "(GMT +0) Sao Tome", false);
public static final TimeZone T180 = new TimeZone ("T180", "T180", "(GMT +0) Danmarkshavn", false);
public static final TimeZone T181 = new TimeZone ("T181", "T181", "(GMT +0) Troll", false);
public static final TimeZone T182 = new TimeZone ("T182", "T182", "(GMT +0) Canary", false);
public static final TimeZone T183 = new TimeZone ("T183", "T183", "(GMT +0) Faroe", false);
public static final TimeZone T184 = new TimeZone ("T184", "T184", "(GMT +0) Madeira", false);
public static final TimeZone T185 = new TimeZone ("T185", "T185", "(GMT +0) Reykjavik", false);
public static final TimeZone T186 = new TimeZone ("T186", "T186", "(GMT +0) St Helena", false);
public static final TimeZone T187 = new TimeZone ("T187", "T187", "(GMT +0) Dublin", false);
public static final TimeZone T188 = new TimeZone ("T188", "T188", "(GMT +0) Guernsey", false);
public static final TimeZone T189 = new TimeZone ("T189", "T189", "(GMT +0) Isle of Man", false);
public static final TimeZone T190 = new TimeZone ("T190", "T190", "(GMT +0) Jersey", false);
public static final TimeZone T191 = new TimeZone ("T191", "T191", "(GMT +0) Lisbon", false);
public static final TimeZone T192 = new TimeZone ("T192", "T192", "(GMT +0) London", false);
public static final TimeZone T193 = new TimeZone ("T193", "T193", "(GMT +1) Algiers", false);
public static final TimeZone T194 = new TimeZone ("T194", "T194", "(GMT +1) Bangui", false);
public static final TimeZone T195 = new TimeZone ("T195", "T195", "(GMT +1) Brazzaville", false);
public static final TimeZone T196 = new TimeZone ("T196", "T196", "(GMT +1) Ceuta", false);
public static final TimeZone T197 = new TimeZone ("T197", "T197", "(GMT +1) Douala", false);
public static final TimeZone T198 = new TimeZone ("T198", "T198", "(GMT +1) Kinshasa", false);
public static final TimeZone T199 = new TimeZone ("T199", "T199", "(GMT +1) Lagos", false);
public static final TimeZone T200 = new TimeZone ("T200", "T200", "(GMT +1) Libreville", false);
public static final TimeZone T201 = new TimeZone ("T201", "T201", "(GMT +1) Luanda", false);
public static final TimeZone T202 = new TimeZone ("T202", "T202", "(GMT +1) Malabo", false);
public static final TimeZone T203 = new TimeZone ("T203", "T203", "(GMT +1) Ndjamena", false);
public static final TimeZone T204 = new TimeZone ("T204", "T204", "(GMT +1) Niamey", false);
public static final TimeZone T205 = new TimeZone ("T205", "T205", "(GMT +1) Porto-Novo", false);
public static final TimeZone T206 = new TimeZone ("T206", "T206", "(GMT +1) Tunis", false);
public static final TimeZone T207 = new TimeZone ("T207", "T207", "(GMT +1) Windhoek", false);
public static final TimeZone T208 = new TimeZone ("T208", "T208", "(GMT +1) Longyearbyen", false);
public static final TimeZone T209 = new TimeZone ("T209", "T209", "(GMT +1) Amsterdam", false);
public static final TimeZone T210 = new TimeZone ("T210", "T210", "(GMT +1) Andorra", false);
public static final TimeZone T211 = new TimeZone ("T211", "T211", "(GMT +1) Belgrade", false);
public static final TimeZone T212 = new TimeZone ("T212", "T212", "(GMT +1) Berlin", false);
public static final TimeZone T213 = new TimeZone ("T213", "T213", "(GMT +1) Bratislava", false);
public static final TimeZone T214 = new TimeZone ("T214", "T214", "(GMT +1) Brussels", false);
public static final TimeZone T215 = new TimeZone ("T215", "T215", "(GMT +1) Budapest", false);
public static final TimeZone T216 = new TimeZone ("T216", "T216", "(GMT +1) Copenhagen", false);
public static final TimeZone T217 = new TimeZone ("T217", "T217", "(GMT +1) Gibraltar", false);
public static final TimeZone T218 = new TimeZone ("T218", "T218", "(GMT +1) Ljubljana", false);
public static final TimeZone T219 = new TimeZone ("T219", "T219", "(GMT +1) Luxembourg", false);
public static final TimeZone T220 = new TimeZone ("T220", "T220", "(GMT +1) Madrid", false);
public static final TimeZone T221 = new TimeZone ("T221", "T221", "(GMT +1) Malta", false);
public static final TimeZone T222 = new TimeZone ("T222", "T222", "(GMT +1) Monaco", false);
public static final TimeZone T223 = new TimeZone ("T223", "T223", "(GMT +1) Oslo", false);
public static final TimeZone T224 = new TimeZone ("T224", "T224", "(GMT +1) Paris", false);
public static final TimeZone T225 = new TimeZone ("T225", "T225", "(GMT +1) Podgorica", false);
public static final TimeZone T226 = new TimeZone ("T226", "T226", "(GMT +1) Prague", false);
public static final TimeZone T227 = new TimeZone ("T227", "T227", "(GMT +1) Rome", false);
public static final TimeZone T228 = new TimeZone ("T228", "T228", "(GMT +1) San Marino", false);
public static final TimeZone T229 = new TimeZone ("T229", "T229", "(GMT +1) Sarajevo", false);
public static final TimeZone T230 = new TimeZone ("T230", "T230", "(GMT +1) Skopje", false);
public static final TimeZone T231 = new TimeZone ("T231", "T231", "(GMT +1) Stockholm", false);
public static final TimeZone T232 = new TimeZone ("T232", "T232", "(GMT +1) Tirane", false);
public static final TimeZone T233 = new TimeZone ("T233", "T233", "(GMT +1) Vaduz", false);
public static final TimeZone T234 = new TimeZone ("T234", "T234", "(GMT +1) Vatican", false);
public static final TimeZone T235 = new TimeZone ("T235", "T235", "(GMT +1) Vienna", false);
public static final TimeZone T236 = new TimeZone ("T236", "T236", "(GMT +1) Warsaw", false);
public static final TimeZone T237 = new TimeZone ("T237", "T237", "(GMT +1) Zagreb", false);
public static final TimeZone T238 = new TimeZone ("T238", "T238", "(GMT +1) Zurich", false);
public static final TimeZone T239 = new TimeZone ("T239", "T239", "(GMT +2) Blantyre", false);
public static final TimeZone T240 = new TimeZone ("T240", "T240", "(GMT +2) Bujumbura", false);
public static final TimeZone T241 = new TimeZone ("T241", "T241", "(GMT +2) Cairo", false);
public static final TimeZone T242 = new TimeZone ("T242", "T242", "(GMT +2) Gaborone", false);
public static final TimeZone T243 = new TimeZone ("T243", "T243", "(GMT +2) Harare", false);
public static final TimeZone T244 = new TimeZone ("T244", "T244", "(GMT +2) Johannesburg", false);
public static final TimeZone T245 = new TimeZone ("T245", "T245", "(GMT +2) Kigali", false);
public static final TimeZone T246 = new TimeZone ("T246", "T246", "(GMT +2) Lubumbashi", false);
public static final TimeZone T247 = new TimeZone ("T247", "T247", "(GMT +2) Lusaka", false);
public static final TimeZone T248 = new TimeZone ("T248", "T248", "(GMT +2) Maputo", false);
public static final TimeZone T249 = new TimeZone ("T249", "T249", "(GMT +2) Maseru", false);
public static final TimeZone T250 = new TimeZone ("T250", "T250", "(GMT +2) Mbabane", false);
public static final TimeZone T251 = new TimeZone ("T251", "T251", "(GMT +2) Tripoli", false);
public static final TimeZone T252 = new TimeZone ("T252", "T252", "(GMT +2) Amman", false);
public static final TimeZone T253 = new TimeZone ("T253", "T253", "(GMT +2) Beirut", false);
public static final TimeZone T254 = new TimeZone ("T254", "T254", "(GMT +2) Damascus", false);
public static final TimeZone T255 = new TimeZone ("T255", "T255", "(GMT +2) Gaza", false);
public static final TimeZone T256 = new TimeZone ("T256", "T256", "(GMT +2) Hebron", false);
public static final TimeZone T257 = new TimeZone ("T257", "T257", "(GMT +2) Jerusalem", false);
public static final TimeZone T258 = new TimeZone ("T258", "T258", "(GMT +2) Nicosia", false);
public static final TimeZone T259 = new TimeZone ("T259", "T259", "(GMT +2) Athens", false);
public static final TimeZone T260 = new TimeZone ("T260", "T260", "(GMT +2) Bucharest", false);
public static final TimeZone T261 = new TimeZone ("T261", "T261", "(GMT +2) Chisinau", false);
public static final TimeZone T262 = new TimeZone ("T262", "T262", "(GMT +2) Helsinki", false);
public static final TimeZone T263 = new TimeZone ("T263", "T263", "(GMT +2) Istanbul", false);
public static final TimeZone T264 = new TimeZone ("T264", "T264", "(GMT +2) Kaliningrad", false);
public static final TimeZone T265 = new TimeZone ("T265", "T265", "(GMT +2) Kiev", false);
public static final TimeZone T266 = new TimeZone ("T266", "T266", "(GMT +2) Mariehamn", false);
public static final TimeZone T267 = new TimeZone ("T267", "T267", "(GMT +2) Riga", false);
public static final TimeZone T268 = new TimeZone ("T268", "T268", "(GMT +2) Sofia", false);
public static final TimeZone T269 = new TimeZone ("T269", "T269", "(GMT +2) Tallinn", false);
public static final TimeZone T270 = new TimeZone ("T270", "T270", "(GMT +2) Uzhgorod", false);
public static final TimeZone T271 = new TimeZone ("T271", "T271", "(GMT +2) Vilnius", false);
public static final TimeZone T272 = new TimeZone ("T272", "T272", "(GMT +2) Zaporozhye", false);
public static final TimeZone T273 = new TimeZone ("T273", "T273", "(GMT +3) Addis Ababa", false);
public static final TimeZone T274 = new TimeZone ("T274", "T274", "(GMT +3) Asmara", false);
public static final TimeZone T275 = new TimeZone ("T275", "T275", "(GMT +3) Dar es Salaam", false);
public static final TimeZone T276 = new TimeZone ("T276", "T276", "(GMT +3) Djibouti", false);
public static final TimeZone T277 = new TimeZone ("T277", "T277", "(GMT +3) Juba", false);
public static final TimeZone T278 = new TimeZone ("T278", "T278", "(GMT +3) Kampala", false);
public static final TimeZone T279 = new TimeZone ("T279", "T279", "(GMT +3) Khartoum", false);
public static final TimeZone T280 = new TimeZone ("T280", "T280", "(GMT +3) Mogadishu", false);
public static final TimeZone T281 = new TimeZone ("T281", "T281", "(GMT +3) Nairobi", false);
public static final TimeZone T282 = new TimeZone ("T282", "T282", "(GMT +3) Syowa", false);
public static final TimeZone T283 = new TimeZone ("T283", "T283", "(GMT +3) Aden", false);
public static final TimeZone T284 = new TimeZone ("T284", "T284", "(GMT +3) Baghdad", false);
public static final TimeZone T285 = new TimeZone ("T285", "T285", "(GMT +3) Bahrain", false);
public static final TimeZone T286 = new TimeZone ("T286", "T286", "(GMT +3) Kuwait", false);
public static final TimeZone T287 = new TimeZone ("T287", "T287", "(GMT +3) Qatar", false);
public static final TimeZone T288 = new TimeZone ("T288", "T288", "(GMT +3) Riyadh", false);
public static final TimeZone T289 = new TimeZone ("T289", "T289", "(GMT +3) Minsk", false);
public static final TimeZone T290 = new TimeZone ("T290", "T290", "(GMT +3) Moscow", false);
public static final TimeZone T291 = new TimeZone ("T291", "T291", "(GMT +3) Simferopol", false);
public static final TimeZone T292 = new TimeZone ("T292", "T292", "(GMT +3) Volgograd", false);
public static final TimeZone T293 = new TimeZone ("T293", "T293", "(GMT +3) Antananarivo", false);
public static final TimeZone T294 = new TimeZone ("T294", "T294", "(GMT +3) Comoro", false);
public static final TimeZone T295 = new TimeZone ("T295", "T295", "(GMT +3) Mayotte", false);
public static final TimeZone T296 = new TimeZone ("T296", "T296", "(GMT +3:30) Tehran", false);
public static final TimeZone T297 = new TimeZone ("T297", "T297", "(GMT +4) Baku", false);
public static final TimeZone T298 = new TimeZone ("T298", "T298", "(GMT +4) Dubai", false);
public static final TimeZone T299 = new TimeZone ("T299", "T299", "(GMT +4) Muscat", false);
public static final TimeZone T300 = new TimeZone ("T300", "T300", "(GMT +4) Tbilisi", false);
public static final TimeZone T301 = new TimeZone ("T301", "T301", "(GMT +4) Yerevan", false);
public static final TimeZone T302 = new TimeZone ("T302", "T302", "(GMT +4) Astrakhan", false);
public static final TimeZone T303 = new TimeZone ("T303", "T303", "(GMT +4) Samara", false);
public static final TimeZone T304 = new TimeZone ("T304", "T304", "(GMT +4) Ulyanovsk", false);
public static final TimeZone T305 = new TimeZone ("T305", "T305", "(GMT +4) Mahe", false);
public static final TimeZone T306 = new TimeZone ("T306", "T306", "(GMT +4) Mauritius", false);
public static final TimeZone T307 = new TimeZone ("T307", "T307", "(GMT +4) Reunion", false);
public static final TimeZone T308 = new TimeZone ("T308", "T308", "(GMT +4:30) Kabul", false);
public static final TimeZone T309 = new TimeZone ("T309", "T309", "(GMT +5) Mawson", false);
public static final TimeZone T310 = new TimeZone ("T310", "T310", "(GMT +5) Aqtau", false);
public static final TimeZone T311 = new TimeZone ("T311", "T311", "(GMT +5) Aqtobe", false);
public static final TimeZone T312 = new TimeZone ("T312", "T312", "(GMT +5) Ashgabat", false);
public static final TimeZone T313 = new TimeZone ("T313", "T313", "(GMT +5) Dushanbe", false);
public static final TimeZone T314 = new TimeZone ("T314", "T314", "(GMT +5) Karachi", false);
public static final TimeZone T315 = new TimeZone ("T315", "T315", "(GMT +5) Oral", false);
public static final TimeZone T316 = new TimeZone ("T316", "T316", "(GMT +5) Samarkand", false);
public static final TimeZone T317 = new TimeZone ("T317", "T317", "(GMT +5) Tashkent", false);
public static final TimeZone T318 = new TimeZone ("T318", "T318", "(GMT +5) Yekaterinburg", false);
public static final TimeZone T319 = new TimeZone ("T319", "T319", "(GMT +5) Kerguelen", false);
public static final TimeZone T320 = new TimeZone ("T320", "T320", "(GMT +5) Maldives", false);
public static final TimeZone T321 = new TimeZone ("T321", "T321", "(GMT +5:30) Colombo", false);
public static final TimeZone T322 = new TimeZone ("T322", "T322", "(GMT +5:30) Kolkata", false);
public static final TimeZone T323 = new TimeZone ("T323", "T323", "(GMT +5:45) Kathmandu", false);
public static final TimeZone T324 = new TimeZone ("T324", "T324", "(GMT +6) Vostok", false);
public static final TimeZone T325 = new TimeZone ("T325", "T325", "(GMT +6) Almaty", false);
public static final TimeZone T326 = new TimeZone ("T326", "T326", "(GMT +6) Bishkek", false);
public static final TimeZone T327 = new TimeZone ("T327", "T327", "(GMT +6) Dhaka", false);
public static final TimeZone T328 = new TimeZone ("T328", "T328", "(GMT +6) Novosibirsk", false);
public static final TimeZone T329 = new TimeZone ("T329", "T329", "(GMT +6) Omsk", false);
public static final TimeZone T330 = new TimeZone ("T330", "T330", "(GMT +6) Qyzylorda", false);
public static final TimeZone T331 = new TimeZone ("T331", "T331", "(GMT +6) Thimphu", false);
public static final TimeZone T332 = new TimeZone ("T332", "T332", "(GMT +6) Urumqi", false);
public static final TimeZone T333 = new TimeZone ("T333", "T333", "(GMT +6) Chagos", false);
public static final TimeZone T334 = new TimeZone ("T334", "T334", "(GMT +6:30) Rangoon", false);
public static final TimeZone T335 = new TimeZone ("T335", "T335", "(GMT +6:30) Cocos", false);
public static final TimeZone T336 = new TimeZone ("T336", "T336", "(GMT +7) Davis", false);
public static final TimeZone T337 = new TimeZone ("T337", "T337", "(GMT +7) Bangkok", false);
public static final TimeZone T338 = new TimeZone ("T338", "T338", "(GMT +7) Barnaul", false);
public static final TimeZone T339 = new TimeZone ("T339", "T339", "(GMT +7) Hovd", false);
public static final TimeZone T340 = new TimeZone ("T340", "T340", "(GMT +7) Ho Chi Minh", false);
public static final TimeZone T341 = new TimeZone ("T341", "T341", "(GMT +7) Jakarta", false);
public static final TimeZone T342 = new TimeZone ("T342", "T342", "(GMT +7) Krasnoyarsk", false);
public static final TimeZone T343 = new TimeZone ("T343", "T343", "(GMT +7) Novokuznetsk", false);
public static final TimeZone T344 = new TimeZone ("T344", "T344", "(GMT +7) Phnom Penh", false);
public static final TimeZone T345 = new TimeZone ("T345", "T345", "(GMT +7) Pontianak", false);
public static final TimeZone T346 = new TimeZone ("T346", "T346", "(GMT +7) Vientiane", false);
public static final TimeZone T347 = new TimeZone ("T347", "T347", "(GMT +7) Christmas", false);
public static final TimeZone T348 = new TimeZone ("T348", "T348", "(GMT +8) Casey", false);
public static final TimeZone T349 = new TimeZone ("T349", "T349", "(GMT +8) Brunei", false);
public static final TimeZone T350 = new TimeZone ("T350", "T350", "(GMT +8) Choibalsan", false);
public static final TimeZone T351 = new TimeZone ("T351", "T351", "(GMT +8) Hong Kong", false);
public static final TimeZone T352 = new TimeZone ("T352", "T352", "(GMT +8) Irkutsk", false);
public static final TimeZone T353 = new TimeZone ("T353", "T353", "(GMT +8) Kuala Lumpur", false);
public static final TimeZone T354 = new TimeZone ("T354", "T354", "(GMT +8) Kuching", false);
public static final TimeZone T355 = new TimeZone ("T355", "T355", "(GMT +8) Macau", false);
public static final TimeZone T356 = new TimeZone ("T356", "T356", "(GMT +8) Makassar", false);
public static final TimeZone T357 = new TimeZone ("T357", "T357", "(GMT +8) Manila", false);
public static final TimeZone T358 = new TimeZone ("T358", "T358", "(GMT +8) Shanghai", false);
public static final TimeZone T359 = new TimeZone ("T359", "T359", "(GMT +8) Singapore", false);
public static final TimeZone T360 = new TimeZone ("T360", "T360", "(GMT +8) Taipei", false);
public static final TimeZone T361 = new TimeZone ("T361", "T361", "(GMT +8) Ulaanbaatar", false);
public static final TimeZone T362 = new TimeZone ("T362", "T362", "(GMT +8) Perth", false);
public static final TimeZone T363 = new TimeZone ("T363", "T363", "(GMT +8:30) Pyongyang", false);
public static final TimeZone T364 = new TimeZone ("T364", "T364", "(GMT +8:45) Eucla", false);
public static final TimeZone T365 = new TimeZone ("T365", "T365", "(GMT +9) Chita", false);
public static final TimeZone T366 = new TimeZone ("T366", "T366", "(GMT +9) Dili", false);
public static final TimeZone T367 = new TimeZone ("T367", "T367", "(GMT +9) Jayapura", false);
public static final TimeZone T368 = new TimeZone ("T368", "T368", "(GMT +9) Khandyga", false);
public static final TimeZone T369 = new TimeZone ("T369", "T369", "(GMT +9) Seoul", false);
public static final TimeZone T370 = new TimeZone ("T370", "T370", "(GMT +9) Tokyo", false);
public static final TimeZone T371 = new TimeZone ("T371", "T371", "(GMT +9) Yakutsk", false);
public static final TimeZone T372 = new TimeZone ("T372", "T372", "(GMT +9) Palau", false);
public static final TimeZone T373 = new TimeZone ("T373", "T373", "(GMT +9:30) Adelaide", false);
public static final TimeZone T374 = new TimeZone ("T374", "T374", "(GMT +9:30) Broken Hill", false);
public static final TimeZone T375 = new TimeZone ("T375", "T375", "(GMT +9:30) Darwin", false);
public static final TimeZone T376 = new TimeZone ("T376", "T376", "(GMT +10) DumontDUrville", false);
public static final TimeZone T377 = new TimeZone ("T377", "T377", "(GMT +10) Ust-Nera", false);
public static final TimeZone T378 = new TimeZone ("T378", "T378", "(GMT +10) Vladivostok", false);
public static final TimeZone T379 = new TimeZone ("T379", "T379", "(GMT +10) Brisbane", false);
public static final TimeZone T380 = new TimeZone ("T380", "T380", "(GMT +10) Currie", false);
public static final TimeZone T381 = new TimeZone ("T381", "T381", "(GMT +10) Hobart", false);
public static final TimeZone T382 = new TimeZone ("T382", "T382", "(GMT +10) Lindeman", false);
public static final TimeZone T383 = new TimeZone ("T383", "T383", "(GMT +10) Melbourne", false);
public static final TimeZone T384 = new TimeZone ("T384", "T384", "(GMT +10) Sydney", false);
public static final TimeZone T385 = new TimeZone ("T385", "T385", "(GMT +10) Chuuk", false);
public static final TimeZone T386 = new TimeZone ("T386", "T386", "(GMT +10) Guam", false);
public static final TimeZone T387 = new TimeZone ("T387", "T387", "(GMT +10) Port Moresby", false);
public static final TimeZone T388 = new TimeZone ("T388", "T388", "(GMT +10) Saipan", false);
public static final TimeZone T389 = new TimeZone ("T389", "T389", "(GMT +10:30) Lord Howe", false);
public static final TimeZone T390 = new TimeZone ("T390", "T390", "(GMT +11) Macquarie", false);
public static final TimeZone T391 = new TimeZone ("T391", "T391", "(GMT +11) Magadan", false);
public static final TimeZone T392 = new TimeZone ("T392", "T392", "(GMT +11) Sakhalin", false);
public static final TimeZone T393 = new TimeZone ("T393", "T393", "(GMT +11) Srednekolymsk", false);
public static final TimeZone T394 = new TimeZone ("T394", "T394", "(GMT +11) Bougainville", false);
public static final TimeZone T395 = new TimeZone ("T395", "T395", "(GMT +11) Efate", false);
public static final TimeZone T396 = new TimeZone ("T396", "T396", "(GMT +11) Guadalcanal", false);
public static final TimeZone T397 = new TimeZone ("T397", "T397", "(GMT +11) Kosrae", false);
public static final TimeZone T398 = new TimeZone ("T398", "T398", "(GMT +11) Norfolk", false);
public static final TimeZone T399 = new TimeZone ("T399", "T399", "(GMT +11) Noumea", false);
public static final TimeZone T400 = new TimeZone ("T400", "T400", "(GMT +11) Pohnpei", false);
public static final TimeZone T401 = new TimeZone ("T401", "T401", "(GMT +12) McMurdo", false);
public static final TimeZone T402 = new TimeZone ("T402", "T402", "(GMT +12) Anadyr", false);
public static final TimeZone T403 = new TimeZone ("T403", "T403", "(GMT +12) Kamchatka", false);
public static final TimeZone T404 = new TimeZone ("T404", "T404", "(GMT +12) Auckland", false);
public static final TimeZone T405 = new TimeZone ("T405", "T405", "(GMT +12) Fiji", false);
public static final TimeZone T406 = new TimeZone ("T406", "T406", "(GMT +12) Funafuti", false);
public static final TimeZone T407 = new TimeZone ("T407", "T407", "(GMT +12) Kwajalein", false);
public static final TimeZone T408 = new TimeZone ("T408", "T408", "(GMT +12) Majuro", false);
public static final TimeZone T409 = new TimeZone ("T409", "T409", "(GMT +12) Nauru", false);
public static final TimeZone T410 = new TimeZone ("T410", "T410", "(GMT +12) Tarawa", false);
public static final TimeZone T411 = new TimeZone ("T411", "T411", "(GMT +12) Wake", false);
public static final TimeZone T412 = new TimeZone ("T412", "T412", "(GMT +12) Wallis", false);
public static final TimeZone T413 = new TimeZone ("T413", "T413", "(GMT +12:45) Chatham", false);
public static final TimeZone T414 = new TimeZone ("T414", "T414", "(GMT +13) Apia", false);
public static final TimeZone T415 = new TimeZone ("T415", "T415", "(GMT +13) Enderbury", false);
public static final TimeZone T416 = new TimeZone ("T416", "T416", "(GMT +13) Fakaofo", false);
public static final TimeZone T417 = new TimeZone ("T417", "T417", "(GMT +13) Tongatapu", false);
public static final TimeZone T418 = new TimeZone ("T418", "T418", "(GMT +14) Kiritimati", false);
private static final TimeZone[] allTimeZones =
new TimeZone[] { T001,T002,T003,T004,T005,T006,T007,T008,T009,T010,T011,T012,T013,T014,T015,T016,T017,T018,T019,T020,T021,T022,T023,T024,T025,T026,T027,T028,T029,T030,T031,T032,T033,T034,T035,T036,T037,T038,T039,T040,T041,T042,T043,T044,T045,T046,T047,T048,T049,T050,T051,T052,T053,T054,T055,T056,T057,T058,T059,T060,T061,T062,T063,T064,T065,T066,T067,T068,T069,T070,T071,T072,T073,T074,T075,T076,T077,T078,T079,T080,T081,T082,T083,T084,T085,T086,T087,T088,T089,T090,T091,T092,T093,T094,T095,T096,T097,T098,T099,T100,T101,T102,T103,T104,T105,T106,T107,T108,T109,T110,T111,T112,T113,T114,T115,T116,T117,T118,T119,T120,T121,T122,T123,T124,T125,T126,T127,T128,T129,T130,T131,T132,T133,T134,T135,T136,T137,T138,T139,T140,T141,T142,T143,T144,T145,T146,T147,T148,T149,T150,T151,T152,T153,T154,T155,T156,T157,T158,T159,T160,T161,T162,T163,T164,T165,T166,T167,T168,T169,T170,T171,T172,T173,T174,T175,T176,T177,T178,T179,T180,T181,T182,T183,T184,T185,T186,T187,T188,T189,T190,T191,T192,T193,T194,T195,T196,T197,T198,T199,T200,T201,T202,T203,T204,T205,T206,T207,T208,T209,T210,T211,T212,T213,T214,T215,T216,T217,T218,T219,T220,T221,T222,T223,T224,T225,T226,T227,T228,T229,T230,T231,T232,T233,T234,T235,T236,T237,T238,T239,T240,T241,T242,T243,T244,T245,T246,T247,T248,T249,T250,T251,T252,T253,T254,T255,T256,T257,T258,T259,T260,T261,T262,T263,T264,T265,T266,T267,T268,T269,T270,T271,T272,T273,T274,T275,T276,T277,T278,T279,T280,T281,T282,T283,T284,T285,T286,T287,T288,T289,T290,T291,T292,T293,T294,T295,T296,T297,T298,T299,T300,T301,T302,T303,T304,T305,T306,T307,T308,T309,T310,T311,T312,T313,T314,T315,T316,T317,T318,T319,T320,T321,T322,T323,T324,T325,T326,T327,T328,T329,T330,T331,T332,T333,T334,T335,T336,T337,T338,T339,T340,T341,T342,T343,T344,T345,T346,T347,T348,T349,T350,T351,T352,T353,T354,T355,T356,T357,T358,T359,T360,T361,T362,T363,T364,T365,T366,T367,T368,T369,T370,T371,T372,T373,T374,T375,T376,T377,T378,T379,T380,T381,T382,T383,T384,T385,T386,T387,T388,T389,T390,T391,T392,T393,T394,T395,T396,T397,T398,T399,T400,T401,T402,T403,T404,T405,T406,T407,T408,T409,T410,T411,T412,T413,T414,T415,T416,T417,T418};
private static TimeZone[] getAllTimeZones ()
{
return allTimeZones;
}
private transient String TimeZoneCode;
private transient String Country;
private TimeZone (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public String getTimeZoneCode()
{
return TimeZoneCode;
}
public String getCountry()
{
return Country;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allTimeZones);
static
{
defineAdditionalData ();
}
public boolean isEqual (TimeZone other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return TimeZone.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return TimeZone.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_TimeZone;
}
public static TimeZone forName (String name)
{
if (name == null) { return null; }
TimeZone[] all = getAllTimeZones();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static TimeZone forValue (String value)
{
if (value == null) { return null; }
TimeZone[] all = getAllTimeZones();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllTimeZones (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllTimeZones());
}
public static TimeZone[] getTimeZoneArray ()
{
return (TimeZone[])getAllTimeZones().clone ();
}
public static void defineAdditionalData ()
{
T001.TimeZoneCode = "Pacific/Midway";
T001.Country = "United States Minor Outlying Islands";
T002.TimeZoneCode = "Pacific/Niue";
T002.Country = "Niue";
T003.TimeZoneCode = "Pacific/Pago_Pago";
T003.Country = "American Samoa";
T004.TimeZoneCode = "America/Adak";
T004.Country = "United States";
T005.TimeZoneCode = "Pacific/Honolulu";
T005.Country = "United States";
T006.TimeZoneCode = "Pacific/Johnston";
T006.Country = "United States Minor Outlying Islands";
T007.TimeZoneCode = "Pacific/Rarotonga";
T007.Country = "Cook Islands";
T008.TimeZoneCode = "Pacific/Tahiti";
T008.Country = "French Polynesia";
T009.TimeZoneCode = "Pacific/Marquesas";
T009.Country = "French Polynesia";
T010.TimeZoneCode = "America/Anchorage";
T010.Country = "United States";
T011.TimeZoneCode = "America/Juneau";
T011.Country = "United States";
T012.TimeZoneCode = "America/Metlakatla";
T012.Country = "United States";
T013.TimeZoneCode = "America/Nome";
T013.Country = "United States";
T014.TimeZoneCode = "America/Sitka";
T014.Country = "United States";
T015.TimeZoneCode = "America/Yakutat";
T015.Country = "United States";
T016.TimeZoneCode = "Pacific/Gambier";
T016.Country = "French Polynesia";
T017.TimeZoneCode = "America/Dawson";
T017.Country = "Canada";
T018.TimeZoneCode = "America/Los_Angeles";
T018.Country = "United States";
T019.TimeZoneCode = "America/Tijuana";
T019.Country = "Mexico";
T020.TimeZoneCode = "America/Vancouver";
T020.Country = "Canada";
T021.TimeZoneCode = "America/Whitehorse";
T021.Country = "Canada";
T022.TimeZoneCode = "Pacific/Pitcairn";
T022.Country = "Pitcairn";
T023.TimeZoneCode = "America/Boise";
T023.Country = "United States";
T024.TimeZoneCode = "America/Cambridge_Bay";
T024.Country = "Canada";
T025.TimeZoneCode = "America/Chihuahua";
T025.Country = "Mexico";
T026.TimeZoneCode = "America/Creston";
T026.Country = "Canada";
T027.TimeZoneCode = "America/Dawson_Creek";
T027.Country = "Canada";
T028.TimeZoneCode = "America/Denver";
T028.Country = "United States";
T029.TimeZoneCode = "America/Edmonton";
T029.Country = "Canada";
T030.TimeZoneCode = "America/Fort_Nelson";
T030.Country = "Canada";
T031.TimeZoneCode = "America/Hermosillo";
T031.Country = "Mexico";
T032.TimeZoneCode = "America/Inuvik";
T032.Country = "Canada";
T033.TimeZoneCode = "America/Mazatlan";
T033.Country = "Mexico";
T034.TimeZoneCode = "America/Ojinaga";
T034.Country = "Mexico";
T035.TimeZoneCode = "America/Phoenix";
T035.Country = "United States";
T036.TimeZoneCode = "America/Yellowknife";
T036.Country = "Canada";
T037.TimeZoneCode = "America/Bahia_Banderas";
T037.Country = "Mexico";
T038.TimeZoneCode = "America/Belize";
T038.Country = "Belize";
T039.TimeZoneCode = "America/Chicago";
T039.Country = "United States";
T040.TimeZoneCode = "America/Costa_Rica";
T040.Country = "Costa Rica";
T041.TimeZoneCode = "America/El_Salvador";
T041.Country = "El Salvador";
T042.TimeZoneCode = "America/Guatemala";
T042.Country = "Guatemala";
T043.TimeZoneCode = "America/Indiana/Knox";
T043.Country = "United States";
T044.TimeZoneCode = "America/Indiana/Tell_City";
T044.Country = "United States";
T045.TimeZoneCode = "America/Managua";
T045.Country = "Nicaragua";
T046.TimeZoneCode = "America/Matamoros";
T046.Country = "Mexico";
T047.TimeZoneCode = "America/Menominee";
T047.Country = "United States";
T048.TimeZoneCode = "America/Merida";
T048.Country = "Mexico";
T049.TimeZoneCode = "America/Mexico_City";
T049.Country = "Mexico";
T050.TimeZoneCode = "America/Monterrey";
T050.Country = "Mexico";
T051.TimeZoneCode = "America/North_Dakota/Beulah";
T051.Country = "United States";
T052.TimeZoneCode = "America/North_Dakota/Center";
T052.Country = "United States";
T053.TimeZoneCode = "America/North_Dakota/New_Salem";
T053.Country = "United States";
T054.TimeZoneCode = "America/Rainy_River";
T054.Country = "Canada";
T055.TimeZoneCode = "America/Rankin_Inlet";
T055.Country = "Canada";
T056.TimeZoneCode = "America/Regina";
T056.Country = "Canada";
T057.TimeZoneCode = "America/Resolute";
T057.Country = "Canada";
T058.TimeZoneCode = "America/Swift_Current";
T058.Country = "Canada";
T059.TimeZoneCode = "America/Tegucigalpa";
T059.Country = "Honduras";
T060.TimeZoneCode = "America/Winnipeg";
T060.Country = "Canada";
T061.TimeZoneCode = "Pacific/Easter";
T061.Country = "Chile";
T062.TimeZoneCode = "Pacific/Galapagos";
T062.Country = "Ecuador";
T063.TimeZoneCode = "America/Atikokan";
T063.Country = "Canada";
T064.TimeZoneCode = "America/Bogota";
T064.Country = "Colombia";
T065.TimeZoneCode = "America/Cancun";
T065.Country = "Mexico";
T066.TimeZoneCode = "America/Cayman";
T066.Country = "Cayman Islands";
T067.TimeZoneCode = "America/Detroit";
T067.Country = "United States";
T068.TimeZoneCode = "America/Eirunepe";
T068.Country = "Brazil";
T069.TimeZoneCode = "America/Guayaquil";
T069.Country = "Ecuador";
T070.TimeZoneCode = "America/Havana";
T070.Country = "Cuba";
T071.TimeZoneCode = "America/Indiana/Indianapolis";
T071.Country = "United States";
T072.TimeZoneCode = "America/Indiana/Marengo";
T072.Country = "United States";
T073.TimeZoneCode = "America/Indiana/Petersburg";
T073.Country = "United States";
T074.TimeZoneCode = "America/Indiana/Vevay";
T074.Country = "United States";
T075.TimeZoneCode = "America/Indiana/Vincennes";
T075.Country = "United States";
T076.TimeZoneCode = "America/Indiana/Winamac";
T076.Country = "United States";
T077.TimeZoneCode = "America/Iqaluit";
T077.Country = "Canada";
T078.TimeZoneCode = "America/Jamaica";
T078.Country = "Jamaica";
T079.TimeZoneCode = "America/Kentucky/Louisville";
T079.Country = "United States";
T080.TimeZoneCode = "America/Kentucky/Monticello";
T080.Country = "United States";
T081.TimeZoneCode = "America/Lima";
T081.Country = "Peru";
T082.TimeZoneCode = "America/Nassau";
T082.Country = "Bahamas";
T083.TimeZoneCode = "America/New_York";
T083.Country = "United States";
T084.TimeZoneCode = "America/Nipigon";
T084.Country = "Canada";
T085.TimeZoneCode = "America/Panama";
T085.Country = "Panama";
T086.TimeZoneCode = "America/Pangnirtung";
T086.Country = "Canada";
T087.TimeZoneCode = "America/Port-au-Prince";
T087.Country = "Haiti";
T088.TimeZoneCode = "America/Rio_Branco";
T088.Country = "Brazil";
T089.TimeZoneCode = "America/Thunder_Bay";
T089.Country = "Canada";
T090.TimeZoneCode = "America/Toronto";
T090.Country = "Canada";
T091.TimeZoneCode = "America/Anguilla";
T091.Country = "Anguilla";
T092.TimeZoneCode = "America/Antigua";
T092.Country = "Antigua and Barbuda";
T093.TimeZoneCode = "America/Aruba";
T093.Country = "Aruba";
T094.TimeZoneCode = "America/Asuncion";
T094.Country = "Paraguay";
T095.TimeZoneCode = "America/Barbados";
T095.Country = "Barbados";
T096.TimeZoneCode = "America/Blanc-Sablon";
T096.Country = "Canada";
T097.TimeZoneCode = "America/Boa_Vista";
T097.Country = "Brazil";
T098.TimeZoneCode = "America/Campo_Grande";
T098.Country = "Brazil";
T099.TimeZoneCode = "America/Caracas";
T099.Country = "Venezuela";
T100.TimeZoneCode = "America/Cuiaba";
T100.Country = "Brazil";
T101.TimeZoneCode = "America/Curacao";
T101.Country = "Curacao";
T102.TimeZoneCode = "America/Dominica";
T102.Country = "Dominica";
T103.TimeZoneCode = "America/Glace_Bay";
T103.Country = "Canada";
T104.TimeZoneCode = "America/Goose_Bay";
T104.Country = "Canada";
T105.TimeZoneCode = "America/Grand_Turk";
T105.Country = "Turks and Caicos Islands";
T106.TimeZoneCode = "America/Grenada";
T106.Country = "Grenada";
T107.TimeZoneCode = "America/Guadeloupe";
T107.Country = "Guadeloupe";
T108.TimeZoneCode = "America/Guyana";
T108.Country = "Guyana";
T109.TimeZoneCode = "America/Halifax";
T109.Country = "Canada";
T110.TimeZoneCode = "America/Kralendijk";
T110.Country = "Bonaire, Saint Eustatius and Saba";
T111.TimeZoneCode = "America/La_Paz";
T111.Country = "Bolivia";
T112.TimeZoneCode = "America/Lower_Princes";
T112.Country = "Sint Maarten";
T113.TimeZoneCode = "America/Manaus";
T113.Country = "Brazil";
T114.TimeZoneCode = "America/Marigot";
T114.Country = "Saint Martin";
T115.TimeZoneCode = "America/Martinique";
T115.Country = "Martinique";
T116.TimeZoneCode = "America/Moncton";
T116.Country = "Canada";
T117.TimeZoneCode = "America/Montserrat";
T117.Country = "Montserrat";
T118.TimeZoneCode = "America/Porto_Velho";
T118.Country = "Brazil";
T119.TimeZoneCode = "America/Port_of_Spain";
T119.Country = "Trinidad and Tobago";
T120.TimeZoneCode = "America/Puerto_Rico";
T120.Country = "Puerto Rico";
T121.TimeZoneCode = "America/Santiago";
T121.Country = "Chile";
T122.TimeZoneCode = "America/Santo_Domingo";
T122.Country = "Dominican Republic";
T123.TimeZoneCode = "America/St_Barthelemy";
T123.Country = "Saint Barthelemy";
T124.TimeZoneCode = "America/St_Kitts";
T124.Country = "Saint Kitts and Nevis";
T125.TimeZoneCode = "America/St_Lucia";
T125.Country = "Saint Lucia";
T126.TimeZoneCode = "America/St_Thomas";
T126.Country = "U.S. Virgin Islands";
T127.TimeZoneCode = "America/St_Vincent";
T127.Country = "Saint Vincent and the Grenadines";
T128.TimeZoneCode = "America/Thule";
T128.Country = "Greenland";
T129.TimeZoneCode = "America/Tortola";
T129.Country = "British Virgin Islands";
T130.TimeZoneCode = "Antarctica/Palmer";
T130.Country = "Antarctica";
T131.TimeZoneCode = "Atlantic/Bermuda";
T131.Country = "Bermuda";
T132.TimeZoneCode = "America/St_Johns";
T132.Country = "Canada";
T133.TimeZoneCode = "America/Araguaina";
T133.Country = "Brazil";
T134.TimeZoneCode = "America/Argentina/Buenos_Aires";
T134.Country = "Argentina";
T135.TimeZoneCode = "America/Argentina/Catamarca";
T135.Country = "Argentina";
T136.TimeZoneCode = "America/Argentina/Cordoba";
T136.Country = "Argentina";
T137.TimeZoneCode = "America/Argentina/Jujuy";
T137.Country = "Argentina";
T138.TimeZoneCode = "America/Argentina/La_Rioja";
T138.Country = "Argentina";
T139.TimeZoneCode = "America/Argentina/Mendoza";
T139.Country = "Argentina";
T140.TimeZoneCode = "America/Argentina/Rio_Gallegos";
T140.Country = "Argentina";
T141.TimeZoneCode = "America/Argentina/Salta";
T141.Country = "Argentina";
T142.TimeZoneCode = "America/Argentina/San_Juan";
T142.Country = "Argentina";
T143.TimeZoneCode = "America/Argentina/San_Luis";
T143.Country = "Argentina";
T144.TimeZoneCode = "America/Argentina/Tucuman";
T144.Country = "Argentina";
T145.TimeZoneCode = "America/Argentina/Ushuaia";
T145.Country = "Argentina";
T146.TimeZoneCode = "America/Bahia";
T146.Country = "Brazil";
T147.TimeZoneCode = "America/Belem";
T147.Country = "Brazil";
T148.TimeZoneCode = "America/Cayenne";
T148.Country = "French Guiana";
T149.TimeZoneCode = "America/Fortaleza";
T149.Country = "Brazil";
T150.TimeZoneCode = "America/Godthab";
T150.Country = "Greenland";
T151.TimeZoneCode = "America/Maceio";
T151.Country = "Brazil";
T152.TimeZoneCode = "America/Miquelon";
T152.Country = "Saint Pierre and Miquelon";
T153.TimeZoneCode = "America/Montevideo";
T153.Country = "Uruguay";
T154.TimeZoneCode = "America/Paramaribo";
T154.Country = "Suriname";
T155.TimeZoneCode = "America/Recife";
T155.Country = "Brazil";
T156.TimeZoneCode = "America/Santarem";
T156.Country = "Brazil";
T157.TimeZoneCode = "America/Sao_Paulo";
T157.Country = "Brazil";
T158.TimeZoneCode = "Antarctica/Rothera";
T158.Country = "Antarctica";
T159.TimeZoneCode = "Atlantic/Stanley";
T159.Country = "Falkland Islands";
T160.TimeZoneCode = "America/Noronha";
T160.Country = "Brazil";
T161.TimeZoneCode = "Atlantic/South_Georgia";
T161.Country = "South Georgia and the South Sandwich Islands";
T162.TimeZoneCode = "America/Scoresbysund";
T162.Country = "Greenland";
T163.TimeZoneCode = "Atlantic/Azores";
T163.Country = "Portugal";
T164.TimeZoneCode = "Atlantic/Cape_Verde";
T164.Country = "Cape Verde";
T165.TimeZoneCode = "Africa/Abidjan";
T165.Country = "Ivory Coast";
T166.TimeZoneCode = "Africa/Accra";
T166.Country = "Ghana";
T167.TimeZoneCode = "Africa/Bamako";
T167.Country = "Mali";
T168.TimeZoneCode = "Africa/Banjul";
T168.Country = "Gambia";
T169.TimeZoneCode = "Africa/Bissau";
T169.Country = "Guinea-Bissau";
T170.TimeZoneCode = "Africa/Casablanca";
T170.Country = "Morocco";
T171.TimeZoneCode = "Africa/Conakry";
T171.Country = "Guinea";
T172.TimeZoneCode = "Africa/Dakar";
T172.Country = "Senegal";
T173.TimeZoneCode = "Africa/El_Aaiun";
T173.Country = "Western Sahara";
T174.TimeZoneCode = "Africa/Freetown";
T174.Country = "Sierra Leone";
T175.TimeZoneCode = "Africa/Lome";
T175.Country = "Togo";
T176.TimeZoneCode = "Africa/Monrovia";
T176.Country = "Liberia";
T177.TimeZoneCode = "Africa/Nouakchott";
T177.Country = "Mauritania";
T178.TimeZoneCode = "Africa/Ouagadougou";
T178.Country = "Burkina Faso";
T179.TimeZoneCode = "Africa/Sao_Tome";
T179.Country = "Sao Tome and Principe";
T180.TimeZoneCode = "America/Danmarkshavn";
T180.Country = "Greenland";
T181.TimeZoneCode = "Antarctica/Troll";
T181.Country = "Antarctica";
T182.TimeZoneCode = "Atlantic/Canary";
T182.Country = "Spain";
T183.TimeZoneCode = "Atlantic/Faroe";
T183.Country = "Faroe Islands";
T184.TimeZoneCode = "Atlantic/Madeira";
T184.Country = "Portugal";
T185.TimeZoneCode = "Atlantic/Reykjavik";
T185.Country = "Iceland";
T186.TimeZoneCode = "Atlantic/St_Helena";
T186.Country = "Saint Helena";
T187.TimeZoneCode = "Europe/Dublin";
T187.Country = "Ireland";
T188.TimeZoneCode = "Europe/Guernsey";
T188.Country = "Guernsey";
T189.TimeZoneCode = "Europe/Isle_of_Man";
T189.Country = "Isle of Man";
T190.TimeZoneCode = "Europe/Jersey";
T190.Country = "Jersey";
T191.TimeZoneCode = "Europe/Lisbon";
T191.Country = "Portugal";
T192.TimeZoneCode = "Europe/London";
T192.Country = "United Kingdom";
T193.TimeZoneCode = "Africa/Algiers";
T193.Country = "Algeria";
T194.TimeZoneCode = "Africa/Bangui";
T194.Country = "Central African Republic";
T195.TimeZoneCode = "Africa/Brazzaville";
T195.Country = "Republic of the Congo";
T196.TimeZoneCode = "Africa/Ceuta";
T196.Country = "Spain";
T197.TimeZoneCode = "Africa/Douala";
T197.Country = "Cameroon";
T198.TimeZoneCode = "Africa/Kinshasa";
T198.Country = "Democratic Republic of the Congo";
T199.TimeZoneCode = "Africa/Lagos";
T199.Country = "Nigeria";
T200.TimeZoneCode = "Africa/Libreville";
T200.Country = "Gabon";
T201.TimeZoneCode = "Africa/Luanda";
T201.Country = "Angola";
T202.TimeZoneCode = "Africa/Malabo";
T202.Country = "Equatorial Guinea";
T203.TimeZoneCode = "Africa/Ndjamena";
T203.Country = "Chad";
T204.TimeZoneCode = "Africa/Niamey";
T204.Country = "Niger";
T205.TimeZoneCode = "Africa/Porto-Novo";
T205.Country = "Benin";
T206.TimeZoneCode = "Africa/Tunis";
T206.Country = "Tunisia";
T207.TimeZoneCode = "Africa/Windhoek";
T207.Country = "Namibia";
T208.TimeZoneCode = "Arctic/Longyearbyen";
T208.Country = "Svalbard and Jan Mayen";
T209.TimeZoneCode = "Europe/Amsterdam";
T209.Country = "Netherlands";
T210.TimeZoneCode = "Europe/Andorra";
T210.Country = "Andorra";
T211.TimeZoneCode = "Europe/Belgrade";
T211.Country = "Serbia";
T212.TimeZoneCode = "Europe/Berlin";
T212.Country = "Germany";
T213.TimeZoneCode = "Europe/Bratislava";
T213.Country = "Slovakia";
T214.TimeZoneCode = "Europe/Brussels";
T214.Country = "Belgium";
T215.TimeZoneCode = "Europe/Budapest";
T215.Country = "Hungary";
T216.TimeZoneCode = "Europe/Copenhagen";
T216.Country = "Denmark";
T217.TimeZoneCode = "Europe/Gibraltar";
T217.Country = "Gibraltar";
T218.TimeZoneCode = "Europe/Ljubljana";
T218.Country = "Slovenia";
T219.TimeZoneCode = "Europe/Luxembourg";
T219.Country = "Luxembourg";
T220.TimeZoneCode = "Europe/Madrid";
T220.Country = "Spain";
T221.TimeZoneCode = "Europe/Malta";
T221.Country = "Malta";
T222.TimeZoneCode = "Europe/Monaco";
T222.Country = "Monaco";
T223.TimeZoneCode = "Europe/Oslo";
T223.Country = "Norway";
T224.TimeZoneCode = "Europe/Paris";
T224.Country = "France";
T225.TimeZoneCode = "Europe/Podgorica";
T225.Country = "Montenegro";
T226.TimeZoneCode = "Europe/Prague";
T226.Country = "Czech Republic";
T227.TimeZoneCode = "Europe/Rome";
T227.Country = "Italy";
T228.TimeZoneCode = "Europe/San_Marino";
T228.Country = "San Marino";
T229.TimeZoneCode = "Europe/Sarajevo";
T229.Country = "Bosnia and Herzegovina";
T230.TimeZoneCode = "Europe/Skopje";
T230.Country = "Macedonia";
T231.TimeZoneCode = "Europe/Stockholm";
T231.Country = "Sweden";
T232.TimeZoneCode = "Europe/Tirane";
T232.Country = "Albania";
T233.TimeZoneCode = "Europe/Vaduz";
T233.Country = "Liechtenstein";
T234.TimeZoneCode = "Europe/Vatican";
T234.Country = "Vatican";
T235.TimeZoneCode = "Europe/Vienna";
T235.Country = "Austria";
T236.TimeZoneCode = "Europe/Warsaw";
T236.Country = "Poland";
T237.TimeZoneCode = "Europe/Zagreb";
T237.Country = "Croatia";
T238.TimeZoneCode = "Europe/Zurich";
T238.Country = "Switzerland";
T239.TimeZoneCode = "Africa/Blantyre";
T239.Country = "Malawi";
T240.TimeZoneCode = "Africa/Bujumbura";
T240.Country = "Burundi";
T241.TimeZoneCode = "Africa/Cairo";
T241.Country = "Egypt";
T242.TimeZoneCode = "Africa/Gaborone";
T242.Country = "Botswana";
T243.TimeZoneCode = "Africa/Harare";
T243.Country = "Zimbabwe";
T244.TimeZoneCode = "Africa/Johannesburg";
T244.Country = "South Africa";
T245.TimeZoneCode = "Africa/Kigali";
T245.Country = "Rwanda";
T246.TimeZoneCode = "Africa/Lubumbashi";
T246.Country = "Democratic Republic of the Congo";
T247.TimeZoneCode = "Africa/Lusaka";
T247.Country = "Zambia";
T248.TimeZoneCode = "Africa/Maputo";
T248.Country = "Mozambique";
T249.TimeZoneCode = "Africa/Maseru";
T249.Country = "Lesotho";
T250.TimeZoneCode = "Africa/Mbabane";
T250.Country = "Swaziland";
T251.TimeZoneCode = "Africa/Tripoli";
T251.Country = "Libya";
T252.TimeZoneCode = "Asia/Amman";
T252.Country = "Jordan";
T253.TimeZoneCode = "Asia/Beirut";
T253.Country = "Lebanon";
T254.TimeZoneCode = "Asia/Damascus";
T254.Country = "Syria";
T255.TimeZoneCode = "Asia/Gaza";
T255.Country = "Palestinian Territory";
T256.TimeZoneCode = "Asia/Hebron";
T256.Country = "Palestinian Territory";
T257.TimeZoneCode = "Asia/Jerusalem";
T257.Country = "Israel";
T258.TimeZoneCode = "Asia/Nicosia";
T258.Country = "Cyprus";
T259.TimeZoneCode = "Europe/Athens";
T259.Country = "Greece";
T260.TimeZoneCode = "Europe/Bucharest";
T260.Country = "Romania";
T261.TimeZoneCode = "Europe/Chisinau";
T261.Country = "Moldova";
T262.TimeZoneCode = "Europe/Helsinki";
T262.Country = "Finland";
T263.TimeZoneCode = "Europe/Istanbul";
T263.Country = "Turkey";
T264.TimeZoneCode = "Europe/Kaliningrad";
T264.Country = "Russia";
T265.TimeZoneCode = "Europe/Kiev";
T265.Country = "Ukraine";
T266.TimeZoneCode = "Europe/Mariehamn";
T266.Country = "Aland Islands";
T267.TimeZoneCode = "Europe/Riga";
T267.Country = "Latvia";
T268.TimeZoneCode = "Europe/Sofia";
T268.Country = "Bulgaria";
T269.TimeZoneCode = "Europe/Tallinn";
T269.Country = "Estonia";
T270.TimeZoneCode = "Europe/Uzhgorod";
T270.Country = "Ukraine";
T271.TimeZoneCode = "Europe/Vilnius";
T271.Country = "Lithuania";
T272.TimeZoneCode = "Europe/Zaporozhye";
T272.Country = "Ukraine";
T273.TimeZoneCode = "Africa/Addis_Ababa";
T273.Country = "Ethiopia";
T274.TimeZoneCode = "Africa/Asmara";
T274.Country = "Eritrea";
T275.TimeZoneCode = "Africa/Dar_es_Salaam";
T275.Country = "Tanzania";
T276.TimeZoneCode = "Africa/Djibouti";
T276.Country = "Djibouti";
T277.TimeZoneCode = "Africa/Juba";
T277.Country = "South Sudan";
T278.TimeZoneCode = "Africa/Kampala";
T278.Country = "Uganda";
T279.TimeZoneCode = "Africa/Khartoum";
T279.Country = "Sudan";
T280.TimeZoneCode = "Africa/Mogadishu";
T280.Country = "Somalia";
T281.TimeZoneCode = "Africa/Nairobi";
T281.Country = "Kenya";
T282.TimeZoneCode = "Antarctica/Syowa";
T282.Country = "Antarctica";
T283.TimeZoneCode = "Asia/Aden";
T283.Country = "Yemen";
T284.TimeZoneCode = "Asia/Baghdad";
T284.Country = "Iraq";
T285.TimeZoneCode = "Asia/Bahrain";
T285.Country = "Bahrain";
T286.TimeZoneCode = "Asia/Kuwait";
T286.Country = "Kuwait";
T287.TimeZoneCode = "Asia/Qatar";
T287.Country = "Qatar";
T288.TimeZoneCode = "Asia/Riyadh";
T288.Country = "Saudi Arabia";
T289.TimeZoneCode = "Europe/Minsk";
T289.Country = "Belarus";
T290.TimeZoneCode = "Europe/Moscow";
T290.Country = "Russia";
T291.TimeZoneCode = "Europe/Simferopol";
T291.Country = "Russia";
T292.TimeZoneCode = "Europe/Volgograd";
T292.Country = "Russia";
T293.TimeZoneCode = "Indian/Antananarivo";
T293.Country = "Madagascar";
T294.TimeZoneCode = "Indian/Comoro";
T294.Country = "Comoros";
T295.TimeZoneCode = "Indian/Mayotte";
T295.Country = "Mayotte";
T296.TimeZoneCode = "Asia/Tehran";
T296.Country = "Iran";
T297.TimeZoneCode = "Asia/Baku";
T297.Country = "Azerbaijan";
T298.TimeZoneCode = "Asia/Dubai";
T298.Country = "United Arab Emirates";
T299.TimeZoneCode = "Asia/Muscat";
T299.Country = "Oman";
T300.TimeZoneCode = "Asia/Tbilisi";
T300.Country = "Georgia";
T301.TimeZoneCode = "Asia/Yerevan";
T301.Country = "Armenia";
T302.TimeZoneCode = "Europe/Astrakhan";
T302.Country = "Russia";
T303.TimeZoneCode = "Europe/Samara";
T303.Country = "Russia";
T304.TimeZoneCode = "Europe/Ulyanovsk";
T304.Country = "Russia";
T305.TimeZoneCode = "Indian/Mahe";
T305.Country = "Seychelles";
T306.TimeZoneCode = "Indian/Mauritius";
T306.Country = "Mauritius";
T307.TimeZoneCode = "Indian/Reunion";
T307.Country = "Reunion";
T308.TimeZoneCode = "Asia/Kabul";
T308.Country = "Afghanistan";
T309.TimeZoneCode = "Antarctica/Mawson";
T309.Country = "Antarctica";
T310.TimeZoneCode = "Asia/Aqtau";
T310.Country = "Kazakhstan";
T311.TimeZoneCode = "Asia/Aqtobe";
T311.Country = "Kazakhstan";
T312.TimeZoneCode = "Asia/Ashgabat";
T312.Country = "Turkmenistan";
T313.TimeZoneCode = "Asia/Dushanbe";
T313.Country = "Tajikistan";
T314.TimeZoneCode = "Asia/Karachi";
T314.Country = "Pakistan";
T315.TimeZoneCode = "Asia/Oral";
T315.Country = "Kazakhstan";
T316.TimeZoneCode = "Asia/Samarkand";
T316.Country = "Uzbekistan";
T317.TimeZoneCode = "Asia/Tashkent";
T317.Country = "Uzbekistan";
T318.TimeZoneCode = "Asia/Yekaterinburg";
T318.Country = "Russia";
T319.TimeZoneCode = "Indian/Kerguelen";
T319.Country = "French Southern Territories";
T320.TimeZoneCode = "Indian/Maldives";
T320.Country = "Maldives";
T321.TimeZoneCode = "Asia/Colombo";
T321.Country = "Sri Lanka";
T322.TimeZoneCode = "Asia/Kolkata";
T322.Country = "India";
T323.TimeZoneCode = "Asia/Kathmandu";
T323.Country = "Nepal";
T324.TimeZoneCode = "Antarctica/Vostok";
T324.Country = "Antarctica";
T325.TimeZoneCode = "Asia/Almaty";
T325.Country = "Kazakhstan";
T326.TimeZoneCode = "Asia/Bishkek";
T326.Country = "Kyrgyzstan";
T327.TimeZoneCode = "Asia/Dhaka";
T327.Country = "Bangladesh";
T328.TimeZoneCode = "Asia/Novosibirsk";
T328.Country = "Russia";
T329.TimeZoneCode = "Asia/Omsk";
T329.Country = "Russia";
T330.TimeZoneCode = "Asia/Qyzylorda";
T330.Country = "Kazakhstan";
T331.TimeZoneCode = "Asia/Thimphu";
T331.Country = "Bhutan";
T332.TimeZoneCode = "Asia/Urumqi";
T332.Country = "China";
T333.TimeZoneCode = "Indian/Chagos";
T333.Country = "British Indian Ocean Territory";
T334.TimeZoneCode = "Asia/Rangoon";
T334.Country = "Myanmar";
T335.TimeZoneCode = "Indian/Cocos";
T335.Country = "Cocos Islands";
T336.TimeZoneCode = "Antarctica/Davis";
T336.Country = "Antarctica";
T337.TimeZoneCode = "Asia/Bangkok";
T337.Country = "Thailand";
T338.TimeZoneCode = "Asia/Barnaul";
T338.Country = "Russia";
T339.TimeZoneCode = "Asia/Hovd";
T339.Country = "Mongolia";
T340.TimeZoneCode = "Asia/Ho_Chi_Minh";
T340.Country = "Vietnam";
T341.TimeZoneCode = "Asia/Jakarta";
T341.Country = "Indonesia";
T342.TimeZoneCode = "Asia/Krasnoyarsk";
T342.Country = "Russia";
T343.TimeZoneCode = "Asia/Novokuznetsk";
T343.Country = "Russia";
T344.TimeZoneCode = "Asia/Phnom_Penh";
T344.Country = "Cambodia";
T345.TimeZoneCode = "Asia/Pontianak";
T345.Country = "Indonesia";
T346.TimeZoneCode = "Asia/Vientiane";
T346.Country = "Laos";
T347.TimeZoneCode = "Indian/Christmas";
T347.Country = "Christmas Island";
T348.TimeZoneCode = "Antarctica/Casey";
T348.Country = "Antarctica";
T349.TimeZoneCode = "Asia/Brunei";
T349.Country = "Brunei";
T350.TimeZoneCode = "Asia/Choibalsan";
T350.Country = "Mongolia";
T351.TimeZoneCode = "Asia/Hong_Kong";
T351.Country = "Hong Kong";
T352.TimeZoneCode = "Asia/Irkutsk";
T352.Country = "Russia";
T353.TimeZoneCode = "Asia/Kuala_Lumpur";
T353.Country = "Malaysia";
T354.TimeZoneCode = "Asia/Kuching";
T354.Country = "Malaysia";
T355.TimeZoneCode = "Asia/Macau";
T355.Country = "Macao";
T356.TimeZoneCode = "Asia/Makassar";
T356.Country = "Indonesia";
T357.TimeZoneCode = "Asia/Manila";
T357.Country = "Philippines";
T358.TimeZoneCode = "Asia/Shanghai";
T358.Country = "China";
T359.TimeZoneCode = "Asia/Singapore";
T359.Country = "Singapore";
T360.TimeZoneCode = "Asia/Taipei";
T360.Country = "Taiwan";
T361.TimeZoneCode = "Asia/Ulaanbaatar";
T361.Country = "Mongolia";
T362.TimeZoneCode = "Australia/Perth";
T362.Country = "Australia";
T363.TimeZoneCode = "Asia/Pyongyang";
T363.Country = "North Korea";
T364.TimeZoneCode = "Australia/Eucla";
T364.Country = "Australia";
T365.TimeZoneCode = "Asia/Chita";
T365.Country = "Russia";
T366.TimeZoneCode = "Asia/Dili";
T366.Country = "East Timor";
T367.TimeZoneCode = "Asia/Jayapura";
T367.Country = "Indonesia";
T368.TimeZoneCode = "Asia/Khandyga";
T368.Country = "Russia";
T369.TimeZoneCode = "Asia/Seoul";
T369.Country = "South Korea";
T370.TimeZoneCode = "Asia/Tokyo";
T370.Country = "Japan";
T371.TimeZoneCode = "Asia/Yakutsk";
T371.Country = "Russia";
T372.TimeZoneCode = "Pacific/Palau";
T372.Country = "Palau";
T373.TimeZoneCode = "Australia/Adelaide";
T373.Country = "Australia";
T374.TimeZoneCode = "Australia/Broken_Hill";
T374.Country = "Australia";
T375.TimeZoneCode = "Australia/Darwin";
T375.Country = "Australia";
T376.TimeZoneCode = "Antarctica/DumontDUrville";
T376.Country = "Antarctica";
T377.TimeZoneCode = "Asia/Ust-Nera";
T377.Country = "Russia";
T378.TimeZoneCode = "Asia/Vladivostok";
T378.Country = "Russia";
T379.TimeZoneCode = "Australia/Brisbane";
T379.Country = "Australia";
T380.TimeZoneCode = "Australia/Currie";
T380.Country = "Australia";
T381.TimeZoneCode = "Australia/Hobart";
T381.Country = "Australia";
T382.TimeZoneCode = "Australia/Lindeman";
T382.Country = "Australia";
T383.TimeZoneCode = "Australia/Melbourne";
T383.Country = "Australia";
T384.TimeZoneCode = "Australia/Sydney";
T384.Country = "Australia";
T385.TimeZoneCode = "Pacific/Chuuk";
T385.Country = "Micronesia";
T386.TimeZoneCode = "Pacific/Guam";
T386.Country = "Guam";
T387.TimeZoneCode = "Pacific/Port_Moresby";
T387.Country = "Papua New Guinea";
T388.TimeZoneCode = "Pacific/Saipan";
T388.Country = "Northern Mariana Islands";
T389.TimeZoneCode = "Australia/Lord_Howe";
T389.Country = "Australia";
T390.TimeZoneCode = "Antarctica/Macquarie";
T390.Country = "Australia";
T391.TimeZoneCode = "Asia/Magadan";
T391.Country = "Russia";
T392.TimeZoneCode = "Asia/Sakhalin";
T392.Country = "Russia";
T393.TimeZoneCode = "Asia/Srednekolymsk";
T393.Country = "Russia";
T394.TimeZoneCode = "Pacific/Bougainville";
T394.Country = "Papua New Guinea";
T395.TimeZoneCode = "Pacific/Efate";
T395.Country = "Vanuatu";
T396.TimeZoneCode = "Pacific/Guadalcanal";
T396.Country = "Solomon Islands";
T397.TimeZoneCode = "Pacific/Kosrae";
T397.Country = "Micronesia";
T398.TimeZoneCode = "Pacific/Norfolk";
T398.Country = "Norfolk Island";
T399.TimeZoneCode = "Pacific/Noumea";
T399.Country = "New Caledonia";
T400.TimeZoneCode = "Pacific/Pohnpei";
T400.Country = "Micronesia";
T401.TimeZoneCode = "Antarctica/McMurdo";
T401.Country = "Antarctica";
T402.TimeZoneCode = "Asia/Anadyr";
T402.Country = "Russia";
T403.TimeZoneCode = "Asia/Kamchatka";
T403.Country = "Russia";
T404.TimeZoneCode = "Pacific/Auckland";
T404.Country = "New Zealand";
T405.TimeZoneCode = "Pacific/Fiji";
T405.Country = "Fiji";
T406.TimeZoneCode = "Pacific/Funafuti";
T406.Country = "Tuvalu";
T407.TimeZoneCode = "Pacific/Kwajalein";
T407.Country = "Marshall Islands";
T408.TimeZoneCode = "Pacific/Majuro";
T408.Country = "Marshall Islands";
T409.TimeZoneCode = "Pacific/Nauru";
T409.Country = "Nauru";
T410.TimeZoneCode = "Pacific/Tarawa";
T410.Country = "Kiribati";
T411.TimeZoneCode = "Pacific/Wake";
T411.Country = "United States Minor Outlying Islands";
T412.TimeZoneCode = "Pacific/Wallis";
T412.Country = "Wallis and Futuna";
T413.TimeZoneCode = "Pacific/Chatham";
T413.Country = "New Zealand";
T414.TimeZoneCode = "Pacific/Apia";
T414.Country = "Samoa";
T415.TimeZoneCode = "Pacific/Enderbury";
T415.Country = "Kiribati";
T416.TimeZoneCode = "Pacific/Fakaofo";
T416.Country = "Tokelau";
T417.TimeZoneCode = "Pacific/Tongatapu";
T417.Country = "Tonga";
T418.TimeZoneCode = "Pacific/Kiritimati";
T418.Country = "Kiribati";
}
static class TimeZoneFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return TimeZone.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return TimeZone.forValue (name);
}
public Enumeration getAll ()
{
return TimeZone.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("TimeZoneCode", ArrayFormatter.toObject(getTimeZoneCode()));
attribs.put ("Country", ArrayFormatter.toObject(getCountry()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="TimeZone">
<DATA name="TimeZoneCode" type="String" />
<DATA name="Country" type="String" />
<VALUE name="T001" description="(GMT -11) Midway" TimeZoneCode='"Pacific/Midway"' Country='"United States Minor Outlying Islands"' />
<VALUE name="T002" description="(GMT -11) Niue" TimeZoneCode='"Pacific/Niue"' Country='"Niue"' />
<VALUE name="T003" description="(GMT -11) Pago Pago" TimeZoneCode='"Pacific/Pago_Pago"' Country='"American Samoa"' />
<VALUE name="T004" description="(GMT -10) Adak" TimeZoneCode='"America/Adak"' Country='"United States"' />
<VALUE name="T005" description="(GMT -10) Honolulu" TimeZoneCode='"Pacific/Honolulu"' Country='"United States"' />
<VALUE name="T006" description="(GMT -10) Johnston" TimeZoneCode='"Pacific/Johnston"' Country='"United States Minor Outlying Islands"' />
<VALUE name="T007" description="(GMT -10) Rarotonga" TimeZoneCode='"Pacific/Rarotonga"' Country='"Cook Islands"' />
<VALUE name="T008" description="(GMT -10) Tahiti" TimeZoneCode='"Pacific/Tahiti"' Country='"French Polynesia"' />
<VALUE name="T009" description="(GMT -9:30) Marquesas" TimeZoneCode='"Pacific/Marquesas"' Country='"French Polynesia"' />
<VALUE name="T010" description="(GMT -9) Anchorage" TimeZoneCode='"America/Anchorage"' Country='"United States"' />
<VALUE name="T011" description="(GMT -9) Juneau" TimeZoneCode='"America/Juneau"' Country='"United States"' />
<VALUE name="T012" description="(GMT -9) Metlakatla" TimeZoneCode='"America/Metlakatla"' Country='"United States"' />
<VALUE name="T013" description="(GMT -9) Nome" TimeZoneCode='"America/Nome"' Country='"United States"' />
<VALUE name="T014" description="(GMT -9) Sitka" TimeZoneCode='"America/Sitka"' Country='"United States"' />
<VALUE name="T015" description="(GMT -9) Yakutat" TimeZoneCode='"America/Yakutat"' Country='"United States"' />
<VALUE name="T016" description="(GMT -9) Gambier" TimeZoneCode='"Pacific/Gambier"' Country='"French Polynesia"' />
<VALUE name="T017" description="(GMT -8) Dawson" TimeZoneCode='"America/Dawson"' Country='"Canada"' />
<VALUE name="T018" description="(GMT -8) Los Angeles" TimeZoneCode='"America/Los_Angeles"' Country='"United States"' />
<VALUE name="T019" description="(GMT -8) Tijuana" TimeZoneCode='"America/Tijuana"' Country='"Mexico"' />
<VALUE name="T020" description="(GMT -8) Vancouver" TimeZoneCode='"America/Vancouver"' Country='"Canada"' />
<VALUE name="T021" description="(GMT -8) Whitehorse" TimeZoneCode='"America/Whitehorse"' Country='"Canada"' />
<VALUE name="T022" description="(GMT -8) Pitcairn" TimeZoneCode='"Pacific/Pitcairn"' Country='"Pitcairn"' />
<VALUE name="T023" description="(GMT -7) Boise" TimeZoneCode='"America/Boise"' Country='"United States"' />
<VALUE name="T024" description="(GMT -7) Cambridge Bay" TimeZoneCode='"America/Cambridge_Bay"' Country='"Canada"' />
<VALUE name="T025" description="(GMT -7) Chihuahua" TimeZoneCode='"America/Chihuahua"' Country='"Mexico"' />
<VALUE name="T026" description="(GMT -7) Creston" TimeZoneCode='"America/Creston"' Country='"Canada"' />
<VALUE name="T027" description="(GMT -7) Dawson Creek" TimeZoneCode='"America/Dawson_Creek"' Country='"Canada"' />
<VALUE name="T028" description="(GMT -7) Denver" TimeZoneCode='"America/Denver"' Country='"United States"' />
<VALUE name="T029" description="(GMT -7) Edmonton" TimeZoneCode='"America/Edmonton"' Country='"Canada"' />
<VALUE name="T030" description="(GMT -7) Fort Nelson" TimeZoneCode='"America/Fort_Nelson"' Country='"Canada"' />
<VALUE name="T031" description="(GMT -7) Hermosillo" TimeZoneCode='"America/Hermosillo"' Country='"Mexico"' />
<VALUE name="T032" description="(GMT -7) Inuvik" TimeZoneCode='"America/Inuvik"' Country='"Canada"' />
<VALUE name="T033" description="(GMT -7) Mazatlan" TimeZoneCode='"America/Mazatlan"' Country='"Mexico"' />
<VALUE name="T034" description="(GMT -7) Ojinaga" TimeZoneCode='"America/Ojinaga"' Country='"Mexico"' />
<VALUE name="T035" description="(GMT -7) Phoenix" TimeZoneCode='"America/Phoenix"' Country='"United States"' />
<VALUE name="T036" description="(GMT -7) Yellowknife" TimeZoneCode='"America/Yellowknife"' Country='"Canada"' />
<VALUE name="T037" description="(GMT -6) Bahia Banderas" TimeZoneCode='"America/Bahia_Banderas"' Country='"Mexico"' />
<VALUE name="T038" description="(GMT -6) Belize" TimeZoneCode='"America/Belize"' Country='"Belize"' />
<VALUE name="T039" description="(GMT -6) Chicago" TimeZoneCode='"America/Chicago"' Country='"United States"' />
<VALUE name="T040" description="(GMT -6) Costa Rica" TimeZoneCode='"America/Costa_Rica"' Country='"Costa Rica"' />
<VALUE name="T041" description="(GMT -6) El Salvador" TimeZoneCode='"America/El_Salvador"' Country='"El Salvador"' />
<VALUE name="T042" description="(GMT -6) Guatemala" TimeZoneCode='"America/Guatemala"' Country='"Guatemala"' />
<VALUE name="T043" description="(GMT -6) Knox" TimeZoneCode='"America/Indiana/Knox"' Country='"United States"' />
<VALUE name="T044" description="(GMT -6) Tell City" TimeZoneCode='"America/Indiana/Tell_City"' Country='"United States"' />
<VALUE name="T045" description="(GMT -6) Managua" TimeZoneCode='"America/Managua"' Country='"Nicaragua"' />
<VALUE name="T046" description="(GMT -6) Matamoros" TimeZoneCode='"America/Matamoros"' Country='"Mexico"' />
<VALUE name="T047" description="(GMT -6) Menominee" TimeZoneCode='"America/Menominee"' Country='"United States"' />
<VALUE name="T048" description="(GMT -6) Merida" TimeZoneCode='"America/Merida"' Country='"Mexico"' />
<VALUE name="T049" description="(GMT -6) Mexico City" TimeZoneCode='"America/Mexico_City"' Country='"Mexico"' />
<VALUE name="T050" description="(GMT -6) Monterrey" TimeZoneCode='"America/Monterrey"' Country='"Mexico"' />
<VALUE name="T051" description="(GMT -6) Beulah" TimeZoneCode='"America/North_Dakota/Beulah"' Country='"United States"' />
<VALUE name="T052" description="(GMT -6) Center" TimeZoneCode='"America/North_Dakota/Center"' Country='"United States"' />
<VALUE name="T053" description="(GMT -6) New Salem" TimeZoneCode='"America/North_Dakota/New_Salem"' Country='"United States"' />
<VALUE name="T054" description="(GMT -6) Rainy River" TimeZoneCode='"America/Rainy_River"' Country='"Canada"' />
<VALUE name="T055" description="(GMT -6) Rankin Inlet" TimeZoneCode='"America/Rankin_Inlet"' Country='"Canada"' />
<VALUE name="T056" description="(GMT -6) Regina" TimeZoneCode='"America/Regina"' Country='"Canada"' />
<VALUE name="T057" description="(GMT -6) Resolute" TimeZoneCode='"America/Resolute"' Country='"Canada"' />
<VALUE name="T058" description="(GMT -6) Swift Current" TimeZoneCode='"America/Swift_Current"' Country='"Canada"' />
<VALUE name="T059" description="(GMT -6) Tegucigalpa" TimeZoneCode='"America/Tegucigalpa"' Country='"Honduras"' />
<VALUE name="T060" description="(GMT -6) Winnipeg" TimeZoneCode='"America/Winnipeg"' Country='"Canada"' />
<VALUE name="T061" description="(GMT -6) Easter" TimeZoneCode='"Pacific/Easter"' Country='"Chile"' />
<VALUE name="T062" description="(GMT -6) Galapagos" TimeZoneCode='"Pacific/Galapagos"' Country='"Ecuador"' />
<VALUE name="T063" description="(GMT -5) Atikokan" TimeZoneCode='"America/Atikokan"' Country='"Canada"' />
<VALUE name="T064" description="(GMT -5) Bogota" TimeZoneCode='"America/Bogota"' Country='"Colombia"' />
<VALUE name="T065" description="(GMT -5) Cancun" TimeZoneCode='"America/Cancun"' Country='"Mexico"' />
<VALUE name="T066" description="(GMT -5) Cayman" TimeZoneCode='"America/Cayman"' Country='"Cayman Islands"' />
<VALUE name="T067" description="(GMT -5) Detroit" TimeZoneCode='"America/Detroit"' Country='"United States"' />
<VALUE name="T068" description="(GMT -5) Eirunepe" TimeZoneCode='"America/Eirunepe"' Country='"Brazil"' />
<VALUE name="T069" description="(GMT -5) Guayaquil" TimeZoneCode='"America/Guayaquil"' Country='"Ecuador"' />
<VALUE name="T070" description="(GMT -5) Havana" TimeZoneCode='"America/Havana"' Country='"Cuba"' />
<VALUE name="T071" description="(GMT -5) Indianapolis" TimeZoneCode='"America/Indiana/Indianapolis"' Country='"United States"' />
<VALUE name="T072" description="(GMT -5) Marengo" TimeZoneCode='"America/Indiana/Marengo"' Country='"United States"' />
<VALUE name="T073" description="(GMT -5) Petersburg" TimeZoneCode='"America/Indiana/Petersburg"' Country='"United States"' />
<VALUE name="T074" description="(GMT -5) Vevay" TimeZoneCode='"America/Indiana/Vevay"' Country='"United States"' />
<VALUE name="T075" description="(GMT -5) Vincennes" TimeZoneCode='"America/Indiana/Vincennes"' Country='"United States"' />
<VALUE name="T076" description="(GMT -5) Winamac" TimeZoneCode='"America/Indiana/Winamac"' Country='"United States"' />
<VALUE name="T077" description="(GMT -5) Iqaluit" TimeZoneCode='"America/Iqaluit"' Country='"Canada"' />
<VALUE name="T078" description="(GMT -5) Jamaica" TimeZoneCode='"America/Jamaica"' Country='"Jamaica"' />
<VALUE name="T079" description="(GMT -5) Louisville" TimeZoneCode='"America/Kentucky/Louisville"' Country='"United States"' />
<VALUE name="T080" description="(GMT -5) Monticello" TimeZoneCode='"America/Kentucky/Monticello"' Country='"United States"' />
<VALUE name="T081" description="(GMT -5) Lima" TimeZoneCode='"America/Lima"' Country='"Peru"' />
<VALUE name="T082" description="(GMT -5) Nassau" TimeZoneCode='"America/Nassau"' Country='"Bahamas"' />
<VALUE name="T083" description="(GMT -5) New York" TimeZoneCode='"America/New_York"' Country='"United States"' />
<VALUE name="T084" description="(GMT -5) Nipigon" TimeZoneCode='"America/Nipigon"' Country='"Canada"' />
<VALUE name="T085" description="(GMT -5) Panama" TimeZoneCode='"America/Panama"' Country='"Panama"' />
<VALUE name="T086" description="(GMT -5) Pangnirtung" TimeZoneCode='"America/Pangnirtung"' Country='"Canada"' />
<VALUE name="T087" description="(GMT -5) Port-au-Prince" TimeZoneCode='"America/Port-au-Prince"' Country='"Haiti"' />
<VALUE name="T088" description="(GMT -5) Rio Branco" TimeZoneCode='"America/Rio_Branco"' Country='"Brazil"' />
<VALUE name="T089" description="(GMT -5) Thunder Bay" TimeZoneCode='"America/Thunder_Bay"' Country='"Canada"' />
<VALUE name="T090" description="(GMT -5) Toronto" TimeZoneCode='"America/Toronto"' Country='"Canada"' />
<VALUE name="T091" description="(GMT -4) Anguilla" TimeZoneCode='"America/Anguilla"' Country='"Anguilla"' />
<VALUE name="T092" description="(GMT -4) Antigua" TimeZoneCode='"America/Antigua"' Country='"Antigua and Barbuda"' />
<VALUE name="T093" description="(GMT -4) Aruba" TimeZoneCode='"America/Aruba"' Country='"Aruba"' />
<VALUE name="T094" description="(GMT -4) Asuncion" TimeZoneCode='"America/Asuncion"' Country='"Paraguay"' />
<VALUE name="T095" description="(GMT -4) Barbados" TimeZoneCode='"America/Barbados"' Country='"Barbados"' />
<VALUE name="T096" description="(GMT -4) Blanc-Sablon" TimeZoneCode='"America/Blanc-Sablon"' Country='"Canada"' />
<VALUE name="T097" description="(GMT -4) Boa Vista" TimeZoneCode='"America/Boa_Vista"' Country='"Brazil"' />
<VALUE name="T098" description="(GMT -4) Campo Grande" TimeZoneCode='"America/Campo_Grande"' Country='"Brazil"' />
<VALUE name="T099" description="(GMT -4) Caracas" TimeZoneCode='"America/Caracas"' Country='"Venezuela"' />
<VALUE name="T100" description="(GMT -4) Cuiaba" TimeZoneCode='"America/Cuiaba"' Country='"Brazil"' />
<VALUE name="T101" description="(GMT -4) Curacao" TimeZoneCode='"America/Curacao"' Country='"Curacao"' />
<VALUE name="T102" description="(GMT -4) Dominica" TimeZoneCode='"America/Dominica"' Country='"Dominica"' />
<VALUE name="T103" description="(GMT -4) Glace Bay" TimeZoneCode='"America/Glace_Bay"' Country='"Canada"' />
<VALUE name="T104" description="(GMT -4) Goose Bay" TimeZoneCode='"America/Goose_Bay"' Country='"Canada"' />
<VALUE name="T105" description="(GMT -4) Grand Turk" TimeZoneCode='"America/Grand_Turk"' Country='"Turks and Caicos Islands"' />
<VALUE name="T106" description="(GMT -4) Grenada" TimeZoneCode='"America/Grenada"' Country='"Grenada"' />
<VALUE name="T107" description="(GMT -4) Guadeloupe" TimeZoneCode='"America/Guadeloupe"' Country='"Guadeloupe"' />
<VALUE name="T108" description="(GMT -4) Guyana" TimeZoneCode='"America/Guyana"' Country='"Guyana"' />
<VALUE name="T109" description="(GMT -4) Halifax" TimeZoneCode='"America/Halifax"' Country='"Canada"' />
<VALUE name="T110" description="(GMT -4) Kralendijk" TimeZoneCode='"America/Kralendijk"' Country='"Bonaire, Saint Eustatius and Saba"' />
<VALUE name="T111" description="(GMT -4) La Paz" TimeZoneCode='"America/La_Paz"' Country='"Bolivia"' />
<VALUE name="T112" description="(GMT -4) Lower Princes" TimeZoneCode='"America/Lower_Princes"' Country='"Sint Maarten"' />
<VALUE name="T113" description="(GMT -4) Manaus" TimeZoneCode='"America/Manaus"' Country='"Brazil"' />
<VALUE name="T114" description="(GMT -4) Marigot" TimeZoneCode='"America/Marigot"' Country='"Saint Martin"' />
<VALUE name="T115" description="(GMT -4) Martinique" TimeZoneCode='"America/Martinique"' Country='"Martinique"' />
<VALUE name="T116" description="(GMT -4) Moncton" TimeZoneCode='"America/Moncton"' Country='"Canada"' />
<VALUE name="T117" description="(GMT -4) Montserrat" TimeZoneCode='"America/Montserrat"' Country='"Montserrat"' />
<VALUE name="T118" description="(GMT -4) Porto Velho" TimeZoneCode='"America/Porto_Velho"' Country='"Brazil"' />
<VALUE name="T119" description="(GMT -4) Port of Spain" TimeZoneCode='"America/Port_of_Spain"' Country='"Trinidad and Tobago"' />
<VALUE name="T120" description="(GMT -4) Puerto Rico" TimeZoneCode='"America/Puerto_Rico"' Country='"Puerto Rico"' />
<VALUE name="T121" description="(GMT -4) Santiago" TimeZoneCode='"America/Santiago"' Country='"Chile"' />
<VALUE name="T122" description="(GMT -4) Santo Domingo" TimeZoneCode='"America/Santo_Domingo"' Country='"Dominican Republic"' />
<VALUE name="T123" description="(GMT -4) St Barthelemy" TimeZoneCode='"America/St_Barthelemy"' Country='"Saint Barthelemy"' />
<VALUE name="T124" description="(GMT -4) St Kitts" TimeZoneCode='"America/St_Kitts"' Country='"Saint Kitts and Nevis"' />
<VALUE name="T125" description="(GMT -4) St Lucia" TimeZoneCode='"America/St_Lucia"' Country='"Saint Lucia"' />
<VALUE name="T126" description="(GMT -4) St Thomas" TimeZoneCode='"America/St_Thomas"' Country='"U.S. Virgin Islands"' />
<VALUE name="T127" description="(GMT -4) St Vincent" TimeZoneCode='"America/St_Vincent"' Country='"Saint Vincent and the Grenadines"' />
<VALUE name="T128" description="(GMT -4) Thule" TimeZoneCode='"America/Thule"' Country='"Greenland"' />
<VALUE name="T129" description="(GMT -4) Tortola" TimeZoneCode='"America/Tortola"' Country='"British Virgin Islands"' />
<VALUE name="T130" description="(GMT -4) Palmer" TimeZoneCode='"Antarctica/Palmer"' Country='"Antarctica"' />
<VALUE name="T131" description="(GMT -4) Bermuda" TimeZoneCode='"Atlantic/Bermuda"' Country='"Bermuda"' />
<VALUE name="T132" description="(GMT -3:30) St Johns" TimeZoneCode='"America/St_Johns"' Country='"Canada"' />
<VALUE name="T133" description="(GMT -3) Araguaina" TimeZoneCode='"America/Araguaina"' Country='"Brazil"' />
<VALUE name="T134" description="(GMT -3) Buenos Aires" TimeZoneCode='"America/Argentina/Buenos_Aires"' Country='"Argentina"' />
<VALUE name="T135" description="(GMT -3) Catamarca" TimeZoneCode='"America/Argentina/Catamarca"' Country='"Argentina"' />
<VALUE name="T136" description="(GMT -3) Cordoba" TimeZoneCode='"America/Argentina/Cordoba"' Country='"Argentina"' />
<VALUE name="T137" description="(GMT -3) Jujuy" TimeZoneCode='"America/Argentina/Jujuy"' Country='"Argentina"' />
<VALUE name="T138" description="(GMT -3) La Rioja" TimeZoneCode='"America/Argentina/La_Rioja"' Country='"Argentina"' />
<VALUE name="T139" description="(GMT -3) Mendoza" TimeZoneCode='"America/Argentina/Mendoza"' Country='"Argentina"' />
<VALUE name="T140" description="(GMT -3) Rio Gallegos" TimeZoneCode='"America/Argentina/Rio_Gallegos"' Country='"Argentina"' />
<VALUE name="T141" description="(GMT -3) Salta" TimeZoneCode='"America/Argentina/Salta"' Country='"Argentina"' />
<VALUE name="T142" description="(GMT -3) San Juan" TimeZoneCode='"America/Argentina/San_Juan"' Country='"Argentina"' />
<VALUE name="T143" description="(GMT -3) San Luis" TimeZoneCode='"America/Argentina/San_Luis"' Country='"Argentina"' />
<VALUE name="T144" description="(GMT -3) Tucuman" TimeZoneCode='"America/Argentina/Tucuman"' Country='"Argentina"' />
<VALUE name="T145" description="(GMT -3) Ushuaia" TimeZoneCode='"America/Argentina/Ushuaia"' Country='"Argentina"' />
<VALUE name="T146" description="(GMT -3) Bahia" TimeZoneCode='"America/Bahia"' Country='"Brazil"' />
<VALUE name="T147" description="(GMT -3) Belem" TimeZoneCode='"America/Belem"' Country='"Brazil"' />
<VALUE name="T148" description="(GMT -3) Cayenne" TimeZoneCode='"America/Cayenne"' Country='"French Guiana"' />
<VALUE name="T149" description="(GMT -3) Fortaleza" TimeZoneCode='"America/Fortaleza"' Country='"Brazil"' />
<VALUE name="T150" description="(GMT -3) Godthab" TimeZoneCode='"America/Godthab"' Country='"Greenland"' />
<VALUE name="T151" description="(GMT -3) Maceio" TimeZoneCode='"America/Maceio"' Country='"Brazil"' />
<VALUE name="T152" description="(GMT -3) Miquelon" TimeZoneCode='"America/Miquelon"' Country='"Saint Pierre and Miquelon"' />
<VALUE name="T153" description="(GMT -3) Montevideo" TimeZoneCode='"America/Montevideo"' Country='"Uruguay"' />
<VALUE name="T154" description="(GMT -3) Paramaribo" TimeZoneCode='"America/Paramaribo"' Country='"Suriname"' />
<VALUE name="T155" description="(GMT -3) Recife" TimeZoneCode='"America/Recife"' Country='"Brazil"' />
<VALUE name="T156" description="(GMT -3) Santarem" TimeZoneCode='"America/Santarem"' Country='"Brazil"' />
<VALUE name="T157" description="(GMT -3) Sao Paulo" TimeZoneCode='"America/Sao_Paulo"' Country='"Brazil"' />
<VALUE name="T158" description="(GMT -3) Rothera" TimeZoneCode='"Antarctica/Rothera"' Country='"Antarctica"' />
<VALUE name="T159" description="(GMT -3) Stanley" TimeZoneCode='"Atlantic/Stanley"' Country='"Falkland Islands"' />
<VALUE name="T160" description="(GMT -2) Noronha" TimeZoneCode='"America/Noronha"' Country='"Brazil"' />
<VALUE name="T161" description="(GMT -2) South Georgia" TimeZoneCode='"Atlantic/South_Georgia"' Country='"South Georgia and the South Sandwich Islands"' />
<VALUE name="T162" description="(GMT -1) Scoresbysund" TimeZoneCode='"America/Scoresbysund"' Country='"Greenland"' />
<VALUE name="T163" description="(GMT -1) Azores" TimeZoneCode='"Atlantic/Azores"' Country='"Portugal"' />
<VALUE name="T164" description="(GMT -1) Cape Verde" TimeZoneCode='"Atlantic/Cape_Verde"' Country='"Cape Verde"' />
<VALUE name="T165" description="(GMT +0) Abidjan" TimeZoneCode='"Africa/Abidjan"' Country='"Ivory Coast"' />
<VALUE name="T166" description="(GMT +0) Accra" TimeZoneCode='"Africa/Accra"' Country='"Ghana"' />
<VALUE name="T167" description="(GMT +0) Bamako" TimeZoneCode='"Africa/Bamako"' Country='"Mali"' />
<VALUE name="T168" description="(GMT +0) Banjul" TimeZoneCode='"Africa/Banjul"' Country='"Gambia"' />
<VALUE name="T169" description="(GMT +0) Bissau" TimeZoneCode='"Africa/Bissau"' Country='"Guinea-Bissau"' />
<VALUE name="T170" description="(GMT +0) Casablanca" TimeZoneCode='"Africa/Casablanca"' Country='"Morocco"' />
<VALUE name="T171" description="(GMT +0) Conakry" TimeZoneCode='"Africa/Conakry"' Country='"Guinea"' />
<VALUE name="T172" description="(GMT +0) Dakar" TimeZoneCode='"Africa/Dakar"' Country='"Senegal"' />
<VALUE name="T173" description="(GMT +0) El Aaiun" TimeZoneCode='"Africa/El_Aaiun"' Country='"Western Sahara"' />
<VALUE name="T174" description="(GMT +0) Freetown" TimeZoneCode='"Africa/Freetown"' Country='"Sierra Leone"' />
<VALUE name="T175" description="(GMT +0) Lome" TimeZoneCode='"Africa/Lome"' Country='"Togo"' />
<VALUE name="T176" description="(GMT +0) Monrovia" TimeZoneCode='"Africa/Monrovia"' Country='"Liberia"' />
<VALUE name="T177" description="(GMT +0) Nouakchott" TimeZoneCode='"Africa/Nouakchott"' Country='"Mauritania"' />
<VALUE name="T178" description="(GMT +0) Ouagadougou" TimeZoneCode='"Africa/Ouagadougou"' Country='"Burkina Faso"' />
<VALUE name="T179" description="(GMT +0) Sao Tome" TimeZoneCode='"Africa/Sao_Tome"' Country='"Sao Tome and Principe"' />
<VALUE name="T180" description="(GMT +0) Danmarkshavn" TimeZoneCode='"America/Danmarkshavn"' Country='"Greenland"' />
<VALUE name="T181" description="(GMT +0) Troll" TimeZoneCode='"Antarctica/Troll"' Country='"Antarctica"' />
<VALUE name="T182" description="(GMT +0) Canary" TimeZoneCode='"Atlantic/Canary"' Country='"Spain"' />
<VALUE name="T183" description="(GMT +0) Faroe" TimeZoneCode='"Atlantic/Faroe"' Country='"Faroe Islands"' />
<VALUE name="T184" description="(GMT +0) Madeira" TimeZoneCode='"Atlantic/Madeira"' Country='"Portugal"' />
<VALUE name="T185" description="(GMT +0) Reykjavik" TimeZoneCode='"Atlantic/Reykjavik"' Country='"Iceland"' />
<VALUE name="T186" description="(GMT +0) St Helena" TimeZoneCode='"Atlantic/St_Helena"' Country='"Saint Helena"' />
<VALUE name="T187" description="(GMT +0) Dublin" TimeZoneCode='"Europe/Dublin"' Country='"Ireland"' />
<VALUE name="T188" description="(GMT +0) Guernsey" TimeZoneCode='"Europe/Guernsey"' Country='"Guernsey"' />
<VALUE name="T189" description="(GMT +0) Isle of Man" TimeZoneCode='"Europe/Isle_of_Man"' Country='"Isle of Man"' />
<VALUE name="T190" description="(GMT +0) Jersey" TimeZoneCode='"Europe/Jersey"' Country='"Jersey"' />
<VALUE name="T191" description="(GMT +0) Lisbon" TimeZoneCode='"Europe/Lisbon"' Country='"Portugal"' />
<VALUE name="T192" description="(GMT +0) London" TimeZoneCode='"Europe/London"' Country='"United Kingdom"' />
<VALUE name="T193" description="(GMT +1) Algiers" TimeZoneCode='"Africa/Algiers"' Country='"Algeria"' />
<VALUE name="T194" description="(GMT +1) Bangui" TimeZoneCode='"Africa/Bangui"' Country='"Central African Republic"' />
<VALUE name="T195" description="(GMT +1) Brazzaville" TimeZoneCode='"Africa/Brazzaville"' Country='"Republic of the Congo"' />
<VALUE name="T196" description="(GMT +1) Ceuta" TimeZoneCode='"Africa/Ceuta"' Country='"Spain"' />
<VALUE name="T197" description="(GMT +1) Douala" TimeZoneCode='"Africa/Douala"' Country='"Cameroon"' />
<VALUE name="T198" description="(GMT +1) Kinshasa" TimeZoneCode='"Africa/Kinshasa"' Country='"Democratic Republic of the Congo"' />
<VALUE name="T199" description="(GMT +1) Lagos" TimeZoneCode='"Africa/Lagos"' Country='"Nigeria"' />
<VALUE name="T200" description="(GMT +1) Libreville" TimeZoneCode='"Africa/Libreville"' Country='"Gabon"' />
<VALUE name="T201" description="(GMT +1) Luanda" TimeZoneCode='"Africa/Luanda"' Country='"Angola"' />
<VALUE name="T202" description="(GMT +1) Malabo" TimeZoneCode='"Africa/Malabo"' Country='"Equatorial Guinea"' />
<VALUE name="T203" description="(GMT +1) Ndjamena" TimeZoneCode='"Africa/Ndjamena"' Country='"Chad"' />
<VALUE name="T204" description="(GMT +1) Niamey" TimeZoneCode='"Africa/Niamey"' Country='"Niger"' />
<VALUE name="T205" description="(GMT +1) Porto-Novo" TimeZoneCode='"Africa/Porto-Novo"' Country='"Benin"' />
<VALUE name="T206" description="(GMT +1) Tunis" TimeZoneCode='"Africa/Tunis"' Country='"Tunisia"' />
<VALUE name="T207" description="(GMT +1) Windhoek" TimeZoneCode='"Africa/Windhoek"' Country='"Namibia"' />
<VALUE name="T208" description="(GMT +1) Longyearbyen" TimeZoneCode='"Arctic/Longyearbyen"' Country='"Svalbard and Jan Mayen"' />
<VALUE name="T209" description="(GMT +1) Amsterdam" TimeZoneCode='"Europe/Amsterdam"' Country='"Netherlands"' />
<VALUE name="T210" description="(GMT +1) Andorra" TimeZoneCode='"Europe/Andorra"' Country='"Andorra"' />
<VALUE name="T211" description="(GMT +1) Belgrade" TimeZoneCode='"Europe/Belgrade"' Country='"Serbia"' />
<VALUE name="T212" description="(GMT +1) Berlin" TimeZoneCode='"Europe/Berlin"' Country='"Germany"' />
<VALUE name="T213" description="(GMT +1) Bratislava" TimeZoneCode='"Europe/Bratislava"' Country='"Slovakia"' />
<VALUE name="T214" description="(GMT +1) Brussels" TimeZoneCode='"Europe/Brussels"' Country='"Belgium"' />
<VALUE name="T215" description="(GMT +1) Budapest" TimeZoneCode='"Europe/Budapest"' Country='"Hungary"' />
<VALUE name="T216" description="(GMT +1) Copenhagen" TimeZoneCode='"Europe/Copenhagen"' Country='"Denmark"' />
<VALUE name="T217" description="(GMT +1) Gibraltar" TimeZoneCode='"Europe/Gibraltar"' Country='"Gibraltar"' />
<VALUE name="T218" description="(GMT +1) Ljubljana" TimeZoneCode='"Europe/Ljubljana"' Country='"Slovenia"' />
<VALUE name="T219" description="(GMT +1) Luxembourg" TimeZoneCode='"Europe/Luxembourg"' Country='"Luxembourg"' />
<VALUE name="T220" description="(GMT +1) Madrid" TimeZoneCode='"Europe/Madrid"' Country='"Spain"' />
<VALUE name="T221" description="(GMT +1) Malta" TimeZoneCode='"Europe/Malta"' Country='"Malta"' />
<VALUE name="T222" description="(GMT +1) Monaco" TimeZoneCode='"Europe/Monaco"' Country='"Monaco"' />
<VALUE name="T223" description="(GMT +1) Oslo" TimeZoneCode='"Europe/Oslo"' Country='"Norway"' />
<VALUE name="T224" description="(GMT +1) Paris" TimeZoneCode='"Europe/Paris"' Country='"France"' />
<VALUE name="T225" description="(GMT +1) Podgorica" TimeZoneCode='"Europe/Podgorica"' Country='"Montenegro"' />
<VALUE name="T226" description="(GMT +1) Prague" TimeZoneCode='"Europe/Prague"' Country='"Czech Republic"' />
<VALUE name="T227" description="(GMT +1) Rome" TimeZoneCode='"Europe/Rome"' Country='"Italy"' />
<VALUE name="T228" description="(GMT +1) San Marino" TimeZoneCode='"Europe/San_Marino"' Country='"San Marino"' />
<VALUE name="T229" description="(GMT +1) Sarajevo" TimeZoneCode='"Europe/Sarajevo"' Country='"Bosnia and Herzegovina"' />
<VALUE name="T230" description="(GMT +1) Skopje" TimeZoneCode='"Europe/Skopje"' Country='"Macedonia"' />
<VALUE name="T231" description="(GMT +1) Stockholm" TimeZoneCode='"Europe/Stockholm"' Country='"Sweden"' />
<VALUE name="T232" description="(GMT +1) Tirane" TimeZoneCode='"Europe/Tirane"' Country='"Albania"' />
<VALUE name="T233" description="(GMT +1) Vaduz" TimeZoneCode='"Europe/Vaduz"' Country='"Liechtenstein"' />
<VALUE name="T234" description="(GMT +1) Vatican" TimeZoneCode='"Europe/Vatican"' Country='"Vatican"' />
<VALUE name="T235" description="(GMT +1) Vienna" TimeZoneCode='"Europe/Vienna"' Country='"Austria"' />
<VALUE name="T236" description="(GMT +1) Warsaw" TimeZoneCode='"Europe/Warsaw"' Country='"Poland"' />
<VALUE name="T237" description="(GMT +1) Zagreb" TimeZoneCode='"Europe/Zagreb"' Country='"Croatia"' />
<VALUE name="T238" description="(GMT +1) Zurich" TimeZoneCode='"Europe/Zurich"' Country='"Switzerland"' />
<VALUE name="T239" description="(GMT +2) Blantyre" TimeZoneCode='"Africa/Blantyre"' Country='"Malawi"' />
<VALUE name="T240" description="(GMT +2) Bujumbura" TimeZoneCode='"Africa/Bujumbura"' Country='"Burundi"' />
<VALUE name="T241" description="(GMT +2) Cairo" TimeZoneCode='"Africa/Cairo"' Country='"Egypt"' />
<VALUE name="T242" description="(GMT +2) Gaborone" TimeZoneCode='"Africa/Gaborone"' Country='"Botswana"' />
<VALUE name="T243" description="(GMT +2) Harare" TimeZoneCode='"Africa/Harare"' Country='"Zimbabwe"' />
<VALUE name="T244" description="(GMT +2) Johannesburg" TimeZoneCode='"Africa/Johannesburg"' Country='"South Africa"' />
<VALUE name="T245" description="(GMT +2) Kigali" TimeZoneCode='"Africa/Kigali"' Country='"Rwanda"' />
<VALUE name="T246" description="(GMT +2) Lubumbashi" TimeZoneCode='"Africa/Lubumbashi"' Country='"Democratic Republic of the Congo"' />
<VALUE name="T247" description="(GMT +2) Lusaka" TimeZoneCode='"Africa/Lusaka"' Country='"Zambia"' />
<VALUE name="T248" description="(GMT +2) Maputo" TimeZoneCode='"Africa/Maputo"' Country='"Mozambique"' />
<VALUE name="T249" description="(GMT +2) Maseru" TimeZoneCode='"Africa/Maseru"' Country='"Lesotho"' />
<VALUE name="T250" description="(GMT +2) Mbabane" TimeZoneCode='"Africa/Mbabane"' Country='"Swaziland"' />
<VALUE name="T251" description="(GMT +2) Tripoli" TimeZoneCode='"Africa/Tripoli"' Country='"Libya"' />
<VALUE name="T252" description="(GMT +2) Amman" TimeZoneCode='"Asia/Amman"' Country='"Jordan"' />
<VALUE name="T253" description="(GMT +2) Beirut" TimeZoneCode='"Asia/Beirut"' Country='"Lebanon"' />
<VALUE name="T254" description="(GMT +2) Damascus" TimeZoneCode='"Asia/Damascus"' Country='"Syria"' />
<VALUE name="T255" description="(GMT +2) Gaza" TimeZoneCode='"Asia/Gaza"' Country='"Palestinian Territory"' />
<VALUE name="T256" description="(GMT +2) Hebron" TimeZoneCode='"Asia/Hebron"' Country='"Palestinian Territory"' />
<VALUE name="T257" description="(GMT +2) Jerusalem" TimeZoneCode='"Asia/Jerusalem"' Country='"Israel"' />
<VALUE name="T258" description="(GMT +2) Nicosia" TimeZoneCode='"Asia/Nicosia"' Country='"Cyprus"' />
<VALUE name="T259" description="(GMT +2) Athens" TimeZoneCode='"Europe/Athens"' Country='"Greece"' />
<VALUE name="T260" description="(GMT +2) Bucharest" TimeZoneCode='"Europe/Bucharest"' Country='"Romania"' />
<VALUE name="T261" description="(GMT +2) Chisinau" TimeZoneCode='"Europe/Chisinau"' Country='"Moldova"' />
<VALUE name="T262" description="(GMT +2) Helsinki" TimeZoneCode='"Europe/Helsinki"' Country='"Finland"' />
<VALUE name="T263" description="(GMT +2) Istanbul" TimeZoneCode='"Europe/Istanbul"' Country='"Turkey"' />
<VALUE name="T264" description="(GMT +2) Kaliningrad" TimeZoneCode='"Europe/Kaliningrad"' Country='"Russia"' />
<VALUE name="T265" description="(GMT +2) Kiev" TimeZoneCode='"Europe/Kiev"' Country='"Ukraine"' />
<VALUE name="T266" description="(GMT +2) Mariehamn" TimeZoneCode='"Europe/Mariehamn"' Country='"Aland Islands"' />
<VALUE name="T267" description="(GMT +2) Riga" TimeZoneCode='"Europe/Riga"' Country='"Latvia"' />
<VALUE name="T268" description="(GMT +2) Sofia" TimeZoneCode='"Europe/Sofia"' Country='"Bulgaria"' />
<VALUE name="T269" description="(GMT +2) Tallinn" TimeZoneCode='"Europe/Tallinn"' Country='"Estonia"' />
<VALUE name="T270" description="(GMT +2) Uzhgorod" TimeZoneCode='"Europe/Uzhgorod"' Country='"Ukraine"' />
<VALUE name="T271" description="(GMT +2) Vilnius" TimeZoneCode='"Europe/Vilnius"' Country='"Lithuania"' />
<VALUE name="T272" description="(GMT +2) Zaporozhye" TimeZoneCode='"Europe/Zaporozhye"' Country='"Ukraine"' />
<VALUE name="T273" description="(GMT +3) Addis Ababa" TimeZoneCode='"Africa/Addis_Ababa"' Country='"Ethiopia"' />
<VALUE name="T274" description="(GMT +3) Asmara" TimeZoneCode='"Africa/Asmara"' Country='"Eritrea"' />
<VALUE name="T275" description="(GMT +3) Dar es Salaam" TimeZoneCode='"Africa/Dar_es_Salaam"' Country='"Tanzania"' />
<VALUE name="T276" description="(GMT +3) Djibouti" TimeZoneCode='"Africa/Djibouti"' Country='"Djibouti"' />
<VALUE name="T277" description="(GMT +3) Juba" TimeZoneCode='"Africa/Juba"' Country='"South Sudan"' />
<VALUE name="T278" description="(GMT +3) Kampala" TimeZoneCode='"Africa/Kampala"' Country='"Uganda"' />
<VALUE name="T279" description="(GMT +3) Khartoum" TimeZoneCode='"Africa/Khartoum"' Country='"Sudan"' />
<VALUE name="T280" description="(GMT +3) Mogadishu" TimeZoneCode='"Africa/Mogadishu"' Country='"Somalia"' />
<VALUE name="T281" description="(GMT +3) Nairobi" TimeZoneCode='"Africa/Nairobi"' Country='"Kenya"' />
<VALUE name="T282" description="(GMT +3) Syowa" TimeZoneCode='"Antarctica/Syowa"' Country='"Antarctica"' />
<VALUE name="T283" description="(GMT +3) Aden" TimeZoneCode='"Asia/Aden"' Country='"Yemen"' />
<VALUE name="T284" description="(GMT +3) Baghdad" TimeZoneCode='"Asia/Baghdad"' Country='"Iraq"' />
<VALUE name="T285" description="(GMT +3) Bahrain" TimeZoneCode='"Asia/Bahrain"' Country='"Bahrain"' />
<VALUE name="T286" description="(GMT +3) Kuwait" TimeZoneCode='"Asia/Kuwait"' Country='"Kuwait"' />
<VALUE name="T287" description="(GMT +3) Qatar" TimeZoneCode='"Asia/Qatar"' Country='"Qatar"' />
<VALUE name="T288" description="(GMT +3) Riyadh" TimeZoneCode='"Asia/Riyadh"' Country='"Saudi Arabia"' />
<VALUE name="T289" description="(GMT +3) Minsk" TimeZoneCode='"Europe/Minsk"' Country='"Belarus"' />
<VALUE name="T290" description="(GMT +3) Moscow" TimeZoneCode='"Europe/Moscow"' Country='"Russia"' />
<VALUE name="T291" description="(GMT +3) Simferopol" TimeZoneCode='"Europe/Simferopol"' Country='"Russia"' />
<VALUE name="T292" description="(GMT +3) Volgograd" TimeZoneCode='"Europe/Volgograd"' Country='"Russia"' />
<VALUE name="T293" description="(GMT +3) Antananarivo" TimeZoneCode='"Indian/Antananarivo"' Country='"Madagascar"' />
<VALUE name="T294" description="(GMT +3) Comoro" TimeZoneCode='"Indian/Comoro"' Country='"Comoros"' />
<VALUE name="T295" description="(GMT +3) Mayotte" TimeZoneCode='"Indian/Mayotte"' Country='"Mayotte"' />
<VALUE name="T296" description="(GMT +3:30) Tehran" TimeZoneCode='"Asia/Tehran"' Country='"Iran"' />
<VALUE name="T297" description="(GMT +4) Baku" TimeZoneCode='"Asia/Baku"' Country='"Azerbaijan"' />
<VALUE name="T298" description="(GMT +4) Dubai" TimeZoneCode='"Asia/Dubai"' Country='"United Arab Emirates"' />
<VALUE name="T299" description="(GMT +4) Muscat" TimeZoneCode='"Asia/Muscat"' Country='"Oman"' />
<VALUE name="T300" description="(GMT +4) Tbilisi" TimeZoneCode='"Asia/Tbilisi"' Country='"Georgia"' />
<VALUE name="T301" description="(GMT +4) Yerevan" TimeZoneCode='"Asia/Yerevan"' Country='"Armenia"' />
<VALUE name="T302" description="(GMT +4) Astrakhan" TimeZoneCode='"Europe/Astrakhan"' Country='"Russia"' />
<VALUE name="T303" description="(GMT +4) Samara" TimeZoneCode='"Europe/Samara"' Country='"Russia"' />
<VALUE name="T304" description="(GMT +4) Ulyanovsk" TimeZoneCode='"Europe/Ulyanovsk"' Country='"Russia"' />
<VALUE name="T305" description="(GMT +4) Mahe" TimeZoneCode='"Indian/Mahe"' Country='"Seychelles"' />
<VALUE name="T306" description="(GMT +4) Mauritius" TimeZoneCode='"Indian/Mauritius"' Country='"Mauritius"' />
<VALUE name="T307" description="(GMT +4) Reunion" TimeZoneCode='"Indian/Reunion"' Country='"Reunion"' />
<VALUE name="T308" description="(GMT +4:30) Kabul" TimeZoneCode='"Asia/Kabul"' Country='"Afghanistan"' />
<VALUE name="T309" description="(GMT +5) Mawson" TimeZoneCode='"Antarctica/Mawson"' Country='"Antarctica"' />
<VALUE name="T310" description="(GMT +5) Aqtau" TimeZoneCode='"Asia/Aqtau"' Country='"Kazakhstan"' />
<VALUE name="T311" description="(GMT +5) Aqtobe" TimeZoneCode='"Asia/Aqtobe"' Country='"Kazakhstan"' />
<VALUE name="T312" description="(GMT +5) Ashgabat" TimeZoneCode='"Asia/Ashgabat"' Country='"Turkmenistan"' />
<VALUE name="T313" description="(GMT +5) Dushanbe" TimeZoneCode='"Asia/Dushanbe"' Country='"Tajikistan"' />
<VALUE name="T314" description="(GMT +5) Karachi" TimeZoneCode='"Asia/Karachi"' Country='"Pakistan"' />
<VALUE name="T315" description="(GMT +5) Oral" TimeZoneCode='"Asia/Oral"' Country='"Kazakhstan"' />
<VALUE name="T316" description="(GMT +5) Samarkand" TimeZoneCode='"Asia/Samarkand"' Country='"Uzbekistan"' />
<VALUE name="T317" description="(GMT +5) Tashkent" TimeZoneCode='"Asia/Tashkent"' Country='"Uzbekistan"' />
<VALUE name="T318" description="(GMT +5) Yekaterinburg" TimeZoneCode='"Asia/Yekaterinburg"' Country='"Russia"' />
<VALUE name="T319" description="(GMT +5) Kerguelen" TimeZoneCode='"Indian/Kerguelen"' Country='"French Southern Territories"' />
<VALUE name="T320" description="(GMT +5) Maldives" TimeZoneCode='"Indian/Maldives"' Country='"Maldives"' />
<VALUE name="T321" description="(GMT +5:30) Colombo" TimeZoneCode='"Asia/Colombo"' Country='"Sri Lanka"' />
<VALUE name="T322" description="(GMT +5:30) Kolkata" TimeZoneCode='"Asia/Kolkata"' Country='"India"' />
<VALUE name="T323" description="(GMT +5:45) Kathmandu" TimeZoneCode='"Asia/Kathmandu"' Country='"Nepal"' />
<VALUE name="T324" description="(GMT +6) Vostok" TimeZoneCode='"Antarctica/Vostok"' Country='"Antarctica"' />
<VALUE name="T325" description="(GMT +6) Almaty" TimeZoneCode='"Asia/Almaty"' Country='"Kazakhstan"' />
<VALUE name="T326" description="(GMT +6) Bishkek" TimeZoneCode='"Asia/Bishkek"' Country='"Kyrgyzstan"' />
<VALUE name="T327" description="(GMT +6) Dhaka" TimeZoneCode='"Asia/Dhaka"' Country='"Bangladesh"' />
<VALUE name="T328" description="(GMT +6) Novosibirsk" TimeZoneCode='"Asia/Novosibirsk"' Country='"Russia"' />
<VALUE name="T329" description="(GMT +6) Omsk" TimeZoneCode='"Asia/Omsk"' Country='"Russia"' />
<VALUE name="T330" description="(GMT +6) Qyzylorda" TimeZoneCode='"Asia/Qyzylorda"' Country='"Kazakhstan"' />
<VALUE name="T331" description="(GMT +6) Thimphu" TimeZoneCode='"Asia/Thimphu"' Country='"Bhutan"' />
<VALUE name="T332" description="(GMT +6) Urumqi" TimeZoneCode='"Asia/Urumqi"' Country='"China"' />
<VALUE name="T333" description="(GMT +6) Chagos" TimeZoneCode='"Indian/Chagos"' Country='"British Indian Ocean Territory"' />
<VALUE name="T334" description="(GMT +6:30) Rangoon" TimeZoneCode='"Asia/Rangoon"' Country='"Myanmar"' />
<VALUE name="T335" description="(GMT +6:30) Cocos" TimeZoneCode='"Indian/Cocos"' Country='"Cocos Islands"' />
<VALUE name="T336" description="(GMT +7) Davis" TimeZoneCode='"Antarctica/Davis"' Country='"Antarctica"' />
<VALUE name="T337" description="(GMT +7) Bangkok" TimeZoneCode='"Asia/Bangkok"' Country='"Thailand"' />
<VALUE name="T338" description="(GMT +7) Barnaul" TimeZoneCode='"Asia/Barnaul"' Country='"Russia"' />
<VALUE name="T339" description="(GMT +7) Hovd" TimeZoneCode='"Asia/Hovd"' Country='"Mongolia"' />
<VALUE name="T340" description="(GMT +7) Ho Chi Minh" TimeZoneCode='"Asia/Ho_Chi_Minh"' Country='"Vietnam"' />
<VALUE name="T341" description="(GMT +7) Jakarta" TimeZoneCode='"Asia/Jakarta"' Country='"Indonesia"' />
<VALUE name="T342" description="(GMT +7) Krasnoyarsk" TimeZoneCode='"Asia/Krasnoyarsk"' Country='"Russia"' />
<VALUE name="T343" description="(GMT +7) Novokuznetsk" TimeZoneCode='"Asia/Novokuznetsk"' Country='"Russia"' />
<VALUE name="T344" description="(GMT +7) Phnom Penh" TimeZoneCode='"Asia/Phnom_Penh"' Country='"Cambodia"' />
<VALUE name="T345" description="(GMT +7) Pontianak" TimeZoneCode='"Asia/Pontianak"' Country='"Indonesia"' />
<VALUE name="T346" description="(GMT +7) Vientiane" TimeZoneCode='"Asia/Vientiane"' Country='"Laos"' />
<VALUE name="T347" description="(GMT +7) Christmas" TimeZoneCode='"Indian/Christmas"' Country='"Christmas Island"' />
<VALUE name="T348" description="(GMT +8) Casey" TimeZoneCode='"Antarctica/Casey"' Country='"Antarctica"' />
<VALUE name="T349" description="(GMT +8) Brunei" TimeZoneCode='"Asia/Brunei"' Country='"Brunei"' />
<VALUE name="T350" description="(GMT +8) Choibalsan" TimeZoneCode='"Asia/Choibalsan"' Country='"Mongolia"' />
<VALUE name="T351" description="(GMT +8) Hong Kong" TimeZoneCode='"Asia/Hong_Kong"' Country='"Hong Kong"' />
<VALUE name="T352" description="(GMT +8) Irkutsk" TimeZoneCode='"Asia/Irkutsk"' Country='"Russia"' />
<VALUE name="T353" description="(GMT +8) Kuala Lumpur" TimeZoneCode='"Asia/Kuala_Lumpur"' Country='"Malaysia"' />
<VALUE name="T354" description="(GMT +8) Kuching" TimeZoneCode='"Asia/Kuching"' Country='"Malaysia"' />
<VALUE name="T355" description="(GMT +8) Macau" TimeZoneCode='"Asia/Macau"' Country='"Macao"' />
<VALUE name="T356" description="(GMT +8) Makassar" TimeZoneCode='"Asia/Makassar"' Country='"Indonesia"' />
<VALUE name="T357" description="(GMT +8) Manila" TimeZoneCode='"Asia/Manila"' Country='"Philippines"' />
<VALUE name="T358" description="(GMT +8) Shanghai" TimeZoneCode='"Asia/Shanghai"' Country='"China"' />
<VALUE name="T359" description="(GMT +8) Singapore" TimeZoneCode='"Asia/Singapore"' Country='"Singapore"' />
<VALUE name="T360" description="(GMT +8) Taipei" TimeZoneCode='"Asia/Taipei"' Country='"Taiwan"' />
<VALUE name="T361" description="(GMT +8) Ulaanbaatar" TimeZoneCode='"Asia/Ulaanbaatar"' Country='"Mongolia"' />
<VALUE name="T362" description="(GMT +8) Perth" TimeZoneCode='"Australia/Perth"' Country='"Australia"' />
<VALUE name="T363" description="(GMT +8:30) Pyongyang" TimeZoneCode='"Asia/Pyongyang"' Country='"North Korea"' />
<VALUE name="T364" description="(GMT +8:45) Eucla" TimeZoneCode='"Australia/Eucla"' Country='"Australia"' />
<VALUE name="T365" description="(GMT +9) Chita" TimeZoneCode='"Asia/Chita"' Country='"Russia"' />
<VALUE name="T366" description="(GMT +9) Dili" TimeZoneCode='"Asia/Dili"' Country='"East Timor"' />
<VALUE name="T367" description="(GMT +9) Jayapura" TimeZoneCode='"Asia/Jayapura"' Country='"Indonesia"' />
<VALUE name="T368" description="(GMT +9) Khandyga" TimeZoneCode='"Asia/Khandyga"' Country='"Russia"' />
<VALUE name="T369" description="(GMT +9) Seoul" TimeZoneCode='"Asia/Seoul"' Country='"South Korea"' />
<VALUE name="T370" description="(GMT +9) Tokyo" TimeZoneCode='"Asia/Tokyo"' Country='"Japan"' />
<VALUE name="T371" description="(GMT +9) Yakutsk" TimeZoneCode='"Asia/Yakutsk"' Country='"Russia"' />
<VALUE name="T372" description="(GMT +9) Palau" TimeZoneCode='"Pacific/Palau"' Country='"Palau"' />
<VALUE name="T373" description="(GMT +9:30) Adelaide" TimeZoneCode='"Australia/Adelaide"' Country='"Australia"' />
<VALUE name="T374" description="(GMT +9:30) Broken Hill" TimeZoneCode='"Australia/Broken_Hill"' Country='"Australia"' />
<VALUE name="T375" description="(GMT +9:30) Darwin" TimeZoneCode='"Australia/Darwin"' Country='"Australia"' />
<VALUE name="T376" description="(GMT +10) DumontDUrville" TimeZoneCode='"Antarctica/DumontDUrville"' Country='"Antarctica"' />
<VALUE name="T377" description="(GMT +10) Ust-Nera" TimeZoneCode='"Asia/Ust-Nera"' Country='"Russia"' />
<VALUE name="T378" description="(GMT +10) Vladivostok" TimeZoneCode='"Asia/Vladivostok"' Country='"Russia"' />
<VALUE name="T379" description="(GMT +10) Brisbane" TimeZoneCode='"Australia/Brisbane"' Country='"Australia"' />
<VALUE name="T380" description="(GMT +10) Currie" TimeZoneCode='"Australia/Currie"' Country='"Australia"' />
<VALUE name="T381" description="(GMT +10) Hobart" TimeZoneCode='"Australia/Hobart"' Country='"Australia"' />
<VALUE name="T382" description="(GMT +10) Lindeman" TimeZoneCode='"Australia/Lindeman"' Country='"Australia"' />
<VALUE name="T383" description="(GMT +10) Melbourne" TimeZoneCode='"Australia/Melbourne"' Country='"Australia"' />
<VALUE name="T384" description="(GMT +10) Sydney" TimeZoneCode='"Australia/Sydney"' Country='"Australia"' />
<VALUE name="T385" description="(GMT +10) Chuuk" TimeZoneCode='"Pacific/Chuuk"' Country='"Micronesia"' />
<VALUE name="T386" description="(GMT +10) Guam" TimeZoneCode='"Pacific/Guam"' Country='"Guam"' />
<VALUE name="T387" description="(GMT +10) Port Moresby" TimeZoneCode='"Pacific/Port_Moresby"' Country='"Papua New Guinea"' />
<VALUE name="T388" description="(GMT +10) Saipan" TimeZoneCode='"Pacific/Saipan"' Country='"Northern Mariana Islands"' />
<VALUE name="T389" description="(GMT +10:30) Lord Howe" TimeZoneCode='"Australia/Lord_Howe"' Country='"Australia"' />
<VALUE name="T390" description="(GMT +11) Macquarie" TimeZoneCode='"Antarctica/Macquarie"' Country='"Australia"' />
<VALUE name="T391" description="(GMT +11) Magadan" TimeZoneCode='"Asia/Magadan"' Country='"Russia"' />
<VALUE name="T392" description="(GMT +11) Sakhalin" TimeZoneCode='"Asia/Sakhalin"' Country='"Russia"' />
<VALUE name="T393" description="(GMT +11) Srednekolymsk" TimeZoneCode='"Asia/Srednekolymsk"' Country='"Russia"' />
<VALUE name="T394" description="(GMT +11) Bougainville" TimeZoneCode='"Pacific/Bougainville"' Country='"Papua New Guinea"' />
<VALUE name="T395" description="(GMT +11) Efate" TimeZoneCode='"Pacific/Efate"' Country='"Vanuatu"' />
<VALUE name="T396" description="(GMT +11) Guadalcanal" TimeZoneCode='"Pacific/Guadalcanal"' Country='"Solomon Islands"' />
<VALUE name="T397" description="(GMT +11) Kosrae" TimeZoneCode='"Pacific/Kosrae"' Country='"Micronesia"' />
<VALUE name="T398" description="(GMT +11) Norfolk" TimeZoneCode='"Pacific/Norfolk"' Country='"Norfolk Island"' />
<VALUE name="T399" description="(GMT +11) Noumea" TimeZoneCode='"Pacific/Noumea"' Country='"New Caledonia"' />
<VALUE name="T400" description="(GMT +11) Pohnpei" TimeZoneCode='"Pacific/Pohnpei"' Country='"Micronesia"' />
<VALUE name="T401" description="(GMT +12) McMurdo" TimeZoneCode='"Antarctica/McMurdo"' Country='"Antarctica"' />
<VALUE name="T402" description="(GMT +12) Anadyr" TimeZoneCode='"Asia/Anadyr"' Country='"Russia"' />
<VALUE name="T403" description="(GMT +12) Kamchatka" TimeZoneCode='"Asia/Kamchatka"' Country='"Russia"' />
<VALUE name="T404" description="(GMT +12) Auckland" TimeZoneCode='"Pacific/Auckland"' Country='"New Zealand"' />
<VALUE name="T405" description="(GMT +12) Fiji" TimeZoneCode='"Pacific/Fiji"' Country='"Fiji"' />
<VALUE name="T406" description="(GMT +12) Funafuti" TimeZoneCode='"Pacific/Funafuti"' Country='"Tuvalu"' />
<VALUE name="T407" description="(GMT +12) Kwajalein" TimeZoneCode='"Pacific/Kwajalein"' Country='"Marshall Islands"' />
<VALUE name="T408" description="(GMT +12) Majuro" TimeZoneCode='"Pacific/Majuro"' Country='"Marshall Islands"' />
<VALUE name="T409" description="(GMT +12) Nauru" TimeZoneCode='"Pacific/Nauru"' Country='"Nauru"' />
<VALUE name="T410" description="(GMT +12) Tarawa" TimeZoneCode='"Pacific/Tarawa"' Country='"Kiribati"' />
<VALUE name="T411" description="(GMT +12) Wake" TimeZoneCode='"Pacific/Wake"' Country='"United States Minor Outlying Islands"' />
<VALUE name="T412" description="(GMT +12) Wallis" TimeZoneCode='"Pacific/Wallis"' Country='"Wallis and Futuna"' />
<VALUE name="T413" description="(GMT +12:45) Chatham" TimeZoneCode='"Pacific/Chatham"' Country='"New Zealand"' />
<VALUE name="T414" description="(GMT +13) Apia" TimeZoneCode='"Pacific/Apia"' Country='"Samoa"' />
<VALUE name="T415" description="(GMT +13) Enderbury" TimeZoneCode='"Pacific/Enderbury"' Country='"Kiribati"' />
<VALUE name="T416" description="(GMT +13) Fakaofo" TimeZoneCode='"Pacific/Fakaofo"' Country='"Tokelau"' />
<VALUE name="T417" description="(GMT +13) Tongatapu" TimeZoneCode='"Pacific/Tongatapu"' Country='"Tonga"' />
<VALUE name="T418" description="(GMT +14) Kiritimati" TimeZoneCode='"Pacific/Kiritimati"' Country='"Kiribati"' />
</CONSTANT>
</ROOT>
\ No newline at end of file
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 UserSortOption extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_UserSortOption = new UserSortOptionFactory();
public static final UserSortOption ALPHA_A_Z = new UserSortOption ("ALPHA_A_Z", "ALPHA_A_Z", "A-Z", false);
public static final UserSortOption ALPHA_Z_A = new UserSortOption ("ALPHA_Z_A", "ALPHA_Z_A", "Z-A", false);
private static final UserSortOption[] allUserSortOptions =
new UserSortOption[] { ALPHA_A_Z,ALPHA_Z_A};
private static UserSortOption[] getAllUserSortOptions ()
{
return allUserSortOptions;
}
private UserSortOption (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allUserSortOptions);
static
{
defineAdditionalData ();
}
public boolean isEqual (UserSortOption other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return UserSortOption.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return UserSortOption.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_UserSortOption;
}
public static UserSortOption forName (String name)
{
if (name == null) { return null; }
UserSortOption[] all = getAllUserSortOptions();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static UserSortOption forValue (String value)
{
if (value == null) { return null; }
UserSortOption[] all = getAllUserSortOptions();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllUserSortOptions (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllUserSortOptions());
}
public static UserSortOption[] getUserSortOptionArray ()
{
return (UserSortOption[])getAllUserSortOptions().clone ();
}
public static void defineAdditionalData ()
{
}
static class UserSortOptionFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return UserSortOption.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return UserSortOption.forValue (name);
}
public Enumeration getAll ()
{
return UserSortOption.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="UserSortOption">
<VALUE name="ALPHA_A_Z" value="ALPHA_A_Z" description="A-Z"/>
<VALUE name="ALPHA_Z_A" value="ALPHA_Z_A" description="Z-A"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
...@@ -4,6 +4,7 @@ import java.util.*; ...@@ -4,6 +4,7 @@ import java.util.*;
import oneit.logging.*; import oneit.logging.*;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.objstore.rdbms.filters.*; import oneit.objstore.rdbms.filters.*;
import oneit.objstore.utils.*;
import oneit.utils.*; import oneit.utils.*;
import oneit.utils.filter.*; import oneit.utils.filter.*;
import oneit.utils.math.*; import oneit.utils.math.*;
...@@ -230,7 +231,8 @@ public class AnalysisEngine ...@@ -230,7 +231,8 @@ public class AnalysisEngine
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> analyseAnswers completed for Candidate ", candidate, " Level:", level); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> analyseAnswers completed for Candidate ", candidate, " Level:", level);
} }
public static Map<CultureClass, Long> getCultureFit(Set<CultureCriteriaAnswer> cultureCriteriaAnswers, Job job) //Tuple.T2<Long, Set<Tuple.T3>> ---> T2<Score, List<T3 <WeightingScore, CultureElement, Narrative>>
public static Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>> getCultureFit(Set<CultureCriteriaAnswer> cultureCriteriaAnswers, Job job)
{ {
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getCultureFit called"); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getCultureFit called");
...@@ -238,16 +240,17 @@ public class AnalysisEngine ...@@ -238,16 +240,17 @@ public class AnalysisEngine
CultureCriteriaAnswer.pipesCultureCriteriaAnswer(cultureCriteriaAnswers).toSelectedQuestion().toNarratives().toCultureElementRating().uniqueVals(); CultureCriteriaAnswer.pipesCultureCriteriaAnswer(cultureCriteriaAnswers).toSelectedQuestion().toNarratives().toCultureElementRating().uniqueVals();
CultureCriteriaAnswer.pipesCultureCriteriaAnswer(cultureCriteriaAnswers).toCultureElement().uniqueVals(); CultureCriteriaAnswer.pipesCultureCriteriaAnswer(cultureCriteriaAnswers).toCultureElement().uniqueVals();
Map<CultureClass, Integer> scoreMap = new HashMap(); Map<CultureClass, Integer> scoreMap = new LinkedHashMap();
Map<CultureClass, Integer> maxScoreMap = new HashMap(); Map<CultureClass, Integer> maxScoreMap = new LinkedHashMap();
Map<CultureClass, Set<Tuple.T3>> elementMap = new LinkedHashMap();
for(CultureClass cultureClass : CultureClass.getCultureClassArray()) for(CultureClass cultureClass : CultureClass.getCultureClassArray())
{ {
scoreMap.put(cultureClass, 0); scoreMap.put(cultureClass, 0);
maxScoreMap.put(cultureClass, 0); maxScoreMap.put(cultureClass, 0);
elementMap.put(cultureClass, new TreeSet<Tuple.T3>());
} }
for(CultureCriteriaAnswer answer : cultureCriteriaAnswers) for(CultureCriteriaAnswer answer : cultureCriteriaAnswers)
{ {
CultureCriteria criteria = answer.getCriteriaJob(job); CultureCriteria criteria = answer.getCriteriaJob(job);
...@@ -273,6 +276,12 @@ public class AnalysisEngine ...@@ -273,6 +276,12 @@ public class AnalysisEngine
{ {
ratingScore = narrative.getColorCode().getRatingScore(); ratingScore = narrative.getColorCode().getRatingScore();
} }
Tuple.T3 tuple = new Tuple.T3(weightingScore, element, narrative);
tuple.setComparatorForIndex(CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST), 0);
tuple.setComparatorForIndex(ObjectComparator.BY_ID, 1);
elementMap.get(cultureClass).add(tuple);
} }
int score = (weightingScore * ratingScore); int score = (weightingScore * ratingScore);
...@@ -284,16 +293,21 @@ public class AnalysisEngine ...@@ -284,16 +293,21 @@ public class AnalysisEngine
} }
} }
Map<CultureClass, Long> cultureFitMap = getFinalFitMap(scoreMap, maxScoreMap); Map<CultureClass, Long> cultureFitMap = getFinalFitMap(scoreMap, maxScoreMap);
Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>> finalMap = new LinkedHashMap();
for(CultureClass cultureClass : cultureFitMap.keySet())
{
finalMap.put(cultureClass, new Tuple.T2(cultureFitMap.get(cultureClass), elementMap.get(cultureClass)));
}
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getCultureFit completed"); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getCultureFit completed");
return cultureFitMap; return finalMap;
} }
private static <T> Map<T, Long> getFinalFitMap(Map<T, Integer> scoreMap, Map<T, Integer> maxScoreMap) private static <T> Map<T, Long> getFinalFitMap(Map<T, Integer> scoreMap, Map<T, Integer> maxScoreMap)
{ {
Map<T, Long> fitMap = new HashMap(); Map<T, Long> fitMap = new LinkedHashMap();
int totalScore = 0; int totalScore = 0;
int totalMaxScore = 0; int totalMaxScore = 0;
...@@ -400,12 +414,12 @@ public class AnalysisEngine ...@@ -400,12 +414,12 @@ public class AnalysisEngine
return roleFitMap; return roleFitMap;
} }
public static Map<FactorClass, Double> getRoleFitSuitability(Candidate candidate, Level level) public static Map<FactorClass, Tuple.T2<Double, ColorCode>> getRoleFitSuitability(Candidate candidate, Level level)
{ {
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability called for candidate ", candidate, " Level ", level); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability called for candidate ", candidate, " Level ", level);
TestAnalysis testAnalysis = candidate.getTestAnalysisFor(level); TestAnalysis testAnalysis = candidate.getTestAnalysisFor(level);
Map<FactorClass, Double> scoreMap = new HashMap(); Map<FactorClass, Tuple.T2<Double, ColorCode>> scoreMap = new HashMap();
if(testAnalysis != null && testAnalysis.getCandidateClassScoresCount() > 0) if(testAnalysis != null && testAnalysis.getCandidateClassScoresCount() > 0)
{ {
...@@ -416,14 +430,16 @@ public class AnalysisEngine ...@@ -416,14 +430,16 @@ public class AnalysisEngine
CandidateClassScore candidateClassScore = testAnalysis.pipelineTestAnalysis().toCandidateClassScores(candidateClassScoreFilter).val(); CandidateClassScore candidateClassScore = testAnalysis.pipelineTestAnalysis().toCandidateClassScores(candidateClassScoreFilter).val();
ClassNormalisation classNormalisation = level.getClassNormalisationFor(factorClass); ClassNormalisation classNormalisation = level.getClassNormalisationFor(factorClass);
Double score = 0d; Double score = 0d;
ColorCode colorCode = null;
if(candidateClassScore != null && classNormalisation != null && NullArith.greaterThan(classNormalisation.getWghtStddevScore(), 0d)) if(candidateClassScore != null && classNormalisation != null && NullArith.greaterThan(classNormalisation.getWghtStddevScore(), 0d))
{ {
score = NullArith.round(((10 * ((candidateClassScore.getWghtdClassScore() - classNormalisation.getWghtMeanScore()) / classNormalisation.getWghtStddevScore())) + 50), 1); score = NullArith.round(((10 * ((candidateClassScore.getWghtdClassScore() - classNormalisation.getWghtMeanScore()) / classNormalisation.getWghtStddevScore())) + 50), 1);
colorCode = candidateClassScore.getColorCode();
} }
scoreMap.put(factorClass, score); scoreMap.put(factorClass, new Tuple.T2(score, colorCode));
} }
scoreMap.put(null, getSuitabilityScore(testAnalysis).get0()); scoreMap.put(null, getSuitabilityScore(testAnalysis));
} }
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability completed for candidate ", candidate, " Level ", level); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability completed for candidate ", candidate, " Level ", level);
......
package performa.utils;
import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.business.content.transform.ContentTransformFactory;
import oneit.components.DefaultInitialisable;
import oneit.objstore.ObjectTransaction;
import oneit.security.SecUser;
import oneit.utils.ObjectTransform;
import performa.orm.Company;
import performa.orm.CompanyUser;
public class MenuItemDisableTransformFactory implements ContentTransformFactory, DefaultInitialisable
{
@Override
public ObjectTransform createTransform(Article article, HttpServletRequest request, ObjectTransaction transaction)
{
return new MenuItemDisableTransform(article, request, transaction);
}
public class MenuItemDisableTransform implements ObjectTransform
{
Article article;
HttpServletRequest request;
ObjectTransaction transaction;
SecUser secUser;
CompanyUser companyUser;
Company company;
public MenuItemDisableTransform(Article article, HttpServletRequest request, ObjectTransaction transaction)
{
this.article = article;
this.request = request;
this.transaction = transaction;
this.secUser = SecUser.getTXUser(transaction);
this.companyUser = this.secUser!=null ? this.secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) : null;
this.company = this.companyUser!=null ? this.companyUser.getCompany() : null;
}
public Object transform(Object original)
{
if((Boolean)article.getAdditionalAttribute("Allow Disable", Boolean.FALSE)
&& this.company !=null && !this.company.showHasClientSupport())
{
return String.valueOf(original);
}
else
{
return "";
}
}
}
}
\ No newline at end of file
package performa.utils;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpSession;
import oneit.components.*;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectStatus;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.services.TransactionServicesFactory;
import oneit.security.Role;
import oneit.security.SecUser;
import oneit.security.oauth.decorator.OAuthCallbackDecorator;
import oneit.security.oauth.utils.BaseOAuthLoginHandler;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.servlets.utils.BaseHttpServletRequest;
import oneit.servlets.utils.BaseHttpServletResponse;
import oneit.servlets.utils.decorator.ServletDecorator;
import oneit.servlets.utils.decorator.ServletDecoratorConfig;
import oneit.utils.*;
import performa.orm.Candidate;
import performa.orm.CompanyUser;
import performa.orm.Company;
import performa.orm.types.RoleType;
/**
* This is almost similar class to OAuthCallbackDecorator,
* except setup user extensions using redirect URL before redirect request.
*
* @see OAuthCallbackDecorator
*/
public class PerformaOAuthCallbackDecorator implements ServletDecorator, InitialisationParticipant
{
private LoggingArea LOG = LoggingArea.createLoggingArea("OAuthCallbackDecorator");
private TransactionServicesFactory servicesFactory;
public static final String REDIRECT_URL_ATTRIB_NAME = "oauth.returnURL";
public static final String TOKEN_ATTRIB_NAME = "oauth.token";
public static final String ACCESS_DENY_URL_ATTRIB_NAME = "oauth.accessDenyURL";
public static final String ACCESS_DENY_ERROR_KEY = "oauth.accessDenyError";
/**
* Map <Callback Service, Callback Handler>
*/
public Map handlerMap;
@Override
public void processRequest (ServletDecoratorConfig config, BaseHttpServletRequest request, BaseHttpServletResponse response) throws Exception
{
String callbackURL = request.getServletPath();
HttpSession session = request.getSession();
try
{
LogMgr.log(LOG, LogLevel.DEBUG1, "Entering into OAuthCallbackDecorator");
if(handlerMap != null && handlerMap.containsKey(callbackURL))
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Catching in OAuthCallbackDecorator RE for callback :: ", callbackURL);
BaseOAuthLoginHandler loginHandler = (BaseOAuthLoginHandler)handlerMap.get(callbackURL);
// Validate request is authorized or not.
loginHandler.validateRequest(request);
// Create or Get Login user from oauth process
ObjectTransaction transaction = new ObjectTransaction (servicesFactory);
String fullURL = (String)session.getAttribute(REDIRECT_URL_ATTRIB_NAME);
try
{
SecUser secUser = loginHandler.getOrCreateSecuser(request, transaction);
if(fullURL.contains(WebUtils.APPLICANT_PORTAL))
{
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_APPLICANT));
Candidate candidate = secUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
candidate.setUser(secUser);
}
else if(fullURL.contains(WebUtils.ADMIN_PORTAL))
{
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_CLIENT));
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_COMPANY_ADMIN));
CompanyUser companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
if(companyUser.getStatus()==ObjectStatus.NEW)
{
Company company = Company.createCompany(transaction);
company.setCompanyName("");
company.setAddedByUser(companyUser);
company.addToUsers(companyUser);
companyUser.setRole(RoleType.ADMIN);
}
}
transaction.commit();
transaction.commitResources();
// Store user in session for login.
session.setAttribute(SecUser.SEC_USER_ID, secUser);
session.setAttribute(SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
}
finally
{
transaction.releaseResources();
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Redirecting user to next page after login. ", fullURL);
if(fullURL == null || fullURL.isEmpty())
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Can't find returnURL in Session.");
config.forwardRequest(request, response);
return;
}
// Redirect user on next page after login
request.setAttribute ("DecoratorFilter.TERMINATE", "YES");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Redirecting form OAuthCallbackDecorator ON :: " + fullURL);
response.sendRedirect(fullURL);
return;
}
LogMgr.log(LOG, LogLevel.DEBUG1, "Exit from OAuthCallbackDecorator");
config.forwardRequest(request, response);
}
catch(Exception e)
{
if (e instanceof BaseOAuthLoginHandler.LoadProfileException)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, e);
Map<String, String> paramsMap = getURLParams((String)session.getAttribute(REDIRECT_URL_ATTRIB_NAME));
if (StringUtils.subBlanks(paramsMap.get(ACCESS_DENY_URL_ATTRIB_NAME)) == null)
{
throw new NestedException(e);
}
request.setAttribute ("DecoratorFilter.TERMINATE", "YES");
session.setAttribute(ACCESS_DENY_ERROR_KEY, e.getMessage());
response.sendRedirect(paramsMap.get(ACCESS_DENY_URL_ATTRIB_NAME));
return;
}
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, e, "Error occurred during decorator filter.");
throw NestedException.wrap(e);
}
finally
{
session.removeAttribute(TOKEN_ATTRIB_NAME);
session.removeAttribute(REDIRECT_URL_ATTRIB_NAME);
}
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
context.setObject(this);
handlerMap = context.getChildMap("Handler");
}
/**
* Get request parameters as a map, from given URL.
*
* @param urlString
* @return
*/
public static Map<String, String> getURLParams(String urlString)
{
Map<String,String> urlParamsMap = new HashMap<String, String>();
URL url;
try
{
url = new URL(urlString);
}
catch (MalformedURLException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.SYSTEMERROR1, ex, "\n Malformed URL:" + urlString);
return urlParamsMap;
}
String[] params = url.getQuery() != null ? url.getQuery().split("&") : new String[] {};
for (String param: params)
{
String key = param.substring(0, param.indexOf('='));
urlParamsMap.put( key, param.substring(param.indexOf('=') + 1));
}
return urlParamsMap;
}
}
package performa.utils;
import oneit.logging.*;
import oneit.security.*;
import oneit.security.oauth.utils.SetupUserHelper;
public class PerformaSetupUserHelper extends SetupUserHelper
{
@Override
public void setUpDefaultRole(SecUser secUser)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Inside setUpDefaultRole in PerformaSetupUserHelper for ", secUser);
}
@Override
public void setUpDefaultPriv(SecUser secUser)
{
LogMgr.log(LoggingArea.ALL, LogLevel.DEBUG1, "Bypassing setUpDefaultPriv in PerformaSetupUserHelper");
}
@Override
public void setUpDefaultExtensions(SecUser secUser)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Inside setUpDefaultExtensions in PerformaSetupUserHelper for ", secUser);
}
}
...@@ -2,31 +2,29 @@ package performa.utils; ...@@ -2,31 +2,29 @@ package performa.utils;
import java.util.*; import java.util.*;
import javax.activation.DataSource; import javax.activation.DataSource;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr; import oneit.appservices.config.ConfigMgr;
import oneit.email.ConfigurableArticleTemplateEmailer; import oneit.business.content.Article;
import oneit.email.ConfigurableEmailerException; import oneit.email.*;
import oneit.logging.LogLevel; import oneit.logging.*;
import oneit.logging.LogMgr; import oneit.net.LoopbackHTTP;
import oneit.logging.LoggingArea; import oneit.objstore.*;
import oneit.objstore.BaseBusinessClass; import oneit.objstore.rdbms.filters.*;
import oneit.objstore.ObjectTransaction; import oneit.objstore.utils.ObjstoreUtils;
import oneit.objstore.rdbms.filters.GreaterThanEqualFilter;
import oneit.objstore.rdbms.filters.LessThanFilter;
import oneit.security.*; import oneit.security.*;
import oneit.utils.Tuple; import oneit.security.jsp.*;
import performa.orm.*; import oneit.security.oauth.form.*;
import performa.orm.types.Importance; import oneit.servlets.forms.*;
import performa.orm.types.JobSortOption; import oneit.servlets.orm.DataMap;
import oneit.objstore.utils.*; import oneit.servlets.process.ORMProcessState;
import oneit.servlets.security.SessionSecUserDecorator;
import oneit.utils.*; import oneit.utils.*;
import oneit.utils.filter.CollectionFilter; import oneit.utils.filter.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.MapTransform; import oneit.utils.transform.MapTransform;
import oneit.utils.transform.param.ErrorTransform; import oneit.utils.transform.param.*;
import oneit.utils.transform.param.ORMTransform; import performa.form.LinkedInOAuthLoginFP;
import oneit.utils.transform.param.PrefixCompoundTransform; import performa.orm.*;
import performa.orm.types.AppSortOption; import performa.orm.types.*;
import performa.orm.types.JobStatus;
/** /**
* *
...@@ -36,8 +34,12 @@ public class Utils ...@@ -36,8 +34,12 @@ public class Utils
{ {
public static final String ROLE_APPLICANT = "TL_Applicant"; public static final String ROLE_APPLICANT = "TL_Applicant";
public static final String ROLE_CLIENT = "TL_Client"; public static final String ROLE_CLIENT = "TL_Client";
public static final String ROLE_COMPANY_ADMIN = "TL_CompanyAdmin";
public static final String ROLE_COMPANY_USER = "TL_CompanyUser";
public static final String PRIV_ACCESS_ADMIN_PORTAL = "TL_AccessAdminPortal"; public static final String PRIV_ACCESS_ADMIN_PORTAL = "TL_AccessAdminPortal";
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 = "TL_AccessCompany";
public static final String LEVEL_GENERAL_PURPOSE = "General Purpose"; public static final String LEVEL_GENERAL_PURPOSE = "General Purpose";
public static final String LEVEL_SALES = "Sales"; public static final String LEVEL_SALES = "Sales";
public static final String LEVEL_MANAGEMENT = "Management"; public static final String LEVEL_MANAGEMENT = "Management";
...@@ -143,6 +145,61 @@ public class Utils ...@@ -143,6 +145,61 @@ public class Utils
new Comparator[]{comparator}); new Comparator[]{comparator});
} }
public static List<Client> getClientsSorted(Client[] clients, ClientSortOption clientSortOption)
{
ObjectTransform transform = Client.pipesClient().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR;
if(clientSortOption == ClientSortOption.ALPHA_A_Z)
{
transform = Client.pipesClient().toClientName();
comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR;
}
else if(clientSortOption == ClientSortOption.ALPHA_Z_A)
{
transform = Client.pipesClient().toClientName();
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR);
}
else if(clientSortOption == ClientSortOption.OPEN_JOBS)
{
transform = new ClientJobCountTransform(JobStatus.OPEN);
comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR);
}
else if(clientSortOption == ClientSortOption.FILLED_JOBS)
{
transform = new ClientJobCountTransform(JobStatus.FILLED);
comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR);
}
return ObjstoreUtils.sort( Arrays.asList(clients), new ObjectTransform[]{transform}, new Comparator[]{comparator});
}
public static Collection<CompanyUser> getUsersSorted(Collection<CompanyUser> users, UserSortOption userSortOption)
{
Comparator comparator = (userSortOption == UserSortOption.ALPHA_Z_A) ? CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST) : CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
return ObjstoreUtils.sort(users, new ObjectTransform[]{CompanyUserTransform.INSTANCE}, new Comparator[]{comparator});
}
public static class ClientJobCountTransform implements ObjectTransform<Client, Integer>
{
JobStatus jobStatus;
public ClientJobCountTransform(JobStatus jobStatus)
{
this.jobStatus = jobStatus;
}
@Override
public Integer transform(Client client)
{
return client.getApplicationCountByStatus(jobStatus);
}
}
public static int getClosingSoonJobCount(Job[] jobs) public static int getClosingSoonJobCount(Job[] jobs)
{ {
...@@ -214,7 +271,7 @@ public class Utils ...@@ -214,7 +271,7 @@ public class Utils
} }
public static void sendMail(ConfigurableArticleTemplateEmailer emailer, ObjectTransform finalTransform, String[] emails, DataSource[] attachments, BaseBusinessClass bo) throws ConfigurableEmailerException public static void sendMail(ConfigurableEmailer emailer, ObjectTransform finalTransform, String[] emails, DataSource[] attachments, BaseBusinessClass bo) throws ConfigurableEmailerException
{ {
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Sending Mail from Utils class to" + Arrays.toString(emails)); LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Sending Mail from Utils class to" + Arrays.toString(emails));
...@@ -234,4 +291,209 @@ public class Utils ...@@ -234,4 +291,209 @@ public class Utils
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Mail sent from Utils class to " + Arrays.toString(emails)); LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Mail sent from Utils class to " + Arrays.toString(emails));
} }
}
public static String getPwdKeyOfSecUser(HttpServletRequest request, SecUser user, boolean mandatoryPwd)
{
if(user != null)
{
DataMap dm = DataMap.getDataMap(request, true);
return dm.storeORMHandler(new PasswordDIHandler(user, "md5:" + SecUser.FIELD_Password, mandatoryPwd), user, "md5:" + SecUser.FIELD_Password);
}
return "";
}
public static SuccessfulResult processSuccessfulLogin(ORMProcessState process, SubmissionDetails submission, Map params, SecUser user) throws BusinessException
{
HttpServletRequest request = submission.getRequest();
request.getSession().setAttribute (SecUser.SEC_USER_ID, user);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
process.completeAndRestart();
return new RedirectResult((String) request.getAttribute("nextPage"), null);
}
public static Client[] getClientsByCompany(ObjectTransaction transaction)
{
SecUser secUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
return companyUser.getCompany().getClientsSet().toArray(new Client[0]);
}
public static Boolean isCompanyUserEmailFound(ObjectTransaction objTran, String email)
{
if(email!=null)
{
SecUser user = SecUser.searchNAME(objTran, email.toLowerCase());
if(user!=null && user.getExtension(CompanyUser.REFERENCE_CompanyUser)!=null)
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
public static Boolean isCompanyUserEmailFound(ObjectTransaction objTran, String email, CompanyUser currentUser)
{
if(email!=null)
{
SecUser user = SecUser.searchNAME(objTran, email.toLowerCase());
if(user!=null)
{
CompanyUser comUser = user.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(comUser!=null && !CollectionUtils.equals(comUser, currentUser))
{
return Boolean.TRUE;
}
}
}
return Boolean.FALSE;
}
public static Tuple.T2<SecUser, Boolean> getSecUserForCompanyIfAvailable(CompanyUser companyUser)
{
SecUser secUser = companyUser.getUser();
SecUser availableSecUser = SecUser.searchNAME(companyUser.getTransaction(), secUser.getEmail());
if(availableSecUser!=null)
{
if(availableSecUser.getExtension(CompanyUser.REFERENCE_CompanyUser)==null)
{
availableSecUser.addToExtensions(companyUser);
//remove new sec user obj
secUser.removeFromExtensions(companyUser);
secUser.delete();
return new Tuple.T2<SecUser, Boolean>(availableSecUser, Boolean.TRUE);
}
}
return new Tuple.T2<SecUser, Boolean>(secUser, Boolean.FALSE);
}
public static void sendVerificationMail(CompanyUser companyUser, HttpServletRequest request, ConfigurableArticleTemplateEmailer emailer, String callingClass) throws BusinessException
{
if(!CollectionUtils.equals(companyUser.getIsAccountVerified(), Boolean.TRUE))
{
try
{
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sending verification mail from " + callingClass + " to :: ", companyUser);
Article verificationArticle = WebUtils.getArticleByShortCut(companyUser.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION);
RandomStringGen random = new RandomStringGen();
//set verification key and send mail time
companyUser.setVerificationKey(random.generateAlphaNum(6));
companyUser.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ verificationArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sent verification mail successfully from " + callingClass + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(CompanyUser.LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for user :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
else
{
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Call from " + callingClass + ". Account is already verified for user :: ", companyUser);
}
}
public static void sendEmailChangedMail(CompanyUser companyUser, HttpServletRequest request, ConfigurableArticleTemplateEmailer emailer, String callingClass) throws BusinessException
{
if(companyUser.getIsEmailChanged()==Boolean.TRUE)
{
try
{
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sending email changed mail from " + callingClass + " to :: ", companyUser);
RandomStringGen random = new RandomStringGen();
//set verification key and send mail time
companyUser.setVerificationKey(random.generateAlphaNum(6));
companyUser.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ "/extensions/adminportal/email_verified.jsp"
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser);
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sent email changed mail successfully from " + callingClass + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(CompanyUser.LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for user :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
else
{
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Call from " + callingClass + ". Account is already verified for user :: ", companyUser);
}
}
public static boolean facebookAvailable()
{
return ConfigMgr.getKeyfileString(FacebookOAuthLoginFP.FACEBOOK_APPID_ATTRIB_NAME) != null
&& ConfigMgr.getKeyfileString(FacebookOAuthLoginFP.FACEBOOK_APP_SECRET_ATTR_NAME) != null;
}
public static boolean linkedInAvailable()
{
return ConfigMgr.getKeyfileString(LinkedInOAuthLoginFP.LINKEDIN_CLIENTID_ATTR_NAME) != null
&& ConfigMgr.getKeyfileString(LinkedInOAuthLoginFP.LINKEDIN_CLIENTSECRET_ATTR_NAME) != null;
}
public static boolean googleAvailable()
{
return ConfigMgr.getKeyfileString(GoogleOAuthLoginFP.GOOGLE_CLIENTID_ATTR_NAME) != null
&& ConfigMgr.getKeyfileString(GoogleOAuthLoginFP.GOOGLE_CLIENTSECRET_ATTR_NAME) != null;
}
private static class CompanyUserTransform implements ObjectTransform<CompanyUser, String>
{
static CompanyUserTransform INSTANCE = new CompanyUserTransform();
@Override
public String transform(CompanyUser companyUser)
{
return SecUserToNameTransform.INSTANCE.transform(companyUser.getUser());
}
}
}
\ No newline at end of file
...@@ -30,6 +30,7 @@ public class WebUtils ...@@ -30,6 +30,7 @@ public class WebUtils
public static final String JOBS = "Jobs"; public static final String JOBS = "Jobs";
public static final String CANDIDATES = "Candidates"; public static final String CANDIDATES = "Candidates";
public static final String CLIENTS = "Clients"; public static final String CLIENTS = "Clients";
public static final String EDIT_CLIENT = "EditClient";
public static final String MANAGE_USERS = "ManageUsers"; public static final String MANAGE_USERS = "ManageUsers";
public static final String MY_COMPANY = "MyCompany"; public static final String MY_COMPANY = "MyCompany";
public static final String BILLING = "Billing"; public static final String BILLING = "Billing";
...@@ -40,6 +41,10 @@ public class WebUtils ...@@ -40,6 +41,10 @@ public class WebUtils
public static final String UNSUITABLE_APPS = "UnsuitableApps"; public static final String UNSUITABLE_APPS = "UnsuitableApps";
public static final String VIEW_APPLICANTS_GRID = "ViewApplicantsGrid"; public static final String VIEW_APPLICANTS_GRID = "ViewApplicantsGrid";
public static final String APPLICANT_ACCOUNT_VERIFICATION = "ApplicantAccountVerification"; public static final String APPLICANT_ACCOUNT_VERIFICATION = "ApplicantAccountVerification";
public static final String RESET_PASSWORD_ARTICLE = "ResetPasswordEmail";
public static final String COMPANY_ACCOUNT_VERIFICATION = "CompanyAccountVerification";
public static final String MY_DETAILS = "MyDetails";
public static final String RESET_PASSWORD = "ResetPassword";
public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode) public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode)
...@@ -136,4 +141,18 @@ public class WebUtils ...@@ -136,4 +141,18 @@ public class WebUtils
renderMode.equals(JOB_REVIEW) || renderMode.equals(JOB_REVIEW) ||
renderMode.equals(CREATED_JOB); renderMode.equals(CREATED_JOB);
} }
public static boolean showHeaderFooter(ObjectTransaction objTran, Article article)
{
Article accVerificationArticle = getArticleByShortCut(objTran, COMPANY_ACCOUNT_VERIFICATION);
if(accVerificationArticle != null)
{
if(descendsFrom(article, accVerificationArticle.getIdentifier()))
{
return false;
}
}
return true;
}
} }
\ No newline at end of file
...@@ -258,6 +258,10 @@ ul.profile-dropdown { ...@@ -258,6 +258,10 @@ ul.profile-dropdown {
.main-menu ul li{ .main-menu ul li{
clear: both; clear: both;
} }
.main-menu ul li.disabled{
pointer-events:none;
opacity:0.6;
}
.main-menu li a{ .main-menu li a{
font-size: 15px; font-size: 15px;
color: #03a0e7; color: #03a0e7;
...@@ -267,6 +271,9 @@ ul.profile-dropdown { ...@@ -267,6 +271,9 @@ ul.profile-dropdown {
margin-bottom: 5px; margin-bottom: 5px;
margin-left: 3px; margin-left: 3px;
} }
.main-menu ul li.disabled a{
color: #939393;
}
.main-menu li a.second-menu{ .main-menu li a.second-menu{
color: #4e5258; color: #4e5258;
} }
...@@ -1503,10 +1510,10 @@ span.rate-label { ...@@ -1503,10 +1510,10 @@ span.rate-label {
text-align: center; text-align: center;
margin-bottom: 22px; margin-bottom: 22px;
} }
p.job-txt { p.job-txt, p.job-txt span{
text-align: center; text-align: center;
padding: 0 7%; padding: 10% 0 7%;
margin-bottom: 17px; font-family: "Usual-Light";
} }
.space-55{ .space-55{
display: inline-block; display: inline-block;
...@@ -2280,13 +2287,14 @@ a.forgot-pass { ...@@ -2280,13 +2287,14 @@ a.forgot-pass {
.d-three-box{ .d-three-box{
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.05); box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.05);
max-width: 23.7%; max-width: 275px;
padding: 20px 36px 31px; padding: 20px 36px 31px;
top: 20px; top: 20px;
float: none; float: none;
display: inline-block; display: inline-block;
text-align: left; text-align: left;
z-index: 100; z-index: 100;
width: 275px;
} }
.d-fl-left { .d-fl-left {
float: left; float: left;
...@@ -2491,6 +2499,66 @@ a.forgot-pass { ...@@ -2491,6 +2499,66 @@ a.forgot-pass {
height: 16px; height: 16px;
border: solid 4px #03ac66; border: solid 4px #03ac66;
} }
.main-dashboard-content {
position: relative;
}
.main-welcome-popup{
border-radius: 2px;
background-color: #ffffff;
box-shadow: 0 0 30px 5px rgba(0, 0, 0, 0.2);
border: 1px solid #e8e8eb;
width: 500px;
margin: 0 auto;
text-align: center;
padding: 0;
}
.main-welcome-popup h2{
font-size: 22px;
font-weight: 600;
color: #4a4a4a;
margin: 38px 0 22px;
}
.main-welcome-popup p {
font-size: 16px;
font-weight: 300;
line-height: 1.56;
text-align: center;
color: #4a4a4a;
padding: 0 60px;
}
.create-y-f-job{
width: 100%;
border-top: 1px solid #ededef;
margin-top: 35px;
padding: 27px 0;
}
.create-y-f-job a{
border-radius: 100px;
background-color: #03a0e7;
display: inline-block;
width: 280px;
height: 60px;
font-size: 15px;
font-weight: 600;
text-align: center;
color: #ffffff;
line-height: 60px;
}
.overlayer-dark::before {
background: rgba(0, 0, 0, 0.6) none repeat scroll 0 0;
bottom: 0;
content: "";
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 3;
}
.welcome-pop-top{
margin-top: 10%;
}
/*Dashboard Page End*/ /*Dashboard Page End*/
/*All Jobs Page*/ /*All Jobs Page*/
...@@ -2573,6 +2641,7 @@ a.forgot-pass { ...@@ -2573,6 +2641,7 @@ a.forgot-pass {
float: left; float: left;
} }
.chief-officer { .chief-officer {
color: #ffffff;
text-align: left; text-align: left;
font-size: 26px; font-size: 26px;
font-weight: 300; font-weight: 300;
...@@ -2593,7 +2662,7 @@ a.forgot-pass { ...@@ -2593,7 +2662,7 @@ a.forgot-pass {
} }
span.austr-post { span.austr-post {
text-transform: uppercase; text-transform: uppercase;
font-weight: 500; font-weight: 700;
font-family: "Usual-Medium"; font-family: "Usual-Medium";
} }
span.ex-management { span.ex-management {
...@@ -2606,10 +2675,10 @@ span.ex-management { ...@@ -2606,10 +2675,10 @@ span.ex-management {
background-position: left center; background-position: left center;
color: rgba(255, 255, 255, 0.7); color: rgba(255, 255, 255, 0.7);
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 700;
font-family: "Usual-Medium"; font-family: "Usual-Medium";
} }
.open-status-icon{ .active-status-icon{
width: 20px; width: 20px;
height: 20px; height: 20px;
border: solid 4px #03ac66; border: solid 4px #03ac66;
...@@ -2646,8 +2715,7 @@ span.ex-management { ...@@ -2646,8 +2715,7 @@ span.ex-management {
letter-spacing: 1px; letter-spacing: 1px;
color: #ffffff; color: #ffffff;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 700;
font-family: "Usual-Medium";
} }
.applicant-right-status{ .applicant-right-status{
text-align: right; text-align: right;
...@@ -2656,29 +2724,29 @@ span.ex-management { ...@@ -2656,29 +2724,29 @@ span.ex-management {
display: inline-block; display: inline-block;
} }
.edit-btn-dropdown a{ .edit-btn-dropdown a{
border-radius: 100px;
background-color: rgba(255, 255, 255, 0.15); background-color: rgba(255, 255, 255, 0.15);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
color: #ffffff; color: #ffffff;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 700;
padding: 0 27px; padding: 0 27px;
line-height: 45px; line-height: 45px;
height: 45px; height: 45px;
display: inline-block; display: inline-block;
font-family: "Usual-Medium"; font-family: "Usual-Medium";
background-color: #667281; background-color: #667281;
margin-left: 29px;
} }
.edit-btn-dropdown a.rightbtn { .edit-btn-dropdown a.rightbtn {
border-radius:0 100px 100px 0; border-radius:0 100px 100px 0;
margin-left: 0px; margin-left: 0px;
} }
.edit-btn-dropdown a.leftbtn { .edit-btn-dropdown a.leftbtn {
border-radius: 100px 0 0 100px; border-radius: 100px 0 0 100px;
margin-left: 29px; margin-left: 29px;
} }
.edit-btn-dropdown a:hover,.edit-btn-dropdown a:focus{ .edit-btn-dropdown a:hover,.edit-btn-dropdown a:focus{
...@@ -2696,8 +2764,7 @@ span.ex-management { ...@@ -2696,8 +2764,7 @@ span.ex-management {
} }
.main-applicant-content { .main-applicant-content {
float: left; float: left;
width: 100%; width: 100%;
background-color: #ffffff;
} }
.applicant-sidebar li { .applicant-sidebar li {
line-height: 49px; line-height: 49px;
...@@ -2734,10 +2801,9 @@ span.ex-management { ...@@ -2734,10 +2801,9 @@ span.ex-management {
} }
.main-appli-name{ .main-appli-name{
float: left; float: left;
padding-left:36px;
} }
.nav-justified > li { .test-tabs > li {
width: 200px; width: 200px;
} }
...@@ -2755,13 +2821,15 @@ span.ex-management { ...@@ -2755,13 +2821,15 @@ span.ex-management {
color: #7d7f82; color: #7d7f82;
text-align: left; text-align: left;
font-size: 12px; font-size: 12px;
margin-top: 11px; margin-top: 6px;
} }
.applicant-header { .applicant-header {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
border-bottom: solid 1px #dddddd; padding: 21px 24px;
padding: 22px 24px; background-color: #fff;
margin-bottom: 2.75%;
position: relative;
} }
.main-export { .main-export {
text-align: right; text-align: right;
...@@ -2777,16 +2845,74 @@ span.export-candidate,span.appli-status-short{ ...@@ -2777,16 +2845,74 @@ span.export-candidate,span.appli-status-short{
} }
.applicant-left { .applicant-left {
float: left; float: left;
width: 75.7%; width: 73.814%;
border-right: solid 1px #dddddd; }
.role-fit {
background: #fff none repeat scroll 0 0;
}
/*.role-fit .progress-label{
font-size: 16px;
letter-spacing: 1.5px;
color: #4a4a4a;
margin-top: 18px;
}*/
.thr-block.culture-fit, .thr-block.requirement-fit {
margin-top: 0;
background-color: #f7f7f8;
box-shadow: inset 1px 0 0 0 #dddddd;
}
.common-dot{
width: 12px;
height: 12px;
display: inline-block;
border-radius: 50%;
vertical-align: middle;
}
.red-dot{
background-color: #fabdc1;
border:1px solid #fb5d67;
}
.yellow-dot{
background-color: #fbe7a1;
border: 1px solid #fbc712;
}
.green-dot{
background-color: #8CE2DB;
border: 1px solid #47BBB3;
}
.text-dot-dot{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 88%;
display: inline-block;
}
.r-y-label{
font-size: 11px;
color: #67696d;
padding-left: 6px;
vertical-align: middle;
} }
.applicant-tab{ .a-label-row {
margin-bottom: 6px;
}
.thr-block {
display: inline-block;
padding: 0 17px 25px 25px;
vertical-align: bottom;
}
.four-label{
margin-top: 25px;
}
.applicant-tab {
background: #fff none repeat scroll 0 0;
border-top: 1px solid #ddd;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }
.applicant-tab ul { .applicant-tab ul {
background-color: #4a4a4a; background-color: #4a4a4a;
padding: 8px 6px 0 60px; padding: 8px 6px 0;
} }
.applicant-tab ul li a { .applicant-tab ul li a {
border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0;
...@@ -2809,12 +2935,14 @@ span.export-candidate,span.appli-status-short{ ...@@ -2809,12 +2935,14 @@ span.export-candidate,span.appli-status-short{
margin-left: 0; margin-left: 0;
} }
.appli-label{ .appli-label{
float: left; float: left;
line-height: 28px; font-size: 12px;
line-height: 28px;
width: 25%;
} }
.pro-bar { .pro-bar {
padding: 30px 28px 27px; padding: 28px 38px 22px 62px;
text-align: right; text-align: left;
} }
span.appli-percen { span.appli-percen {
color: #67b413; color: #67b413;
...@@ -2825,16 +2953,18 @@ span.appli-percen { ...@@ -2825,16 +2953,18 @@ span.appli-percen {
position: relative; position: relative;
top: -2px; top: -2px;
font-family: "Usual-Bold"; font-family: "Usual-Bold";
width: 80px;
text-align: right;
} }
.expand-box { .expand-box {
display: inline-block; display: inline-block;
margin-left: 26px; margin-left: 26px;
float: right;
position: relative; position: relative;
top: -6px;
} }
span.appli-progress-bar { span.appli-progress-bar {
display: inline-block; display: inline-block;
width: 44.47%; width: 48.47%;
} }
.appli-progress-bar .progress { .appli-progress-bar .progress {
margin-bottom: 0; margin-bottom: 0;
...@@ -2869,8 +2999,9 @@ span.appli-progress-bar { ...@@ -2869,8 +2999,9 @@ span.appli-progress-bar {
width: 100%; width: 100%;
} }
.applicant-right { .applicant-right {
float: left; float: right;
width: 24.3%; width: 23.73%;
background-color: #ffffff;
} }
.overall-suit{ .overall-suit{
color: #4a4a4a; color: #4a4a4a;
...@@ -2878,19 +3009,18 @@ span.appli-progress-bar { ...@@ -2878,19 +3009,18 @@ span.appli-progress-bar {
font-size: 12px; font-size: 12px;
text-transform: uppercase; text-transform: uppercase;
float: left; float: left;
width: 50%; line-height: 56px;
padding-top: 20px;
} }
.big-percentage{ .big-percentage{
color: #67b413; color: #667281;
font-size: 40px; font-size: 40px;
float:right; float: right;
width: 50%;
text-align: center;
} }
.app-right-b { .app-right-b {
padding: 10px 20px 60px 40px; padding: 15px 22px 15px 22px;
border-bottom: solid 1px #dddddd; border-bottom: solid 1px #dddddd;
float: left;
width: 100%;
} }
.contact-title{ .contact-title{
color: #4e5258; color: #4e5258;
...@@ -2899,8 +3029,10 @@ span.appli-progress-bar { ...@@ -2899,8 +3029,10 @@ span.appli-progress-bar {
margin-bottom: 22px; margin-bottom: 22px;
} }
.applicant-contact-info { .applicant-contact-info {
padding: 22px 20px 7px 40px; padding: 22px 20px 7px 20px;
border-bottom: solid 1px #dddddd; border-bottom: solid 1px #dddddd;
float: left;
width: 100%;
} }
.contact-label{ .contact-label{
letter-spacing: 1px; letter-spacing: 1px;
...@@ -2932,6 +3064,8 @@ span.appli-progress-bar { ...@@ -2932,6 +3064,8 @@ span.appli-progress-bar {
} }
.applicant-note { .applicant-note {
padding: 25px 21px; padding: 25px 21px;
float: left;
width: 100%;
} }
.applicant-note-title{ .applicant-note-title{
color: #4e5258; color: #4e5258;
...@@ -2971,13 +3105,14 @@ input.add-note-btn:hover{ ...@@ -2971,13 +3105,14 @@ input.add-note-btn:hover{
text-align: right; text-align: right;
} }
.admin-notes { .admin-notes {
padding: 16px 21px; padding: 16px 21px 56px;
float: left;
width: 100%;
} }
.admin-name{ .admin-name{
color: #4e5258; color: #4e5258;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 700;
font-family: "Usual-Medium";
} }
.date-value{ .date-value{
color: #4e5258; color: #4e5258;
...@@ -2992,7 +3127,7 @@ input.add-note-btn:hover{ ...@@ -2992,7 +3127,7 @@ input.add-note-btn:hover{
} }
.admin-br-line{ .admin-br-line{
border: solid 1px #d4d5d7; border: solid 1px #d4d5d7;
margin: 16px 0; margin: 30px 0 20px;
display: block; display: block;
} }
.fixed-width{ .fixed-width{
...@@ -3004,13 +3139,16 @@ input.add-note-btn:hover{ ...@@ -3004,13 +3139,16 @@ input.add-note-btn:hover{
color: #4a4a4a; color: #4a4a4a;
font-size: 12px; font-size: 12px;
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 15px; margin-bottom: 15px;
font-family: Usual-Regular; font-family: Usual-Regular;
letter-spacing: 1.1px;
font-weight: normal;
margin-top: 24px;
} }
.applicant-progress { .applicant-progress {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
margin: 29px 0 64px; float: left;
} }
.applicant-sidebar li.active a:after { .applicant-sidebar li.active a:after {
content: ''; content: '';
...@@ -3024,8 +3162,7 @@ input.add-note-btn:hover{ ...@@ -3024,8 +3162,7 @@ input.add-note-btn:hover{
top: 17px; top: 17px;
} }
.second-part.v-applicant-area{ .second-part.v-applicant-area{
padding-top: 63px; padding-top: 0px;
margin-top: 0px;
} }
.expand-hide-tag{ .expand-hide-tag{
background-color: #f2f3f4; background-color: #f2f3f4;
...@@ -3038,19 +3175,23 @@ input.add-note-btn:hover{ ...@@ -3038,19 +3175,23 @@ input.add-note-btn:hover{
width: 100%; width: 100%;
border-bottom: solid 1px #e3e3e3; border-bottom: solid 1px #e3e3e3;
} }
.tab-row:last-child{
border-bottom: 0;
}
.tab-view-label { .tab-view-label {
color: #4e5258; color: #4e5258;
float: left; float: left;
font-size: 10px; font-size: 10px;
letter-spacing: 0.9px; letter-spacing: 0.9px;
line-height: 82px; line-height: 82px;
text-align: right; text-align: left;
text-transform: uppercase; text-transform: uppercase;
width: 30%; width: 30%;
padding-left: 62px;
} }
.tab-view-side { .tab-view-side {
float: right; float: right;
padding: 17px 28px 17px 18px; padding: 17px 38px 17px 10px;
width: 67.4%; width: 67.4%;
} }
.result-want { .result-want {
...@@ -3090,25 +3231,25 @@ input.add-note-btn:hover{ ...@@ -3090,25 +3231,25 @@ input.add-note-btn:hover{
padding: 0 !important; padding: 0 !important;
} }
.red-b { .red-b {
background: #f9623d none repeat scroll 0 0; background: #f9623d none repeat scroll 0 0 !important;
float: left; float: left;
position: relative; position: relative;
z-index: 10; z-index: 10;
height: 10px; /*height: 10px;*/
} }
.yellow-b{ .yellow-b{
background-color: #ffd14c; background-color: #ffd14c !important;
float: left; float: left;
position: relative; position: relative;
z-index: 10; z-index: 10;
height: 10px; /*height: 10px;*/
} }
.green-b{ .green-b{
background-color: #03ac66; background-color: #03ac66 !important;
float: left; float: left;
position: relative; position: relative;
z-index: 10; z-index: 10;
height: 10px; /*height: 10px;*/
} }
.triangle-arrow { .triangle-arrow {
background: rgba(0, 0, 0, 0) url("../images/triangle.png") no-repeat scroll center center; background: rgba(0, 0, 0, 0) url("../images/triangle.png") no-repeat scroll center center;
...@@ -3127,6 +3268,27 @@ input.add-note-btn:hover{ ...@@ -3127,6 +3268,27 @@ input.add-note-btn:hover{
text-transform: uppercase; text-transform: uppercase;
margin-top: 10px; margin-top: 10px;
} }
.prev-btn,.next-btn{
width: 28px;
height: 28px;
background-color: #fff;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
border-radius: 50%;
text-align: center;
display: inline-block;
position: absolute;
line-height: 26px;
top: 50%;
transform: translateY(-50%);
}
.prev-btn{
left: -40px;
}
.next-btn{
right: -40px;
}
/*View Applicants Ends*/ /*View Applicants Ends*/
/*View Applicant Second page*/ /*View Applicant Second page*/
...@@ -3290,7 +3452,7 @@ input.add-note-btn:hover{ ...@@ -3290,7 +3452,7 @@ input.add-note-btn:hover{
width: 19%; width: 19%;
text-align: left; text-align: left;
background: #ffffff none repeat scroll 0 0; background: #ffffff none repeat scroll 0 0;
margin: 0 0.4%; margin: 0.4% 0.4%;
width: 19.05%; width: 19.05%;
} }
.green-back{ .green-back{
...@@ -3547,6 +3709,14 @@ input.add-note-btn:hover{ ...@@ -3547,6 +3709,14 @@ input.add-note-btn:hover{
text-transform: uppercase; text-transform: uppercase;
width: 15%; width: 15%;
} }
.appli-jcs2 {
color: #4a4a4a;
font-size: 11px;
letter-spacing: 1px;
padding: 26px 18px 5px;
text-transform: uppercase;
width: 20%;
}
.appli-overall{ .appli-overall{
color: #4a4a4a; color: #4a4a4a;
font-size: 11px; font-size: 11px;
...@@ -3797,7 +3967,7 @@ span.right-img { ...@@ -3797,7 +3967,7 @@ span.right-img {
border-bottom: 1px solid #edeff0; border-bottom: 1px solid #edeff0;
} }
.grid-box-view .appl-c-box{ .grid-box-view .appl-c-box{
margin: 0 0.61% 0 0; margin: 0 10px 0 0;
} }
.grid-box-view .appl-c-box:last-child{ .grid-box-view .appl-c-box:last-child{
...@@ -3850,6 +4020,129 @@ span.right-img { ...@@ -3850,6 +4020,129 @@ span.right-img {
/*View Applicants HT005 - Shortlist End*/ /*View Applicants HT005 - Shortlist End*/
/*Manage User Page Start*/
.eq-justify-content{
display: flex;
justify-content: space-between;
}
.manage-user-left {float: left;width: 71.695%;}
.manage-user-right {
background-color: #4e5258;
float: left;
margin-left: 2.2%;
margin-top: 83px;
padding: 30px;
width: 26%;
}
.user-list-row:last-child{
margin-bottom: 0;
}
.select2-container--disabled .select2-selection--single .select2-selection__arrow b{
display: none;
}
.main-manage-userlist{float: left;width: 100%;}
.user-list-row{
background: #fff none repeat scroll 0 0;
display: inline-block;
width: 100%;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 15px;
}
.m-user-left{
float: left;
width: 78%;
padding: 18px 26px;
}
.m-user-right{
float: right;
width: 22%;
padding: 15px 17px;
}
.m-user-icon,.m-user-info{
float: left;
}
.m-user-icon{
margin-right: 16px;
}
.m-user-name {
font-size: 20px;
}
.m-user-email{
color: #7d7f82;
font-size: 12px;
text-transform: uppercase;
}
.m-save-user{
padding: 15px 26px;
float: left;
width: 80%;
}
.m-save-user input {
display: inline-block;
margin-right: 5px;
width: 30%;
}
.save-button{
float: right;
padding: 17px 17px;
}
.btn.btn-save {
background-color: #67b413;
border-radius: 100px;
color: #ffffff;
font-size: 12px;
font-weight: 500;
height: 45px;
letter-spacing: 1px;
width: 100px;
}
.resend-link a{
font-size: 12px;
text-align: left;
color: #4990e2;
text-decoration: underline;
}
.resend-link {
background-color: #fafafa;
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.02);
display: inline-block;
padding: 15px 80px;
width: 100%;
}
.manage-user-right label{
color: #ffffff;
font-weight: 400;
}
.manage-user-right .form-group {
margin-bottom: 11px;
}
.sidebar-title {
color: #ffffff;
font-size: 20px;
font-weight: 500;
margin-bottom: 30px;
}
.invite-btn {
float: right;
margin-top: 12px;
}
.btn.btn-invite{
background-color: #03a0e7;
border-radius: 100px;
color: #ffffff;
font-size: 12px;
font-weight: 500;
height: 45px;
letter-spacing: 1px;
width: 100px;
}
.invite-combo{
text-align: center;
}
/*Manage User Page End*/
/*popup message*/ /*popup message*/
.main-popup .modal-body{padding: 50px 45px 44px;text-align: center;} .main-popup .modal-body{padding: 50px 45px 44px;text-align: center;}
.popup-message-txt {margin: 24px 0 36px;line-height: 23px;} .popup-message-txt {margin: 24px 0 36px;line-height: 23px;}
...@@ -3904,7 +4197,7 @@ img.alert-icon {float: left;} ...@@ -3904,7 +4197,7 @@ img.alert-icon {float: left;}
@media screen and (max-width: 1540px){ @media screen and (max-width: 1540px){
.search-bar {width: 54.25%;} .search-bar {width: 54.25%;}
.fl-right {width: 29.3%;} .fl-right {width: 29.3%;}
.main-applicant-content {width: 80.3%;} /*.main-applicant-content {width: 80.3%;}*/
.applicant-sidebar li a{font-size: 13px;padding: 0 8px;} .applicant-sidebar li a{font-size: 13px;padding: 0 8px;}
.applicant-sidebar .gray,.applicant-sidebar .green,.applicant-sidebar .blue {font-size: 14px;} .applicant-sidebar .gray,.applicant-sidebar .green,.applicant-sidebar .blue {font-size: 14px;}
.applicant-sidebar li {line-height: 46px;} .applicant-sidebar li {line-height: 46px;}
...@@ -3912,16 +4205,21 @@ img.alert-icon {float: left;} ...@@ -3912,16 +4205,21 @@ img.alert-icon {float: left;}
.appli-label {font-size: 13px;line-height: 24px;} .appli-label {font-size: 13px;line-height: 24px;}
.expand-box{margin-left: 15px;} .expand-box{margin-left: 15px;}
.big-percentage{font-size: 58px;} .big-percentage{font-size: 58px;}
.appli-percent-no{padding-right: 25px;} .appli-percent-no{font-size: 28px; line-height: 1.8em;}
.appli-jcs{font-size: 10px;padding: 26px 15px 5px;} .appli-jcs{font-size: 10px;padding: 26px 15px 5px; width: 13.5%;}
.appli-jcs2{font-size: 10px;padding: 26px 15px 5px;}
.appli-list-name{font-size: 18px;} .appli-list-name{font-size: 18px;}
.appli-status{padding: 15px 0 0 12px;width: 28.8%;} .appli-status{padding: 15px 0 0 12px; }
.appli-overall{width: 17%;}
.company-pro-logo {margin: 9% 0 2.6%;}
.tabing-sidebar .nav-tabs > li > a{padding-left: 30px;}
} }
@media screen and (max-width: 1480px){ @media screen and (max-width: 1480px){
.search-bar {width: 53.25%;} .search-bar {width: 53.25%;}
.site-logo { padding: 16.5px 15px 13.5px 23px;} .site-logo { padding: 16.5px 15px 13.5px 23px;}
.rate-toggle {width: 78%;} .rate-toggle {width: 78%;}
.d-three-box{padding: 20px 15px;} .d-three-box{padding: 20px 15px;}
.job-post{padding-left: 15px;} .job-post{padding-left: 15px;}
.job-application{padding-left: 20px;} .job-application{padding-left: 20px;}
...@@ -3930,16 +4228,23 @@ img.alert-icon {float: left;} ...@@ -3930,16 +4228,23 @@ img.alert-icon {float: left;}
.job-post-name {font-size: 18px;margin-bottom: 10px;} .job-post-name {font-size: 18px;margin-bottom: 10px;}
.calendar{font-size: 12px;} .calendar{font-size: 12px;}
.superlaw{margin-right: 8px;} .superlaw{margin-right: 8px;}
.company-pro-logo {margin: 9% 0 2.2%;}
} }
@media screen and (max-width: 1440px){ @media screen and (max-width: 1440px){
.fl-right {width: 30.5%;} .fl-right {width: 30.5%;}
.d-three-box{padding: 20px 15px;border-width: 7px;top: 10px;} .d-three-box{padding: 32px 15px;border-width: 7px;top: 10px; bottom: 0;}
.arrow-btn{margin-top: 25px;} .arrow-btn{margin-top: 25px;}
.empty-area{margin-top: 25px;}
.week-states{margin-top: 20px;} .week-states{margin-top: 20px;}
.dash-count {font-size: 48px;} .dash-count {font-size: 48px;}
.welcome-text {font-size: 30px;} .welcome-text {font-size: 30px;}
.appl-c-box{margin: 0 0.3%;} .appl-c-box{margin: 0.3% 0.3%;}
.tabing-sidebar .nav-tabs > li > a {padding-left: 24px;}
.thr-block{padding: 0 15px 15px;}
} }
@media screen and (max-width: 1380px){ @media screen and (max-width: 1380px){
...@@ -3952,7 +4257,7 @@ img.alert-icon {float: left;} ...@@ -3952,7 +4257,7 @@ img.alert-icon {float: left;}
.facebook-icon {width: 12.73%;} .facebook-icon {width: 12.73%;}
.shape-icon{width: 13.73%; } .shape-icon{width: 13.73%; }
.more-icon {width: 13.3%;} .more-icon {width: 13.3%;}
.appl-c-box{margin: 0 0.2%;} .appl-c-box{margin: 0.2% 0.2%;}
.over-all.f-60 {font-size: 54px;} .over-all.f-60 {font-size: 54px;}
.appli-list-drop{width: 145px;} .appli-list-drop{width: 145px;}
.appli-view-bar{margin-bottom: 5.5px;} .appli-view-bar{margin-bottom: 5.5px;}
...@@ -3971,6 +4276,9 @@ img.alert-icon {float: left;} ...@@ -3971,6 +4276,9 @@ img.alert-icon {float: left;}
.message-common {padding: 20px 28px 20px 25px;} .message-common {padding: 20px 28px 20px 25px;}
.message-txt{margin-left: 18px;} .message-txt{margin-left: 18px;}
.main-applicant-content {width: 100%;} .main-applicant-content {width: 100%;}
.thr-block {padding: 0 10px 10px;}
.admin-notes{padding: 16px 21px 28px;}
} }
@media screen and (max-width: 1350px){ @media screen and (max-width: 1350px){
...@@ -3979,14 +4287,18 @@ img.alert-icon {float: left;} ...@@ -3979,14 +4287,18 @@ img.alert-icon {float: left;}
.rate-toggle {width: 80%;} .rate-toggle {width: 80%;}
.work-rating {font-size: 12px;} .work-rating {font-size: 12px;}
.make-payment-tab li a{width: 300px;} .make-payment-tab li a{width: 300px;}
.appli-percent-no {padding-right: 18px;font-size: 28px;} .appli-jcs {font-size: 9px;padding: 26px 10px 0; width: 12%;}
.appli-jcs {font-size: 9px;padding: 26px 10px 0;} .appli-jcs2 {font-size: 9px;padding: 26px 10px 0; width: 18%;}
.jcc{padding: 0 8px;} .jcc{padding: 0 8px;}
.jcc span{font-size: 18px;} .jcc span{font-size: 18px;}
.jcc img {margin-right: 5px;} .jcc img {margin-right: 5px;}
.cb-title{font-size: 15px;padding: 12.5px 13px;} .cb-title{font-size: 15px;padding: 12.5px 13px;}
.main-job-match-area {padding: 40px 10.4% 44px;} .main-job-match-area {padding: 40px 10.4% 44px;}
.main-applicant-content {width: 100%;} .main-applicant-content {width: 100%;}
.text-dot-dot{width: 75%;}
.admin-br-line{margin: 18px 0 17px;}
.appli-overall{width: 19%;}
} }
@media screen and (max-width: 1280px){ @media screen and (max-width: 1280px){
...@@ -3996,9 +4308,12 @@ img.alert-icon {float: left;} ...@@ -3996,9 +4308,12 @@ img.alert-icon {float: left;}
.d-create-job-btn {height: 38px;line-height: 38px;margin-top: 25px;padding: 0 30px;} .d-create-job-btn {height: 38px;line-height: 38px;margin-top: 25px;padding: 0 30px;}
.arrow-btn{height: 38px;line-height: 38px;padding-left: 15px;} .arrow-btn{height: 38px;line-height: 38px;padding-left: 15px;}
.arrow-btn:before {right: 12px;height: 38px;} .arrow-btn:before {right: 12px;height: 38px;}
.empty-area {height: 38px;line-height: 38px;padding-left: 15px;}
.appli-name {font-size: 24px;} .appli-name {font-size: 24px;}
.main-applicant-content {width: 100%;} .main-applicant-content {width: 100%;}
.applicant-sidebar{width: 20.65%;} .applicant-sidebar{width: 20.65%;}
.tabing-sidebar .nav-tabs > li > a {padding-left: 15px;}
} }
@media screen and (max-width: 1278px){ @media screen and (max-width: 1278px){
.main-pack-type li {float: left;margin: 0 7.5px 15px;width: 47%;} .main-pack-type li {float: left;margin: 0 7.5px 15px;width: 47%;}
...@@ -4041,6 +4356,7 @@ img.alert-icon {float: left;} ...@@ -4041,6 +4356,7 @@ img.alert-icon {float: left;}
.arrow-btn{font-size: 9px;} .arrow-btn{font-size: 9px;}
.arrow-btn {height: 32px;line-height: 32px;padding-left: 12px;} .arrow-btn {height: 32px;line-height: 32px;padding-left: 12px;}
.arrow-btn:before {right: 9px;height: 32px;} .arrow-btn:before {right: 9px;height: 32px;}
.empty-area {height: 32px;line-height: 32px;padding-left: 12px;}
.week-states {font-size: 13px;margin-top: 15px;} .week-states {font-size: 13px;margin-top: 15px;}
.job-application{padding-left: 15px;} .job-application{padding-left: 15px;}
.job-shortlisted{padding-left: 15px} .job-shortlisted{padding-left: 15px}
...@@ -4083,6 +4399,7 @@ img.alert-icon {float: left;} ...@@ -4083,6 +4399,7 @@ img.alert-icon {float: left;}
.appli-list-name{width: 18.5%;} .appli-list-name{width: 18.5%;}
.appli-list-drop {width: 130px;} .appli-list-drop {width: 130px;}
.appli-jcs {font-size: 8px;} .appli-jcs {font-size: 8px;}
.appli-jcs2 {font-size: 8px;}
.appli-list-name {padding: 26px 0 0 8px;} .appli-list-name {padding: 26px 0 0 8px;}
.jcc{font-size: 8px;line-height: 34px;} .jcc{font-size: 8px;line-height: 34px;}
.jcc span {font-size: 16px;} .jcc span {font-size: 16px;}
...@@ -4116,6 +4433,23 @@ img.alert-icon {float: left;} ...@@ -4116,6 +4433,23 @@ img.alert-icon {float: left;}
.slick-arrow img{width: 8px;} .slick-arrow img{width: 8px;}
.sl_width.slider-next.slick-arrow{right: -4%;} .sl_width.slider-next.slick-arrow{right: -4%;}
.sl_width.slider-prev.slick-arrow{left: -4%;} .sl_width.slider-prev.slick-arrow{left: -4%;}
.main-company-profile {margin: 50px auto 0;width: 60%;}
.company-pro-logo {margin: 10% 0 3.2%;}
.main-compony-section {padding: 40px 45px 15px;}
.m-user-left {padding: 18px;width: 70%;}
.m-user-right{width: 30%;}
.m-save-user{width: 75%;}
.resend-link{padding: 15px 70px;}
.manage-user-right{margin-top: 75px;padding: 20px;}
.main-sign-up {width: 44.5%;}
.tabing-sidebar .nav-tabs > li > a {font-size: 12px;padding:12px 0 12px 10px;}
.tabing-sidebar .nav-tabs > li.active > a:focus, .tabing-sidebar .nav-tabs > li.active > a:hover, .tabing-sidebar .nav-tabs > li.active > a{font-size: 12px;}
.tabpage-title {font-size: 18px;}
.tabing-sidebar {padding: 36px 0 0 18px;}
} }
@media screen and (max-width: 1080px){ @media screen and (max-width: 1080px){
...@@ -4173,6 +4507,7 @@ img.alert-icon {float: left;} ...@@ -4173,6 +4507,7 @@ img.alert-icon {float: left;}
.cb-title {font-size: 16px;padding: 12.5px 10px;} .cb-title {font-size: 16px;padding: 12.5px 10px;}
.appli-list-name {border-right: medium none;width: 93%;border-bottom: 1px solid rgba(229, 232, 235, 0.5); padding: 15px 0 0 8px;} .appli-list-name {border-right: medium none;width: 93%;border-bottom: 1px solid rgba(229, 232, 235, 0.5); padding: 15px 0 0 8px;}
.appli-jcs{width: 20.33%;padding: 26px 10px 15px;} .appli-jcs{width: 20.33%;padding: 26px 10px 15px;}
.appli-jcs2{width: 30.33%;padding: 26px 10px 15px;}
.appli-status{width: 36%;} .appli-status{width: 36%;}
.appli-checkbox{border-bottom: 1px solid rgba(229, 232, 235, 0.5);padding: 15px 0 0;width: 7%;} .appli-checkbox{border-bottom: 1px solid rgba(229, 232, 235, 0.5);padding: 15px 0 0;width: 7%;}
.appli-filter > ul {padding-right: 0;} .appli-filter > ul {padding-right: 0;}
...@@ -4196,6 +4531,21 @@ img.alert-icon {float: left;} ...@@ -4196,6 +4531,21 @@ img.alert-icon {float: left;}
.left-s-label div, .right-s-label div{height: 36px;} .left-s-label div, .right-s-label div{height: 36px;}
span.left-s-label{margin-right: 0;} span.left-s-label{margin-right: 0;}
span.right-s-label{margin-left: 0;} span.right-s-label{margin-left: 0;}
.main-company-profile {width: 70%;}
.eq-justify-content {display: inline-block;justify-content: unset;}
.manage-user-left {width: 100%;}
.manage-user-right {margin-left: 0;margin-top: 20px;padding: 20px;width: 100%;margin-bottom: 20px;}
.main-sign-up {width: 66%;}
.company-content-area {padding: 6.3% 5.3% 6.1%;}
.tabing-sidebar {padding: 30px 0 0;}
.prev-btn {left: -18px;}
.next-btn {right: -18px;}
} }
@media screen and (max-width: 980px){ @media screen and (max-width: 980px){
...@@ -4382,6 +4732,10 @@ img.alert-icon {float: left;} ...@@ -4382,6 +4732,10 @@ img.alert-icon {float: left;}
.pagination.ratting-number.ipsative-rating > li > a, .pagination.ratting-number.ipsative-rating > li > span{width: 20%;} .pagination.ratting-number.ipsative-rating > li > a, .pagination.ratting-number.ipsative-rating > li > span{width: 20%;}
.ips-box {margin-bottom: 0;} .ips-box {margin-bottom: 0;}
.left-s-label div, .right-s-label div {height: auto;} .left-s-label div, .right-s-label div {height: auto;}
.main-company-profile {margin: 40px auto 0;padding: 0 15px;width: 100%;}
.hello-company-name {font-size: 18px;}
.main-invite-friend {padding: 35px 30px 25px;}
} }
@media screen and (max-width: 750px){ @media screen and (max-width: 750px){
...@@ -4426,13 +4780,24 @@ img.alert-icon {float: left;} ...@@ -4426,13 +4780,24 @@ img.alert-icon {float: left;}
.box-btn{font-size: 13px;width: 100%;padding: 0;} .box-btn{font-size: 13px;width: 100%;padding: 0;}
.pl-verify{font-size: 12px;} .pl-verify{font-size: 12px;}
.verify-i-setpone label{font-size: 12px;margin-bottom: 8px;} .verify-i-setpone label{font-size: 12px;margin-bottom: 8px;}
.main-sign-up {width: 90%;}
} }
@media screen and (max-width: 600px){ @media screen and (max-width: 600px){
.ratting-box{padding: 23px 0;} .ratting-box{padding: 23px 0;}
.ratting-box span {margin: 0 4px;} .ratting-box span {margin: 0 4px;}
.section-c-title{font-size: 18px;} .section-c-title{font-size: 18px;}
.m-save-user {width: 100%;padding: 15px 15px 0;}
.m-save-user input {display: inline-block;margin: 0 0 10px;width: 100%;}
.m-user-left {padding: 15px;width: 100%;}
.m-user-right {width: 100%;padding: 0 15px 15px;}
.manage-user-left .jobs-list-shorting{margin-bottom: 20px;}
.m-user-name {font-size: 18px;}
.m-user-email {font-size: 11px;}
.m-user-icon {margin-right: 12px;}
.resend-link {padding: 15px 0;text-align: center;}
} }
@media screen and (max-width: 580px){ @media screen and (max-width: 580px){
...@@ -4467,6 +4832,12 @@ img.alert-icon {float: left;} ...@@ -4467,6 +4832,12 @@ img.alert-icon {float: left;}
.job-filter{margin-top: 18px;} .job-filter{margin-top: 18px;}
.share-link {border-bottom: 1px solid #eeeef0;width: 100%;} .share-link {border-bottom: 1px solid #eeeef0;width: 100%;}
.share-btn,.linkdin-icon,.facebook-icon,.shape-icon,.more-icon{width: 20%;} .share-btn,.linkdin-icon,.facebook-icon,.shape-icon,.more-icon{width: 20%;}
.hello-company-name {font-size: 16px;}
.company-pro-logo {margin: 10% 0 6.2%;}
.main-compony-section {padding: 35px 30px 10px;}
.up-rep-btn {margin-top: 15px;position: relative;top: 0;}
.u-img-tag{margin-right: 0;}
} }
@media screen and (max-width: 480px){ @media screen and (max-width: 480px){
...@@ -4506,6 +4877,13 @@ img.alert-icon {float: left;} ...@@ -4506,6 +4877,13 @@ img.alert-icon {float: left;}
.main-pack-type li {width: 74%;} .main-pack-type li {width: 74%;}
.ratting-box span.left-s-label{width: 105px;} .ratting-box span.left-s-label{width: 105px;}
.ratting-box span.right-s-label{width: 105px;} .ratting-box span.right-s-label{width: 105px;}
.main-company-profile {margin: 30px auto 0;}
.btn-b-225{height: 45px;line-height: 45px;}
.box-bg-color{padding: 30px;}
.col-2 {margin-left: 0;margin-right: 0;width: 100%;}
.col-row {margin-left: 0;margin-right: 0;}
.u-img-tag{width: 100%;height: auto;}
} }
@media screen and (max-width: 360px){ @media screen and (max-width: 360px){
.payment-title {font-size: 14px;} .payment-title {font-size: 14px;}
...@@ -4534,7 +4912,10 @@ img.alert-icon {float: left;} ...@@ -4534,7 +4912,10 @@ img.alert-icon {float: left;}
} }
@media screen and (max-width: 320px){ @media screen and (max-width: 320px){
.verify-i-title {font-size: 13px;} .verify-i-title {font-size: 13px;}
.tabing-sidebar .nav-tabs > li > a {font-size: 10px;padding: 10px 0 10px 5px;}
.tabing-sidebar .nav-tabs > li.active > a:focus, .tabing-sidebar .nav-tabs > li.active > a:hover, .tabing-sidebar .nav-tabs > li.active > a {font-size: 10px;}
.tabing-sidebar {padding: 13px 0 0;}
} }
.footer{ .footer{
...@@ -4665,4 +5046,512 @@ label, label .label-title span { ...@@ -4665,4 +5046,512 @@ label, label .label-title span {
.estimated-time span { .estimated-time span {
font-family: "Usual-Bold"; font-family: "Usual-Bold";
}
.smile-face{
position: absolute;
width: 30.2px;
margin-left: 8px;
font-size: 26px;
}
.smaller-face{
width: 20.2px;
}
.mob-smile-face{
position: absolute;
width: 16.2px;
margin-left: 8px;
font-size: 26px;
}
.btn-gotojob {
border-radius: 100px !important;
}
.empty-area {
display: inline-block;
height: 45px;
line-height: 45px;
width: 100%;
position: relative;
margin-top: 44px;
}
.job-main-tabs {
max-width: 1300px;
}
/* Start of Clients HT010 */
.add-client-btn{
margin-left:40px;
}
.client-list {
background: #fff none repeat scroll 0 0;
display: inline-block;
width: 100%;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 10px;
height:80px;
}
.application-count{
width:10%;
padding: 11px 15px 17px 50px;
border-right: solid 1px rgba(229, 232, 235, 0.5);
color: #7d7f82;
font-size: 30px;
font-weight: 300;
font-family: "Usual-Light";
}
.application-count .grey-span{
letter-spacing: 1px;
color: #8e97a0;
font-size: 11px;
font-weight: 500;
width: 100%;
float: left;
font-family: "Usual-Medium";
text-transform: uppercase;
}
.client-name-cell{
width:60%;
padding-left: 39px;
padding-top: 25px;
padding-bottom: 25px;
border-right: solid 1px rgba(229, 232, 235, 0.5);
color: #1a2531;
}
.client-name{
text-align: left;
font-size: 20px;
}
.opaque-jobcount{
opacity: 0.5;
}
/* End of Clients HT010 */
/*Client edit*/
.client-form-area {
background-color: #ffffff;
display: inline-block;
padding: 7.8% 7.8% 6.1%;
width: 100%;
}
.client-form-area label{
font-weight: normal;
margin-bottom: 7px;
}
.client-update-btn{
margin-bottom: 0;
clear: both;
}
.client-update-btn input.btn.btn-primary {
margin-top: 3.1%;
}
.main-upload-logo span{
display: inline-block;
vertical-align: middle;
}
.upload-img-w-h{}
.u-img-tag{
border: 1px dashed #dbdbdf;
border-radius: 2px;
width: 315px;
height: 94px;
position: relative;
margin-right: 17px;
}
.up-rep-btn {
position: relative;
top: -3px;
}
.up-rep-btn a {
border: 1px solid #8e97a0;
border-radius: 100px;
color: #8e97a0;
font-size: 9px;
font-weight: 500;
letter-spacing: 0.8px;
padding: 7px 15px;
text-transform: uppercase;
}
.remove-logo-btn {
background: #fff none repeat scroll 0 0;
border: 1px solid #8e97a0;
border-radius: 100px;
height: 28px;
line-height: 24px;
position: absolute;
right: -14px;
text-align: center;
top: 50%;
transform: translateY(-50%);
width: 28px;
z-index: 1;
}
.client-form-area label
{
font-family: "Usual-Regular";
}
.client-form-area .fileLink
{
display: none;
}
/*Client edit end*/
/*My Company Pages*/
.tabs-left>li, .tabs-right>li {
float: none;
}
.tabing-sidebar .nav > li > a{
font-size: 13px;
color: #ffffff;
}
.tabing-sidebar .nav-tabs > li{
margin-bottom: 0;
}
.tabing-sidebar .nav-tabs{
border: 0;
}
.tabing-sidebar .nav-tabs > li > a{
margin-right: 0;
border: 0;
padding: 16px 0 16px 36px;
}
.tabing-sidebar .nav > li > a:focus,.tabing-sidebar .nav > li > a:hover{
background: none;
border: 0;
}
.tabing-sidebar .nav-tabs > li.active > a:focus,.tabing-sidebar .nav-tabs > li.active > a:hover,.tabing-sidebar .nav-tabs > li.active > a{
border-radius: 3px 0 0 3px;
background-color: rgba(245, 247, 248, 0.15);
font-size: 13px;
font-weight: bold;
border: 0;
color: #fff;
}
.my-company-area {
background: #fff none repeat scroll 0 0;
float: left;
width: 100%;
}
.tabing-sidebar {
float: left;
width: 20.618%;
background-color: #4e5258;
padding: 48px 0 0 20px;
}
.company-content-area {
float: right;
padding: 6.3% 8.3% 6.1%;
width: 79.382%;
}
.tabpage-title{
font-size: 20px;
font-weight: 700;
margin-bottom: 6%;
}
.company-content-area label {
font-weight: normal;
}
.company-content-area label
{
font-family: "Usual-Regular";
}
.company-content-area .fileLink
{
display: none;
}
/*My Company Pages End*/
/*My Details Pages*/
.notification-popup{
border-radius: 2px;
background-color: #ffffff;
box-shadow: 0 0 30px 5px rgba(0, 0, 0, 0.2);
border: 1px solid #e8e8eb;
border-top: 5px solid #f6a623;
width: 300px;
margin: 0 auto;
text-align: center;
padding: 0;
padding: 15px;
}
.notification-popup h2{
font-size: 24px;
color: #f6a623;
margin: 38px 0 22px;
}
.notification-popup p {
font-size: 15px;
font-weight: 300;
line-height: 1.53;
text-align: center;
color: #4a4a4a;
padding: 0 28px;
font-family: "Usual-Light";
}
.save-my-details{
width: 100%;
padding: 27px 0;
}
.save-my-details-btn{
border-radius: 100px;
min-width: 120px;
padding: 13px 0;
}
.btn.btn-primary.btn-orange{
background-color: #f5a623;
border-color: #f5a623;
}
.btn.btn-primary.btn-orange:hover{
background-color: #f5a623;
border-color: #f5a623;
}
.close-popup-btn{
float: right;
}
.email-verify{
text-align:right;
font-size: 12px;
margin-bottom: 25px;
width:100%;
margin-top:5px;
}
.email-verify-link
{
color: #03a0e7;
text-decoration: underline;
}
/*My Details Pages End*/
.hire-the-right-candi {
height: 75px;
font-family: Usual-Medium;
font-size: 20px;
font-weight: 500;
text-align: center;
color: #4a4a4a;
}
.main-user-invite {
display: inline-block;
width: 100%;
background: #eff0f2;
margin-bottom: 17px;
position: relative;
font-family: "Usual-Light";
font-size: 14px;
}
.delete-company-user{
width: 28px;
height: 28px;
background-color: #ffffff;
border: solid 2px #9b9b9b;
position: absolute;
right: -14px;
top: 22%;
border-radius: 100px;
text-align: center;
cursor: pointer;
}
.delete-company-user span{
display: inline-block;
width: 12px;
border: solid 1px #8e97a0;
position: relative;
top: -2px;
}
.content-to-center {
text-align: center;
}
.hello-company-name{
height: 75px;
color: #4a4a4a;
font-weight: 500;
font-size: 20px;
}
.main-company-profile {
margin: 60px auto 0;
width: 47.009%;
}
.main-compony-section{
display: inline-block;
width: 100%;
padding: 45px 50px 20px;
}
.company-radio-btn .form-group{
margin-bottom: 20px;
}
.company-profile-btn input.btn.btn-primary{
width: 280px;
}
.company-profile-btn {
border-top: 1px solid #ededef;
padding: 45px 0 25px;
margin-bottom: 55px;
}
.company-select-box label{
margin: 0 0 10px;
}
.set-margin-space{
margin-top: 27px;
}
.company-radio-btn .radio label{
padding-left: 10px;
}
.hello-company-name{
color: #4a4a4a;
font-weight: 500;
font-size: 20px;
}
.main-company-pro-logo {
text-align: center;
}
.company-pro-logo {
margin: 11% 0 2.9%;
}
.main-invite-friend{
display: inline-block;
width: 100%;
padding: 59px 50px 46px;
}
.main-invite-friend .form-group{
margin-bottom: 20px;
position: relative;
}
.add-input-box{
text-align: center;
margin-top: 5px;
display: inline-block;
width: 100%;
}
.remove-input-field {
width: 28px;
height: 28px;
background-color: #ffffff;
border: solid 2px #9b9b9b;
position: absolute;
right: -14px;
top: 50%;
border-radius: 100px;
text-align: center;
cursor: pointer;
transform: translateY(-50%);
}
.remove-input-field span {
display: inline-block;
width: 12px;
border: solid 1px #8e97a0;
position: relative;
top: -2px;
}
.add-more-input-field {
cursor: pointer;
letter-spacing: 1px;
color: #ffffff;
font-size: 11px;
font-weight: 500;
border-radius: 100px;
background-color: #667281;
display: inline-block;
min-height: 45px;
line-height: 45px;
padding: 0 23.37px;
text-transform: uppercase;
}
.add-more-input-field img {
margin-right: 6px;
position: relative;
top: -1px;
}
.no-height{
height: 0;
}
input{
font-family: "Usual-Light";
}
.text-justify{
font-family: "Usual-Light";
text-align: justify;
}
.detail-tab-row{
float: left;
height: 45px;
width: 100%;
border-bottom: solid 1px #e3e3e3;
}
.detail-tab-row-title {
width: 40%;
height: 12px;
font-family: "Usual-Regular";
font-size: 10px;
letter-spacing: 0.9px;
text-align: left;
color: #4e5258;
padding: 16px 30px;
float: left;
text-transform: uppercase;
}
.detail-tab-row-text {
width: 60%;
height: 12px;
font-family: "Usual-Regular";
font-size: 10px;
line-height: 1.17;
text-align: left;
color: #7d7f82;
padding: 16px;
float: left;
} }
\ No newline at end of file
...@@ -17,22 +17,24 @@ ...@@ -17,22 +17,24 @@
<%@ include file="setuprequest.jsp" %> <%@ include file="setuprequest.jsp" %>
<% <%
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL)) if(WebUtils.showHeaderFooter(objTran, article))
{ {
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{
%> %>
<%@ include file="extensions/adminportal/inc/htmlheader.jsp" %> <%@ include file="extensions/adminportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/adminportal/inc/menuinclude.jsp" %> <%@ include file="extensions/adminportal/inc/menuinclude.jsp" %>
<% <%
} }
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL)) else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{ {
%> %>
<%@ include file="extensions/applicantportal/inc/htmlheader.jsp" %> <%@ include file="extensions/applicantportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %> <%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %>
<% <%
}
} }
Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article)) Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article))
.mapEntry("StartLevel", new Integer (0)) .mapEntry("StartLevel", new Integer (0))
.mapEntry("EndLevel", new Integer (0)) .mapEntry("EndLevel", new Integer (0))
...@@ -41,12 +43,15 @@ ...@@ -41,12 +43,15 @@
%> %>
<oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/> <oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/>
<% <%
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL)) if(WebUtils.showHeaderFooter(objTran, article))
{
%><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{ {
%><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><% if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{
%><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{
%><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><%
}
} }
%> %>
\ No newline at end of file
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
<DECORATOR id="auth" factory="MetaComponent" component="AdminPortalAuthDecorator" priv="TL_AccessAdminPortal"/> <DECORATOR id="auth" factory="MetaComponent" component="AdminPortalAuthDecorator" priv="TL_AccessAdminPortal"/>
</NODE> </NODE>
<NODE name="NavBarSkinConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig"> <NODE name="NavBarSkinConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig">
<format item="LI_A_Selected_Menu.level0.section.entry | <format item="LI_A_Selected_Menu.level0.section.entry |
LI_A_Selected_Menu.level0.article.entry"><![CDATA[${BracklineSeparator:<span class="brack-line"></span>}<li class="${selected:active}"><a class="${position} ${attrib:Additional CSS Class}" href="${link}" ${isTarget:target="?"}><span class="${attrib:Menu Icon CSS}"></span>${divsOpen}${attrib:Menu Title|title}${divsClose}</a></li>]]></format> LI_A_Selected_Menu.level0.article.entry"><![CDATA[${BracklineSeparator:<span class="brack-line"></span>}<li class="${selected:active}${MenuItemDisable:disabled}"><a class="${position} ${attrib:Additional CSS Class}" href="${link}" ${isTarget:target="?"}><span class="${attrib:Menu Icon CSS}"></span>${divsOpen}${attrib:Menu Title|title}${divsClose}</a></li>]]></format>
</NODE> </NODE>
<NODE name="AdminPortalAuthDecorator" factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator"> <NODE name="AdminPortalAuthDecorator" factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator">
...@@ -31,6 +32,25 @@ ...@@ -31,6 +32,25 @@
<FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/> <FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/>
<FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/> <FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/>
<FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/> <FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/>
<FORM name="*.verifyCompanyUser" factory="Participant" class="performa.form.VerifyCompanyUserFP">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
</FORM>
<FORM name="*.sendCompanyUserInvites" factory="Participant" class="performa.form.SendCompanyUserInvitesFP">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
<InvitationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="InvitationMail"/>
</FORM>
<FORM name="*.sendUserInvites" factory="Participant" class="performa.form.SendUserInvitationFP">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
<InvitationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="InvitationMail"/>
</FORM>
<FORM name="*.saveUserDetails" factory="Participant" class="performa.form.SaveUserDetailsFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="EmailChangedMail"/>
</FORM>
<FORM name="*.resendVerification" factory="Participant" class="performa.form.ResendVerificationFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="EmailChangedMail"/>
</FORM>
<FORM name="*.saveClient" factory="Participant" class="performa.form.SaveClientFP"/>
<FORM name="*.saveCompany" factory="Participant" class="performa.form.SaveCompanyFP"/>
</NODE> </NODE>
<NODE name="job_assessment_criteria_add_jsp" factory="Participant"> <NODE name="job_assessment_criteria_add_jsp" factory="Participant">
...@@ -49,6 +69,40 @@ ...@@ -49,6 +69,40 @@
<NODE name="nonExistErrorMessage" factory="String" value="Please enter a value for password"/> <NODE name="nonExistErrorMessage" factory="String" value="Please enter a value for password"/>
</PARSER> </PARSER>
</FORM> </FORM>
<FORM name="*.facebookOAuthLogin" factory="Participant" class="oneit.security.oauth.form.FacebookOAuthLoginFP"/>
<FORM name="*.googleOAuthLogin" factory="Participant" class="oneit.security.oauth.form.GoogleOAuthLoginFP"/>
<FORM name="*.linkedinOAuthLogin" factory="Participant" class="performa.form.LinkedInOAuthLoginFP"/>
</NODE>
<NODE name="forgot_password_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
<FORM name="*.forgotPassword" factory="Participant" class="performa.form.ForgotPasswordFP">
<ResetCodeEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="ResetCodeEmail"/>
</FORM>
</NODE>
<NODE name="reset_password_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
<FORM name="*.resetPassword" factory="Participant" class="performa.form.ResetPasswordFP"/>
</NODE>
<NODE name="reset_password_sent_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE>
<NODE name="sign_up_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
<FORM name="*.send" factory="Participant" class="performa.form.SendVerificationMailFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="CompanyAccountVerificationMail"/>
</FORM>
</NODE>
<NODE name="invite_user_add_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE>
<NODE name="email_verified_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE> </NODE>
<NODE name="ORMErrorConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig"> <NODE name="ORMErrorConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig">
...@@ -60,4 +114,29 @@ ...@@ -60,4 +114,29 @@
<format item="form.*.pageHeader_notifyPrefix"><![CDATA[<div class="success-message message-common"><img src="images/success-alert.png" class="alert-icon" /><span class="message-txt">]]></format> <format item="form.*.pageHeader_notifyPrefix"><![CDATA[<div class="success-message message-common"><img src="images/success-alert.png" class="alert-icon" /><span class="message-txt">]]></format>
<format item="form.*.pageHeader_notifySuffix"><![CDATA[</span></div>]]></format> <format item="form.*.pageHeader_notifySuffix"><![CDATA[</span></div>]]></format>
</NODE> </NODE>
<NODE name="SetupUserHelper" factory="Participant" class="performa.utils.PerformaSetupUserHelper"/>
<NODE name="DecoratorFilter::ADMIN_PORTAL">
<DECORATOR factory="Participant" class="performa.utils.PerformaOAuthCallbackDecorator">
<NODE name="servicesFactory" factory="ConfigMgr" system="CONFIG.GLOBAL" paramname="TransactionServices" />
<Handler name="/facebookCallback" factory="Participant" class="oneit.security.oauth.utils.FacebookOAuthLoginHandler">
<NODE name="helper" factory="Named" nodename="SetupUserHelper"/>
<NODE name="serviceName" factory="String" value="FACEBOOK"/>
</Handler>
<Handler name="/googleCallback" factory="Participant" class="oneit.security.oauth.utils.GoogleOAuthLoginHandler">
<NODE name="helper" factory="Named" nodename="SetupUserHelper"/>
<NODE name="serviceName" factory="String" value="GOOGLE"/>
</Handler>
<Handler name="/linkedinCallback" factory="Participant" class="performa.form.LinkedInOAuthLoginHandler">
<NODE name="helper" factory="Named" nodename="SetupUserHelper"/>
<NODE name="serviceName" factory="String" value="LINKEDIN"/>
</Handler>
</DECORATOR>
</NODE>
</OBJECTS> </OBJECTS>
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
<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/adminportal/list_clients.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/adminportal/list_clients.jsp"/>
<RenderMode name="EditClient" preIncludeJSP="extensions/adminportal/edit_client.jsp"/>
</NODE> </NODE>
</MAP> </MAP>
...@@ -83,12 +84,33 @@ ...@@ -83,12 +84,33 @@
</NODE> </NODE>
</MAP> </MAP>
<MAP value="COMPANY_ACCOUNT_VERIFICATION" description="Company Account Verification" TemplatePage="dynamic_content_form.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/verify_company.jsp"/>
<RenderMode name="CompanyProfile" preIncludeJSP="extensions/adminportal/company_profile.jsp"/>
<RenderMode name="InviteUsers" preIncludeJSP="extensions/adminportal/invite_users.jsp"/>
<RenderMode name="AuthError" preIncludeJSP="extensions/adminportal/auth_error.jsp"/>
</NODE>
</MAP>
<MAP value="MY_DETAILS" description="My Details" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/my_details.jsp"/>
</NODE>
</MAP>
</NODE> </NODE>
<NODE name="StandardJSP::AdminPortal"> <NODE name="StandardJSP::AdminPortal">
<Attribute name="Menu Icon CSS" factory="MetaComponent" component="StringAttrib" mandatory="false"/> <Attribute name="Menu Icon CSS" factory="MetaComponent" component="StringAttrib" mandatory="false"/>
<Attribute name="Add Brackline Separator" factory="MetaComponent" component="BooleanAttrib" mandatory="false"/> <Attribute name="Add Brackline Separator" factory="MetaComponent" component="BooleanAttrib" mandatory="false"/>
<Attribute name="Additional CSS Class" factory="MetaComponent" component="StringAttrib" mandatory="false"/> <Attribute name="Additional CSS Class" factory="MetaComponent" component="StringAttrib" mandatory="false"/>
<Attribute name="Allow Disable" factory="MetaComponent" component="BooleanAttrib" mandatory="false"/>
</NODE> </NODE>
<NODE name="WEB_BATCH::PERFORMA_ADMIN_PORTAL_BATCH"> <NODE name="WEB_BATCH::PERFORMA_ADMIN_PORTAL_BATCH">
......
...@@ -30,6 +30,17 @@ ...@@ -30,6 +30,17 @@
$("select[name$='AssessmentTemplate']").change(function(){ $("select[name$='AssessmentTemplate']").change(function(){
$("button[name$='loadRequirementsFromTemplate']").click(); $("button[name$='loadRequirementsFromTemplate']").click();
}); });
var showError = true;
addPostRecalcHandler (function ($fieldThatChanged) {
if(showError) {
showError = false;
$('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus();
}
recalcFunction();
});
}); });
function addCriteria(criteria) function addCriteria(criteria)
...@@ -167,7 +178,6 @@ ...@@ -167,7 +178,6 @@
requestAttribs="<%= CollectionUtils.mapEntry("Job", job) requestAttribs="<%= CollectionUtils.mapEntry("Job", job)
.mapEntry (UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE) .mapEntry (UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>" /> .toMap() %>" />
</span> </span>
</div> </div>
</oneit:recalcClass> </oneit:recalcClass>
......
<%@ 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" %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, "InviteUsers");
Company company = (Company) process.getAttribute("Company");
Boolean socialLogin = CollectionUtils.equals(process.getAttribute("socialLogin"), Boolean.TRUE);
Debug.assertion(company != null, "Invalid company user in admin portal");
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
Integer pageNumber = 1;
process.setAttribute("Company", company);
process.setAttribute("socialLogin", socialLogin);
%>
<div class="hello-company-name">Hello, <%= secUser.getFirstName() %></div>
<div class="section-tab-view">
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="active"><a href="#"><span>1</span><div>Company Profile</div></a></li>
<li><a href="#"><span>2</span><div>Invite Users</div></a></li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li>
</ul>
</div>
<oneit:form name="companyProfile" method="post" enctype="multipart/form-data">
<div class="section-page-area" style="text-align: left">
<div class="main-sc-section">
<div class="form-group">
<label><oneit:label GUIName="What type of hiring team are you?" /></label>
<%
FormTag jobForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = jobForm.getFormBuilder();
String optionKey = WebUtils.getInputKey(request, company, Company.FIELD_HiringTeamType);
String formValue = formBuilder.fieldValue (optionKey, company.getHiringTeamType() == null ? "" : company.getHiringTeamType().getName());
for(HiringTeamType hiringTeamType : HiringTeamType.getHiringTeamTypeArray())
{
boolean isSelected = CollectionUtils.equals(formValue, hiringTeamType.getName());
String hiringTeamTypeId = String.valueOf(company.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
%>
<div class="<%= "radio radio-primary workplace-radio " %>">
<input type="radio" name="<%= optionKey %>" id="<%= hiringTeamTypeId %>" class="element_rating_radio" value="<%= hiringTeamType.getName() %>" <%= selected %> >
<label for="<%= hiringTeamTypeId %>">
<oneit:toString value="<%= hiringTeamType %>" mode="EscapeHTML"/>
</label>
</div>
<%
}
%>
</div>
<div class="form-group">
<label><oneit:label GUIName="Industry" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Time zone" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
<div class="text-center company-profile-btn">
<oneit:button value="Confirm details & invite users" name="gotoPage" cssClass="btn btn-primary box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/>
</div>
</div>
</oneit:form>
</div>
</oneit:dynIncluded>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
String url = LoopbackHTTP.getRemoteAccessURL("/ApplicantPortal-ApplyJob.htm?" + "id=" + job.getID() + "&key=" + job.getRandomKey()); String url = LoopbackHTTP.getRemoteAccessURL("/ApplicantPortal-ApplyJob.htm?" + "id=" + job.getID() + "&key=" + job.getRandomKey());
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
%> %>
<script> <script>
function copyToClipboard() { function copyToClipboard() {
...@@ -33,8 +35,8 @@ ...@@ -33,8 +35,8 @@
<div class="main-created-job"> <div class="main-created-job">
<h1 class="page-title created-job-title"> <h1 class="page-title created-job-title">
Congratulations! Your job has been created Congratulations! Your job is now open
<a href="<%= url %>" id="jobURL"> <a href="<%= url %>" id="jobURL" style="display:none;">
<%= url %> <%= url %>
</a> </a>
</h1> </h1>
...@@ -49,11 +51,12 @@ ...@@ -49,11 +51,12 @@
<li class="more-icon"><a href="#"><img src="images/more-icon.png" /></a></li> <li class="more-icon"><a href="#"><img src="images/more-icon.png" /></a></li>
</ul> </ul>
</div> </div>
<div class="goto-job-btn"><a href="#">Go to Job</a></div> <p class="job-txt">
<div class="option-title">Optional: Setup Your Interview</div> This job will be open for 30 days until&nbsp;<oneit:toString value="<%= job.getApplyBy() %>" mode="PerformaDate"/>.
<p class="job-txt">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p> </p>
<div class="text-center"> <div class="text-center">
<input type="button" class="btn btn-primary top-margin-25 largeBtn" value="Set up Interview for this job" /> <oneit:button value="Go to Job" name="gotoPage" cssClass="btn btn-primary largeBtn"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>'/>
</div> </div>
<div class="space-55"></div> <div class="space-55"></div>
</div> </div>
......
<%@ 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>
<%
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Client", Client.REFERENCE_Client);
Client client = (Client) process.getAttribute("Client");
if (toRedirect)
{
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
client.setCompany(companyUser.getCompany());
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(client != null && !toRedirect, "Invalid client in admin portal edit client");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
<script>
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$("#upload").change(function(){
readURL(this);
});
$("#remove-logo").click(function(){
removeLogo();
});
});
</script>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title"><%= "Client" + (client.getClientName() != null ? " - " + client.getClientName() : "") %></h1>
<div class="client-form-area">
<oneit:form name="editClient" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Client Name" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ClientName" cssClass="form-control" />
</div>
<div class="form-group">
<label><oneit:ormlabel obj="<%= client %>" field="ClientLogo" /></label>
<div class="main-upload-logo">
<span class="u-img-tag" style="<%= client.getClientLogo() != null ? "" : "display: none" %>">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(client.getClientLogo()), "KEEP", new ScaleWithin (0,90)) %>"
class="upload-img-w-h" id="client-logo"/>
<span class="remove-logo-btn">
<img src="images/logo-remove-btn.png" id="remove-logo">
<oneit:ormInput obj="<%= client %>" type="text" attributeName="IsLogoDeleted" style="display:none;" />
</span>
</span>
<span class="up-rep-btn">
<oneit:ormInput obj="<%= client %>" type="file" attributeName="ClientLogo" accept="image/*" id="upload"
style="visibility: hidden; width: 1px; height: 1px"/>
<a href="javascript:void(0)" onclick="document.getElementById('upload').click(); return false" id="replace-btn">
<%= client.getClientLogo() != null ? "Replace" : "Upload" %>
</a>
</span>
</div>
</div>
<div class="form-brack-line-sub"></div>
<div class="form-group">
<label><oneit:ormlabel obj="<%= client %>" field="Email" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Email" cssClass="form-control" />
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="ContactName" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactName" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="ContactSurname" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactSurname" cssClass="form-control" />
</div>
</div>
<div class="form-group">
<label><oneit:ormlabel obj="<%= client %>" field="Phone" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Phone" cssClass="form-control" />
</div>
<div class="form-brack-line-sub"></div>
<div class="form-group row">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="Country" /></label>
<oneit:ormEnum obj="<%= client %>" attributeName="Country" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="State" /></label>
<oneit:ormEnum obj="<%= client %>" attributeName="State" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="PostCode" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="City" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="City" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="TimeZone"/></label>
<oneit:ormEnum obj="<%= client %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
<div class="text-center form-group">
<oneit:button value="Save Updates" name="saveClient" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
</div>
</oneit:form>
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="create-job"> <div class="create-job">
<div class="assessment-criteria"> <div class="assessment-criteria">
<div class="form-group"> <div class="form-group">
<label class="label-16">Detail</label> <label class="label-16">Details</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Job Title" /></label> <label><oneit:label GUIName="Job Title" /></label>
...@@ -42,15 +42,22 @@ ...@@ -42,15 +42,22 @@
</div> </div>
<div class="optional-title">OPTIONAL</div> <div class="optional-title">OPTIONAL</div>
<div class="row"> <div class="row">
<div class="col-sm-6 col-xs-12 form-group"> <%
<label>Client</label> SecUser txUser = SecUser.getTXUser(process.getTransaction());
<select class="form-control"> CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
<option>Australia Post</option>
<option>One 1</option> if(companyUser.getCompany().showHasClientSupport())
<option>One 2</option> {
<option>One 3</option> %>
</select> <div class="col-sm-6 col-xs-12 form-group">
</div> <label><oneit:label GUIName="Client"/></label>
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="Client" options="<%= Utils.getClientsByCompany(transaction) %>"/>
</div>
</div>
<%
}
%>
<div class="col-sm-6 col-xs-12 form-group"> <div class="col-sm-6 col-xs-12 form-group">
<label><oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" /></label> <label><oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" /></label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="ReferenceNumber" cssClass="form-control" /> <oneit:ormInput obj="<%= job %>" type="text" attributeName="ReferenceNumber" cssClass="form-control" />
......
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "email_verified_jsp"; } %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request);
//to process company user verification
String id = request.getParameter("id");
String key = request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null && key!=null)
{
CompanyUser companyUser = CompanyUser.searchIdPin(objTran, Long.parseLong(id), key);
if(companyUser!=null && companyUser.getIsEmailChanged()==Boolean.TRUE)
{
try
{
companyUser.setIsEmailChanged(Boolean.FALSE);
companyUser.setIsAccountVerified(Boolean.TRUE);
objTran.commit();
objTran.commitResources();
}
finally
{
objTran.releaseResources();
}
invalid = Boolean.FALSE;
// response.sendRedirect(nextPage);
}
}
if(invalid)
{
%>
<h3>Verification Error</h3>
<p><span>Access expired.</span></p>
<%
}
else
{
%>
<p>Your e-mail address is successfully verified! Please login to access your account!</p>
<a class="btn btn-primary" href="<%= nextPage %>">Go to login</a>
<%
}
%>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -10,56 +10,68 @@ ...@@ -10,56 +10,68 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
validate(); recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$('input').on('change keyup', function() { validate() });
}); $('input[type="text"]').keyup(function() {
$(this).change();
function validate() {
var empty = false;
$('input[required]').each(function() {
if ( $.trim($( this ).val()) == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
}); });
});
if (empty) {
$('.send-btn').attr('disabled', 'disabled');
} else {
$('.send-btn').removeAttr('disabled');
}
}
</script> </script>
<style> <style>
button[disabled] { .btn-disabled button{
opacity: 0.6; opacity: 0.6;
background-color: #0582ba; background-color: #0582ba;
} }
</style>
<oneit:form name="forgotPassword" method="post"> #right-mark {
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> width: 24px;
<div class="main-box-layout login-box"> height: 24px;
<div class="text-left"> border-radius: 30px;
<p > position: absolute;
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link. top: 51%;
</p> right: 37px;
</div> background-color: #67b413;
<div>&nbsp;</div> padding-top: 5px;
<div class="form-group text-left"> }
<label>Email Address</label>
<input type="email" class="form-control" name="email" required>
</div>
<div class="form-group"> #right-mark img {
<oneit:button value="Send" name="forgotPassword" cssClass="box-btn send-btn" width: 15px;
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true") height: 15px;
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "resetPasswordEmailSent") display: block;
.toMap() %>"/> margin: auto auto;
}
</style>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
CompanyUser companyUser = CompanyUser.createCompanyUser(objTran);
%>
<oneit:form name="forgotPassword" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<div class="text-justify">
<p>
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link.
</p>
</div>
<div>&nbsp;</div>
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Email" cssClass="form-control" autocomplete="off"/>
<oneit:recalcClass id="right-mark-div" htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'hide'" companyUser="<%= companyUser %>" class="right-mark">
<span id="right-mark"><img src="<%= request.getContextPath() %>/images/right-mark.svg"/></span>
</oneit:recalcClass>
</div>
<div class="form-group">
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'btn-disabled'" companyUser="<%= companyUser %>">
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "reset_password_sent.jsp")
.mapEntry ("CompanyUser", companyUser)
.toMap() %>"/>
</oneit:recalcClass>
</div>
</div> </div>
</div> </oneit:form>
</oneit:form>
<%@ include file="inc/htmlfooter_nopriv.jsp" %> <%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -42,9 +42,10 @@ ...@@ -42,9 +42,10 @@
</div> </div>
</div> </div>
<div class="appli-list-name appli-l eq-second-height"> <div class="appli-list-name appli-l eq-second-height">
<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).toMap()).toMap() %>"> .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).toMap())
.toMap() %>">
<oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" /> <oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" />
<div class="appli-int-status"> <div class="appli-int-status">
<oneit:toString value="<%= jobApplication.getApplicantStatusStr() %>" mode="EscapeHTML" /> <oneit:toString value="<%= jobApplication.getApplicantStatusStr() %>" mode="EscapeHTML" />
...@@ -59,8 +60,16 @@ ...@@ -59,8 +60,16 @@
<div class="<%= "appli-percent-no " + (j == 0 ? "first green" : (j < 3 ? "blue" : "grey" ))%>"> <div class="<%= "appli-percent-no " + (j == 0 ? "first green" : (j < 3 ? "blue" : "grey" ))%>">
<oneit:toString value="<%= jobApplication.getOverallRank() %>" mode="Integer" /> <oneit:toString value="<%= jobApplication.getOverallRank() %>" mode="Integer" />
</div> </div>
</div> </div>
<div class="appli-jcs appli-l eq-second-height"> <%
String widthClass = "appli-jcs2";
if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
{
widthClass = "appli-jcs";
}
%>
<div class="<%= widthClass %> appli-l eq-second-height">
<span class="appli-view-bar"> <span class="appli-view-bar">
<div class="progress"> <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= roleFit %>" aria-valuemin="0" aria-valuemax="100" <div class="progress-bar" role="progressbar" aria-valuenow="<%= roleFit %>" aria-valuemin="0" aria-valuemax="100"
...@@ -70,7 +79,7 @@ ...@@ -70,7 +79,7 @@
</span> </span>
role fit role fit
</div> </div>
<div class="appli-jcs appli-l eq-second-height"> <div class="<%= widthClass %> appli-l eq-second-height">
<span class="appli-view-bar"> <span class="appli-view-bar">
<div class="progress"> <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= culture %>" aria-valuemin="0" aria-valuemax="100" <div class="progress-bar" role="progressbar" aria-valuenow="<%= culture %>" aria-valuemin="0" aria-valuemax="100"
...@@ -80,16 +89,23 @@ ...@@ -80,16 +89,23 @@
</span> </span>
culture fit culture fit
</div> </div>
<div class="appli-jcs appli-l eq-second-height"> <%
<span class="appli-view-bar"> if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
<div class="progress"> {
<div class="progress-bar" role="progressbar" aria-valuenow="<%= criteria %>" aria-valuemin="0" aria-valuemax="100" %>
style="<%= "width: " + criteria %>"> <div class="<%= widthClass %> appli-l eq-second-height">
</div> <span class="appli-view-bar">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= criteria %>" aria-valuemin="0" aria-valuemax="100"
style="<%= "width: " + criteria %>">
</div>
</div>
</span>
requirements
</div> </div>
</span> <%
requirements }
</div> %>
<div class="appli-status appli-l eq-second-height"> <div class="appli-status appli-l eq-second-height">
<div class="appli-list-drop"> <div class="appli-list-drop">
<oneit:ormEnum obj="<%= jobApplication %>" attributeName="AppProcessOption" cssClass="form-control app-process" <oneit:ormEnum obj="<%= jobApplication %>" attributeName="AppProcessOption" cssClass="form-control app-process"
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
String currentPage = (String) getData(request, "currentPage"); String currentPage = (String) getData(request, "currentPage");
AppSortOption appSortOpt = (AppSortOption) getData(request, "sortOption"); AppSortOption appSortOpt = (AppSortOption) getData(request, "sortOption");
String tabNumber = (String) getData(request, "tabNumber"); String tabNumber = (String) getData(request, "tabNumber");
Boolean isShortList = getData(request, "isShortList")!=null ? (Boolean) getData(request, "isShortList") : Boolean.FALSE; Boolean isShortList = getData(request, "isShortList")!= null ? (Boolean) getData(request, "isShortList") : Boolean.FALSE;
Boolean expand = getData(request, "expand")!=null ? (Boolean) getData(request, "expand") : Boolean.FALSE; Boolean showOrderBy = getData(request, "showOrderBy")!= null ? (Boolean) getData(request, "showOrderBy") : Boolean.FALSE;
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
...@@ -45,7 +44,7 @@ ...@@ -45,7 +44,7 @@
<div class="appli-shorting-dropdown appli-left"> <div class="appli-shorting-dropdown appli-left">
<span class="appli-order-label">Bulk Update</span> <span class="appli-order-label">Bulk Update</span>
<oneit:ormEnum obj="<%= job %>" attributeName="AppProcessOption" cssClass="form-control bullk-app-process" id="AppProcessOption" <oneit:ormEnum obj="<%= job %>" attributeName="AppProcessOption" cssClass="form-control bullk-app-process" id="AppProcessOption"
enums="<%= job.getValidProcessOptions(tabNumber) %>"/> enums="<%= job.getValidProcessOptions(isShortList) %>"/>
<oneit:button name="bulkupdate" value=" " cssClass="bulk-update" skin="link" <oneit:button name="bulkupdate" value=" " cssClass="bulk-update" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
...@@ -94,24 +93,29 @@ ...@@ -94,24 +93,29 @@
--%> --%>
<% <%
} }
if(showOrderBy)
{
%>
<div class="appli-shorting-dropdown">
<span class="appli-order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (AppSortOption sortOption : AppSortOption.getAppSortOptionArray())
{
String optionLink = currentPage + "&JobID=" + job.getID() + "&AppSortOption=" + sortOption.getName();
%>
<option <%= (appSortOpt != null && appSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
<%
}
%> %>
<div class="appli-shorting-dropdown">
<span class="appli-order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (AppSortOption sortOption : AppSortOption.getAppSortOptionArray())
{
String optionLink = currentPage + "&JobID=" + job.getID() + "&AppSortOption=" + sortOption.getName()
+ (expand ? "&Expand=Y" : "");
%>
<option <%= (appSortOpt != null && appSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div> </div>
</div> </div>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ page import="oneit.security.SecUser"%>
<oneit:dynIncluded>
<%
CompanyUser companyUser = (CompanyUser) getData(request, "CompanyUser");
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
%>
<div class="form-group text-left">
<label>Email Address</label>
<%
if(companyUser.getStatus()==ObjectStatus.NEW || 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" 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="<%= companyUser %>" field="Phone" /></label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Phone" cssClass="form-control" required="true"/>
</div>
<div class="form-group text-left">
<label>Company</label>
<%
if(company.getIsVerified()==Boolean.TRUE || !CollectionUtils.equals(company.getAddedByUser(), companyUser))
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" readonly="true" required="true"/>
<%
}
else
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true"/>
<%
}
%>
</div>
</oneit:dynIncluded>
...@@ -4,12 +4,24 @@ ...@@ -4,12 +4,24 @@
<meta charset="utf-8"></meta> <meta charset="utf-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta> <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1"></meta> <meta name="viewport" content="width=device-width, initial-scale=1"></meta>
<title>Talentology</title> <%
Company company = clientUser != null && clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null
? clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany() : null;
%>
<title><%= "Talentology" + (company != null ? " - " + company.getCompanyName() : "")%></title>
<%@include file="/inc/std_imports.jsp" %> <%@include file="/inc/std_imports.jsp" %>
<%@include file="/hotjar.jsp" %> <%@include file="/hotjar.jsp" %>
<%@include file="/heapAnalysis.jsp" %> <%@include file="/heapAnalysis.jsp" %>
</head> </head>
<script>
window.intercomSettings = {
app_id: "kqed9h3r"
};
</script>
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/kqed9h3r';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
</script>
<body> <body>
<% <%
Article home = WebUtils.getArticleByShortCut(objTran, WebUtils.ADMIN_HOME); Article home = WebUtils.getArticleByShortCut(objTran, WebUtils.ADMIN_HOME);
...@@ -25,11 +37,15 @@ ...@@ -25,11 +37,15 @@
sb.append(clientUser.getFirstName()); sb.append(clientUser.getFirstName());
sb.append(" "); sb.append(" ");
if(clientUser.getLastName()!=null ) if(clientUser.getLastName()!= null && !clientUser.getLastName().isEmpty() && ( sb.length() + clientUser.getLastName().length()) > 20 )
{ {
sb.append(clientUser.getLastName().charAt(0)); sb.append(clientUser.getLastName().charAt(0));
sb.append("."); sb.append(".");
} }
else
{
sb.append(clientUser.getLastName());
}
} }
else else
{ {
...@@ -45,7 +61,7 @@ ...@@ -45,7 +61,7 @@
<div class="search-bar"> <div class="search-bar">
<div class="inset-shadow"></div> <div class="inset-shadow"></div>
<img src="images/search-icon.svg"/> <img src="images/search-icon.svg"/>
<input type="text" class="form-control" placeholder="Search for job, candidate or client"/> <input type="text" class="form-control" placeholder="<%= company.showHasClientSupport() ? "Search for job, candidate or client" : "Search for a job or candidate"%>"/>
</div> </div>
<div class="fl-right"> <div class="fl-right">
<div class="notification-bar"> <div class="notification-bar">
...@@ -68,9 +84,11 @@ ...@@ -68,9 +84,11 @@
</a> </a>
<ul class="profile-dropdown dropdown-menu"> <ul class="profile-dropdown dropdown-menu">
<span class="arrow-up"></span> <span class="arrow-up"></span>
<!--Redirect to HT016--> <%
<li><a href="#">My Details</a></li> Article myDetailsArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.MY_DETAILS);
<li><a href="<%= signoutUrl %>">Sign Out</a></li> %>
<li><a href="<%= myDetailsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap())%>">My Details</a></li>
<li><a href="<%= signoutUrl %>">Sign Out</a></li>
</ul> </ul>
</div> </div>
<div class="create-job-btn"> <div class="create-job-btn">
......
<%@ page extends="oneit.servlets.process.AJAXProcessJSP" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "invite_user_add_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Company company = (Company) process.getAttribute("Company");
CompanyUser companyUser = (CompanyUser) getData(request, "CUser");
SecUser secUser = null;
if(companyUser == null)
{
secUser = SecUser.createSecUser(objTran);
companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
companyUser.setCompany(company);
}
secUser = companyUser.getUser();
%>
<oneit:form name="companyProfile" method="POST">
<oneit:evalBody buffer="<%= getBuffer(request) %>">
<%
FormTag myForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = myForm.getFormBuilder();
String optionKey = WebUtils.getInputKey(request, secUser, SecUser.FIELD_Email);
String formValue = formBuilder.fieldValue (optionKey, secUser.getEmail());
String deleteVarKey = FormTag.getVariableKey (request);
FormTag.setVariable (request, deleteVarKey, "objToDelete", secUser);
FormTag.setVariable (request, deleteVarKey, "jqToDelete", "#" + secUser.getID());
%>
<div class="main-user-invite" id="<%= secUser.getID() %>">
<span class="delete-company-user" onclick="return deleteUser (<%= deleteVarKey %>)"><span></span></span>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" />
</div>
</oneit:evalBody>
</oneit:form>
\ No newline at end of file
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
<%@ include file="/extensions/performa/inc/stdimports.jsp" %> <%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<% <%
Job[] jobs = (Job[]) getData(request, "Jobs"); Job[] jobs = (Job[]) getData(request, "Jobs");
JobStatus jobStatus = (JobStatus) getData(request, "JobStatus"); JobStatus jobStatus = (JobStatus) getData(request, "JobStatus");
String nextPage = (String) getData(request, "NextPage"); JobSortOption jobSortOption = (JobSortOption) getData(request, "JobSortOption");
String homePage = (String) getData(request, "HomePage"); String nextPage = (String) getData(request, "NextPage");
String shortlistPage = (String) getData(request, "ShortlistPage"); String homePage = (String) getData(request, "HomePage");
String shortlistPage = (String) getData(request, "ShortlistPage");
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
...@@ -49,15 +50,21 @@ ...@@ -49,15 +50,21 @@
<div class="job-row" > <div class="job-row" >
<div class="job-post jl-c eq-second-height" style="height: 107px;"> <div class="job-post jl-c eq-second-height" style="height: 107px;">
<div class="job-post-name"> <div class="job-post-name">
<oneit:button value=" " name="gotoPage" skin="link" <a href="<%= nextPage+"&JobID="+job.getObjectID() %>">
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>">
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML" /> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML" />
</oneit:button> </a>
</div> </div>
<div class="job-company-name"> <div class="job-company-name">
<!--<span class="superlaw">SUPERLAW</span>--> <span class="superlaw">
<%
if(job.isClientAvailable())
{
%>
<oneit:toString value="<%= job.getClient() %>" mode="EscapeHTML" />
<%
}
%>
</span>
<span class="calendar"> <span class="calendar">
<% <%
if(job.getJobStatus() == JobStatus.OPEN) if(job.getJobStatus() == JobStatus.OPEN)
...@@ -124,10 +131,10 @@ ...@@ -124,10 +131,10 @@
</div> </div>
<div class="job-states jl-c wider-select"> <div class="job-states jl-c wider-select">
<oneit:ormEnum obj="<%= job %>" attributeName="JobStatus" cssClass="form-control status-img job-status" <oneit:ormEnum obj="<%= job %>" attributeName="JobStatus" cssClass="form-control status-img job-status"
enums="<%= Arrays.asList(new JobStatus[]{JobStatus.OPEN, JobStatus.COMPLETE, JobStatus.FILLED}) %>"/> enums="<%= job.getAvailableStatus() %>"/>
</div> </div>
<oneit:button name="saveJob" value="Save" cssClass="<%= "save-job" + job.getID().toString() + " hidden"%>" <oneit:button name="saveJob" value="Save" cssClass="<%= "save-job" + job.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("Job", job).mapEntry("nextPage", homePage+ (jobStatus != null ? "&JobStatus=" + jobStatus : "")).toMap() %>" /> requestAttribs="<%= CollectionUtils.mapEntry("Job", job).mapEntry("nextPage", homePage + "&JobStatus=" + jobStatus + "&JobSortOption=" + jobSortOption).toMap() %>" />
</div> </div>
<% <%
} }
......
...@@ -17,41 +17,41 @@ ...@@ -17,41 +17,41 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<div class="main-tab-form"> <div class="main-tab-form job-main-tabs">
<ul class="nav nav-pills nav-justified"> <ul class="nav nav-pills nav-justified">
<li class="<%= pageNumber == "1" ? "active" : job.getCompletedDetails() || savedJob ? "complate" : ""%>"> <li class="<%= pageNumber == "1" ? "active" : CollectionUtils.equals(job.getCompletedDetails(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span><%= job.getCompletedDetails() || savedJob ? "<img src=\"images/right-mark.png\" />" : "1"%></span> <span><%= CollectionUtils.equals(job.getCompletedDetails(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
Job Detail Job Detail
</oneit:button> </oneit:button>
</li> </li>
<li class="<%= pageNumber == "2" ? "active" : job.getCompletedAssessmentType() || savedJob ? "complate" : ""%>"> <li class="<%= pageNumber == "2" ? "active" : CollectionUtils.equals(job.getCompletedAssessmentType(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span><%= job.getCompletedAssessmentType() || savedJob ? "<img src=\"images/right-mark.png\" />" : "2"%></span> <span><%= CollectionUtils.equals(job.getCompletedAssessmentType(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "2"%></span>
Role Role
</oneit:button> </oneit:button>
</li> </li>
<li class="<%= pageNumber == "3" ? "active" : job.getCompletedCulture() || savedJob ? "complate" : ""%>"> <li class="<%= pageNumber == "3" ? "active" : CollectionUtils.equals(job.getCompletedCulture(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span><%= job.getCompletedCulture() || savedJob ? "<img src=\"images/right-mark.png\" />" : "3"%></span> <span><%= CollectionUtils.equals(job.getCompletedCulture(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "3"%></span>
Culture Culture
</oneit:button> </oneit:button>
</li> </li>
<li class="<%= pageNumber == "4" ? "active" : job.getCompletedRequirements() || savedJob ? "complate" : ""%>"> <li class="<%= pageNumber == "4" ? "active" : CollectionUtils.equals(job.getCompletedRequirements(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fourthPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fourthPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span><%= job.getCompletedRequirements() || savedJob ? "<img src=\"images/right-mark.png\" />" : "4"%></span> <span><%= CollectionUtils.equals(job.getCompletedRequirements(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "4"%></span>
Requirements Requirements
</oneit:button> </oneit:button>
</li> </li>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
int shortlisted = job.getNoOfCandidatesShortlisted(); int shortlisted = job.getNoOfCandidatesShortlisted();
String editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB); String editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB);
String reviewPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_REVIEW);
String sharePage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB); String sharePage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB);
String jobPage = WebUtils.getSamePageInRenderMode(request, (shortlisted > 0 ? WebUtils.APPLICANTS_SHORTLIST : WebUtils.VIEW_APPLICANTS)); String jobPage = WebUtils.getSamePageInRenderMode(request, (shortlisted > 0 ? WebUtils.APPLICANTS_SHORTLIST : WebUtils.VIEW_APPLICANTS));
%> %>
...@@ -16,7 +17,18 @@ ...@@ -16,7 +17,18 @@
<div class="officer-box"> <div class="officer-box">
<div class="officer-name"> <div class="officer-name">
<div class="chief-officer"><%--<img src="images/post-p.png" />--%> <div class="chief-officer">
<%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 26;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
...@@ -25,7 +37,17 @@ ...@@ -25,7 +37,17 @@
</oneit:button> </oneit:button>
</div> </div>
<div class="off-name"> <div class="off-name">
<span class="austr-post"></span> by <oneit:toString value="<%= SecUserToNameTransform.INSTANCE.transform(job.getSecUser()) %>" mode="EscapeHTML"/><span class="ex-management">&bull;&nbsp; <span class="austr-post">
<%
if(job.isClientAvailable())
{
%>
<oneit:toString value="<%= job.getClient() %>" mode="EscapeHTML" />
<%
}
%>
</span> by <oneit:toString value="<%= job.getCompanyUser() %>" mode="EscapeHTML" nullValue=""/>
<span class="ex-management">&bull;&nbsp;
<oneit:toString value="<%= job.getLevel() %>" mode="EscapeHTML" /> <oneit:toString value="<%= job.getLevel() %>" mode="EscapeHTML" />
</span> </span>
</div> </div>
...@@ -64,7 +86,7 @@ ...@@ -64,7 +86,7 @@
.mapEntry("cancelProcess", true) .mapEntry("cancelProcess", true)
.toMap() %>"/> .toMap() %>"/>
<oneit:button value=" " cssClass="rightbtn" name="gotoPage" skin="link" <oneit:button value=" " cssClass="rightbtn" name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editJobPage + "&JobID=" + job.getObjectID()) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", (job.getJobStatus() == JobStatus.DRAFT ? reviewPage : editJobPage) + "&JobID=" + job.getObjectID())
.mapEntry("cancelProcess", true) .mapEntry("cancelProcess", true)
.toMap() %>"> .toMap() %>">
EDIT EDIT
......
<%@ 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" %>
<%
String tabNumber = (String) getData(request, "TabNumber");
String firstPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
<oneit:dynIncluded>
<div class="tabing-sidebar">
<ul class="nav nav-tabs tabs-left">
<li class="<%= tabNumber == "1" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.toMap() %>">
Company Details
</oneit:button>
</li>
<li class="">Manage Plan</li>
<li class="">Billing</li>
<li class="disabled">Invoices</li>
</ul>
</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" %>
<%
String tabNumber = (String) getData(request, "TabNumber");
String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.MY_DETAILS);
%>
<oneit:dynIncluded>
<div class="tabing-sidebar">
<ul class="nav nav-tabs tabs-left">
<li class="<%= tabNumber == "1" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.toMap() %>">
My Details
</oneit:button>
</li>
<li>Security Settings</li>
</ul>
</div>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -4,20 +4,33 @@ ...@@ -4,20 +4,33 @@
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %> <%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
String tabText = candidate.getToString();
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
%>
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
Map<FactorClass, Double> roleScoreMap = (Map<FactorClass, Double>)jobApplication.getRoleFit(); JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
List<JobApplication> applications = (List<JobApplication>) process.getAttribute("Applications");
Long prevAppID = (Long) getData(request, "prevAppID");
Long nextAppID = (Long) getData(request, "nextAppID");
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
String tabText = candidate.getToString();
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
Map<FactorClass, Tuple.T2<Double, ColorCode>> roleScoreMap = (Map<FactorClass, Tuple.T2<Double, ColorCode>>)jobApplication.getRoleFit();
%> %>
<script> <script>
function tabToggle(tab) { function tabToggle(tab, selectDiv) {
$(".thr-block").each(function() {
$(this).css("margin-top", 0);
$(this).css("padding-top", 0);
$(this).css("background-color", "#f7f7f8");
$(this).parent().find(".progress-label").css("font-size", "12px");
});
$(selectDiv).css("margin-top", -10);
$(selectDiv).css("padding-top", "5px")
$(selectDiv).css("background", "#fff");
$(selectDiv).find(":first").css("font-size", "16px");
$(".nav-justified li").each(function() { $(".nav-justified li").each(function() {
$(this).removeClass('active'); $(this).removeClass('active');
}); });
...@@ -38,11 +51,17 @@ ...@@ -38,11 +51,17 @@
$(this).addClass('hasarrow'); $(this).addClass('hasarrow');
} }
}); });
tabToggle("#tab1", ".role-fit");
}); });
</script> </script>
<div class="main-applicant-content dashboard-content-area v-applicant-area ">
<div class="main-applicant-content">
<div class="applicant-header"> <div class="applicant-header">
<oneit:button name="gotoPage" value=" " cssClass="prev-btn" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("procParams", CollectionUtils.mapEntry("Applications", applications).toMap())
.mapEntry("nextPage", currentPage+"&JobApplicationID="+prevAppID ).toMap() %>" >
<img src="images/arrow-left-prev.svg" />
</oneit:button>
<div class="main-appli-name"> <div class="main-appli-name">
<div class="appli-name"><oneit:toString value="<%= candidate.getToString() %>" mode="EscapeHTML"/></div> <div class="appli-name"><oneit:toString value="<%= candidate.getToString() %>" mode="EscapeHTML"/></div>
<div class="appli-applied"> <div class="appli-applied">
...@@ -67,300 +86,348 @@ ...@@ -67,300 +86,348 @@
.mapEntry ("restartProcess", Boolean.TRUE).toMap() %>" /> .mapEntry ("restartProcess", Boolean.TRUE).toMap() %>" />
</span> </span>
</div> </div>
<oneit:button name="gotoPage" value=" " cssClass="next-btn" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).toMap())
.mapEntry("nextPage", currentPage+"&JobApplicationID="+nextAppID ).toMap() %>" >
<img src="images/arrow-right-next.svg" />
</oneit:button>
</div> </div>
<div class="applicant-sub-part"> <div class="main-applicant-content">
<div class="applicant-left"> <div class="applicant-sub-part">
<div class="applicant-progress"> <div class="applicant-left">
<div class="col-sm-4 col-xs-12 text-center" href="#1a" data-toggle="tab" id="progress1" onClick="tabToggle('#tab1')"> <%
<label class="progress-label">role fit</label> Tuple.T2<Double, ColorCode> roleFitData = (jobApplication.getRoleFit()!=null && jobApplication.getRoleFit().get(null)!=null) ? (Tuple.T2<Double, ColorCode>) jobApplication.getRoleFit().get(null) : null;
<div class="percent-role fixed-width"> String colorClass = "percent-" +(roleFitData!=null ? roleFitData.get1().getCSSClass() : "green");
<p style="display:none;"><oneit:toString value="<%= jobApplication.getRoleFitScore() %>" mode="TwoDPDouble" nullValue="0"/></p> %>
</div> <div class="applicant-progress">
</div> <div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-6" %> col-xs-12 text-center thr-block role-fit" href="#1a" data-toggle="tab" id="progress1" onClick="tabToggle('#tab1', '.role-fit')">
<div class="col-sm-4 col-xs-12 text-center" href="#2a" data-toggle="tab" id="progress2" onClick="tabToggle('#tab2')"> <label class="progress-label">role fit</label>
<label class="progress-label">culture fit</label> <div class="<%= colorClass %> fixed-width">
<div class="percent-culture fixed-width"> <p style="display:none;"><oneit:toString value="<%= roleFitData.get0() %>" mode="TwoDPDouble" nullValue="0"/></p>
<p style="display:none;"><oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="PercentageWholeNumber" /></p> </div>
<div class="row four-label">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="a-label-row">
<span class="common-dot yellow-dot"></span><span class="r-y-label text-dot-dot">Achievement</span>
</div>
<div class="a-label-row">
<span class="common-dot red-dot"></span><span class="r-y-label text-dot-dot">Item with a long ti</span>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="a-label-row">
<span class="common-dot yellow-dot"></span><span class="r-y-label text-dot-dot">Remuneration</span>
</div>
<div class="a-label-row">
<span class="common-dot red-dot"></span><span class="r-y-label text-dot-dot">Item title</span>
</div>
</div>
</div>
</div> </div>
</div> <div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-4" %> col-xs-12 text-center thr-block culture-fit" href="#2a" data-toggle="tab" id="progress2" onClick="tabToggle('#tab2', '.culture-fit')">
<div class="col-sm-4 col-xs-12 text-center" href="#3a" data-toggle="tab" id="progress3" onClick="tabToggle('#tab3')"> <label class="progress-label">culture fit</label>
<label class="progress-label">requirements</label> <div class="percent-green fixed-width">
<div class="percent-req fixed-width"> <p style="display:none;"><oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="TwoDPDouble" /></p>
<p style="display:none;"><oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="PercentageWholeNumber" /></p> </div>
<div class="row four-label">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="a-label-row">
<span class="common-dot yellow-dot"></span><span class="r-y-label text-dot-dot">Achievement</span>
</div>
<div class="a-label-row">
<span class="common-dot red-dot"></span><span class="r-y-label text-dot-dot">Item title</span>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="a-label-row">
<span class="common-dot yellow-dot"></span><span class="r-y-label text-dot-dot">Remuneration</span>
</div>
</div>
</div>
</div> </div>
</div>
</div>
<div class="applicant-tab">
<ul class="nav nav-pills nav-justified">
<li id="tab1" class="active"><a href="#1a" data-toggle="tab">role fit</a></li>
<li id="tab2"><a href="#2a" data-toggle="tab">culture fit</a></li>
<li id="tab3"><a href="#3a" data-toggle="tab">requirements</a></li>
<li id="tab4" style="display: none"><a href="#4a" data-toggle="tab">areas of concern</a></li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="1a">
<% <%
for(FactorClass factorClass : jobApplication.getSortedFactorClasses()) if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
{ {
if(roleScoreMap.get(factorClass) != null && roleScoreMap.get(factorClass) > 0d)
{
Map<FactorLevelLink, Map> factorDetails = AnalysisEngine.getFactorScoreDetails(candidate, job.getLevel(), factorClass);
%> %>
<div class="main-pro-bar"> <div class="col-sm-4 col-xs-12 text-center thr-block requirement-fit" href="#3a" data-toggle="tab" id="progress3" onClick="tabToggle('#tab3','.requirement-fit')">
<div class="pro-bar"> <label class="progress-label">requirements</label>
<span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span> <div class="percent-blue fixed-width">
<span class="appli-percen"><oneit:toString value="<%= roleScoreMap.get(factorClass) %>" mode="TwoDPDouble"/></span> <p style="display:none;"><oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="TwoDPDouble" /></p>
<span class="expand-box"> </div>
<span class="hasarrow"><img src="images/select-down-arrow.svg"></span> <div class="row four-label">
</span> <div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="a-label-row">
<span class="common-dot yellow-dot"></span><span class="r-y-label text-dot-dot">Item title</span>
</div>
<div class="a-label-row">&nbsp;</div>
</div> </div>
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<div class="expand-hide-tag"> <div class="a-label-row">
<% <span class="common-dot red-dot"></span><span class="r-y-label text-dot-dot">Item title</span>
for(FactorLevelLink factorLevelLink : factorDetails.keySet()) </div>
{ <div class="a-label-row">&nbsp;</div>
Map factorLinkDetails = factorDetails.get(factorLevelLink);
if(!factorLinkDetails.isEmpty())
{
FactorScore factorScore = (FactorScore) factorLinkDetails.get("factorScore");
%>
<div class="tab-row">
<div class="tab-view-label"><oneit:toString value="<%= factorLevelLink.getFactor() %>" mode="EscapeHTML"/></div>
<div class="tab-view-side">
<div class="result-want">
<div class="result"><oneit:toString value="<%= factorLevelLink.getLeftAnnot() %>" mode="EscapeHTML"/></div>
<div class="wants"><oneit:toString value="<%= factorLevelLink.getRightAnnot() %>" mode="EscapeHTML"/></div>
</div>
<div class="result-bar">
<ul>
<%
Map<FactorScoreResult, Double> factorScoreDetails = (Map<FactorScoreResult, Double>)factorLinkDetails.get("factorScoreDetails");
for(FactorScoreResult factorScoreResult : factorScoreDetails.keySet())
{
%>
<li class="<%= factorScoreResult.getColorCode() != null ? factorScoreResult.getColorCode().getCSSClass() : "" %>" style="width: <%= factorScoreDetails.get(factorScoreResult) %>%;"></li>
<%
}
%>
</ul>
<span class="triangle-arrow" style="left: <%= factorLinkDetails.get("scoreLeftMargin")%>%;"></span>
</div>
<div class="like-strive"><oneit:toString value="<%= factorScore != null ? factorScore.getNarrative() : null %>" mode="EscapeHTML"/></div>
</div>
</div>
<%
}
}
%>
</div> </div>
</div> </div>
</div>
<% <%
}
} }
%> %>
</div> </div>
<div class="tab-pane" id="2a"> <div class="applicant-tab">
<div class="tab-content clearfix">
<div class="tab-pane active" id="1a">
<% <%
Map<CultureClass, Long> cultureFitData = (Map<CultureClass, Long>)jobApplication.getCultureFit(); for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
for(CultureClass cClass: cultureFitData.keySet())
{ {
if(cClass==null) if(roleScoreMap.get(factorClass) != null && roleScoreMap.get(factorClass).get0() > 0d)
{ {
continue; Map<FactorLevelLink, Map> factorDetails = AnalysisEngine.getFactorScoreDetails(candidate, job.getLevel(), factorClass);
} Double rating = roleScoreMap.get(factorClass).get0();
ColorCode colorCode = roleScoreMap.get(factorClass).get1();
Long rating = cultureFitData.get(cClass); String cssClass = colorCode.getCSSClass();
%> %>
<div class="main-pro-bar"> <div class="main-pro-bar">
<div class="pro-bar"> <div class="pro-bar">
<span class="appli-label"><oneit:toString value="<%= cClass %>" mode="EscapeHTML"/></span> <span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></span> <span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="TwoDPDouble"/></span>
<span class="appli-progress-bar"> <span class="appli-progress-bar">
<div class="progress"> <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div> <div class="progress-bar <%= cssClass %>" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div>
</div>
</span>
<span class="expand-box">
<span class="hasarrow"><img src="images/select-down-arrow.svg" /></span>
</span>
</div>
<div class="expand-hide-tag">
<div class="tab-row">
<div class="tab-view-label">
Achievement
</div>
<div class="tab-view-side">
<div class="result-want">
<div class="result">Not results focused</div>
<div class="wants">Wants results</div>
</div> </div>
<div class="result-bar"> </span>
<ul> <span class="expand-box">
<li class="red-b" style="width: 26.5%;"></li> <span class="hasarrow"><img src="images/select-down-arrow.svg"></span>
<li class="yellow-b" style="width: 26.5%;"></li> </span>
<li class="green-b" style="width: 47%;"></li>
</ul>
<span class="triangle-arrow" style="left: 48%;"></span>
</div>
<div class="like-strive">Likely to strive to achive results</div>
</div>
</div> </div>
<div class="tab-row">
<div class="tab-view-label"> <div class="expand-hide-tag">
Remuneration <%
</div> for(FactorLevelLink factorLevelLink : factorDetails.keySet())
<div class="tab-view-side"> {
<div class="result-want"> Map factorLinkDetails = factorDetails.get(factorLevelLink);
<div class="result">Low concern</div>
<div class="wants">High concern</div> if(!factorLinkDetails.isEmpty())
</div> {
<div class="result-bar"> FactorScore factorScore = (FactorScore) factorLinkDetails.get("factorScore");
<ul> %>
<li class="red-b" style="width: 23.2%;"></li> <div class="tab-row">
<li class="yellow-b" style="width: 57.6%;"></li> <div class="tab-view-label">
<li class="green-b" style="width: 19%;"></li> <oneit:toString value="<%= factorLevelLink.getFactor() %>" mode="EscapeHTML"/>
</ul> </div>
<span class="triangle-arrow" style="left: 72%;"></span> <div class="tab-view-side">
</div> <div class="result-want">
<div class="like-strive">Financial reward is less of a motivation than many other factors</div> <div class="result"><oneit:toString value="<%= factorLevelLink.getLeftAnnot() %>" mode="EscapeHTML"/></div>
</div> <div class="wants"><oneit:toString value="<%= factorLevelLink.getRightAnnot() %>" mode="EscapeHTML"/></div>
</div>
<div class="result-bar">
<ul>
<%
Map<FactorScoreResult, Double> factorScoreDetails = (Map<FactorScoreResult, Double>)factorLinkDetails.get("factorScoreDetails");
for(FactorScoreResult factorScoreResult : factorScoreDetails.keySet())
{
%>
<li class="<%= factorScoreResult.getColorCode() != null ? factorScoreResult.getColorCode().getCSSClass() : "" %>" style="width: <%= factorScoreDetails.get(factorScoreResult) %>%; height: 10px"></li>
<%
}
%>
</ul>
<span class="triangle-arrow" style="left: <%= factorLinkDetails.get("scoreLeftMargin")%>%;"></span>
</div>
<div class="like-strive"><oneit:toString value="<%= factorScore != null ? factorScore.getNarrative() : null %>" mode="EscapeHTML"/></div>
</div>
</div>
<%
}
}
%>
</div> </div>
</div> </div>
</div>
<% <%
}
} }
%> %>
</div> </div>
<div class="tab-pane" id="3a"> <div class="tab-pane" id="2a">
<% <%
Map<Importance, Long> requirementFitData = (Map<Importance, Long>)jobApplication.getRequirementFit(); Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>> cultureFitData = (Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>>) jobApplication.getCultureFit();
for(Importance importance: requirementFitData.keySet()) for(CultureClass cClass: cultureFitData.keySet())
{
if(importance==null)
{ {
continue; if(cClass == null || cultureFitData.get(cClass) == null)
} {
continue;
}
Long rating = requirementFitData.get(importance); Long rating = cultureFitData.get(cClass).get0();
%> %>
<div class="main-pro-bar"> <div class="main-pro-bar">
<div class="pro-bar"> <div class="pro-bar">
<span class="appli-label"><oneit:toString value="<%= importance %>" mode="EscapeHTML"/></span> <span class="appli-label"><oneit:toString value="<%= cClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></span> <span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="WholeNumber" /></span>
<span class="appli-progress-bar"> <span class="appli-progress-bar">
<div class="progress"> <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div> <div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%;"></div>
</div>
</span>
<span class="expand-box">
<span class="hasarrow"><img src="images/select-down-arrow.svg" /></span>
</span>
</div>
<div class="expand-hide-tag">
<div class="tab-row">
<div class="tab-view-label">
Achievement
</div>
<div class="tab-view-side">
<div class="result-want">
<div class="result">Not results focused</div>
<div class="wants">Wants results</div>
</div> </div>
<div class="result-bar"> </span>
<ul> <span class="expand-box">
<li class="red-b" style="width: 26.5%;"></li> <span class="hasarrow"><img src="images/select-down-arrow.svg" /></span>
<li class="yellow-b" style="width: 26.5%;"></li> </span>
<li class="green-b" style="width: 47%;"></li>
</ul>
<span class="triangle-arrow" style="left: 48%;"></span>
</div>
<div class="like-strive">Likely to strive to achive results</div>
</div>
</div> </div>
<div class="tab-row"> <div class="expand-hide-tag">
<div class="tab-view-label"> <%
Remuneration for(Tuple.T3 tuple : cultureFitData.get(cClass).get1())
</div> {
<div class="tab-view-side"> CultureNarrative cultureNarrative = (CultureNarrative) tuple.get2();
<div class="result-want"> String dotClass = cultureNarrative != null && cultureNarrative.getColorCode() != null ? cultureNarrative.getColorCode().getDotCSSClass() : "";
<div class="result">Low concern</div> %>
<div class="wants">High concern</div> <div class="detail-tab-row">
</div> <div class="detail-tab-row-title col-md-4 col-sm-4 col-xs-4">
<div class="result-bar"> <span class="common-dot <%= dotClass %>"></span> &nbsp;
<ul> <oneit:toString value="<%= tuple.get1() %>" mode="EscapeHTML"/>
<li class="red-b" style="width: 23.2%;"></li> </div>
<li class="yellow-b" style="width: 57.6%;"></li> <div class="detail-tab-row-text col-md-8 col-sm-8 col-xs-8">
<li class="green-b" style="width: 19%;"></li> <oneit:toString value="<%= cultureNarrative %>" mode="EscapeHTML"/>
</ul> </div>
<span class="triangle-arrow" style="left: 72%;"></span> </div>
</div> <%
<div class="like-strive">Financial reward is less of a motivation than many other factors</div> }
</div> %>
</div> </div>
</div> </div>
<%
}
%>
</div>
<%
if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
{
%>
<div class="tab-pane" id="3a">
<%
MultiHashtable<Importance, AssessmentCriteriaAnswer> reqAnswersByImportance = jobApplication.getRequirementAnswersByImportance();
Map<Importance, Long> requirementFitData = (Map<Importance, Long>)jobApplication.getRequirementFit();
for(Importance importance: requirementFitData.keySet())
{
if(importance==null)
{
continue;
}
Long rating = requirementFitData.get(importance);
%>
<div class="main-pro-bar">
<div class="pro-bar">
<span class="appli-label"><oneit:toString value="<%= importance %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="WholeNumber" /></span>
<span class="appli-progress-bar">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div>
</div>
</span>
<%
if(reqAnswersByImportance.getValuesForKey(importance)!=null)
{
%>
<span class="expand-box">
<span class="hasarrow"><img src="images/select-down-arrow.svg" /></span>
</span>
<%
}
%>
</div>
<%
if(reqAnswersByImportance.getValuesForKey(importance)!=null)
{
%>
<div class="expand-hide-tag">
<%
for(AssessmentCriteriaAnswer answer: reqAnswersByImportance.getValuesForKey(importance))
{
%>
<div class="tab-row">
<div class="detail-tab-row-title col-md-4 col-sm-4 col-xs-4" style="width: 30%">
<oneit:toString value="<%= answer.getAssessmentCriteria().getCriteriaType() %>" mode="EscapeHTML"/>
</div>
<div class="detail-tab-row-text col-md-8 col-sm-8 col-xs-8" style="width: 65%">
<oneit:toString value="<%= answer.getAssessmentCriteria() %>" mode="EscapeHTML"/>
<span style="padding-left: 10px; float: right">
<oneit:toString value="<%= answer.getAnswer() ? "Yes" : "No" %>" mode="EscapeHTML"/>
</span>
</div>
</div>
<%
}
%>
</div>
<%
}
%>
</div>
<%
}
%>
</div> </div>
<% <%
} }
%> %>
</div> <div class="tab-pane" id="4a">
<div class="tab-pane" id="4a"> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="applicant-right">
<div class="applicant-right">
<div class="app-right-b">
<div class="app-right-b"> <div class="overall-suit">overall rank</div>
<div class="overall-suit">overall rank</div> <div class="big-percentage">
<div class="big-percentage"> <oneit:toString value="<%= jobApplication.getOverallRank() %>" mode="Integer" />
<oneit:toString value="<%= jobApplication.getOverallRank() %>" mode="Integer" />
</div>
</div>
<div class="applicant-contact-info">
<div class="contact-title">Contact</div>
<div class="contact-row">
<div class="contact-label">E</div>
<div class="contact-value">
<a href="<%= "mailto:" + candidate.getUser().getUserName() %>">
<oneit:toString value="<%= candidate.getUser().getUserName() %>" mode="EscapeHTML" />
</a>
</div> </div>
</div> </div>
<div class="contact-row"> <div class="applicant-contact-info">
<div class="contact-label">P</div> <div class="contact-title">Contact</div>
<div class="contact-value"> <div class="contact-row">
<oneit:toString value="<%= candidate.getPhone() %>" mode="EscapeHTML" /> <div class="contact-label">E</div>
<div class="contact-value">
<a href="<%= "mailto:" + candidate.getUser().getUserName() %>">
<oneit:toString value="<%= candidate.getUser().getUserName() %>" mode="EscapeHTML" />
</a>
</div>
</div>
<div class="contact-row">
<div class="contact-label">P</div>
<div class="contact-value">
<oneit:toString value="<%= candidate.getPhone() %>" mode="EscapeHTML" />
</div>
</div>
<div class="contact-row" style="display: none;">
<div class="contact-label"><img src="images/linkdin-icon.png" /></div>
<div class="contact-value"><a href="#">View LinkedIn profile</a></div>
</div>
<div class="contact-row" style="display: none;">
<div class="contact-label"><img src="images/download-icon.png" /></div>
<div class="contact-value"><a href="#">Download Resume</a></div>
</div> </div>
</div> </div>
<div class="contact-row" style="display: none;"> <div class="applicant-note" style="display: none;">
<div class="contact-label"><img src="images/linkdin-icon.png" /></div> <div class="applicant-note-title">Notes</div>
<div class="contact-value"><a href="#">View LinkedIn profile</a></div> <div class="note-txt-box">
</div> <textarea class="form-control"></textarea>
<div class="contact-row" style="display: none;"> <input type="button" class="add-note-btn" value="ADD NOTE" />
<div class="contact-label"><img src="images/download-icon.png" /></div> </div>
<div class="contact-value"><a href="#">Download Resume</a></div>
</div> </div>
</div> <div class="admin-notes" style="display: none;">
<div class="applicant-note" style="display: none;"> <div class="admin-name">Admin name</div>
<div class="applicant-note-title">Notes</div> <div class="date-value">TODAY</div>
<div class="note-txt-box"> <div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent accumsan interdum nisi, sed laoreet dui rhoncus.</div>
<textarea class="form-control"></textarea> <div class="admin-br-line"></div>
<input type="button" class="add-note-btn" value="ADD NOTE" /> <div class="admin-name">Admin name</div>
<div class="date-value">2 days ago</div>
<div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div> </div>
</div> </div>
<div class="admin-notes" style="display: none;">
<div class="admin-name">Admin name</div>
<div class="date-value">TODAY</div>
<div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent accumsan interdum nisi, sed laoreet dui rhoncus.</div>
<div class="admin-br-line"></div>
<div class="admin-name">Admin name</div>
<div class="date-value">2 days ago</div>
<div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
<%@ 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" %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request) + "?showModal=true";
Company company = (Company) process.getAttribute("Company");
Boolean socialLogin = CollectionUtils.equals(process.getAttribute("socialLogin"), Boolean.TRUE);
Debug.assertion(company != null, "Invalid company user in admin portal");
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
Integer pageNumber = 2;
boolean toRedirect = company.createDefaultUser();
if (toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
%>
<script type="text/javascript">
function addUser() {
var divID = "#usersSection";
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/adminportal/inc/invite_user_add.jsp", divID, {}, function (theHTML_JQ) {
$(divID).append (theHTML_JQ);
});
}
function deleteUser(deleteVarKey) {
ajaxProcessDeleteJQ("<%= request.getContextPath() %>/genericDelete_AJAX.jsp", "#usersSection" , { varKey: deleteVarKey });
return false;
}
</script>
<div class="hire-the-right-candi" style="">You're nearly there...</div>
<oneit:form name="companyProfile" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="section-tab-view">
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="complate"><a href="#"><span><img src="images/right-mark.svg"/></span><div>Company Profile</div></a></li>
<li class="active"><a href="#"><span>2</span><div>Invite Users</div></a></li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li>
</ul>
</div>
<div class="section-page-area" style="text-align: left">
<div class="main-sc-section">
<div class="form-group">
<div id="usersSection">
<%
for (CompanyUser cUser : company.getUsersSet())
{
if(!CollectionUtils.equals(cUser, companyUser))
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/invite_user_add.jsp"
CUser="<%= cUser %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/>
<%
}
}
%>
</div>
</div>
</div>
<div class="main-sc-section main-add-more content-to-center">
<oneit:button value="Add Another" name="newUser" cssClass="add-more-btn" skin="link"
onClick="<%="addUser(); return false;"%>"
requestAttribs="<%= CollectionUtils.EMPTY_MAP %>"/>
</div>
<div class="main-sc-section text-center company-profile-btn">
<oneit:button value="Send invites & proceed" name="sendCompanyUserInvites" cssClass="btn btn-primary box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap())
.toMap() %>"/>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -46,7 +46,9 @@ ...@@ -46,7 +46,9 @@
<div class="form-page-area"> <div class="form-page-area">
<div class="create-job"> <div class="create-job">
<% <%
Job[] jobs = Job.SearchByAll().andSecUser(new EqualsFilter<>(SecUser.getTXUser(transaction))).search(transaction); SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Job[] jobs = Job.SearchByAll().andCompanyUser(new EqualsFilter<>(companyUser)).search(transaction);
if(jobs.length > 0) if(jobs.length > 0)
{ {
...@@ -79,15 +81,19 @@ ...@@ -79,15 +81,19 @@
<div class=""> <div class="">
<div class="optional-title">OPTIONAL</div> <div class="optional-title">OPTIONAL</div>
<div class="row"> <div class="row">
<div class="col-sm-6 col-xs-12 form-group"> <%
<label>Client</label> if(companyUser.getCompany().showHasClientSupport())
<select class="form-control"> {
<option>Please Select or Add New</option> %>
<option>One 1</option> <div class="col-sm-6 col-xs-12 form-group">
<option>One 2</option> <label><oneit:label GUIName="Client"/></label>
<option>One 3</option> <div class="wider-select">
</select> <tagfile:ormsingleasso_select obj="<%= job %>" assocName="Client" options="<%= Utils.getClientsByCompany(transaction) %>"/>
</div> </div>
</div>
<%
}
%>
<div class="col-sm-6 col-xs-12 form-group"> <div class="col-sm-6 col-xs-12 form-group">
<label><oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" /></label> <label><oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" /></label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="ReferenceNumber" cssClass="form-control" /> <oneit:ormInput obj="<%= job %>" type="text" attributeName="ReferenceNumber" cssClass="form-control" />
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS); Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS);
String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.VIEW_APPLICANTS).toMap()); String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.VIEW_APPLICANTS).toMap());
if(job == null && request.getParameter("JobID")!= null)
{
job = Job.getJobByID(transaction, Long.parseLong(request.getParameter("JobID")));
process.setAttribute("Job", job);
}
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
%> %>
<oneit:form name="editJob" method="post" enctype="multipart/form-data"> <oneit:form name="editJob" method="post" enctype="multipart/form-data">
...@@ -34,7 +41,7 @@ ...@@ -34,7 +41,7 @@
<div class="create-job"> <div class="create-job">
<div class="assessment-criteria"> <div class="assessment-criteria">
<div class="form-group"> <div class="form-group">
<label class="label-16">Detail</label> <label class="label-16">Details</label>
<oneit:button value="EDIT" name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right" skin="link" <oneit:button value="EDIT" name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
...@@ -58,13 +65,31 @@ ...@@ -58,13 +65,31 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="row main-review-label"> <div class="row main-review-label">
<div class="col-sm-3 col-xs-12 review-label">Job Type</div> <div class="col-sm-3 col-xs-12 review-label">
<div class="col-sm-9 col-xs-12 review-data"><oneit:toString value="<%= job.getJobType() %>" mode="EscapeHTML" /></div> <oneit:label GUIName="Job Type" />
</div> </div>
<div class="row main-review-label"> <div class="col-sm-9 col-xs-12 review-data">
<div class="col-sm-3 col-xs-12 review-label">Client</div> <oneit:toString value="<%= job.getJobType() %>" mode="EscapeHTML" />
<div class="col-sm-9 col-xs-12 review-data">Australia Post</div> </div>
</div> </div>
<%
SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser.getCompany().showHasClientSupport())
{
%>
<div class="row main-review-label">
<div class="col-sm-3 col-xs-12 review-label">
<oneit:label GUIName="Client" />
</div>
<div class="col-sm-9 col-xs-12 review-data">
<oneit:toString value="<%= job.getClient() %>" mode="EscapeHTML" />
</div>
</div>
<%
}
%>
<div class="row main-review-label"> <div class="row main-review-label">
<div class="col-sm-3 col-xs-12 review-label"> <div class="col-sm-3 col-xs-12 review-label">
<oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" /> <oneit:ormlabel obj="<%= job %>" field="ReferenceNumber" />
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %> <%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded> <oneit:dynIncluded>
</oneit:dynIncluded> <%
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_CLIENT);
String clientPage = WebUtils.getSamePageInRenderMode(request, "Page");
ClientSortOption clientSortOpt = (ClientSortOption) process.getAttribute("ClientSortOption");
Client[] clients = (Client[]) process.getAttribute("Clients");
if( request.getParameter("ClientSortOption") != null)
{
clientSortOpt = ClientSortOption.forName((String) request.getParameter("ClientSortOption"));
}
if(clientSortOpt == null)
{
clientSortOpt = ClientSortOption.ALPHA_A_Z;
}
if(clients == null)
{
clients = Utils.getClientsByCompany(transaction);
process.setAttribute("Clients", clients);
}
List<Client> sortedClients = Utils.getClientsSorted(clients, clientSortOpt);
process.setAttribute("ClientSortOption", clientSortOpt);
%>
<oneit:form name="listClient" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Clients</div>
<oneit:button value="Add Client" name="gotoPage" cssClass="add-more-btn add-client-btn" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>"/>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (ClientSortOption sortOption : ClientSortOption.getClientSortOptionArray())
{
String optionLink = clientPage + "&ClientSortOption=" + sortOption.getName() ;
%>
<option <%= (clientSortOpt != null && clientSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div>
<div class="main-client-list">
<%
for(Client client : sortedClients)
{
%>
<div class="client-list" id="<%= client.getID() %>">
<div class="client-row">
<div class="client-name-cell jl-c">
<div class="client-name">
<a href="<%= nextPage+"&ClientID="+client.getObjectID() %>">
<oneit:toString value="<%= client.getClientName() %>" mode="EscapeHTML" />
</a>
</div>
</div>
<%
for (JobStatus jobStatus : JobStatus.getJobStatusArray())
{
int jobCount = client.getApplicationCountByStatus(jobStatus);
%>
<div class="<%= "application-count jl-c " + (jobCount == 0 ? "opaque-jobcount" : "")%>">
<oneit:toString value="<%= jobCount %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">
<oneit:toString value="<%= jobStatus.getDescription() %>" mode="EscapeHTML"/>
</span>
</div>
<%
}
%>
</div>
</div>
<%
}
%>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
if(jobs==null) if(jobs==null)
{ {
jobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(jobStatus)) SecUser txUser = SecUser.getTXUser(objTran);
.andSecUser(new EqualsFilter(SecUser.getTXUser(transaction)))
jobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(jobStatus))
.byCompany(txUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany())
.search(transaction); .search(transaction);
process.setAttribute(jobListName, jobs); process.setAttribute(jobListName, jobs);
...@@ -90,7 +92,8 @@ ...@@ -90,7 +92,8 @@
</div> </div>
<oneit:dynInclude page="/extensions/adminportal/inc/job_list.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" ShortlistPage="<%= shortlistPage %>" <oneit:dynInclude page="/extensions/adminportal/inc/job_list.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" ShortlistPage="<%= shortlistPage %>"
NextPage="<%= nextPage%>" HomePage="<%= homePage%>" Jobs="<%= sortedJobs.toArray(new Job[0]) %>" JobStatus="<%= jobStatus %>" /> NextPage="<%= nextPage%>" HomePage="<%= homePage%>" Jobs="<%= sortedJobs.toArray(new Job[0]) %>" JobStatus="<%= jobStatus %>"
JobSortOption="<%= jobSortOpt %>" />
</div> </div>
</oneit:form> </oneit:form>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %> <%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ page import="oneit.utils.filter.CollectionFilter"%>
<oneit:dynIncluded> <oneit:dynIncluded>
<%
String currentPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MANAGE_USERS).getLink(request);
String usersPage = WebUtils.getSamePageInRenderMode(request, "Page");
ObjectTransaction objTran = process.getTransaction ();
SecUser secUser = SecUser.getTXUser(objTran);
Company company = (Company) process.getAttribute("Company");
CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
Collection companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers");
Collection pendingUsers = (Collection<CompanyUser>) process.getAttribute("PendingUsers");
if(company==null)
{
company = comUser.getCompany();
process.setAttribute("Company", company);
}
if(companyUsers == null || pendingUsers == null)
{
companyUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)));
pendingUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE)));
process.setAttribute("CompanyUsers", companyUsers);
process.setAttribute("PendingUsers", pendingUsers);
}
if( request.getParameter("UserSortOption") != null)
{
userSortOpt = UserSortOption.forName((String) request.getParameter("UserSortOption"));
}
if(userSortOpt == null)
{
userSortOpt = UserSortOption.ALPHA_A_Z;
}
process.setAttribute("UserSortOption", userSortOpt);
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
%>
<script type="text/javascript">
$(document).ready(function()
{
$(".user-role").change(function()
{
var id = $(this).closest('.user-list-row').attr('id');
$('.save-user' + id).click();
});
});
</script>
<oneit:form name="listUsers" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="eq-justify-content">
<div class="manage-user-left">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Manage Users</div>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (UserSortOption sortOption : UserSortOption.getUserSortOptionArray())
{
String optionLink = usersPage + "&UserSortOption=" + sortOption.getName() ;
%>
<option <%= (userSortOpt != null && userSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div>
<div class="main-manage-userlist">
<%
for(CompanyUser companyUser : sortedCompanyUsers)
{
SecUser user = companyUser.getUser();
%>
<div class="user-list-row" id="<%= companyUser.getID() %>">
<div class="m-user-left">
<div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info">
<div class="m-user-name">
<oneit:toString value="<%= SecUserToNameTransform.INSTANCE.transform(user) %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
<oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" />
</div>
</div>
</div>
<div class="m-user-right">
<oneit:ormEnum obj="<%= companyUser %>" attributeName="Role" cssClass="form-control user-role"/>
</div>
<oneit:button name="save" value="Save" cssClass="<%= "save-user" + companyUser.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("CompanyUser", companyUser).mapEntry("nextPage", usersPage + "&UserSortOption=" + userSortOpt).toMap() %>" />
</div>
<%
}
%>
<!--
No button provided to edit a record, hence hiding this section
<div class="user-list-row">
<div class="m-save-user">
<input type="text" placeholder="First Name" class="form-control" />
<input type="text" placeholder="Surname" class="form-control" />
<input type="text" placeholder="Email" class="form-control" />
</div>
<div class="save-button">
<input type="button" class="btn btn-save" value="save">
</div>
</div>
-->
<%
for(CompanyUser pendingUser : sortedPendingUsers)
{
SecUser user = pendingUser.getUser();
String name = StringUtils.subBlanks(user.getName())!=null ? user.getName() : user.getUserName();
String resendTxt = "Re-send invitation to " + (StringUtils.subBlanks(user.getFirstName())!=null ? user.getFirstName() : StringUtils.subBlanks(user.getLastName())!=null ? user.getLastName() : user.getUserName());
%>
<div class="user-list-row" id="<%= pendingUser.getID() %>">
<div class="m-user-left">
<div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info">
<div class="m-user-name">
<oneit:toString value="<%= name %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
<oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" />
</div>
</div>
</div>
<div class="m-user-right invite-combo">
<select class="form-control" disabled="">
<option>Invitation sent</option>
</select>
</div>
<div class="resend-link">
<oneit:button value="<%= resendTxt %>" name="sendUserInvites" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("ResendUser", pendingUser)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent")
.toMap() %>" />
</div>
</div>
<%
}
%>
</div>
</div>
<div class="manage-user-right">
<div class="sidebar-title">
Invite a user
</div>
<div class="form-group">
<label><oneit:label GUIName="Email Address" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="UserEmail" cssClass="form-control" style="text-transform: lowercase"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="First Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="FirstName" cssClass="form-control"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Last Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="LastName" cssClass="form-control"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Role" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/>
</div>
<div class="invite-btn">
<oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent")
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded> </oneit:dynIncluded>
...@@ -14,4 +14,22 @@ CultureCriteria.CultureElementRating = Rating ...@@ -14,4 +14,22 @@ CultureCriteria.CultureElementRating = Rating
AssessmentCriteriaTemplate.TemplateName = Template Name AssessmentCriteriaTemplate.TemplateName = Template Name
CultureCriteriaTemplate.TemplateName = Template Name CultureCriteriaTemplate.TemplateName = Template Name
\ No newline at end of file
Client.ClientName = Client Name
Client.TimeZone = Time Zone
Client.PostCode = Postal Code
Client.Phone = Contact Phone Number
Client.Email = Contact Email Address
Client.ContactName = Contact First Name
Client.ContactSurname = Contact Last Name
Client.ClientLogo = Client Logo
Client.State = State or Province
Company.TimeZone = Time zone
Company.HasClientSupport = We help clients with hiring
Company.UserEmail = Email Address
Company.FirstName = First Name
Company.LastName = Last Name
Company.RoleType = Role
Company.CompanyLogo = Company Logo
#atleastOneRequirement = Please add at least one Requirement. #atleastOneRequirement = Please add at least one Requirement.
#exceedMaxShortlisted = Selected number of applications exceed maximum shortlist application count #exceedMaxShortlisted = Selected number of applications exceed maximum shortlist application count
#saveTemplateFirst = Please save template first, before proceeding to the next step #saveTemplateFirst = Please save template first, before proceeding to the next step
#passwordNotMatch = The password does not match. Please try again. #passwordNotMatch = The password does not match. Please try again.
\ No newline at end of file #invitationSent = Your invitation has been successfully sent.
#invalidEmail = Invalid email address.
<%@ page extends="oneit.servlets.jsp.JSPInclude" %> <%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded> <oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$("#upload").change(function(){
readURL(this);
});
$("#remove-logo").click(function(){
removeLogo();
});
});
</script>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Company</h1>
<div class="my-company-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="1" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<label class="label-16">Company Details</label>
</div>
<div class="form-group">
<label><oneit:label GUIName="Company Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" />
</div>
<div class="form-group">
<label><oneit:ormlabel obj="<%= company %>" field="CompanyLogo" /></label>
<div class="main-upload-logo">
<span class="u-img-tag" style="<%= company.getCompanyLogo() != null ? "" : "display: none" %>">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(company.getCompanyLogo()), "KEEP", new ScaleWithin (0,90)) %>"
class="upload-img-w-h" id="client-logo"/>
<span class="remove-logo-btn">
<img src="images/logo-remove-btn.png" id="remove-logo">
<oneit:ormInput obj="<%= company %>" type="text" attributeName="IsLogoDeleted" style="display:none;" />
</span>
</span>
<span class="up-rep-btn">
<oneit:ormInput obj="<%= company %>" type="file" attributeName="CompanyLogo" accept="image/*" id="upload"
style="visibility: hidden; width: 1px; height: 1px"/>
<a href="javascript:void(0)" onclick="document.getElementById('upload').click(); return false" id="replace-btn">
<%= company.getCompanyLogo() != null ? "Replace" : "Upload" %>
</a>
</span>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:label GUIName="Industry" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control"/>
</div>
</div>
<div class="form-group">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= company %>" id="has-client-support" attributeName="HasClientSupport" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="company.showHasClientSupport() ? 'checked': 'unchecked'" company="<%= company %>">
<label for="has-client-support">
<oneit:ormlabel obj="<%= company %>" field="HasClientSupport" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="form-brack-line-sub"></div>
<div class="form-group row">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="Country" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Country" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="State" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="State" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="PostCode" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= company %>" field="City" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="City" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:label GUIName="Default Timezone" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
<div class="text-center form-group">
<oneit:button value="Save Updates" name="saveCompany" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
</div>
</div>
</div>
</div>
</oneit:dynIncluded> </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>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Debug.assertion(companyUser != null , "Invalid user in admin portal my details");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
boolean emailChanged = request.getAttribute("EmailChanged") != null ? (boolean) request.getAttribute("EmailChanged") : false;
%>
<script type="text/javascript">
$(document).ready(function()
{
$('input[name$=ConfirmPassword]').val('');
<%
if(emailChanged)
{
%>
$('#password-confirm-popup').modal('show');
<%
}
%>
$(".close-popup-btn").click(function(){
$('#password-confirm-popup').modal('hide');
});
});
</script>
<oneit:form name="editUser" method="post" enctype="multipart/form-data">
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Details</h1>
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<div class="my-company-area">
<oneit:dynInclude page="/extensions/adminportal/inc/my_details_tabs.jsp" TabNumber="1" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
My Details
</div>
<div class="form-group">
<label><oneit:label GUIName="Email Address" /></label>
<%
if(companyUser.isLoggedViaSocial())
{
%>
<oneit:ormInput obj="<%= loggedInUser %>" type="text" attributeName="Email" cssClass="form-control" />
<%
}
else
{
%>
<oneit:ormInput obj="<%= loggedInUser %>" type="text" attributeName="UserName" cssClass="form-control" />
<% }
if(companyUser.getIsAccountVerified()!=Boolean.TRUE || companyUser.getIsEmailChanged()==Boolean.TRUE)
{
%>
<div class="email-verify">Email address not yet verified.
<oneit:button value=" " name="resendVerification" skin="link" cssClass="email-verify-link"
requestAttribs="<%= CollectionUtils.mapEntry("CompanyUser", companyUser)
.mapEntry("nextPage", nextPage)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailSent")
.toMap() %>">
Resend verification email
</oneit:button>
</div>
<%
}
%>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:label GUIName="First Name" /></label>
<oneit:ormInput obj="<%= loggedInUser %>" type="text" attributeName="FirstName" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:label GUIName="Last Name" /></label>
<oneit:ormInput obj="<%= loggedInUser %>" type="text" attributeName="LastName" cssClass="form-control" />
</div>
</div>
<div class="form-group">
<label><oneit:label GUIName="Phone" /></label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Phone" cssClass="form-control" />
</div>
<div class="text-center form-group">
<oneit:button value="Save Updates" name="saveUserDetails" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="password-confirm-popup" role="dialog">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body notification-popup">
<span class="close-popup-btn">
<img src="images/notification-popup-close.svg">
</span>
<h2>Nearly There!</h2>
<p>Please confirm your password to finish updating your email.</p>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control"/>
<div class="save-my-details">
<oneit:button value="Save" name="saveUserDetails" cssClass="btn btn-primary btn-orange save-my-details-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
...@@ -8,8 +8,21 @@ ...@@ -8,8 +8,21 @@
<% <%
//TODO: filter with Client; //TODO: filter with Client;
SecUser secUser = SecUser.getTXUser(transaction); SecUser secUser = SecUser.getTXUser(transaction);
Job[] jobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
.andSecUser(new EqualsFilter(secUser)) //to verify social login and redirect to login verification
if(secUser.hasRole(Utils.ROLE_CLIENT))
{
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser!=null && companyUser.isLoggedViaSocial() && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION).getLink(request));
return;
}
}
Job[] jobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
.byCompany(secUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany())
.search(transaction); .search(transaction);
Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS); Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS);
...@@ -17,6 +30,18 @@ ...@@ -17,6 +30,18 @@
String shortlistPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.APPLICANTS_SHORTLIST).toMap()); String shortlistPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.APPLICANTS_SHORTLIST).toMap());
String homePage = WebUtils.getSamePageInRenderMode(request, "Page"); String homePage = WebUtils.getSamePageInRenderMode(request, "Page");
String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap()); String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap());
boolean showModal = request.getParameter("showModal") != null ? Boolean.parseBoolean(request.getParameter("showModal")) : false;
if(showModal)
{
%>
<script>
$(document).ready(function(){
$('#welcomepopup').modal('show');
});
</script>
<%
}
%> %>
<oneit:form name="editJob" method="post" enctype="multipart/form-data"> <oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area"> <div class="dashboard-content-area">
...@@ -54,6 +79,12 @@ ...@@ -54,6 +79,12 @@
</oneit:button> </oneit:button>
<% <%
} }
else
{
%>
<div class="empty-area">&nbsp;</div>
<%
}
%> %>
</div> </div>
</div> </div>
...@@ -62,25 +93,26 @@ ...@@ -62,25 +93,26 @@
<div class="dash-count c-gray"> <div class="dash-count c-gray">
<% <%
Job[] filledJobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(JobStatus.FILLED)) Job[] filledJobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(JobStatus.FILLED))
.andSecUser(new EqualsFilter(SecUser.getTXUser(transaction))) .andCompanyUser(new EqualsFilter<>(secUser.getExtension(CompanyUser.REFERENCE_CompanyUser)))
.search(transaction); .search(transaction);
int filledCount = filledJobs != null ? filledJobs.length : 0; int filledCount = filledJobs != null ? filledJobs.length : 0;
if(filledCount > 0) if(filledCount > 0)
{ {
%> %>
<oneit:button value=" " name="navigateBetweenStatus" skin="link" <oneit:button value=" " name="navigateBetweenStatus" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.mapEntry("JobStatus", JobStatus.FILLED) .mapEntry("JobStatus", JobStatus.FILLED)
.toMap() %>"> .toMap() %>">
<oneit:toString value="<%= filledCount %>" mode="Integer" nullValue="0"/> <oneit:toString value="<%= filledCount %>" mode="Integer" nullValue="0"/>
</oneit:button> </oneit:button>
<% <%
} }
%> %>
<%= filledCount == 0 ? "0" : "" %> <%= filledCount == 0 ? "0" : "" %>
</div> </div>
<div class="d-box-title">Jobs filled</div> <div class="d-box-title">Jobs filled</div>
<div class="empty-area">&nbsp;</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -94,4 +126,18 @@ ...@@ -94,4 +126,18 @@
</div> </div>
</div> </div>
</oneit:form> </oneit:form>
<div class="modal fade" id="welcomepopup" role="dialog">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body main-welcome-popup">
<h2>Welcome to your Dashboard!</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a porta ex, ac suscipit quam. Donec aliquam hendrerit odio, et vestibulum turpis porttitor u phasellus nec velit in nibh eleifend.</p>
<div class="create-y-f-job">
<a href="<%= jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.CREATE_JOB).toMap()) %>">
Create your first job
</a>
</div>
</div>
</div>
</div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "reset_password_sent_jsp"; } %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<script type="text/javascript">
$(document.body).addClass('bg-color');
</script>
<div class="main-box-layout login-box">
<div>
<p>
Sent! Check your email now.<span><img class="smile-face smaller-face" src="<%= request.getContextPath() %>/images/smile-face.png" /></span>
</p>
</div>
</div>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
...@@ -12,42 +12,42 @@ ...@@ -12,42 +12,42 @@
%> %>
<%@ include file="inc/htmlheader_nopriv.jsp" %> <%@ include file="inc/htmlheader_nopriv.jsp" %>
<body class="bg-color">
<script type="text/javascript">
var interval;
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) { <script type="text/javascript">
$('.login-btn').attr('disabled', 'disabled'); var interval;
} else {
$('.login-btn').removeAttr('disabled'); $(document).ready(function() {
clearInterval(interval); validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
} }
} }
</script> });
<style>
button[disabled] { if (empty) {
opacity: 0.6; $('.login-btn').attr('disabled', 'disabled');
background-color: #0582ba; } else {
} $('.login-btn').removeAttr('disabled');
</style> clearInterval(interval);
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<div class="main-box-layout login-box"> <div class="main-box-layout login-box">
<oneit:form name="login" method="post"> <oneit:form name="login" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -62,21 +62,45 @@ ...@@ -62,21 +62,45 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<a href="#" class="forgot-pass" style="display: none">Forgot password?</a> <oneit:button value="Forgot password?" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "forgot_password.jsp")
.toMap() %>"></oneit:button>
<oneit:button value="Sign in" name="login" cssClass="box-btn login-btn" <oneit:button value="Sign in" name="login" cssClass="box-btn login-btn"
requestAttribs="<%= CollectionUtils.EMPTY_MAP%>"/> requestAttribs="<%= CollectionUtils.EMPTY_MAP%>"/>
</div> </div>
<div class="form-group">
<oneit:button value="Dont have an account? Create account" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_up.jsp")
.toMap() %>"></oneit:button>
</div>
</oneit:form> </oneit:form>
<div class="box-br-line"><span></span></div> <div class="box-br-line"><span></span></div>
<div class="box-label">Sign in using your social network of choice</div> <div class="box-label">Sign in using your social network of choice</div>
<oneit:form name="socialLogin" method="post"> <oneit:form name="socialLogin" method="post">
<ul class="social-login"> <ul class="social-login">
<li><a href="#"><img src="<%= request.getContextPath() %>/images/login-linkedin-icon.svg" /></a></li> <li>
<li><a href="#"><img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" /></a></li> <oneit:button value=" " name="linkedinOAuthLogin" skin="link" cssClass="social_login_btn"
<li><a href="#"><img src="<%= request.getContextPath() %>/images/login-google.png" /></a></li> disabled="<%= Utils.linkedInAvailable() ? "false" : "true" %>"
</ul> requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", nextPage).toMap() %>">
<img src="<%= request.getContextPath() %>/images/login-linkedin-icon.svg" />
</oneit:button>
</li>
<li>
<oneit:button value=" " name="facebookOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.facebookAvailable() ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", nextPage).toMap() %>">
<img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" />
</oneit:button>
</li>
<li>
<oneit:button value=" " name="googleOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.googleAvailable() ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", nextPage).toMap() %>">
<img src="<%= request.getContextPath() %>/images/login-google.png" />
</oneit:button>
</li>
</ul>
</oneit:form> </oneit:form>
</div> </div>
<%@ include file="inc/htmlfooter_nopriv.jsp" %> <%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "sign_up_jsp"; } %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Company", Company.REFERENCE_Company);
Company company = (Company) process.getAttribute("Company");
SecUser secUser = null;
CompanyUser companyUser = company.getAddedByUser();
if(companyUser==null)
{
secUser = SecUser.createSecUser(objTran);
companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
company.setAddedByUser(companyUser);
companyUser.setCompany(company);
}
secUser = companyUser.getUser();
if(toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(companyUser != null, "CompanyUser is null in admin portal");
%>
<script type="text/javascript">
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ( $.trim($( this ).val()) == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) {
$('.send-btn').attr('disabled', 'disabled');
} else {
$('.send-btn').removeAttr('disabled');
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<div class="hire-the-right-candi">Hire the right candidate</div>
<div>&nbsp;</div>
<oneit:form name="sign_up" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/>
<oneit:button value="Sign up" name="send" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true")
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailSent")
.mapEntry("Company", company)
.toMap() %>"/>
</div>
</oneit:form>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<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="info@talentology.com.au"/>
<NODE name="EmailSubject" factory="String" value="Password reset code"/>
<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>Hello,</p>
<p>We have received request&nbsp;to reset your&nbsp;account&nbsp;password.</p>
<p>Click below link to reset your password.</p>
<p>
<a href="${url}">Reset Passsword</a>
</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>We have received request&nbsp;to reset your&nbsp;account&nbsp;password.</p><p>Click below link to reset your password.</p><p>
<a href="${url}">Reset Passsword</a>
</p><p>Thank You.</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
delete from oneit_sec_user_extension where user_id in (select user_id from oneit_sec_role_grant where role_id = (select object_id from oneit_sec_role where name ='TL_Client'));
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Home">
<createSpecificIdentifier factory='String' value='HOME'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="HOME"/>
</articleIdentifiers>
<createdLabel factory="String" value="HOME"/>
<articleAttributeChanges factory="Map">
<NODE name="OnLeftMenu" factory="Boolean" value="false"/>
<NODE name="Shortcuts" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2000-01-01 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="3000-01-01 00:00:00"/>
<NODE name="Title" factory="String" value="Home"/>
<NODE name="ShortTitle" factory="String" value="Home"/>
<NODE name="SortOrder" factory="Integer" value="-200203"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="ADMIN_PORTAL_HOME"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link type="text/css" rel="stylesheet" href="css/cms_style.css">
</head>
<body class="CMS_GENERIC_EDITOR CMS_${oneit.Template} CMS_${oneit.Template}_${oneit.ContentType} CMS_${oneit.ContentType}">
<p>This is some content that should sit within the Home page.</p>
<br>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>This is some content that should sit within the Home page.</p>
<br>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<html>
<head>
<meta name='author' content='Cougar Content by 1iT www.1it.com.au'>
<link href="css/cms_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>
</p>
<br>
</body>
</html>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select user_id from oneit_sec_role_grant where role_id = (select object_id from oneit_sec_role where name ='TL_Client') fetch first 1 row only">
<tableName factory="String">tl_company</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="CompanyID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='company_name' factory='String'>Talentology</value>
<value name='hiring_team_type' factory='String'>SMB</value>
<value name='added_by_user_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="user_id"/> <!-- Dummy value. Will be updated in next sql script-->
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select user_id from oneit_sec_role_grant where role_id = (select object_id from oneit_sec_role where name ='TL_Client')">
<tableName factory="String">oneit_sec_user_extension</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_type' factory='String'>CompanyUser</value>
<value name='role_type' factory='String'>ADMIN</value>
<value name='is_account_verified' factory='Boolean'>true</value>
<value name='user_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="user_id" />
<value name='company_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="CompanyID"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
-- @AutoRun
update tl_company set added_by_user_id = (select object_id from oneit_sec_user_extension ext where ext.user_id = added_by_user_id);
update tl_job set company_user_id = (select object_id from oneit_sec_user_extension ext where ext.user_id = secuser_id);
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<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">
<createSpecificIdentifier factory='String' value='VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ"/>
</articleIdentifiers>
<createdLabel factory="String" value="VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ"/>
<newParentCategory factory="String" value="created:5L47UE8LMI51VOIOS8YTLLVQAT5NTW"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="Null"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="Shortcuts" factory="String" value="CompanyAccountVerification"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-06-20 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-06-20 13:00:00"/>
<NODE name="Title" factory="String" value="Company Account Verification"/>
<NODE name="ShortTitle" factory="String" value="Account Verification"/>
<NODE name="SortOrder" factory="Integer" value="-36831674"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="COMPANY_ACCOUNT_VERIFICATION"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" 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>&nbsp;</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>&nbsp;</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" 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 xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="MyDetails">
<createSpecificIdentifier factory='String' value='2O6A4WA2OL0K5Y1ZANF682XLJWG5RO'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="2O6A4WA2OL0K5Y1ZANF682XLJWG5RO"/>
</articleIdentifiers>
<createdLabel factory="String" value="2O6A4WA2OL0K5Y1ZANF682XLJWG5RO"/>
<newParentCategory factory="String" value="created:5L47UE8LMI51VOIOS8YTLLVQAT5NTW"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="Null"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="Shortcuts" factory="String" value="MyDetails"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-07-04 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-07-04 10:00:00"/>
<NODE name="Title" factory="String" value="MyDetails"/>
<NODE name="ShortTitle" factory="String" value="MyCompany"/>
<NODE name="SortOrder" factory="Integer" value="37839082"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="MY_DETAILS"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" 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 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"/>
<newParentCategory factory="String" value="RESOURCE_LIBRARY"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="info@talentology.com.au"/>
<NODE name="EmailSubject" factory="String" value="Verify your email"/>
<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>Hello,</p>
<p>Welcome to Talantology! Your account has been created.</p>
<p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>Welcome to Talantology! Your account has been created.</p><p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p><p>Thank You.</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 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"/>
<newParentCategory factory="String" value="RESOURCE_LIBRARY"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="info@talentology.com.au"/>
<NODE name="EmailSubject" factory="String" value="Invitation to join Talentology"/>
<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>
<strong>Join Talentology</strong>
</p>
<p>You are invited to join Talentology. To accept this invitation, <a href="${link}">click here</a>.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>
<strong>Join Talentology</strong>
</p><p>You are invited to join Talentology. To accept this invitation, <a href="${link}">click here</a>.</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"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select 'cms:ViewPrivilege:' || identifier as privname from oneit_content_article WHERE template='MANAGE_USERS' fetch first 1 row only">
<tableName factory="String">oneit_sec_privilege</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="manageUserViewPrivID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="privname"/>
<value name='category' factory='String' value="CMS"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select 'cms:ViewPrivilege:' || identifier as privname from oneit_content_article WHERE template='MY_COMPANY' fetch first 1 row only">
<tableName factory="String">oneit_sec_privilege</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="myCompanyViewPrivID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>cms:ViewPrivilege:L81G02K5MTK0TOFUS8WCGZ42NSR06P</value>
<value name='category' factory='String' value="CMS"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select object_id as roleid from oneit_sec_role where name='TL_CompanyAdmin'">
<tableName factory="String">oneit_sec_role_priv_link</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='priv_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="manageUserViewPrivID"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="roleid"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select object_id as roleid from oneit_sec_role where name='TL_CompanyAdmin'">
<tableName factory="String">oneit_sec_role_priv_link</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='priv_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="myCompanyViewPrivID"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="roleid"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Clients">
<createSpecificIdentifier factory='String' value='WYYPYG4D0N1FUERJX49D90I44AAD2Z'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="WYYPYG4D0N1FUERJX49D90I44AAD2Z"/>
</articleIdentifiers>
<createdLabel factory="String" value="WYYPYG4D0N1FUERJX49D90I44AAD2Z"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="Null"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Allow Disable" factory="Boolean" value="true"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="String" value="Clients"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="String" value="client-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="Clients"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-07-04 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-07-04 10:00:00"/>
<NODE name="Title" factory="String" value="Clients"/>
<NODE name="ShortTitle" factory="String" value="Clients"/>
<NODE name="SortOrder" factory="Integer" value="37839080"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="CLIENTS"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" 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
-- @AutoRun
UPDATE oneit_content_article
SET privilege_id = (SELECT object_id FROM oneit_sec_privilege priv WHERE priv.name = 'cms:ViewPrivilege:' || identifier)
WHERE template = 'MANAGE_USERS';
UPDATE oneit_content_article
SET privilege_id = (SELECT object_id FROM oneit_sec_privilege priv WHERE priv.name = 'cms:ViewPrivilege:' || identifier)
WHERE template = 'MY_COMPANY';
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<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"/>
<newParentCategory factory="String" value="RESOURCE_LIBRARY"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="help@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Email address changed"/>
<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>Hello</p>
<p>Thanks for taking the time to update your contact email address.</p>
<p>To verify your email, please <a href="${link}">click here</a>.</p>
<p>If you haven't requested the change or believe this email was sent by mistake, please do note take any action.</p>
<p>Thanks :)</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello</p><p>Thanks for taking the time to update your contact email address.</p><p>To verify your email, please <a href="${link}">click here</a>.</p><p>If you haven't requested the change or believe this email was sent by mistake, please do note take any action.</p><p>Thanks :)</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 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="help@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Account Created"/>
<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>Hello,</p>
<p>You have successfully registered and&nbsp;created&nbsp;an&nbsp;account&nbsp;with Talentology.</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>You have successfully registered and&nbsp;created&nbsp;an&nbsp;account&nbsp;with Talentology.</p><p>Thank You.</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 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@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Verify your email"/>
<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>Welcome to Talentology! Your account has been created.</p>
<p>To verify your account, please <a href="${link}">click here</a>.</p>
<p>Thanks :)</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Welcome to Talentology! Your account has been created.</p><p>To verify your account, please <a href="${link}">click here</a>.</p><p>Thanks :)</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 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="help@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Verify your email"/>
<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>Hello,</p>
<p>Welcome to Talantology! Your account has been created.</p>
<p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>Welcome to Talantology! Your account has been created.</p><p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p><p>Thank You.</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 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="help@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Invitation to join Talentology"/>
<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>
<strong>Join Talentology</strong>
</p>
<p>You are invited to join Talentology. To accept this invitation, <a href="${link}">click here</a>.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>
<strong>Join Talentology</strong>
</p><p>You are invited to join Talentology. To accept this invitation, <a href="${link}">click here</a>.</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 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="help@talentology.com"/>
<NODE name="EmailSubject" factory="String" value="Password reset code"/>
<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>Hello,</p>
<p>We have received request&nbsp;to reset your&nbsp;account&nbsp;password.</p>
<p>Click below link to reset your password.</p>
<p>
<a href="${url}">Reset Passsword</a>
</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>We have received request&nbsp;to reset your&nbsp;account&nbsp;password.</p><p>Click below link to reset your password.</p><p>
<a href="${url}">Reset Passsword</a>
</p><p>Thank You.</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
<%@ 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" %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, "CompanyProfile");
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
SecUser secUser = null;
Boolean socialLogin = Boolean.FALSE;
//to process company user verification
String id = request.getParameter("id");
String key = request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null && key!=null)
{
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id), key);
if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
secUser = companyUser.getUser();
process.setAttribute("CompanyUser", companyUser);
invalid = Boolean.FALSE;
}
}
if(invalid)
{
//to handle social login
SecUser logedInUser = SecUser.getTXUser(transaction);
companyUser = logedInUser != null ? logedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser) : null;
if(logedInUser!=null
&& logedInUser.hasRole(Utils.ROLE_CLIENT)
&& companyUser!=null
&& companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
socialLogin = Boolean.TRUE;
}
else
{
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request));
}
}
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) {
$('.verify-btn').attr('disabled', 'disabled');
} else {
$('.verify-btn').removeAttr('disabled');
clearInterval(interval);
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="verify" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/>
<%
if(!socialLogin)
{
%>
<div class="form-group text-left">
<label>Password</label>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="Password" cssClass="form-control second-style reset-pw" required="true"/>
</div>
<div class="form-group text-left">
<label>Confirm password</label>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control second-style reset-pw " required="true"/>
</div>
<%
}
%>
<oneit:button value="Verify and login" name="verifyCompanyUser" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("socialLogin", socialLogin)
.mapEntry("nextPage", nextPage).toMap() %>"/>
</div>
</oneit:form>
</oneit:dynIncluded>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
tabNumber="1" tabNumber="1"
sortOption="<%= appSortOpt %>" sortOption="<%= appSortOpt %>"
currentPage="<%= currentPage %>" currentPage="<%= currentPage %>"
showOrderBy="<%= sortedApplications.size() > 0 %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/> data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp" <oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp"
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
currentPage="<%= currentPage %>" currentPage="<%= currentPage %>"
tabNumber="1" tabNumber="1"
isShortList="<%= Boolean.TRUE %>" isShortList="<%= Boolean.TRUE %>"
showOrderBy="<%= sortedApplications.size() > 0 %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/> data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp" <oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp"
......
...@@ -16,18 +16,6 @@ ...@@ -16,18 +16,6 @@
process.setAttribute("Job", job); process.setAttribute("Job", job);
} }
Boolean isExpand = (Boolean) process.getAttribute("IsExpand");
if(request.getParameter("Expand") != null)
{
isExpand = CollectionUtils.equals((String) request.getParameter("Expand"), "Y");
}
if(isExpand == null)
{
isExpand = Boolean.FALSE;
}
Debug.assertion(job != null, "Job is null in admin portal view applicants"); Debug.assertion(job != null, "Job is null in admin portal view applicants");
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION); String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
...@@ -56,7 +44,6 @@ ...@@ -56,7 +44,6 @@
List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>(); List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>();
process.setAttribute("AppSortOption", appSortOpt); process.setAttribute("AppSortOption", appSortOpt);
process.setAttribute("IsExpand", isExpand);
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -114,7 +101,7 @@ ...@@ -114,7 +101,7 @@
currentPage="<%= currentPage %>" currentPage="<%= currentPage %>"
tabNumber="2" tabNumber="2"
isShortList="<%= Boolean.TRUE %>" isShortList="<%= Boolean.TRUE %>"
expand="<%= isExpand %>" showOrderBy="<%= sortedApplications.size() > 0 %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/> data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -127,24 +114,24 @@ ...@@ -127,24 +114,24 @@
Candidate candidate = jobApplication.getCandidate(); Candidate candidate = jobApplication.getCandidate();
String appID = "app-id-" + jobApplication.getID().toString(); String appID = "app-id-" + jobApplication.getID().toString();
Map<FactorClass, Double> roleScoreMap = (Map<FactorClass, Double>)jobApplication.getRoleFit(); Map<FactorClass, Tuple.T2<Double, ColorCode>> roleScoreMap = (Map<FactorClass, Tuple.T2<Double, ColorCode>>)jobApplication.getRoleFit();
%> %>
<div class="<%= "appl-c-box " + (i == 0 ? " cb-one" : "")%> "> <div class="<%= "appl-c-box " + (i == 0 ? " cb-one" : "")%> ">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
<div class="<%= "cb-title " + (i == 0 ? "green-back" : (i < 3 ? "blue-back" : "dark-back" ))%> ">
<div class="checkbox-list grid-checkbox">
<div class="checkbox-list">
<input type="checkbox" name="IsSelected" value="<%= jobApplication.getObjectID().toString() %>" id="<%= appID %>" class="applicant" >
<label for="<%= appID %>">
<oneit:toString value="<%= candidate %>" mode="EscapeHTML" />
</label>
</div>
</div>
</div>
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", sortedApplications).toMap())
.toMap() %>"> .toMap() %>">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
<div class="<%= "cb-title " + (i == 0 ? "green-back" : (i < 3 ? "blue-back" : "dark-back" ))%> ">
<div class="checkbox-list grid-checkbox">
<div class="checkbox-list">
<input type="checkbox" name="IsSelected" value="<%= jobApplication.getObjectID().toString() %>" id="<%= appID %>" class="applicant" >
<label for="<%= appID %>">
<oneit:toString value="<%= candidate %>" mode="EscapeHTML" />
</label>
</div>
</div>
</div>
<div class="overall-suitablity grid-suitability"> <div class="overall-suitablity grid-suitability">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this--> <!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
<div class="<%= "over-all " + (i == 0 ? "f-60 green" : (i < 3 ? "blue" : "gray"))%>"> <div class="<%= "over-all " + (i == 0 ? "f-60 green" : (i < 3 ? "blue" : "gray"))%>">
...@@ -160,17 +147,20 @@ ...@@ -160,17 +147,20 @@
<div class="detail-box"> <div class="detail-box">
<% <%
for(FactorClass factorClass : jobApplication.getSortedFactorClasses()) for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
{ {
if(factorClass != null && roleScoreMap.get(factorClass) != null)
{
%> %>
<div class="detail-row"> <div class="detail-row">
<div class="detail-label"> <div class="detail-label">
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/> <oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
</div> </div>
<div class="detail-no green"> <div class="detail-no green">
<oneit:toString value="<%= roleScoreMap.get(factorClass) %>" mode="TwoDPDouble"/> <oneit:toString value="<%= roleScoreMap.get(factorClass).get0() %>" mode="TwoDPDouble"/>
</div> </div>
</div> </div>
<% <%
}
} }
%> %>
</div> </div>
...@@ -181,13 +171,13 @@ ...@@ -181,13 +171,13 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"> .toMap() %>">
<oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="PercentageWholeNumber" /> <oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="WholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
<div class="detail-box"> <div class="detail-box">
<% <%
Map<CultureClass, Long> cultureFitData = (Map<CultureClass, Long>)jobApplication.getCultureFit(); Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>> cultureFitData = (Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>>)jobApplication.getCultureFit();
for(CultureClass cClass: cultureFitData.keySet()) for(CultureClass cClass: cultureFitData.keySet())
{ {
...@@ -198,24 +188,28 @@ ...@@ -198,24 +188,28 @@
%> %>
<div class="detail-row"> <div class="detail-row">
<div class="detail-label"><oneit:toString value="<%= cClass %>" mode="EscapeHTML"/></div> <div class="detail-label"><oneit:toString value="<%= cClass %>" mode="EscapeHTML"/></div>
<div class="detail-no green"><oneit:toString value="<%= cultureFitData.get(cClass) %>" mode="PercentageWholeNumber" /></div> <div class="detail-no green"><oneit:toString value="<%= cultureFitData.get(cClass) != null ? cultureFitData.get(cClass).get0() : 0 %>" mode="WholeNumber" /></div>
</div> </div>
<% <%
} }
%> %>
</div> </div>
<div class="jcc"> <%
<img src="images/criteria-icon.svg"> Requirements if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
<span> {
<oneit:button value=" " name="gotoPage" skin="link" %>
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage) <div class="jcc">
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) <img src="images/criteria-icon.svg"> Requirements
.toMap() %>"> <span>
<oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="PercentageWholeNumber" /> <oneit:button value=" " name="gotoPage" skin="link"
</oneit:button> requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
</span> .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
</div> .toMap() %>">
<div class="detail-box"> <oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="WholeNumber" />
</oneit:button>
</span>
</div>
<div class="detail-box">
<% <%
Map<Importance, Long> requirementFitData = (Map<Importance, Long>)jobApplication.getRequirementFit(); Map<Importance, Long> requirementFitData = (Map<Importance, Long>)jobApplication.getRequirementFit();
...@@ -228,12 +222,15 @@ ...@@ -228,12 +222,15 @@
%> %>
<div class="detail-row"> <div class="detail-row">
<div class="detail-label"><oneit:toString value="<%= importance %>" mode="EscapeHTML"/></div> <div class="detail-label"><oneit:toString value="<%= importance %>" mode="EscapeHTML"/></div>
<div class="detail-no green"><oneit:toString value="<%= requirementFitData.get(importance) %>" mode="PercentageWholeNumber" /></div> <div class="detail-no green"><oneit:toString value="<%= requirementFitData.get(importance) %>" mode="WholeNumber" /></div>
</div> </div>
<% <%
} }
%> %>
</div> </div>
<%
}
%>
</div> </div>
</oneit:button> </oneit:button>
</div> </div>
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<oneit:dynInclude page="/extensions/adminportal/inc/application_sorting_bar.jsp" <oneit:dynInclude page="/extensions/adminportal/inc/application_sorting_bar.jsp"
sortOption="<%= appSortOpt %>" sortOption="<%= appSortOpt %>"
currentPage="<%= currentPage %>" currentPage="<%= currentPage %>"
showOrderBy="<%= sortedApplications.size() > 0 %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/> data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp" <oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp"
......
...@@ -15,19 +15,7 @@ ...@@ -15,19 +15,7 @@
process.setAttribute("Job", job); process.setAttribute("Job", job);
} }
Boolean isExpand = (Boolean) process.getAttribute("IsExpand");
if(request.getParameter("Expand") != null)
{
isExpand = CollectionUtils.equals((String) request.getParameter("Expand"), "Y");
}
if(isExpand == null)
{
isExpand = Boolean.FALSE;
}
Debug.assertion(job != null, "Job is null in admin portal view applicants"); Debug.assertion(job != null, "Job is null in admin portal view applicants");
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION); String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
...@@ -59,7 +47,6 @@ ...@@ -59,7 +47,6 @@
List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>(); List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>();
process.setAttribute("AppSortOption", appSortOpt); process.setAttribute("AppSortOption", appSortOpt);
process.setAttribute("IsExpand", isExpand);
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -116,7 +103,7 @@ ...@@ -116,7 +103,7 @@
sortOption="<%= appSortOpt %>" sortOption="<%= appSortOpt %>"
currentPage="<%= currentPage %>" currentPage="<%= currentPage %>"
tabNumber="2" tabNumber="2"
expand="<%= isExpand %>" showOrderBy="<%= sortedApplications.size() > 0 %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/> data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -126,17 +113,24 @@ ...@@ -126,17 +113,24 @@
for(JobApplication jobApplication : sortedApplications) for(JobApplication jobApplication : sortedApplications)
{ {
String appID = "app-id-" + jobApplication.getID().toString();
%> %>
<div class="appl-c-box application-row"> <div class="appl-c-box application-row">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
<div class="<%= "cb-title " + (index == 0 ? "green-back" : (index < 3 ? "blue-back" : "dark-back" ))%> ">
<div class="checkbox-list grid-checkbox">
<div class="checkbox-list">
<input type="checkbox" name="IsSelected" value="<%= jobApplication.getObjectID().toString() %>" id="<%= appID %>" class="applicant" >
<label for="<%= appID %>">
<oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" />
</label>
</div>
</div>
</div>
<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).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", sortedApplications).toMap())
.toMap() %>"> .toMap() %>">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
<div class="<%= "cb-title " + (index == 0 ? "green-back" : (index < 3 ? "blue-back" : "dark-back" ))%> ">
<oneit:toString value="<%= jobApplication.getCandidate() %>" mode="EscapeHTML" />
</div>
<div class="overall-suitablity"> <div class="overall-suitablity">
<div class="<%= "overall " + (index == 0 ? "f-60" : "")%>">overall rank</div> <div class="<%= "overall " + (index == 0 ? "f-60" : "")%>">overall rank</div>
<div class="<%= "over-all " + (index == 0 ? "f-60 green" : (index < 3 ? "blue" : "gray"))%> "> <div class="<%= "over-all " + (index == 0 ? "f-60 green" : (index < 3 ? "blue" : "gray"))%> ">
...@@ -162,21 +156,28 @@ ...@@ -162,21 +156,28 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"> .toMap() %>">
<oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="PercentageWholeNumber" /> <oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="WholeNumber" />
</oneit:button>
</span>
</div>
<div class="criteria jcc">
<img src="images/criteria-icon.svg"> requirements
<span>
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>">
<oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
<%
if(job.getIncludeAssessmentCriteria()==Boolean.TRUE)
{
%>
<div class="criteria jcc">
<img src="images/criteria-icon.svg"> requirements
<span>
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicationPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>">
<oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="WholeNumber" />
</oneit:button>
</span>
</div>
<%
}
%>
</div> </div>
</oneit:button> </oneit:button>
</div> </div>
......
...@@ -7,48 +7,92 @@ ...@@ -7,48 +7,92 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication"); JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
List<JobApplication> applications = (List<JobApplication>) process.getAttribute("Applications");
if(request.getParameter("JobApplicationID")!=null)
{
jobApplication = JobApplication.getJobApplicationByID(transaction, Long.parseLong(request.getParameter("JobApplicationID")));
process.setAttribute("JobApplication", jobApplication);
process.setAttribute("Job", jobApplication.getJob());
}
Debug.assertion(jobApplication != null, "JobApplication is null in admin portal view applicants"); Debug.assertion(jobApplication != null, "JobApplication is null in admin portal view applicants");
Job job = jobApplication.getJob(); Job job = jobApplication.getJob();
String samePage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION); String samePage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
//to navigation between applications
if(applications==null)
{
applications = Utils.getApplicationsSorted(job.getJobApplicationsSet().toArray(new JobApplication[job.getJobApplicationsSet().size()]), AppSortOption.RANK);
process.setAttribute("Applications", applications);
}
int appPosition = applications.indexOf(jobApplication);
int prevNo = appPosition - 1;
int nextNo = appPosition + 1;
JobApplication prevApp = prevNo<0 ? applications.get(applications.size()-1) : applications.get(prevNo);
JobApplication nextApp = nextNo>=applications.size() ? applications.get(0) : applications.get(nextNo);
%> %>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
{ {
$('.percent-role').percentageLoader({ $('.percent-red-b').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 20, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#67b413', ringColor: '#f9623d',
textColor: '#67b413', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: false
}); });
$('.percent-yellow-b').percentageLoader({
$('.percent-culture').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 20, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#67b413', ringColor: '#ffd14c',
textColor: '#67b413', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal' fontWeight: 'normal',
showPercent: false
});
$('.percent-green-b').percentageLoader({
valElement: 'p',
strokeWidth: 15,
bgColor: '#e5e8eb',
ringColor: '#03ac66',
textColor: '#4a4a4a',
fontSize: '30px',
fontWeight: 'normal',
showPercent: false
}); });
$('.percent-req').percentageLoader({ $('.percent-green').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 20, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#03a0e7', ringColor: '#41bdb4',
textColor: '#03a0e7', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal' fontWeight: 'normal',
showPercent: false
}); });
$('.percent-blue').percentageLoader({
valElement: 'p',
strokeWidth: 15,
bgColor: '#e5e8eb',
ringColor: '#fbd44e',
textColor: '#4a4a4a',
fontSize: '30px',
fontWeight: 'normal',
showPercent: false
});
}); });
</script> </script>
...@@ -59,7 +103,9 @@ ...@@ -59,7 +103,9 @@
<oneit:dynInclude page="/extensions/adminportal/inc/job_title_bar.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/adminportal/inc/job_title_bar.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div> </div>
<div class="second-part v-applicant-area"> <div class="second-part v-applicant-area">
<oneit:dynInclude page="/extensions/adminportal/inc/view_application_tab_applicant.jsp" data="<%= CollectionUtils.EMPTY_MAP %>"/> <oneit:dynInclude page="/extensions/adminportal/inc/view_application_tab_applicant.jsp"
data="<%= CollectionUtils.mapEntry("prevAppID", prevApp.getObjectID())
.mapEntry("nextAppID", nextApp.getObjectID()).toMap() %>"/>
</div> </div>
</div> </div>
</oneit:form> </oneit:form>
......
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
$("select[name$='CultureTemplate']").change(function(){ $("select[name$='CultureTemplate']").change(function(){
$("button[name$='loadCultureFromTemplate']").click(); $("button[name$='loadCultureFromTemplate']").click();
}); });
var showError = true;
addPostRecalcHandler (function ($fieldThatChanged) {
if(showError) {
showError = false;
$('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus();
}
recalcFunction();
});
}); });
</script> </script>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,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">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/> <AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
</FORM> </FORM>
<FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/> <FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/>
<FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/> <FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/>
...@@ -13,16 +13,21 @@ ...@@ -13,16 +13,21 @@
<FORM name="*.sendVerificationMail" factory="Participant" class="performa.form.SendVerificationMailFP"> <FORM name="*.sendVerificationMail" factory="Participant" class="performa.form.SendVerificationMailFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountVerificationMail"/> <AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountVerificationMail"/>
</FORM> </FORM>
<FORM name="*.facebookOAuthLogin" factory="Participant" class="oneit.security.oauth.form.FacebookOAuthLoginFP"/>
<FORM name="*.googleOAuthLogin" factory="Participant" class="oneit.security.oauth.form.GoogleOAuthLoginFP"/>
<FORM name="*.linkedinOAuthLogin" factory="Participant" class="performa.form.LinkedInOAuthLoginFP"/>
<FORM name="*.forgotPassword" factory="Participant" class="performa.form.ForgotPasswordFP">
<ResetCodeEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="ResetCodeEmail"/>
</FORM>
<FORM name="*.resetPassword" factory="Participant" class="performa.form.ResetPasswordFP"/>
</NODE> </NODE>
<NODE name="dynamic_content_form_applicant" factory="Participant"> <NODE name="dynamic_content_form_applicant" factory="Participant">
<INHERITS factory="Named" nodename="dynamic_content_form"/> <INHERITS factory="Named" nodename="dynamic_content_form"/>
<DECORATOR id="auth" factory="MetaComponent" component="ApplicantPortalAuthDecorator" priv="TL_AccessApplicantPortal"/> <DECORATOR id="auth" factory="MetaComponent" component="ApplicantPortalAuthDecorator" priv="TL_AccessApplicantPortal"/>
</NODE> </NODE>
<NODE name="ApplicantPortalAuthDecorator" factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator"> <NODE name="ApplicantPortalAuthDecorator" factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator">
<AUTHENTICATOR factory="Participant" class="oneit.security.SecurityAuthenticator"> <AUTHENTICATOR factory="Participant" class="oneit.security.SecurityAuthenticator">
<PRIVILEGE factory="Parameter" param="priv"/> <PRIVILEGE factory="Parameter" param="priv"/>
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
<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="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
<RenderMode name="ResetPassword" preIncludeJSP="extensions/applicantportal/reset_password.jsp"/>
<RenderMode name="ResetPasswordSent" preIncludeJSP="extensions/applicantportal/reset_password_sent.jsp"/>
</NODE> </NODE>
......
...@@ -76,8 +76,19 @@ ...@@ -76,8 +76,19 @@
} }
process.setAttribute("JobApplication", jobApplication); process.setAttribute("JobApplication", jobApplication);
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<div class="welcome-aust-logo">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
</div>
<%
}
%> %>
<div class="welcome-aust-logo"><img src="images/logo.svg" /></div>
<div class="welcome-title">Welcome <oneit:toString value="<%= candidate.getFirstName() %>"/>, here's your application outline</div> <div class="welcome-title">Welcome <oneit:toString value="<%= candidate.getFirstName() %>"/>, here's your application outline</div>
<div class="appli-aust-title"> <div class="appli-aust-title">
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$('input[type="text"]').keyup(function() {
$(this).change();
});
});
</script>
<style>
.btn-disabled button{
opacity: 0.6;
background-color: #0582ba;
}
#right-mark {
width: 24px;
height: 24px;
border-radius: 30px;
position: absolute;
top: 51%;
right: 37px;
background-color: #67b413;
padding-top: 5px;
}
#right-mark img {
width: 15px;
height: 15px;
display: block;
margin: auto auto;
}
</style>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job");
%>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<oneit:form name="forgotPassword" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<div class="text-left">
<p>
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link.
</p>
</div>
<div>&nbsp;</div>
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="Email" cssClass="form-control second-style" style="text-transform: lowercase" autocomplete="off"/>
<oneit:recalcClass htmlTag="div" classScript="job.isEmailFound() ? 'show': 'hide'" job="<%= job %>" class="right-mark">
<span id="right-mark"><img src="images/right-mark.svg"/></span>
</oneit:recalcClass>
</div>
<div class="form-group">
<oneit:recalcClass htmlTag="div" classScript="job.isEmailFound() ? 'show': 'btn-disabled'" job="<%= job %>">
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ResetPasswordSent"))
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>"/>
</oneit:recalcClass>
</div>
</div>
</oneit:form>
</div>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -31,6 +31,32 @@ ...@@ -31,6 +31,32 @@
process.setAttribute("AllQuestions", allQuestions); process.setAttribute("AllQuestions", allQuestions);
} }
//to store current question number in history
if(process.getAttribute("QuestionNumber")==null || process.getAttribute("ActualNumber")==null)
{
request.getSession().setAttribute ("historyQstNo", null);
request.getSession().setAttribute ("historyActualNo", null);
}
if(request.getSession().getAttribute("historyQstNo")!=null && process.getAttribute("QuestionNumber")!= null)
{
if((int) process.getAttribute("QuestionNumber") <= (int) request.getSession().getAttribute("historyQstNo"))
{
questionNumber = (int) request.getSession().getAttribute("historyQstNo");
}
}
if(request.getSession().getAttribute("historyActualNo")!=null && process.getAttribute("ActualNumber")!= null)
{
if((int) process.getAttribute("ActualNumber") <= (int) request.getSession().getAttribute("historyActualNo"))
{
actualNumber = (int) request.getSession().getAttribute("historyActualNo");
}
}
request.getSession().setAttribute ("historyQstNo", questionNumber);
request.getSession().setAttribute ("historyActualNo", actualNumber);
boolean toRedirect = jobApplication.initAssessmentAnswers(allQuestions); boolean toRedirect = jobApplication.initAssessmentAnswers(allQuestions);
...@@ -64,8 +90,19 @@ ...@@ -64,8 +90,19 @@
<div class="main-application-outline"> <div class="main-application-outline">
<div class="selection-aust-logo"> <div class="selection-aust-logo">
<img src="images/logo.svg" /> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span> <span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
<div class="clearfix no-height"></div>
</div> </div>
<div class="show-mobile-title"> <div class="show-mobile-title">
<div class="mobile-title-page">Your Work Style</div> <div class="mobile-title-page">Your Work Style</div>
......
...@@ -28,7 +28,19 @@ ...@@ -28,7 +28,19 @@
</style> </style>
<div class="main-position-overview"> <div class="main-position-overview">
<%-- <div class="aust-logo"> <img src="images/logo.svg"> </div> --%> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<div class="aust-logo">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
</div>
<%
}
%>
<div class="overview-title"> <div class="overview-title">
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
</div> </div>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
String candidateID = (String) process.getAttribute("candidateID"); //request.getParameter("id");
String forgotpasswordCode = (String) process.getAttribute("forgotpasswordCode"); //request.getParameter("key");
SecUser user = (SecUser) process.getAttribute("SecUser");
String nextPage = WebUtils.getSamePageInRenderMode(request, "SignIn");
Job job = (Job) process.getAttribute("Job");
if(request.getParameter("id")!= null)
{
candidateID = request.getParameter("id");
process.setAttribute("candidateID", candidateID);
}
if(request.getParameter("key")!= null)
{
forgotpasswordCode = request.getParameter("key");
process.setAttribute("forgotpasswordCode", forgotpasswordCode);
}
if(request.getParameter("jid")!= null)
{
String jobID = request.getParameter("jid");
job = Job.getJobByID(objTran, Long.parseLong(jobID));
process.setAttribute("Job", job);
}
if(StringUtils.subBlanks(candidateID) != null)
{
Candidate candidate = Candidate.getCandidateForForgotPassword(objTran, candidateID, forgotpasswordCode);
if(candidate != null)
{
user = candidate.getUser();
process.setAttribute("SecUser", user);
}
}
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
});
function validate() {
var empty = false;
$('.password-field').each(function() {
if ( $.trim($( this ).val()) == '') {
empty = true;
}
});
if (empty) {
$('.reset-btn').attr('disabled', 'disabled');
} else {
$('.reset-btn').removeAttr('disabled');
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<oneit:form name="resetPassword" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<%
if(user!=null)
{
String key = Utils.getPwdKeyOfSecUser(request, user, true);
%>
<div class="main-box-layout login-box">
<div class="text-left">
<p >
Please enter a new password below.
</p>
</div>
<div>&nbsp;</div>
<div class="form-group text-left">
<label>Password *</label>
<oneit:input type="password" name="<%= key %>" class="form-control password-field"/>
</div> <!-- form-group -->
<div class="form-group text-left">
<label>Confirm Password *</label>
<oneit:input type="password" name="<%= key + 2 %>" class="form-control password-field"/>
</div> <!-- form-group -->
<div class="col-sm-12">
<oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage + "&JobID=" + job.getID().toString())
.toMap() %>"/>
</div>
</div>
<%
}
else
{
%>
<h3 class="text-danger">Invalid User or this link has been expired, generate new link to access this page.</h3>
<%
}
%>
</oneit:form>
</div>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<script type="text/javascript">
$(document.body).addClass('bg-color');
</script>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<div class="main-box-layout login-box">
<div>
<p>
Sent! Check your email now.<span><img class="smile-face smaller-face"src="images/smile-face.png" /></span>
</p>
</div>
</div>
</div>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -45,8 +45,19 @@ ...@@ -45,8 +45,19 @@
<div class="main-application-outline"> <div class="main-application-outline">
<div class="selection-aust-logo"> <div class="selection-aust-logo">
<img src="images/logo.svg" /> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span> <span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
<div class="clearfix no-height"></div>
</div> </div>
<div class="show-mobile-title"> <div class="show-mobile-title">
<div class="mobile-title-page">Requirements</div> <div class="mobile-title-page">Requirements</div>
......
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
} }
Debug.assertion(job != null, "Job is null in applicant portal"); Debug.assertion(job != null, "Job is null in applicant portal");
String socialLoginNextPage = nextPage + "&JobID=" + job.getID().toString();
%> %>
<script type="text/javascript"> <script type="text/javascript">
var interval; var interval;
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
$(document).ready(function() { $(document).ready(function() {
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true}); recalcFunction = setupRecalc ($("#applyJob"), {'recalcOnError':true});
interval = setInterval(function() { validate(); }, 500); interval = setInterval(function() { validate(); }, 500);
$('#applyJob').on('keyup keypress', function(e) { $('#applyJob').on('keyup keypress', function(e) {
...@@ -91,26 +93,61 @@ ...@@ -91,26 +93,61 @@
} }
</style> </style>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data"> <div class="main-verify-identity">
<%
BinaryContent logo = job.getLogo();
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> if(logo != null)
{
int logoHeight = 45;
%>
<div class="verify-aust-logo">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
</div>
<%
}
%>
<div class="pl-verify">Please verify your identity before applying to:</div>
<div class="verify-i-title">
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
</div>
<div class="main-box-layout verify-i-setpone">
<div class="box-label">Sign in using your social network of choice</div>
<div class="main-verify-identity"> <oneit:form name="socialLogin" method="post">
<div class="verify-aust-logo"><img src="images/logo.svg"></div> <ul class="social-login">
<div class="pl-verify">Please verify your identity before applying to:</div> <li>
<div class="verify-i-title"> <oneit:button value=" " name="linkedinOAuthLogin" skin="link" cssClass="social_login_btn"
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> disabled="<%= Utils.linkedInAvailable() ? "false" : "true" %>"
</div> requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", socialLoginNextPage).toMap() %>">
<div class="main-box-layout verify-i-setpone"> <img src="<%= request.getContextPath() %>/images/login-linkedin-icon.svg" />
<!-- <div class="box-label">Sign in using your social network of choice</div> </oneit:button>
<ul class="social-login"> </li>
<li><a href="#"><img src="images/login-linkedin-icon.svg"></a></li> <li>
<li><a href="#"><img src="images/login-facebok-icon.svg"></a></li> <oneit:button value=" " name="facebookOAuthLogin" skin="link" cssClass="social_login_btn"
<li><a href="#"><img src="images/login-google.png"></a></li> disabled="<%= Utils.facebookAvailable() ? "false" : "true" %>"
</ul> requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", socialLoginNextPage).toMap() %>">
<div class="box-br-line"><span></span></div>--> <img src="<%= request.getContextPath() %>/images/login-facebok-icon.svg" />
<!--<div class="box-label">Or sign in via email</div>--> </oneit:button>
<div class="box-label">Sign in via email</div> </li>
<li>
<oneit:button value=" " name="googleOAuthLogin" skin="link" cssClass="social_login_btn"
disabled="<%= Utils.googleAvailable() ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry ("nextPage", socialLoginNextPage).toMap() %>">
<img src="<%= request.getContextPath() %>/images/login-google.png" />
</oneit:button>
</li>
</ul>
</oneit:form>
<div class="box-br-line"><span></span></div>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="box-label">Or sign in via email</div>
<div class="form-group text-left" id="email-div"> <div class="form-group text-left" id="email-div">
<label>Email Address</label> <label>Email Address</label>
<oneit:ormInput obj="<%= job %>" type="text" attributeName="Email" cssClass="form-control second-style" style="text-transform: lowercase" autocomplete="off"/> <oneit:ormInput obj="<%= job %>" type="text" attributeName="Email" cssClass="form-control second-style" style="text-transform: lowercase" autocomplete="off"/>
...@@ -125,6 +162,10 @@ ...@@ -125,6 +162,10 @@
<oneit:ormInput obj="<%= job %>" type="password" attributeName="Password" cssClass="form-control second-style" /> <oneit:ormInput obj="<%= job %>" type="password" attributeName="Password" cssClass="form-control second-style" />
</div> </div>
<div class="form-group"> <div class="form-group">
<oneit:button value="Forgot password?" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ForgotPassword"))
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).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", nextPage)
.mapEntry("Job",job) .mapEntry("Job",job)
...@@ -142,13 +183,12 @@ ...@@ -142,13 +183,12 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry("Job",job) .mapEntry("Job",job)
.mapEntry("restartProcess", Boolean.TRUE) .mapEntry("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", "Job")
.mapEntry("attribNamesToRestore", Collections.singleton("Job")) .mapEntry("attribNamesToRestore", Collections.singleton("Job"))
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailSent") .mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailSent")
.toMap() %>"/> .toMap() %>"/>
</div> </div>
</oneit:recalcClass> </oneit:recalcClass>
</div> </oneit:form>
</div> </div>
</oneit:form> </div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
...@@ -17,14 +17,25 @@ ...@@ -17,14 +17,25 @@
<div class="main-application-outline"> <div class="main-application-outline">
<div class="selection-aust-logo"> <div class="selection-aust-logo">
<img src="images/logo.svg" /> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span> <span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
<div class="clearfix no-height"></div>
</div> </div>
<div class="mobile-successfull-show display-none">Application Successfully Submitted</div> <div class="mobile-successfull-show display-none">Thank you <span><img class="mob-smile-face" src="images/smile-face.png" /></span></div>
<div class="section-page-area complete-back"> <div class="section-page-area complete-back">
<div class="job-post-complete"> <div class="job-post-complete">
<div class="big-right-sy"><span><img src="images/big-right-symbol.svg" /></span></div> <div class="big-right-sy"><span><img src="images/big-right-symbol.svg" /></span></div>
<div class="app-complete-title m-hide">Application Successfully Submitted</div> <div class="app-complete-title m-hide">Thank you <span><img class="smile-face"src="images/smile-face.png" /></span></div>
<div class="app-complete-text"> <div class="app-complete-text">
Your application for Your application for
<oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/>
...@@ -32,7 +43,7 @@ ...@@ -32,7 +43,7 @@
</div> </div>
<oneit:form name="applyJob" method="post" enctype="multipart/form-data"> <oneit:form name="applyJob" method="post" enctype="multipart/form-data">
<div class="section-btn text-center"> <div class="section-btn text-center">
<oneit:button value="Return to Job Details" name="gotoPage" cssClass="box-btn" <oneit:button value="Return to Job Details" name="gotoPage" cssClass="btn btn-primary box-btn btn-gotojob"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", exitPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", exitPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"/> .toMap() %>"/>
......
...@@ -101,7 +101,19 @@ ...@@ -101,7 +101,19 @@
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-verify-identity"> <div class="main-verify-identity">
<div class="verify-aust-logo"><img src="images/logo.svg"></div> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<div class="verify-aust-logo">
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
</div>
<%
}
%>
<div class="pl-confirm text-center">Please confirm your details to continue</div> <div class="pl-confirm text-center">Please confirm your details to continue</div>
<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">
......
...@@ -14,9 +14,22 @@ ...@@ -14,9 +14,22 @@
int cultureQuestionNo = process.getAttribute("CultureQuestionNo")!= null ? (int) process.getAttribute("CultureQuestionNo") : candidate.getCultureCriteriaAnswersCount(); int cultureQuestionNo = process.getAttribute("CultureQuestionNo")!= null ? (int) process.getAttribute("CultureQuestionNo") : candidate.getCultureCriteriaAnswersCount();
String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey(); String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey();
boolean toRedirect = jobApplication.createCultureCriteriaObjects(); boolean toRedirect = jobApplication.createCultureCriteriaObjects();
// Boolean alreadyCompletedRole = (Boolean) process.getAttribute("AlreadyCompletedRole");
Boolean isAssesmentComplete = jobApplication.assessmentCompleted(); Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
//to store current question number in history
if(process.getAttribute("CultureQuestionNo")==null)
{
request.getSession().setAttribute ("historyQuestionNo", null);
}
if(request.getSession().getAttribute("historyQuestionNo")!=null && process.getAttribute("CultureQuestionNo")!= null)
{
if((int) process.getAttribute("CultureQuestionNo")<=(int) request.getSession().getAttribute("historyQuestionNo"))
{
cultureQuestionNo = (int) request.getSession().getAttribute("historyQuestionNo");
}
}
if(isAssesmentComplete) if(isAssesmentComplete)
{ {
nextPage = WebUtils.getSamePageInRenderMode(request, "SubmitApplication"); nextPage = WebUtils.getSamePageInRenderMode(request, "SubmitApplication");
...@@ -41,6 +54,8 @@ ...@@ -41,6 +54,8 @@
String numberText = (cultureQuestionNo + 1) + "/" + total; String numberText = (cultureQuestionNo + 1) + "/" + total;
process.setAttribute("JobApplication", jobApplication); process.setAttribute("JobApplication", jobApplication);
request.getSession().setAttribute ("historyQuestionNo", cultureQuestionNo);
%> %>
<script> <script>
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
...@@ -53,8 +68,19 @@ ...@@ -53,8 +68,19 @@
<div class="main-application-outline"> <div class="main-application-outline">
<div class="selection-aust-logo"> <div class="selection-aust-logo">
<img src="images/logo.svg" /> <%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
<span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span> <span><oneit:toString value="<%= job.getJobTitle() %>" mode="EscapeHTML"/></span>
<div class="clearfix no-height"></div>
</div> </div>
<div class="show-mobile-title"> <div class="show-mobile-title">
<div class="mobile-title-page">Culture</div> <div class="mobile-title-page">Culture</div>
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<MAP code="TestInput" class="performa.orm.TestInput"/> <MAP code="TestInput" class="performa.orm.TestInput"/>
<MAP code="JobApplication" class="performa.orm.JobApplication"/> <MAP code="JobApplication" class="performa.orm.JobApplication"/>
<MAP code="Candidate" class="performa.orm.Candidate"/> <MAP code="Candidate" class="performa.orm.Candidate"/>
<MAP code="CompanyUser" class="performa.orm.CompanyUser"/>
<MAP code="Client" class="performa.orm.Client"/>
<MAP code="Company" class="performa.orm.Company"/>
</NODE> </NODE>
<NODE name="CONFIG.GLOBAL::Performa"> <NODE name="CONFIG.GLOBAL::Performa">
......
<%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*"%> <%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.* "%> <%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.* "%>
<?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="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
</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="client_id" type="Long" length="11" nullable="true"/>
<column name="company_user_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">oneit_sec_user_extension</tableName>
<column name="role_type" type="String" nullable="true" length="200"/>
<column name="company_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_company_id" isUnique="false">
<column name="company_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_client</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="object_type" type="String" nullable="false" length="30"/>
<column name="company_name" type="String" nullable="false" length="100"/>
<column name="company_logo" type="BLOB" nullable="true"/>
<column name="email" type="String" nullable="true" length="100"/>
<column name="contact_name" type="String" nullable="true" length="100"/>
<column name="contact_surname" type="String" nullable="true" length="100"/>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="company_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_client" indexName="idx_tl_client_company_id" isUnique="false"><column name="company_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_company</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="object_type" type="String" nullable="false" length="30"/>
<column name="company_name" type="String" nullable="false" length="100"/>
<column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- @AutoRun
ALTER TABLE tl_company DROP COLUMN object_type;
ALTER TABLE tl_client DROP COLUMN object_type;
\ No newline at end of file
-- @AutoRun
UPDATE oneit_sec_user_extension SET object_type='CompanyUser' WHERE object_type='AdminUser';
\ No newline at end of file
-- @AutoRun
ALTER TABLE tl_client RENAME COLUMN company_name TO client_name;
ALTER TABLE tl_client RENAME COLUMN company_logo TO client_logo;
\ 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_company</tableName>
<column name="is_verified" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_company</tableName>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_industry</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="NAME" type="String" nullable="false" length="200"/>
<column name="VALUE" type="String" nullable="false" length="200"/>
<column name="DESCRIPTION" type="String" nullable="true" length="200"/>
<column name="SORT_ORDER" type="Long" nullable="false"/>
<column name="DISABLED" type="Boolean" 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.RedefineTableOperation">
<tableName factory="String">tl_client</tableName>
<column name="city" type="String" nullable="true" length="100"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Add followings to keyfile.properties
intercom.appId=kqed9h3r
intercom.token=dG9rOjg5ZGMyNzAxXzI2OGVfNDI2OV84NmQ2XzkwOTcxYWI3OWUzOToxOjA=
\ 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_company</tableName>
<column name="company_logo" type="BLOB" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">oneit_sec_privilege</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>TL_AccessCompanyAdmin</value>
<value name='description' factory='String'>Allow the user to access admin options in company</value>
<value name='category' factory='String' value="Talentology"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">oneit_sec_privilege</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>TL_AccessCompany</value>
<value name='description' factory='String'>Allow the user to access standared options in company</value>
<value name='category' factory='String' value="Talentology"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">oneit_sec_role</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyAdminRoleID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>TL_CompanyAdmin</value>
<value name='description' factory='String'>Users who is in charge of company</value>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">oneit_sec_role</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyUserRoleID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='name' factory='String'>TL_CompanyUser</value>
<value name='description' factory='String'>The Standard User</value>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation" query="select object_id as privid from oneit_sec_privilege where name in ('TL_AccessCompanyAdmin','TL_AccessCompany')">
<tableName factory="String">oneit_sec_role_priv_link</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyAdminRoleID"/>
<value name='priv_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="privid"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation" query="select object_id as privid from oneit_sec_privilege where name in ('TL_AccessCompany')">
<tableName factory="String">oneit_sec_role_priv_link</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyUserRoleID"/>
<value name='priv_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="privid"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select user_id from oneit_sec_user_extension where object_type='CompanyUser' AND role_type='ADMIN'">
<tableName factory="String">oneit_sec_role_grant</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyAdminRoleID"/>
<value name='user_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="user_id"/>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select user_id from oneit_sec_user_extension where object_type='CompanyUser' AND role_type!='ADMIN'">
<tableName factory="String">oneit_sec_role_grant</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='role_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID" keyName="companyUserRoleID"/>
<value name='user_id' factory='Participant' class="oneit.sql.transfer.InsertOperation$QueryColumn" column="user_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Add followings to keyfile.properties
linkedin.clientId=81eohoovrfda10
linkedin.clientSecret=jXDHcrXYDirPygCf
\ 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_changed" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="13" viewBox="0 0 8 13">
<path fill="#BBBFC5" fill-rule="evenodd" d="M7.018 12.368a.914.914 0 0 0 0-1.294L2.444 6.5l4.574-4.574A.914.914 0 1 0 5.724.632L.547 5.81a.903.903 0 0 0-.26.691.903.903 0 0 0 .26.69l5.177 5.178a.914.914 0 0 0 1.294 0"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="13" viewBox="0 0 8 13">
<path fill="#BBBFC5" fill-rule="evenodd" d="M.826.632a.914.914 0 0 0 0 1.294L5.4 6.5.826 11.074a.914.914 0 1 0 1.294 1.294L7.297 7.19a.903.903 0 0 0 .26-.691.903.903 0 0 0-.26-.69L2.12.631a.914.914 0 0 0-1.294 0"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="13px" height="13px" viewBox="0 0 13 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>B0DE6AE9-7EA8-49E0-8EC2-EBF60DA473EC</title>
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="My-Details-HT016-1" transform="translate(-1056.000000, -444.000000)" fill="#F5A623">
<g id="Modal---Success" transform="translate(780.000000, 427.000000)">
<path d="M281.698324,22.6983239 L274.313708,22.6983239 L274.313708,23.9290931 L281.698324,23.9290931 L281.698324,31.3137085 L282.929093,31.3137085 L282.929093,23.9290931 L290.313708,23.9290931 L290.313708,22.6983239 L282.929093,22.6983239 L282.929093,15.3137085 L281.698324,15.3137085 L281.698324,22.6983239 Z" id="Combined-Shape" transform="translate(282.313708, 23.313708) rotate(-315.000000) translate(-282.313708, -23.313708) "></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
...@@ -21,6 +21,16 @@ $(document).ready(function () { ...@@ -21,6 +21,16 @@ $(document).ready(function () {
} }
$('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus(); $('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus();
/*Set sidebar height*/
$(window).load(function() {
var sdh = $('.company-content-area').outerHeight();
$('.tabing-sidebar').css('min-height',sdh);
});
$(window).resize(function(){
var sdh = $('.company-content-area').outerHeight();
$('.tabing-sidebar').css('min-height',sdh);
});
}); });
function addUserPic(opt) { function addUserPic(opt) {
...@@ -83,3 +93,27 @@ $(window).resize(function () { ...@@ -83,3 +93,27 @@ $(window).resize(function () {
equalheight('.eq-height'); equalheight('.eq-height');
equalheight('.eq-second-height'); equalheight('.eq-second-height');
}); });
function readURL(input) {
if (input.files && input.files[0])
{
var reader = new FileReader();
reader.onload = function (e) {
$('#client-logo').attr('src', e.target.result);
$('#client-logo').removeAttr("width");
$('#client-logo').attr("height", "90");
$('input[name$=IsLogoDeleted]').val('false').change();
$('.u-img-tag').show();
$('#replace-btn').text('Replace');
}
reader.readAsDataURL(input.files[0]);
}
}
function removeLogo() {
$('#client-logo').removeAttr("src");
$('input[name$=IsLogoDeleted]').val('true').change();
$('.u-img-tag').hide();
$('#replace-btn').text('Upload');
}
\ No newline at end of file
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
<INHERITS nodename="SharedPersonalisationTransformFactories:parent"/> <INHERITS nodename="SharedPersonalisationTransformFactories:parent"/>
<NODE name="BracklineSeparator" class="performa.utils.BracklineSeparatorTransformFactory" /> <NODE name="BracklineSeparator" class="performa.utils.BracklineSeparatorTransformFactory" />
<NODE name="MenuItemDisable" class="performa.utils.MenuItemDisableTransformFactory" />
</NODE> </NODE>
......
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