use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class EntityServicesViewBean method handleTblButtonDeleteRequest.
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SEARCH);
table.restoreStateData();
Integer[] selected = tblModel.getSelectedRows();
Set names = new HashSet(selected.length * 2);
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List cache = (List) szCache.getSerializedObj();
if (selected.length > 0) {
for (int i = 0; i < selected.length; i++) {
names.add((String) cache.get(selected[i].intValue()));
}
try {
EntitiesModel model = (EntitiesModel) getModel();
String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
model.unassignServices(universalId, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "entities.message.service.unassigned");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "entities.message.service.unassigned.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "entities.message.service.unassigned.non.selected");
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class EntityResourceOfferingViewBean method handleTblButtonDeleteRequest.
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_ENTRIES);
table.restoreStateData();
EntityResourceOfferingModel model = (EntityResourceOfferingModel) getModel();
String univId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String cacheID = (String) getPageSessionAttribute(EntityResourceOfferingViewBean.DATA_ID);
SMDiscoveryServiceData smEntry = cache.getData(model.getUserSSOToken(), cacheID);
Integer[] selected = tblModel.getSelectedRows();
smEntry.deleteDiscoEntries(selected);
try {
model.setEntityDiscoEntry(univId, smEntry);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method getActionValues.
private Map getActionValues(String serviceType, boolean withResource) throws ModelControlException {
Map actionValues = new HashMap();
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
try {
Map mapActionSchemas = mapActionSchemaNameToActionSchema(model.getActionSchemas(getCachedPolicy().getPolicy(), realmName, serviceType, withResource));
CCActionTable table = (CCActionTable) getChild(TBL_ACTIONS);
table.restoreStateData();
List actionSchemaNames = (List) getPageSessionAttribute(PG_SESSION_ACTION_SCHEMA_NAMES);
if ((actionSchemaNames != null) && !actionSchemaNames.isEmpty()) {
HttpServletRequest req = getRequestContext().getRequest();
String chkName = getName() + "." + SELECTION_CHKBOX_NAME;
int sz = actionSchemaNames.size();
for (int i = 0; i < sz; i++) {
String chkValue = req.getParameter(chkName + i);
if ((chkValue != null) && chkValue.equals("true")) {
String actionSchemaName = (String) actionSchemaNames.get(i);
ActionSchema actionSchema = (ActionSchema) mapActionSchemas.get(actionSchemaName);
Set values = getActionSchemaValues(actionSchema, i);
actionValues.put(actionSchemaName, values);
}
}
}
if (actionValues.isEmpty()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.missing.actionValues");
actionValues = null;
}
} catch (AMConsoleException e) {
debug.warning("RuleOpViewBeanBase.getActionValues", e);
//NO-OP
}
return actionValues;
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SessionPropertyConditionEditViewBean method handleTblPolicySessionButtonDeleteRequest.
public void handleTblPolicySessionButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
Map map = (Map) getPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES);
CCActionTable tbl = (CCActionTable) getChild(SessionPropertyConditionHelper.ATTR_VALUES);
tbl.restoreStateData();
Integer[] selected = tblValuesModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
int idx = selected[i].intValue();
tblValuesModel.setLocation(idx);
String propertyName = hexToString((String) tblValuesModel.getValue(SessionPropertyConditionHelper.TBL_DATA_ACTION));
map.remove(propertyName);
tblValuesModel.removeRow(idx);
}
tbl.resetStateData();
helper.populateTable(map, propertySheetModel);
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class RealmResourceOfferingViewBean method handleTblButtonDeleteRequest.
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_ENTRIES);
table.restoreStateData();
RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String cacheID = (String) getPageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
SMDiscoveryServiceData smEntry = cache.getData(model.getUserSSOToken(), cacheID);
Integer[] selected = tblModel.getSelectedRows();
smEntry.deleteDiscoEntries(selected);
try {
model.setRealmDiscoEntry(realm, smEntry);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations