Subversion Repositories SmartDukaan

Rev

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

Rev 5266 Rev 5347
Line 91... Line 91...
91
    	String productName = "";
91
    	String productName = "";
92
    	String categoryName = "";
92
    	String categoryName = "";
93
    	String categoryUrl = "";
93
    	String categoryUrl = "";
94
    	String displayAccessories = "FALSE";
94
    	String displayAccessories = "FALSE";
95
    	String breadCrumb = "";
95
    	String breadCrumb = "";
-
 
96
    	String parentCategory = "";
96
    	try {
97
    	try {
97
    	    setSnippets();
98
    	    setSnippets();
98
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
99
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
99
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
100
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
100
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
101
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
Line 104... Line 105...
104
    	    productName = productPropertiesInJson.getString("name");
105
    	    productName = productPropertiesInJson.getString("name");
105
    	    categoryName = productPropertiesInJson.getString("categoryName");
106
    	    categoryName = productPropertiesInJson.getString("categoryName");
106
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
107
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
107
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
108
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
108
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
109
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
-
 
110
    	    parentCategory = productPropertiesInJson.getString("parentCategory");
109
    	}
111
    	}
110
    	catch (JSONException e) {
112
    	catch (JSONException e) {
111
            log.warn("Unable to parse product properties JSON", e);
113
            log.warn("Unable to parse product properties JSON", e);
112
            try {
114
            try {
113
                CatalogClient catalogClientService = new CatalogClient();
115
                CatalogClient catalogClientService = new CatalogClient();
Line 142... Line 144...
142
		htmlSnippets.put("SLIDE_GUIDE", snippets.get(PRODUCT_SLIDEGUIDE_KEY));
144
		htmlSnippets.put("SLIDE_GUIDE", snippets.get(PRODUCT_SLIDEGUIDE_KEY));
143
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
145
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
144
		htmlSnippets.put("PAGE_METADESC", metaDescription);
146
		htmlSnippets.put("PAGE_METADESC", metaDescription);
145
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
147
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
146
		htmlSnippets.put("BREADCRUMB", breadCrumb);
148
		htmlSnippets.put("BREADCRUMB", breadCrumb);
-
 
149
		htmlSnippets.put("PARENT_CATEGORY", parentCategory);
147
		
150
		
148
		if(displayAccessories.equals("TRUE")){
151
		if(displayAccessories.equals("TRUE")){
149
			setMobile(true);
152
			setMobile(true);
150
		}
153
		}
151
		
154
		
Line 216... Line 219...
216
	}
219
	}
217
	
220
	
218
	public String getProductName()	{
221
	public String getProductName()	{
219
		return htmlSnippets.get("PRODUCT_NAME");
222
		return htmlSnippets.get("PRODUCT_NAME");
220
	}
223
	}
-
 
224
	
-
 
225
	public String getParentCategory(){
-
 
226
		return htmlSnippets.get("PARENT_CATEGORY");
-
 
227
	}
-
 
228
	
-
 
229
	public String getParentCategoryLowerCase(){
-
 
230
		String parentCategory = htmlSnippets.get("PARENT_CATEGORY");
-
 
231
		return parentCategory.substring(0,parentCategory.length()-1).toLowerCase();
-
 
232
	}
221
 
233
 
222
	public String getCategoryName()	{
234
	public String getCategoryName()	{
223
		return htmlSnippets.get("CATEGORY_NAME");
235
		return htmlSnippets.get("CATEGORY_NAME");
224
	}
236
	}
225
	
237