use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class ServicesSelectViewBean method setRadioButtons.
private void setRadioButtons(CCRadioButton rb) {
try {
EntitiesModel model = (EntitiesModel) getModel();
String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
Map assigned = model.getAssignedServiceNames(universalId);
Map assignables = model.getAssignableServiceNames(universalId);
for (Iterator i = assigned.keySet().iterator(); i.hasNext(); ) {
assignables.remove(i.next());
}
if (!assignables.isEmpty()) {
OptionList optList = AMFormatUtils.getSortedOptionList(assignables, model.getUserLocale());
rb.setOptions(optList);
if (!submitCycle) {
rb.setValue(optList.getValue(0));
}
}
} 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 IdentityMembershipConditionAddViewBean method beginDisplay.
/**
* Sets the values to UI model.
*
* @param event Display Event.
* @throws ModelControlException if the default UI model is not accessible.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
IdentitySubjectModel subjectModel = getSubjectModel();
PolicyModel model = (PolicyModel) getModel();
super.beginDisplay(event);
CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
Map supportedEntityTypes = model.getSupportedEntityTypes(realmName);
OptionList entityTypes = createOptionList(supportedEntityTypes);
entityTypes.add(0, "policy.subject.select.identity.type", "");
menu.setOptions(entityTypes);
menu.setValue("");
// initialize the available/selected component
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
OptionList selected = addRemoveModel.getSelectedOptionList();
OptionList possible = helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, getPossibleValues(subjectModel, realmName));
child.resetStateData();
addRemoveModel.setAvailableOptionList(possible);
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class IdentityMembershipConditionEditViewBean method beginDisplay.
/**
* Sets the values to UI model.
*
* @param event Display Event.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
IdentitySubjectModel subjectModel = getSubjectModel();
PolicyModel model = (PolicyModel) getModel();
super.beginDisplay(event);
if (!canModify) {
Map mapValues = getDefaultValues();
if ((mapValues != null) && !mapValues.isEmpty()) {
Set values = (Set) mapValues.get(AMIdentityMembershipCondition.AM_IDENTITY_NAME);
Set identityNames = helper.getAMIdentityNames(model.getUserSSOToken(), values);
propertySheetModel.setValue(VALUES_MULTIPLE_CHOICE_VALUE, AMAdminUtils.getString(identityNames, ",", false));
}
} else {
CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
Map supportedEntityTypes = model.getSupportedEntityTypes(realmName);
OptionList entityTypes = createOptionList(supportedEntityTypes);
entityTypes.add(0, "policy.subject.select.identity.type", "");
menu.setOptions(entityTypes);
menu.setValue("");
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
if (!submitCycle) {
helper.setSelectedIdentities(child, model.getUserSSOToken(), model.getUserLocale(), this, getDefaultValues());
} else {
// initialize the available/selected component
OptionList possible = helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, getPossibleValues(subjectModel, realmName));
OptionList selected = addRemoveModel.getSelectedOptionList();
List selectedIds = AMAdminUtils.toList(selected);
child.resetStateData();
addRemoveModel.setAvailableOptionList(possible);
addRemoveModel.setSelectedOptionList(helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, selectedIds));
}
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class IdentitySubjectEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
IdentitySubjectModel model = (IdentitySubjectModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
Set values = null;
if (bFilter) {
Set defaultValue = getValues();
if (defaultValue != null) {
values = getAMIdentity(model, defaultValue);
}
} else {
values = getAMIdentity(model, getDefaultValues(model));
}
super.beginDisplay(event);
if (canModify) {
Map supportedEntityTypes = model.getSupportedEntityTypes(realmName);
CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
OptionList entityTypes = createOptionList(supportedEntityTypes);
entityTypes.add(0, "policy.subject.select.identity.type", "");
menu.setOptions(entityTypes);
menu.setValue("");
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
OptionList selected = addRemoveModel.getSelectedOptionList();
child.resetStateData();
addRemoveModel.setAvailableOptionList(createOptionList(getPossibleValues(model, realmName, values)));
if (submitCycle) {
addRemoveModel.setSelectedOptionList(selected);
} else {
addRemoveModel.setSelectedOptionList(createOptionList(values));
}
} else {
propertySheetModel.setValue(VALUES_MULTIPLE_CHOICE_VALUE, AMAdminUtils.getString(getDefaultValues(), ",", false));
}
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class PMDefaultAuthSchemeConditionAddViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
CCSelect sl = (CCSelect) getChild(AuthSchemeCondition.AUTH_SCHEME);
OptionList optList = sl.getOptions();
if (optList != null) {
int size = optList.size();
String emptyRealm = getModel().getLocalizedString("policy.condition.null.realm");
for (int i = 0; i < size; i++) {
Option opt = optList.get(i);
if (opt.getLabel().startsWith(":")) {
opt.setLabel(emptyRealm + opt.getLabel());
}
}
}
}
Aggregations