use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method getActionSchemaValues.
private Set getActionSchemaValues(Syntax syntax) {
Set values = null;
int syn = AMDisplayType.getDisplaySyntax(syntax);
switch(syn) {
case AMDisplayType.SYNTAX_TEXT:
values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_TEXT_VALUE));
break;
case AMDisplayType.SYNTAX_SINGLE_CHOICE:
values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_SINGLE_CHOICE_VALUE));
break;
case AMDisplayType.SYNTAX_MULTIPLE_CHOICE:
if (addRemoveModel != null) {
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
child.restoreStateData();
values = getValues(addRemoveModel.getSelectedOptionList());
break;
}
}
return (values == null) ? Collections.EMPTY_SET : values;
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method setAddRemoveModel.
protected void setAddRemoveModel() throws ModelControlException {
if (canModify) {
Set values = getValidValues();
CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
Set defaultValues = (bFilter) ? getValues() : getDefaultValues();
child.resetStateData();
if (values != null) {
if (defaultValues != null) {
values.removeAll(defaultValues);
}
addRemoveModel.setAvailableOptionList(createOptionList(values));
} else {
addRemoveModel.setAvailableOptionList(new OptionList());
}
addRemoveModel.setSelectedOptionList(createOptionList(defaultValues));
}
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class SMDiscoveryDescriptionViewBeanBase method getValues.
private SMDescriptionData getValues() throws AMConsoleException {
SMDescriptionData smData = new SMDescriptionData();
smData.descriptionID = (String) getDisplayFieldValue(TF_DESCRIPTION_ID);
if (smData.descriptionID.length() == 0) {
smData.descriptionID = SAMLUtils.generateID();
}
CCAddRemove mechIdChild = (CCAddRemove) getChild(ATTR_NAME_SECURITY_MECH_ID);
mechIdChild.restoreStateData();
CCAddRemoveModel mechIdModel = (CCAddRemoveModel) propertySheetModel.getModel(ATTR_NAME_SECURITY_MECH_ID);
smData.securityMechId = getList(mechIdModel.getSelectedOptionList());
smData.endPointUrl = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_END_POINT)).trim();
smData.soapAction = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_ACTION)).trim();
if (smData.securityMechId.isEmpty()) {
throw new AMConsoleException("discovery.service.description.missing.securityMechId.message");
}
if (smData.endPointUrl.length() == 0) {
throw new AMConsoleException("discovery.service.description.missing.endPointUrl.message");
}
return smData;
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class CreateCOTViewBean method handleButton1Request.
/**
* Handles save button request.
* save
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
try {
Map values = ps.getAttributeValues(model.getDataMap(), false, model);
String name = (String) getDisplayFieldValue(model.TF_NAME);
if ((name == null) || (name.length() < 1)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("authdomain.authentication.domain.name.missing.message"));
psModel.setErrorProperty("nameProperty", true);
forwardTo();
} else {
CCAddRemove addRemoveList = (CCAddRemove) getChild(ADD_REMOVE_PROVIDERS);
addRemoveList.restoreStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
Set providers = new HashSet(getSelectedValues(addRemoveModel));
model.createAuthenticationDomain(values, providers);
Object[] params = { name };
String message = MessageFormat.format(model.getLocalizedString("authentication.domain.create.message"), params);
setPageSessionAttribute(FederationViewBean.MESSAGE_TEXT, message);
backTrail();
FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.
the class FSAuthDomainsEditViewBean method handleButton1Request.
/**
* Handles create authentication domains view bean.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
String name = (String) getDisplayFieldValue(model.TF_NAME);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
try {
String realm = model.getRealm(name);
Map values = ps.getAttributeValues(model.getDataMap(), false, model);
model.setAttributeValues(realm, name, values);
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
CCAddRemove addRemoveList = (CCAddRemove) getChild(ADD_REMOVE_PROVIDERS);
addRemoveList.restoreStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
List list = new ArrayList(getSelectedValues(addRemoveModel));
model.addProviders(realm, name, list);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.domain.updated");
forwardTo();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
Aggregations