| Line 79... |
Line 79... |
| 79 |
productUrl = productUrl.replaceAll("/", "-");
|
79 |
productUrl = productUrl.replaceAll("/", "-");
|
| 80 |
url = url + productUrl;
|
80 |
url = url + productUrl;
|
| 81 |
url = url.replaceAll("-+", "-");
|
81 |
url = url.replaceAll("-+", "-");
|
| 82 |
return url;
|
82 |
return url;
|
| 83 |
}
|
83 |
}
|
| - |
|
84 |
|
| - |
|
85 |
|
| - |
|
86 |
/**
|
| - |
|
87 |
* Get the url of the entity
|
| - |
|
88 |
* @param expEntity
|
| - |
|
89 |
* @return url
|
| - |
|
90 |
*/
|
| - |
|
91 |
private String getProductURL(long entityId, Item item, int affiliateId){
|
| - |
|
92 |
//long rootCategoryId = catm.getCategory(item.getCategory()).getParent_category_id();
|
| - |
|
93 |
in.shop2020.metamodel.definitions.Category parentCategory = defContainer.getCategory(item.getCategory()).getParentCategory();
|
| - |
|
94 |
|
| - |
|
95 |
String url = "http://www.saholic.com/" + parentCategory.getLabel().toLowerCase().replace(' ', '-') + "/";
|
| - |
|
96 |
String productUrl = ((item.getBrand() != null) ? item.getBrand().trim() + " " : "").toLowerCase().replace(' ', '-')
|
| - |
|
97 |
+ "-" + ((item.getModelName() != null) ? item.getModelName().trim() + " " : "").toLowerCase().replace(' ', '-')
|
| - |
|
98 |
+ "-" + (( item.getModelNumber() != null ) ? item.getModelNumber().trim() + " ": "" ).toLowerCase().replace(' ', '-')
|
| - |
|
99 |
+ "-" + entityId;
|
| - |
|
100 |
productUrl = productUrl.replaceAll("/", "-");
|
| - |
|
101 |
url = url + productUrl;
|
| - |
|
102 |
url = url.replaceAll("-+", "-");
|
| - |
|
103 |
return url + "?afid=" + affiliateId;
|
| - |
|
104 |
}
|
| 84 |
|
105 |
|
| 85 |
|
106 |
|
| 86 |
|
107 |
|
| 87 |
/**
|
108 |
/**
|
| 88 |
* Get the minimum mrp of the items
|
109 |
* Get the minimum mrp of the items
|
| Line 760... |
Line 781... |
| 760 |
}
|
781 |
}
|
| 761 |
if(isActive) {
|
782 |
if(isActive) {
|
| 762 |
productXMLSnippets.add(this.xmlIndentation[1] + "<products>");
|
783 |
productXMLSnippets.add(this.xmlIndentation[1] + "<products>");
|
| 763 |
productXMLSnippets.add(this.xmlIndentation[2] + "<id>" + item.getCatalogItemId() + "</id>");
|
784 |
productXMLSnippets.add(this.xmlIndentation[2] + "<id>" + item.getCatalogItemId() + "</id>");
|
| 764 |
productXMLSnippets.add(this.xmlIndentation[2] + "<product>" + getProductTitle(item) + "</product>");
|
785 |
productXMLSnippets.add(this.xmlIndentation[2] + "<product>" + getProductTitle(item) + "</product>");
|
| 765 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_URL>" + getProductURL(item.getCatalogItemId(), item) + "</Product_URL>");
|
786 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_URL>" + getProductURL(item.getCatalogItemId(), item, 59) + "</Product_URL>");
|
| 766 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_Price>" + (int)item.getSellingPrice() + "</Product_Price>");
|
787 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_Price>" + (int)item.getSellingPrice() + "</Product_Price>");
|
| 767 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Merchant_Name>" + "saholic.com" + "</Merchant_Name>");
|
788 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Merchant_Name>" + "saholic.com" + "</Merchant_Name>");
|
| 768 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Category_Name>" + parentCategory.getLabel() + "</Category_Name>");
|
789 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Category_Name>" + parentCategory.getLabel() + "</Category_Name>");
|
| 769 |
productXMLSnippets.add(this.xmlIndentation[1] + "</products>");
|
790 |
productXMLSnippets.add(this.xmlIndentation[1] + "</products>");
|
| 770 |
catalogItemIds.add(item.getCatalogItemId());
|
791 |
catalogItemIds.add(item.getCatalogItemId());
|