Search in sources :

Example 1 with CCActionTable

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

the class DelegationViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SEARCH)) {
        populateTableModelEx();
        view = new CCActionTable(this, tblModel, name);
    } else if (name.equals(PAGETITLE)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (tblModel.isChildSupported(name)) {
        view = tblModel.createChild(this, name);
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 2 with CCActionTable

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

the class RuleOpViewBeanBase method populateActionsTable.

protected void populateActionsTable(boolean retainSelectedEntry) throws ModelControlException, AMConsoleException {
    CCActionTable table = (CCActionTable) getChild(TBL_ACTIONS);
    table.resetStateData();
    tblActionsModel.clearAll();
    PolicyModel model = (PolicyModel) getModel();
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    String serviceType = (String) propertySheetModel.getValue(SERVICE_TYPE);
    boolean withResource = false;
    Boolean b = ((Boolean) getPageSessionAttribute(WITH_RESOURCE));
    if (b != null) {
        withResource = b.booleanValue();
    }
    actionSchemas = new ArrayList(model.getActionSchemas(getCachedPolicy().getPolicy(), realmName, serviceType, withResource));
    if ((actionSchemas != null) && !actionSchemas.isEmpty()) {
        int sz = actionSchemas.size();
        ArrayList actionSchemaNames = new ArrayList(sz);
        for (int i = 0; i < sz; i++) {
            if (i > 0) {
                tblActionsModel.appendRow();
            }
            ActionSchema as = (ActionSchema) actionSchemas.get(i);
            boolean sel = isActionSelected(as);
            tblActionsModel.setRowSelected(i, sel);
            actionSchemaNames.add(as.getName());
            tblActionsModel.setValue(TBL_ACTIONS_DATA_NAME, model.getActionSchemaLocalizedName(serviceType, as));
        }
        setPageSessionAttribute(PG_SESSION_ACTION_SCHEMA_NAMES, actionSchemaNames);
    }
}
Also used : ArrayList(java.util.ArrayList) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) ActionSchema(com.sun.identity.policy.ActionSchema)

Example 3 with CCActionTable

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

the class ServerConfigXMLViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SERVERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
        populateServerTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblServerModel, name);
    } else if (name.equals(TBL_USERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
        populateUserTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblUserModel, name);
    } else if (name.equals(PGTITLE_THREE_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (tblServerModel.isChildSupported(name)) {
        view = tblServerModel.createChild(this, name);
    } else if (tblUserModel.isChildSupported(name)) {
        view = tblUserModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 4 with CCActionTable

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

the class SMG11NViewBean method handleTblCharsetAliasButtonDeleteRequest.

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

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

the class AuthPropertiesViewBean method handleDeleteInstanceButtonRequest.

/**
     * Handles the delete authentication instance request.
     *
     * @param event Request Invocation Event.
     */
public void handleDeleteInstanceButtonRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(AUTH_INSTANCE_TABLE);
    table.restoreStateData();
    CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(AUTH_INSTANCE_TABLE);
    Integer[] selected = tableModel.getSelectedRows();
    Set instances = new HashSet(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        tableModel.setRowIndex(selected[i].intValue());
        instances.add((String) tableModel.getValue(NAME_COLUMN_DATA));
    }
    try {
        AuthPropertiesModel model = (AuthPropertiesModel) getModel();
        model.removeAuthInstance(instances);
        /* 
             * There is a timing issue with the backend after an 
             * instance is deleted causing the UI to be out of synch with the 
             * backend. We are storing the instances removed to be used when 
             * the page is redrawn to ensure the deleted instances are not 
             * put back into the instance table.
             */
        setPageSessionAttribute(INSTANCES_REMOVED, (Serializable) instances);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.instance.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.instance.deleted.multiple");
        }
        removePageSessionAttribute(AUTH_INSTANCE_TABLE);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

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