use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class FederationViewBean method handleDeleteEntityButtonRequest.
public void handleDeleteEntityButtonRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(ENTITY_TABLE);
table.restoreStateData();
EntityModel model = getEntityModel();
CCActionTableModel cctablemodel = (CCActionTableModel) propertySheetModel.getModel(ENTITY_TABLE);
List entitiesList = (ArrayList) getPageSessionAttribute(ENTITY_TABLE);
Integer[] selected = cctablemodel.getSelectedRows();
List successList = new ArrayList();
List failureList = new ArrayList();
String name = null;
for (int i = 0; i < selected.length; i++) {
String selectedRow = (String) entitiesList.get(selected[i].intValue());
int pos = selectedRow.indexOf(",");
name = selectedRow.substring(0, pos);
String protStr = selectedRow.substring(pos + 1);
int posProtocol = protStr.indexOf(",");
String protocol = protStr.substring(0, posProtocol);
String realmStr = protStr.substring(posProtocol + 1);
int posrealm = realmStr.indexOf(",");
String realm = realmStr.substring(0, posrealm);
try {
model.deleteEntities(name, protocol, realm);
successList.add(name);
} catch (AMConsoleException e) {
failureList.add(name);
}
}
String finalStr = printDeleteMessage(model, successList, failureList);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", finalStr);
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class FederationViewBean method handleDeleteTPButtonRequest.
/**
* Handles the delete trusted partner request. The items which are
* selected in the SAML table will be removed. After the processing is
* complete a message will be displayed indicating the process succeeded,
* or what failed if it didn't succeed.
*
* @param event Request Invocation Event.
*/
public void handleDeleteTPButtonRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable tbl = (CCActionTable) getChild(SAML_TABLE);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SAML_TABLE);
// get selected rows here
Integer[] selected = tblModel.getSelectedRows();
List currentList = (List) getPageSessionAttribute(SAML_TABLE_ATTRIBUTE);
Set selectedSet = new HashSet();
for (int i = 0; i < selected.length; i++) {
selectedSet.add(currentList.get(selected[i].intValue()));
}
try {
FSSAMLServiceModel model = (FSSAMLServiceModel) getSAMLModel();
model.deleteTrustPartners(selectedSet);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations