Subversion Repositories SmartDukaan

Rev

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

Rev 9840 Rev 10190
Line 96... Line 96...
96
    	String categoryUrl = "";
96
    	String categoryUrl = "";
97
    	String displayAccessories = "FALSE";
97
    	String displayAccessories = "FALSE";
98
    	String breadCrumb = "";
98
    	String breadCrumb = "";
99
    	String parentCategory = "";
99
    	String parentCategory = "";
100
    	String compareCategory = "";
100
    	String compareCategory = "";
-
 
101
    	String isComparable = "false";
101
    	try {
102
    	try {
102
    	    setSnippets();
103
    	    setSnippets();
103
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
104
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
104
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
105
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
105
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
106
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
Line 110... Line 111...
110
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
111
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
111
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
112
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
112
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
113
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
113
    	    parentCategory = productPropertiesInJson.getString("parentCategory");
114
    	    parentCategory = productPropertiesInJson.getString("parentCategory");
114
    	    compareCategory = productPropertiesInJson.getString("compareCategory");
115
    	    compareCategory = productPropertiesInJson.getString("compareCategory");
-
 
116
    	    isComparable = productPropertiesInJson.getString("isComparable");
115
    	}
117
    	}
116
    	catch (JSONException e) {
118
    	catch (JSONException e) {
117
            log.warn("Unable to parse product properties JSON", e);
119
            log.warn("Unable to parse product properties JSON", e);
118
            try {
120
            try {
119
                CatalogClient catalogClientService = new CatalogClient();
121
                CatalogClient catalogClientService = new CatalogClient();
Line 149... Line 151...
149
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
151
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
150
		htmlSnippets.put("PAGE_METADESC", metaDescription);
152
		htmlSnippets.put("PAGE_METADESC", metaDescription);
151
		htmlSnippets.put("BREADCRUMB", breadCrumb);
153
		htmlSnippets.put("BREADCRUMB", breadCrumb);
152
		htmlSnippets.put("PARENT_CATEGORY", parentCategory);
154
		htmlSnippets.put("PARENT_CATEGORY", parentCategory);
153
		htmlSnippets.put("COMPARE_CATEGORY", compareCategory);
155
		htmlSnippets.put("COMPARE_CATEGORY", compareCategory);
-
 
156
		htmlSnippets.put("IS_COMPARABLE", isComparable);
154
		
157
		
155
		if(displayAccessories.equals("TRUE")){
158
		if(displayAccessories.equals("TRUE")){
156
			setMobile(true);
159
			setMobile(true);
157
		}
160
		}
158
		
161
		
Line 247... Line 250...
247
	}
250
	}
248
 
251
 
249
	public String getBreadCrumb(){
252
	public String getBreadCrumb(){
250
		return htmlSnippets.get("BREADCRUMB");
253
		return htmlSnippets.get("BREADCRUMB");
251
	}
254
	}
-
 
255
 
-
 
256
	public String isComparable(){
-
 
257
		return htmlSnippets.get("IS_COMPARABLE");
-
 
258
	}
252
	
259
	
253
	/**
260
	/**
254
	 * @param isMobile the isMobile to set
261
	 * @param isMobile the isMobile to set
255
	 */
262
	 */
256
	public void setMobile(boolean isMobile) {
263
	public void setMobile(boolean isMobile) {
Line 293... Line 300...
293
    	try {
300
    	try {
294
    		LogisticsClient cl = new LogisticsClient();
301
    		LogisticsClient cl = new LogisticsClient();
295
            LogisticsService.Client client = cl.getClient();
302
            LogisticsService.Client client = cl.getClient();
296
            itemTexts = client.getEntityLogisticsEstimation(productId, DEFAULT_PINCODE, DeliveryType.PREPAID );
303
            itemTexts = client.getEntityLogisticsEstimation(productId, DEFAULT_PINCODE, DeliveryType.PREPAID );
297
        } catch (Exception e1) {
304
        } catch (Exception e1) {
298
            log.error("Unable to get items by catalog item id", e1);
305
            log.error("Unable to get items for productId: "+  productId, e1);
299
        }
306
        }
300
        List<Long> items = new ArrayList<Long>();
307
        List<Long> items = new ArrayList<Long>();
301
        for(ItemText itemText : itemTexts) {
308
        for(ItemText itemText : itemTexts) {
302
        	items.add(itemText.getItemId());
309
        	items.add(itemText.getItemId());
303
        }
310
        }