use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.
the class SMDiscoveryServiceViewBean method handleTblProviderResourceIdMapperButtonDeleteRequest.
/**
* Handles remove provider resource id mapper request.
*
* @param event Request Invocation Event.
*/
public void handleTblProviderResourceIdMapperButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
tblValues.removeAll(selected);
populateProviderResourceIdMapperTable(tblValues);
}
forwardTo();
}
use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method populateDescriptionsTable.
private void populateDescriptionsTable(List descData) {
tablePopulated = true;
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(ATTRIBUTE_NAME_SECURITY_MECH_ID);
tblModel.clearAll();
if (descData != null) {
boolean firstEntry = true;
int counter = 0;
if ((descData != null) && !descData.isEmpty()) {
for (Iterator iter = descData.iterator(); iter.hasNext(); ) {
SMDescriptionData smDesc = (SMDescriptionData) iter.next();
if (!firstEntry) {
tblModel.appendRow();
} else {
firstEntry = false;
}
tblModel.setValue(TBL_SECURITY_MECH_ID_DATA_ID, smDesc.getFirstSecurityMechId());
tblModel.setValue(TBL_SECURITY_MECH_ID_HREF_ACTION, Integer.toString(counter));
tblModel.setValue(TBL_SECURITY_MECH_ID_LABEL_ACTION, "discovery.service.table.bootstrapResOff.action.edit.label");
counter++;
}
}
}
setPageSessionAttribute(ATTR_SECURITY_MECH_ID, (ArrayList) descData);
}
use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method handleTblSecurityMechIDButtonDeleteRequest.
/**
* Handles remove security mechanism ID request.
*
* @param event Request Invocation Event.
*/
public void handleTblSecurityMechIDButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
try {
SMDiscoEntryData smData = getValues(false);
CCActionTable table = (CCActionTable) getChild(ATTRIBUTE_NAME_SECURITY_MECH_ID);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(ATTRIBUTE_NAME_SECURITY_MECH_ID);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
for (int i = selected.length - 1; i >= 0; --i) {
Integer index = selected[i];
smData.descData.remove(index.intValue());
}
setValues(smData, getModel());
populateDescriptionsTable(smData.descData);
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.model.CCActionTableModel 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.model.CCActionTableModel 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();
}
Aggregations