use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class EntityMembershipViewBean method handleButton1Request.
public void handleButton1Request(RequestInvocationEvent event) {
submitCycle = true;
CCAddRemove child = (CCAddRemove) getChild(ADD_REMOVE_MEMBERS);
child.restoreStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) propertySheetModel.getModel(ADD_REMOVE_MEMBERS);
OptionList os = addRemoveModel.getSelectedOptionList();
EntitiesModel model = (EntitiesModel) getModel();
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
try {
Set entities = getEntitiesID(model.getMembership(curRealm, universalId, type));
Set selected = getValues(os);
Set toAdd = new HashSet(selected);
toAdd.removeAll(entities);
entities.removeAll(selected);
if (!toAdd.isEmpty()) {
model.addMemberships(universalId, toAdd);
}
if (!entities.isEmpty()) {
model.removeMemberships(universalId, entities);
}
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class SMDiscoveryDescriptionViewBeanBase method populateMechID.
void populateMechID() {
populateMechID = true;
CCAddRemoveModel model = new CCAddRemoveModel();
model.setOrientation(CCAddRemoveModel.VERTICAL);
model.setListboxHeight(CCAddRemoveModel.DEFAULT_LISTBOX_HEIGHT);
setMechID(model);
propertySheetModel.setModel(ATTR_NAME_SECURITY_MECH_ID, model);
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method createPropertyModel.
protected void createPropertyModel(String realmName) {
DelegationConfig dConfig = DelegationConfig.getInstance();
canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName(!canModify)));
propertySheetModel.clear();
if (canModify) {
addRemoveModel = new CCAddRemoveModel();
addRemoveModel.setShowMoveUpDownButtons("false");
addRemoveModel.clear();
propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
}
}
Aggregations