use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServerSiteViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SERVERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
populateServerTableModel((Map) szCache.getSerializedObj());
view = new CCActionTable(this, tblServerModel, name);
} else if (name.equals(TBL_SITES)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SITE);
populateSiteTableModel((Map) szCache.getSerializedObj());
view = new CCActionTable(this, tblSiteModel, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblSiteModel.isChildSupported(name)) {
view = tblSiteModel.createChild(this, name);
} else if (tblServerModel.isChildSupported(name)) {
view = tblServerModel.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 SubConfigEditViewBean method handleTblSubConfigButtonDeleteRequest.
/**
* Deletes sub configuration.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
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++) {
SMSubConfig sc = (SMSubConfig) list.get(selected[i].intValue());
names.add(sc.getName());
}
try {
SubConfigModel model = (SubConfigModel) getModel();
model.deleteSubConfigurations(names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
submitCycle = false;
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class AgentConfigInheritViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_PROPERTY_NAMES)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populatePropertyNameTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblPropertyNamesModel, name);
} else if (name.equals(PGTITLE_THREE_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblPropertyNamesModel.isChildSupported(name)) {
view = tblPropertyNamesModel.createChild(this, name);
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (name.equals(CHILD_STATICTEXT)) {
view = new CCStaticTextField(this, name, null);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class AgentConfigInheritViewBean method handleButton1Request.
/**
* Handles save profile request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable table = (CCActionTable) getChild(TBL_PROPERTY_NAMES);
table.restoreStateData();
Integer[] selected = tblPropertyNamesModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
Map inherit = new HashMap();
for (Iterator i = list.iterator(); i.hasNext(); ) {
String name = (String) i.next();
inherit.put(name, "0");
}
for (int i = 0; i < selected.length; i++) {
String name = (String) list.get(selected[i].intValue());
inherit.put(name, "1");
}
try {
AgentsModel model = (AgentsModel) getModel();
String universalId = (String) getPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID);
model.updateAgentConfigInheritance(universalId, inherit);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "agentcfg.inheritance.updated");
} 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 FSSAMLServiceViewBean method handleTblSiteIDButtonDeleteRequest.
public void handleTblSiteIDButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
Map modifiedValues = null;
try {
modifiedValues = getValues(false, false);
} catch (AMConsoleException e) {
/* exception will not be thrown because we are instructing
* AMPropertySheet to return values without doing password
* validation.
*/
}
CCActionTable tbl = (CCActionTable) getChild(TABLE_SITE_ID);
tbl.restoreStateData();
Integer[] selected = tblSiteIdModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) modifiedValues.get(TABLE_SITE_ID);
tblValues.removeAll(selected);
modifiedValues.put(TABLE_SITE_ID, tblValues);
}
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) modifiedValues);
setPageSessionAttribute(MODIFIED, "1");
setValues();
forwardTo();
}
Aggregations