Search in sources :

Example 1 with CreateMetaDataModel

use of com.sun.identity.console.federation.model.CreateMetaDataModel in project OpenAM by OpenRock.

the class CreateSAML2MetaDataViewBean method handleButton1Request.

/**
     * Handles save button request.
     * save
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    setPageSessionAttribute(getTrackingTabIDName(), AMAdminConstants.FED_TAB_ID);
    setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, getTrackingTabIDName());
    CreateMetaDataModel model = (CreateMetaDataModel) getModel();
    try {
        String realm = getDisplayFieldStringValue("singleChoiceRealm");
        String entityId = getDisplayFieldStringValue("tfEntityId");
        if ((realm == null) || (realm.trim().length() == 0)) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("samlv2.create.provider.missing.realm"));
            forwardTo();
        } else if ((entityId == null) || (entityId.trim().length() == 0)) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("samlv2.create.provider.missing.entityId"));
            forwardTo();
        } else {
            Map map = getWorkflowParamMap(realm, model);
            if (protocol.equals(PROTO_SAMLv2)) {
                model.createSAMLv2Provider(realm, entityId, map);
            } else if (protocol.equals(PROTO_IDFF)) {
                model.createIDFFProvider(realm, entityId, map);
            } else {
                model.createWSFedProvider(realm, entityId, map);
            }
            backTrail();
            FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : CreateMetaDataModel(com.sun.identity.console.federation.model.CreateMetaDataModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with CreateMetaDataModel

use of com.sun.identity.console.federation.model.CreateMetaDataModel in project OpenAM by OpenRock.

the class CreateSAML2MetaDataViewBean method populateRealmData.

private void populateRealmData() {
    CreateMetaDataModel model = (CreateMetaDataModel) getModel();
    try {
        Set realmNames = new TreeSet(model.getRealmNames("/", "*"));
        CCDropDownMenu menu = (CCDropDownMenu) getChild("singleChoiceRealm");
        OptionList list = new OptionList();
        for (Iterator i = realmNames.iterator(); i.hasNext(); ) {
            String name = (String) i.next();
            list.add(getPath(name), name);
        }
        menu.setOptions(list);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : TreeSet(java.util.TreeSet) Set(java.util.Set) TreeSet(java.util.TreeSet) Iterator(java.util.Iterator) CreateMetaDataModel(com.sun.identity.console.federation.model.CreateMetaDataModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 CreateMetaDataModel (com.sun.identity.console.federation.model.CreateMetaDataModel)2 OptionList (com.iplanet.jato.view.html.OptionList)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1