Search in sources :

Example 1 with AbstractAuditModel

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();
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) SMSubConfig(com.sun.identity.console.base.model.SMSubConfig) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 2 with AbstractAuditModel

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());
        }
    }
}
Also used : AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 3 with AbstractAuditModel

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");
        }
    }
}
Also used : AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 4 with AbstractAuditModel

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());
    }
}
Also used : AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 5 with AbstractAuditModel

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());
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AbstractAuditModel(com.sun.identity.console.audit.model.AbstractAuditModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)9 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)9 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)2 OptionList (com.iplanet.jato.view.html.OptionList)1 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)1 SerializedField (com.sun.identity.console.components.view.html.SerializedField)1 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 ArrayList (java.util.ArrayList)1 Collections.singletonList (java.util.Collections.singletonList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1