use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class AuthToRealmEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String filter = (String) getDisplayFieldValue(AuthToRealmHelper.ATTR_FILTER);
if ((filter == null) || (filter.trim().length() == 0)) {
setDisplayFieldValue(AuthToRealmHelper.ATTR_FILTER, "*");
}
try {
Set realmNames = helper.getRealmNames(filter, (PolicyModel) getModel());
if (realmNames.isEmpty()) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "policy.condition.authtorealm.no.search.result.message");
}
if (realmValue != null) {
realmNames.add(realmValue);
}
CCSelect sl = (CCSelect) getChild(AuthToRealmHelper.ATTR_VALUE);
sl.setOptions(createOptionList(realmNames));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class AuthToServiceAddViewBean 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.isEmpty()) {
realmNames.add("");
CCSelect sl = (CCSelect) getChild(AuthToServiceHelper.ATTR_REALM);
sl.setOptions(createOptionList(getLabelValueMap(realmNames)));
String realm = null;
if (!bRealmSelect) {
realm = (String) realmNames.iterator().next();
sl.setValue(realm);
} else {
realm = (String) sl.getValue();
}
setServiceNames(realm);
} else {
CCSelect slService = (CCSelect) getChild(AuthToServiceHelper.ATTR_SERVICE);
slService.setOptions(new OptionList());
}
}
use of com.sun.web.ui.view.html.CCSelect in project OpenAM by OpenRock.
the class AuthToServiceAddViewBean method setServiceNames.
private void setServiceNames(String realm) {
try {
Set serviceNames = helper.getAssignedServiceNamesInRealm(realm, (PolicyModel) getModel());
CCSelect slService = (CCSelect) getChild(AuthToServiceHelper.ATTR_SERVICE);
slService.setOptions(createOptionList(serviceNames));
} 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 AuthToServiceEditViewBean method setServiceNames.
private void setServiceNames(String realm) {
try {
Set serviceNames = helper.getAssignedServiceNamesInRealm(realm, (PolicyModel) getModel());
CCSelect slService = (CCSelect) getChild(AuthToServiceHelper.ATTR_SERVICE);
slService.setOptions(createOptionList(serviceNames));
} 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 ReferralOpViewBeanBase method beginChildDisplay.
public boolean beginChildDisplay(ChildDisplayEvent event) {
super.endDisplay(event);
boolean display = true;
String childName = event.getChildName();
int syntax = Integer.parseInt((String) propertySheetModel.getValue(SYNTAX));
if ((childName.indexOf(LBL_FILTER) != -1) || (childName.indexOf(BTN_FILTER) != -1) || (childName.indexOf(FILTER) != -1)) {
display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE) || (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
} else if (childName.indexOf(VALUES_TEXT_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_TEXTFIELD);
Set values = getDefaultValues();
if ((values != null) && !values.isEmpty()) {
if (canModify) {
CCTextField tf = (CCTextField) getChild(childName);
tf.setValue(values.iterator().next());
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(values.iterator().next());
}
}
} else if (childName.indexOf(VALUES_SINGLE_CHOICE_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE);
if (display) {
Set values = getDefaultValues();
if (canModify) {
CCSelect child = (CCSelect) getChild(childName);
setPossibleValues(child);
if ((values != null) && !values.isEmpty()) {
child.setValue(values.iterator().next());
}
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(values.iterator().next());
}
}
} else if (childName.indexOf(VALUES_MULTIPLE_CHOICE_VALUE) != -1) {
display = (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
if (display) {
Set values = getDefaultValues();
if (canModify) {
CCSelect child = (CCSelect) getChild(childName);
setPossibleValues(child);
if ((values != null) && !values.isEmpty()) {
child.setValues(values.toArray());
}
} else {
CCStaticTextField tf = (CCStaticTextField) getChild(childName);
tf.setValue(AMAdminUtils.getString(values, ",", false));
}
}
}
return display;
}
Aggregations