Search in sources :

Example 76 with CCActionTable

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

the class ServerSiteViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SERVERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
        populateServerTableModel((Map) szCache.getSerializedObj());
        view = new CCActionTable(this, tblServerModel, name);
    } else if (name.equals(TBL_SITES)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SITE);
        populateSiteTableModel((Map) szCache.getSerializedObj());
        view = new CCActionTable(this, tblSiteModel, name);
    } else if (name.equals(PAGETITLE)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (tblSiteModel.isChildSupported(name)) {
        view = tblSiteModel.createChild(this, name);
    } else if (tblServerModel.isChildSupported(name)) {
        view = tblServerModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) HashMap(java.util.HashMap) Map(java.util.Map) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 77 with CCActionTable

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

the class SubConfigEditViewBean method handleTblSubConfigButtonDeleteRequest.

/**
     * Deletes sub configuration.
     *
     * @param event Request Invocation Event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
    tbl.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    Integer[] selected = tblModel.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++) {
        SMSubConfig sc = (SMSubConfig) list.get(selected[i].intValue());
        names.add(sc.getName());
    }
    try {
        SubConfigModel model = (SubConfigModel) getModel();
        model.deleteSubConfigurations(names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    submitCycle = false;
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) SMSubConfig(com.sun.identity.console.base.model.SMSubConfig) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) 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 78 with CCActionTable

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

the class AgentConfigInheritViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_PROPERTY_NAMES)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        populatePropertyNameTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblPropertyNamesModel, name);
    } else if (name.equals(PGTITLE_THREE_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (tblPropertyNamesModel.isChildSupported(name)) {
        view = tblPropertyNamesModel.createChild(this, name);
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (name.equals(CHILD_STATICTEXT)) {
        view = new CCStaticTextField(this, name, null);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 79 with CCActionTable

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

the class AgentConfigInheritViewBean method handleButton1Request.

/**
     * Handles save profile request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    CCActionTable table = (CCActionTable) getChild(TBL_PROPERTY_NAMES);
    table.restoreStateData();
    Integer[] selected = tblPropertyNamesModel.getSelectedRows();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    List list = (List) szCache.getSerializedObj();
    Map inherit = new HashMap();
    for (Iterator i = list.iterator(); i.hasNext(); ) {
        String name = (String) i.next();
        inherit.put(name, "0");
    }
    for (int i = 0; i < selected.length; i++) {
        String name = (String) list.get(selected[i].intValue());
        inherit.put(name, "1");
    }
    try {
        AgentsModel model = (AgentsModel) getModel();
        String universalId = (String) getPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID);
        model.updateAgentConfigInheritance(universalId, inherit);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "agentcfg.inheritance.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) HashMap(java.util.HashMap) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) 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 80 with CCActionTable

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

the class FSSAMLServiceViewBean method handleTblSiteIDButtonDeleteRequest.

public void handleTblSiteIDButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    Map modifiedValues = null;
    try {
        modifiedValues = getValues(false, false);
    } catch (AMConsoleException e) {
    /* exception will not be thrown because we are instructing
             * AMPropertySheet to return values without doing password
             * validation.
             */
    }
    CCActionTable tbl = (CCActionTable) getChild(TABLE_SITE_ID);
    tbl.restoreStateData();
    Integer[] selected = tblSiteIdModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) modifiedValues.get(TABLE_SITE_ID);
        tblValues.removeAll(selected);
        modifiedValues.put(TABLE_SITE_ID, tblValues);
    }
    setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) modifiedValues);
    setPageSessionAttribute(MODIFIED, "1");
    setValues();
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCActionTable(com.sun.web.ui.view.table.CCActionTable) HashMap(java.util.HashMap) Map(java.util.Map)

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