Search in sources :

Example 31 with CCActionTable

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

the class WSPersonalProfileServiceViewBean method handleTblDSAttributeMapListButtonDeleteRequest.

/**
     * Handles remove LDAP Attribute Mapping request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblDSAttributeMapListButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_DS_ATTRIBUTE_MAP_LIST);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_DS_ATTRIBUTE_MAP_LIST);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_DS_ATTRIBUTE_MAP_LIST);
        tblValues.removeAll(selected);
        setPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_DS_ATTRIBUTE_MAP_LIST, tblValues);
        populateDSAttributeMapListTable(tblValues);
    }
    resetButtonState(TBL_DS_ATTRIBUTE_MAP_LIST_DELETE_BTN);
    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 32 with CCActionTable

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

the class WSAuthNServicesViewBean method handleTblHandlersButtonDeleteRequest.

/**
     * Handles remove handler request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblHandlersButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
        tblValues.removeAll(selected);
        setPageSessionAttribute(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS, tblValues);
        populateHandlersTable(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 33 with CCActionTable

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

the class ServicesViewBean method handleTblButtonDeleteRequest.

/**
     * Deletes ID Repo.
     *
     * @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);
    for (int i = 0; i < selected.length; i++) {
        tblModel.setRowIndex(selected[i].intValue());
        names.add((String) tblModel.getValue(TF_DATA_NAME));
    }
    try {
        ServicesModel model = (ServicesModel) getModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        model.unassignServices(curRealm, names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "services.message.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "services.message.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) ServicesModel(com.sun.identity.console.realm.model.ServicesModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 34 with CCActionTable

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

the class AuthConfigViewBean method handleButton1Request.

/**
     * Handles save button request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(AUTH_ENTRY_TABLE);
    table.restoreStateData();
    acModel = (AuthConfigurationModel) getModel();
    acModel.setEntries(getTableData());
    try {
        Map original = acModel.getValues();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        Map updated = ps.getAttributeValues(original, true, acModel);
        acModel.setValues(updated);
        acModel.store(getRealmName(), getConfigName());
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.save.ok");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        tablePopulated = false;
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 35 with CCActionTable

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

the class AuthConfigViewBean method handleReorderEntryButtonRequest.

/**
     * Handles reorder authentication chains request.
     *
     * @param event Request invocation event
     */
public void handleReorderEntryButtonRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(AUTH_ENTRY_TABLE);
    table.restoreStateData();
    cacheValues();
    setPageSessionAttribute(ENTRY_LIST, AMAuthConfigUtils.authConfigurationEntryToXMLString(getTableData()));
    ReorderAuthChainsViewBean vb = (ReorderAuthChainsViewBean) getViewBean(ReorderAuthChainsViewBean.class);
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
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