use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractAuditViewBean method handleTblSubConfigButtonDeleteRequest.
/**
* Called on request from the UI to delete an event handler.
*
* @param event Request Invocation Event.
*/
@SuppressWarnings("unused")
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable tbl = (CCActionTable) getChild(TBL_SUB_CONFIG);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
Integer[] selected = tblModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = szCache.getSerializedObj();
Set<String> names = new HashSet<>(selected.length * 2);
for (Integer index : selected) {
SMSubConfig sc = (SMSubConfig) list.get(index);
names.add(sc.getName());
}
try {
AbstractAuditModel model = (AbstractAuditModel) getModel();
model.deleteEventHandles(names);
if (selected.length == 1) {
setInlineAlertMessage(TYPE_INFO, INFORMATION_MESSAGE, "event.handler.message.deleted");
} else {
setInlineAlertMessage(TYPE_INFO, INFORMATION_MESSAGE, "event.handler.message.deleted.plural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
submitCycle = false;
forwardTo();
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractAuditViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
AbstractAuditModel model = (AbstractAuditModel) getModel();
if (!submitCycle) {
try {
populateTableModel(model.getEventHandlerConfigurations());
resetButtonState(TBL_SUB_CONFIG_BUTTON_DELETE);
disableButton(TBL_SUB_CONFIG_BUTTON_ADD, false);
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
}
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerAddViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
AbstractAuditModel model = (AbstractAuditModel) getModel();
String schemaName = (String) getPageSessionAttribute(AUDIT_HANDLER_TYPE);
if (!submitCycle) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
propertySheetModel.clear();
try {
ps.setAttributeValues(model.getEventHandlerDefaultValues(schemaName), model);
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "noproperties.message");
}
}
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerEditViewBean method createPropertyModel.
private void createPropertyModel() {
try {
AbstractAuditModel model = (AbstractAuditModel) getModel();
String subConfigName = (String) getPageSessionAttribute(AUDIT_HANDLER_NAME);
String realm = isGlobalService() ? "/" : (String) getPageSessionAttribute(CURRENT_REALM);
propertySheetModel = new AMPropertySheetModel(model.getEditEventHandlerPropertyXML(realm, subConfigName, getClass().getName()));
propertySheetModel.clear();
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
}
use of com.sun.identity.console.audit.model.AbstractAuditModel in project OpenAM by OpenRock.
the class AbstractEventHandlerSelectViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
try {
AbstractAuditModel model = (AbstractAuditModel) getModel();
Set<String> auditHandlerTypes = model.getEventHandlerTypeNames();
OptionList optionList = new OptionList();
for (String type : auditHandlerTypes) {
optionList.add(type, type);
}
CCRadioButton rb = (CCRadioButton) getChild(RB_EVENT_HANDLER);
rb.setOptions(optionList);
rb.setValue(optionList.getValue(0));
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
}
Aggregations