Commit 1576dac4 by David Barton

Finish Release-20171020

parents 873012d0 21b0d10f
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">it_does_not_matter</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="" type="CLOB" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<column name="level_id" type="Long" length="11" nullable="false"/> <column name="level_id" type="Long" length="11" nullable="false"/>
<column name="client_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"/> <column name="company_user_id" type="Long" length="11" nullable="true"/>
<column name="shortened_url_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_shortened_url</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="code" type="String" nullable="false" length="8"/>
<column name="url_link" type="CLOB" nullable="false"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
text NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -25,7 +25,8 @@ CREATE TABLE tl_job ( ...@@ -25,7 +25,8 @@ CREATE TABLE tl_job (
country varchar(200) NULL, country varchar(200) NULL,
level_id numeric(12) NOT NULL, level_id numeric(12) NOT NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
shortened_url_id numeric(12) NULL
); );
......
-- DROP TABLE tl_shortened_url;
CREATE TABLE tl_shortened_url (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
code varchar(8) NOT NULL,
url_link text NOT NULL
);
ALTER TABLE tl_shortened_url ADD
CONSTRAINT PK_tl_shortened_url PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
clob NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -26,7 +26,8 @@ CREATE TABLE tl_job ( ...@@ -26,7 +26,8 @@ CREATE TABLE tl_job (
country varchar2(200) NULL, country varchar2(200) NULL,
level_id number(12) NOT NULL, level_id number(12) NOT NULL,
client_id number(12) NULL, client_id number(12) NULL,
company_user_id number(12) NULL company_user_id number(12) NULL,
shortened_url_id number(12) NULL
); );
......
-- DROP TABLE tl_shortened_url;
CREATE TABLE tl_shortened_url (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
code varchar2(8) NOT NULL,
url_link clob NOT NULL
);
ALTER TABLE tl_shortened_url ADD
CONSTRAINT PK_tl_shortened_url PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
text NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -26,7 +26,8 @@ CREATE TABLE tl_job ( ...@@ -26,7 +26,8 @@ CREATE TABLE tl_job (
country varchar(200) NULL, country varchar(200) NULL,
level_id numeric(12) NOT NULL, level_id numeric(12) NOT NULL,
client_id numeric(12) NULL, client_id numeric(12) NULL,
company_user_id numeric(12) NULL company_user_id numeric(12) NULL,
shortened_url_id numeric(12) NULL
); );
......
-- @AutoRun
-- drop table tl_shortened_url;
CREATE TABLE tl_shortened_url (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
code varchar(8) NOT NULL,
url_link text NOT NULL
);
ALTER TABLE tl_shortened_url ADD
CONSTRAINT pk_tl_shortened_url PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
package performa.batch;
import oneit.appservices.batch.ORMBatch;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.IsNullFilter;
import oneit.utils.parsers.FieldException;
import performa.orm.Job;
public class URLShortnerBatch extends ORMBatch
{
public static LoggingArea URL_SHORTNER_BATCH = LoggingArea.createLoggingArea("URLShortnerBatch");
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
LogMgr.log (URL_SHORTNER_BATCH, LogLevel.DEBUG2, "RUNNING URL Shortner Batch");
Job[] jobs = Job.SearchByAll()
.andShortenedURL(new IsNullFilter<>())
.search(ot);
for (Job job : jobs)
{
try
{
job.createShortenedURL();
LogMgr.log(URL_SHORTNER_BATCH, LogLevel.DEBUG2, "Setting Shortened URL to job : ", job);
}
catch(StorageException | FieldException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while setting shortened URL to job : " + job);
}
}
}
}
\ No newline at end of file
...@@ -53,6 +53,11 @@ public class BulkUpdateFP extends SaveFP ...@@ -53,6 +53,11 @@ public class BulkUpdateFP extends SaveFP
{ {
application.setApplicationStatus(ApplicationStatus.SUBMITTED); application.setApplicationStatus(ApplicationStatus.SUBMITTED);
} }
else if(job.getAppProcessOption() == AppProcessOption.TO_UNSUITABLE)
{
application.setApplicationStatus(ApplicationStatus.UNSUITABLE);
}
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In BulkUpdateFP Job Application Status successfully changed : ", application ); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In BulkUpdateFP Job Application Status successfully changed : ", application );
} }
......
...@@ -8,6 +8,7 @@ import oneit.email.ConfigurableEmailer; ...@@ -8,6 +8,7 @@ import oneit.email.ConfigurableEmailer;
import oneit.logging.*; import oneit.logging.*;
import oneit.net.LoopbackHTTP; import oneit.net.LoopbackHTTP;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
...@@ -29,15 +30,16 @@ public class ForgotPasswordFP extends SaveFP ...@@ -29,15 +30,16 @@ public class ForgotPasswordFP extends SaveFP
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction(); ObjectTransaction objTran = process.getTransaction();
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser"); CompanyUserNPO tmpComUser = (CompanyUserNPO) request.getAttribute("CompanyUser");
String email = job != null ? job.getEmail() : (companyUser != null ? companyUser.getEmail() : null); String email = job != null ? job.getEmail() : (tmpComUser != null ? tmpComUser.getEmail() : null);
Map emailParams = null;
Debug.assertion(StringUtils.subBlanks(email) != null, "Email not avaialble"); Debug.assertion(StringUtils.subBlanks(email) != null, "Email not avaialble");
email = StringUtils.trim(email); email = StringUtils.trim(email);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send pasword reset link email.", email); LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send pasword reset link email.", email);
SecUser secUser = SecUser.searchNAME (objTran, email); SecUser secUser = SecUser.searchNAME (objTran, email);
if(secUser == null) if(secUser == null)
...@@ -54,11 +56,15 @@ public class ForgotPasswordFP extends SaveFP ...@@ -54,11 +56,15 @@ public class ForgotPasswordFP extends SaveFP
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ForgotPasswordFP for send reset pasword link mail to ", email); LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ForgotPasswordFP for send reset pasword link mail to ", email);
Map emailParams; if(tmpComUser != null)
companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser != null)
{ {
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser == null)
{
throw new BusinessException("Sorry, you are not an authorised user to access admin portal.");
}
if(companyUser.getForgotPasswordKey() == null) if(companyUser.getForgotPasswordKey() == null)
{ {
String resetCode = new RandomStringGen().generateHumanAlphaNum(DEFAULT_PASSWORD_LENGTH); String resetCode = new RandomStringGen().generateHumanAlphaNum(DEFAULT_PASSWORD_LENGTH);
...@@ -72,7 +78,7 @@ public class ForgotPasswordFP extends SaveFP ...@@ -72,7 +78,7 @@ public class ForgotPasswordFP extends SaveFP
+ "?id=" + companyUser.getID() + "?id=" + companyUser.getID()
+ "&key=" + companyUser.getForgotPasswordKey()).toMap(); + "&key=" + companyUser.getForgotPasswordKey()).toMap();
} }
else else if(job != null)
{ {
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate); Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
...@@ -130,4 +136,23 @@ public class ForgotPasswordFP extends SaveFP ...@@ -130,4 +136,23 @@ public class ForgotPasswordFP extends SaveFP
resetCodeEmailer = (ConfigurableEmailer)(context.getSingleChild("ResetCodeEmailer")); resetCodeEmailer = (ConfigurableEmailer)(context.getSingleChild("ResetCodeEmailer"));
} }
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
super.validate(process, submission, exceptions, params);
HttpServletRequest request = submission.getRequest();
Job job = (Job) process.getAttribute("Job");
CompanyUserNPO companyUser = (CompanyUserNPO) request.getAttribute("CompanyUser");
if(job != null)
{
BusinessObjectParser.assertFieldCondition(StringUtils.subBlanks(job.getEmail()) != null, job, Job.FIELD_Email, "mandatory", exceptions, true, request);
}
else if(companyUser != null)
{
BusinessObjectParser.assertFieldCondition(StringUtils.subBlanks(companyUser.getEmail()) != null, companyUser, CompanyUserNPO.FIELD_Email, "mandatory", exceptions, true, request);
}
}
} }
\ No newline at end of file
...@@ -50,6 +50,7 @@ public class LoadJobFromTemplateFP extends ORMProcessFormProcessor ...@@ -50,6 +50,7 @@ public class LoadJobFromTemplateFP extends ORMProcessFormProcessor
job.setCompletedAssessmentType(Boolean.TRUE); job.setCompletedAssessmentType(Boolean.TRUE);
job.setCompletedRequirements(Boolean.TRUE); job.setCompletedRequirements(Boolean.TRUE);
job.setCompletedCulture(Boolean.TRUE); job.setCompletedCulture(Boolean.TRUE);
job.setShortenedURL(null);
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadJobFromTemplateFP completed for ", job); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadJobFromTemplateFP completed for ", job);
......
...@@ -14,6 +14,7 @@ import oneit.servlets.process.SaveFP; ...@@ -14,6 +14,7 @@ import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
import oneit.utils.DateDiff; import oneit.utils.DateDiff;
import performa.orm.Job; import performa.orm.Job;
import performa.orm.ShortenedURL;
import performa.orm.types.JobStatus; import performa.orm.types.JobStatus;
...@@ -29,12 +30,17 @@ public class SaveJobFP extends SaveFP ...@@ -29,12 +30,17 @@ public class SaveJobFP extends SaveFP
Job oldJob = (Job) job.getEarliestBackup(); Job oldJob = (Job) job.getEarliestBackup();
if(oldJob != null && oldJob.getJobStatus() == JobStatus.DRAFT) if(oldJob != null && oldJob.getJobStatus() == JobStatus.DRAFT && job.getJobStatus() == JobStatus.OPEN)
{ {
job.setJobStatus(JobStatus.OPEN);
job.setApplyBy(DateDiff.add(DateDiff.getToday(), Calendar.DATE, 30)); job.setApplyBy(DateDiff.add(DateDiff.getToday(), Calendar.DATE, 30));
job.setOpenDate(new Date()); job.setOpenDate(new Date());
} }
if(job.getJobStatus() == JobStatus.OPEN && job.getShortenedURL() == null)
{
job.createShortenedURL();
}
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ public class SaveUserDetailsFP extends SaveFP ...@@ -48,7 +48,7 @@ public class SaveUserDetailsFP extends SaveFP
{ {
if(companyUser.getConfirmPassword() == null) if(companyUser.getConfirmPassword() == null)
{ {
submission.getRequest().setAttribute("EmailChanged", true); request.setAttribute("EmailChanged", true);
return RedisplayResult.getInstance(); return RedisplayResult.getInstance();
} }
else else
...@@ -57,7 +57,7 @@ public class SaveUserDetailsFP extends SaveFP ...@@ -57,7 +57,7 @@ public class SaveUserDetailsFP extends SaveFP
if(!validPassword) if(!validPassword)
{ {
submission.getRequest().setAttribute("EmailChanged", false); request.setAttribute("EmailChanged", false);
companyUser.setConfirmPassword(null); companyUser.setConfirmPassword(null);
} }
...@@ -67,12 +67,10 @@ public class SaveUserDetailsFP extends SaveFP ...@@ -67,12 +67,10 @@ public class SaveUserDetailsFP extends SaveFP
{ {
// companyUser.setIsAccountVerified(Boolean.FALSE); // companyUser.setIsAccountVerified(Boolean.FALSE);
companyUser.setIsEmailChanged(Boolean.TRUE); companyUser.setIsEmailChanged(Boolean.TRUE);
Utils.sendEmailChangedMail(companyUser, request, emailer, SaveUserDetailsFP.class.getName()); Utils.sendEmailChangedMail(companyUser, request, emailer, SaveUserDetailsFP.class.getName());
} }
} }
// secUser.setEmail(secUser.getUserName());
} }
else //email changed for social login else //email changed for social login
{ {
...@@ -85,13 +83,17 @@ public class SaveUserDetailsFP extends SaveFP ...@@ -85,13 +83,17 @@ public class SaveUserDetailsFP extends SaveFP
} }
} }
User intercomUser = IntercomUtils.updateIntercomUser(secUser); User intercomUser = (User)request.getSession().getAttribute("IntercomUser");
if(intercomUser == null) if(intercomUser == null)
{ {
performa.intercom.resources.Company intercomCompany = IntercomUtils.findOrCreateCompany(companyUser.getCompany()); performa.intercom.resources.Company intercomCompany = IntercomUtils.findOrCreateCompany(companyUser.getCompany());
IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany); IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany, companyUser.getPhone());
}
else
{
IntercomUtils.updateIntercomUser(secUser, companyUser.getPhone());
} }
} }
......
...@@ -38,18 +38,22 @@ public class SendCompanyUserInvitesFP extends SaveFP ...@@ -38,18 +38,22 @@ public class SendCompanyUserInvitesFP extends SaveFP
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Company company = (Company) process.getAttribute("Company"); Company company = (Company) process.getAttribute("Company");
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser"); CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
Boolean isSkip = CollectionUtils.equals((Boolean) request.getAttribute("Skip"), Boolean.TRUE);
if(companyUser != null && companyUser == company.getAddedByUser()) if(companyUser != null && companyUser == company.getAddedByUser())
{ {
for(CompanyUser cUser : company.getUsersSet()) if(!isSkip)
{ {
if(!CollectionUtils.equals(cUser, company.getAddedByUser())) for(CompanyUser cUser : company.getUsersSet())
{ {
SecUser secUser = cUser.getUser(); 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(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);
}
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(process.getTransaction(), secUser.getEmail()), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
} }
} }
...@@ -72,9 +76,11 @@ public class SendCompanyUserInvitesFP extends SaveFP ...@@ -72,9 +76,11 @@ public class SendCompanyUserInvitesFP extends SaveFP
CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser"); CompanyUser companyUser = (CompanyUser) request.getAttribute("CompanyUser");
SecUser secUser = companyUser.getUser(); SecUser secUser = companyUser.getUser();
Boolean socialLogin = CollectionUtils.equals(process.getAttribute("socialLogin"), Boolean.TRUE); Boolean socialLogin = CollectionUtils.equals(process.getAttribute("socialLogin"), Boolean.TRUE);
Boolean isSkip = CollectionUtils.equals((Boolean) request.getAttribute("Skip"), Boolean.TRUE);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing Company User", companyUser, secUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing Company User", companyUser, secUser);
companyUser.setRole(RoleType.ADMIN);
companyUser.setIsAccountVerified(Boolean.TRUE); companyUser.setIsAccountVerified(Boolean.TRUE);
company.setIsVerified(Boolean.TRUE); company.setIsVerified(Boolean.TRUE);
...@@ -82,7 +88,6 @@ public class SendCompanyUserInvitesFP extends SaveFP ...@@ -82,7 +88,6 @@ public class SendCompanyUserInvitesFP extends SaveFP
if(!socialLogin) if(!socialLogin)
{ {
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);
...@@ -96,22 +101,33 @@ public class SendCompanyUserInvitesFP extends SaveFP ...@@ -96,22 +101,33 @@ public class SendCompanyUserInvitesFP extends SaveFP
//process user invitations //process user invitations
for(CompanyUser cUser : company.getUsersSet()) for(CompanyUser cUser : company.getUsersSet())
{ {
if(!CollectionUtils.equals(cUser, companyUser)) if(!CollectionUtils.equals(cUser, company.getAddedByUser()))
{ {
SecUser sUser = cUser.getUser(); SecUser sUser = cUser.getUser();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send invitaion email.", cUser); if(isSkip) //remove invitaions due to skip
{
sUser.setUserName(sUser.getEmail().toLowerCase()); sUser.removeFromExtensions(cUser);
sUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD); cUser.delete();
sUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran)); sUser.delete();
companyUser.setRole(RoleType.STANDARD);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Removed user details for skip.", cUser, sUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", sUser); }
else
sendInvitationMail(cUser, request); {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send invitaion email.", cUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending invitation email.", cUser);
sUser.setUserName(sUser.getEmail().toLowerCase());
sUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
sUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
cUser.setRole(RoleType.STANDARD);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", sUser);
sendInvitationMail(cUser, request);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending invitation email.", cUser);
}
} }
} }
} }
...@@ -120,7 +136,7 @@ public class SendCompanyUserInvitesFP extends SaveFP ...@@ -120,7 +136,7 @@ public class SendCompanyUserInvitesFP extends SaveFP
performa.intercom.resources.Company intercomCompany = IntercomUtils.findOrCreateCompany(company); performa.intercom.resources.Company intercomCompany = IntercomUtils.findOrCreateCompany(company);
IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany); IntercomUtils.createIntercomUser(secUser, "Hiring Team", intercomCompany, companyUser.getPhone());
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
......
...@@ -176,7 +176,7 @@ public class SendVerificationMailFP extends SaveFP ...@@ -176,7 +176,7 @@ public class SendVerificationMailFP extends SaveFP
+ "&aid=" + candidate.getID() + "&aid=" + candidate.getID()
+ "&pin=" + candidate.getVerificationKey(); + "&pin=" + candidate.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap(); Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate); ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate.getUser());
Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate); Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate);
......
...@@ -57,7 +57,6 @@ public class SignInCandidateFP extends LoginProcessor ...@@ -57,7 +57,6 @@ public class SignInCandidateFP extends LoginProcessor
BusinessObjectParser.assertFieldCondition(job.getEmail()!= null, job, Job.FIELD_Email, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(job.getEmail()!= null, job, Job.FIELD_Email, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(job.getPassword()!= null, job, Job.FIELD_Password, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(job.getPassword()!= null, job, Job.FIELD_Password, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.emailExists(job.getTransaction(), job.getEmail()), job, Job.FIELD_Email, "emailExists", exceptions, true, request);
return super.validate(submission, exceptions); return super.validate(submission, exceptions);
} }
......
...@@ -27,5 +27,10 @@ public class UserLoginFP extends LoginProcessor ...@@ -27,5 +27,10 @@ public class UserLoginFP extends LoginProcessor
{ {
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);
} }
else if(companyUser.getIsEmailChanged()==Boolean.TRUE)
{
//verify email address change
companyUser.changeEmail(submission.getRequest());
}
} }
} }
\ No newline at end of file
...@@ -2,10 +2,12 @@ package performa.form; ...@@ -2,10 +2,12 @@ package performa.form;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.components.ParticipantInitialisationContext; import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableArticleTemplateEmailer; import oneit.email.ConfigurableArticleTemplateEmailer;
import oneit.email.ConfigurableEmailerException; import oneit.email.ConfigurableEmailerException;
import oneit.logging.*; import oneit.logging.*;
import oneit.net.LoopbackHTTP;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser; import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser; import oneit.security.SecUser;
...@@ -16,9 +18,10 @@ import oneit.utils.*; ...@@ -16,9 +18,10 @@ import oneit.utils.*;
import performa.intercom.utils.IntercomUtils; import performa.intercom.utils.IntercomUtils;
import performa.orm.*; import performa.orm.*;
import performa.utils.Utils; import performa.utils.Utils;
import performa.utils.WebUtils;
public class VerifyIdentityFP extends ORMProcessFormProcessor public class VerifyIdentityFP extends SaveFP
{ {
private static LoggingArea LOG = LoggingArea.createLoggingArea("VerifyIdentity"); private static LoggingArea LOG = LoggingArea.createLoggingArea("VerifyIdentity");
protected ConfigurableArticleTemplateEmailer emailer; protected ConfigurableArticleTemplateEmailer emailer;
...@@ -27,7 +30,6 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor ...@@ -27,7 +30,6 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor
protected Map validate(SubmissionDetails submission, MultiException exceptions) protected Map validate(SubmissionDetails submission, MultiException exceptions)
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Boolean isVerify = CollectionUtils.equals(request.getAttribute("isVerify"), Boolean.TRUE);
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
Candidate candidate = (Candidate) request.getAttribute("Candidate"); Candidate candidate = (Candidate) request.getAttribute("Candidate");
SecUser secUser = candidate.getUser(); SecUser secUser = candidate.getUser();
...@@ -39,16 +41,7 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor ...@@ -39,16 +41,7 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor
BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request);
if(isVerify)
{
BusinessObjectParser.assertFieldCondition(job.getPassword()!= null, job, Job.FIELD_Password, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(job.getConfirmPassword()!= null, job, Job.FIELD_ConfirmPassword, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(CollectionUtils.equals(job.getPassword(), job.getConfirmPassword()), job, Job.FIELD_ConfirmPassword, "passwordNotMatch", exceptions, true, request);
}
return super.validate(submission, exceptions); return super.validate(submission, exceptions);
} }
...@@ -68,22 +61,22 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor ...@@ -68,22 +61,22 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor
LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User", job, secUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "Verifing User", job, secUser);
if(CollectionUtils.equals(job.getPassword(), job.getConfirmPassword())) // if(CollectionUtils.equals(job.getPassword(), job.getConfirmPassword()))
{ // {
secUser.setAttribute("md5:" + SecUser.FIELD_Password, job.getPassword()); // secUser.setAttribute("md5:" + SecUser.FIELD_Password, job.getPassword());
candidate.setIsAccountVerified(Boolean.TRUE); candidate.setIsAccountVerified(Boolean.TRUE);
sendMail(candidate, request); sendMail(candidate, job, request);
// Create a applicant user in intercom // Create a applicant user in intercom
IntercomUtils.createIntercomUser(secUser, "Applicant", null); IntercomUtils.createIntercomUser(secUser, "Applicant", null, candidate.getPhone());
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);
// request.setAttribute("nextPage", nextPage + "&JobID=" + job.getObjectID()); // request.setAttribute("nextPage", nextPage + "&JobID=" + job.getObjectID());
LogMgr.log(LOG, LogLevel.PROCESSING1, "Password resetted", job, secUser); LogMgr.log(LOG, LogLevel.PROCESSING1, "Password resetted", job, secUser);
} // }
} }
process.completeAndRestart(); process.completeAndRestart();
...@@ -97,18 +90,23 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor ...@@ -97,18 +90,23 @@ public class VerifyIdentityFP extends ORMProcessFormProcessor
{ {
super.init(context); super.init(context);
emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("AccountCreatedEmailer")); emailer = (ConfigurableArticleTemplateEmailer) (context.getSingleChild("ApplicantAccountCreatedEmailer"));
} }
protected void sendMail(Candidate candidate, HttpServletRequest request) throws BusinessException protected void sendMail(Candidate candidate, Job job, HttpServletRequest request) throws BusinessException
{ {
try try
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from VerifyIdentityFP to :: ", candidate); LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending Account Created mail from VerifyIdentityFP to :: ", candidate);
Map defaultParams = CollectionUtils.EMPTY_MAP; Article applyJobArticle = WebUtils.getArticleByShortCut(candidate.getTransaction(), WebUtils.APPLY_JOB);
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate); String link = LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.FORGOT_PASSWORD).toMap(), "/")
+ "&id=" + job.getID()
+ "&key=" + job.getRandomKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, candidate.getUser());
Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate); Utils.sendMail(emailer, transform, new String[]{candidate.getUser().getUserName()}, null, candidate);
......
...@@ -2,7 +2,6 @@ package performa.intercom.utils; ...@@ -2,7 +2,6 @@ package performa.intercom.utils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel; import oneit.logging.LogLevel;
import oneit.logging.LogMgr; import oneit.logging.LogMgr;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
...@@ -11,17 +10,19 @@ import performa.intercom.resources.Company; ...@@ -11,17 +10,19 @@ import performa.intercom.resources.Company;
import performa.intercom.resources.CustomAttribute; import performa.intercom.resources.CustomAttribute;
import performa.intercom.resources.Intercom; import performa.intercom.resources.Intercom;
import performa.intercom.resources.User; import performa.intercom.resources.User;
import performa.utils.Utils;
public class IntercomUtils public class IntercomUtils
{ {
static static
{ {
Intercom.setToken(ConfigMgr.getKeyfileString("intercom.token", "")); Intercom.setToken(Utils.INTERCOM_TOKEN);
Intercom.setAppID(Utils.INTERCOM_APP_ID);
} }
public static User createIntercomUser(SecUser secUser, String role, Company company) public static User createIntercomUser(SecUser secUser, String role, Company company, String phone)
{ {
try try
{ {
...@@ -30,6 +31,7 @@ public class IntercomUtils ...@@ -30,6 +31,7 @@ public class IntercomUtils
user.setUserId(secUser.getIdentification()); user.setUserId(secUser.getIdentification());
user.setEmail(secUser.getEmail()); user.setEmail(secUser.getEmail());
user.setName(secUser.getName()); user.setName(secUser.getName());
user.setPhone(phone);
user.addCustomAttribute(CustomAttribute.newStringAttribute("role", role)); user.addCustomAttribute(CustomAttribute.newStringAttribute("role", role));
if(company != null) if(company != null)
...@@ -67,7 +69,7 @@ public class IntercomUtils ...@@ -67,7 +69,7 @@ public class IntercomUtils
} }
public static User updateIntercomUser(SecUser secUser) public static User updateIntercomUser(SecUser secUser, String phone)
{ {
try try
{ {
...@@ -77,6 +79,7 @@ public class IntercomUtils ...@@ -77,6 +79,7 @@ public class IntercomUtils
{ {
user.setEmail(secUser.getEmail()); user.setEmail(secUser.getEmail());
user.setName(secUser.getName()); user.setName(secUser.getName());
user.setPhone(phone);
User.update(user); User.update(user);
} }
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
public abstract class BaseCompanyUserNPO extends NonPersistentBO
{
// Reference instance for the object
public static final CompanyUserNPO REFERENCE_CompanyUserNPO = new CompanyUserNPO ();
// Reference instance for the object
public static final CompanyUserNPO DUMMY_CompanyUserNPO = new DummyCompanyUserNPO ();
// Static constants corresponding to field names
public static final String FIELD_Email = "Email";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<CompanyUserNPO> HELPER_Email = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _Email;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_CompanyUserNPO = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Email_Validators;
// Arrays of behaviour decorators
private static final CompanyUserNPOBehaviourDecorator[] CompanyUserNPO_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_Email_Validators = (AttributeValidator[])setupAttribMetaData_Email(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_CompanyUserNPO.initialiseReference ();
DUMMY_CompanyUserNPO.initialiseReference ();
CompanyUserNPO_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(CompanyUserNPO.class).toArray(new CompanyUserNPOBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_Email(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "Email");
metaInfo.put ("type", "String");
metaInfo.put ("validators", "Email");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUserNPO.Email:", metaInfo);
ATTRIBUTES_METADATA_CompanyUserNPO.put (FIELD_Email, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUserNPO.class, "Email", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUserNPO.Email:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseCompanyUserNPO ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return CompanyUserNPO_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_Email = (String)(HELPER_Email.initialise (_Email));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute Email
*/
public String getEmail ()
{
assertValid();
String valToReturn = _Email;
for (CompanyUserNPOBehaviourDecorator bhd : CompanyUserNPO_BehaviourDecorators)
{
valToReturn = bhd.getEmail ((CompanyUserNPO)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 preEmailChange (String newEmail) 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 postEmailChange () throws FieldException
{
}
public FieldWriteability getWriteability_Email ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Email. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setEmail (String newEmail) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
try
{
for (CompanyUserNPOBehaviourDecorator bhd : CompanyUserNPO_BehaviourDecorators)
{
newEmail = bhd.setEmail ((CompanyUserNPO)this, newEmail);
oldAndNewIdentical = HELPER_Email.compare (_Email, newEmail);
}
if (FIELD_Email_Validators.length > 0)
{
Object newEmailObj = HELPER_Email.toObject (newEmail);
if (newEmailObj != null)
{
int loopMax = FIELD_Email_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUserNPO.get (FIELD_Email);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Email_Validators[v].checkAttribute (this, FIELD_Email, metadata, newEmailObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Email () != FieldWriteability.FALSE, "Field Email is not writeable");
preEmailChange (newEmail);
markFieldChange (FIELD_Email);
_Email = newEmail;
postFieldChange (FIELD_Email);
postEmailChange ();
}
}
/**
* 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 CompanyUserNPO newInstance ()
{
return new CompanyUserNPO ();
}
public CompanyUserNPO referenceInstance ()
{
return REFERENCE_CompanyUserNPO;
}
public CompanyUserNPO getInTransaction (ObjectTransaction t) throws StorageException
{
return getCompanyUserNPOByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_CompanyUserNPO;
}
public String getBaseSetName ()
{
return "it_does_not_matter";
}
/**
* 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 it_does_not_matterPSet = allSets.getPersistentSet (myID, "it_does_not_matter", myPSetStatus);
it_does_not_matterPSet.setAttrib (FIELD_ObjectID, myID);
it_does_not_matterPSet.setAttrib (FIELD_Email, HELPER_Email.toObject (_Email)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (objectID, "it_does_not_matter");
_Email = (String)(HELPER_Email.fromObject (_Email, it_does_not_matterPSet.getAttrib (FIELD_Email))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof CompanyUserNPO)
{
CompanyUserNPO otherCompanyUserNPO = (CompanyUserNPO)other;
try
{
setEmail (otherCompanyUserNPO.getEmail ());
}
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 BaseCompanyUserNPO)
{
BaseCompanyUserNPO sourceCompanyUserNPO = (BaseCompanyUserNPO)(source);
_Email = sourceCompanyUserNPO._Email;
}
}
/**
* 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 BaseCompanyUserNPO)
{
BaseCompanyUserNPO sourceCompanyUserNPO = (BaseCompanyUserNPO)(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 BaseCompanyUserNPO)
{
BaseCompanyUserNPO sourceCompanyUserNPO = (BaseCompanyUserNPO)(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);
_Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseCompanyUserNPO)
{
BaseCompanyUserNPO otherCompanyUserNPO = (BaseCompanyUserNPO)(other);
if (!HELPER_Email.compare(this._Email, otherCompanyUserNPO._Email))
{
listener.notifyFieldChange(this, other, FIELD_Email, HELPER_Email.toObject(this._Email), HELPER_Email.toObject(otherCompanyUserNPO._Email));
}
// 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_Email, HELPER_Email.toObject(getEmail()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static CompanyUserNPO createCompanyUserNPO (ObjectTransaction transaction) throws StorageException
{
CompanyUserNPO result = new CompanyUserNPO ();
result.initialiseNewObject (transaction);
return result;
}
public static CompanyUserNPO getCompanyUserNPOByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (CompanyUserNPO)(transaction.getObjectByID (REFERENCE_CompanyUserNPO, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Email))
{
return filter.matches (getEmail ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email.toObject (getEmail ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email;
}
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_Email))
{
setEmail ((String)(HELPER_Email.fromObject (_Email, 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_Email))
{
return getWriteability_Email ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_Email () != FieldWriteability.TRUE)
{
fields.add (FIELD_Email);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_CompanyUserNPO.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_CompanyUserNPO.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_CompanyUserNPO.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_CompanyUserNPO.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 CompanyUserNPOBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<CompanyUserNPO>
{
/**
* Get the attribute Email
*/
public String getEmail (CompanyUserNPO obj, String original)
{
return original;
}
/**
* Change the value set for attribute Email.
* May modify the field beforehand
* Occurs before validation.
*/
public String setEmail (CompanyUserNPO obj, String newEmail) throws FieldException
{
return newEmail;
}
}
public ORMPipeLine pipes()
{
return new CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> ((CompanyUserNPO)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> pipelineCompanyUserNPO()
{
return (CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO>) pipes();
}
public static CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> pipesCompanyUserNPO(Collection<CompanyUserNPO> items)
{
return REFERENCE_CompanyUserNPO.new CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> (items);
}
public static CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> pipesCompanyUserNPO(CompanyUserNPO[] _items)
{
return pipesCompanyUserNPO(Arrays.asList (_items));
}
public static CompanyUserNPOPipeLineFactory<CompanyUserNPO, CompanyUserNPO> pipesCompanyUserNPO()
{
return pipesCompanyUserNPO((Collection)null);
}
public class CompanyUserNPOPipeLineFactory<From extends BaseBusinessClass, Me extends CompanyUserNPO> extends NonPersistentBOPipeLineFactory<From, Me>
{
public <Prev> CompanyUserNPOPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public CompanyUserNPOPipeLineFactory (From seed)
{
super(seed);
}
public CompanyUserNPOPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Email"))
{
return toEmail ();
}
return super.to(name);
}
public PipeLine<From, String> toEmail () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Email)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyCompanyUserNPO extends CompanyUserNPO
{
// Default constructor primarily to support Externalisable
public DummyCompanyUserNPO()
{
super();
}
public void assertValid ()
{
}
}
...@@ -176,7 +176,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass ...@@ -176,7 +176,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper"); metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "importance"); metaInfo.put ("dbcol", "importance");
metaInfo.put ("defaultValue", "Importance.DESIRABLE"); metaInfo.put ("defaultValue", "Importance.NOT_APPLICABLE");
metaInfo.put ("mandatory", "true"); metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Importance"); metaInfo.put ("name", "Importance");
metaInfo.put ("type", "Importance"); metaInfo.put ("type", "Importance");
...@@ -217,7 +217,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass ...@@ -217,7 +217,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
super._initialiseNewObjAttributes (transaction); super._initialiseNewObjAttributes (transaction);
_Importance = (Importance)(Importance.DESIRABLE); _Importance = (Importance)(Importance.NOT_APPLICABLE);
} }
......
...@@ -79,6 +79,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -79,6 +79,7 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String SINGLEREFERENCE_Client = "Client"; public static final String SINGLEREFERENCE_Client = "Client";
public static final String BACKREF_Client = ""; public static final String BACKREF_Client = "";
public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser"; public static final String SINGLEREFERENCE_CompanyUser = "CompanyUser";
public static final String SINGLEREFERENCE_ShortenedURL = "ShortenedURL";
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";
...@@ -161,6 +162,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -161,6 +162,7 @@ public abstract class BaseJob extends BaseBusinessClass
private SingleAssociation<Job, Level> _Level; private SingleAssociation<Job, Level> _Level;
private SingleAssociation<Job, Client> _Client; private SingleAssociation<Job, Client> _Client;
private SingleAssociation<Job, CompanyUser> _CompanyUser; private SingleAssociation<Job, CompanyUser> _CompanyUser;
private SingleAssociation<Job, ShortenedURL> _ShortenedURL;
// Private attributes corresponding to multiple references // Private attributes corresponding to multiple references
...@@ -227,6 +229,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -227,6 +229,7 @@ public abstract class BaseJob extends BaseBusinessClass
setupAssocMetaData_Level(); setupAssocMetaData_Level();
setupAssocMetaData_Client(); setupAssocMetaData_Client();
setupAssocMetaData_CompanyUser(); setupAssocMetaData_CompanyUser();
setupAssocMetaData_ShortenedURL();
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]);
...@@ -395,6 +398,20 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -395,6 +398,20 @@ public abstract class BaseJob extends BaseBusinessClass
// Meta Info setup // Meta Info setup
private static void setupAssocMetaData_ShortenedURL()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "shortened_url_id");
metaInfo.put ("name", "ShortenedURL");
metaInfo.put ("type", "ShortenedURL");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.ShortenedURL:", metaInfo);
ATTRIBUTES_METADATA_Job.put (SINGLEREFERENCE_ShortenedURL, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Email(Map validatorMapping) private static List setupAttribMetaData_Email(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -724,7 +741,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -724,7 +741,7 @@ public abstract class BaseJob extends BaseBusinessClass
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "include_assessment_criteria"); metaInfo.put ("dbcol", "include_assessment_criteria");
metaInfo.put ("defaultValue", "Boolean.TRUE"); metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "true"); metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "IncludeAssessmentCriteria"); metaInfo.put ("name", "IncludeAssessmentCriteria");
metaInfo.put ("type", "Boolean"); metaInfo.put ("type", "Boolean");
...@@ -946,7 +963,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -946,7 +963,7 @@ public abstract class BaseJob extends BaseBusinessClass
_JobStatus = (JobStatus)(HELPER_JobStatus.initialise (_JobStatus)); _JobStatus = (JobStatus)(HELPER_JobStatus.initialise (_JobStatus));
_OpenDate = (Date)(HELPER_OpenDate.initialise (_OpenDate)); _OpenDate = (Date)(HELPER_OpenDate.initialise (_OpenDate));
_ApplyBy = (Date)(HELPER_ApplyBy.initialise (_ApplyBy)); _ApplyBy = (Date)(HELPER_ApplyBy.initialise (_ApplyBy));
_IncludeAssessmentCriteria = (Boolean)(Boolean.TRUE); _IncludeAssessmentCriteria = (Boolean)(Boolean.FALSE);
_AssessmentType = (AssessmentType)(AssessmentType.COMPREHENSIVE); _AssessmentType = (AssessmentType)(AssessmentType.COMPREHENSIVE);
_RandomKey = (String)(HELPER_RandomKey.initialise (_RandomKey)); _RandomKey = (String)(HELPER_RandomKey.initialise (_RandomKey));
_JobType = (JobType)(JobType.FULL_TIME); _JobType = (JobType)(JobType.FULL_TIME);
...@@ -983,6 +1000,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -983,6 +1000,7 @@ public abstract class BaseJob extends BaseBusinessClass
_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");
_Client = new SingleAssociation<Job, Client> (this, SINGLEREFERENCE_Client, Client.MULTIPLEREFERENCE_Jobs, Client.REFERENCE_Client, "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"); _CompanyUser = new SingleAssociation<Job, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "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);
...@@ -1001,6 +1019,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -1001,6 +1019,7 @@ public abstract class BaseJob extends BaseBusinessClass
_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");
_Client = new SingleAssociation<Job, Client> (this, SINGLEREFERENCE_Client, Client.MULTIPLEREFERENCE_Jobs, Client.REFERENCE_Client, "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"); _CompanyUser = new SingleAssociation<Job, CompanyUser> (this, SINGLEREFERENCE_CompanyUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_job");
_ShortenedURL = new SingleAssociation<Job, ShortenedURL> (this, SINGLEREFERENCE_ShortenedURL, null, ShortenedURL.REFERENCE_ShortenedURL, "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);
...@@ -3783,6 +3802,8 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3783,6 +3802,8 @@ public abstract class BaseJob extends BaseBusinessClass
result.add("CompanyUser"); result.add("CompanyUser");
result.add("ShortenedURL");
return result; return result;
} }
...@@ -3812,6 +3833,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3812,6 +3833,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return _CompanyUser.getReferencedType (); return _CompanyUser.getReferencedType ();
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
return _ShortenedURL.getReferencedType ();
} }
else else
{ {
...@@ -3835,6 +3859,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3835,6 +3859,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return null ; return null ;
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
return null ;
} }
else else
{ {
...@@ -3867,6 +3894,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3867,6 +3894,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (); return getCompanyUser ();
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
return getShortenedURL ();
} }
else else
{ {
...@@ -3899,6 +3929,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3899,6 +3929,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUser (getType); return getCompanyUser (getType);
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
return getShortenedURL (getType);
} }
else else
{ {
...@@ -3931,6 +3964,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3931,6 +3964,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
return getCompanyUserID (); return getCompanyUserID ();
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
return getShortenedURLID ();
} }
else else
{ {
...@@ -3963,6 +3999,9 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -3963,6 +3999,9 @@ public abstract class BaseJob extends BaseBusinessClass
}else if (assocName.equals (SINGLEREFERENCE_CompanyUser)) }else if (assocName.equals (SINGLEREFERENCE_CompanyUser))
{ {
setCompanyUser ((CompanyUser)(newValue)); setCompanyUser ((CompanyUser)(newValue));
}else if (assocName.equals (SINGLEREFERENCE_ShortenedURL))
{
setShortenedURL ((ShortenedURL)(newValue));
} }
else else
{ {
...@@ -4551,6 +4590,100 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -4551,6 +4590,100 @@ public abstract class BaseJob extends BaseBusinessClass
} }
/** /**
* Get the reference ShortenedURL
*/
public ShortenedURL getShortenedURL () throws StorageException
{
assertValid();
try
{
return (ShortenedURL)(_ShortenedURL.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in Job:", this.getObjectID (), ", was trying to get ShortenedURL:", getShortenedURLID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _ShortenedURL.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public ShortenedURL getShortenedURL (Get getType) throws StorageException
{
assertValid();
return _ShortenedURL.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getShortenedURLID ()
{
assertValid();
if (_ShortenedURL == null)
{
return null;
}
else
{
return _ShortenedURL.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 preShortenedURLChange (ShortenedURL newShortenedURL) 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 postShortenedURLChange () throws FieldException
{
}
public FieldWriteability getWriteability_ShortenedURL ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference ShortenedURL. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setShortenedURL (ShortenedURL newShortenedURL) throws StorageException, FieldException
{
if (_ShortenedURL.wouldReferencedChange (newShortenedURL))
{
assertValid();
Debug.assertion (getWriteability_ShortenedURL () != FieldWriteability.FALSE, "Assoc ShortenedURL is not writeable");
preShortenedURLChange (newShortenedURL);
_ShortenedURL.set (newShortenedURL);
postShortenedURLChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings. * A list of multi assoc names e.g. list of strings.
*/ */
public List<String> getMultiAssocs() public List<String> getMultiAssocs()
...@@ -5106,6 +5239,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5106,6 +5239,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Level.getPersistentSets (allSets); _Level.getPersistentSets (allSets);
_Client.getPersistentSets (allSets); _Client.getPersistentSets (allSets);
_CompanyUser.getPersistentSets (allSets); _CompanyUser.getPersistentSets (allSets);
_ShortenedURL.getPersistentSets (allSets);
} }
...@@ -5138,6 +5272,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5138,6 +5272,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Level.setFromPersistentSets (objectID, allSets); _Level.setFromPersistentSets (objectID, allSets);
_Client.setFromPersistentSets (objectID, allSets); _Client.setFromPersistentSets (objectID, allSets);
_CompanyUser.setFromPersistentSets (objectID, allSets); _CompanyUser.setFromPersistentSets (objectID, allSets);
_ShortenedURL.setFromPersistentSets (objectID, allSets);
} }
...@@ -5353,6 +5488,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5353,6 +5488,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Level.copyFrom (sourceJob._Level, linkToGhosts); _Level.copyFrom (sourceJob._Level, linkToGhosts);
_Client.copyFrom (sourceJob._Client, linkToGhosts); _Client.copyFrom (sourceJob._Client, linkToGhosts);
_CompanyUser.copyFrom (sourceJob._CompanyUser, linkToGhosts); _CompanyUser.copyFrom (sourceJob._CompanyUser, linkToGhosts);
_ShortenedURL.copyFrom (sourceJob._ShortenedURL, linkToGhosts);
} }
} }
...@@ -5428,6 +5564,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5428,6 +5564,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Level.readExternalData(vals.get(SINGLEREFERENCE_Level)); _Level.readExternalData(vals.get(SINGLEREFERENCE_Level));
_Client.readExternalData(vals.get(SINGLEREFERENCE_Client)); _Client.readExternalData(vals.get(SINGLEREFERENCE_Client));
_CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser)); _CompanyUser.readExternalData(vals.get(SINGLEREFERENCE_CompanyUser));
_ShortenedURL.readExternalData(vals.get(SINGLEREFERENCE_ShortenedURL));
_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));
...@@ -5476,6 +5613,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5476,6 +5613,7 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData()); vals.put (SINGLEREFERENCE_Level, _Level.writeExternalData());
vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData()); vals.put (SINGLEREFERENCE_Client, _Client.writeExternalData());
vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData()); vals.put (SINGLEREFERENCE_CompanyUser, _CompanyUser.writeExternalData());
vals.put (SINGLEREFERENCE_ShortenedURL, _ShortenedURL.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());
...@@ -5560,6 +5698,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5560,6 +5698,7 @@ public abstract class BaseJob extends BaseBusinessClass
_Level.compare (otherJob._Level, listener); _Level.compare (otherJob._Level, listener);
_Client.compare (otherJob._Client, listener); _Client.compare (otherJob._Client, listener);
_CompanyUser.compare (otherJob._CompanyUser, listener); _CompanyUser.compare (otherJob._CompanyUser, listener);
_ShortenedURL.compare (otherJob._ShortenedURL, listener);
// Compare multiple assocs // Compare multiple assocs
...@@ -5617,6 +5756,7 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5617,6 +5756,7 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitAssociation (_Level); visitor.visitAssociation (_Level);
visitor.visitAssociation (_Client); visitor.visitAssociation (_Client);
visitor.visitAssociation (_CompanyUser); visitor.visitAssociation (_CompanyUser);
visitor.visitAssociation (_ShortenedURL);
visitor.visitAssociation (_JobApplications); visitor.visitAssociation (_JobApplications);
visitor.visitAssociation (_AssessmentCriterias); visitor.visitAssociation (_AssessmentCriterias);
visitor.visitAssociation (_CultureCriterias); visitor.visitAssociation (_CultureCriterias);
...@@ -5652,6 +5792,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5652,6 +5792,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
visitor.visit (_CompanyUser); visitor.visit (_CompanyUser);
} }
if (scope.includes (_ShortenedURL))
{
visitor.visit (_ShortenedURL);
}
if (scope.includes (_JobApplications)) if (scope.includes (_JobApplications))
{ {
visitor.visit (_JobApplications); visitor.visit (_JobApplications);
...@@ -5761,6 +5905,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5761,6 +5905,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return filter.matches (getCompanyUser ()); return filter.matches (getCompanyUser ());
} }
else if (attribName.equals (SINGLEREFERENCE_ShortenedURL))
{
return filter.matches (getShortenedURL ());
}
else else
{ {
return super.testFilter (attribName, filter); return super.testFilter (attribName, filter);
...@@ -5900,6 +6048,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -5900,6 +6048,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchAll andShortenedURL (QueryFilter<ShortenedURL> filter)
{
filter.addFilter (context, "tl_job.shortened_url_id", "ShortenedURL");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -6071,6 +6225,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6071,6 +6225,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchJobKey andShortenedURL (QueryFilter<ShortenedURL> filter)
{
filter.addFilter (context, "tl_job.shortened_url_id", "ShortenedURL");
return this;
}
public Job search (ObjectTransaction transaction) throws StorageException public Job search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -6236,6 +6396,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6236,6 +6396,12 @@ public abstract class BaseJob extends BaseBusinessClass
return this; return this;
} }
public SearchCompany andShortenedURL (QueryFilter<ShortenedURL> filter)
{
filter.addFilter (context, "tl_job.shortened_url_id", "ShortenedURL");
return this;
}
public Job[] public Job[]
search (ObjectTransaction transaction) throws StorageException search (ObjectTransaction transaction) throws StorageException
{ {
...@@ -6738,6 +6904,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -6738,6 +6904,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return getWriteability_CompanyUser (); return getWriteability_CompanyUser ();
} }
else if (fieldName.equals (SINGLEREFERENCE_ShortenedURL))
{
return getWriteability_ShortenedURL ();
}
else if (fieldName.equals (FIELD_Email)) else if (fieldName.equals (FIELD_Email))
{ {
return getWriteability_Email (); return getWriteability_Email ();
...@@ -7743,6 +7913,10 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7743,6 +7913,10 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return toCompanyUser (); return toCompanyUser ();
} }
if (name.equals ("ShortenedURL"))
{
return toShortenedURL ();
}
return super.to(name); return super.to(name);
...@@ -7840,6 +8014,12 @@ public abstract class BaseJob extends BaseBusinessClass ...@@ -7840,6 +8014,12 @@ public abstract class BaseJob extends BaseBusinessClass
{ {
return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter)); return CompanyUser.REFERENCE_CompanyUser.new CompanyUserPipeLineFactory<From, CompanyUser> (this, new ORMSingleAssocPipe<Me, CompanyUser>(SINGLEREFERENCE_CompanyUser, filter));
} }
public ShortenedURL.ShortenedURLPipeLineFactory<From, ShortenedURL> toShortenedURL () { return toShortenedURL (Filter.ALL); }
public ShortenedURL.ShortenedURLPipeLineFactory<From, ShortenedURL> toShortenedURL (Filter<ShortenedURL> filter)
{
return ShortenedURL.REFERENCE_ShortenedURL.new ShortenedURLPipeLineFactory<From, ShortenedURL> (this, new ORMSingleAssocPipe<Me, ShortenedURL>(SINGLEREFERENCE_ShortenedURL, filter));
}
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); } public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications () { return toJobApplications(Filter.ALL); }
public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter) public JobApplication.JobApplicationPipeLineFactory<From, JobApplication> toJobApplications (Filter<JobApplication> filter)
...@@ -8053,6 +8233,20 @@ class DummyJob extends Job ...@@ -8053,6 +8233,20 @@ class DummyJob extends Job
return CompanyUser.DUMMY_CompanyUser.getObjectID(); return CompanyUser.DUMMY_CompanyUser.getObjectID();
} }
public ShortenedURL getShortenedURL () throws StorageException
{
return (ShortenedURL)(ShortenedURL.DUMMY_ShortenedURL);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getShortenedURLID ()
{
return ShortenedURL.DUMMY_ShortenedURL.getObjectID();
}
public int getJobApplicationsCount () throws StorageException public int getJobApplicationsCount () throws StorageException
{ {
return 0; return 0;
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
public abstract class BaseShortenedURL extends BaseBusinessClass
{
// Reference instance for the object
public static final ShortenedURL REFERENCE_ShortenedURL = new ShortenedURL ();
// Reference instance for the object
public static final ShortenedURL DUMMY_ShortenedURL = new DummyShortenedURL ();
// Static constants corresponding to field names
public static final String FIELD_Code = "Code";
public static final String FIELD_UrlLink = "UrlLink";
// Static constants corresponding to searches
public static final String SEARCH_all = "all";
public static final String SEARCH_ByCode = "ByCode";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<ShortenedURL> HELPER_Code = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<ShortenedURL> HELPER_UrlLink = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _Code;
private String _UrlLink;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_ShortenedURL = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Code_Validators;
private static final AttributeValidator[] FIELD_UrlLink_Validators;
// Arrays of behaviour decorators
private static final ShortenedURLBehaviourDecorator[] ShortenedURL_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_Code_Validators = (AttributeValidator[])setupAttribMetaData_Code(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_UrlLink_Validators = (AttributeValidator[])setupAttribMetaData_UrlLink(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_ShortenedURL.initialiseReference ();
DUMMY_ShortenedURL.initialiseReference ();
ShortenedURL_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(ShortenedURL.class).toArray(new ShortenedURLBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_Code(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "code");
metaInfo.put ("length", "8");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Code");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ShortenedURL.Code:", metaInfo);
ATTRIBUTES_METADATA_ShortenedURL.put (FIELD_Code, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ShortenedURL.class, "Code", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ShortenedURL.Code:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_UrlLink(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "url_link");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "UrlLink");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for ShortenedURL.UrlLink:", metaInfo);
ATTRIBUTES_METADATA_ShortenedURL.put (FIELD_UrlLink, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(ShortenedURL.class, "UrlLink", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for ShortenedURL.UrlLink:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseShortenedURL ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return ShortenedURL_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_Code = (String)(HELPER_Code.initialise (_Code));
_UrlLink = (String)(HELPER_UrlLink.initialise (_UrlLink));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute Code
*/
public String getCode ()
{
assertValid();
String valToReturn = _Code;
for (ShortenedURLBehaviourDecorator bhd : ShortenedURL_BehaviourDecorators)
{
valToReturn = bhd.getCode ((ShortenedURL)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 preCodeChange (String newCode) 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 postCodeChange () throws FieldException
{
}
public FieldWriteability getWriteability_Code ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Code. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setCode (String newCode) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Code.compare (_Code, newCode);
try
{
for (ShortenedURLBehaviourDecorator bhd : ShortenedURL_BehaviourDecorators)
{
newCode = bhd.setCode ((ShortenedURL)this, newCode);
oldAndNewIdentical = HELPER_Code.compare (_Code, newCode);
}
BusinessObjectParser.assertFieldCondition (newCode != null, this, FIELD_Code, "mandatory");
if (FIELD_Code_Validators.length > 0)
{
Object newCodeObj = HELPER_Code.toObject (newCode);
if (newCodeObj != null)
{
int loopMax = FIELD_Code_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ShortenedURL.get (FIELD_Code);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Code_Validators[v].checkAttribute (this, FIELD_Code, metadata, newCodeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Code () != FieldWriteability.FALSE, "Field Code is not writeable");
preCodeChange (newCode);
markFieldChange (FIELD_Code);
_Code = newCode;
postFieldChange (FIELD_Code);
postCodeChange ();
}
}
/**
* Get the attribute UrlLink
*/
public String getUrlLink ()
{
assertValid();
String valToReturn = _UrlLink;
for (ShortenedURLBehaviourDecorator bhd : ShortenedURL_BehaviourDecorators)
{
valToReturn = bhd.getUrlLink ((ShortenedURL)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 preUrlLinkChange (String newUrlLink) 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 postUrlLinkChange () throws FieldException
{
}
public FieldWriteability getWriteability_UrlLink ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute UrlLink. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setUrlLink (String newUrlLink) throws FieldException
{
boolean oldAndNewIdentical = HELPER_UrlLink.compare (_UrlLink, newUrlLink);
try
{
for (ShortenedURLBehaviourDecorator bhd : ShortenedURL_BehaviourDecorators)
{
newUrlLink = bhd.setUrlLink ((ShortenedURL)this, newUrlLink);
oldAndNewIdentical = HELPER_UrlLink.compare (_UrlLink, newUrlLink);
}
BusinessObjectParser.assertFieldCondition (newUrlLink != null, this, FIELD_UrlLink, "mandatory");
if (FIELD_UrlLink_Validators.length > 0)
{
Object newUrlLinkObj = HELPER_UrlLink.toObject (newUrlLink);
if (newUrlLinkObj != null)
{
int loopMax = FIELD_UrlLink_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_ShortenedURL.get (FIELD_UrlLink);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_UrlLink_Validators[v].checkAttribute (this, FIELD_UrlLink, metadata, newUrlLinkObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_UrlLink () != FieldWriteability.FALSE, "Field UrlLink is not writeable");
preUrlLinkChange (newUrlLink);
markFieldChange (FIELD_UrlLink);
_UrlLink = newUrlLink;
postFieldChange (FIELD_UrlLink);
postUrlLinkChange ();
}
}
/**
* 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 ShortenedURL newInstance ()
{
return new ShortenedURL ();
}
public ShortenedURL referenceInstance ()
{
return REFERENCE_ShortenedURL;
}
public ShortenedURL getInTransaction (ObjectTransaction t) throws StorageException
{
return getShortenedURLByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_ShortenedURL;
}
public String getBaseSetName ()
{
return "tl_shortened_url";
}
/**
* 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_shortened_urlPSet = allSets.getPersistentSet (myID, "tl_shortened_url", myPSetStatus);
tl_shortened_urlPSet.setAttrib (FIELD_ObjectID, myID);
tl_shortened_urlPSet.setAttrib (FIELD_Code, HELPER_Code.toObject (_Code)); //
tl_shortened_urlPSet.setAttrib (FIELD_UrlLink, HELPER_UrlLink.toObject (_UrlLink)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_shortened_urlPSet = allSets.getPersistentSet (objectID, "tl_shortened_url");
_Code = (String)(HELPER_Code.fromObject (_Code, tl_shortened_urlPSet.getAttrib (FIELD_Code))); //
_UrlLink = (String)(HELPER_UrlLink.fromObject (_UrlLink, tl_shortened_urlPSet.getAttrib (FIELD_UrlLink))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof ShortenedURL)
{
ShortenedURL otherShortenedURL = (ShortenedURL)other;
try
{
setCode (otherShortenedURL.getCode ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setUrlLink (otherShortenedURL.getUrlLink ());
}
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 BaseShortenedURL)
{
BaseShortenedURL sourceShortenedURL = (BaseShortenedURL)(source);
_Code = sourceShortenedURL._Code;
_UrlLink = sourceShortenedURL._UrlLink;
}
}
/**
* 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 BaseShortenedURL)
{
BaseShortenedURL sourceShortenedURL = (BaseShortenedURL)(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 BaseShortenedURL)
{
BaseShortenedURL sourceShortenedURL = (BaseShortenedURL)(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);
_Code = (String)(HELPER_Code.readExternal (_Code, vals.get(FIELD_Code))); //
_UrlLink = (String)(HELPER_UrlLink.readExternal (_UrlLink, vals.get(FIELD_UrlLink))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_Code, HELPER_Code.writeExternal (_Code));
vals.put (FIELD_UrlLink, HELPER_UrlLink.writeExternal (_UrlLink));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseShortenedURL)
{
BaseShortenedURL otherShortenedURL = (BaseShortenedURL)(other);
if (!HELPER_Code.compare(this._Code, otherShortenedURL._Code))
{
listener.notifyFieldChange(this, other, FIELD_Code, HELPER_Code.toObject(this._Code), HELPER_Code.toObject(otherShortenedURL._Code));
}
if (!HELPER_UrlLink.compare(this._UrlLink, otherShortenedURL._UrlLink))
{
listener.notifyFieldChange(this, other, FIELD_UrlLink, HELPER_UrlLink.toObject(this._UrlLink), HELPER_UrlLink.toObject(otherShortenedURL._UrlLink));
}
// 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_Code, HELPER_Code.toObject(getCode()));
visitor.visitField(this, FIELD_UrlLink, HELPER_UrlLink.toObject(getUrlLink()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static ShortenedURL createShortenedURL (ObjectTransaction transaction) throws StorageException
{
ShortenedURL result = new ShortenedURL ();
result.initialiseNewObject (transaction);
return result;
}
public static ShortenedURL getShortenedURLByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (ShortenedURL)(transaction.getObjectByID (REFERENCE_ShortenedURL, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Code))
{
return filter.matches (getCode ());
}
else if (attribName.equals (FIELD_UrlLink))
{
return filter.matches (getUrlLink ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static Searchall SearchByall () { return new Searchall (); }
public static class Searchall extends SearchObject<ShortenedURL>
{
public Searchall andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_shortened_url.object_id", FIELD_ObjectID);
return this;
}
public Searchall andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_shortened_url.object_created_date", FIELD_ObjectCreated);
return this;
}
public Searchall andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_shortened_url.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public Searchall andCode (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_shortened_url.code", "Code");
return this;
}
public Searchall andUrlLink (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_shortened_url.url_link", "UrlLink");
return this;
}
public ShortenedURL[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_ShortenedURL, SEARCH_all, criteria);
Set<ShortenedURL> typedResults = new LinkedHashSet <ShortenedURL> ();
for (BaseBusinessClass bbcResult : results)
{
ShortenedURL aResult = (ShortenedURL)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ShortenedURL[0]);
}
}
public static ShortenedURL[]
searchall (ObjectTransaction transaction) throws StorageException
{
return SearchByall ()
.search (transaction);
}
public abstract boolean filterByCode(String Code) throws StorageException;
public static SearchByCode SearchByByCode () { return new SearchByCode (); }
public static class SearchByCode extends SearchObject<ShortenedURL>
{
public SearchByCode byCode (String Code)
{
by ("Code", Code);
return this;
}
public SearchByCode andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_shortened_url.object_id", FIELD_ObjectID);
return this;
}
public SearchByCode andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_shortened_url.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchByCode andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_shortened_url.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchByCode andCode (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_shortened_url.code", "Code");
return this;
}
public SearchByCode andUrlLink (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_shortened_url.url_link", "UrlLink");
return this;
}
public ShortenedURL[]
search (ObjectTransaction transaction) throws StorageException
{
String Code = (String)criteria.get ("Code");
BaseBusinessClass[] results = super.search (transaction, REFERENCE_ShortenedURL, SEARCH_ByCode, criteria);
Set<ShortenedURL> typedResults = new LinkedHashSet <ShortenedURL> ();
for (BaseBusinessClass bbcResult : results)
{
ShortenedURL aResult = (ShortenedURL)bbcResult;
// Check in case in memory objects should be excluded
if (!aResult.filterByCode(Code) || !filterAndsInMemory (aResult))
{
continue;
}
typedResults.add (aResult);
}
// Check in memory objects for matches
for (BaseBusinessClass bbcInMemory : transaction.getObjectsToStore ())
{
if (bbcInMemory instanceof ShortenedURL)
{
ShortenedURL aInMemory = (ShortenedURL)bbcInMemory;
if (!aInMemory.filterByCode(Code) || !filterAndsInMemory (aInMemory))
{
continue;
}
typedResults.add (aInMemory);
}
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new ShortenedURL[0]);
}
}
public static ShortenedURL[]
searchByCode (ObjectTransaction transaction, String Code) throws StorageException
{
return SearchByByCode ()
.byCode (Code)
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Code))
{
return HELPER_Code.toObject (getCode ());
}
else if (attribName.equals (FIELD_UrlLink))
{
return HELPER_UrlLink.toObject (getUrlLink ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_Code))
{
return HELPER_Code;
}
else if (attribName.equals (FIELD_UrlLink))
{
return HELPER_UrlLink;
}
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_Code))
{
setCode ((String)(HELPER_Code.fromObject (_Code, attribValue)));
}
else if (attribName.equals (FIELD_UrlLink))
{
setUrlLink ((String)(HELPER_UrlLink.fromObject (_UrlLink, 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_Code))
{
return getWriteability_Code ();
}
else if (fieldName.equals (FIELD_UrlLink))
{
return getWriteability_UrlLink ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_Code () != FieldWriteability.TRUE)
{
fields.add (FIELD_Code);
}
if (getWriteability_UrlLink () != FieldWriteability.TRUE)
{
fields.add (FIELD_UrlLink);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_Code.getAttribObject (getClass (), _Code, true, FIELD_Code));
result.add(HELPER_UrlLink.getAttribObject (getClass (), _UrlLink, true, FIELD_UrlLink));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_ShortenedURL.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_ShortenedURL.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_ShortenedURL.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_ShortenedURL.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 ShortenedURLBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<ShortenedURL>
{
/**
* Get the attribute Code
*/
public String getCode (ShortenedURL obj, String original)
{
return original;
}
/**
* Change the value set for attribute Code.
* May modify the field beforehand
* Occurs before validation.
*/
public String setCode (ShortenedURL obj, String newCode) throws FieldException
{
return newCode;
}
/**
* Get the attribute UrlLink
*/
public String getUrlLink (ShortenedURL obj, String original)
{
return original;
}
/**
* Change the value set for attribute UrlLink.
* May modify the field beforehand
* Occurs before validation.
*/
public String setUrlLink (ShortenedURL obj, String newUrlLink) throws FieldException
{
return newUrlLink;
}
}
public ORMPipeLine pipes()
{
return new ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> ((ShortenedURL)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> pipelineShortenedURL()
{
return (ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL>) pipes();
}
public static ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> pipesShortenedURL(Collection<ShortenedURL> items)
{
return REFERENCE_ShortenedURL.new ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> (items);
}
public static ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> pipesShortenedURL(ShortenedURL[] _items)
{
return pipesShortenedURL(Arrays.asList (_items));
}
public static ShortenedURLPipeLineFactory<ShortenedURL, ShortenedURL> pipesShortenedURL()
{
return pipesShortenedURL((Collection)null);
}
public class ShortenedURLPipeLineFactory<From extends BaseBusinessClass, Me extends ShortenedURL> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> ShortenedURLPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ShortenedURLPipeLineFactory (From seed)
{
super(seed);
}
public ShortenedURLPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("Code"))
{
return toCode ();
}
if (name.equals ("UrlLink"))
{
return toUrlLink ();
}
return super.to(name);
}
public PipeLine<From, String> toCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Code)); }
public PipeLine<From, String> toUrlLink () { return pipe(new ORMAttributePipe<Me, String>(FIELD_UrlLink)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyShortenedURL extends ShortenedURL
{
// Default constructor primarily to support Externalisable
public DummyShortenedURL()
{
super();
}
public void assertValid ()
{
}
}
package performa.orm; package performa.orm;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.security.SecUser; import oneit.security.SecUser;
...@@ -90,19 +93,6 @@ public class CompanyUser extends BaseCompanyUser ...@@ -90,19 +93,6 @@ public class CompanyUser extends BaseCompanyUser
} }
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() public String getEmailAddressFromUser()
{ {
return StringUtils.isEmailAddress(getUser().getUserName()) ? getUser().getUserName() : getUser().getEmail(); return StringUtils.isEmailAddress(getUser().getUserName()) ? getUser().getUserName() : getUser().getEmail();
...@@ -114,4 +104,43 @@ public class CompanyUser extends BaseCompanyUser ...@@ -114,4 +104,43 @@ public class CompanyUser extends BaseCompanyUser
return !StringUtils.isEmailAddress(getUser().getUserName()); return !StringUtils.isEmailAddress(getUser().getUserName());
} }
//verfy and cahnge email
public void changeEmail(HttpServletRequest request) throws FieldException
{
if(getIsEmailChanged()==Boolean.TRUE)
{
if(request.getSession().getAttribute("EmailToVerify")!=null)
{
if(CollectionUtils.equals(request.getSession().getAttribute("EmailToVerify"), getUser()))
{
setIsEmailChanged(Boolean.FALSE);
if(!isLoggedViaSocial())
{
SecUser secUser = getUser();
secUser.setUserName(secUser.getEmail());
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING2, "User name changed.", secUser);
}
request.getSession().setAttribute("EmailVerified", true);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "User Email verified", this);
}
else
{
request.getSession().setAttribute("EmailStillNotVerified", true);
}
request.getSession().removeAttribute("EmailToVerify");
}
else
{
request.getSession().setAttribute("EmailStillNotVerified", true);
}
}
}
} }
\ No newline at end of file
package performa.orm;
import oneit.security.SecUser;
public class CompanyUserNPO extends BaseCompanyUserNPO
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public CompanyUserNPO ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
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;
}
}
\ 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="CompanyUserNPO" package="performa.orm" superclass="NonPersistentBO">
<IMPORT value="oneit.servlets.orm.*"/>
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Email" type="String" validators="Email" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class CompanyUserNPOPersistenceMgr extends NonPersistentBOPersistenceMgr
{
private static final LoggingArea CompanyUserNPOPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "CompanyUserNPO");
// Private attributes corresponding to business object data
private String dummyEmail;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Email = DefaultAttributeHelper.INSTANCE;
public CompanyUserNPOPersistenceMgr ()
{
dummyEmail = (String)(HELPER_Email.initialise (dummyEmail));
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter., 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, CompanyUserNPO.REFERENCE_CompanyUserNPO);
if (objectToReturn instanceof CompanyUserNPO)
{
LogMgr.log (CompanyUserNPOPersistence, 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 CompanyUserNPO");
}
}
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(id, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(CompanyUserNPO.FIELD_Email))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (CompanyUserNPOPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
CompanyUserNPO result = new CompanyUserNPO ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}it_does_not_matter " +
"WHERE " + SELECT_JOINS + "{PREFIX}it_does_not_matter.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 it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Email.getForSQL(dummyEmail, it_does_not_matterPSet.getAttrib (CompanyUserNPO.FIELD_Email))).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}it_does_not_matter 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[] { "it_does_not_matter", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (CompanyUserNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:it_does_not_matter for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (CompanyUserNPOPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (CompanyUserNPOPersistence, 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 it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
LogMgr.log (CompanyUserNPOPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}it_does_not_matter " +
"WHERE it_does_not_matter.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}it_does_not_matter WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:it_does_not_matter for row:" + objectID;
LogMgr.log (CompanyUserNPOPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, CompanyUserNPO> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (CompanyUserNPO.REFERENCE_CompanyUserNPO.getObjectIDSpace (), r.getLong ("id"));
CompanyUserNPO 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, CompanyUserNPO.REFERENCE_CompanyUserNPO);
if (cachedElement instanceof CompanyUserNPO)
{
LogMgr.log (CompanyUserNPOPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (CompanyUserNPO)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a CompanyUserNPO");
}
}
else
{
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new CompanyUserNPO ();
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 (CompanyUserNPOPersistence, 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}it_does_not_matter " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
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 CompanyUserNPO)
{
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 it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter", PersistentSetStatus.FETCHED);
// Object Modified
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(CompanyUserNPO.FIELD_Email, HELPER_Email.getFromRS(dummyEmail, r, ""));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
it_does_not_matterPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" (, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Email.getForSQL(dummyEmail, it_does_not_matterPSet.getAttrib (CompanyUserNPO.FIELD_Email))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm; package performa.orm;
import oneit.utils.BusinessException;
public class CultureCriteria extends BaseCultureCriteria public class CultureCriteria extends BaseCultureCriteria
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<TABLE name="tl_culture_criteria" tablePrefix="object" polymorphic="FALSE"> <TABLE name="tl_culture_criteria" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="Importance.DESIRABLE"/> <ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="Importance.NOT_APPLICABLE"/>
<SINGLEREFERENCE name="CultureElement" type="CultureElement" dbcol="culture_element_id" mandatory="true" /> <SINGLEREFERENCE name="CultureElement" type="CultureElement" dbcol="culture_element_id" mandatory="true" />
<SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id" mandatory="true" /> <SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id" mandatory="true" />
......
...@@ -2,6 +2,7 @@ package performa.orm; ...@@ -2,6 +2,7 @@ package performa.orm;
import java.util.*; import java.util.*;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
import oneit.net.LoopbackHTTP;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.objstore.cloning.AssocCopyingRule; import oneit.objstore.cloning.AssocCopyingRule;
import oneit.objstore.cloning.BusinessCopyHelper; import oneit.objstore.cloning.BusinessCopyHelper;
...@@ -390,6 +391,7 @@ public class Job extends BaseJob ...@@ -390,6 +391,7 @@ public class Job extends BaseJob
} }
options.add(AppProcessOption.REMOVE_FROM_SHORTLIST); options.add(AppProcessOption.REMOVE_FROM_SHORTLIST);
options.add(AppProcessOption.TO_UNSUITABLE);
return options; return options;
} }
...@@ -473,11 +475,11 @@ public class Job extends BaseJob ...@@ -473,11 +475,11 @@ public class Job extends BaseJob
public BinaryContent getLogo() public BinaryContent getLogo()
{ {
if(isClientAvailable() && getClient().getClientLogo()!= null) if(isClientAvailable())
{ {
return getClient().getClientLogo(); return getClient().getClientLogo();
} }
else if(getCompanyUser() != null && getCompanyUser().getCompany().getCompanyLogo() != null) else if(getCompanyUser() != null)
{ {
return getCompanyUser().getCompany().getCompanyLogo(); return getCompanyUser().getCompany().getCompanyLogo();
} }
...@@ -499,4 +501,43 @@ public class Job extends BaseJob ...@@ -499,4 +501,43 @@ public class Job extends BaseJob
return Arrays.asList(new JobStatus[]{JobStatus.OPEN, JobStatus.COMPLETE, JobStatus.FILLED}); return Arrays.asList(new JobStatus[]{JobStatus.OPEN, JobStatus.COMPLETE, JobStatus.FILLED});
} }
private String getURL()
{
return "/ApplicantPortal-ApplyJob.htm?" + "id=" + getID() + "&key=" + getRandomKey();
}
public void createShortenedURL() throws StorageException, FieldException
{
ShortenedURL shortenedURL = ShortenedURL.createShortenedURL(getTransaction());
shortenedURL.setUrlLink(getURL());
shortenedURL.setCode(generateUniqueCode());
setShortenedURL(shortenedURL);
}
private String generateUniqueCode()
{
String randomString;
while (true)
{
randomString = RandomStringGen.getRandomStringGen().generateAlphaNum(6);
ShortenedURL[] searchByCode = ShortenedURL.searchByCode(getTransaction(), randomString);
if (searchByCode.length == 0)
{
return randomString;
}
}
}
public String getShortenedUrlLink()
{
return LoopbackHTTP.getRemoteAccessURL("/j/" + (getShortenedURL() != null ? getShortenedURL().getCode() : ""));
}
} }
\ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<ATTRIB name="JobStatus" type="JobStatus" dbcol="job_status" attribHelper="EnumeratedAttributeHelper" mandatory="true"/> <ATTRIB name="JobStatus" type="JobStatus" dbcol="job_status" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="OpenDate" type="Date" dbcol="open_date"/> <ATTRIB name="OpenDate" type="Date" dbcol="open_date"/>
<ATTRIB name="ApplyBy" type="Date" dbcol="apply_by"/> <ATTRIB name="ApplyBy" type="Date" dbcol="apply_by"/>
<ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.TRUE"/> <ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.FALSE"/>
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/> <ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/>
<ATTRIB name="RandomKey" type="String" dbcol="random_key" length="10"/> <ATTRIB name="RandomKey" type="String" dbcol="random_key" length="10"/>
<ATTRIB name="JobType" type="JobType" dbcol="job_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="JobType.FULL_TIME"/> <ATTRIB name="JobType" type="JobType" dbcol="job_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="JobType.FULL_TIME"/>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="true"/> <SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="true"/>
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" /> <SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" />
<SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" />
</TABLE> </TABLE>
......
...@@ -348,14 +348,53 @@ public class JobApplication extends BaseJobApplication ...@@ -348,14 +348,53 @@ public class JobApplication extends BaseJobApplication
return getRequirementFit() != null ? (Long) getRequirementFit().get(null) : 0; return getRequirementFit() != null ? (Long) getRequirementFit().get(null) : 0;
} }
public String getCultureFitColor()
{
long score = getCultureFitScore();
return score >= 70 ? "green" : (score >= 50 ? "yellow" : "red-b");
}
public String getRequirementFitColor()
{
long score = getRequirementFitScore();
Filter filter = AssessmentCriteria.SearchByAll().andImportance(new EqualsFilter<>(Importance.ESSENTIAL));
Collection<AssessmentCriteria> essentialRequirements = CollectionFilter.filter(getJob().getAssessmentCriteriasSet(), filter);
if(essentialRequirements.size() > 0)
{
Filter negativeFilter = AssessmentCriteriaAnswer.SearchByAll().andAnswer(new EqualsFilter<>(Boolean.FALSE));
if(CollectionFilter.filter(getRequirementAnswersByImportance().getValuesForKey(Importance.ESSENTIAL), negativeFilter).size() > 0)
{
return "red-b";
}
}
return score >= 80 ? "green" : (score >= 60 ? "yellow" : "red-b");
}
//This will return relative percentage considering topper as 100% //This will return relative percentage considering topper as 100%
public Double getRoleFitPercentage() public Double getRoleFitPercentage()
{ {
JobApplication jobTopper = getJob() != null ? getJob().getTopper() : null; Double myScore = getRoleFitScore();
Double myScore = getRoleFitScore();
Double topScore = jobTopper != null ? jobTopper.getRoleFitScore() : null;
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2); if(myScore > 0 && getCandidate() != null && getJob() != null && getJob().getLevel() != null)
{
TestAnalysis testAnalysis = getCandidate().getTestAnalysisFor(getJob().getLevel());
if(testAnalysis != null)
{
Double topScore = AnalysisEngine.getSuitabilityScore(testAnalysis, true).get0();
if(topScore > 0)
{
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2);
}
}
}
return 0d;
} }
public List<AppProcessOption> getValidProcessOptions() public List<AppProcessOption> getValidProcessOptions()
...@@ -426,9 +465,9 @@ public class JobApplication extends BaseJobApplication ...@@ -426,9 +465,9 @@ public class JobApplication extends BaseJobApplication
//to get pending time to complete job application //to get pending time to complete job application
public Integer getRemainingTime() public Integer getRemainingTime()
{ {
//req-07 min //req-05 min
//cul-07 min //cul-05 min
//req-26 min //req-20 min
int remainingTime = 0; int remainingTime = 0;
...@@ -437,21 +476,19 @@ public class JobApplication extends BaseJobApplication ...@@ -437,21 +476,19 @@ public class JobApplication extends BaseJobApplication
{ {
if(!selectionCompleted()) if(!selectionCompleted())
{ {
remainingTime += 7; remainingTime += 5;
} }
} }
if(!cultureCompleted()) if(!cultureCompleted())
{ {
remainingTime += 7; remainingTime += 5;
} }
//ROLE //ROLE
remainingTime += getRoleTestRemainingTime() ;
if(!assessmentCompleted()) if(!assessmentCompleted())
{ {
remainingTime += 6; remainingTime += getRoleTestRemainingTime() ;
} }
return remainingTime; return remainingTime;
......
...@@ -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.client_id, {PREFIX}tl_job.company_user_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, {PREFIX}tl_job.shortened_url_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
...@@ -154,7 +154,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -154,7 +154,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!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_Client)|| !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Client)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_CompanyUser)) !tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_CompanyUser)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_ShortenedURL))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -234,10 +235,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -234,10 +235,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 = ? , client_id = ? , company_user_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 = ? , shortened_url_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_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))).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 (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -622,6 +623,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -622,6 +623,7 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
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_Client, r.getObject ("client_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Client, r.getObject ("client_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id")); tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_CompanyUser, r.getObject ("company_user_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_ShortenedURL, r.getObject ("shortened_url_id"));
} }
...@@ -638,10 +640,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr ...@@ -638,10 +640,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, client_id, company_user_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, shortened_url_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_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))) .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 (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED); tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
package performa.orm;
import oneit.objstore.StorageException;
import oneit.utils.CollectionUtils;
public class ShortenedURL extends BaseShortenedURL
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public ShortenedURL ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public boolean filterByCode(String code) throws StorageException
{
return CollectionUtils.equals(code, getCode());
}
}
\ No newline at end of file
<?xml version="1.0"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="ShortenedURL" package="performa.orm">
<TABLE name="tl_shortened_url" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Code" type="String" dbcol="code" mandatory="true" length="8"/>
<ATTRIB name="UrlLink" type="String" dbcol="url_link" mandatory="true" />
</TABLE>
<SEARCH type="all" paramFilter="object_id is not null" orderBy="object_created_date desc">
</SEARCH>
<SEARCH type="ByCode" paramFilter="object_id is not NULL" checkTXObjects="TRUE">
<PARAM name="Code" type="String" paramFilter="trim(code) = ${Code}"/>
</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.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class ShortenedURLPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea ShortenedURLPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "ShortenedURL");
// Private attributes corresponding to business object data
private String dummyCode;
private String dummyUrlLink;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Code = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_UrlLink = DefaultAttributeHelper.INSTANCE;
public ShortenedURLPersistenceMgr ()
{
dummyCode = (String)(HELPER_Code.initialise (dummyCode));
dummyUrlLink = (String)(HELPER_UrlLink.initialise (dummyUrlLink));
}
private String SELECT_COLUMNS = "{PREFIX}tl_shortened_url.object_id as id, {PREFIX}tl_shortened_url.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_shortened_url.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_shortened_url.code, {PREFIX}tl_shortened_url.url_link, 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, ShortenedURL.REFERENCE_ShortenedURL);
if (objectToReturn instanceof ShortenedURL)
{
LogMgr.log (ShortenedURLPersistence, 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 ShortenedURL");
}
}
PersistentSet tl_shortened_urlPSet = allPSets.getPersistentSet(id, "tl_shortened_url", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_shortened_urlPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_shortened_urlPSet.containsAttrib(ShortenedURL.FIELD_Code)||
!tl_shortened_urlPSet.containsAttrib(ShortenedURL.FIELD_UrlLink))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (ShortenedURLPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
ShortenedURL result = new ShortenedURL ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_shortened_url " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_shortened_url.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_shortened_urlPSet = allPSets.getPersistentSet(objectID, "tl_shortened_url");
if (tl_shortened_urlPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_shortened_urlPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_shortened_url " +
"SET code = ?, url_link = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_shortened_url.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Code.getForSQL(dummyCode, tl_shortened_urlPSet.getAttrib (ShortenedURL.FIELD_Code))).listEntry (HELPER_UrlLink.getForSQL(dummyUrlLink, tl_shortened_urlPSet.getAttrib (ShortenedURL.FIELD_UrlLink))).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_shortened_url 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_shortened_url", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (ShortenedURLPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_shortened_url");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_shortened_url for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (ShortenedURLPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_shortened_urlPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (ShortenedURLPersistence, 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_shortened_urlPSet = allPSets.getPersistentSet(objectID, "tl_shortened_url");
LogMgr.log (ShortenedURLPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_shortened_urlPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_shortened_urlPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_shortened_url " +
"WHERE tl_shortened_url.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_shortened_url WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_shortened_url");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_shortened_url for row:" + objectID;
LogMgr.log (ShortenedURLPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_shortened_urlPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryall (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryall");
}
public ResultSet executeSearchQueryByCode (SQLManager sqlMgr, String Code) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryByCode");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, ShortenedURL> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (ShortenedURL.REFERENCE_ShortenedURL.getObjectIDSpace (), r.getLong ("id"));
ShortenedURL 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, ShortenedURL.REFERENCE_ShortenedURL);
if (cachedElement instanceof ShortenedURL)
{
LogMgr.log (ShortenedURLPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (ShortenedURL)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a ShortenedURL");
}
}
else
{
PersistentSet tl_shortened_urlPSet = allPSets.getPersistentSet(objectID, "tl_shortened_url", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new ShortenedURL ();
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 (ShortenedURLPersistence, 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_shortened_url " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (ShortenedURL.SEARCH_all))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY object_created_date desc";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: object_id is not null
String preFilter = "(object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_shortened_url " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (ShortenedURL.SEARCH_ByCode))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: object_id is not NULL
String preFilter = "(object_id is not NULL)"
+ " ";
if (criteria.containsKey("Code"))
{
preFilter += " AND (trim(code) = ${Code}) ";
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_shortened_url " + 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_shortened_urlPSet = allPSets.getPersistentSet(objectID, "tl_shortened_url", PersistentSetStatus.FETCHED);
// Object Modified
tl_shortened_urlPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_shortened_urlPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_shortened_urlPSet.setAttrib(ShortenedURL.FIELD_Code, HELPER_Code.getFromRS(dummyCode, r, "code"));
tl_shortened_urlPSet.setAttrib(ShortenedURL.FIELD_UrlLink, HELPER_UrlLink.getFromRS(dummyUrlLink, r, "url_link"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_shortened_urlPSet = allPSets.getPersistentSet(objectID, "tl_shortened_url");
if (tl_shortened_urlPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_shortened_urlPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_shortened_url " +
" (code, url_link, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Code.getForSQL(dummyCode, tl_shortened_urlPSet.getAttrib (ShortenedURL.FIELD_Code))).listEntry (HELPER_UrlLink.getForSQL(dummyUrlLink, tl_shortened_urlPSet.getAttrib (ShortenedURL.FIELD_UrlLink))) .listEntry (objectID.longID ()).toList().toArray());
tl_shortened_urlPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
...@@ -20,12 +20,14 @@ public class AppProcessOption extends AbstractEnumerated ...@@ -20,12 +20,14 @@ public class AppProcessOption extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_AppProcessOption = new AppProcessOptionFactory(); public static final EnumeratedFactory FACTORY_AppProcessOption = new AppProcessOptionFactory();
public static final AppProcessOption TO_SHORTLIST = new AppProcessOption ("TO_SHORTLIST", "TO_SHORTLIST", "To Shortlist", false); public static final AppProcessOption TO_SHORTLIST = new AppProcessOption ("TO_SHORTLIST", "TO_SHORTLIST", "To Shortlisted", false);
public static final AppProcessOption REMOVE_FROM_SHORTLIST = new AppProcessOption ("REMOVE_FROM_SHORTLIST", "REMOVE_FROM_SHORTLIST", "Remove From Shortlist", false); public static final AppProcessOption REMOVE_FROM_SHORTLIST = new AppProcessOption ("REMOVE_FROM_SHORTLIST", "REMOVE_FROM_SHORTLIST", "Remove From Shortlisted", false);
public static final AppProcessOption TO_UNSUITABLE = new AppProcessOption ("TO_UNSUITABLE", "TO_UNSUITABLE", "To Unsuitable", false);
private static final AppProcessOption[] allAppProcessOptions = private static final AppProcessOption[] allAppProcessOptions =
new AppProcessOption[] { TO_SHORTLIST,REMOVE_FROM_SHORTLIST}; new AppProcessOption[] { TO_SHORTLIST,REMOVE_FROM_SHORTLIST,TO_UNSUITABLE};
private static AppProcessOption[] getAllAppProcessOptions () private static AppProcessOption[] getAllAppProcessOptions ()
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
<ROOT> <ROOT>
<CONSTANT package="performa.orm.types" name="AppProcessOption"> <CONSTANT package="performa.orm.types" name="AppProcessOption">
<VALUE name="TO_SHORTLIST" value="TO_SHORTLIST" description="To Shortlist"/> <VALUE name="TO_SHORTLIST" value="TO_SHORTLIST" description="To Shortlisted"/>
<VALUE name="REMOVE_FROM_SHORTLIST" value="REMOVE_FROM_SHORTLIST" description="Remove From Shortlist"/> <VALUE name="REMOVE_FROM_SHORTLIST" value="REMOVE_FROM_SHORTLIST" description="Remove From Shortlisted"/>
<VALUE name="TO_UNSUITABLE" value="TO_UNSUITABLE" description="To Unsuitable"/>
</CONSTANT> </CONSTANT>
</ROOT> </ROOT>
...@@ -134,7 +134,7 @@ public class AssessmentType extends AbstractEnumerated ...@@ -134,7 +134,7 @@ public class AssessmentType extends AbstractEnumerated
public static void defineAdditionalData () public static void defineAdditionalData ()
{ {
COMPREHENSIVE.HeaderDesc = " – Up to 96% accuracy on candidate suitability "; COMPREHENSIVE.HeaderDesc = " – Up to 96% accuracy on candidate suitability ";
COMPREHENSIVE.AdditionalDesc = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh."; COMPREHENSIVE.AdditionalDesc = "";
COMPREHENSIVE.QuestionDetails = " (250 Questions - 20 Minutes)"; COMPREHENSIVE.QuestionDetails = " (250 Questions - 20 Minutes)";
COMPREHENSIVE.TestDescr = "Comprehensive Assessment"; COMPREHENSIVE.TestDescr = "Comprehensive Assessment";
EXPRESS.HeaderDesc = ""; EXPRESS.HeaderDesc = "";
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<DATA name="TestDescr" type="String" /> <DATA name="TestDescr" type="String" />
<VALUE name="COMPREHENSIVE" description="Talentology Comprehensive" HeaderDesc='" – Up to 96% accuracy on candidate suitability "' <VALUE name="COMPREHENSIVE" description="Talentology Comprehensive" HeaderDesc='" – Up to 96% accuracy on candidate suitability "'
AdditionalDesc='"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh."' AdditionalDesc='""'
QuestionDetails='" (250 Questions - 20 Minutes)"' QuestionDetails='" (250 Questions - 20 Minutes)"'
TestDescr='"Comprehensive Assessment"'/> TestDescr='"Comprehensive Assessment"'/>
<VALUE name="EXPRESS" description="Talentology Express" HeaderDesc='""' <VALUE name="EXPRESS" description="Talentology Express" HeaderDesc='""'
......
...@@ -37,10 +37,17 @@ public class CriteriaType extends AbstractEnumerated ...@@ -37,10 +37,17 @@ public class CriteriaType extends AbstractEnumerated
return allCriteriaTypes; return allCriteriaTypes;
} }
private transient boolean IsSingular;
private CriteriaType (String name, String value, String description, boolean disabled) private CriteriaType (String name, String value, String description, boolean disabled)
{ {
super (name, value, description, disabled); super (name, value, description, disabled);
} }
public boolean getIsSingular()
{
return IsSingular;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allCriteriaTypes); public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allCriteriaTypes);
...@@ -109,6 +116,10 @@ public class CriteriaType extends AbstractEnumerated ...@@ -109,6 +116,10 @@ public class CriteriaType extends AbstractEnumerated
public static void defineAdditionalData () public static void defineAdditionalData ()
{ {
QUALIFICATION.IsSingular = false;
SKILL.IsSingular = false;
EXPERIENCE.IsSingular = true;
KNOWLEDGE.IsSingular = true;
} }
...@@ -136,6 +147,7 @@ public class CriteriaType extends AbstractEnumerated ...@@ -136,6 +147,7 @@ public class CriteriaType extends AbstractEnumerated
{ {
Map attribs = new HashMap (); Map attribs = new HashMap ();
attribs.put ("IsSingular", ArrayFormatter.toObject(getIsSingular()));
return attribs; return attribs;
} }
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
<ROOT> <ROOT>
<CONSTANT package="performa.orm.types" name="CriteriaType"> <CONSTANT package="performa.orm.types" name="CriteriaType">
<VALUE name="QUALIFICATION" value="QUALIFICATION" description="Qualifications"/> <DATA name="IsSingular" type="boolean"/>
<VALUE name="SKILL" value="SKILL" description="Skills"/>
<VALUE name="EXPERIENCE" value="EXPERIENCE" description="Experience"/> <VALUE name="QUALIFICATION" value="QUALIFICATION" description="Qualifications" IsSingular="false"/>
<VALUE name="KNOWLEDGE" value="KNOWLEDGE" description="Knowledge"/> <VALUE name="SKILL" value="SKILL" description="Skills" IsSingular="false"/>
<VALUE name="EXPERIENCE" value="EXPERIENCE" description="Experience" IsSingular="true"/>
<VALUE name="KNOWLEDGE" value="KNOWLEDGE" description="Knowledge" IsSingular="true"/>
</CONSTANT> </CONSTANT>
</ROOT> </ROOT>
...@@ -41,6 +41,8 @@ public class Importance extends AbstractEnumerated ...@@ -41,6 +41,8 @@ public class Importance extends AbstractEnumerated
private transient Integer WeightingScore; private transient Integer WeightingScore;
private transient String CultureDescription;
private Importance (String name, String value, String description, boolean disabled) private Importance (String name, String value, String description, boolean disabled)
{ {
super (name, value, description, disabled); super (name, value, description, disabled);
...@@ -55,6 +57,11 @@ public class Importance extends AbstractEnumerated ...@@ -55,6 +57,11 @@ public class Importance extends AbstractEnumerated
{ {
return WeightingScore; return WeightingScore;
} }
public String getCultureDescription()
{
return CultureDescription;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allImportances); public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allImportances);
...@@ -125,12 +132,16 @@ public class Importance extends AbstractEnumerated ...@@ -125,12 +132,16 @@ public class Importance extends AbstractEnumerated
{ {
NOT_APPLICABLE.ConsiderForAssessment = false; NOT_APPLICABLE.ConsiderForAssessment = false;
NOT_APPLICABLE.WeightingScore = 0; NOT_APPLICABLE.WeightingScore = 0;
NOT_APPLICABLE.CultureDescription = "Not Applicable";
DESIRABLE.ConsiderForAssessment = true; DESIRABLE.ConsiderForAssessment = true;
DESIRABLE.WeightingScore = 2; DESIRABLE.WeightingScore = 2;
DESIRABLE.CultureDescription = "Somewhat Important";
HIGHLY_DESIRABLE.ConsiderForAssessment = true; HIGHLY_DESIRABLE.ConsiderForAssessment = true;
HIGHLY_DESIRABLE.WeightingScore = 5; HIGHLY_DESIRABLE.WeightingScore = 5;
HIGHLY_DESIRABLE.CultureDescription = "Important";
ESSENTIAL.ConsiderForAssessment = true; ESSENTIAL.ConsiderForAssessment = true;
ESSENTIAL.WeightingScore = 10; ESSENTIAL.WeightingScore = 10;
ESSENTIAL.CultureDescription = "Essential";
} }
...@@ -160,6 +171,7 @@ public class Importance extends AbstractEnumerated ...@@ -160,6 +171,7 @@ public class Importance extends AbstractEnumerated
attribs.put ("ConsiderForAssessment", ArrayFormatter.toObject(getConsiderForAssessment())); attribs.put ("ConsiderForAssessment", ArrayFormatter.toObject(getConsiderForAssessment()));
attribs.put ("WeightingScore", ArrayFormatter.toObject(getWeightingScore())); attribs.put ("WeightingScore", ArrayFormatter.toObject(getWeightingScore()));
attribs.put ("CultureDescription", ArrayFormatter.toObject(getCultureDescription()));
return attribs; return attribs;
} }
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
<DATA name="ConsiderForAssessment" type="boolean" /> <DATA name="ConsiderForAssessment" type="boolean" />
<DATA name="WeightingScore" type="Integer"/> <DATA name="WeightingScore" type="Integer"/>
<DATA name="CultureDescription" type="String"/>
<VALUE name="NOT_APPLICABLE" description="Not Applicable" ConsiderForAssessment="false" WeightingScore="0"/> <VALUE name="NOT_APPLICABLE" description="Not Applicable" ConsiderForAssessment="false" WeightingScore="0" CultureDescription='"Not Applicable"'/>
<VALUE name="DESIRABLE" description="Desirable" ConsiderForAssessment="true" WeightingScore="2"/> <VALUE name="DESIRABLE" description="Desirable" ConsiderForAssessment="true" WeightingScore="2" CultureDescription='"Somewhat Important"'/>
<VALUE name="HIGHLY_DESIRABLE" description="Highly Desirable" ConsiderForAssessment="true" WeightingScore="5"/> <VALUE name="HIGHLY_DESIRABLE" description="Highly Desirable" ConsiderForAssessment="true" WeightingScore="5" CultureDescription='"Important"'/>
<VALUE name="ESSENTIAL" description="Essential" ConsiderForAssessment="true" WeightingScore="10"/> <VALUE name="ESSENTIAL" description="Essential" ConsiderForAssessment="true" WeightingScore="10" CultureDescription='"Essential"'/>
</CONSTANT> </CONSTANT>
</ROOT> </ROOT>
\ No newline at end of file
...@@ -438,18 +438,18 @@ public class AnalysisEngine ...@@ -438,18 +438,18 @@ public class AnalysisEngine
} }
scoreMap.put(factorClass, new Tuple.T2(score, colorCode)); scoreMap.put(factorClass, new Tuple.T2(score, colorCode));
} }
scoreMap.put(null, getSuitabilityScore(testAnalysis)); scoreMap.put(null, getSuitabilityScore(testAnalysis, false));
} }
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);
return scoreMap; return scoreMap;
} }
public static Tuple.T2<Double, ColorCode> getSuitabilityScore(TestAnalysis testAnalysis) public static Tuple.T2<Double, ColorCode> getSuitabilityScore(TestAnalysis testAnalysis, boolean maxScore)
{ {
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore called for testAnalysis ", testAnalysis); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore called for testAnalysis ", testAnalysis);
Double totalScore = testAnalysis.getWghtdLevelScore(); Double totalScore = maxScore ? testAnalysis.getMaxWghtdLevelScore() : testAnalysis.getWghtdLevelScore();
Double wghtdMeanScore = 0d; Double wghtdMeanScore = 0d;
Double wghtdStdDevScore = 0d; Double wghtdStdDevScore = 0d;
Double suitabilityScore = 0d; Double suitabilityScore = 0d;
......
...@@ -103,6 +103,10 @@ public class PerformaOAuthCallbackDecorator implements ServletDecorator, Initial ...@@ -103,6 +103,10 @@ public class PerformaOAuthCallbackDecorator implements ServletDecorator, Initial
companyUser.setRole(RoleType.ADMIN); companyUser.setRole(RoleType.ADMIN);
} }
else if(companyUser.getIsEmailChanged()==Boolean.TRUE)
{
companyUser.changeEmail(request);
}
} }
transaction.commit(); transaction.commit();
......
package performa.utils;
import oneit.appservices.config.ConfigMgr;
import oneit.components.InitialisationParticipant;
import oneit.components.ParticipantInitialisationContext;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.net.LoopbackHTTP;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.services.TransactionServicesFactory;
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.BusinessException;
import oneit.utils.InitialisationException;
import performa.orm.ShortenedURL;
public class ShortenedURLDecorator implements ServletDecorator, InitialisationParticipant
{
public static final LoggingArea LOG = LoggingArea.createLoggingArea("ShortenedURLFilter");
public static final String JOB_URL_PREFIX = "/j/";
@Override
public void processRequest(ServletDecoratorConfig config, BaseHttpServletRequest request, BaseHttpServletResponse response) throws Exception
{
String pathInfo = request.getServletPath();
LogMgr.log(LOG, LogLevel.PROCESSING1, "ShortenedURLFilter.doFilter: ", pathInfo);
if (pathInfo != null && pathInfo.contains(JOB_URL_PREFIX))
{
int lastIndex = pathInfo.lastIndexOf("/");
String shortcut = pathInfo.substring(lastIndex+1);
try
{
TransactionServicesFactory servicesFactory = (TransactionServicesFactory) ConfigMgr.getConfigObject(ConfigMgr.GLOBAL_CONFIG_SYSTEM, "TransactionServices");
ObjectTransaction objTran = new ObjectTransaction (servicesFactory);
ShortenedURL[] shortURL = ShortenedURL.searchByCode(objTran, shortcut);
if(shortURL != null && shortURL.length > 0)
{
request.setAttribute("DecoratorFilter.TERMINATE", "Yes");
response.sendRedirect(LoopbackHTTP.getRemoteAccessURL(shortURL[0].getUrlLink()));
return;
}
}
catch (Exception e)
{
LogMgr.log(LOG, LogLevel.BUSINESS2, e, "Problem find the shorted url");
throw new BusinessException("Something went wrong. Please contact Admin");
}
}
config.forwardRequest(request, response);
}
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException
{
}
}
\ No newline at end of file
...@@ -45,6 +45,8 @@ public class Utils ...@@ -45,6 +45,8 @@ public class Utils
public static final String LEVEL_MANAGEMENT = "Management"; public static final String LEVEL_MANAGEMENT = "Management";
public static final String LEVEL_EXECUTIVE = "Executive"; public static final String LEVEL_EXECUTIVE = "Executive";
public static final String HEAP_ANALYSIS_ID = ConfigMgr.getKeyfileString("heap.analysis.id", "3411110378"); public static final String HEAP_ANALYSIS_ID = ConfigMgr.getKeyfileString("heap.analysis.id", "3411110378");
public static final String INTERCOM_APP_ID = ConfigMgr.getKeyfileString("intercom.appId", "");
public static final String INTERCOM_TOKEN = ConfigMgr.getKeyfileString("intercom.token", "");
public static Role getRole(String role, ObjectTransaction transaction) public static Role getRole(String role, ObjectTransaction transaction)
{ {
...@@ -463,7 +465,7 @@ public class Utils ...@@ -463,7 +465,7 @@ public class Utils
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap(); Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser); ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getEmailAddressFromUser()}, null, companyUser); Utils.sendMail(emailer, transform, new String[]{companyUser.getUser().getEmail()}, null, companyUser);
LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sent email changed mail successfully from " + callingClass + " to :: ", companyUser); LogMgr.log(CompanyUser.LOG, LogLevel.PROCESSING1, "Sent email changed mail successfully from " + callingClass + " to :: ", companyUser);
} }
......
...@@ -47,6 +47,7 @@ public class WebUtils ...@@ -47,6 +47,7 @@ public class WebUtils
public static final String RESET_PASSWORD = "ResetPassword"; public static final String RESET_PASSWORD = "ResetPassword";
public static final String COMPANY_PROFILE = "CompanyProfile"; public static final String COMPANY_PROFILE = "CompanyProfile";
public static final String INVITE_USERS = "InviteUsers"; public static final String INVITE_USERS = "InviteUsers";
public static final String FORGOT_PASSWORD = "ForgotPassword";
public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode) public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode)
......
...@@ -1467,23 +1467,33 @@ span.rate-label { ...@@ -1467,23 +1467,33 @@ span.rate-label {
margin-right: 8px; margin-right: 8px;
} }
.share-link { .share-link {
width: 30.578%; width: 40%;
background: url(../images/link-icon.png) no-repeat ;
height: 100px;
text-align: left;
background-position: left 20px center;
padding: 30px 0 20px 60px;
}
.copy-link{
font-size: 11px;
color: #9b9b9b;
} }
.share-btn { .share-btn {
width: 13.002%; width: 12%;
background-color: #efefef; background-color: #efefef;
} }
.linkdin-icon { .linkdin-icon {
width: 13.6%; width: 12%;
} }
.facebook-icon { .facebook-icon {
width: 13.73%; width: 12%;
} }
.shape-icon{ .shape-icon{
width: 14.73%; width: 12%;
} }
.more-icon { .more-icon {
width: 14.3%; width: 12%;
} }
.goto-job-btn{ .goto-job-btn{
display: inline-block; display: inline-block;
...@@ -2950,6 +2960,16 @@ span.export-candidate,span.appli-status-short{ ...@@ -2950,6 +2960,16 @@ span.export-candidate,span.appli-status-short{
.pro-bar { .pro-bar {
padding: 28px 38px 22px 62px; padding: 28px 38px 22px 62px;
text-align: left; text-align: left;
cursor: pointer;
}
.pro-bar:hover{
box-shadow: 3px 3px 15px #666;
border-color:#C76C0C;
cursor: pointer;
/*Opacity*/
zoom: 1;
filter: alpha(opacity=100);
opacity: 1;
} }
span.appli-percen { span.appli-percen {
color: #67b413; color: #67b413;
...@@ -3238,21 +3258,21 @@ input.add-note-btn:hover{ ...@@ -3238,21 +3258,21 @@ input.add-note-btn:hover{
padding: 0 !important; padding: 0 !important;
} }
.red-b { .red-b {
background: #f9623d none repeat scroll 0 0 !important; background: #fb5d67 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 !important; background-color: #fedd6f !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 !important; background-color: #41bdb4 !important;
float: left; float: left;
position: relative; position: relative;
z-index: 10; z-index: 10;
...@@ -5561,4 +5581,185 @@ input{ ...@@ -5561,4 +5581,185 @@ input{
color: #7d7f82; color: #7d7f82;
padding: 16px; padding: 16px;
float: left; float: left;
} }
\ No newline at end of file
.skip-btn{
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;
background-repeat: no-repeat;
background-position: center left 20px;
padding: 0px 35px 0px 35px;
margin-top: 10px
}
/*password popup*/
.strength_wrapper {
position: relative;
text-align: left;
}
.strength_meter {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
z-index: -1;
overflow: hidden;
}
.button_strength {
text-decoration: none;
color: #4d4d4d;
font-size: 13px;
display: block;
}
.strength_meter div {
width: 0%;
height: 34px;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
}
.strength_meter div p {
position: absolute;
right: 10px;
color: #4d4d4d;
font-size: 13px;
padding-right: 30px;
}
.veryweak {
background-color: #FF7979;
width: 25% !important;
}
.weak {
background-color: #FDA068;
width: 50% !important;
}
.medium {
background-color: #FFE560;
width: 75% !important;
}
.strong {
background-color: #9BF47D;
width: 100% !important;
}
.info_box {
position: relative;
background: #fff;
border: 1px solid #ccc;
padding: 15px;
}
.info_box:after, .info_box:before{
right:100%;
top:50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.info_box:after{
border-color: rgba(255,255,255,0);
border-right-color: #fff;
border-width: 15px;
margin-top: -15px;
}
.info_box:before{
border-color: rgba(204,204,204,0);
border-right-color: #ccc;
border-width: 16px;
margin-top: -16px;
}
/* Styles for verification */
.pswd_info {
position:absolute;
width: 280px;
padding:0;
/* background:#fefefe; */
font-size:20px;
/* border-radius:15px;
box-shadow:0 1px 3px #ccc;
border:1px solid #ddd;*/
display:none;
z-index: 1000;
top: -25px;
right: -295px;
/* background-color: rgb(238,238,238);*/
/*box-shadow: 5px 5px 5px #888888;*/
}
/*
.pswd_info:before,
.pswd_info:after {
position: absolute;
bottom: 100%;
content: '';
}
.pswd_info:before {
right: 52px;
border-right: 17px solid transparent;
border-bottom: 17px solid #ddd;
border-left: 17px solid transparent;
}
.pswd_info:after {
right: 53px;
border-right: 16px solid transparent;
border-bottom: 16px solid rgb(238,238,238);
border-left: 16px solid transparent;
}*/
.pswd_info h4 {
margin:0 0 10px 0;
padding:0;
font-weight:normal;
font-size: 1em;
font-size: 0.7em;
}
.pswd_info ul {
padding: 0;
margin: 0;
list-style-type: none;
font-size: 17px;
}
.pswd_info ul li {
visibility: visible !important;
height: 20px !important;
min-height: 20px !important;
line-height:24px;
font-size: 0.7em;
padding-left: 24px !important;
}
.pswd_info .invalid {
background:url(../images/invalid.png) no-repeat 0 50%;
color:#ec3f41;
}
.pswd_info .valid {
background:url(../images/valid.png) no-repeat 0 50%;
color:#3a7d34;
}
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<%@ include file="inc/dynamic_content_core_top.jsp" %> <%@ include file="inc/dynamic_content_core_top.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %> <%@ include file="/inc/stdimports50.jsp" %>
<%@ page import="performa.utils.*"%> <%@ page import="performa.utils.*"%>
<%@ page import="performa.intercom.utils.*"%>
<%@ page import="performa.intercom.resources.User"%>
<% <%
ORMProcessState process = (ORMProcessState)(ProcessDecorator.getDefaultProcess(request)); ORMProcessState process = (ORMProcessState)(ProcessDecorator.getDefaultProcess(request));
......
<%@ page import="oneit.servlets.jsp.*, oneit.servlets.process.*,java.util.*,java.io.*" %>
<%@ page extends="oneit.servlets.jsp.BaseJSP" %>
<%! protected String getName (ServletConfig config) { return "process_error_jsp"; } %>
<%@ include file="./skin/oneit/include/small_head_pre.jspf" %>
<title>We signed you out</title>
<%@ include file="./skin/oneit/include/small_head_post.jspf" %>
<%
String restartLink = "../index.jsp";
%>
<body>
<%@ include file="./skin/oneit/include/small_content_pre.jspf" %>
<p class="info_header">We signed you out</p>
<p class="info_text">
To help protect your account, we automatically sign you out of Talentology after a long period of inactivity.
</p>
<%
if(restartLink != null)
{
%>
<p class="info_text"><a href="<%= restartLink %>">Sign in again</a></p>
<% } %>
<p class="info_text">
Message generated on <br/>
<span style="font-size: 12px;">
<%= new java.util.Date().toString()%>.
</span>
</p>
<%@ include file="./skin/oneit/include/small_content_post.jspf" %>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?> <?xml version="1.0"?>
<OBJECTS name="AdminPortal"> <OBJECTS name="AdminPortal">
<NODE name="DecoratorFilter::performa">
<DECORATOR factory="Participant" class="performa.utils.ShortenedURLDecorator"/>
</NODE>
<NODE name="dynamic_content_form_client" factory="Participant"> <NODE name="dynamic_content_form_client" factory="Participant">
<INHERITS factory="Named" nodename="dynamic_content_form"/> <INHERITS factory="Named" nodename="dynamic_content_form"/>
...@@ -32,7 +36,7 @@ ...@@ -32,7 +36,7 @@
<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="*.sendCompanyUserInvites" factory="Participant" class="performa.form.SendCompanyUserInvitesFP"> <FORM name="*.sendCompanyUserInvites" factory="Participant" class="performa.form.SendCompanyUserInvitesFP">
<AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/> <AccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="AccountCreatedMail"/>
<InvitationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="InvitationMail"/> <InvitationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="InvitationMail"/>
</FORM> </FORM>
......
...@@ -128,6 +128,15 @@ ...@@ -128,6 +128,15 @@
</TASK> </TASK>
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN class="performa.batch.URLShortnerBatch" factory="Participant"/>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
<NODE name="schedule" class="oneit.appservices.batch.NeverSchedule">
</NODE>
</WHEN>
</TASK>
</NODE> </NODE>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,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>Include Assessment Criteria for this position? <a href="#" class="info-icon"><img src="images/info-icon.png" /></a> </label> <label>Include Requirements for this Job? <a href="#" class="info-icon"><img src="images/info-icon.png" /></a> </label>
<span class="pull-right"> <span class="pull-right">
<label class="switch"> <label class="switch">
<oneit:recalcClass htmlTag="span" classScript="job.showAssessmentCriteriaSection() ? 'checkbox checked': 'checkbox unchecked'" job="<%= job %>"> <oneit:recalcClass htmlTag="span" classScript="job.showAssessmentCriteriaSection() ? 'checkbox checked': 'checkbox unchecked'" job="<%= job %>">
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</oneit:recalcClass> </oneit:recalcClass>
<oneit:recalcClass htmlTag="span" class="skill-label" classScript="job.getAssessmentCriteraCountByType(criteria) > 0 ? 'hide': 'show'" job="<%= job %>" criteria="<%= criteria %>"> <oneit:recalcClass htmlTag="span" class="skill-label" classScript="job.getAssessmentCriteraCountByType(criteria) > 0 ? 'hide': 'show'" job="<%= job %>" criteria="<%= criteria %>">
<span class="skill-label">No <oneit:toString value="<%= criteria %>" mode="EscapeHTML"/> currently added for this role.</span> <span class="skill-label">No required <oneit:toString value="<%= criteria %>" mode="EscapeHTML"/><%= criteria.getIsSingular() ? " has" : " have"%> been added.</span>
</oneit:recalcClass> </oneit:recalcClass>
</span> </span>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</div> </div>
<div class="text-center company-profile-btn"> <div class="text-center company-profile-btn">
<oneit:button value="Confirm details & invite users" name="gotoPage" cssClass="btn btn-primary box-btn" <oneit:button value="Confirm details & invite teammates" name="gotoPage" cssClass="btn btn-primary box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/> requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/>
</div> </div>
</div> </div>
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +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 = job.getShortenedUrlLink();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS); boolean fromJob = request.getParameter("fromJob") != null ? Boolean.parseBoolean(request.getParameter("fromJob")) : false;
String nextPage = WebUtils.getSamePageInRenderMode(request, (fromJob ? "Page" : WebUtils.VIEW_APPLICANTS));
%> %>
<script> <script>
...@@ -35,7 +36,14 @@ ...@@ -35,7 +36,14 @@
<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 is now open <%
if(fromJob)
{
%>
Congratulations! Your job is now open
<%
}
%>
<a href="<%= url %>" id="jobURL" style="display:none;"> <a href="<%= url %>" id="jobURL" style="display:none;">
<%= url %> <%= url %>
</a> </a>
...@@ -43,23 +51,31 @@ ...@@ -43,23 +51,31 @@
<div class="form-page-area"> <div class="form-page-area">
<div class="job-share-icon"> <div class="job-share-icon">
<ul> <ul>
<li class="share-link" onclick="copyToClipboard()"><a href="#"><img src="images/link-icon.png" /> Copy link to clipboard</a></li> <li class="share-link" onclick="copyToClipboard()">
<li class="share-btn"><a href="#">Share</a></li> <a class="linked-col" href="#">
<div><%= url %></div>
<span class="copy-link">(Copy link to clipboard)</span>
</a>
</li>
<!-- <li class="share-btn"><a href="#">Share</a></li>
<li class="linkdin-icon"><a href="#"><img src="images/linkedin-icon.png" /></a></li> <li class="linkdin-icon"><a href="#"><img src="images/linkedin-icon.png" /></a></li>
<li class="facebook-icon"><a href="#"><img src="images/facebook-icon.png"/></a></li> <li class="facebook-icon"><a href="#"><img src="images/facebook-icon.png"/></a></li>
<li class="shape-icon"><a href="#"><img src="images/shape.png" /></a></li> <li class="shape-icon"><a href="#"><img src="images/shape.png" /></a></li>
<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>
<p class="job-txt"> <p class="job-txt">
This job will be open for 30 days until&nbsp;<oneit:toString value="<%= job.getApplyBy() %>" mode="PerformaDate"/>. This job will be open for 30 days until&nbsp;<oneit:toString value="<%= job.getApplyBy() %>" mode="PerformaDate"/>.
</p> </p>
<div class="text-center"> <div class="text-center">
<oneit:button value="Go to Job" name="gotoPage" cssClass="btn btn-primary largeBtn" <oneit:button value="<%= "Go to Job" + (fromJob ? "s" : "")%>" name="gotoPage" cssClass="btn btn-primary largeBtn"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>'/> requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>'/>
</div> </div>
<div class="space-55"></div> <div class="space-55"></div>
</div> </div>
</div> </div>
<style>
.job-share-icon li a.linked-col {line-height: 20px;}
</style>
</oneit:form> </oneit:form>
</oneit:dynIncluded> </oneit:dynIncluded>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<div class="form-brack-line-sub"></div> <div class="form-brack-line-sub"></div>
<div class="form-group"> <div class="form-group">
<label class="label-16">Job Match Assessment</label> <label class="label-16">Role</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="beloning job-match-ass"> <div class="beloning job-match-ass">
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
//to process company user verification //to process company user verification
String id = request.getParameter("id"); String id = request.getParameter("id");
String key = request.getParameter("key"); String key = request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null && key!=null) if(id!=null && key!=null)
{ {
...@@ -24,38 +23,16 @@ ...@@ -24,38 +23,16 @@
if(companyUser!=null && companyUser.getIsEmailChanged()==Boolean.TRUE) if(companyUser!=null && companyUser.getIsEmailChanged()==Boolean.TRUE)
{ {
try session = request.getSession();
{ session.removeAttribute(SecUser.SEC_USER_ID);
companyUser.setIsEmailChanged(Boolean.FALSE); session.setAttribute("EmailToVerify", companyUser.getUser());
companyUser.setIsAccountVerified(Boolean.TRUE); response.sendRedirect(nextPage);
return;
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>
<%
}
%> %>
<h3>Verification Error</h3>
<p><span>Access expired.</span></p>
<%@ include file="inc/htmlfooter_nopriv.jsp" %> <%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
...@@ -19,9 +19,10 @@ ...@@ -19,9 +19,10 @@
</script> </script>
<style> <style>
.btn-disabled button{ .btn-disabled{
opacity: 0.6; opacity: 0.6;
background-color: #0582ba; background-color: #0582ba;
cursor: not-allowed;
} }
#right-mark { #right-mark {
...@@ -42,10 +43,11 @@ ...@@ -42,10 +43,11 @@
margin: auto auto; margin: auto auto;
} }
</style> </style>
<% <%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
CompanyUser companyUser = CompanyUser.createCompanyUser(objTran); CompanyUserNPO companyUser = CompanyUserNPO.createCompanyUserNPO(objTran);
%> %>
<oneit:form name="forgotPassword" method="post" enctype="multipart/form-data"> <oneit:form name="forgotPassword" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -64,12 +66,15 @@ ...@@ -64,12 +66,15 @@
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
<div class="form-group"> <div class="form-group">
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'btn-disabled'" companyUser="<%= companyUser %>"> <oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'hide'" companyUser="<%= companyUser %>">
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn" <oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "reset_password_sent.jsp") requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "reset_password_sent.jsp")
.mapEntry ("CompanyUser", companyUser) .mapEntry ("CompanyUser", companyUser)
.toMap() %>"/> .toMap() %>"/>
</oneit:recalcClass> </oneit:recalcClass>
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'hide': 'show'" companyUser="<%= companyUser %>">
<input type="button" value="Send reset link" disabled="true" class="box-btn send-btn btn-disabled">
</oneit:recalcClass>
</div> </div>
</div> </div>
</oneit:form> </oneit:form>
......
...@@ -34,25 +34,31 @@ ...@@ -34,25 +34,31 @@
</oneit:button> </oneit:button>
</li> </li>
<li class="<%= tabNumber == "2" ? "active" : "" %>"> <li class="<%= tabNumber == "2" ? "active" : "" %>">
<oneit:button value=" " name="gotoPage" skin="link" <%
int noOfShortlisted = job.getNoOfCandidatesShortlisted();
%>
<oneit:button value=" " name="gotoPage" skin="link" disabled="<%= noOfShortlisted > 0 ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondTab) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span> <span>
<oneit:toString value="<%= job.getNoOfCandidatesShortlisted() %>" mode="Integer" /> <oneit:toString value="<%= noOfShortlisted %>" mode="Integer" />
</span> </span>
Shortlist Shortlisted
</oneit:button> </oneit:button>
</li> </li>
</ul> </ul>
</div> </div>
<div class="unsutable <%= tabNumber == "3" ? "active" : "" %>"> <div class="unsutable <%= tabNumber == "3" ? "active" : "" %>">
<oneit:button value=" " name="gotoPage" skin="link" <%
int noOfUnsuitable = job.getNoOfCandidatesUnsuitable();
%>
<oneit:button value=" " name="gotoPage" skin="link" disabled="<%= noOfUnsuitable > 0 ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdTab) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"> .toMap() %>">
<span> <span>
<oneit:toString value="<%= job.getNoOfCandidatesUnsuitable() %>" mode="Integer" /> <oneit:toString value="<%= noOfUnsuitable %>" mode="Integer" />
</span> </span>
Unsuitable Unsuitable
</oneit:button> </oneit:button>
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
.mapEntry("procParams", CollectionUtils.mapEntry("Company", company).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Company", company).toMap())
.toMap() %>"> .toMap() %>">
<span>2</span> <span>2</span>
<div>Invite Users</div> <div>Invite Teammates</div>
</oneit:button> </oneit:button>
</li> </li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li> <li><a href="#"><span>3</span><div>Welcome</div></a></li>
</ul> </ul>
</div> </div>
......
...@@ -5,8 +5,15 @@ ...@@ -5,8 +5,15 @@
<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>
<% <%
Company company = clientUser != null && clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null Company company = clientUser != null && clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null
? clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany() : null; ? clientUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany() : null;
User intercomUser = (User)session.getAttribute("IntercomUser");
if(intercomUser == null)
{
intercomUser = IntercomUtils.findUserByID(clientUser);
session.setAttribute("IntercomUser" , intercomUser);
}
%> %>
<title><%= "Talentology" + (company != null ? " - " + company.getCompanyName() : "")%></title> <title><%= "Talentology" + (company != null ? " - " + company.getCompanyName() : "")%></title>
...@@ -16,7 +23,8 @@ ...@@ -16,7 +23,8 @@
</head> </head>
<script> <script>
window.intercomSettings = { window.intercomSettings = {
app_id: "kqed9h3r" app_id: "<%= Utils.INTERCOM_APP_ID %>",
user_id: "<%= clientUser.getID().toString() %>"
}; };
</script> </script>
<script> <script>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="main-user-invite" id="<%= secUser.getID() %>"> <div class="main-user-invite" id="<%= secUser.getID() %>">
<span class="delete-company-user" onclick="return deleteUser (<%= deleteVarKey %>)"><span></span></span> <span class="delete-company-user" onclick="return deleteUser (<%= deleteVarKey %>)"><span></span></span>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" /> <oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase"/>
</div> </div>
</oneit:evalBody> </oneit:evalBody>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.toMap() %>"> .toMap() %>">
Company Details Hiring Team Details
</oneit:button> </oneit:button>
</li> </li>
<li class="">Manage Plan</li> <li class="">Manage Plan</li>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<% <%
String tabNumber = (String) getData(request, "TabNumber"); String tabNumber = (String) getData(request, "TabNumber");
String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.MY_DETAILS); String firstPage = WebUtils.getSamePageInRenderMode(request, "Page");
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<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="<%= 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')">
<label class="progress-label">role fit</label> <label class="progress-label">role fit</label>
<div class="<%= colorClass %> fixed-width"> <div class="<%= colorClass %> fixed-width">
<p style="display:none;"><oneit:toString value="<%= roleFitData.get0()!=null?roleFitData.get0():0D %>" mode="TwoDPDouble" nullValue="0"/></p> <p style="display:none;"><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="TwoDPDouble" nullValue="0"/></p>
</div> </div>
<div class="row four-label"> <div class="row four-label">
<% <%
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
</div> </div>
<div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-6" %> col-xs-12 text-center thr-block culture-fit" href="#2a" data-toggle="tab" id="progress2" onClick="tabToggle('#tab2', '.culture-fit')"> <div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-6" %> col-xs-12 text-center thr-block culture-fit" href="#2a" data-toggle="tab" id="progress2" onClick="tabToggle('#tab2', '.culture-fit')">
<label class="progress-label">culture fit</label> <label class="progress-label">culture fit</label>
<div class="percent-green fixed-width"> <div class="<%= "percent-" + jobApplication.getCultureFitColor() + " fixed-width" %>">
<p style="display:none;"><oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="TwoDPDouble" /></p> <p style="display:none;"><oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="TwoDPDouble" /></p>
</div> </div>
<div class="row four-label"> <div class="row four-label">
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
%> %>
<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="col-sm-4 col-xs-12 text-center thr-block requirement-fit" href="#3a" data-toggle="tab" id="progress3" onClick="tabToggle('#tab3','.requirement-fit')">
<label class="progress-label">requirements</label> <label class="progress-label">requirements</label>
<div class="percent-blue fixed-width"> <div class="<%= "percent-" + jobApplication.getRequirementFitColor() + " fixed-width" %>">
<p style="display:none;"><oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="TwoDPDouble" /></p> <p style="display:none;"><oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="TwoDPDouble" /></p>
</div> </div>
<div class="row four-label"> <div class="row four-label">
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
<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="<%= factorClass %>" mode="EscapeHTML"/></span> <span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="TwoDPDouble"/></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 <%= cssClass %>" 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>
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
<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="<%= cClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="WholeNumber" /></span> <span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></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>
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
<div class="main-pro-bar <%= importance %>"> <div class="main-pro-bar <%= importance %>">
<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="<%= importance %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="WholeNumber" /></span> <span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></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>
......
...@@ -79,8 +79,18 @@ ...@@ -79,8 +79,18 @@
<oneit:button value="Send invites & proceed" name="sendCompanyUserInvites" cssClass="btn btn-primary box-btn" <oneit:button value="Send invites & proceed" name="sendCompanyUserInvites" cssClass="btn btn-primary box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser) .mapEntry("CompanyUser", companyUser)
.mapEntry("Skip", Boolean.FALSE)
.mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap())
.toMap() %>"/> .toMap() %>"/>
<div>
<oneit:button value="Skip" name="sendCompanyUserInvites" cssClass="btn skip-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.mapEntry("Skip", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap())
.toMap() %>"/>
</div>
</div> </div>
</div> </div>
</oneit:form> </oneit:form>
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB); String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB); String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB);
String secondPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA); String secondPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
String thirdPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE); String thirdPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
String fourthPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_MATCH); String fourthPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_MATCH);
Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS); String fifthPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_REVIEW);
String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.VIEW_APPLICANTS).toMap()); String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
if(job == null && request.getParameter("JobID")!= null) if(job == null && request.getParameter("JobID")!= null)
{ {
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<div class="form-brack-line-sub"></div> <div class="form-brack-line-sub"></div>
<div class="form-group"> <div class="form-group">
<label class="label-16">Job Match Assessment</label> <label class="label-16">Role</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", fourthPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fourthPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
...@@ -214,6 +214,7 @@ ...@@ -214,6 +214,7 @@
<oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn" <oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fifthPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job")) .mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" /> .toMap() %>" />
......
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
<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="jobs-list-shorting"> <div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">All Jobs</div> <div class="d-job-title all-jobs-title">
<%= jobStatus == null ? "All" : jobStatus.getDescription() %> Jobs
</div>
<div class="job-filter"> <div class="job-filter">
<ul class=""> <ul class="">
<li class="lable-job-shorting">showing</li> <li class="lable-job-shorting">showing</li>
...@@ -59,7 +61,7 @@ ...@@ -59,7 +61,7 @@
.toMap() %>"/> .toMap() %>"/>
</li> </li>
<% <%
for (JobStatus status : JobStatus.getJobStatusArray()) for (JobStatus status : Utils.getJobStatusesForClient())
{ {
%> %>
<li class="<%= (jobStatus != null && jobStatus == status ? "active" : "" )%>"> <li class="<%= (jobStatus != null && jobStatus == status ? "active" : "" )%>">
......
...@@ -47,19 +47,43 @@ ...@@ -47,19 +47,43 @@
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt); Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt); Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
company.setRoleType(RoleType.STANDARD);
%> %>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
{ {
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$(".user-role").change(function() $(".user-role").change(function()
{ {
var id = $(this).closest('.user-list-row').attr('id'); var id = $(this).closest('.user-list-row').attr('id');
$('.save-user' + id).click(); $('.save-user' + id).click();
}); });
validate();
$('input[name$=UserEmail]').keyup(function() {
recalcFunction();
validate();
});
}); });
function validate() {
if ($('.invite-btn').hasClass('disabled')) {
$('.btn-invite').attr('disabled', 'disabled');
} else {
$('.btn-invite').removeAttr('disabled');
}
}
</script> </script>
<style>
button[disabled]{
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="listUsers" method="post" enctype="multipart/form-data"> <oneit:form name="listUsers" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part"> <div class="dashboard-content-area second-part">
...@@ -69,7 +93,7 @@ ...@@ -69,7 +93,7 @@
<div class="eq-justify-content"> <div class="eq-justify-content">
<div class="manage-user-left"> <div class="manage-user-left">
<div class="jobs-list-shorting"> <div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Manage Users</div> <div class="d-job-title all-jobs-title">Manage Teammates</div>
<div class="shorting-dropdown"> <div class="shorting-dropdown">
<span class="order-label">order by</span> <span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value"> <select class="form-control" onChange="location=this.value">
...@@ -166,7 +190,7 @@ ...@@ -166,7 +190,7 @@
</div> </div>
<div class="manage-user-right"> <div class="manage-user-right">
<div class="sidebar-title"> <div class="sidebar-title">
Invite a user Invite a teammate
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Email Address" /></label> <label><oneit:label GUIName="Email Address" /></label>
...@@ -184,13 +208,13 @@ ...@@ -184,13 +208,13 @@
<label><oneit:label GUIName="Role" /></label> <label><oneit:label GUIName="Role" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/> <oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/>
</div> </div>
<div class="invite-btn"> <oneit:recalcClass htmlTag="div" classScript="company.getUserEmail()== null? 'invite-btn disabled': 'invite-btn enabled'" company="<%= company %>">
<oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite" <oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent") .mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent")
.toMap() %>" /> .toMap() %>" />
</div> </oneit:recalcClass>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -32,5 +32,6 @@ Company.UserEmail = Email Address ...@@ -32,5 +32,6 @@ Company.UserEmail = Email Address
Company.FirstName = First Name Company.FirstName = First Name
Company.LastName = Last Name Company.LastName = Last Name
Company.RoleType = Role Company.RoleType = Role
Company.CompanyLogo = Company Logo Company.CompanyLogo = Logo
Company.HiringTeamType = Hiring Team Company.HiringTeamType = Hiring Team
Company.CompanyName = Hiring Team Name
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
#passwordNotMatch = The password does not match. Please try again. #passwordNotMatch = The password does not match. Please try again.
#invitationSent = Your invitation has been successfully sent. #invitationSent = Your invitation has been successfully sent.
#invalidEmail = Invalid email address. #invalidEmail = Invalid email address.
#emailChangeVefified = Your email address has been successfully changed and you can now use new email address when signing in.
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row content"> <div class="row content">
<div class="main-content-area"> <div class="main-content-area">
<h1 class="page-title">My Company</h1> <h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area"> <div class="my-company-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data"> <oneit:form name="editCompany" method="post" enctype="multipart/form-data">
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="company-detail"> <div class="tab-pane active" id="company-detail">
<div class="tabpage-title"> <div class="tabpage-title">
<label class="label-16">Company Details</label> <label class="label-16">Hiring Team Details</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Company Name" /></label> <label><oneit:ormlabel obj="<%= company %>" field="CompanyName" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" /> <oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" />
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
SecUser loggedInUser = SecUser.getTXUser(transaction); ObjectTransaction objTran = process.getTransaction ();
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser); SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Debug.assertion(companyUser != null , "Invalid user in admin portal my details"); Debug.assertion(companyUser != null , "Invalid user in admin portal my details");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page"); String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
boolean emailChanged = request.getAttribute("EmailChanged") != null ? (boolean) request.getAttribute("EmailChanged") : false; boolean emailChanged = request.getAttribute("EmailChanged") != null ? (boolean) request.getAttribute("EmailChanged") : false;
%> %>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
...@@ -31,15 +32,27 @@ ...@@ -31,15 +32,27 @@
}); });
}); });
</script> </script>
<oneit:form name="editUser" method="post" enctype="multipart/form-data"> <oneit:form name="editUser" method="post" enctype="multipart/form-data">
<div class="container-fluid"> <div class="container-fluid">
<div class="row content"> <div class="row content">
<div class="main-content-area"> <div class="main-content-area">
<h1 class="page-title">My Details</h1> <h1 class="page-title">My Details</h1>
<div style="padding-left: 15px; padding-right: 15px;"> <div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<%
if(companyUser.getIsEmailChanged()==Boolean.TRUE && request.getSession().getAttribute("EmailStillNotVerified")!=null)
{
request.getSession().removeAttribute("EmailStillNotVerified");
%>
<div class="error-message message-common">
<img src="images/infomation-icon.png" class="alert-icon">
<span class="message-txt">Your email address change still hasn't been verified!</span>
</div>
<%
}
%>
</div> </div>
<div class="my-company-area"> <div class="my-company-area">
<oneit:dynInclude page="/extensions/adminportal/inc/my_details_tabs.jsp" TabNumber="1" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/adminportal/inc/my_details_tabs.jsp" TabNumber="1" data="<%= CollectionUtils.EMPTY_MAP%>"/>
......
...@@ -14,10 +14,33 @@ ...@@ -14,10 +14,33 @@
{ {
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser!=null && companyUser.isLoggedViaSocial() && companyUser.getIsAccountVerified()!=Boolean.TRUE) if(companyUser!=null)
{ {
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION).getLink(request)); if(companyUser.isLoggedViaSocial() && companyUser.getIsAccountVerified()!=Boolean.TRUE)
return; {
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION).getLink(request));
return;
}
//to notify email address change still not verified
if(request.getSession().getAttribute("EmailStillNotVerified")!=null)
{
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MY_DETAILS).getLink(request));
return;
}
//to notify email address changed
if(request.getSession().getAttribute("EmailVerified")!=null)
{
request.getSession().removeAttribute("EmailVerified");
request.setAttribute(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailChangeVefified");
String messageId = NotificationUtils.getNotifyIdIfRequired(process, request);
String link = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MY_DETAILS).getLink(request);
response.sendRedirect(NotificationUtils.appendNotifyIDToURL(link, messageId));
return;
}
} }
} }
......
...@@ -48,13 +48,24 @@ ...@@ -48,13 +48,24 @@
} }
</style> </style>
<%
if(request.getSession().getAttribute("EmailToVerify")!=null)
{
%>
<div class="form-group">
<p>Please login to verify your email address.</p>
</div>
<%
}
%>
<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%>"/>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Email Address</label> <label>Email Address</label>
<input type="text" class="form-control" name="username" required> <input type="text" class="form-control" name="username" required spellcheck="false">
</div> </div>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Password</label> <label>Password</label>
...@@ -69,7 +80,7 @@ ...@@ -69,7 +80,7 @@
requestAttribs="<%= CollectionUtils.EMPTY_MAP%>"/> requestAttribs="<%= CollectionUtils.EMPTY_MAP%>"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<oneit:button value="Dont have an account? Create account" name="gotoPage" cssClass="forgot-pass" skin="link" <oneit:button value="Don&CloseCurlyQuote;t have an account? Sign up" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_up.jsp") requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_up.jsp")
.toMap() %>"></oneit:button> .toMap() %>"></oneit:button>
</div> </div>
......
<?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="shortened_url_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_shortened_url</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="code" type="String" nullable="false" length="8"/>
<column name="url_link" type="CLOB" nullable="false"/>
</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="ManageUsers">
<createSpecificIdentifier factory='String' value='C3QBLBVFH29N1DW078Q67SC93TQ2W6'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="C3QBLBVFH29N1DW078Q67SC93TQ2W6"/>
</articleIdentifiers>
<createdLabel factory="String" value="C3QBLBVFH29N1DW078Q67SC93TQ2W6"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="String" value="second-menu"/>
<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="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="true"/>
<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="Manage Teammates"/>
<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="manage-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="ManageUsers"/>
<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="ManageUsers"/>
<NODE name="ShortTitle" factory="String" value="ManageUsers"/>
<NODE name="SortOrder" factory="Integer" value="37839081"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="MANAGE_USERS"/>
</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="MyCompany">
<createSpecificIdentifier factory='String' value='L81G02K5MTK0TOFUS8WCGZ42NSR06P'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="L81G02K5MTK0TOFUS8WCGZ42NSR06P"/>
</articleIdentifiers>
<createdLabel factory="String" value="L81G02K5MTK0TOFUS8WCGZ42NSR06P"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="String" value="second-menu"/>
<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="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="String" value="My Hiring Team"/>
<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="company-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="MyCompany"/>
<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="MyCompany"/>
<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_COMPANY"/>
</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
...@@ -43,17 +43,33 @@ ...@@ -43,17 +43,33 @@
&& companyUser.getIsAccountVerified()!=Boolean.TRUE) && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{ {
socialLogin = Boolean.TRUE; socialLogin = Boolean.TRUE;
invalid = Boolean.FALSE;
} }
else
if(invalid)
{ {
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request)); response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request));
} }
} }
process.setAttribute("Company", companyUser.getCompany());
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal"); Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
process.setAttribute("Company", companyUser.getCompany());
%> %>
<oneit:script>
<oneit:script src="/scripts/password_strength_lightweight.js"/>
</oneit:script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="verify" method="post">
<%
String key = Utils.getPwdKeyOfSecUser(request, secUser, true);
%>
<script type="text/javascript"> <script type="text/javascript">
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
...@@ -61,6 +77,11 @@ ...@@ -61,6 +77,11 @@
validate(); validate();
$('input').on('change keyup', function() { validate() }); $('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500); interval = setInterval(function() { validate(); }, 500);
$('#myPassword').strength_meter({
"inputName" : "<%= key %>"
});
}); });
function validate() { function validate() {
...@@ -78,19 +99,10 @@ ...@@ -78,19 +99,10 @@
$('.verify-btn').attr('disabled', 'disabled'); $('.verify-btn').attr('disabled', 'disabled');
} else { } else {
$('.verify-btn').removeAttr('disabled'); $('.verify-btn').removeAttr('disabled');
clearInterval(interval); // clearInterval(interval);
} }
} }
</script> </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%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box"> <div class="main-box-layout login-box">
...@@ -99,11 +111,9 @@ ...@@ -99,11 +111,9 @@
<% <%
if(!socialLogin) if(!socialLogin)
{ {
String key = Utils.getPwdKeyOfSecUser(request, secUser, true);
%> %>
<div class="form-group text-left"> <div class="form-group text-left" id="myPassword">
<label>Password</label> <label>Password</label>
<oneit:input type="password" name="<%= key %>" class="form-control second-style reset-pw"/>
</div> </div>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Confirm password</label> <label>Confirm password</label>
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<div class="jcc-box"> <div class="jcc-box">
<div class="job-match jcc"> <div class="job-match jcc">
<img src="images/app-job-match-icon.svg"> Role fit <img src="images/app-job-match-icon.svg"> Role fit
<span><oneit:toString value="<%= jobApplication.getRoleFitScore() %>" mode="TwoDPDouble" /></span> <span><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="PercentageTwoDP" /></span>
</div> </div>
<div class="detail-box"> <div class="detail-box">
<% <%
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<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).get0() %>" mode="TwoDPDouble"/> <oneit:toString value="<%= roleScoreMap.get(factorClass).get0() %>" mode="PercentageWholeNumber"/>
</div> </div>
</div> </div>
<% <%
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
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="WholeNumber" /> <oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
%> %>
<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) != null ? cultureFitData.get(cClass).get0() : 0 %>" mode="WholeNumber" /></div> <div class="detail-no green"><oneit:toString value="<%= cultureFitData.get(cClass) != null ? cultureFitData.get(cClass).get0() : 0 %>" mode="PercentageWholeNumber" /></div>
</div> </div>
<% <%
} }
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
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.getRequirementFitScore() %>" mode="WholeNumber" /> <oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
%> %>
<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="WholeNumber" /></div> <div class="detail-no green"><oneit:toString value="<%= requirementFitData.get(importance) %>" mode="PercentageWholeNumber" /></div>
</div> </div>
<% <%
} }
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
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.getRoleFitScore() %>" mode="TwoDPDouble" /> <oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
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="WholeNumber" /> <oneit:toString value="<%= jobApplication.getCultureFitScore() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
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.getRequirementFitScore() %>" mode="WholeNumber" /> <oneit:toString value="<%= jobApplication.getRequirementFitScore() %>" mode="PercentageWholeNumber" />
</oneit:button> </oneit:button>
</span> </span>
</div> </div>
......
...@@ -45,31 +45,31 @@ ...@@ -45,31 +45,31 @@
valElement: 'p', valElement: 'p',
strokeWidth: 15, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#f9623d', ringColor: '#fb5d67',
textColor: '#4a4a4a', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: true
}); });
$('.percent-yellow-b').percentageLoader({ $('.percent-yellow-b').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 15, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#ffd14c', ringColor: '#fedd6f',
textColor: '#4a4a4a', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: true
}); });
$('.percent-green-b').percentageLoader({ $('.percent-green-b').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 15, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
ringColor: '#03ac66', ringColor: '#41bdb4',
textColor: '#4a4a4a', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: true
}); });
$('.percent-green').percentageLoader({ $('.percent-green').percentageLoader({
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
textColor: '#4a4a4a', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: true
}); });
$('.percent-blue').percentageLoader({ $('.percent-yellow').percentageLoader({
valElement: 'p', valElement: 'p',
strokeWidth: 15, strokeWidth: 15,
bgColor: '#e5e8eb', bgColor: '#e5e8eb',
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
textColor: '#4a4a4a', textColor: '#4a4a4a',
fontSize: '30px', fontSize: '30px',
fontWeight: 'normal', fontWeight: 'normal',
showPercent: false showPercent: true
}); });
}); });
......
...@@ -15,17 +15,23 @@ ...@@ -15,17 +15,23 @@
<script type="text/javascript"> <script type="text/javascript">
function moveImportanceSection(elementRating){ function enableElementRating(importanceRadio){
var importanceDiv = $(elementRating).closest('.criteria_section').find('.work-rating'); var importanceGroup = $(importanceRadio).closest('.rate-toggle');
var radioGroup = $("[name='" + $(elementRating).attr('name') +"']");
importanceGroup.find('li.active').removeClass("active" );
if(radioGroup.is(':checked')){ importanceGroup.find("input[type='radio']:checked").closest('li').addClass("active" );
importanceDiv.insertAfter($("[name='" + $(elementRating).attr('name') +"']:checked").parent());
importanceDiv.show(); var criteriaDiv = $(importanceRadio).closest('.criteria_section');
if(importanceGroup.find("input[type='radio']:checked").val() !== 'NOT_APPLICABLE')
{
criteriaDiv.find(".element_rating_radio").removeProp("disabled");
} }
else{ else
importanceDiv.hide(); {
criteriaDiv.find(".element_rating_radio").prop("disabled",true);
criteriaDiv.find(".element_rating_radio").prop('checked', false);
} }
} }
...@@ -33,25 +39,17 @@ ...@@ -33,25 +39,17 @@
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true}); recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$(".element_rating_radio").each(function (){
moveImportanceSection(this);
});
$(".element_rating_radio").change(function(){
moveImportanceSection(this);
});
$(".importance_radio").change(function(){ $(".importance_radio").change(function(){
var importanceGroup = $(this).closest('.rate-toggle'); enableElementRating(this);
});
importanceGroup.find('li.active').removeClass("active" ); $(".importance_radio").each(function(){
importanceGroup.find("input[type='radio']:checked").closest('li').addClass("active" ); enableElementRating(this);
}); });
$("select[name$='CultureTemplate']").change(function(){ $("select[name$='CultureTemplate']").change(function(){
$("button[name$='loadCultureFromTemplate']").click(); $("button[name$='loadCultureFromTemplate']").click();
}); });
var showError = true; var showError = true;
addPostRecalcHandler (function ($fieldThatChanged) { addPostRecalcHandler (function ($fieldThatChanged) {
if(showError) { if(showError) {
...@@ -88,7 +86,6 @@ ...@@ -88,7 +86,6 @@
<div class="form-group"> <div class="form-group">
<label class="label-16 work-title">Culture</label> <label class="label-16 work-title">Culture</label>
<p> <p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit.
</p> </p>
</div> </div>
<% <%
...@@ -125,7 +122,7 @@ ...@@ -125,7 +122,7 @@
<oneit:ormInput obj="<%= job %>" id="is-remote" attributeName="Remote" type="checkbox"/> <oneit:ormInput obj="<%= job %>" id="is-remote" attributeName="Remote" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="job.getRemote() != null && job.getRemote() ? 'checked': 'unchecked'" job="<%= job %>"> <oneit:recalcClass htmlTag="span" classScript="job.getRemote() != null && job.getRemote() ? 'checked': 'unchecked'" job="<%= job %>">
<label for="is-remote"> <label for="is-remote">
<oneit:label GUIName="Remote?" /> <oneit:label GUIName="Working remotely is an option" />
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
...@@ -158,21 +155,6 @@ ...@@ -158,21 +155,6 @@
<div class="work-radio-title"> <div class="work-radio-title">
<oneit:toString value="<%= criteria.getCultureElement() %>" mode="EscapeHTML"/> <oneit:toString value="<%= criteria.getCultureElement() %>" mode="EscapeHTML"/>
</div> </div>
<%
for (CultureElementRating rating : criteria.getCultureElement().getRatingsSet())
{
String ratingId = String.valueOf(rating.getID().longID());
String selectedStr = (CollectionUtils.equals(ratingId, formValue) ? "checked" : "");
%>
<div class="<%= "radio radio-primary workplace-radio " %>">
<input type="radio" name="<%= optionKey %>" id="<%= ratingId %>" class="element_rating_radio" value="<%= ratingId %>" <%= selectedStr %> >
<label for="<%= ratingId %>">
<oneit:toString value="<%= rating %>" mode="EscapeHTML"/>
</label>
</div>
<%
}
%>
<div class="work-rating"> <div class="work-rating">
<div class="rate-background"> <div class="rate-background">
<span class="arrow-up-gray"></span> <span class="arrow-up-gray"></span>
...@@ -196,7 +178,7 @@ ...@@ -196,7 +178,7 @@
<a href="javascript:void(0)" class="importance"> <a href="javascript:void(0)" class="importance">
<input type="radio" name="<%= importanceKey %>" id="<%= importanceId %>" class="importance_radio" value="<%= importance.getName() %>" <%= selected %>/> <input type="radio" name="<%= importanceKey %>" id="<%= importanceId %>" class="importance_radio" value="<%= importance.getName() %>" <%= selected %>/>
<label for="<%= importanceId %>"><oneit:toString value="<%= importance %>" mode="EscapeHTML" /></label> <label for="<%= importanceId %>"><oneit:toString value="<%= importance.getCultureDescription() %>" mode="EscapeHTML" /></label>
</a> </a>
</li> </li>
<% <%
...@@ -206,6 +188,21 @@ ...@@ -206,6 +188,21 @@
</span> </span>
</div> </div>
</div> </div>
<%
for (CultureElementRating rating : criteria.getCultureElement().getRatingsSet())
{
String ratingId = String.valueOf(rating.getID().longID());
String selectedStr = (CollectionUtils.equals(ratingId, formValue) ? "checked" : "");
%>
<div class="<%= "radio radio-primary workplace-radio " %>">
<input type="radio" name="<%= optionKey %>" id="<%= ratingId %>" class="element_rating_radio" value="<%= ratingId %>" <%= selectedStr %> >
<label for="<%= ratingId %>">
<oneit:toString value="<%= rating %>" mode="EscapeHTML"/>
</label>
</div>
<%
}
%>
</div> </div>
<div class="form-brack-line-sub"></div> <div class="form-brack-line-sub"></div>
<% <%
......
...@@ -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"/> <ApplicantAccountCreatedEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="ApplicantAccountCreatedMail"/>
</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"/>
......
...@@ -42,9 +42,19 @@ ...@@ -42,9 +42,19 @@
} }
</style> </style>
<% <%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String id = request.getParameter("id");
String key = request.getParameter("key");
if(id != null && key != null)
{
job = Job.searchJobKey(objTran, Long.parseLong(id), key);
process.setAttribute("Job", job);
}
Debug.assertion(job != null, "Invalid job in applicant portal");
%> %>
<div class="main-verify-identity"> <div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div> <div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
List<Question> totalQuestions = (List<Question>) process.getAttribute("TotalQuestions"); List<Question> totalQuestions = (List<Question>) process.getAttribute("TotalQuestions");
List<Question> allQuestions = (List<Question>) process.getAttribute("AllQuestions"); List<Question> allQuestions = (List<Question>) process.getAttribute("AllQuestions");
String exitPage = WebUtils.getArticleLink(request, transaction, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey(); String exitPage = WebUtils.getArticleLink(request, transaction, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey();
boolean showHelp = process.getAttribute("ShowHelp")!= null ? (boolean)process.getAttribute("ShowHelp") : true;
if(totalQuestions == null) if(totalQuestions == null)
{ {
...@@ -126,20 +125,11 @@ ...@@ -126,20 +125,11 @@
<div class="section-page-area section-job-match"> <div class="section-page-area section-job-match">
<% <%
if(actualNumber == 1 ) //|| (showHelp && questionType != QuestionType.SCALAR) if(actualNumber == 1 )
{ {
int maxRating = 7; int maxRating = 7;
int midRating = 4; int midRating = 4;
String otherRating = "2, 3, 5, 6"; String otherRating = "2, 3, 5, 6";
// if(questionType != QuestionType.SCALAR)
// {
// process.setAttribute("ShowHelp", false);
//
// maxRating = 3;
// midRating = 5;
// otherRating = "2, 4";
// }
%> %>
<div class="main-sc-section sj-1"> <div class="main-sc-section sj-1">
<p>Using the scale given, indicate how important to you are the following aspects in your work life. Use the following system:</p> <p>Using the scale given, indicate how important to you are the following aspects in your work life. Use the following system:</p>
...@@ -153,6 +143,17 @@ ...@@ -153,6 +143,17 @@
<div class="selection-br-line"></div> <div class="selection-br-line"></div>
<% <%
} }
else if(questionType == QuestionType.IPSATIVE && actualNumber == 31)
{
%>
<div class="main-sc-section sj-1">
<p>
For questions like these, indicate your preference by selecting the number closest to the term or idea that's most like you. We know that it can be challenging to make a choice sometimes, but try to avoid selecting the middle value.
</p>
</div>
<div class="selection-br-line"></div>
<%
}
%> %>
<div class="main-sc-section main-rate-section"> <div class="main-sc-section main-rate-section">
<% <%
......
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
<div class="clearfix no-height"></div> <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">Your Experience</div>
<div class="mobile-estimated">Estimated time to complete: <b>5 mins</b></div> <div class="mobile-estimated">Estimated time to complete: <b>5 mins</b></div>
</div> </div>
<div class="section-c-title m-hide"> <div class="section-c-title m-hide">
Requirements Your Experience
<span class="estimated-time">Estimated time to complete: <span class="estimated-time">Estimated time to complete:
<span>5 mins</span> <span>5 mins</span>
</span> </span>
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<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" spellcheck="false"/>
<oneit:recalcClass htmlTag="div" classScript="job.isEmailFound() ? 'show': 'hide'" job="<%= job %>" class="right-mark"> <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> <span id="right-mark"><img src="images/right-mark.svg"/></span>
</oneit:recalcClass> </oneit:recalcClass>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria"); String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication"); JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
Job job = jobApplication.getJob(); Job job = jobApplication.getJob();
String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey(); String exitPage = WebUtils.getSamePageInRenderMode(request, "Page") + "&JobID=" + job.getObjectID(); //WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey();
%> %>
<script> <script>
$(document.body).addClass('bg-color'); $(document.body).addClass('bg-color');
......
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script">
<NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Applicant Account Created Mail">
<createSpecificIdentifier factory='String' value='0QBF1OPIDVFDHJVKG22GUAY0OXAXPP'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
</articleIdentifiers>
<createdLabel factory="String" value="0QBF1OPIDVFDHJVKG22GUAY0OXAXPP"/>
<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="Welcome to Talentology!"/>
<NODE name="Shortcuts" factory="String" value="ApplicantAccountCreatedMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Applicant Account Created Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map">
<NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi ${SecUser:FirstName},</p>
<p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Talentology!</p>
<p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Talentology, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p>
<p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p>
<p>Thanks,</p>
<p>The Talentology Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi ${SecUser:FirstName},</p><p>Welcome! You&rsquo;re now ready to apply for job opportunities that are powered by Talentology!</p><p>Your account&rsquo;s been set up and you&rsquo;re all ready to go. Whenever you sign in to Talentology, be sure to use <strong>${SecUser:UserName}</strong> along with the password that you just created.</p><p>And don&rsquo;t worry: If you ever forget your password, you can <a href="${link}">reset it</a> anytime.</p><p>Thanks,</p><p>The Talentology Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</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"/>
<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="Please verify your email address"/>
<NODE name="Shortcuts" factory="String" value="AccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map">
<NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hi,</p>
<p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Talentology account.<br>Please verify this email address by clicking this link:</p>
<p>
<a href="${link}">Verify now</a>
</p>
<p>Thanks,</p>
<p>The Talentology Team</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hi,</p><p>You entered <strong>${SecUser:UserName}</strong> as your email address for your Talentology account.<br>Please verify this email address by clicking this link:</p><p>
<a href="${link}">Verify now</a>
</p><p>Thanks,</p><p>The Talentology Team</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
...@@ -60,35 +60,9 @@ ...@@ -60,35 +60,9 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal"); Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
Debug.assertion(candidate != null, "Invalid candidate in applicant portal"); Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
%> %>
<script type="text/javascript"> <oneit:script>
$(document.body).addClass('bg-color'); <oneit:script src="/scripts/password_strength_lightweight.js"/>
</oneit:script>
$(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> <style>
button[disabled] { button[disabled] {
opacity: 0.6; opacity: 0.6;
...@@ -97,7 +71,41 @@ ...@@ -97,7 +71,41 @@
</style> </style>
<oneit:form name="signIn" method="post" enctype="multipart/form-data"> <oneit:form name="signIn" method="post" enctype="multipart/form-data">
<%
String passkey = Utils.getPwdKeyOfSecUser(request, secUser, true);
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
$('#myPassword').strength_meter({
"inputName" : "<%= passkey %>"
});
});
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>
<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">
...@@ -138,23 +146,12 @@ ...@@ -138,23 +146,12 @@
if(isVerify) if(isVerify)
{ {
%> %>
<div class="form-group text-left"> <div class="form-group text-left" id="myPassword">
<label>Password</label> <label>Password</label>
<oneit:ormInput obj="<%= job %>" type="password" attributeName="Password" cssClass="form-control second-style reset-pw" required="true"/>
</div> </div>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Confirm password</label> <label>Confirm password</label>
<oneit:ormInput obj="<%= job %>" type="password" attributeName="ConfirmPassword" cssClass="form-control second-style reset-pw " required="true"/> <oneit:input type="password" name="<%= passkey + 2 %>" class="form-control second-style reset-pw"/>
</div>
<div class="form-group text-left">
<p>
Your password must:
<ul>
<li>* begin with a letter of the alphabet</li>
<li>* include at least one number</li>
<li>* not include any spaces or special characters.</li>
</ul>
</p>
</div> </div>
<% <%
} }
......
...@@ -83,13 +83,13 @@ ...@@ -83,13 +83,13 @@
<div class="clearfix no-height"></div> <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">Workplace Preference</div>
<div class="mobile-estimated">Estimated time to complete: <div class="mobile-estimated">Estimated time to complete:
<span class="estimated-time-20">&nbsp;5 mins</span> <span class="estimated-time-20">&nbsp;5 mins</span>
</div> </div>
</div> </div>
<div class="section-c-title m-hide"> <div class="section-c-title m-hide">
Culture Workplace Preference
<span class="estimated-time">Estimated time to complete: <span class="estimated-time">Estimated time to complete:
<span class="estimated-time-20">&nbsp;5 mins</span> <span class="estimated-time-20">&nbsp;5 mins</span>
</span> </span>
......
Run URLShortnerBatch - this will add URL shortner to existing jobs.
\ No newline at end of file
cmsWebApp/webroot/images/executive.png

2.19 KB | W: | H:

cmsWebApp/webroot/images/executive.png

1.07 KB | W: | H:

cmsWebApp/webroot/images/executive.png
cmsWebApp/webroot/images/executive.png
cmsWebApp/webroot/images/executive.png
cmsWebApp/webroot/images/executive.png
  • 2-up
  • Swipe
  • Onion skin
cmsWebApp/webroot/images/general.png

1.76 KB | W: | H:

cmsWebApp/webroot/images/general.png

864 Bytes | W: | H:

cmsWebApp/webroot/images/general.png
cmsWebApp/webroot/images/general.png
cmsWebApp/webroot/images/general.png
cmsWebApp/webroot/images/general.png
  • 2-up
  • Swipe
  • Onion skin
cmsWebApp/webroot/images/management.png

2.06 KB | W: | H:

cmsWebApp/webroot/images/management.png

1.25 KB | W: | H:

cmsWebApp/webroot/images/management.png
cmsWebApp/webroot/images/management.png
cmsWebApp/webroot/images/management.png
cmsWebApp/webroot/images/management.png
  • 2-up
  • Swipe
  • Onion skin
cmsWebApp/webroot/images/sale.png

1.94 KB | W: | H:

cmsWebApp/webroot/images/sale.png

1.11 KB | W: | H:

cmsWebApp/webroot/images/sale.png
cmsWebApp/webroot/images/sale.png
cmsWebApp/webroot/images/sale.png
cmsWebApp/webroot/images/sale.png
  • 2-up
  • Swipe
  • Onion skin
/*
This is a simple implementation of the password_strength.js plugin, that does not use jQuery Widget Factory.
If you a going to extend plugin with addition functionality it will be better to use password_strength.js
because jQuery Widget Factory allows to build complex, stateful plugins based on object-oriented principles.
Dependencies:
1. jQuery
*/
;(function ( $, window, document, undefined ) {
var upperCase = new RegExp('[A-Z]');
var lowerCase = new RegExp('[a-z]');
var numbers = new RegExp('[0-9]');
var regx = /^[A-Za-z0-9 _.-]+$/;
var pluginName = 'strength_meter',
defaults = {
strengthWrapperClass: 'strength_wrapper',
inputClass: 'form-control second-style reset-pw',
strengthMeterClass: 'strength_meter',
toggleButtonClass: 'button_strength',
inputName : 'password'
// showPasswordText: 'Show Password',
// hidePasswordText: 'Hide Password'
};
function Plugin( element, options ) {
this.element = $(element);
this.options = $.extend( {}, defaults, options) ;
this._create();
}
Plugin.prototype._create = function () {
var
options = this.options;
//Note. Instead of this you can use templating. I did not want to have addition dependencies.
this.element.addClass(options.strengthWrapperClass);
this.element.append('<input type="password" name="'+ options.inputName +'" class="' + options.inputClass + '" "/>');
this.element.append('<input type="text" class="' + options.inputClass + '" style="display:none"/>');
// this.element.append('<a href="" class="' + options.toggleButtonClass + '">' + options.showPasswordText + '</a>');
this.element.append('<div class="' + options.strengthMeterClass + '"><div><p></p></div></div>');
this.element.append(
'<div class="pswd_info" style="display: none;"> \
<div class="info_box"><h4>Password must include:</h4> \
<ul> \
<li data-criterion="length" class="valid">8-20 <strong>Characters</strong></li> \
<li data-criterion="capital" class="valid">At least <strong>one capital letter</strong></li> \
<li data-criterion="lower" class="valid">At least <strong>one lower case letter</strong></li> \
<li data-criterion="number" class="valid">At least <strong>one number</strong></li> \
<li data-criterion="letter" class="valid">No <strong>spaces</strong> and <strong>special characters</strong></li> \
</ul> \
</div></div>');
//this object contain all main inner elements which will be used in strength meter.
this.content = {};
this.content.$textInput = this.element.find('input[type="text"]');
this.content.$passwordInput = this.element.find('input[type="password"]');
this.content.$toggleButton = this.element.find('a');
this.content.$pswdInfo = this.element.find('.pswd_info');
this.content.$strengthMeter = this.element.find("." + options.strengthMeterClass);
this.content.$dataMeter = this.content.$strengthMeter.find("div");
this._sync_inputs(this.content.$passwordInput, this.content.$textInput);
this._sync_inputs(this.content.$textInput, this.content.$passwordInput);
this._bind_input_events(this.content.$passwordInput);
this._bind_input_events(this.content.$textInput);
var that = this;
this.content.$toggleButton.bind("click", function(e){
e.preventDefault();
that._toggle_input(that.content.$textInput);
that._toggle_input(that.content.$passwordInput);
// var text = that.content.$passwordInput.is(":visible") ? that.options.showPasswordText: that.options.hidePasswordText;
// $(event.target).text(text);
});
},
//Toggle active inputs.
Plugin.prototype._toggle_input = function($element){
$element.toggle();
if($element.is(":visible")){
$element.focus();
}
},
//Copy value from active input inside hidden.
Plugin.prototype._sync_inputs = function($s, $t){
$s.bind('keyup', function () {
var password = $s.val();
$t.val(password);
});
},
Plugin.prototype._bind_input_events = function($s) {
var that = this;
$s.bind('keyup', function () {
var password = $s.val();
var characters = (password.length >= 8);
var capitalletters = password.match(upperCase) ? 1 : 0;
var loweletters = password.match(lowerCase) ? 1 : 0;
var number = password.match(numbers) ? 1 : 0;
var containWhiteSpace = password.indexOf(' ') >= 0 ? 1 : 0;
var validText = regx.test(password) ? 1 : 0;
var total = characters + capitalletters + loweletters + number;
that._update_indicator(total);
that._update_info('length', password.length >= 8 && password.length <= 20);
that._update_info('capital', capitalletters);
that._update_info('lower', loweletters);
that._update_info('number', number);
that._update_info('letter', !containWhiteSpace && validText);
}).focus(function () {
that.content.$pswdInfo.show();
}).blur(function () {
that.content.$pswdInfo.hide();
});
},
Plugin.prototype._update_indicator = function(total) {
var meter = this.content.$dataMeter;
meter.removeClass();
if (total === 0) {
meter.html('');
} else if (total === 1) {
meter.addClass('veryweak').html('<p>very weak</p>');
} else if (total === 2) {
meter.addClass('weak').html('<p>weak</p>');
} else if (total === 3) {
meter.addClass('medium').html('<p>medium</p>');
} else {
meter.addClass('strong').html('<p>strong</p>');
}
},
Plugin.prototype._update_info = function(criterion, isValid) {
var $passwordCriteria = this.element.find('li[data-criterion="' + criterion + '"]');
if (isValid) {
$passwordCriteria.removeClass('invalid').addClass('valid');
} else {
$passwordCriteria.removeClass('valid').addClass('invalid');
}
},
// A really lightweight plugin wrapper around the constructor,
// preventing against multiple instantiations
$.fn[pluginName] = function ( options ) {
return this.each(function () {
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName,
new Plugin( this, options ));
}
});
}
})( jQuery, window, document );
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp"> <SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp">
<WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms"> <WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms">
<OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="2bb1972b665029a5167e3d25f5197c79c206a899"/> <OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="d610a98773b9e156fb1aaa49ea6561f570a387f6"/>
</WEBAPP> </WEBAPP>
<PARAMETER name="key.file"/> <PARAMETER name="key.file"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment