Search in sources :

Example 1 with WSFedPropertiesModel

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

the class WSFedGeneralViewBean method setDisplayName.

private void setDisplayName(String entityName, String realm) {
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    Map spmap = new HashMap();
    Map idpmap = new HashMap();
    try {
        // retrieve role of entity
        List roleList = getWSFedRoles(entityName, realm);
        Iterator rIt = roleList.listIterator();
        // to display idp and sp display names in case of a dual entity
        if (roleList.size() > 1) {
            spmap = model.getServiceProviderAttributes(realm, entityName);
            idpmap = model.getIdentityProviderAttributes(realm, entityName);
            setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(spmap));
            setDisplayFieldValue(WSFedPropertiesModel.TFIDPDISP_NAME, getDisplayName(idpmap));
        } else {
            // to show display name for an entity with single role
            while (rIt.hasNext()) {
                String role = (String) rIt.next();
                if (role.equals(EntityModel.SERVICE_PROVIDER)) {
                    spmap = model.getServiceProviderAttributes(realm, entityName);
                    setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(spmap));
                } else if (role.equals(EntityModel.IDENTITY_PROVIDER)) {
                    idpmap = model.getIdentityProviderAttributes(realm, entityName);
                    setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(idpmap));
                }
            }
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "error in setting Display Name ");
    }
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) HashMap(java.util.HashMap) Iterator(java.util.Iterator) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with WSFedPropertiesModel

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

the class WSFedIDPViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    retrieveCommonProperties();
    try {
        WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        //retrieve all the extended metadata values from the property sheet
        Map idpExtValues = ps.getAttributeValues(model.getIDPEXDataMap(), false, model);
        // should retain the value of the displayname and cotlist from General page
        Set entries = getExtendedValues().entrySet();
        Iterator iterator = entries.iterator();
        while (iterator.hasNext()) {
            Map.Entry entry = (Map.Entry) iterator.next();
            if (entry.getKey().equals(WSFedPropertiesModel.TF_DISPNAME)) {
                idpExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
            } else if (entry.getKey().equals(WSFedPropertiesModel.COT_LIST)) {
                idpExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
            }
        }
        //retrieve all the standard metadata values from the property sheet
        Map idpStdValues = ps.getAttributeValues(model.getIDPSTDDataMap(), false, model);
        //save the standard metadata values for the Idp
        model.setIDPSTDAttributeValues(entityName, idpStdValues, realm, idpExtValues, location);
        //save the extended metadata values for the Idp
        model.setIDPExtAttributeValues(realm, entityName, idpExtValues, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.idp.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) Set(java.util.Set) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with WSFedPropertiesModel

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

the class WSFedIDPViewBean method getStandardValues.

private String getStandardValues() {
    String claimName = null;
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    try {
        FederationElement fedElem = model.getEntityDesc(realm, entityName);
        claimName = model.getClaimType(fedElem);
        if (claimName.equals(strUPN)) {
            claimName = WSFederationConstants.NAMED_CLAIM_DISPLAY_NAMES[WSFederationConstants.NAMED_CLAIM_UPN];
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    return claimName;
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) FederationElement(com.sun.identity.wsfederation.jaxb.wsfederation.FederationElement)

Example 4 with WSFedPropertiesModel

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

the class WSFedIDPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
    //sets the extended meta data values for the Idp
    ps.setAttributeValues(getExtendedValues(), model);
    //sets the claimtype display name
    setDisplayFieldValue(WSFedPropertiesModel.TFCLAIM_TYPES, getStandardValues());
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet)

Example 5 with WSFedPropertiesModel

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

the class WSFedIDPViewBean method getExtendedValues.

private Map getExtendedValues() {
    Map map = new HashMap();
    Map tmpMap = new HashMap();
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    try {
        //gets extended metadata values
        map = model.getIdentityProviderAttributes(realm, entityName);
        Set entries = map.entrySet();
        Iterator iterator = entries.iterator();
        //the list of values is converted to a set
        while (iterator.hasNext()) {
            Map.Entry entry = (Map.Entry) iterator.next();
            tmpMap.put((String) entry.getKey(), returnEmptySetIfValueIsNull(convertListToSet((List) entry.getValue())));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    return tmpMap;
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) Set(java.util.Set) HashMap(java.util.HashMap) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

WSFedPropertiesModel (com.sun.identity.console.federation.model.WSFedPropertiesModel)10 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)8 HashMap (java.util.HashMap)6 Map (java.util.Map)6 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)5 Iterator (java.util.Iterator)5 Set (java.util.Set)4 FederationElement (com.sun.identity.wsfederation.jaxb.wsfederation.FederationElement)2 List (java.util.List)2