Search in sources :

Example 6 with FSAuthDomainsModel

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

the class FSAuthDomainsEditViewBean method handleButton1Request.

/**
     * Handles create authentication domains view bean.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
    String name = (String) getDisplayFieldValue(model.TF_NAME);
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    try {
        String realm = model.getRealm(name);
        Map values = ps.getAttributeValues(model.getDataMap(), false, model);
        model.setAttributeValues(realm, name, values);
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
        CCAddRemove addRemoveList = (CCAddRemove) getChild(ADD_REMOVE_PROVIDERS);
        addRemoveList.restoreStateData();
        CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
        List list = new ArrayList(getSelectedValues(addRemoveModel));
        model.addProviders(realm, name, list);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.domain.updated");
        forwardTo();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) ArrayList(java.util.ArrayList) FSAuthDomainsModel(com.sun.identity.console.federation.model.FSAuthDomainsModel) ArrayList(java.util.ArrayList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 7 with FSAuthDomainsModel

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

the class FSAuthDomainsEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    String name = (String) getDisplayFieldValue(FSAuthDomainsModel.TF_NAME);
    setPageSessionAttribute(FSAuthDomainsModel.TF_NAME, name);
    FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
    try {
        String realm = model.getRealm(name);
        Map values = model.getAttributeValues(realm, name);
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        ps.setAttributeValues(values, model);
        if (addRemoveModel == null) {
            addRemoveModel = new CCAddRemoveModel();
        }
        Set providers = model.getAllProviderNames(realm);
        List selectedProviders = new ArrayList(model.getTrustedProviderNames(realm, name));
        if ((selectedProviders != null) || (!selectedProviders.isEmpty())) {
            providers.removeAll(selectedProviders);
            Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, selectedProviders);
            addRemoveModel.setSelectedOptionList(createOptionList(replacePipeWithComma(displayNames)));
        }
        Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, providers);
        addRemoveModel.setAvailableOptionList(createOptionList(replacePipeWithComma(displayNames)));
        propertySheetModel.setModel(ADD_REMOVE_PROVIDERS, addRemoveModel);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) HashSet(java.util.HashSet) Set(java.util.Set) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) ArrayList(java.util.ArrayList) FSAuthDomainsModel(com.sun.identity.console.federation.model.FSAuthDomainsModel) ArrayList(java.util.ArrayList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 8 with FSAuthDomainsModel

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

the class CreateCOTViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    ps.init();
    populateRealmData();
    FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
    String realm = "/";
    try {
        if (addRemoveModel == null) {
            addRemoveModel = new CCAddRemoveModel();
        }
        Set providers = model.getAllProviderNames(realm);
        Map displayNames = FSAuthDomainsOpViewBeanBase.getProviderDisplayNames(model, providers);
        addRemoveModel.setAvailableOptionList(createOptionList(replacePipeWithComma(displayNames)));
        psModel.setModel(ADD_REMOVE_PROVIDERS, addRemoveModel);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) Set(java.util.Set) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) FSAuthDomainsModel(com.sun.identity.console.federation.model.FSAuthDomainsModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)8 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)6 HashSet (java.util.HashSet)5 Set (java.util.Set)5 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 List (java.util.List)4 Map (java.util.Map)4 OptionList (com.iplanet.jato.view.html.OptionList)3 SerializedField (com.sun.identity.console.components.view.html.SerializedField)3 TreeSet (java.util.TreeSet)3 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)2 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)2 Iterator (java.util.Iterator)2 CircleOfTrustDescriptor (com.sun.identity.cot.CircleOfTrustDescriptor)1 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1