Subversion Repositories SmartDukaan

Rev

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

Rev 5229 Rev 5347
Line 226... Line 226...
226
	 * @param irDataXMLSnippets
226
	 * @param irDataXMLSnippets
227
	 * @throws Exception
227
	 * @throws Exception
228
	 */
228
	 */
229
	private void getProductsJavascript(StringBuffer sb) throws Exception{
229
	private void getProductsJavascript(StringBuffer sb) throws Exception{
230
 
230
 
231
		Map<String, Long> mobilePhones = new HashMap<String, Long>();
231
		Map<String, Map<String, Long>> products = new HashMap<String, Map<String,Long>>();
232
		Map<String, Long> laptops = new HashMap<String, Long>();
-
 
233
		
232
		
234
		for(Long entityId: entityIdItemMap.keySet())	{
233
		for(Map.Entry<Long, List<Item>> entry : entityIdItemMap.entrySet())	{
235
			Item item = entityIdItemMap.get(entityId).get(0);
234
			Item item = entry.getValue().get(0);
-
 
235
			in.shop2020.metamodel.definitions.Category parentCategory = defContainer.getCategory(item.getCategory()).getParentCategory();
236
			
236
			
237
			if (isMobile(item))	{
237
			if(parentCategory.isComparable()){
238
				mobilePhones.put(getProductTitle(item), entityId);
238
				String parentCat = parentCategory.getLabel();
-
 
239
				if(!products.containsKey(parentCategory.getLabel())){
-
 
240
					Map<String, Long> catMap = new HashMap<String, Long>();
-
 
241
					products.put(parentCat, catMap);
239
			}
242
				}
240
			else if (isLaptop(item))	{
-
 
241
				laptops.put(getProductTitle(item), entityId);
243
				products.get(parentCat).put(getProductTitle(item), entry.getKey());
242
			}
244
			}
243
		}
245
		}
244
		Map<String, Map<String, Long>> products = new HashMap<String, Map<String,Long>>();
-
 
245
		products.put("mobiles", mobilePhones);
-
 
246
		products.put("laptops", laptops);
-
 
247
		sb.append(new JSONObject(products));
246
		sb.append(new JSONObject(products));
248
	}
247
	}
249
	
248
	
250
	
249
	
251
	/**
250
	/**