use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class SMProfileViewBean method createChild.
/**
* Creates user interface components used by this view bean.
*
* @param name of component
* @return child component
*/
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SESSIONS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblModel, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblModel.isChildSupported(name)) {
view = tblModel.createChild(this, name);
} else if (name.equals(CHILD_SERVER_NAME_MENU)) {
view = new CCDropDownMenu(this, name, null);
} else if (name.equals(LOGOUT_URL)) {
return new CCStaticTextField(this, LOGOUT_URL, "");
} else if (name.equals(CHILD_SERVER_NAME_HREF)) {
view = new CCHref(this, name, null);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.html.CCDropDownMenu 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);
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class AuthPropertiesViewBean method populateConfigMenu.
private void populateConfigMenu() {
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if ((realm == null) || (realm.length() == 0)) {
realm = AMModelBase.getStartDN(getRequestContext().getRequest());
}
AuthPropertiesModel model = (AuthPropertiesModel) getModel();
OrderedSet configs = new OrderedSet();
configs.addAll(AuthConfigurationModelImpl.getNamedConfigurations(model.getUserSSOToken(), realm));
OptionList containers = new OptionList();
for (Iterator i = configs.iterator(); i.hasNext(); ) {
String entry = (String) i.next();
containers.add(entry, entry);
}
CCDropDownMenu ac = (CCDropDownMenu) getChild(AUTH_CONFIG);
ac.setOptions(containers);
CCDropDownMenu aac = (CCDropDownMenu) getChild(ADMIN_AUTH_CONFIG);
aac.setOptions(containers);
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class ImportEntityViewBean method populateRealmData.
private void populateRealmData() {
Set realmNames = Collections.EMPTY_SET;
ImportEntityModel model = (ImportEntityModel) getModel();
try {
realmNames = model.getRealmNames("/", "*");
CCDropDownMenu menu = (CCDropDownMenu) getChild(ImportEntityModel.REALM_NAME);
OptionList sortedList = createOptionList(realmNames);
OptionList optList = new OptionList();
int size = sortedList.size();
for (int i = 0; i < size; i++) {
String name = sortedList.getValue(i);
optList.add(getPath(name), name);
}
menu.setOptions(optList);
} catch (AMConsoleException e) {
debug.warning("ImportEntityViewBean.populateRealmData ", e);
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "import.entity.populaterealmdata.error");
}
}
use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.
the class ConfigureSalesForceAppsViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
HttpServletRequest req = getRequestContext().getRequest();
try {
TaskModel model = (TaskModel) getModel();
Map map = model.getRealmCotWithHostedIDPs();
Set realms = new TreeSet();
realms.addAll(map.keySet());
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
String realm = req.getParameter("realm");
if ((realm != null) && (realm.trim().length() > 0)) {
setDisplayFieldValue(REALM, realm);
} else {
if (!realms.isEmpty()) {
realm = (String) realms.iterator().next();
}
}
if ((realm != null) && (realm.trim().length() > 0)) {
Map mapCots = (Map) map.get(realm);
Set cots = new TreeSet();
cots.addAll(mapCots.keySet());
CCDropDownMenu menuCOT = (CCDropDownMenu) getChild("choiceCOT");
menuCOT.setOptions(createOptionList(cots));
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue("choiceCOT", cot);
} else {
if (!cots.isEmpty()) {
cot = (String) cots.iterator().next();
}
}
if ((cot != null) && (cot.trim().length() > 0)) {
Set idps = new TreeSet();
idps.addAll((Set) mapCots.get(cot));
CCDropDownMenu menuIDP = (CCDropDownMenu) getChild("choiceIDP");
menuIDP.setOptions(createOptionList(idps));
String idp = req.getParameter("entityId");
if ((idp != null) && (idp.trim().length() > 0)) {
setDisplayFieldValue("choiceIDP", idp);
}
}
//attrmapping
populateTableModel();
Set userAttrNames = AMAdminUtils.getUserAttributeNames();
userAttrNames.remove("iplanet-am-user-account-life");
CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
OptionList optList = createOptionList(userAttrNames);
optList.add(0, "name.attribute.mapping.select", "");
menuUserAttribute.setOptions(optList);
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue(COT_CHOICE, cot);
}
}
Aggregations