Search in sources :

Example 6 with IDFFModel

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

the class IDFFGeneralViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    psModel.setValue(TF_NAME, entityName);
    IDFFModel model = (IDFFModel) getModel();
    try {
        if (model.isAffiliate(realm, entityName)) {
            psModel.setValue(TXT_TYPE, "idff.entityDescriptor.type.affiliate.label");
        } else {
            psModel.setValue(TXT_TYPE, "idff.entityDescriptor.type.provider.label");
        }
    } catch (AMConsoleException e) {
        debug.error("IDFFGeneralViewBean.beginDisplay", e);
    }
    populateValue(entityName);
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 7 with IDFFModel

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

the class IDFFIDPViewBean method populateAuthenticationContext.

private void populateAuthenticationContext(String name, IDFFAuthContexts authContexts, int index) {
    if (index != 0) {
        tblAuthContextsModel.appendRow();
    }
    IDFFModel model = (IDFFModel) getModelInternal();
    tblAuthContextsModel.setValue(TBL_DATA_CONTEXT_REFERENCE, name);
    tblAuthContextsModel.setValue(TBL_DATA_LABEL, model.getLocalizedString(getAuthContextI18nKey(name)));
    IDFFAuthContexts.IDFFAuthContext c = null;
    if (authContexts != null) {
        c = authContexts.get(name);
    }
    if (c == null) {
        tblAuthContextsModel.setValue(TBL_DATA_LEVEL, "0");
        tblAuthContextsModel.setValue(TBL_DATA_KEY, "none");
        tblAuthContextsModel.setValue(TBL_DATA_SUPPORTED, "");
        tblAuthContextsModel.setValue(TBL_DATA_VALUE, "");
    } else {
        tblAuthContextsModel.setValue(TBL_DATA_LEVEL, c.level);
        tblAuthContextsModel.setValue(TBL_DATA_KEY, c.key);
        tblAuthContextsModel.setValue(TBL_DATA_SUPPORTED, c.supported);
        tblAuthContextsModel.setValue(TBL_DATA_VALUE, c.value);
    }
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel)

Example 8 with IDFFModel

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

the class IDFFSPViewBean method populateValue.

private void populateValue(String realm, String name) {
    try {
        IDFFModel model = (IDFFModel) getModelInternal();
        Map values = model.getEntitySPDescriptor(realm, name);
        values.putAll(model.getSPEntityConfig(realm, name, location));
        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 9 with IDFFModel

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

the class IDFFAffiliateViewBean method handleButton1Request.

/**
     * Handles save
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    retrieveCommonProperties();
    IDFFModel model = (IDFFModel) getModel();
    try {
        // get affiliate members
        CCAddRemove addRemoveList = (CCAddRemove) getChild(model.ATTR_AFFILIATE_MEMBERS);
        addRemoveList.restoreStateData();
        CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
        Set members = new HashSet(getSelectedValues(addRemoveModel));
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        Map orig = model.getAffiliateProfileAttributeValues(realm, entityName);
        Map values = ps.getAttributeValues(orig, false, model);
        model.updateAffiliateProfile(realm, entityName, values, members);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "idff.entityDescriptor.Affiliate.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        debug.warning("IDFFAffiliateViewBean.handleButton1Request", e);
    }
    forwardTo();
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) Set(java.util.Set) HashSet(java.util.HashSet) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) Map(java.util.Map) HashSet(java.util.HashSet)

Example 10 with IDFFModel

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

the class IDFFIDPViewBean method populateValue.

private void populateValue(String name, String realm) {
    try {
        IDFFModel model = (IDFFModel) getModelInternal();
        Map values = model.getEntityIDPDescriptor(realm, name);
        values.putAll(model.getIDPEntityConfig(realm, name, location));
        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)

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