Search in sources :

Example 6 with WSFedPropertiesModel

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

the class WSFedSPViewBean 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 spExtValues = ps.getAttributeValues(model.getSPEXDataMap(), 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)) {
                spExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
            } else if (entry.getKey().equals(WSFedPropertiesModel.COT_LIST)) {
                spExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
            }
        }
        //save the extended metadata values for the SP
        model.setSPExtAttributeValues(realm, entityName, spExtValues, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.sp.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 7 with WSFedPropertiesModel

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

the class WSFedSPViewBean method getExtendedValues.

private Map getExtendedValues() {
    Map map = new HashMap();
    Map tmpMap = new HashMap();
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    try {
        //gets extended metadata values
        map = model.getServiceProviderAttributes(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)

Example 8 with WSFedPropertiesModel

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

the class WSFedSPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
    // set extended meta data values for the SP
    ps.setAttributeValues(getExtendedValues(), model);
    setDisplayFieldValue(WSFedPropertiesModel.TFUSR_AGENT_NAME, "Key");
    setDisplayFieldValue(WSFedPropertiesModel.TFCOKKI_NAME, "Name");
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet)

Example 9 with WSFedPropertiesModel

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

the class WSFedGeneralViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    //setting the Name fields
    setDisplayFieldValue(WSFedPropertiesModel.TF_REALM, realm);
    setDisplayFieldValue(WSFedPropertiesModel.TF_NAME, entityName);
    try {
        WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
        FederationElement fedElement = model.getEntityDesc(realm, entityName);
        //setting the Token Issuer Name
        setDisplayFieldValue(WSFedPropertiesModel.TFTOKENISSUER_NAME, model.getTokenName(fedElement));
        //setting the Token Issuer End Point
        setDisplayFieldValue(WSFedPropertiesModel.TFTOKENISSUER_ENDPT, model.getTokenEndpoint(fedElement));
        //setting the value of displayName
        setDisplayName(entityName, realm);
    } catch (AMConsoleException e) {
        debug.error("WSFedGeneralViewBean.beginDisplay", e);
    }
}
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 10 with WSFedPropertiesModel

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

the class WSFedGeneralViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    // get the entity name, realm, and location.
    retrieveCommonProperties();
    try {
        WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        String role = "dual";
        Map attributes = null;
        List roleList = getWSFedRoles(entityName, realm);
        if (roleList.size() == 1) {
            role = (String) roleList.listIterator().next();
            attributes = model.getGenAttributes();
        } else {
            attributes = model.getDualRoleAttributes();
        }
        Map values = ps.getAttributeValues(attributes, false, model);
        model.setGenAttributeValues(realm, entityName, values, role, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.general.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : WSFedPropertiesModel(com.sun.identity.console.federation.model.WSFedPropertiesModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) List(java.util.List) 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