Search in sources :

Example 6 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateRemoteIDPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    HttpServletRequest req = getRequestContext().getRequest();
    String cot = req.getParameter("cot");
    if ((cot != null) && (cot.trim().length() > 0)) {
        setDisplayFieldValue(COT, cot);
        setDisplayFieldValue(COT_CHOICE, cot);
    }
    String realm = req.getParameter("realm");
    if ((realm != null) && (realm.trim().length() > 0)) {
        setDisplayFieldValue(REALM, realm);
    }
    String value = (String) getDisplayFieldValue(RADIO_META);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_META, "url");
    }
    value = (String) getDisplayFieldValue(SELECT_COT);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(SELECT_COT, "no");
    }
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Set(java.util.Set) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 7 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class ConfigureSalesForceAppsCompleteViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    try {
        super.beginDisplay(event);
        HttpServletRequest req = getRequestContext().getRequest();
        String realm = req.getParameter("realm");
        String idp = req.getParameter("idp");
        String attrMapp = req.getParameter("attrMapp");
        String spEntityId = req.getParameter(ENTITY_ID);
        setPageSessionAttribute(ENTITY_ID, spEntityId);
        setPageSessionAttribute("entityRealm", realm);
        TaskModel model = (TaskModel) getModelInternal();
        Map values = model.getConfigureSalesForceAppsURLs(realm, idp, attrMapp);
        String domainId = getModel().getLocalizedString("salesforce.link");
        String msg = "<ul>";
        String orgMsg = getModel().getLocalizedString("configure.salesforce.apps.complete.urllist");
        msg += "<li>";
        msg += MessageFormat.format(orgMsg, domainId, domainId);
        msg += "</li>";
        msg += "</ul>";
        values.put("urllist", returnEmptySetIfValueIsNull(msg));
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException ex) {
        Logger.getLogger(ConfigureSalesForceAppsCompleteViewBean.class.getName()).log(Level.SEVERE, null, ex);
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 8 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateRemoteSPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    HttpServletRequest req = getRequestContext().getRequest();
    String cot = req.getParameter("cot");
    if ((cot != null) && (cot.trim().length() > 0)) {
        setDisplayFieldValue(COT, cot);
        setDisplayFieldValue(COT_CHOICE, cot);
    }
    String realm = req.getParameter("realm");
    if ((realm != null) && (realm.trim().length() > 0)) {
        setDisplayFieldValue(REALM, realm);
    }
    String value = (String) getDisplayFieldValue(RADIO_META);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_META, "url");
    }
    value = (String) getDisplayFieldValue(SELECT_COT);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(SELECT_COT, "no");
    }
    populateTableModel();
    Set userAttrNames = AMAdminUtils.getUserAttributeNames();
    userAttrNames.remove("iplanet-am-user-account-life");
    CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
    OptionList optList = createOptionList(userAttrNames);
    optList.add(0, "name.attribute.mapping.select", "");
    menuUserAttribute.setOptions(optList);
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Set(java.util.Set) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 9 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class ConfigureGoogleAppsViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    HttpServletRequest req = getRequestContext().getRequest();
    try {
        TaskModel model = (TaskModel) getModel();
        Map map = model.getRealmCotWithHostedIDPs();
        Set realms = new TreeSet();
        realms.addAll(map.keySet());
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = req.getParameter("realm");
        if ((realm != null) && (realm.trim().length() > 0)) {
            setDisplayFieldValue(REALM, realm);
        } else {
            if (!realms.isEmpty()) {
                realm = (String) realms.iterator().next();
            }
        }
        if ((realm != null) && (realm.trim().length() > 0)) {
            Map mapCots = (Map) map.get(realm);
            Set cots = new TreeSet();
            cots.addAll(mapCots.keySet());
            CCDropDownMenu menuCOT = (CCDropDownMenu) getChild("choiceCOT");
            menuCOT.setOptions(createOptionList(cots));
            String cot = req.getParameter("cot");
            if ((cot != null) && (cot.trim().length() > 0)) {
                setDisplayFieldValue("choiceCOT", cot);
            } else {
                if (!cots.isEmpty()) {
                    cot = (String) cots.iterator().next();
                }
            }
            if ((cot != null) && (cot.trim().length() > 0)) {
                Set idps = new TreeSet();
                idps.addAll((Set) mapCots.get(cot));
                CCDropDownMenu menuIDP = (CCDropDownMenu) getChild("choiceIDP");
                menuIDP.setOptions(createOptionList(idps));
                String idp = req.getParameter("entityId");
                if ((idp != null) && (idp.trim().length() > 0)) {
                    setDisplayFieldValue("choiceIDP", idp);
                }
            }
        }
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
    String cot = req.getParameter("cot");
    if ((cot != null) && (cot.trim().length() > 0)) {
        setDisplayFieldValue(COT_CHOICE, cot);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Set(java.util.Set) TreeSet(java.util.TreeSet) TreeSet(java.util.TreeSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 10 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class ConfigureGoogleAppsCompleteViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    try {
        super.beginDisplay(event);
        HttpServletRequest req = getRequestContext().getRequest();
        String realm = req.getParameter("realm");
        String entityId = req.getParameter("idp");
        TaskModel model = (TaskModel) getModelInternal();
        Map values = model.getConfigureGoogleAppsURLs(realm, entityId);
        String domainIds = req.getParameter("domainId");
        StringTokenizer st = new StringTokenizer(domainIds, ",");
        String domainId = null;
        String msg = "<ul>";
        while (st.hasMoreTokens()) {
            domainId = st.nextToken().trim();
            String orgMsg = getModel().getLocalizedString("configure.google.apps.complete.urllist");
            msg += "<li>";
            msg += MessageFormat.format(orgMsg, domainId, domainId);
            msg += "</li>";
        }
        msg += "</ul>";
        values.put("urllist", returnEmptySetIfValueIsNull(msg));
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException ex) {
        Logger.getLogger(ConfigureGoogleAppsCompleteViewBean.class.getName()).log(Level.SEVERE, null, ex);
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) StringTokenizer(java.util.StringTokenizer) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) TaskModel(com.sun.identity.console.task.model.TaskModel)

Aggregations

TaskModel (com.sun.identity.console.task.model.TaskModel)20 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)15 Set (java.util.Set)12 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)9 TreeSet (java.util.TreeSet)7 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 OptionList (com.iplanet.jato.view.html.OptionList)5 Iterator (java.util.Iterator)5 Map (java.util.Map)5 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)2 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)1 StringTokenizer (java.util.StringTokenizer)1