use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class IdentityMembershipConditionAddViewBean method setPropertiesValues.
protected void setPropertiesValues(PolicyModel model, Map values) {
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
helper.setSelectedIdentities(child, model.getUserSSOToken(), model.getUserLocale(), this, values);
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class IdentitySubjectAddViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
IdentitySubjectModel model = (IdentitySubjectModel) getModel();
Set values = null;
if (bFilter) {
Set defaultValue = getValues();
if (defaultValue != null) {
values = getAMIdentity(model, defaultValue);
}
}
super.beginDisplay(event);
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
// initialize the 'Filter' drop down menu
// supportedEntityTypes is a map of entity name to its
// localized value
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 = createOptionList(getPossibleValues(model, realmName));
child.resetStateData();
addRemoveModel.setAvailableOptionList(possible);
List selectedIds = AMAdminUtils.toList(selected);
addRemoveModel.setSelectedOptionList(createOptionList(getAMIdentity(model, selectedIds)));
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class IdentitySubjectEditViewBean method getValues.
protected Set getValues(String subjectType) throws ModelControlException {
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
Set values = getValues(addRemoveModel.getSelectedOptionList());
if ((values == null) || values.isEmpty()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.missing.subject.value");
values = null;
}
return values;
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method getActionSchemaValues.
private Set getActionSchemaValues(Syntax syntax) {
Set values = null;
int syn = AMDisplayType.getDisplaySyntax(syntax);
switch(syn) {
case AMDisplayType.SYNTAX_TEXT:
values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_TEXT_VALUE));
break;
case AMDisplayType.SYNTAX_SINGLE_CHOICE:
values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_SINGLE_CHOICE_VALUE));
break;
case AMDisplayType.SYNTAX_MULTIPLE_CHOICE:
if (addRemoveModel != null) {
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
values = getValues(addRemoveModel.getSelectedOptionList());
break;
}
}
return (values == null) ? Collections.EMPTY_SET : values;
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method setAddRemoveModel.
protected void setAddRemoveModel() throws ModelControlException {
if (canModify) {
Set values = getValidValues();
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
Set defaultValues = (bFilter) ? getValues() : getDefaultValues();
child.resetStateData();
if (values != null) {
if (defaultValues != null) {
values.removeAll(defaultValues);
}
addRemoveModel.setAvailableOptionList(createOptionList(values));
} else {
addRemoveModel.setAvailableOptionList(new OptionList());
}
addRemoveModel.setSelectedOptionList(createOptionList(defaultValues));
}
}
Aggregations