use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class IDRepoModelImpl method getIDRepoTypes.
/**
* Returns an option list of ID Repo type name to its localized string.
*
* @return an option list of ID Repo type name to its localized string.
*/
public OptionList getIDRepoTypes() throws AMConsoleException {
Map map = AMFormatUtils.reverseStringMap(getIDRepoTypesMap());
OptionList optList = new OptionList();
List sorted = AMFormatUtils.sortKeyInMap(map, getUserLocale());
for (Iterator iter = sorted.iterator(); iter.hasNext(); ) {
String label = (String) iter.next();
optList.add(label, (String) map.get(label));
}
return optList;
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method populateDirectiveMechIDRefs.
protected void populateDirectiveMechIDRefs(SMDiscoEntryData data) {
List mechIDs = data.getPossibleDirectivesToMechIDs();
if (canModify) {
OptionList optionList = createOptionList(mechIDs);
for (Iterator i = DIRECTIVES_MECHID_LIST.iterator(); i.hasNext(); ) {
String childName = (String) i.next();
CCSelectableList child = (CCSelectableList) getChild(childName);
child.setOptions(optionList);
}
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method getValues.
protected SMDiscoEntryData getValues(boolean validated) throws AMConsoleException {
SMDiscoEntryData smDisco = new SMDiscoEntryData();
smDisco.abstractValue = ((String) propertySheetModel.getValue(ATTR_ABSTRACT)).trim();
smDisco.serviceType = ((String) propertySheetModel.getValue(ATTR_SERVICE_TYPE)).trim();
smDisco.providerId = ((String) propertySheetModel.getValue(ATTR_PROVIDER_ID)).trim();
String optionFlag = (String) propertySheetModel.getValue(ATTR_RESOURCE_OFFERING_OPTIONS_OPTIONS);
smDisco.noOption = optionFlag.equalsIgnoreCase("true");
CCEditableList eList = (CCEditableList) getChild(ATTR_RESOURCE_OFFERING_OPTIONS_LIST);
eList.restoreStateData();
CCEditableListModel eModel = (CCEditableListModel) eList.getModel();
OptionList options = eModel.getOptionList();
if (options != null) {
smDisco.options = AMAdminUtils.toList(options);
}
List descData = (List) removePageSessionAttribute(ATTR_SECURITY_MECH_ID);
if (descData != null) {
smDisco.descData = descData;
}
smDisco.directives = getDirectiveMechIDMapping();
if (validated) {
if ((descData == null) || descData.isEmpty()) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.service.desc.message");
} else if (smDisco.serviceType.length() == 0) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.serviceType.message");
} else if (smDisco.providerId.length() == 0) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.providerId.message");
}
}
return smDisco;
}
use of com.iplanet.jato.view.html.OptionList 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();
}
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AgentProfileViewBean method setProperty.
private void setProperty(AgentsModel model, String type, String universalId) throws AMConsoleException {
Set groups = new HashSet();
Set set = new HashSet(2);
set.add(type);
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
model.getAgentGroupNames(curRealm, set, "*", groups);
CCDropDownMenu menu = (CCDropDownMenu) getChild(CHILD_AGENT_GROUP);
Set groupNames = new TreeSet();
for (Iterator i = groups.iterator(); i.hasNext(); ) {
AMIdentity amid = (AMIdentity) i.next();
groupNames.add(amid.getName());
}
OptionList optList = createOptionList(groupNames);
optList.add(0, model.getLocalizedString("agentgroup.none"), "");
menu.setOptions(optList);
String group = model.getAgentGroup(curRealm, universalId);
if (group != null) {
menu.setValue(group);
}
}
Aggregations