use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SMDiscoveryServiceViewBean method handleTblBootstrapResOffButtonDeleteRequest.
/**
* Handles remove resource offerings request.
*
* @param event Request Invocation Event.
*/
public void handleTblBootstrapResOffButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
try {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(tblValues);
smEntry.deleteDiscoEntries(selected);
tblValues = (OrderedSet) smEntry.getDiscoveryEntries();
setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, tblValues);
populateBootstrapResOffTable(tblValues);
} 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 AbstractAuditViewBean method handleTblSubConfigButtonDeleteRequest.
/**
* Called on request from the UI to delete an event handler.
*
* @param event Request Invocation Event.
*/
@SuppressWarnings("unused")
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable tbl = (CCActionTable) getChild(TBL_SUB_CONFIG);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
Integer[] selected = tblModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = szCache.getSerializedObj();
Set<String> names = new HashSet<>(selected.length * 2);
for (Integer index : selected) {
SMSubConfig sc = (SMSubConfig) list.get(index);
names.add(sc.getName());
}
try {
AbstractAuditModel model = (AbstractAuditModel) getModel();
model.deleteEventHandles(names);
if (selected.length == 1) {
setInlineAlertMessage(TYPE_INFO, INFORMATION_MESSAGE, "event.handler.message.deleted");
} else {
setInlineAlertMessage(TYPE_INFO, INFORMATION_MESSAGE, "event.handler.message.deleted.plural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
submitCycle = false;
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class FederationViewBean method handleDeleteCOTButtonRequest.
public void handleDeleteCOTButtonRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable tbl = (CCActionTable) getChild(COT_TABLE);
tbl.restoreStateData();
CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(COT_TABLE);
// get selected rows
Integer[] selected = tableModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
StringBuilder deletedNames = new StringBuilder();
StringBuilder cannotDeleteds = new StringBuilder();
// each COT is deleted separately as they can be in separate realms
for (int i = 0; i < selected.length; i++) {
String str = (String) list.get(selected[i].intValue());
int pipeIndex = str.indexOf(",");
String name = str.substring(0, pipeIndex);
String realm = str.substring(pipeIndex + 1);
try {
model.deleteAuthenticationDomain(realm, name);
if (deletedNames.length() > 0) {
deletedNames.append(", ");
}
deletedNames.append(name);
} catch (AMConsoleException e) {
if (cannotDeleteds.length() > 0) {
cannotDeleteds.append(", ");
}
cannotDeleteds.append(e.getMessage());
}
}
StringBuilder message = new StringBuilder();
if (deletedNames.length() > 0) {
Object[] params = { deletedNames };
message.append(MessageFormat.format(model.getLocalizedString("authDomain.message.deleted"), params));
}
if (cannotDeleteds.length() > 0) {
Object[] params = { cannotDeleteds };
message.append(MessageFormat.format(model.getLocalizedString("generic.error.message"), params));
}
if (message.length() > 0) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", message.toString());
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblSubjectsButtonDeleteRequest.
/**
* Handles delete subject request.
*
* @param event Request Invocation Event.
*/
public void handleTblSubjectsButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SUBJECTS);
table.restoreStateData();
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
Integer[] selected = tblSubjectsModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
tblSubjectsModel.setRowIndex(selected[i].intValue());
String subjectName = (String) tblSubjectsModel.getValue(TBL_SUBJECTS_DATA_NAME);
policy.removeSubject(subjectName);
}
cachedPolicy.setPolicyModified(true);
populateSubjectsTable();
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblSubjectsButtonDeleteRequest", e);
redirectToStartURL();
}
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblResponseProvidersButtonDeleteRequest.
/**
* Handles delete response attribute request.
*
* @param event Request Invocation Event.
*/
public void handleTblResponseProvidersButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_RESPONSE_ATTRIBUTES);
table.restoreStateData();
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
Integer[] selected = tblResponseProvidersModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
tblResponseProvidersModel.setRowIndex(selected[i].intValue());
String responseProviderName = (String) tblResponseProvidersModel.getValue(TBL_RESPONSE_ATTRIBUTES_DATA_NAME);
policy.removeResponseProvider(responseProviderName);
}
cachedPolicy.setPolicyModified(true);
populateResponseProvidersTable();
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblResponseProvidersButtonDeleteRequest", e);
redirectToStartURL();
}
}
Aggregations