final TextItem groupMember = new TextItem("groupMember", MSG.view_admin_systemSettings_LDAPGroupMember_name());
{
groupMember.setCanEdit(false);
groupMember.setWidth("100%");
}
final CheckboxItem groupQueryPagingItem = new CheckboxItem("groupQueryEnable",
MSG.view_admin_systemSettings_LDAPGroupUsePaging_name());
{
groupQueryPagingItem.setCanEdit(false);
groupQueryPagingItem.setValue(false);
groupQueryPagingItem.setShowLabel(false);
groupQueryPagingItem.setShowTitle(true);
groupQueryPagingItem.setTitleOrientation(TitleOrientation.LEFT);
//You have to set this attribute
groupQueryPagingItem.setAttribute("labelAsTitle", true);
}
final TextItem groupQueryPagingCountItem = new TextItem("groupQueryCount",
MSG.view_adminRoles_ldapQueryPageSize());
{
groupQueryPagingCountItem.setCanEdit(false);
groupQueryPagingCountItem.setWidth("100%");
}
final CheckboxItem groupUsePosixGroupsItem = new CheckboxItem("groupUsePosixGroups",
MSG.view_admin_systemSettings_LDAPGroupUsePosixGroup_name());
{
groupUsePosixGroupsItem.setCanEdit(false);
groupUsePosixGroupsItem.setValue(false);
groupUsePosixGroupsItem.setShowLabel(false);
groupUsePosixGroupsItem.setShowTitle(true);
groupUsePosixGroupsItem.setTitleOrientation(TitleOrientation.LEFT);
//You have to set this attribute
groupUsePosixGroupsItem.setAttribute("labelAsTitle", true);
}
ldapGroupSettings.setItems(groupSearch, groupMember, groupQueryPagingItem, groupQueryPagingCountItem,
groupUsePosixGroupsItem);
// orient both panels next to each other
HLayout panel = new HLayout();
{
panel.addMember(availableGroupDetails);
DynamicForm spacerWrapper = new DynamicForm();
spacerWrapper.setItems(new SpacerItem());
panel.addMember(spacerWrapper);
panel.addMember(ldapGroupSettings);
}
availableFilterForm.addChild(panel);
final long ldapGroupSelectorRequestId = System.currentTimeMillis();
//launch operations to populate/refresh LDAP Group Query contents.
final Timer ldapPropertiesTimer = new Timer() {
public void run() {
//if system properties not set, launch request/update
String ldapGroupQuery = groupSearch.getValueAsString();
if ((ldapGroupQuery == null) || (ldapGroupQuery.trim().isEmpty())) {
GWTServiceLookup.getSystemService().getSystemSettings(new AsyncCallback<SystemSettings>() {
@Override
public void onFailure(Throwable caught) {
groupQueryStatus.setIcons(failIcon);
groupQueryStatus.setDefaultValue(MSG.view_adminRoles_failLdapGroupsSettings());
CoreGUI.getErrorHandler().handleError(MSG.view_adminRoles_failLdapGroupsSettings(), caught);
Log.debug(MSG.view_adminRoles_failLdapGroupsSettings());
}
@Override
public void onSuccess(SystemSettings settings) {
//retrieve relevant information once and update ui
String ldapGroupFilter = settings.get(SystemSetting.LDAP_GROUP_FILTER);
String ldapGroupMember = settings.get(SystemSetting.LDAP_GROUP_MEMBER);
String ldapGroupPagingEnabled = settings.get(SystemSetting.LDAP_GROUP_PAGING);
String ldapGroupPagingValue = settings.get(SystemSetting.LDAP_GROUP_QUERY_PAGE_SIZE);
String ldapGroupIsPosix = settings.get(SystemSetting.LDAP_GROUP_USE_POSIX);
groupSearch.setValue(ldapGroupFilter);
groupMember.setValue(ldapGroupMember);
groupQueryPagingItem.setValue(Boolean.valueOf(ldapGroupPagingEnabled));
groupQueryPagingCountItem.setValue(ldapGroupPagingValue);
groupUsePosixGroupsItem.setValue(Boolean.valueOf(ldapGroupIsPosix));
ldapGroupSettings.markForRedraw();
}
});
}
}