Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
0088b858
Commit
0088b858
authored
Oct 30, 2017
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intercom custom attribute update
parent
ed6e3844
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
156 additions
and
32 deletions
+156
-32
Job.xml
cmsWebApp/sql/Job.xml
+1
-0
Job.sql
cmsWebApp/sql/ms/Job.sql
+1
-0
Job.sql
cmsWebApp/sql/oracle/Job.sql
+1
-0
Job.sql
cmsWebApp/sql/postgres/Job.sql
+1
-0
CloseJobBatch.java
cmsWebApp/src/performa/batch/CloseJobBatch.java
+13
-0
BulkUpdateFP.java
cmsWebApp/src/performa/form/BulkUpdateFP.java
+15
-0
ChangeApplicationStatusFP.java
cmsWebApp/src/performa/form/ChangeApplicationStatusFP.java
+16
-0
CompleteApplicationFP.java
cmsWebApp/src/performa/form/CompleteApplicationFP.java
+16
-1
SaveCompanyFP.java
cmsWebApp/src/performa/form/SaveCompanyFP.java
+1
-1
SaveJobFP.java
cmsWebApp/src/performa/form/SaveJobFP.java
+9
-4
SaveUserDetailsFP.java
cmsWebApp/src/performa/form/SaveUserDetailsFP.java
+1
-1
SendCompanyUserInvitesFP.java
cmsWebApp/src/performa/form/SendCompanyUserInvitesFP.java
+1
-1
IntercomUtils.java
cmsWebApp/src/performa/intercom/utils/IntercomUtils.java
+65
-24
BaseJob.java
cmsWebApp/src/performa/orm/BaseJob.java
+0
-0
Job.xml
cmsWebApp/src/performa/orm/Job.xml
+1
-0
JobPersistenceMgr.java
cmsWebApp/src/performa/orm/JobPersistenceMgr.java
+0
-0
20171030_Alter_Job.xml
...broot/extensions/performa/upgrades/20171030_Alter_Job.xml
+14
-0
No files found.
cmsWebApp/sql/Job.xml
View file @
0088b858
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<column
name=
"city"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"city"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"state"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"state"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"country"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"country"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"manually_closed"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"level_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"level_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"client_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"client_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
...
...
cmsWebApp/sql/ms/Job.sql
View file @
0088b858
...
@@ -23,6 +23,7 @@ CREATE TABLE tl_job (
...
@@ -23,6 +23,7 @@ CREATE TABLE tl_job (
city
varchar
(
100
)
NULL
,
city
varchar
(
100
)
NULL
,
state
varchar
(
200
)
NULL
,
state
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
manually_closed
char
(
1
)
NULL
,
level_id
numeric
(
12
)
NULL
,
level_id
numeric
(
12
)
NULL
,
client_id
numeric
(
12
)
NULL
,
client_id
numeric
(
12
)
NULL
,
company_user_id
numeric
(
12
)
NULL
,
company_user_id
numeric
(
12
)
NULL
,
...
...
cmsWebApp/sql/oracle/Job.sql
View file @
0088b858
...
@@ -24,6 +24,7 @@ CREATE TABLE tl_job (
...
@@ -24,6 +24,7 @@ CREATE TABLE tl_job (
city
varchar2
(
100
)
NULL
,
city
varchar2
(
100
)
NULL
,
state
varchar2
(
200
)
NULL
,
state
varchar2
(
200
)
NULL
,
country
varchar2
(
200
)
NULL
,
country
varchar2
(
200
)
NULL
,
manually_closed
char
(
1
)
NULL
,
level_id
number
(
12
)
NULL
,
level_id
number
(
12
)
NULL
,
client_id
number
(
12
)
NULL
,
client_id
number
(
12
)
NULL
,
company_user_id
number
(
12
)
NULL
,
company_user_id
number
(
12
)
NULL
,
...
...
cmsWebApp/sql/postgres/Job.sql
View file @
0088b858
...
@@ -24,6 +24,7 @@ CREATE TABLE tl_job (
...
@@ -24,6 +24,7 @@ CREATE TABLE tl_job (
city
varchar
(
100
)
NULL
,
city
varchar
(
100
)
NULL
,
state
varchar
(
200
)
NULL
,
state
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
manually_closed
char
(
1
)
NULL
,
level_id
numeric
(
12
)
NULL
,
level_id
numeric
(
12
)
NULL
,
client_id
numeric
(
12
)
NULL
,
client_id
numeric
(
12
)
NULL
,
company_user_id
numeric
(
12
)
NULL
,
company_user_id
numeric
(
12
)
NULL
,
...
...
cmsWebApp/src/performa/batch/CloseJobBatch.java
View file @
0088b858
package
performa
.
batch
;
package
performa
.
batch
;
import
java.util.Set
;
import
oneit.appservices.batch.ORMBatch
;
import
oneit.appservices.batch.ORMBatch
;
import
oneit.logging.*
;
import
oneit.logging.*
;
import
oneit.objstore.ObjectTransaction
;
import
oneit.objstore.ObjectTransaction
;
...
@@ -7,7 +8,9 @@ import oneit.objstore.StorageException;
...
@@ -7,7 +8,9 @@ import oneit.objstore.StorageException;
import
oneit.objstore.rdbms.filters.LessThanFilter
;
import
oneit.objstore.rdbms.filters.LessThanFilter
;
import
oneit.utils.DateDiff
;
import
oneit.utils.DateDiff
;
import
oneit.utils.parsers.FieldException
;
import
oneit.utils.parsers.FieldException
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.Job
;
import
performa.orm.Job
;
import
performa.orm.Company
;
import
performa.orm.types.JobStatus
;
import
performa.orm.types.JobStatus
;
...
@@ -27,8 +30,17 @@ public class CloseJobBatch extends ORMBatch
...
@@ -27,8 +30,17 @@ public class CloseJobBatch extends ORMBatch
for
(
Job
job
:
expiringJobs
)
for
(
Job
job
:
expiringJobs
)
{
{
job
.
setJobStatus
(
JobStatus
.
COMPLETE
);
job
.
setJobStatus
(
JobStatus
.
COMPLETE
);
job
.
setIsManuallyClosed
(
Boolean
.
FALSE
);
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
DEBUG2
,
"Setting Job Status to Closed in job : "
,
job
);
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
DEBUG2
,
"Setting Job Status to Closed in job : "
,
job
);
}
}
// Update closed job details to intercom
Set
<
Company
>
companies
=
Job
.
pipesJob
(
expiringJobs
).
toCompanyUser
().
toCompany
().
uniqueVals
();
for
(
Company
company
:
companies
)
{
IntercomUtils
.
updateCompany
(
company
);
}
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/form/BulkUpdateFP.java
View file @
0088b858
...
@@ -10,6 +10,7 @@ import oneit.objstore.StorageException;
...
@@ -10,6 +10,7 @@ import oneit.objstore.StorageException;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.utils.ObjstoreUtils
;
import
oneit.objstore.utils.ObjstoreUtils
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.ORMProcessState
;
...
@@ -17,6 +18,8 @@ import oneit.servlets.process.SaveFP;
...
@@ -17,6 +18,8 @@ import oneit.servlets.process.SaveFP;
import
oneit.utils.BusinessException
;
import
oneit.utils.BusinessException
;
import
oneit.utils.filter.CollectionFilter
;
import
oneit.utils.filter.CollectionFilter
;
import
oneit.utils.filter.Filter
;
import
oneit.utils.filter.Filter
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.CompanyUser
;
import
performa.orm.Job
;
import
performa.orm.Job
;
import
performa.orm.JobApplication
;
import
performa.orm.JobApplication
;
import
performa.orm.types.AppProcessOption
;
import
performa.orm.types.AppProcessOption
;
...
@@ -62,6 +65,18 @@ public class BulkUpdateFP extends SaveFP
...
@@ -62,6 +65,18 @@ public class BulkUpdateFP extends SaveFP
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
);
}
}
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs
(
process
,
request
);
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
// Update company in intercom
if
(
companyUser
.
getCompany
()
!=
null
)
{
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
());
}
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
}
}
cmsWebApp/src/performa/form/ChangeApplicationStatusFP.java
View file @
0088b858
...
@@ -5,11 +5,14 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -5,11 +5,14 @@ import javax.servlet.http.HttpServletRequest;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LogMgr
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.StorageException
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.SaveFP
;
import
oneit.servlets.process.SaveFP
;
import
oneit.utils.BusinessException
;
import
oneit.utils.BusinessException
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.CompanyUser
;
import
performa.orm.JobApplication
;
import
performa.orm.JobApplication
;
import
performa.orm.types.AppProcessOption
;
import
performa.orm.types.AppProcessOption
;
import
performa.orm.types.ApplicationStatus
;
import
performa.orm.types.ApplicationStatus
;
...
@@ -35,6 +38,18 @@ public class ChangeApplicationStatusFP extends SaveFP
...
@@ -35,6 +38,18 @@ public class ChangeApplicationStatusFP extends SaveFP
LogMgr
.
log
(
JobApplication
.
LOG
,
LogLevel
.
PROCESSING1
,
"In ChangeApplicationStatusFP Job Application Status successfully changed : "
,
jobApplication
);
LogMgr
.
log
(
JobApplication
.
LOG
,
LogLevel
.
PROCESSING1
,
"In ChangeApplicationStatusFP Job Application Status successfully changed : "
,
jobApplication
);
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs
(
process
,
request
);
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
// Update company in intercom
if
(
companyUser
.
getCompany
()
!=
null
)
{
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
());
}
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/form/CompleteApplicationFP.java
View file @
0088b858
...
@@ -6,9 +6,12 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -6,9 +6,12 @@ import javax.servlet.http.HttpServletRequest;
import
oneit.logging.*
;
import
oneit.logging.*
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.*
;
import
oneit.servlets.forms.*
;
import
oneit.servlets.process.*
;
import
oneit.servlets.process.*
;
import
static
oneit
.
servlets
.
process
.
SaveFP
.
completeProcessRestartAndRestoreAttribs
;
import
oneit.utils.*
;
import
oneit.utils.*
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.*
;
import
performa.orm.*
;
import
performa.orm.types.ApplicationStatus
;
import
performa.orm.types.ApplicationStatus
;
import
performa.utils.AnalysisEngine
;
import
performa.utils.AnalysisEngine
;
...
@@ -19,6 +22,7 @@ public class CompleteApplicationFP extends SaveFP
...
@@ -19,6 +22,7 @@ public class CompleteApplicationFP extends SaveFP
@Override
@Override
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
params
)
throws
BusinessException
,
StorageException
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
params
)
throws
BusinessException
,
StorageException
{
{
HttpServletRequest
request
=
submission
.
getRequest
();
JobApplication
jobApplication
=
(
JobApplication
)
process
.
getAttribute
(
"JobApplication"
);
JobApplication
jobApplication
=
(
JobApplication
)
process
.
getAttribute
(
"JobApplication"
);
jobApplication
.
setApplicationStatus
(
ApplicationStatus
.
SUBMITTED
);
jobApplication
.
setApplicationStatus
(
ApplicationStatus
.
SUBMITTED
);
...
@@ -26,7 +30,6 @@ public class CompleteApplicationFP extends SaveFP
...
@@ -26,7 +30,6 @@ public class CompleteApplicationFP extends SaveFP
AnalysisEngine
.
analyseAnswers
(
jobApplication
.
getCandidate
(),
jobApplication
.
getJob
().
getLevel
(),
jobApplication
.
getCompletedAnswers
());
AnalysisEngine
.
analyseAnswers
(
jobApplication
.
getCandidate
(),
jobApplication
.
getJob
().
getLevel
(),
jobApplication
.
getCompletedAnswers
());
//TODO: set application status as UNSUITABLE if not scored
//TODO: set application status as UNSUITABLE if not scored
if
(
false
)
if
(
false
)
{
{
...
@@ -35,6 +38,18 @@ public class CompleteApplicationFP extends SaveFP
...
@@ -35,6 +38,18 @@ public class CompleteApplicationFP extends SaveFP
LogMgr
.
log
(
JobApplication
.
LOG
,
LogLevel
.
PROCESSING2
,
"Job Application Completed"
,
jobApplication
);
LogMgr
.
log
(
JobApplication
.
LOG
,
LogLevel
.
PROCESSING2
,
"Job Application Completed"
,
jobApplication
);
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs
(
process
,
request
);
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
// Update company in intercom
if
(
companyUser
.
getCompany
()
!=
null
)
{
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
());
}
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
...
...
cmsWebApp/src/performa/form/SaveCompanyFP.java
View file @
0088b858
...
@@ -33,7 +33,7 @@ public class SaveCompanyFP extends SaveFP
...
@@ -33,7 +33,7 @@ public class SaveCompanyFP extends SaveFP
}
}
// Update company in intercom
// Update company in intercom
IntercomUtils
.
updateCompany
(
company
,
process
.
getTransaction
()
);
IntercomUtils
.
updateCompany
(
company
);
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
...
...
cmsWebApp/src/performa/form/SaveJobFP.java
View file @
0088b858
...
@@ -53,16 +53,21 @@ public class SaveJobFP extends SaveFP
...
@@ -53,16 +53,21 @@ public class SaveJobFP extends SaveFP
job
.
createShortenedURL
();
job
.
createShortenedURL
();
}
}
// restarting process as job count needs to be updated to intercom
if
(
job
.
getJobStatus
()
==
JobStatus
.
COMPLETE
)
process
.
completeAndRestart
();
{
job
.
setIsManuallyClosed
(
Boolean
.
TRUE
);
}
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs
(
process
,
request
);
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
// Update company in intercom
job count details
// Update company in intercom
if
(
companyUser
.
getCompany
()
!=
null
)
if
(
companyUser
.
getCompany
()
!=
null
)
{
{
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
()
,
process
.
getTransaction
()
);
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
());
}
}
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
...
...
cmsWebApp/src/performa/form/SaveUserDetailsFP.java
View file @
0088b858
...
@@ -87,7 +87,7 @@ public class SaveUserDetailsFP extends SaveFP
...
@@ -87,7 +87,7 @@ public class SaveUserDetailsFP extends SaveFP
if
(
intercomUser
==
null
)
if
(
intercomUser
==
null
)
{
{
performa
.
intercom
.
resources
.
Company
intercomCompany
=
IntercomUtils
.
findOrCreateCompany
(
companyUser
.
getCompany
()
,
process
.
getTransaction
()
);
performa
.
intercom
.
resources
.
Company
intercomCompany
=
IntercomUtils
.
findOrCreateCompany
(
companyUser
.
getCompany
());
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
,
companyUser
.
getPhone
());
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
,
companyUser
.
getPhone
());
}
}
...
...
cmsWebApp/src/performa/form/SendCompanyUserInvitesFP.java
View file @
0088b858
...
@@ -136,7 +136,7 @@ public class SendCompanyUserInvitesFP extends SaveFP
...
@@ -136,7 +136,7 @@ public class SendCompanyUserInvitesFP extends SaveFP
// Create company and the first user of it in intercom
// Create company and the first user of it in intercom
performa
.
intercom
.
resources
.
Company
intercomCompany
=
IntercomUtils
.
findOrCreateCompany
(
company
,
objTran
);
performa
.
intercom
.
resources
.
Company
intercomCompany
=
IntercomUtils
.
findOrCreateCompany
(
company
);
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
,
companyUser
.
getPhone
());
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
,
companyUser
.
getPhone
());
...
...
cmsWebApp/src/performa/intercom/utils/IntercomUtils.java
View file @
0088b858
package
performa
.
intercom
.
utils
;
package
performa
.
intercom
.
utils
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LoggingArea
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.ObjectTransaction
;
import
oneit.objstore.ObjectTransaction
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.InFilter
;
import
oneit.objstore.utils.ObjstoreUtils
;
import
oneit.security.SecUser
;
import
oneit.security.SecUser
;
import
oneit.utils.CollectionUtils
;
import
oneit.utils.ObjectTransform
;
import
oneit.utils.filter.CollectionFilter
;
import
oneit.utils.filter.CollectionFilter
;
import
oneit.utils.filter.Filter
;
import
oneit.utils.filter.Filter
;
import
performa.intercom.resources.Company
;
import
performa.intercom.resources.Company
;
import
performa.intercom.resources.CustomAttribute
;
import
performa.intercom.resources.CustomAttribute
;
import
performa.intercom.resources.Event
;
import
performa.intercom.resources.Intercom
;
import
performa.intercom.resources.Intercom
;
import
performa.intercom.resources.User
;
import
performa.intercom.resources.User
;
import
performa.orm.Job
;
import
performa.orm.Job
;
import
performa.orm.JobApplication
;
import
performa.orm.types.ApplicationStatus
;
import
performa.orm.types.JobStatus
;
import
performa.orm.types.JobStatus
;
import
performa.utils.Utils
;
import
performa.utils.Utils
;
...
@@ -103,21 +110,13 @@ public class IntercomUtils
...
@@ -103,21 +110,13 @@ public class IntercomUtils
}
}
public
static
Company
createIntercomCompany
(
performa
.
orm
.
Company
company
,
ObjectTransaction
transaction
)
public
static
Company
createIntercomCompany
(
performa
.
orm
.
Company
company
)
{
{
try
try
{
{
Company
intercomCompany
=
new
Company
();
Company
intercomCompany
=
new
Company
();
intercomCompany
.
setName
(
company
.
getCompanyName
());
setCompanyDetails
(
intercomCompany
,
company
);
intercomCompany
.
setCompanyID
(
company
.
getID
().
toString
());
Job
[]
jobs
=
Job
.
searchCompany
(
transaction
,
company
);
Filter
filter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
DRAFT
));
Collection
draftJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
filter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"job-count"
,
jobs
!=
null
?
jobs
.
length
:
0
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"draft-job-count"
,
draftJobs
.
size
()));
return
Company
.
create
(
intercomCompany
);
return
Company
.
create
(
intercomCompany
);
}
}
...
@@ -130,6 +129,55 @@ public class IntercomUtils
...
@@ -130,6 +129,55 @@ public class IntercomUtils
}
}
private
static
void
setCompanyDetails
(
Company
intercomCompany
,
performa
.
orm
.
Company
company
)
throws
StorageException
{
intercomCompany
.
setName
(
company
.
getCompanyName
());
intercomCompany
.
setCompanyID
(
company
.
getID
().
toString
());
// job related custom attributes
Job
[]
jobs
=
Job
.
searchCompany
(
company
.
getTransaction
(),
company
);
Filter
draftFilter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
DRAFT
));
Collection
draftJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
draftFilter
);
Filter
filledFilter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
FILLED
));
Collection
filledJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
filledFilter
);
Filter
openFilter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
OPEN
));
Collection
openJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
openFilter
);
Filter
closedFilter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
COMPLETE
));
Collection
closedJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
closedFilter
);
Filter
manuallyFilter
=
Job
.
SearchByAll
().
andIsManuallyClosed
(
new
EqualsFilter
<>(
Boolean
.
TRUE
));
Collection
manuallyClosed
=
CollectionFilter
.
filter
(
closedJobs
,
manuallyFilter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"job-count"
,
jobs
!=
null
?
jobs
.
length
:
0
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"draft-job-count"
,
draftJobs
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"filled_job_count"
,
filledJobs
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"open_job_count"
,
openJobs
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"manually_closed_job_count"
,
manuallyClosed
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"expired_job_count"
,
closedJobs
.
size
()
-
manuallyClosed
.
size
()));
// applicant related custom attributes
Filter
allApplicantFilter
=
JobApplication
.
SearchByAll
().
andApplicationStatus
(
new
InFilter
<>(
ApplicationStatus
.
SUBMITTED
,
ApplicationStatus
.
SHORTLISTED
,
ApplicationStatus
.
UNSUITABLE
));
Collection
applicants
=
Job
.
pipesJob
(
jobs
).
toJobApplications
(
allApplicantFilter
).
uniqueVals
();
Filter
shortlistedFilter
=
JobApplication
.
SearchByAll
().
andApplicationStatus
(
new
EqualsFilter
<>(
ApplicationStatus
.
SHORTLISTED
));
Collection
shortlistedApplicants
=
CollectionFilter
.
filter
(
applicants
,
shortlistedFilter
);
Filter
unsuitableFilter
=
JobApplication
.
SearchByAll
().
andApplicationStatus
(
new
EqualsFilter
<>(
ApplicationStatus
.
UNSUITABLE
));
Collection
unsuitableApplicants
=
CollectionFilter
.
filter
(
applicants
,
unsuitableFilter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"total_applicants"
,
applicants
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"total_shortlisted"
,
shortlistedApplicants
.
size
()));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"total_unsuitable"
,
unsuitableApplicants
.
size
()));
List
<
Job
>
sortedJobs
=
ObjstoreUtils
.
sort
(
Arrays
.
asList
(
jobs
),
new
ObjectTransform
[]{
Job
.
pipesJob
().
toObjectCreated
()},
new
Comparator
[]{
CollectionUtils
.
reverse
(
CollectionUtils
.
DEFAULT_COMPARATOR
)});
if
(
sortedJobs
.
size
()
>
0
)
{
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newLongAttribute
(
"recent_job_created_at"
,
sortedJobs
.
get
(
0
).
getObjectCreated
().
getTime
()
/
1000
));
}
}
public
static
Company
findCompanyByID
(
performa
.
orm
.
Company
company
)
public
static
Company
findCompanyByID
(
performa
.
orm
.
Company
company
)
{
{
try
try
...
@@ -149,7 +197,7 @@ public class IntercomUtils
...
@@ -149,7 +197,7 @@ public class IntercomUtils
}
}
public
static
void
updateCompany
(
performa
.
orm
.
Company
company
,
ObjectTransaction
transaction
)
public
static
void
updateCompany
(
performa
.
orm
.
Company
company
)
{
{
try
try
{
{
...
@@ -157,18 +205,11 @@ public class IntercomUtils
...
@@ -157,18 +205,11 @@ public class IntercomUtils
if
(
intercomCompany
==
null
)
if
(
intercomCompany
==
null
)
{
{
createIntercomCompany
(
company
,
transaction
);
createIntercomCompany
(
company
);
}
}
else
else
{
{
intercomCompany
.
setName
(
company
.
getCompanyName
());
setCompanyDetails
(
intercomCompany
,
company
);
Job
[]
jobs
=
Job
.
searchCompany
(
transaction
,
company
);
Filter
filter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
DRAFT
));
Collection
draftJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
filter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"job-count"
,
jobs
!=
null
?
jobs
.
length
:
0
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
newIntegerAttribute
(
"draft-job-count"
,
draftJobs
.
size
()));
Company
.
update
(
intercomCompany
);
Company
.
update
(
intercomCompany
);
}
}
...
@@ -181,13 +222,13 @@ public class IntercomUtils
...
@@ -181,13 +222,13 @@ public class IntercomUtils
}
}
public
static
Company
findOrCreateCompany
(
performa
.
orm
.
Company
company
,
ObjectTransaction
transaction
)
public
static
Company
findOrCreateCompany
(
performa
.
orm
.
Company
company
)
{
{
Company
intercomCompany
=
findCompanyByID
(
company
);
Company
intercomCompany
=
findCompanyByID
(
company
);
if
(
intercomCompany
==
null
)
if
(
intercomCompany
==
null
)
{
{
intercomCompany
=
createIntercomCompany
(
company
,
transaction
);
intercomCompany
=
createIntercomCompany
(
company
);
}
}
return
intercomCompany
;
return
intercomCompany
;
...
...
cmsWebApp/src/performa/orm/BaseJob.java
View file @
0088b858
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/orm/Job.xml
View file @
0088b858
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
<ATTRIB
name=
"City"
type=
"String"
dbcol=
"city"
length=
"100"
/>
<ATTRIB
name=
"City"
type=
"String"
dbcol=
"city"
length=
"100"
/>
<ATTRIB
name=
"State"
type=
"State"
dbcol=
"state"
defaultValue=
"State.WA"
attribHelper=
"EnumeratedAttributeHelper"
/>
<ATTRIB
name=
"State"
type=
"State"
dbcol=
"state"
defaultValue=
"State.WA"
attribHelper=
"EnumeratedAttributeHelper"
/>
<ATTRIB
name=
"Country"
type=
"Countries"
dbcol=
"country"
defaultValue=
"Countries.AU"
attribHelper=
"EnumeratedAttributeHelper"
/>
<ATTRIB
name=
"Country"
type=
"Countries"
dbcol=
"country"
defaultValue=
"Countries.AU"
attribHelper=
"EnumeratedAttributeHelper"
/>
<ATTRIB
name=
"IsManuallyClosed"
type=
"Boolean"
dbcol=
"manually_closed"
defaultValue=
"Boolean.FALSE"
/>
<SINGLEREFERENCE
name=
"Level"
type=
"Level"
dbcol=
"level_id"
mandatory=
"false"
/>
<SINGLEREFERENCE
name=
"Level"
type=
"Level"
dbcol=
"level_id"
mandatory=
"false"
/>
<SINGLEREFERENCE
name=
"Client"
type=
"Client"
dbcol=
"client_id"
backreferenceName=
"Jobs"
/>
<SINGLEREFERENCE
name=
"Client"
type=
"Client"
dbcol=
"client_id"
backreferenceName=
"Jobs"
/>
...
...
cmsWebApp/src/performa/orm/JobPersistenceMgr.java
View file @
0088b858
This diff is collapsed.
Click to expand it.
cmsWebApp/webroot/extensions/performa/upgrades/20171030_Alter_Job.xml
0 → 100644
View file @
0088b858
<?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=
"manually_closed"
type=
"Boolean"
nullable=
"true"
/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment