use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class ServerEditGeneralViewBean method getParentSites.
private void getParentSites(String serverName, ServerSiteModel model) throws AMConsoleException {
Set sites = model.getSiteNames();
OptionList choices = createOptionList(sites);
choices.add(0, new Option(model.getLocalizedString("none.site"), ""));
String parentSite = model.getServerSite(serverName);
if (parentSite == null) {
parentSite = "";
}
CCDropDownMenu cb = (CCDropDownMenu) getChild(PARENT_SITE);
cb.resetStateData();
cb.setValue(parentSite);
cb.setOptions(choices);
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class SAMLv2Base method populateAuthenticationContext.
/**
* For the given set of authContexts read from the extended metadata, populate the table and dropdown menu
* @param authContexts The set of SAMLv2AuthContexts read from the extended metadata
* @param tblAuthContextsModel The table model to populate
* @param dropdownContextRef The name of the context dropdown menu component to populate
*/
protected void populateAuthenticationContext(SAMLv2AuthContexts authContexts, CCActionTableModel tblAuthContextsModel, String dropdownContextRef) {
// Create lists from defaults that can be updated as there maybe custom entries from the extended metadata.
Set<String> contextNames = new LinkedHashSet<String>(DEFAULT_AUTH_CONTEXT_REF_NAMES);
OptionList options = new OptionList();
// Used to indicate no default context
options.add(getLabel("none"), "none");
for (String name : contextNames) {
options.add(getLabel(name), name);
}
// Need to compare the list from the metadata to the default list and any that are missing should be added
// to the set being shown in the console as they will be custom entries
Map<String, SAMLv2AuthContexts.SAMLv2AuthContext> contexts = authContexts.getCollections();
for (SAMLv2AuthContexts.SAMLv2AuthContext value : contexts.values()) {
if (contextNames.add(value.name)) {
options.add(getLabel(value.name), value.name);
}
}
CCDropDownMenu ac = (CCDropDownMenu) getChild(dropdownContextRef);
ac.setOptions(options);
tblAuthContextsModel.clear();
int i = 0;
for (String name : contextNames) {
populateAuthenticationContext(name, authContexts, i++, tblAuthContextsModel, dropdownContextRef);
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class FSSAMLTrustedPartnersViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
if (populateValues) {
int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
List list = (List) getPageSessionAttribute("samlPropertyAttributes");
setValues(AMPipeDelimitAttrTokenizer.getInstance().tokenizes((String) list.get(index)));
}
Set attributeNames = getAttributeNames();
if (attributeNames.contains(SAMLConstants.VERSION)) {
CCDropDownMenu menu = (CCDropDownMenu) getChild(SAMLConstants.VERSION);
String version = (String) menu.getValue();
if ((version == null) || (version.length() == 0)) {
menu.setValue("1.1");
}
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class MAPDeviceProfileViewBean method initializedClassificationDropDownList.
private void initializedClassificationDropDownList() {
MAPDeviceProfileModel model = (MAPDeviceProfileModel) getModel();
String[] classification = model.getAttributeClassification(deviceName);
if (classification != null) {
Map localizedLabels = model.getLocalizedClassificationLabels(classification);
OptionList optList = new OptionList();
for (int i = 0; i < classification.length; i++) {
String c = classification[i];
String label = (String) localizedLabels.get(c);
if ((label == null) || (label.trim().length() == 0)) {
label = c;
}
optList.add(label, c);
}
CCDropDownMenu cb = (CCDropDownMenu) getChild(SINGLECHOICE_CLASSIFICATION);
cb.setOptions(optList);
String value = (String) cb.getValue();
if ((value == null) || (value.length() == 0)) {
cb.setValue(classification[0]);
setDisplayFieldValue(TF_CLASSIFICATION, classification[0]);
} else {
setDisplayFieldValue(TF_CLASSIFICATION, value);
}
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method setStyles.
private void setStyles() {
MAPServiceModel model = (MAPServiceModel) getModel();
Set styles = model.getStyleNames(getProfileName());
if ((styles != null) && !styles.isEmpty()) {
OptionList styleList = new OptionList();
for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
styleList.add(name, name);
}
CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
menu.setOptions(styleList);
}
}
Aggregations