use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SMProfileViewBean method handleTblButtonInvalidateRequest.
/**
* Handles the event request for <i>Invalidate</i> button.
*
* @param event request invocation event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblButtonInvalidateRequest(RequestInvocationEvent event) throws ModelControlException {
SMProfileModel model = (SMProfileModel) getModel();
String serverName = (String) getPageSessionAttribute(SERVER_NAME);
model.setProfileServerName(serverName);
CCActionTable child = (CCActionTable) getChild(TBL_SESSIONS);
child.restoreStateData();
Integer[] selected = tblModel.getSelectedRows();
List names = new ArrayList(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
tblModel.setRowIndex(selected[i].intValue());
names.add((String) tblModel.getValue(TBL_DATA_SESSION_ID));
}
boolean error = false;
List failList = null;
try {
failList = model.invalidateSessions(names, getFilterString());
} catch (AMConsoleException e) {
error = true;
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
if (!error && failList != null && !failList.isEmpty()) {
// TOFIX: need to display mutiple message.
}
if (!model.isSessionValid()) {
validSession = false;
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class AgentsViewBean method handleTblButtonGroupDeleteRequest.
/**
* Deletes agent groups.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblButtonGroupDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SEARCH_GROUP);
table.restoreStateData();
Integer[] selected = tblGroupModel.getSelectedRows();
Set names = new HashSet(selected.length * 2);
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
Map mapCache = (Map) szCache.getSerializedObj();
List cache = (List) mapCache.get(CACHE_AGENT_GROUPS);
for (int i = 0; i < selected.length; i++) {
names.add((String) cache.get(selected[i].intValue()));
}
try {
AgentsModel model = (AgentsModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
model.deleteAgentGroups(curRealm, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agent.groups.message.deleted"));
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agent.groups.message.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 AgentsViewBean method handleTblButtonDeleteRequest.
/**
* Deletes agents.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
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);
Map mapCache = (Map) szCache.getSerializedObj();
List cache = (List) mapCache.get(CACHE_AGENTS);
for (int i = 0; i < selected.length; i++) {
names.add((String) cache.get(selected[i].intValue()));
}
try {
AgentsModel model = (AgentsModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
model.deleteAgents(curRealm, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agents.message.deleted"));
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("agents.message.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 AuthPropertiesViewBean method handleDeleteConfigButtonRequest.
/**
* Handles the delete authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleDeleteConfigButtonRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(AUTH_CONFIG_TABLE);
table.restoreStateData();
CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(AUTH_CONFIG_TABLE);
Integer[] selected = tableModel.getSelectedRows();
Set configurations = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
tableModel.setRowIndex(selected[i].intValue());
configurations.add((String) tableModel.getValue(CONFIG_NAME_COLUMN_DATA));
}
try {
AuthConfigurationModel m = (AuthConfigurationModel) getConfigModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if ((curRealm == null) || (curRealm.length() == 0)) {
curRealm = AMModelBase.getStartDN(getRequestContext().getRequest());
}
m.deleteAuthConfiguration(curRealm, configurations);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.config.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.config.deleted.multiple");
}
removePageSessionAttribute(AUTH_CONFIG_TABLE);
} 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 IDFFIDPViewBean method getAuthenticationContexts.
private IDFFAuthContexts getAuthenticationContexts() throws ModelControlException {
CCActionTable tbl = (CCActionTable) getChild(TBL_AUTHENTICATION_CONTEXTS);
tbl.restoreStateData();
IDFFAuthContexts authContexts = new IDFFAuthContexts();
int size = 10;
for (int i = 0; i < size; i++) {
tblAuthContextsModel.setLocation(i);
String name = (String) tblAuthContextsModel.getValue(TBL_DATA_CONTEXT_REFERENCE);
String supported = (String) tblAuthContextsModel.getValue(TBL_DATA_SUPPORTED);
String key = (String) tblAuthContextsModel.getValue(TBL_DATA_KEY);
String value = (String) tblAuthContextsModel.getValue(TBL_DATA_VALUE);
String level = (String) tblAuthContextsModel.getValue(TBL_DATA_LEVEL);
authContexts.put(name, supported, key, value, level);
}
return authContexts;
}
Aggregations