use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblRulesButtonDeleteRequest.
/**
* Handles delete rule request.
*
* @param event Request Invocation Event.
*/
public void handleTblRulesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_RULES);
table.restoreStateData();
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
Integer[] selected = tblRulesModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
tblRulesModel.setRowIndex(selected[i].intValue());
String ruleName = (String) tblRulesModel.getValue(TBL_RULES_DATA_NAME);
policy.removeRule(ruleName);
}
cachedPolicy.setPolicyModified(true);
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblRulesButtonDeleteRequest", e);
redirectToStartURL();
}
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblConditionsButtonDeleteRequest.
/**
* Handles delete condition request.
*
* @param event Request Invocation Event.
*/
public void handleTblConditionsButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_CONDITIONS);
table.restoreStateData();
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
Integer[] selected = tblConditionsModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
tblConditionsModel.setRowIndex(selected[i].intValue());
String conditionName = (String) tblConditionsModel.getValue(TBL_CONDITIONS_DATA_NAME);
policy.removeCondition(conditionName);
}
cachedPolicy.setPolicyModified(true);
populateConditionsTable();
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblConditionsButtonDeleteRequest", e);
redirectToStartURL();
}
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SessionPropertyConditionAddViewBean method handleTblPolicySessionButtonDeleteRequest.
public void handleTblPolicySessionButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
Map map = (Map) getPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES);
CCActionTable tbl = (CCActionTable) getChild(SessionPropertyConditionHelper.ATTR_VALUES);
tbl.restoreStateData();
Integer[] selected = tblValuesModel.getSelectedRows();
for (int i = 0; i < selected.length; i++) {
int idx = selected[i].intValue();
tblValuesModel.setLocation(idx);
String propertyName = hexToString((String) tblValuesModel.getValue(SessionPropertyConditionHelper.TBL_DATA_ACTION));
map.remove(propertyName);
tblValuesModel.removeRow(idx);
}
tbl.resetStateData();
helper.populateTable(map, propertySheetModel);
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(ACTIONS_TILED_VIEW)) {
view = new ActionTiledView(this, tblActionsModel, name);
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (name.equals(TBL_ACTIONS)) {
CCActionTable table = new CCActionTable(this, tblActionsModel, name);
table.setTiledView((ActionTiledView) getChild(ACTIONS_TILED_VIEW));
view = table;
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class IDRepoViewBean method handleTblButtonDeleteRequest.
/**
* Deletes ID Repo.
*
* @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();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
Set names = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
names.add(list.get(selected[i].intValue()));
}
try {
IDRepoModel model = (IDRepoModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
model.deleteIDRepos(curRealm, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "idRepo.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "idRepo.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations