Commit 6966e8b7 authored by Saurabh Narayan Singh's avatar Saurabh Narayan Singh
Browse files

separate methods trackClick trackClickSession

parent 3b19fcc0
......@@ -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 trackClickSession(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
......@@ -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() {
......
......@@ -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 trackClickSession(java.lang.String groupID,
analysisService.service.enums.ButtonPositions position, long sessionID) {
return _sessionTimeLocalService.trackClick(groupID, buttonID, position,
return _sessionTimeLocalService.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
*/
@Override
public void trackClick(java.lang.String groupID, java.lang.String buttonID) {
_sessionTimeLocalService.trackClick(groupID, buttonID);
}
@Override
public SessionTimeLocalService getWrappedService() {
return _sessionTimeLocalService;
......
......@@ -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{
......
Supports Markdown
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