Search in sources :

Example 1 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method getActionSchemaValues.

private Set getActionSchemaValues(Syntax syntax) {
    Set values = null;
    int syn = AMDisplayType.getDisplaySyntax(syntax);
    switch(syn) {
        case AMDisplayType.SYNTAX_TEXT:
            values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_TEXT_VALUE));
            break;
        case AMDisplayType.SYNTAX_SINGLE_CHOICE:
            values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_SINGLE_CHOICE_VALUE));
            break;
        case AMDisplayType.SYNTAX_MULTIPLE_CHOICE:
            if (addRemoveModel != null) {
                CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
                child.restoreStateData();
                values = getValues(addRemoveModel.getSelectedOptionList());
                break;
            }
    }
    return (values == null) ? Collections.EMPTY_SET : values;
}
Also used : Set(java.util.Set) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 2 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method setAddRemoveModel.

protected void setAddRemoveModel() throws ModelControlException {
    if (canModify) {
        Set values = getValidValues();
        CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
        Set defaultValues = (bFilter) ? getValues() : getDefaultValues();
        child.resetStateData();
        if (values != null) {
            if (defaultValues != null) {
                values.removeAll(defaultValues);
            }
            addRemoveModel.setAvailableOptionList(createOptionList(values));
        } else {
            addRemoveModel.setAvailableOptionList(new OptionList());
        }
        addRemoveModel.setSelectedOptionList(createOptionList(defaultValues));
    }
}
Also used : Set(java.util.Set) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) OptionList(com.iplanet.jato.view.html.OptionList)

Example 3 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove 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 4 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class CreateCOTViewBean method handleButton1Request.

/**
     * Handles save button request.
     * save
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    try {
        Map values = ps.getAttributeValues(model.getDataMap(), false, model);
        String name = (String) getDisplayFieldValue(model.TF_NAME);
        if ((name == null) || (name.length() < 1)) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("authdomain.authentication.domain.name.missing.message"));
            psModel.setErrorProperty("nameProperty", true);
            forwardTo();
        } else {
            CCAddRemove addRemoveList = (CCAddRemove) getChild(ADD_REMOVE_PROVIDERS);
            addRemoveList.restoreStateData();
            CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
            Set providers = new HashSet(getSelectedValues(addRemoveModel));
            model.createAuthenticationDomain(values, providers);
            Object[] params = { name };
            String message = MessageFormat.format(model.getLocalizedString("authentication.domain.create.message"), params);
            setPageSessionAttribute(FederationViewBean.MESSAGE_TEXT, message);
            backTrail();
            FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
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) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) HashSet(java.util.HashSet)

Example 5 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove 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)

Aggregations

CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)24 Set (java.util.Set)13 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)11 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)10 HashSet (java.util.HashSet)10 Map (java.util.Map)8 OptionList (com.iplanet.jato.view.html.OptionList)7 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)4 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)4 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)4 HashMap (java.util.HashMap)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)2 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)2 ContainerView (com.iplanet.jato.view.ContainerView)1 View (com.iplanet.jato.view.View)1 ViewBean (com.iplanet.jato.view.ViewBean)1 SerializedField (com.sun.identity.console.components.view.html.SerializedField)1