use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class SubConfigAddViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
SubConfigModel model = (SubConfigModel) getModel();
String schemaName = (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
if (!submitCycle) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
propertySheetModel.clear();
try {
ps.setAttributeValues(model.getServiceSchemaDefaultValues(schemaName), model);
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "noproperties.message");
}
}
Set subconfigNames = model.getSelectableConfigNames(schemaName);
if ((subconfigNames != null) && !subconfigNames.isEmpty()) {
CCDropDownMenu menu = (CCDropDownMenu) getChild(ATTR_SUBCONFIG_NAME);
OptionList optList = this.createOptionList(subconfigNames);
menu.setOptions(optList);
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class CreateCOTViewBean method populateRealmData.
private void populateRealmData() {
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
try {
Set realmNames = new TreeSet(model.getRealmNames("/", "*"));
CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_REALM_MENU);
OptionList list = new OptionList();
for (Iterator i = realmNames.iterator(); i.hasNext(); ) {
String name = (String) i.next();
list.add(getPath(name), name);
}
menu.setOptions(list);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class CreateSAML2MetaDataViewBean method populateRealmData.
private void populateRealmData() {
CreateMetaDataModel model = (CreateMetaDataModel) getModel();
try {
Set realmNames = new TreeSet(model.getRealmNames("/", "*"));
CCDropDownMenu menu = (CCDropDownMenu) getChild("singleChoiceRealm");
OptionList list = new OptionList();
for (Iterator i = realmNames.iterator(); i.hasNext(); ) {
String name = (String) i.next();
list.add(getPath(name), name);
}
menu.setOptions(list);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class IdentityMembershipHelper method setSelectedIdentities.
/**
* Populates the add remove child component with identity IDs.
*
* @param child The add remove child component.
* @param token Administrator Single Sign Token which is used to create
* <code>AMIdentity</code> object.
* @param userLocale User Locale.
* @param viewBean Instance of the view bean object that is used to create
* option list.
* @param values Map of
* <code>AMIdentityMembershipCondition.AM_IDENTITY_NAME</code>
* to a set of identity IDs.
*/
public static void setSelectedIdentities(CCAddRemove child, SSOToken token, Locale userLocale, AMViewBeanBase viewBean, Map values) {
if ((values != null) && !values.isEmpty()) {
Set setValues = (Set) values.get(AMIdentityMembershipCondition.AM_IDENTITY_NAME);
if ((setValues != null) && !setValues.isEmpty()) {
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) child.getModel();
OptionList optList = createOptionList(token, userLocale, viewBean, setValues);
addRemoveModel.setSelectedOptionList(optList);
}
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class IdentityMembershipHelper method createOptionList.
/**
* Returns an option list that contains <code>AMIdentity</code> object
* options.
*
* @param token Administrator Single Sign On token that is used to create
* the <code>AMIdentity</code> object.
* @param userLocale User Locale.
* @param viewBean Instance of the view bean object that is used to create
* option list.
* @param values Either a collection of identity IDs or a collection of
* <code>AMIdentity</code> objects.
* @return an option list that contains <code>AMIdentity</code> object
* options.
*/
public static OptionList createOptionList(SSOToken token, Locale userLocale, AMViewBeanBase viewBean, Collection values) {
OptionList optList = new OptionList();
if ((values != null) && !values.isEmpty()) {
/*
* Need to convert to AMIdentity object if the set contains
* universal Ids
*/
Collection amIdentity = (values.iterator().next() instanceof String) ? getAMIdentity(token, values) : values;
Map entries = new HashMap(values.size() * 2);
for (Iterator iter = amIdentity.iterator(); iter.hasNext(); ) {
AMIdentity identity = (AMIdentity) iter.next();
entries.put(IdUtils.getUniversalId(identity), PolicyUtils.getDNDisplayString(identity.getName()));
}
optList = viewBean.createOptionList(entries, userLocale);
}
return optList;
}
Aggregations