/**
* Prepares request attributes for groups and criteria
*/
protected String[][][] prepareGroupsAndCriteria(HttpServletRequest req, Category[] categories) {
CategoryManager categoryManager = new CategoryManager(req.getLocale(),session);
CriteriaManager criteriaManager = new CriteriaManager(req.getLocale(),session);
String groupnames[][] = new String[categories.length][];
String formpropertynames[][] = new String[categories.length][];
String criterianames[][][] = new String[categories.length][][];
String criteriaDescriptions[][][] = new String[categories.length][][];
for (int c=0; c<categories.length; c++) {
CriteriaGroup[] groups = categoryManager.getSortedGroups(categories[c]);
groupnames[c] = new String[groups.length];
formpropertynames[c] = new String[groups.length];
criterianames[c] = new String[groups.length][];
criteriaDescriptions[c] = new String[groups.length][];
if (groups.length > MAX_NOF_GROUPS){
throw new ConfigurationException("only up to " + MAX_NOF_GROUPS + " groups in a category can be displayed");
}
for (int i = 0; i < groups.length; i++) {
CriteriaGroup group = groups[i];
groupnames[c][i] = group.getGroupname();
formpropertynames[c][i] = "criterias"+c+"_"+i;
Criteria[] criterias = criteriaManager.getSortedCriterias(groups[i]);
criterianames[c][i] = new String[criterias.length];
criteriaDescriptions[c][i] = new String[criterias.length];
for (int j = 0; j < criterias.length; j++) {
Criteria criteria = criterias[j];
criterianames[c][i][j] = criteria.getCriterianame();