Subversion Repositories SmartDukaan

Rev

Rev 403 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 403 Rev 448
Line 1082... Line 1082...
1082
		log.info("setParameters:" + reqmap);
1082
		log.info("setParameters:" + reqmap);
1083
		
1083
		
1084
		this.reqparams = reqmap;
1084
		this.reqparams = reqmap;
1085
	}
1085
	}
1086
 
1086
 
-
 
1087
	public String getCategoriesTree()  throws Exception {
-
 
1088
		DefinitionsContainer defs = this.getDefinitionsContainer();
-
 
1089
		Map<String, String> cats = new HashMap<String, String>();
-
 
1090
		
-
 
1091
		List<Category> children = defs.getChildrenCategories(10000L);
-
 
1092
		
-
 
1093
		for(Category child : children) {
-
 
1094
			cats.put(new Long(child.getID()).toString(), child.getLabel());
-
 
1095
		}
-
 
1096
		return "";
-
 
1097
	}
-
 
1098
	
1087
	public Map<String, String> getCategories() throws Exception {
1099
	public Map<String, String> getCategories() throws Exception {
1088
		DefinitionsContainer defs = this.getDefinitionsContainer();
1100
		DefinitionsContainer defs = this.getDefinitionsContainer();
1089
		Map<String, String> cats = new HashMap<String, String>();
1101
		Map<String, String> cats = new HashMap<String, String>();
1090
 
1102
 
1091
		List<Category> children = defs.getChildrenCategories(10001L);
1103
		List<Category> children = defs.getChildrenCategories(10000L);
1092
		for(Category child : children) {
1104
		for(Category child : children) {
1093
			cats.put(new Long(child.getID()).toString(), child.getLabel());
1105
			cats.put(new Long(child.getID()).toString(), child.getLabel());
1094
		}
1106
		}
1095
		
1107
		
1096
		return cats;
1108
		return cats;
1097
	}
1109
	}
-
 
1110
 
-
 
1111
	public Map<String, String> getSubcategories() throws Exception {
-
 
1112
		DefinitionsContainer defs = this.getDefinitionsContainer();
-
 
1113
		Map<String, String> cats = new HashMap<String, String>();
-
 
1114
 
-
 
1115
		List<Category> children = defs.getChildrenCategories(10000L);
-
 
1116
		for(Category child : children) {
-
 
1117
			List<Category> grandChildren = defs.getChildrenCategories(child.getID());
-
 
1118
			for(Category grandchild : grandChildren) {
-
 
1119
				cats.put(new Long(grandchild.getID()).toString(), grandchild.getLabel());
-
 
1120
			}
-
 
1121
		}
-
 
1122
		
-
 
1123
		return cats;
-
 
1124
	}
-
 
1125
	public String getCategoriesString() throws Exception {
-
 
1126
		DefinitionsContainer defs = this.getDefinitionsContainer();
-
 
1127
		StringBuilder categoryString = new StringBuilder();
-
 
1128
		
-
 
1129
		categoryString.append("<label for=\"basecategory\">Category: </label>");
-
 
1130
		categoryString.append("\n");
-
 
1131
		categoryString.append("<select id=\"basecategory\"  name=\"basecategory\" >"); 
-
 
1132
		categoryString.append("\n");
-
 
1133
		List<Category> children = defs.getChildrenCategories(10000L);
-
 
1134
		for(Category child : children) {
-
 
1135
			categoryString.append("<option value=\"" + new Long(child.getID()).toString() + "\">" + child.getLabel() + "</option>");
-
 
1136
			categoryString.append("\n");
-
 
1137
		}
-
 
1138
		categoryString.append("</select>");
-
 
1139
		categoryString.append("\n");
-
 
1140
		categoryString.append("<br/>");
-
 
1141
		categoryString.append("\n");
-
 
1142
		
-
 
1143
		categoryString.append("<label for=\"category\">Sub Category: </label>");
-
 
1144
		categoryString.append("\n");
-
 
1145
		categoryString.append("<select id=\"category\" name=\"category\" >");
-
 
1146
		categoryString.append("\n");
-
 
1147
		for(Category child : children) {
-
 
1148
			List<Category> grandChildren = defs.getChildrenCategories(child.getID());
-
 
1149
			for(Category grandchild : grandChildren) {
-
 
1150
				categoryString.append("<option value=\"" + new Long(grandchild.getID()).toString() + "\" selected=\"$selected\" class = \""+ child.getID()  + "\">" + grandchild.getLabel() + "</option>");
-
 
1151
				categoryString.append("\n");
-
 
1152
			}
-
 
1153
		}
-
 
1154
		categoryString.append("</select>");
-
 
1155
		categoryString.append("\n");
-
 
1156
		categoryString.append("<br/>");
-
 
1157
		
-
 
1158
		return categoryString.toString();
-
 
1159
		
1098
	
1160
	}
-
 
1161
 
-
 
1162
 
1099
	/**
1163
	/**
1100
	 * 
1164
	 * 
1101
	 * @return
1165
	 * @return
1102
	 * @throws Exception
1166
	 * @throws Exception
1103
	 */
1167
	 */
Line 1483... Line 1547...
1483
			this.entity = CreationUtils.getEntity(entityID);
1547
			this.entity = CreationUtils.getEntity(entityID);
1484
		}
1548
		}
1485
		
1549
		
1486
		return this.entity;
1550
		return this.entity;
1487
	}
1551
	}
-
 
1552
 
-
 
1553
 
1488
}
1554
}