Subversion Repositories SmartDukaan

Rev

Rev 2145 | Rev 2183 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2145 Rev 2157
Line 33... Line 33...
33
public class MyresearchController extends BaseController {
33
public class MyresearchController extends BaseController {
34
 
34
 
35
    private UserContextServiceClient userServiceClient = null;
35
    private UserContextServiceClient userServiceClient = null;
36
	private Client client;
36
	private Client client;
37
    private static Logger log = Logger.getLogger(MyresearchController.class);
37
    private static Logger log = Logger.getLogger(MyresearchController.class);
38
    private static Logger dataLog = DataLogger.getLogger();
-
 
39
    private String htmlSnippet = "";
38
    private String htmlSnippet = "";
40
    private String snippets="";
39
    private String snippets="";
41
    private List<String> items;
40
    private List<String> items;
42
    private String itemsInJson;
41
    private String itemsInJson;
43
    private int totalItems = 0;
42
    private int totalItems = 0;
Line 105... Line 104...
105
	                    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");
106
	                }
105
	                }
107
	                catch (IOException e) {
106
	                catch (IOException e) {
108
	                    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");
109
	                }
108
	                }
110
                    dataLog.info(StringUtils.join(
-
 
111
                            new String[] { Event.RESEARCH_ADD.name(),
-
 
112
                                    StringUtils.join(items, "_") }, ", "));
109
                    DataLogger.logData(Event.RESEARCH_ADD.name(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
113
                }
110
                }
114
	        }
111
	        }
115
		}
112
		}
116
		return "success";
113
		return "success";
117
	}
114
	}
Line 119... Line 116...
119
	@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
116
	@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
120
	public String destroy(){
117
	public String destroy(){
121
		for (String item : items){
118
		for (String item : items){
122
			long itemId = Long.parseLong(item);
119
			long itemId = Long.parseLong(item);
123
			deleteFromMyResearch(userinfo.getUserId(), itemId);
120
			deleteFromMyResearch(userinfo.getUserId(), itemId);
124
			dataLog.info(StringUtils.join(
-
 
125
                    new String[] { Event.RESEARCH_DELETE.name(),
-
 
126
                            StringUtils.join(items, "_") }, ", "));
121
			DataLogger.logData(Event.RESEARCH_DELETE.name(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), StringUtils.join(items, "_"));
127
		}
122
		}
128
		return "success";
123
		return "success";
129
	}
124
	}
130
	
125
	
131
	private void deleteFromMyResearch(long userId, long itemId) {
126
	private void deleteFromMyResearch(long userId, long itemId) {