| Line 781... |
Line 781... |
| 781 |
List<Item> items = cc.getAllItemsByStatus(status.ACTIVE);
|
781 |
List<Item> items = cc.getAllItemsByStatus(status.ACTIVE);
|
| 782 |
Client catalogClientProd = new CatalogClient(ConfigClientKeys.catalog_service_server_host_prod.toString(), ConfigClientKeys.catalog_service_server_port.toString()).getClient();
|
782 |
Client catalogClientProd = new CatalogClient(ConfigClientKeys.catalog_service_server_host_prod.toString(), ConfigClientKeys.catalog_service_server_port.toString()).getClient();
|
| 783 |
for (Item item : items){
|
783 |
for (Item item : items){
|
| 784 |
Category parentCategory = Catalog.getInstance().getDefinitionsContainer().getCategory(item.getCategory()).getParentCategory();
|
784 |
Category parentCategory = Catalog.getInstance().getDefinitionsContainer().getCategory(item.getCategory()).getParentCategory();
|
| 785 |
boolean isActive = true;
|
785 |
boolean isActive = true;
|
| 786 |
if(validParentCategories.contains(parentCategory.getID()) && !inStockCatalogItemIds.contains(item.getCatalogItemId())) {
|
786 |
if(!inStockCatalogItemIds.contains(item.getCatalogItemId())) {
|
| 787 |
if(item.isRisky()){
|
787 |
if(item.isRisky()){
|
| 788 |
try {
|
788 |
try {
|
| 789 |
ItemShippingInfo isi = catalogClientProd.isActive(item.getId());
|
789 |
ItemShippingInfo isi = catalogClientProd.isActive(item.getId());
|
| 790 |
isActive = isi.isIsActive();
|
790 |
isActive = isi.isIsActive();
|
| 791 |
} catch (Exception e) {
|
791 |
} catch (Exception e) {
|
| 792 |
isActive = true;
|
792 |
isActive = true;
|
| 793 |
}
|
793 |
}
|
| 794 |
}
|
794 |
}
|
| 795 |
if(isActive) {
|
795 |
if(isActive) {
|
| 796 |
productXMLSnippets.add(this.xmlIndentation[1] + "<products>");
|
- |
|
| 797 |
productXMLSnippets.add(this.xmlIndentation[2] + "<id>" + item.getCatalogItemId() + "</id>");
|
- |
|
| 798 |
productXMLSnippets.add(this.xmlIndentation[2] + "<product>" + getProductTitle(item) + "</product>");
|
- |
|
| 799 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_URL>" + getProductURL(item.getCatalogItemId(), item, 59) + "</Product_URL>");
|
- |
|
| 800 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_Price>" + (int)item.getSellingPrice() + "</Product_Price>");
|
- |
|
| 801 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Merchant_Name>" + "saholic.com" + "</Merchant_Name>");
|
- |
|
| 802 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Category_Name>" + parentCategory.getLabel() + "</Category_Name>");
|
- |
|
| 803 |
productXMLSnippets.add(this.xmlIndentation[1] + "</products>");
|
- |
|
| 804 |
inStockCatalogItemIds.add(item.getCatalogItemId());
|
796 |
inStockCatalogItemIds.add(item.getCatalogItemId());
|
| - |
|
797 |
if(validParentCategories.contains(parentCategory.getID())) {
|
| - |
|
798 |
productXMLSnippets.add(this.xmlIndentation[1] + "<products>");
|
| - |
|
799 |
productXMLSnippets.add(this.xmlIndentation[2] + "<id>" + item.getCatalogItemId() + "</id>");
|
| - |
|
800 |
productXMLSnippets.add(this.xmlIndentation[2] + "<product>" + getProductTitle(item) + "</product>");
|
| - |
|
801 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_URL>" + getProductURL(item.getCatalogItemId(), item, 59) + "</Product_URL>");
|
| - |
|
802 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Product_Price>" + (int)item.getSellingPrice() + "</Product_Price>");
|
| - |
|
803 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Merchant_Name>" + "saholic.com" + "</Merchant_Name>");
|
| - |
|
804 |
productXMLSnippets.add(this.xmlIndentation[2] + "<Category_Name>" + parentCategory.getLabel() + "</Category_Name>");
|
| - |
|
805 |
productXMLSnippets.add(this.xmlIndentation[1] + "</products>");
|
| - |
|
806 |
}
|
| 805 |
}
|
807 |
}
|
| 806 |
}
|
808 |
}
|
| 807 |
}
|
809 |
}
|
| 808 |
productXMLSnippets.add("</root>");
|
810 |
productXMLSnippets.add("</root>");
|
| 809 |
String productDataXML = StringUtils.join(productXMLSnippets, "\n");
|
811 |
String productDataXML = StringUtils.join(productXMLSnippets, "\n");
|