use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class EntitiesViewBean method resetView.
public void resetView() {
super.resetView();
tblModelPopulated = false;
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
szCache.setValue(null);
tblModel.clearAll();
setDisplayFieldValue(TF_FILTER, "*");
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class EntitiesViewBean method handleTblButtonDeleteRequest.
/**
* Deletes policies.
*
* @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();
Integer[] selected = tblModel.getSelectedRows();
Set names = new HashSet(selected.length * 2);
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List cache = (List) szCache.getSerializedObj();
for (int i = 0; i < selected.length; i++) {
names.add((String) cache.get(selected[i].intValue()));
}
try {
EntitiesModel model = (EntitiesModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String idType = (String) getPageSessionAttribute(PG_SESSION_ENTITY_TYPE);
model.deleteEntities(curRealm, names);
if (selected.length == 1) {
Object[] param = { model.getLocalizedString(idType) };
String msg = model.getLocalizedString("entities.message.deleted");
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", MessageFormat.format(msg, param));
} else {
Object[] param = { model.getLocalizedString(idType) };
String msg = model.getLocalizedString("entities.message.deleted.pural");
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", MessageFormat.format(msg, param));
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class ServerSiteViewBean method handleTblServerButtonDeleteRequest.
/**
* Deletes server.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblServerButtonDeleteRequest(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();
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.deleteServers(names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class SubConfigEditViewBean method createChild.
protected View createChild(String name) {
if (!populatedSubConfigTable && name.equals(AMPropertySheetModel.TBL_SUB_CONFIG)) {
populatedSubConfigTable = true;
SubConfigModel model = (SubConfigModel) getModel();
if (model.hasGlobalSubSchema()) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel(szCache.<List<SMSubConfig>>getSerializedObj());
}
}
View view = null;
if (name.equals(PGTITLE_TWO_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 {
view = super.createChild(name);
}
return view;
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class SubConfigEditViewBean 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);
}
}
Aggregations