Subversion Repositories SmartDukaan

Rev

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

Rev 2511 Rev 2652
Line 62... Line 62...
62
    	String entityUrl = "";
62
    	String entityUrl = "";
63
    	String metaKeywords = "";
63
    	String metaKeywords = "";
64
    	String metaDescription = "";
64
    	String metaDescription = "";
65
    	String pageTitle = "";
65
    	String pageTitle = "";
66
    	String productName = "";
66
    	String productName = "";
-
 
67
    	String displayAccessories = "FALSE";
67
    	try {
68
    	try {
68
    	    JSONObject productPropertiesInJson = new JSONObject(pageLoader.getProductPropertiesHtml(productId).trim());
69
    	    JSONObject productPropertiesInJson = new JSONObject(pageLoader.getProductPropertiesHtml(productId).trim());
69
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
70
    	    entityUrl = productPropertiesInJson.getString("entityUrl");
70
    	    metaDescription = productPropertiesInJson.getString("metaDescription");
71
    	    metaDescription = productPropertiesInJson.getString("metaDescription");
71
    	    metaKeywords = productPropertiesInJson.getString("metaKeywords");
72
    	    metaKeywords = productPropertiesInJson.getString("metaKeywords");
72
    	    pageTitle = productPropertiesInJson.getString("title");
73
    	    pageTitle = productPropertiesInJson.getString("title");
73
    	    productName = productPropertiesInJson.getString("name");
74
    	    productName = productPropertiesInJson.getString("name");
-
 
75
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
74
    	}
76
    	}
75
    	catch (JSONException e) {
77
    	catch (JSONException e) {
76
            e.printStackTrace();
78
            e.printStackTrace();
77
            try {
79
            try {
78
                CatalogServiceClient catalogClientService = new CatalogServiceClient();
80
                CatalogServiceClient catalogClientService = new CatalogServiceClient();
Line 104... Line 106...
104
    	htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
106
    	htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
105
		htmlSnippets.put("SLIDE_GUIDE", pageLoader.getSlideGuideHtml(productId));
107
		htmlSnippets.put("SLIDE_GUIDE", pageLoader.getSlideGuideHtml(productId));
106
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
108
		htmlSnippets.put("PAGE_TITLE", pageTitle.trim());
107
		htmlSnippets.put("PAGE_METADESC", metaDescription);
109
		htmlSnippets.put("PAGE_METADESC", metaDescription);
108
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
110
		htmlSnippets.put("PAGE_METAKEYWORDS", metaKeywords);
-
 
111
		if(displayAccessories.equals("TRUE")){
-
 
112
			htmlSnippets.put("RELATED_ACCESSORIES", pageLoader.getAccessoriesHtml());
-
 
113
		}else{
-
 
114
			htmlSnippets.put("RELATED_ACCESSORIES", "");
-
 
115
		}
109
	
116
		
110
		try {
117
		try {
111
			UserContextServiceClient userServiceClient = new UserContextServiceClient();
118
			UserContextServiceClient userServiceClient = new UserContextServiceClient();
112
			Client client = userServiceClient.getClient();
119
			Client client = userServiceClient.getClient();
113
			long itemId = Long.parseLong(id);
120
			long itemId = Long.parseLong(id);
114
			long userId = userinfo.getUserId();
121
			long userId = userinfo.getUserId();
Line 180... Line 187...
180
	}
187
	}
181
	
188
	
182
	public String getRootUrl()	{
189
	public String getRootUrl()	{
183
		return htmlSnippets.get("ROOT_URL");
190
		return htmlSnippets.get("ROOT_URL");
184
	}
191
	}
-
 
192
	
-
 
193
	public String getAccessoriesSnippet() {
-
 
194
		return htmlSnippets.get("RELATED_ACCESSORIES");
-
 
195
	}
185
}
196
}
186
197