use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class ActionTiledView method displayRadioAction.
private boolean displayRadioAction(ActionSchema actionSchema, String childName, int type, int syntax) {
boolean display = false;
RuleOpViewBeanBase parentVB = (RuleOpViewBeanBase) getParentViewBean();
String serviceType = (String) parentVB.propertySheetModel.getValue(RuleOpViewBeanBase.SERVICE_TYPE);
if ((type == AMDisplayType.TYPE_SINGLE) && (syntax == AMDisplayType.SYNTAX_RADIO)) {
CCRadioButton rb = (CCRadioButton) getChild(childName);
OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
rb.setOptions(optList);
if ((optList != null) && (optList.size() > 0)) {
Set set = parentVB.isSubmitCycle() ? parentVB.getCurrentActionValues(actionSchema) : parentVB.getDefaultActionValues(actionSchema);
String value = ((set == null) || set.isEmpty()) ? optList.getValue(0) : (String) set.iterator().next();
rb.setValue(value);
display = true;
}
}
return display;
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class CreateHostedIDPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
String value = (String) getDisplayFieldValue(HAS_META_DATA);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(HAS_META_DATA, "no");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
value = (String) getDisplayFieldValue(RADIO_EXTENDED);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_EXTENDED, "file");
}
value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "file");
}
setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
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);
try {
TaskModel model = (TaskModel) 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);
}
Set keys = model.getSigningKeys();
OptionList optionList = createOptionList(keys);
optionList.add(0, model.getLocalizedString("configure.provider.keys.none"), "");
CCDropDownMenu menuSignKeys = (CCDropDownMenu) getChild(SIGN_KEY);
menuSignKeys.setOptions(optionList);
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class CreateHostedSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
String value = (String) getDisplayFieldValue(HAS_META_DATA);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(HAS_META_DATA, "no");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
value = (String) getDisplayFieldValue(RADIO_EXTENDED);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_EXTENDED, "file");
}
value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "file");
}
setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
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);
CCCheckBox cbAttrDefault = (CCCheckBox) getChild("tfDefaultAttrMapping");
cbAttrDefault.setChecked(true);
try {
TaskModel model = (TaskModel) 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);
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class CreateRemoteSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
HttpServletRequest req = getRequestContext().getRequest();
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue(COT, cot);
setDisplayFieldValue(COT_CHOICE, cot);
}
String realm = req.getParameter("realm");
if ((realm != null) && (realm.trim().length() > 0)) {
setDisplayFieldValue(REALM, realm);
}
String value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "url");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
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);
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AMFormatUtils method getSortedOptionList.
/**
* Returns an option list of sorted label.
*
* @param map Map of value to its label.
* @param locale Locale of user.
* @return an option list of sorted label.
*/
public static OptionList getSortedOptionList(Map map, Locale locale) {
OptionList optionList = new OptionList();
Map reversed = reverseStringMap(map);
List sorted = sortItems(reversed.keySet(), locale);
for (Iterator iter = sorted.iterator(); iter.hasNext(); ) {
String label = (String) iter.next();
optionList.add(label, (String) reversed.get(label));
}
return optionList;
}
Aggregations