Search in sources :

Example 16 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method handleTblProviderResourceIdMapperButtonDeleteRequest.

/**
     * Handles remove provider resource id mapper request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblProviderResourceIdMapperButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
        tblValues.removeAll(selected);
        populateProviderResourceIdMapperTable(tblValues);
    }
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 17 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class SMDiscoveryBootstrapRefOffViewBeanBase method populateDescriptionsTable.

private void populateDescriptionsTable(List descData) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(ATTRIBUTE_NAME_SECURITY_MECH_ID);
    tblModel.clearAll();
    if (descData != null) {
        boolean firstEntry = true;
        int counter = 0;
        if ((descData != null) && !descData.isEmpty()) {
            for (Iterator iter = descData.iterator(); iter.hasNext(); ) {
                SMDescriptionData smDesc = (SMDescriptionData) iter.next();
                if (!firstEntry) {
                    tblModel.appendRow();
                } else {
                    firstEntry = false;
                }
                tblModel.setValue(TBL_SECURITY_MECH_ID_DATA_ID, smDesc.getFirstSecurityMechId());
                tblModel.setValue(TBL_SECURITY_MECH_ID_HREF_ACTION, Integer.toString(counter));
                tblModel.setValue(TBL_SECURITY_MECH_ID_LABEL_ACTION, "discovery.service.table.bootstrapResOff.action.edit.label");
                counter++;
            }
        }
    }
    setPageSessionAttribute(ATTR_SECURITY_MECH_ID, (ArrayList) descData);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData)

Example 18 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class SMDiscoveryBootstrapRefOffViewBeanBase method handleTblSecurityMechIDButtonDeleteRequest.

/**
     * Handles remove security mechanism ID request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblSecurityMechIDButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    try {
        SMDiscoEntryData smData = getValues(false);
        CCActionTable table = (CCActionTable) getChild(ATTRIBUTE_NAME_SECURITY_MECH_ID);
        table.restoreStateData();
        CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(ATTRIBUTE_NAME_SECURITY_MECH_ID);
        Integer[] selected = tblModel.getSelectedRows();
        if ((selected != null) && (selected.length > 0)) {
            for (int i = selected.length - 1; i >= 0; --i) {
                Integer index = selected[i];
                smData.descData.remove(index.intValue());
            }
            setValues(smData, getModel());
            populateDescriptionsTable(smData.descData);
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 19 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method handleTblBootstrapResOffButtonDeleteRequest.

/**
     * Handles remove resource offerings request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblBootstrapResOffButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        try {
            OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
            SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(tblValues);
            smEntry.deleteDiscoEntries(selected);
            tblValues = (OrderedSet) smEntry.getDiscoveryEntries();
            setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, tblValues);
            populateBootstrapResOffTable(tblValues);
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 20 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel 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)

Aggregations

CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)103 CCActionTable (com.sun.web.ui.view.table.CCActionTable)22 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)18 Iterator (java.util.Iterator)18 List (java.util.List)14 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)13 ArrayList (java.util.ArrayList)12 HashSet (java.util.HashSet)9 Set (java.util.Set)9 SerializedField (com.sun.identity.console.components.view.html.SerializedField)8 OptionList (com.iplanet.jato.view.html.OptionList)6 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)6 HashMap (java.util.HashMap)5 Map (java.util.Map)5 SCConfigModel (com.sun.identity.console.service.model.SCConfigModel)4 AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)3 EntityModel (com.sun.identity.console.federation.model.EntityModel)2 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)2 FSSAMLServiceModel (com.sun.identity.console.federation.model.FSSAMLServiceModel)2 SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)2