Subversion Repositories SmartDukaan

Rev

Rev 637 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 637 Rev 650
Line 40... Line 40...
40
	/**
40
	/**
41
	 * 
41
	 * 
42
	 */
42
	 */
43
	private static Log log = LogFactory.getLog(SearchController.class);
43
	private static Log log = LogFactory.getLog(SearchController.class);
44
	
44
	
45
	private Map<String,String> htmlSnippets = new HashMap<String, String>();
-
 
46
	/**
-
 
47
	 * 
-
 
48
	 */
-
 
49
	private Map<String, String[]> results;
45
	private Map<String, String[]> results;
50
 
46
 
51
	/**
47
	/**
52
	 * 
48
	 * 
53
	 */
49
	 */
Line 82... Line 78...
82
	 * @throws UnsupportedEncodingException
78
	 * @throws UnsupportedEncodingException
83
	 */
79
	 */
84
    // GET /query
80
    // GET /query
85
    public HttpHeaders index() throws UnsupportedEncodingException {
81
    public HttpHeaders index() throws UnsupportedEncodingException {
86
    	
82
    	
87
    	// Something we need to figure out
-
 
88
    	
-
 
89
		htmlSnippets.put("HEADER", pageLoader.getHeaderHtml(userinfo.isLoggedIn(), userinfo.getNameOfUser()));
-
 
90
		htmlSnippets.put("MAIN_MENU", pageLoader.getMainMenuHtml());
-
 
91
		htmlSnippets.put("SEARCH_BAR", pageLoader.getSearchBarHtml(userinfo.getTotalItems(), 10000));
-
 
92
		htmlSnippets.put("CUSTOMER_SERVICE", pageLoader.getCustomerServiceHtml());
-
 
93
		htmlSnippets.put("MY_RESEARCH", pageLoader.getMyResearchHtml(userinfo.getUserId(), userinfo.isLoggedIn()));
-
 
94
		htmlSnippets.put("BROWSE_HISTORY", pageLoader.getBrowseHistoryHtml(userinfo.getUserId(), userinfo.isLoggedIn()));
-
 
95
		htmlSnippets.put("FOOTER",pageLoader.getFooterHtml());
-
 
96
		htmlSnippets.put("SEARCH_HEADER","");
-
 
97
		htmlSnippets.put("SEARCH_DETAILS","");
-
 
98
		
-
 
99
 
-
 
100
		log.info("this.request=" + this.request);
83
    	log.info("this.request=" + this.request);
101
    	
84
    	
102
    	//url = this.request.getRequestURL();
85
    	//url = this.request.getRequestURL();
103
		query = this.request.getParameter("q");
86
		query = this.request.getParameter("q");
104
		url = "q="+ URLEncoder.encode(query, "UTF-8");
87
		url = "q="+ URLEncoder.encode(query, "UTF-8");
105
 
88
 
Line 286... Line 269...
286
    
269
    
287
    public Double getMaxPrice() {
270
    public Double getMaxPrice() {
288
    	return this.maxPrice;
271
    	return this.maxPrice;
289
    }
272
    }
290
    
273
    
291
    /**
-
 
292
     * 
-
 
293
     * @return
-
 
294
     */
-
 
295
    public List<String[]> getCrumbs() {
274
    public List<String[]> getCrumbs() {
296
    	return this.crumbs;
275
    	return this.crumbs;
297
    }
276
    }
298
    
-
 
299
    /**
-
 
300
     * 
-
 
301
     */
-
 
302
    
-
 
303
    public String getHeaderSnippet(){
-
 
304
		return htmlSnippets.get("HEADER");
-
 
305
	}
-
 
306
	
-
 
307
	public String getMainMenuSnippet(){
-
 
308
		return htmlSnippets.get("MAIN_MENU");
-
 
309
	}
-
 
310
	
-
 
311
	public String getSearchBarSnippet(){
-
 
312
		return htmlSnippets.get("SEARCH_BAR");
-
 
313
	}
-
 
314
			
-
 
315
	public String getCustomerServiceSnippet(){
-
 
316
		return htmlSnippets.get("CUSTOMER_SERVICE");
-
 
317
	}
-
 
318
	
-
 
319
	public String getSearchHeaderSnippet(){
-
 
320
		return htmlSnippets.get("SEARCH_HEADER");
-
 
321
	}
-
 
322
	
-
 
323
	public String getSearchDetailsSnippet(){
-
 
324
		return htmlSnippets.get("SEARCH_DETAILS");
-
 
325
	}
-
 
326
	
-
 
327
	public String getMyResearchSnippet(){
-
 
328
		return htmlSnippets.get("MY_RESEARCH");
-
 
329
	}
-
 
330
 
277
 
331
	public String getBrowseHistorySnippet(){
-
 
332
		return htmlSnippets.get("BROWSE_HISTORY");
-
 
333
	}
-
 
334
	
-
 
335
	public String getFooterSnippet(){
-
 
336
		return htmlSnippets.get("FOOTER");
-
 
337
	}
-
 
338
	
-
 
339
	public String getJsFileSnippet(){
-
 
340
		return htmlSnippets.get("JS_FILES");
-
 
341
	}
-
 
342
	
-
 
343
	public String getCssFileSnippet(){
-
 
344
		return htmlSnippets.get("CSS_FILES");
-
 
345
	}
-
 
346
}
278
}