use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method setDirectiveMechIDMapping.
private void setDirectiveMechIDMapping(SMDiscoEntryData smDisco) {
populateDirectiveMechIDRefs(smDisco);
Map directives = smDisco.directives;
Set directiveNames = directives.keySet();
for (Iterator iter = DIRECTIVES_MECHID.iterator(); iter.hasNext(); ) {
String directiveName = (String) iter.next();
String childName = (String) MAP_DIRECTIVES_MECHID.get(directiveName);
CCCheckBox cb = null;
CCStaticTextField staticText = null;
if (canModify) {
cb = (CCCheckBox) getChild(childName.substring(0, childName.length() - 4));
} else {
staticText = (CCStaticTextField) getChild(childName.substring(0, childName.length() - 4));
}
if (directiveNames.contains(directiveName)) {
List refIds = (List) directives.get(directiveName);
if (canModify) {
cb.setChecked(true);
CCSelectableList child = (CCSelectableList) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValues(refIds.toArray());
} else {
child.setValues(null);
}
} else {
staticText.setValue("true");
CCStaticTextField child = (CCStaticTextField) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValue(AMAdminUtils.getString(refIds, ",", false));
} else {
child.setValue("");
}
}
} else {
if (canModify) {
cb.setChecked(false);
} else {
staticText.setValue("false");
}
}
}
}
use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class EntityMembersFilteredIdentityViewBean method getMemberNames.
private void getMemberNames() {
EntitiesModel model = (EntitiesModel) getModel();
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
Set entities = model.getMembers(curRealm, universalId, type);
CCSelectableList list = (CCSelectableList) getChild(MEMBERS);
list.setOptions(getOptionListForEntities(entities));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class ActionTiledView method displayMultipleChoiceAction.
private boolean displayMultipleChoiceAction(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_MULTIPLE_CHOICE) {
CCSelectableList child = (CCSelectableList) getChild(childName);
child.resetStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) model.getModel(childName);
Set defaultValues = parentVB.getValues(addRemoveModel.getSelectedOptionList());
if ((defaultValues == null) || defaultValues.isEmpty()) {
defaultValues = parentVB.getDefaultActionValues(actionSchema);
}
OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
int sz = optList.size();
OptionList availList = new OptionList();
for (int i = 0; i < sz; i++) {
Option opt = (Option) optList.get(i);
if (!defaultValues.contains(opt.getValue())) {
availList.add(opt);
}
}
addRemoveModel.setAvailableOptionList(availList);
addRemoveModel.setSelectedOptionList(parentVB.createOptionList(defaultValues));
display = true;
}
return display;
}
use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method getManagedResources.
protected void getManagedResources() {
if (canModify) {
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String serviceType = (String) propertySheetModel.getValue(SERVICE_TYPE);
CCSelectableList cb = (CCSelectableList) getChild(MANAGED_RESOURCES);
cb.setOptions(createOptionList(model.getManagedResources(realmName, serviceType)));
}
}
use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class RMRealmAddViewBean method populateRealmParentList.
private void populateRealmParentList() {
RMRealmModel model = (RMRealmModel) getModel();
Set realms = new HashSet();
try {
realms = model.getRealmNames(model.getStartDN(), "*");
} catch (AMConsoleException a) {
// do something here
}
Map display = new HashMap(realms.size() * 2);
for (Iterator i = realms.iterator(); i.hasNext(); ) {
String tmp = (String) i.next();
String path = getPath(tmp);
display.put(tmp, path);
}
OptionList optionList = createOptionList(display);
CCSelectableList parentList = (CCSelectableList) getChild(RMRealmModel.TF_PARENT);
parentList.setOptions(optionList);
String value = (String) parentList.getValue();
if ((value == null) || (value.length() == 0)) {
Option opt = optionList.get(0);
parentList.setValue(opt.getValue());
}
}
Aggregations