use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class SelectRealmViewBean method setSchemes.
private void setSchemes(String realm) {
if ((realm == null) || (realm.length() == 0)) {
realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
}
SelectRealmModel model = (SelectRealmModel) getModel();
try {
Set schemes = model.getAuthenticationInstances(realm);
CCSelect sl = (CCSelect) getChild(ATTR_SCHEMES);
sl.setOptions(createOptionList(schemes));
} catch (AMConsoleException e) {
if (!isInlineAlertMessageSet()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
}
use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method setPossibleValues.
private void setPossibleValues(String childName) {
if (canModify) {
CCSelect selectView = (CCSelect) getChild(childName);
Set values = getValidValues();
if (values != null) {
OptionList optList = createOptionList(values);
selectView.setOptions(optList);
}
String defaultVal = "";
if (!bFilter) {
Set defaultsValues = getDefaultValues();
if ((defaultsValues != null) && !defaultsValues.isEmpty()) {
defaultVal = (String) defaultsValues.iterator().next();
}
selectView.setValue("");
}
} else {
if (!bFilter) {
Set defaultsValues = getDefaultValues();
propertySheetModel.setValue(childName, defaultsValues.iterator().next());
}
}
}
use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class PMDefaultAuthSchemeConditionEditViewBean method setPropertiesValues.
protected void setPropertiesValues(Map values) {
if ((values != null) && !values.isEmpty()) {
for (Iterator i = values.keySet().iterator(); i.hasNext(); ) {
String propName = (String) i.next();
Set propValue = (Set) values.get(propName);
if ((propValue != null) && !propValue.isEmpty()) {
if (propName.equals(AuthSchemeCondition.AUTH_SCHEME) && canModify) {
Set val = (Set) values.get(propName);
AMModel model = getModel();
CCSelect sl = (CCSelect) getChild(AuthSchemeCondition.AUTH_SCHEME);
sl.setOptions(createOptionList(getLabelValueMap(propValue)));
propertySheetModel.setValues(propName, propValue.toArray(), model);
} else {
StringBuilder strValue = new StringBuilder(16);
for (Iterator x = propValue.iterator(); x.hasNext(); ) {
String tmp = (String) x.next();
if (strValue.length() > 0) {
strValue.append(", ");
}
strValue.append(tmp);
}
setDisplayFieldValue(propName, strValue.toString());
}
}
}
}
}
use of com.sun.web.ui.view.html.CCSelect 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());
}
}
}
}
use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class PMDefaultAuthSchemeConditionAddViewBean method setPropertiesValues.
protected void setPropertiesValues(Map values) {
if ((values != null) && !values.isEmpty()) {
for (Iterator i = values.keySet().iterator(); i.hasNext(); ) {
String propName = (String) i.next();
if (propName.equals(AuthSchemeCondition.AUTH_SCHEME)) {
Set val = (Set) values.get(propName);
if ((val != null) && !val.isEmpty()) {
AMModel model = getModel();
CCSelect sl = (CCSelect) getChild(AuthSchemeCondition.AUTH_SCHEME);
sl.setOptions(createOptionList(getLabelValueMap(val)));
propertySheetModel.setValues(propName, val.toArray(), model);
}
}
}
}
}
Aggregations