Search in sources :

Example 56 with CCActionTable

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

the class SMProfileViewBean method handleTblButtonInvalidateRequest.

/**
     * Handles the event request for <i>Invalidate</i> button.
     *
     * @param event request invocation event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblButtonInvalidateRequest(RequestInvocationEvent event) throws ModelControlException {
    SMProfileModel model = (SMProfileModel) getModel();
    String serverName = (String) getPageSessionAttribute(SERVER_NAME);
    model.setProfileServerName(serverName);
    CCActionTable child = (CCActionTable) getChild(TBL_SESSIONS);
    child.restoreStateData();
    Integer[] selected = tblModel.getSelectedRows();
    List names = new ArrayList(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        tblModel.setRowIndex(selected[i].intValue());
        names.add((String) tblModel.getValue(TBL_DATA_SESSION_ID));
    }
    boolean error = false;
    List failList = null;
    try {
        failList = model.invalidateSessions(names, getFilterString());
    } catch (AMConsoleException e) {
        error = true;
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    if (!error && failList != null && !failList.isEmpty()) {
    // TOFIX:  need to display mutiple message.
    }
    if (!model.isSessionValid()) {
        validSession = false;
    }
    forwardTo();
}
Also used : SMProfileModel(com.sun.identity.console.session.model.SMProfileModel) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 57 with CCActionTable

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

the class AgentsViewBean method handleTblButtonGroupDeleteRequest.

/**
     * Deletes agent groups.
     *
     * @param event Request Invocation Event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblButtonGroupDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_SEARCH_GROUP);
    table.restoreStateData();
    Integer[] selected = tblGroupModel.getSelectedRows();
    Set names = new HashSet(selected.length * 2);
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    Map mapCache = (Map) szCache.getSerializedObj();
    List cache = (List) mapCache.get(CACHE_AGENT_GROUPS);
    for (int i = 0; i < selected.length; i++) {
        names.add((String) cache.get(selected[i].intValue()));
    }
    try {
        AgentsModel model = (AgentsModel) getModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        model.deleteAgentGroups(curRealm, names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agent.groups.message.deleted"));
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agent.groups.message.deleted.pural"));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) SerializedField(com.sun.identity.console.components.view.html.SerializedField) List(java.util.List) ArrayList(java.util.ArrayList) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) HashMap(java.util.HashMap) HashSet(java.util.HashSet)

Example 58 with CCActionTable

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

the class AgentsViewBean method handleTblButtonDeleteRequest.

/**
     * Deletes agents.
     *
     * @param event Request Invocation Event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_SEARCH);
    table.restoreStateData();
    Integer[] selected = tblModel.getSelectedRows();
    Set names = new HashSet(selected.length * 2);
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    Map mapCache = (Map) szCache.getSerializedObj();
    List cache = (List) mapCache.get(CACHE_AGENTS);
    for (int i = 0; i < selected.length; i++) {
        names.add((String) cache.get(selected[i].intValue()));
    }
    try {
        AgentsModel model = (AgentsModel) getModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        model.deleteAgents(curRealm, names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agents.message.deleted"));
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agents.message.deleted.pural"));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) SerializedField(com.sun.identity.console.components.view.html.SerializedField) List(java.util.List) ArrayList(java.util.ArrayList) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) HashMap(java.util.HashMap) HashSet(java.util.HashSet)

Example 59 with CCActionTable

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

the class AuthPropertiesViewBean method handleDeleteConfigButtonRequest.

/**
     * Handles the delete authentication instance request.
     *
     * @param event Request Invocation Event.
     */
public void handleDeleteConfigButtonRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(AUTH_CONFIG_TABLE);
    table.restoreStateData();
    CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(AUTH_CONFIG_TABLE);
    Integer[] selected = tableModel.getSelectedRows();
    Set configurations = new HashSet(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        tableModel.setRowIndex(selected[i].intValue());
        configurations.add((String) tableModel.getValue(CONFIG_NAME_COLUMN_DATA));
    }
    try {
        AuthConfigurationModel m = (AuthConfigurationModel) getConfigModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        if ((curRealm == null) || (curRealm.length() == 0)) {
            curRealm = AMModelBase.getStartDN(getRequestContext().getRequest());
        }
        m.deleteAuthConfiguration(curRealm, configurations);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.config.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.config.deleted.multiple");
        }
        removePageSessionAttribute(AUTH_CONFIG_TABLE);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AuthConfigurationModel(com.sun.identity.console.authentication.model.AuthConfigurationModel) HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 60 with CCActionTable

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

the class IDFFIDPViewBean method getAuthenticationContexts.

private IDFFAuthContexts getAuthenticationContexts() throws ModelControlException {
    CCActionTable tbl = (CCActionTable) getChild(TBL_AUTHENTICATION_CONTEXTS);
    tbl.restoreStateData();
    IDFFAuthContexts authContexts = new IDFFAuthContexts();
    int size = 10;
    for (int i = 0; i < size; i++) {
        tblAuthContextsModel.setLocation(i);
        String name = (String) tblAuthContextsModel.getValue(TBL_DATA_CONTEXT_REFERENCE);
        String supported = (String) tblAuthContextsModel.getValue(TBL_DATA_SUPPORTED);
        String key = (String) tblAuthContextsModel.getValue(TBL_DATA_KEY);
        String value = (String) tblAuthContextsModel.getValue(TBL_DATA_VALUE);
        String level = (String) tblAuthContextsModel.getValue(TBL_DATA_LEVEL);
        authContexts.put(name, supported, key, value, level);
    }
    return authContexts;
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable)

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