Subversion Repositories SmartDukaan

Rev

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

Rev 5346 Rev 5358
Line 102... Line 102...
102
					continue;
102
					continue;
103
				}
103
				}
104
				EntityState es = CreationUtils.getEntityState(entityId);
104
				EntityState es = CreationUtils.getEntityState(entityId);
105
				if(EntityStatus.READY.equals(es.getStatus()) && category.getParentCategory().getID()==Utils.MOBILE_PHONES_CATAGORY) {
105
				if(EntityStatus.READY.equals(es.getStatus()) && category.getParentCategory().getID()==Utils.MOBILE_PHONES_CATAGORY) {
106
					String entityName = EntityUtils.getProductName(expandedEntity);
106
					String entityName = EntityUtils.getProductName(expandedEntity);
107
					String hyphendatedName = entityName.replaceAll(" +", "-").toLowerCase();
107
					String hyphendatedName = entityName.replaceAll(" +", "-").replaceAll("/+", "-").replaceAll("-+", "-").toLowerCase();
108
					for (Long anotherEntityId : entry.getValue().keySet()) {
108
					for (Long anotherEntityId : entry.getValue().keySet()) {
109
						EntityState es1 = CreationUtils.getEntityState(anotherEntityId);
109
						EntityState es1 = CreationUtils.getEntityState(anotherEntityId);
110
						ExpandedEntity anotherExpandedEntity = new ExpandedEntity(CreationUtils.getEntity(anotherEntityId));
110
						ExpandedEntity anotherExpandedEntity = new ExpandedEntity(CreationUtils.getEntity(anotherEntityId));
111
						Category anotherCategory = anotherExpandedEntity.getCategory();
111
						Category anotherCategory = anotherExpandedEntity.getCategory();
112
						if(anotherCategory == null){
112
						if(anotherCategory == null){
113
							continue;
113
							continue;
114
						}
114
						}
115
						if(EntityStatus.READY.equals(es1.getStatus()) && anotherCategory.getParentCategory().getID() == Utils.MOBILE_PHONES_CATAGORY){
115
						if(EntityStatus.READY.equals(es1.getStatus()) && anotherCategory.getParentCategory().getID() == Utils.MOBILE_PHONES_CATAGORY){
116
							String anotherEntityName = EntityUtils.getProductName(anotherExpandedEntity);
116
							String anotherEntityName = EntityUtils.getProductName(anotherExpandedEntity);
117
							String anotherHyphenatedName = anotherEntityName.replaceAll(" +", "-").toLowerCase();
117
							String anotherHyphenatedName = anotherEntityName.replaceAll(" +", "-").replaceAll("/+", "-").replaceAll("-+", "-").toLowerCase();
118
							sb.append(indentation[1] + "<div>\n");
118
							sb.append(indentation[1] + "<div>\n");
119
							sb.append(indentation[2] + "<a href='http://www.saholic.com/compare-mobile-phones/" + hyphendatedName + "-vs-" + anotherHyphenatedName 
119
							sb.append(indentation[2] + "<a href='http://www.saholic.com/compare-mobile-phones/" + hyphendatedName + "-vs-" + anotherHyphenatedName 
120
										+"?p1=" + entityId +"&p2="+ anotherEntityId+" '>" + entityName + " Vs "+ anotherEntityName + "</a>\n");
120
										+"?p1=" + entityId +"&p2="+ anotherEntityId+" '>" + entityName + " Vs "+ anotherEntityName + "</a>\n");
121
							sb.append(indentation[1] + "</div>\n");
121
							sb.append(indentation[1] + "</div>\n");
122
						}
122
						}