Search in sources :

Example 1 with MAPServiceModel

use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method forwardTo.

/**
     * Forwards to Message View Bean if there are no profiles.
     *
     * @param reqContext Request Context.
     * @throws NavigationException if model object is not accessible.
     */
public void forwardTo(RequestContext reqContext) throws NavigationException {
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set profileNames = model.getProfileNames();
    if ((profileNames == null) || profileNames.isEmpty()) {
        MessageViewBean vb = (MessageViewBean) getViewBean(MessageViewBean.class);
        vb.setMessage(CCAlert.TYPE_INFO, "message.information", "map.no.profiles");
        vb.forwardTo(reqContext);
    } else {
        super.forwardTo(reqContext);
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) MessageViewBean(com.sun.identity.console.base.MessageViewBean)

Example 2 with MAPServiceModel

use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method deleteDevice.

private void deleteDevice(String deviceName, String message) {
    MAPServiceModel model = (MAPServiceModel) getModel();
    try {
        model.removeClient(deviceName);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", message);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 3 with MAPServiceModel

use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method createTab.

private View createTab(String name) {
    CCTabsModel tabModel = new CCTabsModel();
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set profileNames = model.getProfileNames();
    if ((profileNames != null) && !profileNames.isEmpty()) {
        for (Iterator iter = profileNames.iterator(); iter.hasNext(); ) {
            String val = (String) iter.next();
            tabModel.addNode(new CCNavNode(val.hashCode(), val, val, val));
        }
        tabModel.setSelectedNode(getProfileName().hashCode());
    }
    return new CCTabs(this, tabModel, name);
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) CCNavNode(com.sun.web.ui.model.CCNavNode) CCTabs(com.sun.web.ui.view.tabs.CCTabs) Set(java.util.Set) Iterator(java.util.Iterator)

Example 4 with MAPServiceModel

use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method getProfileName.

private String getProfileName(int nodeID) {
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set profileNames = model.getProfileNames();
    String profileName = null;
    if ((profileNames != null) && !profileNames.isEmpty()) {
        for (Iterator iter = profileNames.iterator(); iter.hasNext() && (profileName == null); ) {
            String val = (String) iter.next();
            if (val.hashCode() == nodeID) {
                profileName = val;
            }
        }
    }
    return profileName;
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) Iterator(java.util.Iterator)

Example 5 with MAPServiceModel

use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method setStyles.

private void setStyles() {
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set styles = model.getStyleNames(getProfileName());
    if ((styles != null) && !styles.isEmpty()) {
        OptionList styleList = new OptionList();
        for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            styleList.add(name, name);
        }
        CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
        menu.setOptions(styleList);
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) Iterator(java.util.Iterator) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

MAPServiceModel (com.sun.identity.console.service.model.MAPServiceModel)7 Set (java.util.Set)5 Iterator (java.util.Iterator)4 OptionList (com.iplanet.jato.view.html.OptionList)1 MessageViewBean (com.sun.identity.console.base.MessageViewBean)1 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 CCNavNode (com.sun.web.ui.model.CCNavNode)1 CCTabsModel (com.sun.web.ui.model.CCTabsModel)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCTabs (com.sun.web.ui.view.tabs.CCTabs)1