Subversion Repositories SmartDukaan

Rev

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

Rev 2070 Rev 2306
Line 36... Line 36...
36
	
36
	
37
	private static final long serialVersionUID = 8477108528765030321L;
37
	private static final long serialVersionUID = 8477108528765030321L;
38
 
38
 
39
	private static Logger log = Logger.getLogger(Class.class);
39
	private static Logger log = Logger.getLogger(Class.class);
40
 
40
 
41
	private static long ROOT_CATEGORY = 10000;
-
 
42
	private static long MOBILE_PHONES_CATEGORY = 10001;
-
 
43
	private static long MOBILE_ACCESSORIES_CATEGORY = 10011;
-
 
44
	
-
 
45
	private List<String> results;
41
	private List<String> results;
46
	private Map<String, String> snippets;
42
	private Map<String, String> snippets;
47
	private Map<String, List<String[]>> facets;
43
	private Map<String, List<String[]>> facets;
48
	private List<String[]> crumbs;
44
	private List<String[]> crumbs;
49
	/**
45
	/**
Line 106... Line 102...
106
    public HttpHeaders show() throws SecurityException, IOException {
102
    public HttpHeaders show() throws SecurityException, IOException {
107
    	log.info("id=" + id);
103
    	log.info("id=" + id);
108
    	long categoryId = Long.parseLong(id);
104
    	long categoryId = Long.parseLong(id);
109
    	this.categoryName = CategoryManager.getCategoryManager().getCategoryLabel(categoryId);
105
    	this.categoryName = CategoryManager.getCategoryManager().getCategoryLabel(categoryId);
110
    	
106
    	
111
    	if( categoryId == MOBILE_PHONES_CATEGORY || categoryId == MOBILE_ACCESSORIES_CATEGORY ){
107
    	if( categoryId == Utils.MOBILE_PHONES_CATEGORY || categoryId == Utils.MOBILE_ACCESSORIES_CATEGORY ){
112
    		this.categoryTitle = "Mobile Price List India" + " | " + this.categoryName;
108
    		this.categoryTitle = "Mobile Price List India" + " | " + this.categoryName;
113
    	}else{
109
    	}else{
114
    		this.categoryTitle = this.categoryName.replace("Phones", "Mobile Phones");
110
    		this.categoryTitle = this.categoryName.replace("Phones", "Mobile Phones");
115
    	}
111
    	}
116
    	
112
    	
Line 131... Line 127...
131
    	if(fqrys!= null){
127
    	if(fqrys!= null){
132
    		length += fqrys.length;
128
    		length += fqrys.length;
133
    	}
129
    	}
134
    	
130
    	
135
    	String[] newfqrys = new String[length];
131
    	String[] newfqrys = new String[length];
136
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id() == ROOT_CATEGORY){
132
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id() == Utils.ROOT_CATEGORY){
137
    		newfqrys[0] = "F_50010:"+categoryName;
133
    		newfqrys[0] = "F_50010:"+categoryName;
138
    	}else{
134
    	}else{
139
    		newfqrys[0] = "F_50011:"+categoryName;
135
    		newfqrys[0] = "F_50011:"+categoryName;
140
    	}
136
    	}
141
    	
137
    	
Line 179... Line 175...
179
    		url= url + "&max-price=" + this.request.getParameter("max-price");
175
    		url= url + "&max-price=" + this.request.getParameter("max-price");
180
    	}    	
176
    	}    	
181
 
177
 
182
    	query = query + "&sort=F_50002+asc";
178
    	query = query + "&sort=F_50002+asc";
183
    	
179
    	
184
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, ROOT_CATEGORY, null);
180
    	SolrSearchService search = new SolrSearchService(query, newfqrys, facetDefIDs, (page-1)*windowSize, windowSize, minPrice, maxPrice, Utils.ROOT_CATEGORY, null);
185
    	this.results =  search.getResultMap(); 
181
    	this.results =  search.getResultMap(); 
186
 
182
 
187
    	
183
    	
188
    	this.facets = new LinkedHashMap<String, List<String[]>>();
184
    	this.facets = new LinkedHashMap<String, List<String[]>>();
189
    	String qryString = this.request.getQueryString();
185
    	String qryString = this.request.getQueryString();
Line 256... Line 252...
256
                        .replaceAll("Phones", "mobile phones")
252
                        .replaceAll("Phones", "mobile phones")
257
                + " in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
253
                + " in India. Experience n' buy online. FREE Next Day delivery. Original product - Full manufacturer warranty. Comprehensive reviews."; 
258
    }
254
    }
259
    
255
    
260
    public String getPageMetaKeywords() {
256
    public String getPageMetaKeywords() {
261
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id()== MOBILE_PHONES_CATEGORY){
257
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id()== Utils.MOBILE_PHONES_CATEGORY){
262
        	return this.categoryName + ", mobile phone";
258
        	return this.categoryName + ", mobile phone";
263
    	}
259
    	}
264
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id()== MOBILE_ACCESSORIES_CATEGORY){
260
        if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParent_category_id()== Utils.MOBILE_ACCESSORIES_CATEGORY){
265
        	return this.categoryName + ", phone accessories";
261
        	return this.categoryName + ", phone accessories";
266
    	}
262
    	}
267
        return "";
263
        return "";
268
    }
264
    }
269
    
265