Subversion Repositories SmartDukaan

Rev

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

Rev 1643 Rev 1703
Line 60... Line 60...
60
				boolean isNew = client.updateMyResearch(userinfo.getUserId(), entity_id);
60
				boolean isNew = client.updateMyResearch(userinfo.getUserId(), entity_id);
61
				if(isNew){
61
				if(isNew){
62
					htmlSnippet = htmlSnippet + FileUtils.read( Utils.EXPORT_ENTITIES_PATH + entity_id + File.separator +"WidgetSnippet.html");
62
					htmlSnippet = htmlSnippet + FileUtils.read( Utils.EXPORT_ENTITIES_PATH + entity_id + File.separator +"WidgetSnippet.html");
63
				}
63
				}
64
			}
64
			}
65
			if (this.request.getParameter("historyitems") != null) {
-
 
66
				String historyItems = this.request.getParameter("productid");
-
 
67
				updateHistory(historyItems);
-
 
68
			}
-
 
69
 
-
 
70
		}
65
		}
71
		return "success";
66
		return "success";
72
	}
67
	}
73
	
68
	
74
	@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
69
	@Action(value="deletefromresearch",interceptorRefs={@InterceptorRef("createuser"),@InterceptorRef("myDefault")})
Line 100... Line 95...
100
		} catch (Exception e) {
95
		} catch (Exception e) {
101
			e.printStackTrace();
96
			e.printStackTrace();
102
		}
97
		}
103
	}
98
	}
104
	
99
	
105
	private void updateHistory(String historyItems) {
-
 
106
		UserContextServiceClient userServiceClient;
-
 
107
		try {
-
 
108
			userServiceClient = new UserContextServiceClient();
-
 
109
			UserContextService.Client userClient = userServiceClient.getClient();
-
 
110
			StringTokenizer tokenizer = new StringTokenizer(historyItems, "_");
-
 
111
		
100
	
112
			while (tokenizer.hasMoreTokens()) {
-
 
113
				long itemId = Long.parseLong(tokenizer.nextToken());
-
 
114
				userClient.updateBrowseHistory(userinfo.getUserId(), itemId);
-
 
115
			}	
-
 
116
		} catch (Exception e) {
-
 
117
			e.printStackTrace();
-
 
118
		}
-
 
119
	}
-
 
120
 
-
 
121
 
-
 
122
	public String getHtmlSnippet(){
101
	public String getHtmlSnippet(){
123
		if(htmlSnippet == "")	{
102
		if(htmlSnippet == "")	{
124
			htmlSnippet = "0";
103
			htmlSnippet = "0";
125
		}
104
		}
126
		return htmlSnippet;
105
		return htmlSnippet;