Search in sources :

Example 76 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class CreateHostedSPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    String value = (String) getDisplayFieldValue(HAS_META_DATA);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(HAS_META_DATA, "no");
    }
    value = (String) getDisplayFieldValue(SELECT_COT);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(SELECT_COT, "no");
    }
    value = (String) getDisplayFieldValue(RADIO_EXTENDED);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_EXTENDED, "file");
    }
    value = (String) getDisplayFieldValue(RADIO_META);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_META, "file");
    }
    setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
    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);
    CCCheckBox cbAttrDefault = (CCCheckBox) getChild("tfDefaultAttrMapping");
    cbAttrDefault.setChecked(true);
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = getRequestContext().getRequest().getParameter("realm");
        if (realm != null && !realm.trim().isEmpty()) {
            setDisplayFieldValue(REALM, realm);
        }
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : Set(java.util.Set) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) 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 77 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException 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 78 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException 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 79 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException 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 80 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException 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)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)701 Map (java.util.Map)255 Set (java.util.Set)206 HashMap (java.util.HashMap)193 HashSet (java.util.HashSet)148 SSOException (com.iplanet.sso.SSOException)126 Iterator (java.util.Iterator)122 List (java.util.List)97 SMSException (com.sun.identity.sm.SMSException)83 ArrayList (java.util.ArrayList)78 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)76 IdRepoException (com.sun.identity.idm.IdRepoException)58 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)47 SAML2MetaManager (com.sun.identity.saml2.meta.SAML2MetaManager)46 AMIdentity (com.sun.identity.idm.AMIdentity)44 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)41 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)41 CCActionTable (com.sun.web.ui.view.table.CCActionTable)40 TreeSet (java.util.TreeSet)39 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)38