Subversion Repositories SmartDukaan

Rev

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

Rev 2561 Rev 2829
Line 32... Line 32...
32
	 * Get the url of the entity
32
	 * Get the url of the entity
33
	 * @param expEntity
33
	 * @param expEntity
34
	 * @return url
34
	 * @return url
35
	 */
35
	 */
36
	private String getProductURL(long entityId, Item item){
36
	private String getProductURL(long entityId, Item item){
-
 
37
		long rootCategoryId = catm.getCategory(item.getCategory()).getParent_category_id();
-
 
38
		if(rootCategoryId == Utils.ROOT_CATAGOEY){
-
 
39
			rootCategoryId = item.getCategory(); 	
-
 
40
		}
37
		String url = "http://www.saholic.com/" + catm.getCategoryLabel(catm.getCategory(item.getCategory()).getParent_category_id()).toLowerCase().replace(' ', '-') + "/";
41
		String url = "http://www.saholic.com/" + catm.getCategoryLabel(rootCategoryId).toLowerCase().replace(' ', '-') + "/";
38
		String productUrl = ((item.getBrand() != null) ? item.getBrand().trim() + " " : "").toLowerCase().replace(' ', '-')
42
		String productUrl = ((item.getBrand() != null) ? item.getBrand().trim() + " " : "").toLowerCase().replace(' ', '-')
39
        + "-" + ((item.getModelName() != null) ? item.getModelName().trim() + " " : "").toLowerCase().replace(' ', '-') 
43
        + "-" + ((item.getModelName() != null) ? item.getModelName().trim() + " " : "").toLowerCase().replace(' ', '-') 
40
	    + "-" + (( item.getModelNumber() != null ) ? item.getModelNumber().trim() + " ": "" ).toLowerCase().replace(' ', '-')
44
	    + "-" + (( item.getModelNumber() != null ) ? item.getModelNumber().trim() + " ": "" ).toLowerCase().replace(' ', '-')
41
        + "-" + entityId;
45
        + "-" + entityId;
42
		productUrl = productUrl.replaceAll("/", "-");
46
		productUrl = productUrl.replaceAll("/", "-");