Subversion Repositories SmartDukaan

Rev

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

Rev 1534 Rev 1849
Line 64... Line 64...
64
	private long windowSize = 20;
64
	private long windowSize = 20;
65
	private long page = 1;
65
	private long page = 1;
66
	private long totalResults;
66
	private long totalResults;
67
	private long beginIndex = 0;
67
	private long beginIndex = 0;
68
	private String url;
68
	private String url;
69
	private String priceUrl;
-
 
70
 
69
 
71
	/**
70
	/**
72
	 * GET /abc/10004
71
	 * GET /abc/10004
73
	 * 
72
	 * 
74
	 */
73
	 */
Line 121... Line 120...
121
    	String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution" 	};
120
    	String[] facetLabels = new String[] {"Category","Price", "Brand", "Data Connectivity", "Camera Resolution" 	};
122
 
121
 
123
    	String[] fqrys = this.request.getParameterValues("fq");
122
    	String[] fqrys = this.request.getParameterValues("fq");
124
 
123
 
125
    	url = "?";
124
    	url = "?";
126
    	
-
 
127
    	
-
 
128
    	    	
125
    	    	
129
    	query = "*";
126
    	query = "*";
130
    	
127
    	
131
    	int length = 1;
128
    	int length = 1;
132
    	
129
    	
133
    	if(fqrys!= null){
130
    	if(fqrys!= null){
134
    		length += fqrys.length;
131
    		length += fqrys.length;
135
    	}
132
    	}
136
    	
133
    	
137
    	
-
 
138
    	String[] newfqrys = new String[length];
134
    	String[] newfqrys = new String[length];
139
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId() == ROOT_CATEGORY){
135
    	if(CategoryManager.getCategoryManager().getCategory(Long.parseLong(id)).getParentCategoryId() == ROOT_CATEGORY){
140
    		newfqrys[0] = "F_50010:"+categoryName;
136
    		newfqrys[0] = "F_50010:"+categoryName;
141
    	}else{
137
    	}else{
142
    		newfqrys[0] = "F_50011:"+categoryName;
138
    		newfqrys[0] = "F_50011:"+categoryName;
Line 147... Line 143...
147
    	this.crumbs = new ArrayList<String[]>();
143
    	this.crumbs = new ArrayList<String[]>();
148
    	List<String> arrList = Arrays.asList(facetDefIDs);
144
    	List<String> arrList = Arrays.asList(facetDefIDs);
149
    	for(int i=1; i<length; i++) {
145
    	for(int i=1; i<length; i++) {
150
    		newfqrys[i] = fqrys[i-1];
146
    		newfqrys[i] = fqrys[i-1];
151
    		urlCrumb += "&fq=" + URLEncoder.encode(fqrys[i-1], "UTF-8");
147
    		urlCrumb += "&fq=" + URLEncoder.encode(fqrys[i-1], "UTF-8");
152
    		priceUrl += "&fq=" + URLEncoder.encode(fqrys[i-1], "UTF-8");
-
 
153
    		String filterUrl = url;
148
    		String filterUrl = url;
154
    		String facetName = StringUtils.split(fqrys[i-1], ":")[0];
149
    		String facetName = StringUtils.split(fqrys[i-1], ":")[0];
155
    		String facetValue = StringUtils.split(fqrys[i-1], ":")[1];
150
    		String facetValue = StringUtils.split(fqrys[i-1], ":")[1];
156
    		String facetLabel = facetLabels[arrList.indexOf(facetName)];
151
    		String facetLabel = facetLabels[arrList.indexOf(facetName)];
157
    		this.categoryTitle += " | " + facetLabel + " " + facetValue;
152
    		this.categoryTitle += " | " + facetLabel + " " + facetValue;
Line 289... Line 284...
289
    
284
    
290
    public String getUrl(){
285
    public String getUrl(){
291
    	return this.url;
286
    	return this.url;
292
    }
287
    }
293
 
288
 
294
    public String getPriceUrl(){
-
 
295
    	return this.priceUrl;
-
 
296
    }
-
 
297
    
-
 
298
	public long getBeginIndex(){
289
	public long getBeginIndex(){
299
		if(totalResults>0)
290
		if(totalResults>0)
300
			return beginIndex+1;
291
			return beginIndex+1;
301
		return beginIndex;
292
		return beginIndex;
302
	}
293
	}