use of com.sun.identity.console.service.model.SMDiscoveryServiceData 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();
}
Aggregations