use of com.sun.identity.console.base.AMPropertySheet 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.base.AMPropertySheet 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());
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class CreateSAML2MetaDataViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
setPageSessionAttribute("protocol", protocol);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
ps.init();
populateRealmData();
psModel.setModel(AFFI_MEMBERS, new CCEditableListModel());
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class EntityEditViewBean method handleButton1Request.
/**
* Handles create realm request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
EntitiesModel model = (EntitiesModel) getModel();
AMPropertySheet prop = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
try {
Map oldValues = model.getAttributeValues(universalId, false);
Map values = prop.getAttributeValues(oldValues, true, model);
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
model.modifyEntity(curRealm, universalId, values);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class EntityEditViewBean method setDefaultValues.
protected void setDefaultValues(String type) throws AMConsoleException {
if (propertySheetModel != null) {
EntitiesModel model = (EntitiesModel) getModel();
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
if (!submitCycle) {
propertySheetModel.clear();
try {
Map attrValues = model.getAttributeValues(universalId, false);
AMPropertySheet prop = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
prop.setAttributeValues(attrValues, model);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
String[] uuid = { universalId };
propertySheetModel.setValues(PROPERTY_UUID, uuid, model);
}
}
Aggregations