| Line 60... |
Line 60... |
| 60 |
|
60 |
|
| 61 |
String entityUrl = "";
|
61 |
String entityUrl = "";
|
| 62 |
String metaKeywords = "";
|
62 |
String metaKeywords = "";
|
| 63 |
String metaDescription = "";
|
63 |
String metaDescription = "";
|
| 64 |
String pageTitle = "";
|
64 |
String pageTitle = "";
|
| - |
|
65 |
String productName = "";
|
| 65 |
try {
|
66 |
try {
|
| 66 |
JSONObject productPropertiesInJson = new JSONObject(pageLoader.getProductPropertiesHtml(productId).trim());
|
67 |
JSONObject productPropertiesInJson = new JSONObject(pageLoader.getProductPropertiesHtml(productId).trim());
|
| 67 |
entityUrl = productPropertiesInJson.getString("entityUrl");
|
68 |
entityUrl = productPropertiesInJson.getString("entityUrl");
|
| 68 |
metaDescription = productPropertiesInJson.getString("metaDescription");
|
69 |
metaDescription = productPropertiesInJson.getString("metaDescription");
|
| 69 |
metaKeywords = productPropertiesInJson.getString("metaKeywords");
|
70 |
metaKeywords = productPropertiesInJson.getString("metaKeywords");
|
| 70 |
pageTitle = productPropertiesInJson.getString("title");
|
71 |
pageTitle = productPropertiesInJson.getString("title");
|
| - |
|
72 |
productName = productPropertiesInJson.getString("name");
|
| 71 |
}
|
73 |
}
|
| 72 |
catch (JSONException e) {
|
74 |
catch (JSONException e) {
|
| 73 |
e.printStackTrace();
|
75 |
e.printStackTrace();
|
| 74 |
try {
|
76 |
try {
|
| 75 |
CatalogServiceClient catalogClientService = new CatalogServiceClient();
|
77 |
CatalogServiceClient catalogClientService = new CatalogServiceClient();
|
| Line 89... |
Line 91... |
| 89 |
if (!currentUrl.contains(entityUrl)) {
|
91 |
if (!currentUrl.contains(entityUrl)) {
|
| 90 |
redirectUrl = entityUrl;
|
92 |
redirectUrl = entityUrl;
|
| 91 |
return "redirect";
|
93 |
return "redirect";
|
| 92 |
}
|
94 |
}
|
| 93 |
|
95 |
|
| 94 |
//Extracting Product name from Page Title
|
96 |
//Extracting base url
|
| 95 |
String[] items = pageTitle.split("\\|");
|
- |
|
| 96 |
String productName = items[0] != null ? items[0].trim() : null;
|
- |
|
| 97 |
String rootUrl = currentUrl.split("/")[2];
|
97 |
String rootUrl = currentUrl.split("/")[2];
|
| 98 |
|
98 |
|
| 99 |
|
- |
|
| 100 |
htmlSnippets.put("PRODUCT_SUMMARY", pageLoader.getProductSummaryHtml(productId));
|
99 |
htmlSnippets.put("PRODUCT_SUMMARY", pageLoader.getProductSummaryHtml(productId));
|
| 101 |
htmlSnippets.put("PRODUCT_ID", productId + "");
|
100 |
htmlSnippets.put("PRODUCT_ID", productId + "");
|
| 102 |
htmlSnippets.put("PRODUCT_NAME", productName);
|
101 |
htmlSnippets.put("PRODUCT_NAME", productName);
|
| 103 |
htmlSnippets.put("PRODUCT_URL", currentUrl);
|
102 |
htmlSnippets.put("PRODUCT_URL", currentUrl);
|
| 104 |
htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
|
103 |
htmlSnippets.put("ROOT_URL", "http://" + rootUrl);
|