use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class IdentitySubjectEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
IdentitySubjectModel model = (IdentitySubjectModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
Set values = null;
if (bFilter) {
Set defaultValue = getValues();
if (defaultValue != null) {
values = getAMIdentity(model, defaultValue);
}
} else {
values = getAMIdentity(model, getDefaultValues(model));
}
super.beginDisplay(event);
if (canModify) {
Map supportedEntityTypes = model.getSupportedEntityTypes(realmName);
CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
OptionList entityTypes = createOptionList(supportedEntityTypes);
entityTypes.add(0, "policy.subject.select.identity.type", "");
menu.setOptions(entityTypes);
menu.setValue("");
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
OptionList selected = addRemoveModel.getSelectedOptionList();
child.resetStateData();
addRemoveModel.setAvailableOptionList(createOptionList(getPossibleValues(model, realmName, values)));
if (submitCycle) {
addRemoveModel.setSelectedOptionList(selected);
} else {
addRemoveModel.setSelectedOptionList(createOptionList(values));
}
} else {
propertySheetModel.setValue(VALUES_MULTIPLE_CHOICE_VALUE, AMAdminUtils.getString(getDefaultValues(), ",", false));
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class IdentitySubjectEditViewBean method handleBtnFilterRequest.
/**
* Handles filter results request.
*
* @param event Request invocation event.
*/
public void handleBtnFilterRequest(RequestInvocationEvent event) {
CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
setPageSessionAttribute(ENTITY_TYPE, (String) menu.getValue());
super.handleBtnFilterRequest(event);
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class TimeConditionHelper method setTimeZone.
public void setTimeZone(ConditionOpViewBeanBase viewBean, boolean canModify, String tz) {
if ((tz != null) && (tz.trim().length() > 0)) {
AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
if (canModify) {
CCDropDownMenu list = (CCDropDownMenu) viewBean.getChild(STANDARDTIMEZONE);
OptionList optList = list.getOptions();
if ((optList != null) && optList.hasValue(tz)) {
propModel.setValue(STANDARDTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "standard");
} else {
propModel.setValue(CUSTOMTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "custom");
}
} else {
String[] ids = TimeZone.getAvailableIDs();
boolean contains = false;
for (int i = 0; (i < ids.length) && !contains; i++) {
contains = ids[i].equals(tz);
}
if (contains) {
propModel.setValue(STANDARDTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "standard");
} else {
propModel.setValue(CUSTOMTIMEZONE, tz);
propModel.setValue(RADIOTIMEZONE, "custom");
}
}
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class ConfigureOAuth2ViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
try {
OAuth2Model model = (OAuth2Model) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
String realm = getRequestContext().getRequest().getParameter("realm");
if (realm != null && !realm.trim().isEmpty()) {
setDisplayFieldValue(REALM, realm);
}
final String titleMessage = model.getLocalizedString(TITLE_MESSAGE);
ptModel.setPageTitleText(MessageFormat.format(titleMessage, model.getDisplayName()));
ptModel.setPageTitleHelpMessage(model.getLocalizedHelpMessage());
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class SMProfileViewBean method beginDisplay.
/**
* Sets the required information to display the page.
*
* @param event display event.
* @throws ModelControlException if problem access value of component.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
if (validSession) {
super.beginDisplay(event);
SMProfileModel model = (SMProfileModel) getModel();
Map map = model.getServerNames();
OptionList optList = new OptionList();
CCDropDownMenu child = (CCDropDownMenu) getChild(CHILD_SERVER_NAME_MENU);
String value = (String) child.getValue();
if (map != null && !map.isEmpty()) {
for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) {
String str = (String) iter.next();
String val = (String) map.get(str);
optList.add(str, val);
if (value == null) {
child.setValue(val);
}
}
}
child.setOptions(optList);
value = (String) child.getValue();
model.setProfileServerName(value);
SMSessionCache cache = null;
try {
cache = model.getSessionCache(getFilterString());
if (cache != null) {
populateTableModel(cache.getSessions());
String errorMessage = cache.getErrorMessage();
if (errorMessage != null && errorMessage.length() > 0) {
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", errorMessage);
}
}
} catch (AMConsoleException ae) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ae.getMessage());
}
if (cache == null) {
populateTableModel(Collections.EMPTY_LIST);
}
setPageSessionAttribute(SERVER_NAME, value);
// Set our Sub-Tabs
addSessionsTab(model, 1);
// Both the SFO is Enabled and Repository Type has been Specified for view of HA Tabs.
if ((!SystemPropertiesManager.get(CoreTokenConstants.IS_SFO_ENABLED, "false").equalsIgnoreCase("true")) && (SystemPropertiesManager.get(CoreTokenConstants.SYS_PROPERTY_SESSION_HA_REPOSITORY_TYPE, "None").equalsIgnoreCase("None"))) {
removeSessionsTab();
}
}
}
Aggregations