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());
}
}
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());
}
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));
}
}
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);
}
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);
}
Aggregations