use of com.sun.identity.console.federation.model.FSAuthDomainsModel 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();
}
}
use of com.sun.identity.console.federation.model.FSAuthDomainsModel in project OpenAM by OpenRock.
the class FSAuthDomainsEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String name = (String) getDisplayFieldValue(FSAuthDomainsModel.TF_NAME);
setPageSessionAttribute(FSAuthDomainsModel.TF_NAME, name);
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
try {
String realm = model.getRealm(name);
Map values = model.getAttributeValues(realm, name);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
ps.setAttributeValues(values, model);
if (addRemoveModel == null) {
addRemoveModel = new CCAddRemoveModel();
}
Set providers = model.getAllProviderNames(realm);
List selectedProviders = new ArrayList(model.getTrustedProviderNames(realm, name));
if ((selectedProviders != null) || (!selectedProviders.isEmpty())) {
providers.removeAll(selectedProviders);
Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, selectedProviders);
addRemoveModel.setSelectedOptionList(createOptionList(replacePipeWithComma(displayNames)));
}
Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, providers);
addRemoveModel.setAvailableOptionList(createOptionList(replacePipeWithComma(displayNames)));
propertySheetModel.setModel(ADD_REMOVE_PROVIDERS, addRemoveModel);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.federation.model.FSAuthDomainsModel in project OpenAM by OpenRock.
the class CreateCOTViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
ps.init();
populateRealmData();
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
String realm = "/";
try {
if (addRemoveModel == null) {
addRemoveModel = new CCAddRemoveModel();
}
Set providers = model.getAllProviderNames(realm);
Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, providers);
addRemoveModel.setAvailableOptionList(createOptionList(replacePipeWithComma(displayNames)));
psModel.setModel(ADD_REMOVE_PROVIDERS, addRemoveModel);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
Aggregations