Search in sources :

Example 1 with IDFFModel

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

the class IDFFSPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    IDFFModel model = (IDFFModel) getModelInternal();
    psModel.setValue(IDFFModel.ATTR_PROVIDER_TYPE, (String) getPageSessionAttribute(ENTITY_LOCATION));
    populateValue(realm, entityName);
    if (isHosted()) {
        IDFFAuthContexts authContexts = null;
        try {
            authContexts = model.getSPAuthenticationContexts(realm, entityName);
        } catch (AMConsoleException e) {
            debug.warning("IDFFSPViewBean", e);
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
        populateAuthenticationContext(authContexts);
    }
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 2 with IDFFModel

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

the class IDFFSPViewBean method handleButton1Request.

/**
     * Handles save
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    retrieveCommonProperties();
    try {
        IDFFModel model = (IDFFModel) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        // update standard metadata and extended metadata           
        Map stdValues = ps.getAttributeValues(model.getEntitySPDescriptor(realm, entityName), false, model);
        Map extValues = ps.getAttributeValues(model.getAllSPExtendedMetaMap(), false, model);
        Map spAllExtValues = model.getSPEntityConfig(realm, entityName, ENTITY_LOCATION);
        spAllExtValues.putAll(extValues);
        model.updateEntitySPDescriptor(realm, entityName, stdValues, spAllExtValues, isHosted());
        model.updateSPEntityConfig(realm, entityName, spAllExtValues);
        if (isHosted()) {
            // update Authentication Contexts
            model.updateSPAuthenticationContexts(realm, entityName, getAuthenticationContexts());
        }
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "idff.entityDescriptor.provider.sp.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        debug.warning("IDFFSPViewBean -> handleButton1Request", e);
    }
    forwardTo();
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 3 with IDFFModel

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

the class IDFFGeneralViewBean method populateValue.

private void populateValue(String name) {
    IDFFModel model = (IDFFModel) getModel();
    try {
        Map values = model.getCommonAttributeValues(realm, name);
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 4 with IDFFModel

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

the class IDFFIDPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    IDFFModel model = (IDFFModel) getModelInternal();
    psModel.setValue(IDFFModel.ATTR_PROVIDER_TYPE, (String) getPageSessionAttribute(ENTITY_LOCATION));
    populateValue(entityName, realm);
    if (isHosted()) {
        IDFFAuthContexts authContexts = null;
        try {
            authContexts = model.getIDPAuthenticationContexts(realm, entityName);
        } catch (AMConsoleException e) {
            debug.warning("IDFFIDPViewBean", e);
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
        populateAuthenticationContext(authContexts);
    }
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 5 with IDFFModel

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

the class IDFFAffiliateViewBean method populateValue.

private void populateValue(String name) {
    IDFFModel model = (IDFFModel) getModelInternal();
    try {
        Map values = model.getAffiliateProfileAttributeValues(realm, name);
        Set availableEntities = model.getAllEntityDescriptorNames(realm);
        Set affliliatEntities = model.getAllAffiliateEntityDescriptorNames(realm);
        Set affiliateMembers = model.getAllAffiliateMembers(realm, name);
        availableEntities.removeAll(affiliateMembers);
        availableEntities.removeAll(affliliatEntities);
        if (affiliateMembersModel == null) {
            affiliateMembersModel = new CCAddRemoveModel();
        }
        if ((availableEntities != null) && !availableEntities.isEmpty()) {
            affiliateMembersModel.setAvailableOptionList(createOptionList(availableEntities));
        }
        if ((affiliateMembers != null) && !affiliateMembers.isEmpty()) {
            affiliateMembersModel.setSelectedOptionList(createOptionList(affiliateMembers));
        }
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) Set(java.util.Set) HashSet(java.util.HashSet) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Aggregations

IDFFModel (com.sun.identity.console.federation.model.IDFFModel)14 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)11 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)8 Map (java.util.Map)8 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)1