for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null) continue;
FormElement ui = userPropertyHandler.getFormElement(getLocale(), null, formIdentifyer, true);
String group = userPropertyHandler.getGroup();
if (!group.equals(currentGroup)) {
if (currentGroup != null) addFormElement("spacer_" + group, new SpacerElement());
currentGroup = group;
}
addFormElement(userPropertyHandler.getName(), ui);
}
// role constraint
addFormElement("space1", new SpacerElement(true, false));
addFormElement("title.roles", new TitleElement("search.form.title.roles"));
admin = new CheckBoxElement("search.form.constraint.admin");
addFormElement("admin", admin);
author = new CheckBoxElement("search.form.constraint.author");
addFormElement("author", author);
groupmanager = new CheckBoxElement("search.form.constraint.groupmanager");
addFormElement("groupmanager", groupmanager);
usermanager = new CheckBoxElement("search.form.constraint.usermanager");
addFormElement("usermanager", usermanager);
oresmanager = new CheckBoxElement("search.form.constraint.oresmanager");
addFormElement("oresmanager", oresmanager);
// authentication constraints
addFormElement("space2", new SpacerElement(true, false));
addFormElement("title.auth", new TitleElement("search.form.title.authentications"));
// take all providers from the config file
// convention is that a translation key "search.form.constraint.auth." +
// providerName
// must exist. the element is stored using the name "auth." + providerName
Collection providers = LoginModule.getAuthenticationProviders();
Iterator iter = providers.iterator();
while (iter.hasNext()) {
AuthenticationProvider provider = (AuthenticationProvider) iter.next();
if (provider.isEnabled()) {
String providerName = provider.getName();
CheckBoxElement authElem = new CheckBoxElement("search.form.constraint.auth." + providerName);
addFormElement("auth." + providerName, authElem);
}
}
if(WebDAVManager.getInstance().isEnabled()) {
CheckBoxElement authElem = new CheckBoxElement("search.form.constraint.auth." + WebDAVAuthManager.PROVIDER_WEBDAV);
addFormElement("auth." + WebDAVAuthManager.PROVIDER_WEBDAV, authElem);
}
// add additional no authentication element
noAuth = new CheckBoxElement("search.form.constraint.auth.none");
addFormElement("noAuth", noAuth);
// special case login denied
addFormElement("status", createStatusSelectionElement());
// creation date constraints
addFormElement("space3", new SpacerElement(true, false));
addFormElement("title.date", new TitleElement("search.form.title.date"));
afterDate = new DateElement("search.form.afterDate", getLocale());
addFormElement("afterDate", afterDate);
beforeDate = new DateElement("search.form.beforeDate", getLocale());
addFormElement("beforeDate", beforeDate);