Subversion Repositories SmartDukaan

Rev

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

Rev 5612 Rev 5930
Line 365... Line 365...
365
 
365
 
366
		Map<String, Map<String, Long>> products = new HashMap<String, Map<String,Long>>();
366
		Map<String, Map<String, Long>> products = new HashMap<String, Map<String,Long>>();
367
		
367
		
368
		for(Map.Entry<Long, List<Item>> entry : entityIdItemMap.entrySet())	{
368
		for(Map.Entry<Long, List<Item>> entry : entityIdItemMap.entrySet())	{
369
			Item item = entry.getValue().get(0);
369
			Item item = entry.getValue().get(0);
370
			in.shop2020.metamodel.definitions.Category parentCategory = defContainer.getCategory(item.getCategory()).getParentCategory();
370
			in.shop2020.metamodel.definitions.Category category = defContainer.getCategory(item.getCategory());
371
			
-
 
-
 
371
			in.shop2020.metamodel.definitions.Category parentCategory = category.getParentCategory();
-
 
372
			String categoryLabel = category.getLabel();
372
			if(parentCategory.isComparable()){
373
			if(parentCategory.isComparable()){
373
				String parentCat = parentCategory.getLabel();
374
				categoryLabel = parentCategory.getLabel();
374
				if(!products.containsKey(parentCategory.getLabel())){
-
 
375
					Map<String, Long> catMap = new HashMap<String, Long>();
-
 
376
					products.put(parentCat, catMap);
-
 
377
				}
-
 
378
				products.get(parentCat).put(getProductTitle(item), entry.getKey());
-
 
379
			}
375
			}
-
 
376
			if(!products.containsKey(categoryLabel)){
-
 
377
				Map<String, Long> catMap = new HashMap<String, Long>();
-
 
378
				products.put(categoryLabel, catMap);
-
 
379
			}
-
 
380
			products.get(categoryLabel).put(getProductTitle(item), entry.getKey());
380
		}
381
		}
381
		sb.append(new JSONObject(products));
382
		sb.append(new JSONObject(products));
382
	}
383
	}
383
	
384
	
384
	
385