Subversion Repositories SmartDukaan

Rev

Rev 11706 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11706 Rev 11723
Line 65... Line 65...
65
			
65
			
66
			Item item = entityItemMap.get(entity.getID());
66
			Item item = entityItemMap.get(entity.getID());
67
			String url = getProductURL(entity.getID(), item);
67
			String url = getProductURL(entity.getID(), item);
68
			productXMLSnippets.add(this.xmlIndentation[2] + "<url><loc>" + url + "</loc></url>");
68
			productXMLSnippets.add(this.xmlIndentation[2] + "<url><loc>" + url + "</loc></url>");
69
		}
69
		}
70
		productXMLSnippets.add("</Products>");
70
		productXMLSnippets.add("</urlset>");
71
		String productDataXML = StringUtils.join(productXMLSnippets, "\n");
71
		String productDataXML = StringUtils.join(productXMLSnippets, "\n");
72
		
72
		
73
		Utils.info(productDataXML);
73
		Utils.info(productDataXML);
74
		
74
		
75
		// Write it to file
75
		// Write it to file
Line 79... Line 79...
79
	
79
	
80
	private String getProductURL(long entityId, Item item){
80
	private String getProductURL(long entityId, Item item){
81
		//long rootCategoryId = catm.getCategory(item.getCategory()).getParent_category_id();
81
		//long rootCategoryId = catm.getCategory(item.getCategory()).getParent_category_id();
82
		in.shop2020.metamodel.definitions.Category parentCategory = defContainer.getCategory(item.getCategory()).getParentCategory();
82
		in.shop2020.metamodel.definitions.Category parentCategory = defContainer.getCategory(item.getCategory()).getParentCategory();
83
		
83
		
84
		String url = "http://www.saholic.com/" + parentCategory.getLabel().toLowerCase().replace(' ', '-') + "/";
84
		String url = "http://m.saholic.com/" + parentCategory.getLabel().toLowerCase().replace(' ', '-') + "/";
85
		String productUrl = ((item.getBrand() != null) ? item.getBrand().trim() + " " : "").toLowerCase().replace(' ', '-')
85
		String productUrl = ((item.getBrand() != null) ? item.getBrand().trim() + " " : "").toLowerCase().replace(' ', '-')
86
        + "-" + ((item.getModelName() != null) ? item.getModelName().trim() + " " : "").toLowerCase().replace(' ', '-') 
86
        + "-" + ((item.getModelName() != null) ? item.getModelName().trim() + " " : "").toLowerCase().replace(' ', '-') 
87
	    + "-" + (( item.getModelNumber() != null ) ? item.getModelNumber().trim() + " ": "" ).toLowerCase().replace(' ', '-')
87
	    + "-" + (( item.getModelNumber() != null ) ? item.getModelNumber().trim() + " ": "" ).toLowerCase().replace(' ', '-')
88
        + "-" + entityId;
88
        + "-" + entityId;
89
		productUrl = productUrl.replaceAll("/", "-");
89
		productUrl = productUrl.replaceAll("/", "-");