use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class DelegationViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SEARCH)) {
populateTableModelEx();
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 if (ptModel.isChildSupported(name)) {
view = ptModel.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 RuleOpViewBeanBase method populateActionsTable.
protected void populateActionsTable(boolean retainSelectedEntry) throws ModelControlException, AMConsoleException {
CCActionTable table = (CCActionTable) getChild(TBL_ACTIONS);
table.resetStateData();
tblActionsModel.clearAll();
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String serviceType = (String) propertySheetModel.getValue(SERVICE_TYPE);
boolean withResource = false;
Boolean b = ((Boolean) getPageSessionAttribute(WITH_RESOURCE));
if (b != null) {
withResource = b.booleanValue();
}
actionSchemas = new ArrayList(model.getActionSchemas(getCachedPolicy().getPolicy(), realmName, serviceType, withResource));
if ((actionSchemas != null) && !actionSchemas.isEmpty()) {
int sz = actionSchemas.size();
ArrayList actionSchemaNames = new ArrayList(sz);
for (int i = 0; i < sz; i++) {
if (i > 0) {
tblActionsModel.appendRow();
}
ActionSchema as = (ActionSchema) actionSchemas.get(i);
boolean sel = isActionSelected(as);
tblActionsModel.setRowSelected(i, sel);
actionSchemaNames.add(as.getName());
tblActionsModel.setValue(TBL_ACTIONS_DATA_NAME, model.getActionSchemaLocalizedName(serviceType, as));
}
setPageSessionAttribute(PG_SESSION_ACTION_SCHEMA_NAMES, actionSchemaNames);
}
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SERVERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
populateServerTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblServerModel, name);
} else if (name.equals(TBL_USERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
populateUserTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblUserModel, name);
} else if (name.equals(PGTITLE_THREE_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (tblServerModel.isChildSupported(name)) {
view = tblServerModel.createChild(this, name);
} else if (tblUserModel.isChildSupported(name)) {
view = tblUserModel.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 SMG11NViewBean method handleTblCharsetAliasButtonDeleteRequest.
/**
* Handles remove charset alias request.
*
* @param event Request Invocation Event.
*/
public void handleTblCharsetAliasButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS);
tblValues.removeAll(selected);
setPageSessionAttribute(SMG11NModelImpl.ATTRIBUTE_NAME_CHARSET_ALIAS, tblValues);
populateCharsetAliasTable(tblValues);
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class AuthPropertiesViewBean method handleDeleteInstanceButtonRequest.
/**
* Handles the delete authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleDeleteInstanceButtonRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(AUTH_INSTANCE_TABLE);
table.restoreStateData();
CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(AUTH_INSTANCE_TABLE);
Integer[] selected = tableModel.getSelectedRows();
Set instances = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
tableModel.setRowIndex(selected[i].intValue());
instances.add((String) tableModel.getValue(NAME_COLUMN_DATA));
}
try {
AuthPropertiesModel model = (AuthPropertiesModel) getModel();
model.removeAuthInstance(instances);
/*
* There is a timing issue with the backend after an
* instance is deleted causing the UI to be out of synch with the
* backend. We are storing the instances removed to be used when
* the page is redrawn to ensure the deleted instances are not
* put back into the instance table.
*/
setPageSessionAttribute(INSTANCES_REMOVED, (Serializable) instances);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.instance.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.instance.deleted.multiple");
}
removePageSessionAttribute(AUTH_INSTANCE_TABLE);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations