use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServerSiteViewBean method handleTblServerButtonCloneRequest.
/**
* Forwards request to server clone view bean.
*
* @param event Request Invocation Event.
*/
public void handleTblServerButtonCloneRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SERVERS);
table.restoreStateData();
Integer[] selected = tblServerModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
String serverName = (String) list.get(selected[0].intValue());
ServerCloneViewBean vb = (ServerCloneViewBean) getViewBean(ServerCloneViewBean.class);
unlockPageTrail();
setPageSessionAttribute(ServerCloneViewBean.PG_ATTR_SERVER_NAME, serverName);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class FSSAMLServiceViewBean method handleTblTargetURLsButtonDeleteRequest.
public void handleTblTargetURLsButtonDeleteRequest(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_TARGET_URLS);
tbl.restoreStateData();
Integer[] selected = tblTargetURLsModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) modifiedValues.get(TABLE_TARGET_URLS);
tblValues.removeAll(selected);
modifiedValues.put(TABLE_TARGET_URLS, tblValues);
}
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) modifiedValues);
setPageSessionAttribute(MODIFIED, "1");
setValues();
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class RMRealmViewBean method handleTblButtonDeleteRequest.
/**
* Deletes realms.
*
* @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();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
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++) {
String name = (String) list.get(selected[i].intValue());
/*
* make sure the realm name starts with / to give it a
* fully qualified look. This value will be set in the log file
*/
if (!name.startsWith("/")) {
name = "/" + name;
}
names.add(name);
}
try {
RMRealmModel model = (RMRealmModel) getModel();
model.deleteSubRealms(curRealm, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "realm.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "realm.message.deleted.pural");
}
} 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 STSHomeViewBean method createChild.
protected View createChild(String name) {
View view;
if (name.equals(TBL_REST_STS_INSTANCES)) {
Set<String> publishedInstances = getPublishedInstancesFromCache(REST_STS_PUBLISHED_INSTANCES_CACHE_KEY);
if (!CollectionUtils.isEmpty(publishedInstances)) {
populateRestSTSTableModel(publishedInstances);
} else {
setRestSTSInstanceNamesInTable();
}
view = new CCActionTable(this, tblModelRestSTSInstances, name);
} else if (name.equals(TBL_SOAP_STS_INSTANCES)) {
Set<String> publishedInstances = getPublishedInstancesFromCache(SOAP_STS_PUBLISHED_INSTANCES_CACHE_KEY);
if (!CollectionUtils.isEmpty(publishedInstances)) {
populateSoapSTSTableModel(publishedInstances);
} else {
setSoapSTSInstanceNamesInTable();
}
view = new CCActionTable(this, tblModelSoapSTSInstances, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblModelRestSTSInstances.isChildSupported(name)) {
view = tblModelRestSTSInstances.createChild(this, name);
} else if (tblModelSoapSTSInstances.isChildSupported(name)) {
view = tblModelSoapSTSInstances.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 STSHomeViewBean method handleTblRestSTSInstancesButtonDeleteRequest.
public void handleTblRestSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_REST_STS_INSTANCES);
table.restoreStateData();
Integer[] selected = tblModelRestSTSInstances.getSelectedRows();
Set<String> instanceNames = new HashSet<>(selected.length);
for (int i = 0; i < selected.length; i++) {
tblModelRestSTSInstances.setRowIndex(selected[i].intValue());
instanceNames.add((String) tblModelRestSTSInstances.getValue(TBL_REST_STS_INSTANCES_DATA_NAME));
}
try {
STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
model.deleteInstances(STSType.REST, instanceNames);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instance.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instances.deleted");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations