| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.controllers;
|
1 |
package in.shop2020.serving.controllers;
|
| 2 |
|
2 |
|
| - |
|
3 |
import in.shop2020.datalogger.EventType;
|
| 3 |
import in.shop2020.model.v1.user.Widget;
|
4 |
import in.shop2020.model.v1.user.Widget;
|
| 4 |
import in.shop2020.model.v1.user.WidgetException;
|
5 |
import in.shop2020.model.v1.user.WidgetException;
|
| 5 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
6 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 6 |
import in.shop2020.model.v1.user.WidgetItem;
|
7 |
import in.shop2020.model.v1.user.WidgetItem;
|
| 7 |
import in.shop2020.serving.utils.DataLogger;
|
8 |
import in.shop2020.serving.utils.DataLogger;
|
| 8 |
import in.shop2020.serving.utils.FileUtils;
|
9 |
import in.shop2020.serving.utils.FileUtils;
|
| 9 |
import in.shop2020.serving.utils.Utils;
|
10 |
import in.shop2020.serving.utils.Utils;
|
| 10 |
import in.shop2020.serving.utils.DataLogger.Event;
|
- |
|
| 11 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
11 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 12 |
|
12 |
|
| 13 |
import java.io.File;
|
13 |
import java.io.File;
|
| 14 |
import java.io.FileNotFoundException;
|
14 |
import java.io.FileNotFoundException;
|
| 15 |
import java.io.IOException;
|
15 |
import java.io.IOException;
|
| Line 104... |
Line 104... |
| 104 |
log.error("File not found : " + Utils.EXPORT_ENTITIES_PATH + itemId + File.separator +"WidgetSnippet.html");
|
104 |
log.error("File not found : " + Utils.EXPORT_ENTITIES_PATH + itemId + File.separator +"WidgetSnippet.html");
|
| 105 |
}
|
105 |
}
|
| 106 |
catch (IOException e) {
|
106 |
catch (IOException e) {
|
| 107 |
log.error("IO exception : " + Utils.EXPORT_ENTITIES_PATH + itemId + File.separator +"WidgetSnippet.html");
|
107 |
log.error("IO exception : " + Utils.EXPORT_ENTITIES_PATH + itemId + File.separator +"WidgetSnippet.html");
|
| 108 |
}
|
108 |
}
|
| 109 |
DataLogger.logData(Event.RESEARCH_ADD.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
|
109 |
DataLogger.logData(EventType.RESEARCH_ADD.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
|
| 110 |
}
|
110 |
}
|
| 111 |
}
|
111 |
}
|
| 112 |
}
|
112 |
}
|
| 113 |
return "success";
|
113 |
return "success";
|
| 114 |
}
|
114 |
}
|
| Line 116... |
Line 116... |
| 116 |
@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
|
116 |
@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
|
| 117 |
public String destroy(){
|
117 |
public String destroy(){
|
| 118 |
for (String item : items){
|
118 |
for (String item : items){
|
| 119 |
long itemId = Long.parseLong(item);
|
119 |
long itemId = Long.parseLong(item);
|
| 120 |
deleteFromMyResearch(userinfo.getUserId(), itemId);
|
120 |
deleteFromMyResearch(userinfo.getUserId(), itemId);
|
| 121 |
DataLogger.logData(Event.RESEARCH_DELETE.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
|
121 |
DataLogger.logData(EventType.RESEARCH_DELETE.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
|
| 122 |
}
|
122 |
}
|
| 123 |
return "success";
|
123 |
return "success";
|
| 124 |
}
|
124 |
}
|
| 125 |
|
125 |
|
| 126 |
private void deleteFromMyResearch(long userId, long itemId) {
|
126 |
private void deleteFromMyResearch(long userId, long itemId) {
|