use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerEditViewBean method handleButton1Request.
/**
* Handles next button request.
*
* @param event Request invocation event.
*/
@SuppressWarnings("unused")
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
AbstractAuditModel model = (AbstractAuditModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String subConfigName = (String) getPageSessionAttribute(AUDIT_HANDLER_NAME);
try {
Map orig = model.getEventHandlerAttributeValues(subConfigName);
Map values = ps.getAttributeValues(orig, true, true, model);
model.setEventHandlerAttributeValues(subConfigName, values);
backToProfileViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerEditViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
AbstractAuditModel model = (AbstractAuditModel) getModel();
String eventHandlerName = (String) getPageSessionAttribute(AUDIT_HANDLER_NAME);
if (!submitCycle) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
propertySheetModel.clear();
try {
ps.setAttributeValues(model.getEventHandlerAttributeValues(eventHandlerName), model);
} catch (AMConsoleException a) {
setInlineAlertMessage(TYPE_WARNING, WARNING_MESSAGE, "noproperties.message");
}
}
ptModel.setPageTitleText(format(model.getLocalizedString("event.handler.page.title.edit"), eventHandlerName));
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerAddViewBean method createPropertyModel.
private void createPropertyModel() {
try {
String schemaName = (String) getPageSessionAttribute(AUDIT_HANDLER_TYPE);
AbstractAuditModel model = (AbstractAuditModel) getModel();
propertySheetModel = new AMPropertySheetModel(model.getAddEventHandlerPropertyXML(schemaName));
propertySheetModel.clear();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerAddViewBean method handleButton1Request.
/**
* Handles next button request.
*
* @param event Request invocation event.
*/
@SuppressWarnings("unused")
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String subConfigName = (String) getDisplayFieldValue(TF_EVENT_HANDLER_NAME);
if (StringUtils.isBlank(subConfigName)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, ERROR_MESSAGE, "message.missing.name");
forwardTo();
}
AbstractAuditModel model = (AbstractAuditModel) getModel();
try {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String schemaName = (String) getPageSessionAttribute(AUDIT_HANDLER_TYPE);
@SuppressWarnings("unchecked") Map<String, Set<String>> values = ps.getAttributeValues(model.getEventHandlerAttributeNames(schemaName));
model.createEventHandler(subConfigName, schemaName, values);
backToProfileViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
forwardTo();
}
}
Aggregations