Search in sources :

Example 6 with MAPServiceModel

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

the class MAPClientManagerViewBean method handleTblDataActionDuplicateHrefRequest.

/**
     * Handles duplicate device request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblDataActionDuplicateHrefRequest(RequestInvocationEvent event) {
    String name = (String) getDisplayFieldValue(TBL_DATA_ACTION_DUPLICATE_HREF);
    MAPServiceModel model = (MAPServiceModel) getModel();
    MAPDuplicationDeviceViewBean vb = (MAPDuplicationDeviceViewBean) getViewBean(MAPDuplicationDeviceViewBean.class);
    vb.clientType = model.getClientTypePrefix() + name;
    vb.deviceName = model.getDeviceNamePrefix() + model.getDeviceUserAgent(name);
    vb.setDisplayFieldValue(MAPDuplicationDeviceViewBean.TF_ORIG_CLIENT_TYPE, name);
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel)

Example 7 with MAPServiceModel

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

the class MAPClientManagerViewBean method populateTableModel.

private void populateTableModel() {
    tblModel.clearAll();
    boolean first = true;
    String filter = (String) getDisplayFieldValue(TF_FILTER);
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set devices = model.getDeviceNames(getProfileName(), getBaseStyle(), filter);
    if ((devices != null) && !devices.isEmpty()) {
        for (Iterator iter = devices.iterator(); iter.hasNext(); ) {
            if (!first) {
                tblModel.appendRow();
            } else {
                first = false;
            }
            String name = (String) iter.next();
            tblModel.setValue(TBL_DATA_NAME, name);
            tblModel.setValue(TBL_DATA_ACTION_HREF, name);
            tblModel.setValue(TBL_DATA_ACTION_DEFAULT_HREF, name);
            tblModel.setValue(TBL_DATA_ACTION_DUPLICATE_HREF, name);
            tblModel.setValue(TBL_DATA_ACTION_DELETE_HREF, name);
            tblModel.setValue(TBL_DATA_ACTION_LABEL, "clientDetection.edit.hyperlink.label");
            tblModel.setValue(TBL_DATA_ACTION_DUPLICATE_LABEL, "clientDetection.duplicate.hyperlink.label");
            if (model.isCustomizable(name)) {
                tblModel.setValue(TBL_CUSTOMIZABLE, "clientDetection.customizable.label");
            } else {
                tblModel.setValue(TBL_CUSTOMIZABLE, "");
            }
            if (model.hasDefaultSetting(name)) {
                tblModel.setValue(TBL_DATA_ACTION_DEFAULT_LABEL, "clientDetection.default.hyperlink.label");
            } else {
                tblModel.setValue(TBL_DATA_ACTION_DEFAULT_LABEL, "");
            }
            if (model.canBeDeleted(name)) {
                tblModel.setValue(TBL_DATA_ACTION_DELETE_LABEL, "clientDetection.delete.hyperlink.label");
            } else {
                tblModel.setValue(TBL_DATA_ACTION_DELETE_LABEL, "");
            }
        }
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) Iterator(java.util.Iterator)

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