Subversion Repositories SmartDukaan

Rev

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

Rev 2095 Rev 2424
Line 1173... Line 1173...
1173
		}
1173
		}
1174
		
1174
		
1175
		return cats;
1175
		return cats;
1176
	}
1176
	}
1177
 
1177
 
-
 
1178
	
-
 
1179
	public Map<String, String> getLeafcategories() throws Exception {
-
 
1180
		Map<String, String> cats = new HashMap<String, String>();
-
 
1181
		List<Category> children = defs.getChildrenCategories(Catalog.getInstance().getRootCategory().getID());
-
 
1182
		for(Category child : children) {
-
 
1183
			if(child.getChildrenCategory() == null){
-
 
1184
				cats.put(new Long(child.getID()).toString(), child.getLabel());	
-
 
1185
			}else{
-
 
1186
				List<Category> grandChildren = defs.getChildrenCategories(child.getID());
-
 
1187
				for(Category grandChild: grandChildren){
-
 
1188
					if(grandChild.getChildrenCategory() == null){
-
 
1189
						cats.put(new Long(grandChild.getID()).toString(), grandChild.getLabel());
-
 
1190
					}
-
 
1191
				}
-
 
1192
			}
-
 
1193
			
-
 
1194
		}
-
 
1195
		
-
 
1196
		return cats;
-
 
1197
	}
-
 
1198
	
1178
	public Map<String, String> getSubcategories() throws Exception {
1199
	public Map<String, String> getSubcategories() throws Exception {
1179
		Map<String, String> cats = new HashMap<String, String>();
1200
		Map<String, String> cats = new HashMap<String, String>();
1180
 
1201
 
1181
		List<Category> children = defs.getChildrenCategories(Catalog.getInstance().getRootCategory().getID());
1202
		List<Category> children = defs.getChildrenCategories(Catalog.getInstance().getRootCategory().getID());
1182
		for(Category child : children) {
1203
		for(Category child : children) {