Search in sources :

Example 11 with CCEditableList

use of com.sun.web.ui.view.editablelist.CCEditableList in project OpenAM by OpenRock.

the class AMPropertySheet method restoreStateData.

/**
     * Automates the restoring of store data in some children. This is required
     * for some special children such as <code>CCAddRemvoe</code>.
     *
     * @throws ModelControlException if cannot get model of property sheet.
     */
public void restoreStateData(Collection participatingChildren) throws ModelControlException {
    ViewBean parent = getParentViewBean();
    String[] names = parent == null ? null : parent.getChildNames();
    if ((names != null) && (names.length > 0)) {
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (participatingChildren.contains(name)) {
                View child = parent.getChild(name);
                if (CCAddRemove.class.isInstance(child)) {
                    ((CCAddRemove) child).restoreStateData();
                } else if (CCUnOrderedList.class.isInstance(child)) {
                    ((CCUnOrderedList) child).restoreStateData();
                } else if (CCMapList.class.isInstance(child)) {
                    ((CCMapList) child).restoreStateData();
                } else if (CCEditableList.class.isInstance(child)) {
                    ((CCEditableList) child).restoreStateData();
                } else if (CCOrderedList.class.isInstance(child)) {
                    ((CCOrderedList) child).restoreStateData();
                } else if (CCActionTable.class.isInstance(child)) {
                    ((CCActionTable) child).restoreStateData();
                }
            }
        }
    }
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCMapList(com.sun.identity.console.ui.view.CCMapList) ViewBean(com.iplanet.jato.view.ViewBean) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 12 with CCEditableList

use of com.sun.web.ui.view.editablelist.CCEditableList in project OpenAM by OpenRock.

the class CreateSAML2MetaDataViewBean method getWorkflowParamMap.

private Map getWorkflowParamMap(String realm, CreateMetaDataModel model) throws AMConsoleException {
    Map map = new HashMap();
    boolean hasRole = false;
    hasRole |= addStringToMap(map, MetaTemplateParameters.P_IDP, "tfidentityprovider", realm);
    addStringToMap(map, MetaTemplateParameters.P_IDP_S_CERT, "tfidpscertalias");
    addStringToMap(map, MetaTemplateParameters.P_IDP_E_CERT, "tfidpecertalias");
    hasRole |= addStringToMap(map, MetaTemplateParameters.P_SP, "tfserviceprovider", realm);
    addStringToMap(map, MetaTemplateParameters.P_SP_S_CERT, "tfspscertalias");
    addStringToMap(map, MetaTemplateParameters.P_SP_E_CERT, "tfspecertalias");
    if ((protocol.equals(PROTO_SAMLv2))) {
        hasRole |= addStringToMap(map, MetaTemplateParameters.P_ATTR_QUERY_PROVIDER, "tfattrqueryprovider", realm);
        addStringToMap(map, MetaTemplateParameters.P_ATTR_QUERY_PROVIDER_S_CERT, "tfattrqscertalias");
        addStringToMap(map, MetaTemplateParameters.P_ATTR_QUERY_PROVIDER_E_CERT, "tfattrqecertalias");
        hasRole |= addStringToMap(map, MetaTemplateParameters.P_ATTR_AUTHORITY, "tfattrauthority", realm);
        addStringToMap(map, MetaTemplateParameters.P_ATTR_AUTHORITY_S_CERT, "tfattrascertalias");
        addStringToMap(map, MetaTemplateParameters.P_ATTR_AUTHORITY_E_CERT, "tfattraecertalias");
        hasRole |= addStringToMap(map, MetaTemplateParameters.P_AUTHN_AUTHORITY, "tfauthnauthority", realm);
        addStringToMap(map, MetaTemplateParameters.P_AUTHN_AUTHORITY_S_CERT, "tfauthnascertalias");
        addStringToMap(map, MetaTemplateParameters.P_AUTHN_AUTHORITY_E_CERT, "tfauthnaecertalias");
        hasRole |= addStringToMap(map, MetaTemplateParameters.P_PEP, "tfxacmlpep", realm);
        addStringToMap(map, MetaTemplateParameters.P_PEP_S_CERT, "tfxacmlpepscertalias");
        addStringToMap(map, MetaTemplateParameters.P_PEP_E_CERT, "tfxacmlpepecertalias");
        hasRole |= addStringToMap(map, MetaTemplateParameters.P_PDP, "tfxacmlpdp", realm);
        addStringToMap(map, MetaTemplateParameters.P_PDP_S_CERT, "tfxacmlpdpscertalias");
        addStringToMap(map, MetaTemplateParameters.P_PDP_E_CERT, "tfxacmlpdpecertalias");
        boolean bAffiliation = addStringToMap(map, MetaTemplateParameters.P_AFFILIATION, "tfaffiliation", realm);
        hasRole |= bAffiliation;
        addStringToMap(map, MetaTemplateParameters.P_AFFI_S_CERT, "tfaffiscertalias");
        addStringToMap(map, MetaTemplateParameters.P_AFFI_E_CERT, "tfaffiecertalias");
        String owner = this.getDisplayFieldStringValue(MetaTemplateParameters.P_AFFI_OWNERID);
        if (owner != null && owner.length() > 0) {
            addStringToMap(map, MetaTemplateParameters.P_AFFI_OWNERID, "affiOwnerID");
        } else if (bAffiliation) {
            throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.affiliation.owner"));
        }
        CCEditableList eList = (CCEditableList) getChild(AFFI_MEMBERS);
        eList.restoreStateData();
        Set affiMembers = getValues(eList.getModel().getOptionList());
        if ((affiMembers != null) && !affiMembers.isEmpty()) {
            List list = new ArrayList();
            list.addAll(affiMembers);
            map.put(MetaTemplateParameters.P_AFFI_MEMBERS, list);
        } else if (bAffiliation) {
            throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.affiliation.members"));
        }
    } else if (protocol.equals(PROTO_IDFF)) {
        boolean bAffiliation = addStringToMap(map, MetaTemplateParameters.P_AFFILIATION, "tfaffiliation", realm);
        hasRole |= bAffiliation;
        addStringToMap(map, MetaTemplateParameters.P_AFFI_S_CERT, "tfaffiscertalias");
        addStringToMap(map, MetaTemplateParameters.P_AFFI_E_CERT, "tfaffiecertalias");
        String owner = this.getDisplayFieldStringValue(MetaTemplateParameters.P_AFFI_OWNERID);
        if (owner != null && owner.length() > 0) {
            addStringToMap(map, MetaTemplateParameters.P_AFFI_OWNERID, "affiOwnerID");
        } else if (bAffiliation) {
            throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.affiliation.owner"));
        }
        CCEditableList eList = (CCEditableList) getChild(AFFI_MEMBERS);
        eList.restoreStateData();
        Set affiMembers = getValues(eList.getModel().getOptionList());
        if ((affiMembers != null) && !affiMembers.isEmpty()) {
            List list = new ArrayList();
            list.addAll(affiMembers);
            map.put(MetaTemplateParameters.P_AFFI_MEMBERS, list);
        } else if (bAffiliation) {
            throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.affiliation.members"));
        }
    }
    if (!hasRole) {
        throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.roles"));
    }
    return map;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) TreeSet(java.util.TreeSet) Set(java.util.Set) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)12 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)7 View (com.iplanet.jato.view.View)6 Set (java.util.Set)6 CCUnOrderedList (com.sun.identity.console.ui.view.CCUnOrderedList)4 HashMap (java.util.HashMap)4 TreeSet (java.util.TreeSet)4 ContainerView (com.iplanet.jato.view.ContainerView)3 OptionList (com.iplanet.jato.view.html.OptionList)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 CCMapList (com.sun.identity.console.ui.view.CCMapList)3 CCOrderedList (com.sun.identity.console.ui.view.CCOrderedList)3 List (java.util.List)3 Map (java.util.Map)3 CCMapListModel (com.sun.identity.console.ui.model.CCMapListModel)2 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)2 CCUnOrderedListModel (com.sun.identity.console.ui.model.CCUnOrderedListModel)2 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)2 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)2 ArrayList (java.util.ArrayList)2