use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class RMRealmViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SEARCH)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblModel, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblModel.isChildSupported(name)) {
view = tblModel.createChild(this, name);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SCServiceProfileViewBean method populateTableModel.
private void populateTableModel(List<SMSubConfig> subconfig) {
CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
tblModel.clearAll();
if (subconfig != null) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List<SMSubConfig> cache = new ArrayList<>(subconfig.size());
if (!subconfig.isEmpty()) {
tblModel.clearAll();
boolean firstEntry = true;
for (SMSubConfig conf : subconfig) {
if (conf.isHidden()) {
continue;
}
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_NAME, conf.getLocalizedName() == null ? conf.getName() : conf.getLocalizedName());
tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_HREF_NAME, conf.getName());
tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
cache.add(conf);
}
}
szCache.setValue(cache);
}
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SCSAML2SOAPBindingViewBean method handleTblRequestHandlerListButtonDeleteRequest.
/**
* Handles remove request handlers request.
*
* @param event Request Invocation Event.
*/
public void handleTblRequestHandlerListButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
tblValues.removeAll(selected);
setPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, tblValues);
populateRequestHandlerListTable(tblValues);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
setPageSessionAttribute(PAGE_MODIFIED, "1");
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SCSOAPBindingViewBean method handleTblRequestHandlerListButtonDeleteRequest.
/**
* Handles remove request handlers request.
*
* @param event Request Invocation Event.
*/
public void handleTblRequestHandlerListButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
tblValues.removeAll(selected);
setPageSessionAttribute(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, tblValues);
populateRequestHandlerListTable(tblValues);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
setPageSessionAttribute(PAGE_MODIFIED, "1");
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServerSiteViewBean method handleTblSiteButtonDeleteRequest.
/**
* Deletes site.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblSiteButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SITES);
table.restoreStateData();
Integer[] selected = tblSiteModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_1);
List list = (List) szCache.getSerializedObj();
Set names = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
String name = (String) list.get(selected[i].intValue());
names.add(name);
}
try {
ServerSiteModel model = (ServerSiteModel) getModel();
model.deleteSites(names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "siteconfig.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "siteconfig.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations