use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AuthToServiceEditViewBean method beginDisplay.
/**
* Set the realm names and service names.
*
* @param event Display event.
* @throws ModelControlException if default <code>JATO</code> cannot be
* instantiated.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String filter = (String) getDisplayFieldValue(AuthToServiceHelper.ATTR_FILTER);
if ((filter == null) || (filter.trim().length() == 0)) {
setDisplayFieldValue(AuthToServiceHelper.ATTR_FILTER, "*");
}
Set realmNames = getRealmNames(filter);
if (realmNames != null) {
realmNames.add("");
}
boolean nolongExistRealm = false;
String realmValue = (String) propertySheetModel.getValue(AuthToServiceHelper.ATTR_REALM);
if (!bSearchForRealm && !bRealmSelect) {
if (realmValue == null) {
realmValue = "";
}
if (realmNames == null) {
realmNames = new HashSet(2);
}
if (!realmNames.contains(realmValue)) {
realmNames.add(realmValue);
nolongExistRealm = true;
if (!isInlineAlertMessageSet()) {
String msg = getModel().getLocalizedString("policy.condition.authlevel.no.longer.exist.realm");
String[] param = { realmValue };
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", MessageFormat.format(msg, (Object[]) param));
}
}
}
if ((realmNames != null) && !realmNames.isEmpty()) {
CCSelect sl = (CCSelect) getChild(AuthToServiceHelper.ATTR_REALM);
sl.setOptions(createOptionList(getLabelValueMap(realmNames)));
String realm = (bSearchForRealm) ? (String) realmNames.iterator().next() : (String) sl.getValue();
if (realm == null) {
realm = realmValue;
sl.setValue(realm);
}
if (!nolongExistRealm) {
setServiceNames(realm);
} else {
CCSelect slService = (CCSelect) getChild(AuthToServiceHelper.ATTR_SERVICE);
Set svcName = new HashSet(2);
svcName.add(propertySheetModel.getValue(AuthToServiceHelper.ATTR_SERVICE));
slService.setOptions(createOptionList(svcName));
}
} else {
CCSelect slService = (CCSelect) getChild(AuthToServiceHelper.ATTR_SERVICE);
slService.setOptions(new OptionList());
}
}
use of com.iplanet.jato.view.html.OptionList 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.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AuthActionTiledView method displayModuleNameMenu.
private boolean displayModuleNameMenu(String childName, int index) {
boolean display = false;
AuthConfigViewBean parentVB = (AuthConfigViewBean) getParentViewBean();
String value = parentVB.getModuleName(index);
CCDropDownMenu list = (CCDropDownMenu) getChild(childName);
OptionList optList = parentVB.getModuleNameChoiceValues();
if ((optList != null) && (optList.size() > 0)) {
if ((value != null) && (value.length() != 0)) {
if (!containsOption(optList, value)) {
optList.add(0, value, value);
}
list.setOptions(optList);
list.setValue(value);
display = true;
}
}
return display;
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AuthActionTiledView method displayCriteriaMenu.
private boolean displayCriteriaMenu(String childName, int index) {
boolean display = false;
AuthConfigViewBean parentVB = (AuthConfigViewBean) getParentViewBean();
CCDropDownMenu list = (CCDropDownMenu) getChild(childName);
OptionList optList = parentVB.getCriteriaNameChoiceValues();
list.setOptions(optList);
if ((optList != null) && (optList.size() > 0)) {
String value = parentVB.getModuleFlag(index);
if ((value != null) && (value.length() != 0)) {
list.setValue(value);
display = true;
}
}
return display;
}
use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.
the class AMPropertySheetModel method clear.
public void clear() {
super.clear();
for (Iterator iter = children.iterator(); iter.hasNext(); ) {
View view = (View) iter.next();
if (CCAddRemove.class.isInstance(view)) {
CCAddRemoveModel m = (CCAddRemoveModel) getModel(view.getName());
m.clear();
m.setAvailableOptionList(new OptionList());
m.setSelectedOptionList(new OptionList());
} else if (CCEditableList.class.isInstance(view)) {
CCEditableListModel m = (CCEditableListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCEditableList) view).resetStateData();
} else if (CCOrderedList.class.isInstance(view)) {
CCOrderedListModel m = (CCOrderedListModel) getModel(view.getName());
m.setSelectedOptionList(new OptionList());
((CCOrderedList) view).resetStateData();
} else if (CCUnOrderedList.class.isInstance(view)) {
CCUnOrderedListModel m = (CCUnOrderedListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCUnOrderedList) view).resetStateData();
} else if (CCMapList.class.isInstance(view)) {
CCMapListModel m = (CCMapListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCMapList) view).resetStateData();
} else {
if (DisplayFieldImpl.class.isInstance(view)) {
((DisplayFieldImpl) view).setValues(null);
}
}
}
}
Aggregations