Subversion Repositories SmartDukaan

Rev

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

Rev 2961 Rev 2982
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.datalogger.EventType;
4
import in.shop2020.model.v1.user.UserContextService.Client;
4
import in.shop2020.model.v1.user.UserContextService.Client;
5
import in.shop2020.model.v1.user.Widget;
-
 
6
import in.shop2020.model.v1.user.WidgetException;
5
import in.shop2020.model.v1.user.WidgetException;
7
import in.shop2020.model.v1.user.WidgetItem;
-
 
8
import in.shop2020.serving.utils.FileUtils;
6
import in.shop2020.serving.utils.FileUtils;
9
import in.shop2020.serving.utils.Utils;
7
import in.shop2020.serving.utils.Utils;
10
import in.shop2020.thrift.clients.UserContextServiceClient;
8
import in.shop2020.thrift.clients.UserContextServiceClient;
11
import in.shop2020.utils.DataLogger;
9
import in.shop2020.utils.DataLogger;
12
 
10
 
Line 54... Line 52...
54
 
52
 
55
	@Action(value="myresearch",interceptorRefs={@InterceptorRef("myDefault")})
53
	@Action(value="myresearch",interceptorRefs={@InterceptorRef("myDefault")})
56
	public String index() {
54
	public String index() {
57
	    try {
55
	    try {
58
	        JSONArray itemsJson =  new JSONArray();
56
	        JSONArray itemsJson =  new JSONArray();
59
            Widget resWidget = client.getMyResearch(userinfo.getUserId());
57
            List<Long> widgetItemIds = client.getMyResearchItems(userinfo.getUserId());
60
            List<WidgetItem> widgetItems = resWidget.getItems();
-
 
61
            for (WidgetItem wItem : widgetItems) {
58
            for (Long itemId : widgetItemIds) {
62
                itemsJson.put(wItem.getItem_id());
59
                itemsJson.put(itemId);
63
            }
60
            }
64
            itemsInJson = itemsJson.toString();
61
            itemsInJson = itemsJson.toString();
65
        } catch (WidgetException e) {
62
        } catch (WidgetException e) {
66
            log.error("Unable to get the myresearch widget", e);
63
            log.error("Unable to get the myresearch widget", e);
67
        } catch (TException e) {
64
        } catch (TException e) {