Search in sources :

Example 46 with CCActionTable

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

the class ServicesViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(CHILD_TBL_TILED_VIEW)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        populateTableModel((Map) szCache.getSerializedObj());
        view = new ServicesTiledView(this, tblModel, name);
    } else if (name.equals(TBL_SEARCH)) {
        ServicesTiledView tView = (ServicesTiledView) getChild(CHILD_TBL_TILED_VIEW);
        CCActionTable child = new CCActionTable(this, tblModel, name);
        child.setTiledView(tView);
        view = child;
    } 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 : 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)

Example 47 with CCActionTable

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

the class SCPolicyViewBean method handleTblResourceComparatorButtonDeleteRequest.

/**
     * Handles remove resource comparator request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblResourceComparatorButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    CCActionTable table = (CCActionTable) getChild(TBL_RESOURCE);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(TBL_RESOURCE);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR);
        tblValues.removeAll(selected);
        setPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR, tblValues);
        populateResourceComparatorTable(tblValues);
    }
    try {
        Map values = getAllValues();
        setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) values);
        setPageSessionAttribute(SCPolicyViewBean.PAGE_MODIFIED, "1");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    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) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 48 with CCActionTable

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

the class ServerConfigInheritViewBean 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();
    Set toInherit = new HashSet(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        String name = (String) list.get(selected[i].intValue());
        toInherit.add(ServerEditViewBeanBase.getActualPropertyName(name));
    }
    Set notToInherit = new HashSet(list.size() * 2);
    for (Iterator i = list.iterator(); i.hasNext(); ) {
        String name = (String) i.next();
        notToInherit.add(ServerEditViewBeanBase.getActualPropertyName(name));
    }
    notToInherit.removeAll(toInherit);
    try {
        ServerSiteModel model = (ServerSiteModel) getModel();
        String serverName = (String) getPageSessionAttribute(ServerEditViewBeanBase.PG_ATTR_SERVER_NAME);
        model.updateServerConfigInheritance(serverName, toInherit, notToInherit);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "servercfg.inheritance.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) SerializedField(com.sun.identity.console.components.view.html.SerializedField) Iterator(java.util.Iterator) 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 49 with CCActionTable

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

the class ServerConfigInheritViewBean 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 50 with CCActionTable

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

the class ServerConfigXMLViewBean method handleTblServerConfigXMLServerButtonDeleteRequest.

/**
     * Handles remove server group entry request.
     *
     * @param event Request invocation event
     */
public void handleTblServerConfigXMLServerButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    String serverName = (String) getPageSessionAttribute(ServerEditViewBeanBase.PG_ATTR_SERVER_NAME);
    ServerSiteModel model = (ServerSiteModel) getModel();
    try {
        ServerConfigXML xmlObj = model.getServerConfigObject(serverName);
        ServerConfigXML.ServerGroup smsServerGroup = xmlObj.getSMSServerGroup();
        CCActionTable table = (CCActionTable) getChild(TBL_SERVERS);
        table.restoreStateData();
        Integer[] selected = tblServerModel.getSelectedRows();
        if (selected.length >= smsServerGroup.hosts.size()) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("exception.cannot,delete.all.servers"));
        } else {
            for (int i = selected.length - 1; i >= 0; --i) {
                smsServerGroup.hosts.remove(selected[i].intValue());
            }
            model.setServerConfigXML(serverName, xmlObj.toXML());
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) ServerConfigXML(com.sun.identity.common.configuration.ServerConfigXML)

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