Subversion Repositories SmartDukaan

Rev

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

Rev 620 Rev 627
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
6
import in.shop2020.model.v1.widgets.WidgetService.Client;
-
 
7
import in.shop2020.serving.pages.PageContentKeys;
-
 
8
import in.shop2020.serving.pages.PageEnum;
-
 
9
import in.shop2020.serving.services.CategoryManager;
6
import in.shop2020.serving.services.CategoryManager;
10
import in.shop2020.serving.services.PageLoaderHandler;
7
import in.shop2020.serving.services.PageLoaderHandler;
11
import in.shop2020.serving.services.SolrSearchService;
8
import in.shop2020.serving.services.SolrSearchService;
12
import in.shop2020.serving.utils.FileUtils;
9
import in.shop2020.serving.utils.FileUtils;
13
import in.shop2020.thrift.clients.WidgetServiceClient;
-
 
14
import in.shop2020.util.Utils;
10
import in.shop2020.util.Utils;
15
 
11
 
16
import java.io.File;
12
import java.io.File;
17
import java.io.IOException;
13
import java.io.IOException;
18
import java.net.URLEncoder;
14
import java.net.URLEncoder;
Line 207... Line 203...
207
    	}
203
    	}
208
    	this.totalResults = search.getTotalResults();
204
    	this.totalResults = search.getTotalResults();
209
        return new DefaultHttpHeaders("show");
205
        return new DefaultHttpHeaders("show");
210
    }
206
    }
211
    
207
    
212
    /**
-
 
213
     * 
-
 
214
     * @param id
-
 
215
     */
-
 
216
    public void setId(String id) {
208
    public void setId(String id) {
217
    	StringTokenizer tokenizer = new StringTokenizer(id,"-");
209
    	StringTokenizer tokenizer = new StringTokenizer(id,"-");
218
    	while(tokenizer.hasMoreTokens()){
210
    	while(tokenizer.hasMoreTokens()){
219
    		this.id = tokenizer.nextToken();
211
    		this.id = tokenizer.nextToken();
220
    	}
212
    	}
221
    }
213
    }
222
    
214
    
223
    /**
-
 
224
     * 
-
 
225
     */
-
 
226
    public String getId() {
215
    public String getId() {
227
    	return this.id;
216
    	return this.id;
228
    }
217
    }
229
    
218
    
230
    public String getCategoryName() {
219
    public String getCategoryName() {
Line 274... Line 263...
274
	
263
	
275
	public String getCssFileSnippet(){
264
	public String getCssFileSnippet(){
276
		return htmlSnippets.get("CSS_FILES");
265
		return htmlSnippets.get("CSS_FILES");
277
	}
266
	}
278
 
267
 
279
    /**
-
 
280
     * 
-
 
281
     * @return
-
 
282
     */
-
 
283
    public String getQuery() {
268
    public String getQuery() {
284
    	return this.query;
269
    	return this.query;
285
    }
270
    }
286
    
271
    
287
    
272
    
288
    /**
-
 
289
     * 
-
 
290
     * @return
-
 
291
     */
-
 
292
    public Map<String, String[]> getResults() {
273
    public Map<String, String[]> getResults() {
293
    	return this.results;
274
    	return this.results;
294
    }
275
    }
295
    
276
    
296
    /**
-
 
297
     * 
-
 
298
     * @return
-
 
299
     */
-
 
300
    public Map<String, List<String[]>> getFacets() {
277
    public Map<String, List<String[]>> getFacets() {
301
    	return this.facets;
278
    	return this.facets;
302
    }
279
    }
303
    
280
    
304
    
-
 
305
    public long getTotalResults(){
281
    public long getTotalResults(){
306
    	return totalResults;
282
    	return totalResults;
307
    }
283
    }
308
    
284
    
309
    public String getUrl(){
285
    public String getUrl(){
Line 334... Line 310...
334
    
310
    
335
    public Double getMaxPrice() {
311
    public Double getMaxPrice() {
336
    	return this.maxPrice;
312
    	return this.maxPrice;
337
    }
313
    }
338
    
314
    
-
 
315
    public List<String[]> getCrumbs() {
-
 
316
    	return this.crumbs;
-
 
317
    }
-
 
318
 
339
    public Map<String, String> getSnippets() throws Exception {
319
    public Map<String, String> getSnippets() throws Exception {
340
    	if(results != null){
320
    	if(results != null){
341
    		snippets = new HashMap<String, String>();	
321
    		snippets = new HashMap<String, String>();	
342
	    	for(String docId: results.keySet()){
322
	    	for(String docId: results.keySet()){
343
				snippets.put(docId, FileUtils.read( Utils.EXPORT_ENTITIES_PATH + docId + File.separator +"CategorySnippet.html"));
323
				snippets.put(docId, FileUtils.read( Utils.EXPORT_ENTITIES_PATH + docId + File.separator +"CategorySnippet.html"));