Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
civitas-digitalis
platform
Commits
6966e8b7
Commit
6966e8b7
authored
Jan 02, 2018
by
Saurabh Narayan Singh
Browse files
separate methods trackClick trackClickSession
parent
3b19fcc0
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/analysisService/analysisService-api/src/main/java/analysisService/service/SessionTimeLocalService.java
View file @
6966e8b7
...
...
@@ -232,12 +232,17 @@ public interface SessionTimeLocalService extends BaseLocalService,
Projection
projection
);
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
* groupID : String : ID of the portal. Used to track the session length
* ButtonPositions : ENUM : FIRST - LAST - MIDDLE
* sessionID : If it's the first click, send default sessionID - 0
* returns the sessionID after logging the click
*/
public
long
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
,
public
long
trackClick
Session
(
java
.
lang
.
String
groupID
,
ButtonPositions
position
,
long
sessionID
);
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
*/
public
void
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
);
}
\ No newline at end of file
modules/analysisService/analysisService-api/src/main/java/analysisService/service/SessionTimeLocalServiceUtil.java
View file @
6966e8b7
...
...
@@ -258,16 +258,23 @@ public class SessionTimeLocalServiceUtil {
}
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
* groupID : String : ID of the portal. Used to track the session length
* ButtonPositions : ENUM : FIRST - LAST - MIDDLE
* sessionID : If it's the first click, send default sessionID - 0
* returns the sessionID after logging the click
*/
public
static
long
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
,
public
static
long
trackClickSession
(
java
.
lang
.
String
groupID
,
analysisService
.
service
.
enums
.
ButtonPositions
position
,
long
sessionID
)
{
return
getService
().
trackClick
(
groupID
,
buttonID
,
position
,
sessionID
);
return
getService
().
trackClickSession
(
groupID
,
position
,
sessionID
);
}
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
*/
public
static
void
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
)
{
getService
().
trackClick
(
groupID
,
buttonID
);
}
public
static
SessionTimeLocalService
getService
()
{
...
...
modules/analysisService/analysisService-api/src/main/java/analysisService/service/SessionTimeLocalServiceWrapper.java
View file @
6966e8b7
...
...
@@ -266,19 +266,27 @@ public class SessionTimeLocalServiceWrapper implements SessionTimeLocalService,
}
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
* groupID : String : ID of the portal. Used to track the session length
* ButtonPositions : ENUM : FIRST - LAST - MIDDLE
* sessionID : If it's the first click, send default sessionID - 0
* returns the sessionID after logging the click
*/
@Override
public
long
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
,
public
long
trackClick
Session
(
java
.
lang
.
String
groupID
,
analysisService
.
service
.
enums
.
ButtonPositions
position
,
long
sessionID
)
{
return
_sessionTimeLocalService
.
trackClick
(
groupID
,
button
ID
,
position
,
return
_sessionTimeLocalService
.
trackClick
Session
(
group
ID
,
position
,
sessionID
);
}
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
*/
@Override
public
void
trackClick
(
java
.
lang
.
String
groupID
,
java
.
lang
.
String
buttonID
)
{
_sessionTimeLocalService
.
trackClick
(
groupID
,
buttonID
);
}
@Override
public
SessionTimeLocalService
getWrappedService
()
{
return
_sessionTimeLocalService
;
...
...
modules/analysisService/analysisService-service/src/main/java/analysisService/service/impl/SessionTimeLocalServiceImpl.java
View file @
6966e8b7
...
...
@@ -61,12 +61,8 @@ public class SessionTimeLocalServiceImpl extends SessionTimeLocalServiceBaseImpl
/**
* groupID : String : ID of the portal. Used to track the session length.
* buttonID : String : Used to keep track of clicks on the button based on ID
* ButtonPositions : ENUM : FIRST - LAST - MIDDLE
* sessionID : If it's the first click, send default sessionID - 0
* returns the sessionID after logging the click
*/
public
long
trackClick
(
String
groupID
,
String
buttonID
,
ButtonPositions
position
,
long
sessionID
){
DateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd HH:mm:ss.S"
);
public
void
trackClick
(
String
groupID
,
String
buttonID
){
ClickCount
trackClickObject
;
if
(
ClickCountLocalServiceUtil
.
fetchClickCount
(
new
ClickCountPK
(
groupID
,
buttonID
))==
null
){
trackClickObject
=
ClickCountLocalServiceUtil
.
createClickCount
(
new
ClickCountPK
(
groupID
,
buttonID
));
...
...
@@ -77,8 +73,17 @@ public class SessionTimeLocalServiceImpl extends SessionTimeLocalServiceBaseImpl
}
ClickCountLocalServiceUtil
.
updateClickCount
(
trackClickObject
);
}
/**
* groupID : String : ID of the portal. Used to track the session length
* ButtonPositions : ENUM : FIRST - LAST - MIDDLE
* sessionID : If it's the first click, send default sessionID - 0
* returns the sessionID after logging the click
*/
public
long
trackClickSession
(
String
groupID
,
ButtonPositions
position
,
long
sessionID
){
//Create date object with format : yyyy/MM/dd HH:mm:ss.S
DateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd HH:mm:ss.S"
);
DateFormat
df
=
DateFormat
.
getDateInstance
();
Date
timeNow
=
new
Date
();
try
{
...
...
Write
Preview
Supports
Markdown
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