| Line 2... |
Line 2... |
| 2 |
*
|
2 |
*
|
| 3 |
*/
|
3 |
*/
|
| 4 |
package in.shop2020.serving.controllers;
|
4 |
package in.shop2020.serving.controllers;
|
| 5 |
|
5 |
|
| 6 |
|
6 |
|
| - |
|
7 |
import in.shop2020.datalogger.EventType;
|
| 7 |
import in.shop2020.model.v1.user.Sex;
|
8 |
import in.shop2020.model.v1.user.Sex;
|
| 8 |
import in.shop2020.model.v1.user.User;
|
9 |
import in.shop2020.model.v1.user.User;
|
| 9 |
import in.shop2020.model.v1.user.Widget;
|
10 |
import in.shop2020.model.v1.user.Widget;
|
| 10 |
import in.shop2020.model.v1.user.WidgetItem;
|
11 |
import in.shop2020.model.v1.user.WidgetItem;
|
| 11 |
import in.shop2020.serving.interceptors.TrackingInterceptor;
|
12 |
import in.shop2020.serving.interceptors.TrackingInterceptor;
|
| 12 |
import in.shop2020.serving.utils.DataLogger;
|
13 |
import in.shop2020.serving.utils.DataLogger;
|
| 13 |
import in.shop2020.serving.utils.DesEncrypter;
|
14 |
import in.shop2020.serving.utils.DesEncrypter;
|
| 14 |
import in.shop2020.serving.utils.DataLogger.Event;
|
- |
|
| 15 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
15 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 16 |
|
16 |
|
| 17 |
import java.io.IOException;
|
17 |
import java.io.IOException;
|
| 18 |
import java.util.Date;
|
18 |
import java.util.Date;
|
| 19 |
import java.util.List;
|
19 |
import java.util.List;
|
| Line 94... |
Line 94... |
| 94 |
addActionError("Please enter Communication email.");
|
94 |
addActionError("Please enter Communication email.");
|
| 95 |
isValid = false;
|
95 |
isValid = false;
|
| 96 |
}
|
96 |
}
|
| 97 |
|
97 |
|
| 98 |
if(!isValid){
|
98 |
if(!isValid){
|
| 99 |
DataLogger.logData(Event.REGISTER_DATA_INCOMPLETE.name(), session.getId(), email, userName, communicationEmail);
|
99 |
DataLogger.logData(EventType.REGISTER_DATA_INCOMPLETE.name(), session.getId(), Long.toString(userinfo.getUserId()), email, userName, communicationEmail);
|
| 100 |
return isValid;
|
100 |
return isValid;
|
| 101 |
}
|
101 |
}
|
| 102 |
|
102 |
|
| 103 |
UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
|
103 |
UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
|
| 104 |
in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
|
104 |
in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
|
| 105 |
|
105 |
|
| 106 |
if(userClient.userExists(email)){
|
106 |
if(userClient.userExists(email)){
|
| 107 |
addActionError("User already exists with this email id.");
|
107 |
addActionError("User already exists with this email id.");
|
| 108 |
DataLogger.logData(Event.REGISTER_FAILED_USER_EXISTS.name(), session.getId(), email, userName, communicationEmail);
|
108 |
DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS.name(), session.getId(), Long.toString(userinfo.getUserId()), email, userName, communicationEmail);
|
| 109 |
return false;
|
109 |
return false;
|
| 110 |
}
|
110 |
}
|
| 111 |
|
111 |
|
| 112 |
User user = new User();
|
112 |
User user = new User();
|
| 113 |
user.setName(userName);
|
113 |
user.setName(userName);
|
| Line 178... |
Line 178... |
| 178 |
userinfo.setTotalItems(totalItems);
|
178 |
userinfo.setTotalItems(totalItems);
|
| 179 |
if (cookiesMap.containsKey(TrackingInterceptor.AFF_COOKIE)) {
|
179 |
if (cookiesMap.containsKey(TrackingInterceptor.AFF_COOKIE)) {
|
| 180 |
long affId = Long.parseLong(cookiesMap.get(TrackingInterceptor.AFF_COOKIE).getValue());
|
180 |
long affId = Long.parseLong(cookiesMap.get(TrackingInterceptor.AFF_COOKIE).getValue());
|
| 181 |
userClient.addTrackLog(affId, userId, "new registration", "",email, (new Date()).getTime());
|
181 |
userClient.addTrackLog(affId, userId, "new registration", "",email, (new Date()).getTime());
|
| 182 |
}
|
182 |
}
|
| 183 |
DataLogger.logData(Event.REGISTER_SUCCESS.name(), session.getId(), email, userName, communicationEmail);
|
183 |
DataLogger.logData(EventType.REGISTER_SUCCESS.name(), session.getId(), Long.toString(userinfo.getUserId()), email, userName, communicationEmail);
|
| 184 |
|
184 |
|
| 185 |
return true;
|
185 |
return true;
|
| 186 |
}
|
186 |
}
|
| 187 |
|
187 |
|
| 188 |
public String getRegistrationHeaderSnippet(){
|
188 |
public String getRegistrationHeaderSnippet(){
|