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
baed56a3
Commit
baed56a3
authored
Oct 24, 2017
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make job count and draft job count integer values in intercom
parent
dec39df6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
IntercomUtils.java
cmsWebApp/src/performa/intercom/utils/IntercomUtils.java
+30
-4
stdimports.jsp
cmsWebApp/webroot/extensions/performa/inc/stdimports.jsp
+1
-0
No files found.
cmsWebApp/src/performa/intercom/utils/IntercomUtils.java
View file @
baed56a3
package
performa
.
intercom
.
utils
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
...
...
@@ -14,6 +15,7 @@ import oneit.utils.filter.CollectionFilter;
import
oneit.utils.filter.Filter
;
import
performa.intercom.resources.Company
;
import
performa.intercom.resources.CustomAttribute
;
import
performa.intercom.resources.Event
;
import
performa.intercom.resources.Intercom
;
import
performa.intercom.resources.User
;
import
performa.orm.Job
;
...
...
@@ -114,8 +116,8 @@ public class IntercomUtils
Filter
filter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
DRAFT
));
Collection
draftJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
filter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
StringAttribute
(
"job-count"
,
jobs
!=
null
?
String
.
valueOf
(
jobs
.
length
)
:
""
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
StringAttribute
(
"draft-job-count"
,
String
.
valueOf
(
draftJobs
.
size
()
)));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
IntegerAttribute
(
"job-count"
,
jobs
!=
null
?
jobs
.
length
:
0
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
IntegerAttribute
(
"draft-job-count"
,
draftJobs
.
size
(
)));
return
Company
.
create
(
intercomCompany
);
}
...
...
@@ -165,8 +167,8 @@ public class IntercomUtils
Filter
filter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
DRAFT
));
Collection
draftJobs
=
CollectionFilter
.
filter
(
Arrays
.
asList
(
jobs
),
filter
);
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
StringAttribute
(
"job-count"
,
jobs
!=
null
?
String
.
valueOf
(
jobs
.
length
)
:
""
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
StringAttribute
(
"draft-job-count"
,
String
.
valueOf
(
draftJobs
.
size
())));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
IntegerAttribute
(
"job-count"
,
jobs
!=
null
?
jobs
.
length
:
0
));
intercomCompany
.
addCustomAttribute
(
CustomAttribute
.
new
IntegerAttribute
(
"draft-job-count"
,
draftJobs
.
size
()));
Company
.
update
(
intercomCompany
);
}
...
...
@@ -190,4 +192,28 @@ public class IntercomUtils
return
intercomCompany
;
}
// public static void createAccessedJobEvent(Job job, User user)
// {
// try
// {
// Map<String, CustomAttribute> customAttributes = user.getCustomAttributes();
// customAttributes.get("shortlisted-count");
// Event event = new Event();
//
// event.setEventName("accessed-job");
// event.putMetadata("applicant-count", job.getNoOfCandidatesApplied());
// event.putMetadata("shortlisted-count", job.getNoOfCandidatesShortlisted());
// event.setUserID(user.getUserId());
// event.setCreatedAt(currentTimeMillis()/1000L);
//
// Event.create(event);
// }
// catch (Exception e)
// {
// LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while creating accessed job event in intercom");
//
// }
// }
}
cmsWebApp/webroot/extensions/performa/inc/stdimports.jsp
View file @
baed56a3
<%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*"%>
<%@ page import="performa.intercom.utils.*, performa.intercom.resources.User"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.* "%>
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