use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.
the class EditAuthTypeViewBean method handleButton2Request.
/**
* Handles reset request.
*
* @param event Request invocation event.
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
/*
* The service name will be null if the entry was deleted by
* another user while the properties were being viewed.
*/
if (getServiceName(instance) == null) {
debug.warning("EditAuthTypeViewBean.handleButton2Request() " + "The instance " + instance + " could not be found");
AuthPropertiesModel model = getAuthModel();
returnToAuthProperties(model.getLocalizedString("no.module.instance"));
} else {
super.handleButton2Request(event);
}
}
use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.
the class EditAuthTypeViewBean method getValues.
protected Map getValues() throws ModelControlException, AMConsoleException {
Map values = null;
String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
AuthPropertiesModel model = getAuthModel();
if (model != null) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
values = ps.getAttributeValues(model.getInstanceValues(instance), model);
}
return values;
}
use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.
the class EditAuthTypeViewBean method handleButton1Request.
/**
* Handles save request.
*
* @param event Request invocation event.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
AuthPropertiesModel model = getAuthModel();
/*
* The service name will be null if the entry was deleted by
* another user while the properties were being viewed.
*/
if (getServiceName(instance) == null) {
returnToAuthProperties(model.getLocalizedString("no.module.instance"));
} else {
if (model != null) {
try {
Map values = getValues();
model.setInstanceValues(instance, 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.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.
the class AuthPropertiesViewBean method populateConfigMenu.
private void populateConfigMenu() {
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if ((realm == null) || (realm.length() == 0)) {
realm = AMModelBase.getStartDN(getRequestContext().getRequest());
}
AuthPropertiesModel model = (AuthPropertiesModel) getModel();
OrderedSet configs = new OrderedSet();
configs.addAll(AuthConfigurationModelImpl.getNamedConfigurations(model.getUserSSOToken(), realm));
OptionList containers = new OptionList();
for (Iterator i = configs.iterator(); i.hasNext(); ) {
String entry = (String) i.next();
containers.add(entry, entry);
}
CCDropDownMenu ac = (CCDropDownMenu) getChild(AUTH_CONFIG);
ac.setOptions(containers);
CCDropDownMenu aac = (CCDropDownMenu) getChild(ADMIN_AUTH_CONFIG);
aac.setOptions(containers);
}
use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.
the class AuthPropertiesViewBean method handleButton1Request.
/**
* Handles save button request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
try {
AuthPropertiesModel model = (AuthPropertiesModel) getModel();
Map original = model.getValues();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
model.setValues(ps.getAttributeValues(original, true, model));
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.profile.updated");
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", a.getMessage());
}
forwardTo();
}
Aggregations