use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.
the class WSPPServiceSupportedContainerAddViewBean method handleButton1Request.
protected void handleButton1Request(Map values) {
WSPersonalProfileServiceViewBean vb = (WSPersonalProfileServiceViewBean) getViewBean(WSPersonalProfileServiceViewBean.class);
Map attrValues = (Map) getPageSessionAttribute(WSPersonalProfileServiceViewBean.PROPERTY_ATTRIBUTE);
Set containers = (Set) attrValues.get(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
if ((containers == null) || containers.isEmpty()) {
containers = new OrderedSet();
attrValues.put(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS, (OrderedSet) containers);
}
containers.add(mapToString(values));
backTrail();
unlockPageTrailForSwapping();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.
the class G11NCharsetAliasAddViewBean method handleButton1Request.
protected void handleButton1Request(Map values) {
SMG11NViewBean vb = (SMG11NViewBean) getViewBean(SMG11NViewBean.class);
Map attrValues = (Map) getPageSessionAttribute(SMG11NViewBean.PROPERTY_ATTRIBUTE);
Set charsets = (Set) attrValues.get(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS);
if ((charsets == null) || charsets.isEmpty()) {
charsets = new OrderedSet();
attrValues.put(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS, (OrderedSet) charsets);
}
String newCharsetsString = CharsetAliasEntry.toString((String) values.get(ATTR_MIMENAME), (String) values.get(ATTR_JAVANAME));
if (charsets.contains(newCharsetsString)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "globalization.service.CharsetAlias.create.page.existing");
forwardTo();
} else {
charsets.add(CharsetAliasEntry.toString((String) values.get(ATTR_MIMENAME), (String) values.get(ATTR_JAVANAME)));
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 SCPolicyViewBean method handleTblResourceComparatorButtonDeleteRequest.
/**
* Handles remove resource comparator request.
*
* @param event Request Invocation Event.
*/
public void handleTblResourceComparatorButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable table = (CCActionTable) getChild(TBL_RESOURCE);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(TBL_RESOURCE);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR);
tblValues.removeAll(selected);
setPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR, tblValues);
populateResourceComparatorTable(tblValues);
}
try {
Map values = getAllValues();
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) values);
setPageSessionAttribute(SCPolicyViewBean.PAGE_MODIFIED, "1");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.
the class SCPolicyResourceComparatorEditViewBean 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(SCPolicyViewBean.PROPERTY_ATTRIBUTE);
OrderedSet set = (OrderedSet) mapAttrs.get(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR);
setValues((String) set.get(index));
}
}
use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.
the class SCPolicyViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
resetButtonState(TBL_RESOURCE_COMPARATOR_DELETE_BTN);
if (!tablePopulated && !submitCycle) {
AMServiceProfileModel model = (AMServiceProfileModel) getModel();
Set resourceComp = new OrderedSet();
Map values = model.getAttributeValues();
resourceComp.addAll((Set) values.get(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR));
populateResourceComparatorTable(resourceComp);
}
if (!isInlineAlertMessageSet()) {
String flag = (String) getPageSessionAttribute(PAGE_MODIFIED);
if ((flag != null) && flag.equals("1")) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
}
}
}
Aggregations