Search in sources :

Example 6 with AbstractAuditModel

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();
    }
}
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) Map(java.util.Map)

Example 7 with AbstractAuditModel

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));
}
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 8 with AbstractAuditModel

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());
    }
}
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 9 with AbstractAuditModel

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

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