Search in sources :

Example 21 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class AuthConfigViewBean method handleRemoveEntryButtonRequest.

/**
     * Handles remove auth instance request.
     *
     * @param event Request invocation event
     */
public void handleRemoveEntryButtonRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(AUTH_ENTRY_TABLE);
    table.restoreStateData();
    // get the entries selected in the table and remove from 
    // the model
    Integer[] selected = entryTableModel.getSelectedRows();
    acModel = (AuthConfigurationModel) getModel();
    acModel.removeAuthEntries(selected);
    String xml = acModel.getXMLValue(getRealmName(), getConfigName());
    setPageSessionAttribute(ENTRY_LIST, xml);
    // set back to false to force the values to be re-read
    cacheValues();
    tablePopulated = false;
    forwardTo();
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 22 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class SessionPropertyConditionEditViewBean method handleButton2Request.

public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    Map orig = (Map) getPageSessionAttribute(PG_SESSION_ORIG);
    Map map = new HashMap();
    map.putAll(orig);
    setPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES, (HashMap) map);
    CCActionTable tbl = (CCActionTable) getChild(SessionPropertyConditionHelper.ATTR_VALUES);
    tbl.resetStateData();
    helper.populateTable(map, propertySheetModel);
    forwardTo();
}
Also used : HashMap(java.util.HashMap) CCActionTable(com.sun.web.ui.view.table.CCActionTable) HashMap(java.util.HashMap) Map(java.util.Map)

Example 23 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class SessionPropertyConditionEditViewBean method setPropertiesValues.

protected void setPropertiesValues(Map values) {
    Object cached = getPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES);
    if (cached == null) {
        Map map = new HashMap();
        map.putAll(values);
        setPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES, (HashMap) map);
        try {
            CCActionTable tbl = (CCActionTable) getChild(SessionPropertyConditionHelper.ATTR_VALUES);
            tbl.resetStateData();
        } catch (ModelControlException e) {
        //no-op, cannot reset action table
        }
        helper.populateTable(map, propertySheetModel);
        Map orig = new HashMap();
        orig.putAll(values);
        setPageSessionAttribute(PG_SESSION_ORIG, (HashMap) orig);
    }
}
Also used : HashMap(java.util.HashMap) ModelControlException(com.iplanet.jato.model.ModelControlException) CCActionTable(com.sun.web.ui.view.table.CCActionTable) HashMap(java.util.HashMap) Map(java.util.Map)

Example 24 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable 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 25 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable 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)

Aggregations

CCActionTable (com.sun.web.ui.view.table.CCActionTable)82 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)40 SerializedField (com.sun.identity.console.components.view.html.SerializedField)28 ArrayList (java.util.ArrayList)25 List (java.util.List)23 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)22 HashSet (java.util.HashSet)19 Set (java.util.Set)17 View (com.iplanet.jato.view.View)16 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)15 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)13 HashMap (java.util.HashMap)13 Map (java.util.Map)13 OptionList (com.iplanet.jato.view.html.OptionList)6 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)6 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)5 ServerSiteModel (com.sun.identity.console.service.model.ServerSiteModel)5 Policy (com.sun.identity.policy.Policy)5 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)4