use of com.sun.identity.console.base.model.SMSubConfig in project OpenAM by OpenRock.
the class AbstractAuditModel method getEventHandlerConfigurations.
/**
* Get the configuration properties of all the audit event handlers.
*
* @return A list of config objects.
*/
public List<SMSubConfig> getEventHandlerConfigurations() throws AMConsoleException {
List<SMSubConfig> subConfigModelList = new ArrayList<>();
try {
ServiceConfig serviceConfig = getServiceConfig();
if (serviceConfig == null) {
return subConfigModelList;
}
Set<String> auditHandlerNames = serviceConfig.getSubConfigNames();
for (String name : auditHandlerNames) {
ServiceConfig conf = serviceConfig.getSubConfig(name);
subConfigModelList.add(new SMSubConfig(conf.getComponentName(), name, conf.getSchemaID()));
}
sort(subConfigModelList, new SMSubConfigComparator(Collator.getInstance(getUserLocale())));
} catch (SMSException | SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
return subConfigModelList;
}
use of com.sun.identity.console.base.model.SMSubConfig in project OpenAM by OpenRock.
the class AbstractAuditViewBean method createChild.
@Override
protected View createChild(String name) {
if (!populatedSubConfigTable && name.equals(TBL_SUB_CONFIG)) {
populatedSubConfigTable = true;
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel(szCache.<List<SMSubConfig>>getSerializedObj());
}
return super.createChild(name);
}
use of com.sun.identity.console.base.model.SMSubConfig in project OpenAM by OpenRock.
the class AbstractAuditViewBean method populateTableModel.
private void populateTableModel(List<SMSubConfig> subConfigs) {
CCActionTable tbl = (CCActionTable) getChild(TBL_SUB_CONFIG);
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
tblModel.clearAll();
if (CollectionUtils.isEmpty(subConfigs)) {
return;
}
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List<SMSubConfig> cache = new ArrayList<>(subConfigs.size());
boolean firstEntry = true;
for (SMSubConfig conf : subConfigs) {
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
tblModel.setValue(TBL_SUB_CONFIG_DATA_NAME, conf.getName());
tblModel.setValue(TBL_SUB_CONFIG_HREF_NAME, conf.getName());
tblModel.setValue(TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
cache.add(conf);
}
szCache.setValue(cache);
}
use of com.sun.identity.console.base.model.SMSubConfig in project OpenAM by OpenRock.
the class SCServiceProfileViewBean 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);
}
}
use of com.sun.identity.console.base.model.SMSubConfig 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();
}
Aggregations