Subversion Repositories SmartDukaan

Rev

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

Rev 3715 Rev 3830
Line 73... Line 73...
73
    	String entityUrl = "";
73
    	String entityUrl = "";
74
    	String metaKeywords = "";
74
    	String metaKeywords = "";
75
    	String metaDescription = "";
75
    	String metaDescription = "";
76
    	String pageTitle = "";
76
    	String pageTitle = "";
77
    	String productName = "";
77
    	String productName = "";
-
 
78
    	String categoryName = "";
-
 
79
    	String categoryUrl = "";
78
    	String displayAccessories = "FALSE";
80
    	String displayAccessories = "FALSE";
-
 
81
    	String breadCrumb = "";
79
    	try {
82
    	try {
80
    	    setSnippets();
83
    	    setSnippets();
81
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
84
            htmlSnippets.put("PRODUCT_PROPERTIES", snippets.get(PRODUCT_PROERTIES_SNIPPET_KEY));
82
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
85
    	    JSONObject productPropertiesInJson = new JSONObject(htmlSnippets.get("PRODUCT_PROPERTIES"));
83
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
86
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
84
    	    metaDescription = productPropertiesInJson.getString("metaDescription");
87
    	    metaDescription = productPropertiesInJson.getString("metaDescription");
85
    	    metaKeywords = productPropertiesInJson.getString("metaKeywords");
88
    	    metaKeywords = productPropertiesInJson.getString("metaKeywords");
86
    	    pageTitle = productPropertiesInJson.getString("title");
89
    	    pageTitle = productPropertiesInJson.getString("title");
87
    	    productName = productPropertiesInJson.getString("name");
90
    	    productName = productPropertiesInJson.getString("name");
-
 
91
    	    categoryName = productPropertiesInJson.getString("categoryName");
-
 
92
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
88
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
93
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
-
 
94
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
89
    	}
95
    	}
90
    	catch (JSONException e) {
96
    	catch (JSONException e) {
91
            log.error("Unable to parse product properties JSON", e);
97
            log.error("Unable to parse product properties JSON", e);
92
            try {
98
            try {
93
                CatalogClient catalogClientService = new CatalogClient();
99
                CatalogClient catalogClientService = new CatalogClient();
Line 113... Line 119...
113
    	String rootUrl = currentUrl.split("/")[2];
119
    	String rootUrl = currentUrl.split("/")[2];
114
    	
120
    	
115
    	htmlSnippets.put("PRODUCT_SUMMARY", snippets.get(PRODUCT_SUMMARY_SNIPPET_KEY));
121
    	htmlSnippets.put("PRODUCT_SUMMARY", snippets.get(PRODUCT_SUMMARY_SNIPPET_KEY));
116
    	htmlSnippets.put("PRODUCT_ID", productId + "");
122
    	htmlSnippets.put("PRODUCT_ID", productId + "");
117
    	htmlSnippets.put("PRODUCT_NAME", productName);
123
    	htmlSnippets.put("PRODUCT_NAME", productName);
-
 
124
    	htmlSnippets.put("CATEGORY_NAME", categoryName);
-
 
125
    	htmlSnippets.put("CATEGORY_URL", categoryUrl);
118
    	htmlSnippets.put("PRODUCT_URL", currentUrl);
126
    	htmlSnippets.put("PRODUCT_URL", currentUrl);
119
    	htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
127
    	htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
120
		htmlSnippets.put("SLIDE_GUIDE", snippets.get(PRODUCT_SLIDEGUIDE_KEY));
128
		htmlSnippets.put("SLIDE_GUIDE", snippets.get(PRODUCT_SLIDEGUIDE_KEY));
121
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
129
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
122
		htmlSnippets.put("PAGE_METADESC", metaDescription);
130
		htmlSnippets.put("PAGE_METADESC", metaDescription);
123
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
131
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
-
 
132
		htmlSnippets.put("BREADCRUMB", breadCrumb);
-
 
133
		
124
		if(displayAccessories.equals("TRUE")){
134
		if(displayAccessories.equals("TRUE")){
125
			setMobile(true);
135
			setMobile(true);
126
		}
136
		}
127
		
137
		
128
		try {
138
		try {
Line 186... Line 196...
186
	
196
	
187
	public String getProductName()	{
197
	public String getProductName()	{
188
		return htmlSnippets.get("PRODUCT_NAME");
198
		return htmlSnippets.get("PRODUCT_NAME");
189
	}
199
	}
190
 
200
 
-
 
201
	public String getCategoryName()	{
-
 
202
		return htmlSnippets.get("CATEGORY_NAME");
-
 
203
	}
-
 
204
	
-
 
205
	public String getCategoryUrl()	{
-
 
206
		return htmlSnippets.get("CATEGORY_URL");
-
 
207
	}
-
 
208
	
191
	public String getProductId()	{
209
	public String getProductId()	{
192
		return htmlSnippets.get("PRODUCT_ID");
210
		return htmlSnippets.get("PRODUCT_ID");
193
	}
211
	}
194
	
212
	
195
	public String getProductUrl()	{
213
	public String getProductUrl()	{
Line 198... Line 216...
198
	
216
	
199
	public String getRootUrl()	{
217
	public String getRootUrl()	{
200
		return htmlSnippets.get("ROOT_URL");
218
		return htmlSnippets.get("ROOT_URL");
201
	}
219
	}
202
 
220
 
-
 
221
	public String getBreadCrumb(){
-
 
222
		return htmlSnippets.get("BREADCRUMB");
-
 
223
	}
-
 
224
	
203
	/**
225
	/**
204
	 * @param isMobile the isMobile to set
226
	 * @param isMobile the isMobile to set
205
	 */
227
	 */
206
	public void setMobile(boolean isMobile) {
228
	public void setMobile(boolean isMobile) {
207
		this.isMobile = isMobile;
229
		this.isMobile = isMobile;