Search in sources :

Example 61 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class G11NSupportedCharsetsAddViewBean method handleButton1Request.

protected void handleButton1Request(Map values) {
    boolean error = false;
    SMG11NViewBean vb = (SMG11NViewBean) getViewBean(SMG11NViewBean.class);
    Map attrValues = (Map) getPageSessionAttribute(SMG11NViewBean.PROPERTY_ATTRIBUTE);
    Set charsets = (Set) attrValues.get(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
    String strEntry = LocaleSupportedCharsetsEntry.toString((String) values.get(ATTR_LOCALE), (String) values.get(ATTR_CHARSETS));
    if ((charsets == null) || charsets.isEmpty()) {
        charsets = new OrderedSet();
        attrValues.put(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS, (OrderedSet) charsets);
        charsets.add(strEntry);
    } else {
        try {
            LocaleSupportedCharsetsEntry.validate(charsets, (String) values.get(ATTR_LOCALE));
            charsets.add(strEntry);
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
            error = true;
        }
    }
    if (error) {
        forwardTo();
    } else {
        setPageSessionAttribute(SMG11NViewBean.PAGE_MODIFIED, "1");
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 62 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class G11NSupportedCharsetsEditViewBean method handleButton1Request.

protected void handleButton1Request(Map values) {
    SMG11NViewBean vb = (SMG11NViewBean) getViewBean(SMG11NViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(SMG11NViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet containers = (OrderedSet) mapAttrs.get(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    String val = LocaleSupportedCharsetsEntry.toString((String) values.get(ATTR_LOCALE), (String) values.get(ATTR_CHARSETS));
    containers.set(index, val);
    setPageSessionAttribute(SMG11NViewBean.PAGE_MODIFIED, "1");
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Map(java.util.Map)

Example 63 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class G11NSupportedCharsetsEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
        Map mapAttrs = (Map) getPageSessionAttribute(SMG11NViewBean.PROPERTY_ATTRIBUTE);
        OrderedSet set = (OrderedSet) mapAttrs.get(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
        setValues((String) set.get(index));
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Map(java.util.Map)

Example 64 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method populateProviderResourceIdMapperTable.

private void populateProviderResourceIdMapperTable(Collection mapper) {
    tablePopulated = true;
    OrderedSet cache = new OrderedSet();
    if (mapper != null) {
        CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
        tblModel.clearAll();
        boolean firstEntry = true;
        int counter = 0;
        for (Iterator i = mapper.iterator(); i.hasNext(); ) {
            String val = (String) i.next();
            if (!firstEntry) {
                tblModel.appendRow();
            } else {
                firstEntry = false;
            }
            Map map = AMAdminUtils.getValuesFromDelimitedString(val, "|");
            String providerId = (String) map.get(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_PROVIDER_ID);
            String idMapper = (String) map.get(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_ID_MAPPER);
            if ((providerId != null) && (idMapper != null)) {
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_DATA_PROVIDERID, providerId);
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_DATA_ID_MAPPER, idMapper);
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_HREF_ACTION, Integer.toString(counter));
                counter++;
                cache.add(val);
            }
        }
    }
    setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER, cache);
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) HashMap(java.util.HashMap) Map(java.util.Map)

Example 65 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class AuthPropertiesViewBean method populateConfigMenu.

private void populateConfigMenu() {
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if ((realm == null) || (realm.length() == 0)) {
        realm = AMModelBase.getStartDN(getRequestContext().getRequest());
    }
    AuthPropertiesModel model = (AuthPropertiesModel) getModel();
    OrderedSet configs = new OrderedSet();
    configs.addAll(AuthConfigurationModelImpl.getNamedConfigurations(model.getUserSSOToken(), realm));
    OptionList containers = new OptionList();
    for (Iterator i = configs.iterator(); i.hasNext(); ) {
        String entry = (String) i.next();
        containers.add(entry, entry);
    }
    CCDropDownMenu ac = (CCDropDownMenu) getChild(AUTH_CONFIG);
    ac.setOptions(containers);
    CCDropDownMenu aac = (CCDropDownMenu) getChild(ADMIN_AUTH_CONFIG);
    aac.setOptions(containers);
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Iterator(java.util.Iterator) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)87 Map (java.util.Map)52 Set (java.util.Set)36 Iterator (java.util.Iterator)20 HashMap (java.util.HashMap)17 HashSet (java.util.HashSet)16 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)13 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)13 CCActionTable (com.sun.web.ui.view.table.CCActionTable)12 AMServiceProfileModel (com.sun.identity.console.base.model.AMServiceProfileModel)6 CaseInsensitiveHashSet (com.sun.identity.common.CaseInsensitiveHashSet)5 ArrayList (java.util.ArrayList)5 LinkedHashSet (java.util.LinkedHashSet)5 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)4 List (java.util.List)4 AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)3 WSAuthHandlerEntry (com.sun.identity.console.webservices.model.WSAuthHandlerEntry)3 IdRepo (com.sun.identity.idm.IdRepo)3 Issuer (com.sun.identity.saml2.assertion.Issuer)3 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)3