use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServicesViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(CHILD_TBL_TILED_VIEW)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel((Map) szCache.getSerializedObj());
view = new ServicesTiledView(this, tblModel, name);
} else if (name.equals(TBL_SEARCH)) {
ServicesTiledView tView = (ServicesTiledView) getChild(CHILD_TBL_TILED_VIEW);
CCActionTable child = new CCActionTable(this, tblModel, name);
child.setTiledView(tView);
view = child;
} 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 SCPolicyViewBean method handleTblResourceComparatorButtonDeleteRequest.
/**
* Handles remove resource comparator request.
*
* @param event Request Invocation Event.
*/
public void handleTblResourceComparatorButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable table = (CCActionTable) getChild(TBL_RESOURCE);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(TBL_RESOURCE);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR);
tblValues.removeAll(selected);
setPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR, tblValues);
populateResourceComparatorTable(tblValues);
}
try {
Map values = getAllValues();
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) values);
setPageSessionAttribute(SCPolicyViewBean.PAGE_MODIFIED, "1");
} 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 ServerConfigInheritViewBean 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();
Set toInherit = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
String name = (String) list.get(selected[i].intValue());
toInherit.add(ServerEditViewBeanBase.getActualPropertyName(name));
}
Set notToInherit = new HashSet(list.size() * 2);
for (Iterator i = list.iterator(); i.hasNext(); ) {
String name = (String) i.next();
notToInherit.add(ServerEditViewBeanBase.getActualPropertyName(name));
}
notToInherit.removeAll(toInherit);
try {
ServerSiteModel model = (ServerSiteModel) getModel();
String serverName = (String) getPageSessionAttribute(ServerEditViewBeanBase.PG_ATTR_SERVER_NAME);
model.updateServerConfigInheritance(serverName, toInherit, notToInherit);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "servercfg.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 ServerConfigInheritViewBean 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 ServerConfigXMLViewBean method handleTblServerConfigXMLServerButtonDeleteRequest.
/**
* Handles remove server group entry request.
*
* @param event Request invocation event
*/
public void handleTblServerConfigXMLServerButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
String serverName = (String) getPageSessionAttribute(ServerEditViewBeanBase.PG_ATTR_SERVER_NAME);
ServerSiteModel model = (ServerSiteModel) getModel();
try {
ServerConfigXML xmlObj = model.getServerConfigObject(serverName);
ServerConfigXML.ServerGroup smsServerGroup = xmlObj.getSMSServerGroup();
CCActionTable table = (CCActionTable) getChild(TBL_SERVERS);
table.restoreStateData();
Integer[] selected = tblServerModel.getSelectedRows();
if (selected.length >= smsServerGroup.hosts.size()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("exception.cannot,delete.all.servers"));
} else {
for (int i = selected.length - 1; i >= 0; --i) {
smsServerGroup.hosts.remove(selected[i].intValue());
}
model.setServerConfigXML(serverName, xmlObj.toXML());
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations