use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class STSEditViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
final String instanceName = (String) getPageSessionAttribute(STSHomeViewBean.INSTANCE_NAME);
final String currentRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if (!submitCycle) {
STSInstanceModel model = (STSInstanceModel) getModel();
Map map;
try {
map = model.getInstanceState(stsType, currentRealm, instanceName);
} catch (AMConsoleException e) {
throw new ModelControlException(e);
}
if (!map.isEmpty()) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
propertySheetModel.clear();
ps.setAttributeValues(map, getModel());
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", MessageFormat.format(model.getLocalizedString("rest.sts.view.no.instance.message"), instanceName));
}
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class DelegationPropertiesViewBean method handleButton1Request.
/**
* Handles save button request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
DelegationModel model = (DelegationModel) getModel();
String uid = (String) getPageSessionAttribute(CURRENT_IDENTITY);
AMPropertySheet ps = (AMPropertySheet) getChild(DELEGATION_PROPERTIES);
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
try {
PrivilegeXMLBuilder builder = PrivilegeXMLBuilder.getInstance();
Set privileges = builder.getAllPrivileges(realm, model);
Map values = ps.getAttributeValues(privileges);
model.setPrivileges(realm, uid, values);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "delegation.privilege.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 DelegationPropertiesViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
DelegationModel model = (DelegationModel) getModel();
if (model != null) {
if (!submitCycle && hasPrivileges) {
AMPropertySheet ps = (AMPropertySheet) getChild(DELEGATION_PROPERTIES);
psModel.clear();
ps.setAttributeValues(getPrivileges(model), model);
}
setPageTitle(model);
}
if (!hasPrivileges) {
disableButton("button1", true);
disableButton("button2", true);
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class ResponseProviderOpViewBeanBase method getResponseProviderValues.
protected Map getResponseProviderValues(PolicyModel model, String realmName, String providerType) throws ModelControlException, AMConsoleException {
List propertyNames = model.getResponseProviderPropertyNames(realmName, providerType);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
return ps.getAttributeValues(propertyNames);
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SERVERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
populateServerTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblServerModel, name);
} else if (name.equals(TBL_USERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
populateUserTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblUserModel, name);
} else if (name.equals(PGTITLE_THREE_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (tblServerModel.isChildSupported(name)) {
view = tblServerModel.createChild(this, name);
} else if (tblUserModel.isChildSupported(name)) {
view = tblUserModel.createChild(this, name);
} else {
view = super.createChild(name);
}
return view;
}
Aggregations