Search in sources :

Example 6 with CCActionTable

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

the class AgentsViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(PARENTAGE_PATH)) {
        view = createParentagePath(name);
    } else if (name.equals(PARENTAGE_PATH_HREF)) {
        view = new HREF(this, name, null);
    } else if (name.equals(TAB_COMMON)) {
        view = new CCTabs(this, tabModel, name);
    } else if (name.equals(TBL_SEARCH)) {
        populateTableModelEx();
        view = new CCActionTable(this, tblModel, name);
    } else if (name.equals(TBL_SEARCH_GROUP)) {
        populateTableModelEx();
        view = new CCActionTable(this, tblGroupModel, name);
    } else if (name.equals(PAGETITLE)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if ((tblModel != null) && tblModel.isChildSupported(name)) {
        view = tblModel.createChild(this, name);
    } else if ((tblGroupModel != null) && tblGroupModel.isChildSupported(name)) {
        view = tblGroupModel.createChild(this, name);
    } else if ((ptModel != null) && ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCTabs(com.sun.web.ui.view.tabs.CCTabs) HREF(com.iplanet.jato.view.html.HREF) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 7 with CCActionTable

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

the class SAMLv2SPAssertionContentViewBean method getAuthenticationContexts.

private SAMLv2AuthContexts getAuthenticationContexts() throws ModelControlException {
    CCActionTable tbl = (CCActionTable) getChild(TBL_AUTHENTICATION_CONTEXTS);
    tbl.restoreStateData();
    SAMLv2AuthContexts authContexts = new SAMLv2AuthContexts();
    String defaultAuthnContext = (String) getDisplayFieldValue(SAMLv2Model.SP_AUTHN_CONTEXT_CLASS_REF_MAPPING_DEFAULT);
    for (int i = 0; i < tblAuthContextsModel.getSize(); i++) {
        tblAuthContextsModel.setLocation(i);
        String name = (String) tblAuthContextsModel.getValue(TBL_DATA_CONTEXT_REFERENCE);
        String supported = (String) tblAuthContextsModel.getValue(TBL_DATA_SUPPORTED);
        String level = (String) tblAuthContextsModel.getValue(TBL_DATA_LEVEL);
        boolean isDefault = false;
        if (name.equals(defaultAuthnContext)) {
            isDefault = true;
            supported = "true";
        }
        authContexts.put(name, supported, level, isDefault);
    }
    return authContexts;
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 8 with CCActionTable

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

the class EntitiesViewBean method handleTblButtonDeleteRequest.

/**
     * Deletes policies.
     *
     * @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);
    List cache = (List) szCache.getSerializedObj();
    for (int i = 0; i < selected.length; i++) {
        names.add((String) cache.get(selected[i].intValue()));
    }
    try {
        EntitiesModel model = (EntitiesModel) getModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        String idType = (String) getPageSessionAttribute(PG_SESSION_ENTITY_TYPE);
        model.deleteEntities(curRealm, names);
        if (selected.length == 1) {
            Object[] param = { model.getLocalizedString(idType) };
            String msg = model.getLocalizedString("entities.message.deleted");
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", MessageFormat.format(msg, param));
        } else {
            Object[] param = { model.getLocalizedString(idType) };
            String msg = model.getLocalizedString("entities.message.deleted.pural");
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", MessageFormat.format(msg, param));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CCActionTable(com.sun.web.ui.view.table.CCActionTable) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) ArrayList(java.util.ArrayList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 9 with CCActionTable

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

the class ServerSiteViewBean method handleTblServerButtonDeleteRequest.

/**
     * Deletes server.
     *
     * @param event Request Invocation Event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblServerButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_SERVERS);
    table.restoreStateData();
    Integer[] selected = tblServerModel.getSelectedRows();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    List list = (List) szCache.getSerializedObj();
    Set names = new HashSet(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        String name = (String) list.get(selected[i].intValue());
        names.add(name);
    }
    try {
        ServerSiteModel model = (ServerSiteModel) getModel();
        model.deleteServers(names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.message.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.message.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) Set(java.util.Set) SerializedField(com.sun.identity.console.components.view.html.SerializedField) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) 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)

Example 10 with CCActionTable

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

the class SubConfigEditViewBean method populateTableModel.

private void populateTableModel(List<SMSubConfig> subconfig) {
    CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    tblModel.clearAll();
    if (subconfig != null) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        List<SMSubConfig> cache = new ArrayList<>(subconfig.size());
        if (!subconfig.isEmpty()) {
            tblModel.clearAll();
            boolean firstEntry = true;
            for (SMSubConfig conf : subconfig) {
                if (conf.isHidden()) {
                    continue;
                }
                if (firstEntry) {
                    firstEntry = false;
                } else {
                    tblModel.appendRow();
                }
                tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_NAME, conf.getLocalizedName() == null ? conf.getName() : conf.getLocalizedName());
                tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_HREF_NAME, conf.getName());
                tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
                cache.add(conf);
            }
        }
        szCache.setValue(cache);
    }
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) SMSubConfig(com.sun.identity.console.base.model.SMSubConfig) ArrayList(java.util.ArrayList) 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