Search in sources :

Example 16 with CCAddRemoveModel

use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.

the class SAMLv2AffiliateViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    ps.init();
    SAMLv2Model model = (SAMLv2Model) getModel();
    try {
        Map values = getStandardAffiliationValues();
        Set allSPEntities = model.getallSPEntities(realm);
        Set affiliateMembers = (Set) values.get(model.AFFILIATE_MEMBER);
        allSPEntities.removeAll(affiliateMembers);
        if (samladdRemoveModel == null) {
            samladdRemoveModel = new CCAddRemoveModel();
        }
        if ((allSPEntities != null) && !allSPEntities.isEmpty()) {
            samladdRemoveModel.setAvailableOptionList(createOptionList(allSPEntities));
        }
        if ((affiliateMembers != null) && !affiliateMembers.isEmpty()) {
            samladdRemoveModel.setSelectedOptionList(createOptionList(affiliateMembers));
        }
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    ps.setAttributeValues(getExtendedAffiliationValues(), model);
}
Also used : 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) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) HashMap(java.util.HashMap) Map(java.util.Map)

Example 17 with CCAddRemoveModel

use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.

the class SMDiscoveryDescriptionViewBeanBase method getValues.

private SMDescriptionData getValues() throws AMConsoleException {
    SMDescriptionData smData = new SMDescriptionData();
    smData.descriptionID = (String) getDisplayFieldValue(TF_DESCRIPTION_ID);
    if (smData.descriptionID.length() == 0) {
        smData.descriptionID = SAMLUtils.generateID();
    }
    CCAddRemove mechIdChild = (CCAddRemove) getChild(ATTR_NAME_SECURITY_MECH_ID);
    mechIdChild.restoreStateData();
    CCAddRemoveModel mechIdModel = (CCAddRemoveModel) propertySheetModel.getModel(ATTR_NAME_SECURITY_MECH_ID);
    smData.securityMechId = getList(mechIdModel.getSelectedOptionList());
    smData.endPointUrl = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_END_POINT)).trim();
    smData.soapAction = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_ACTION)).trim();
    if (smData.securityMechId.isEmpty()) {
        throw new AMConsoleException("discovery.service.description.missing.securityMechId.message");
    }
    if (smData.endPointUrl.length() == 0) {
        throw new AMConsoleException("discovery.service.description.missing.endPointUrl.message");
    }
    return smData;
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 18 with CCAddRemoveModel

use of com.sun.web.ui.model.CCAddRemoveModel 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)

Example 19 with CCAddRemoveModel

use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.

the class AMPropertySheetModel method clear.

public void clear() {
    super.clear();
    for (Iterator iter = children.iterator(); iter.hasNext(); ) {
        View view = (View) iter.next();
        if (CCAddRemove.class.isInstance(view)) {
            CCAddRemoveModel m = (CCAddRemoveModel) getModel(view.getName());
            m.clear();
            m.setAvailableOptionList(new OptionList());
            m.setSelectedOptionList(new OptionList());
        } else if (CCEditableList.class.isInstance(view)) {
            CCEditableListModel m = (CCEditableListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCEditableList) view).resetStateData();
        } else if (CCOrderedList.class.isInstance(view)) {
            CCOrderedListModel m = (CCOrderedListModel) getModel(view.getName());
            m.setSelectedOptionList(new OptionList());
            ((CCOrderedList) view).resetStateData();
        } else if (CCUnOrderedList.class.isInstance(view)) {
            CCUnOrderedListModel m = (CCUnOrderedListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCUnOrderedList) view).resetStateData();
        } else if (CCMapList.class.isInstance(view)) {
            CCMapListModel m = (CCMapListModel) getModel(view.getName());
            m.setOptionList(new OptionList());
            ((CCMapList) view).resetStateData();
        } else {
            if (DisplayFieldImpl.class.isInstance(view)) {
                ((DisplayFieldImpl) view).setValues(null);
            }
        }
    }
}
Also used : DisplayFieldImpl(com.iplanet.jato.view.DisplayFieldImpl) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) CCMapListModel(com.sun.identity.console.ui.model.CCMapListModel) CCOrderedListModel(com.sun.identity.console.ui.model.CCOrderedListModel) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCMapList(com.sun.identity.console.ui.view.CCMapList) Iterator(java.util.Iterator) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) CCUnOrderedListModel(com.sun.identity.console.ui.model.CCUnOrderedListModel) OptionList(com.iplanet.jato.view.html.OptionList) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 20 with CCAddRemoveModel

use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method createPropertyModel.

protected void createPropertyModel(String realmName) {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
    propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName(!canModify)));
    propertySheetModel.clear();
    if (canModify) {
        addRemoveModel = new CCAddRemoveModel();
        addRemoveModel.setShowMoveUpDownButtons("false");
        addRemoveModel.clear();
        propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Aggregations

CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)33 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)15 Set (java.util.Set)15 HashSet (java.util.HashSet)14 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)11 Map (java.util.Map)11 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)9 HashMap (java.util.HashMap)9 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)8 OptionList (com.iplanet.jato.view.html.OptionList)7 TreeSet (java.util.TreeSet)5 DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)4 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)4 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)4 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)4 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)4 ArrayList (java.util.ArrayList)4 Iterator (java.util.Iterator)4 Option (com.iplanet.jato.view.html.Option)3 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)3