use of com.sun.identity.console.realm.model.IDRepoModel in project OpenAM by OpenRock.
the class IDRepoViewBean method populateTableModel.
private void populateTableModel(Collection idRepoNames) {
tblModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
if ((idRepoNames != null) && !idRepoNames.isEmpty()) {
List cache = new ArrayList(idRepoNames.size());
IDRepoModel model = (IDRepoModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
Map mapTypeToDisplayName = null;
try {
mapTypeToDisplayName = model.getIDRepoTypesMap();
} catch (AMConsoleException e) {
mapTypeToDisplayName = Collections.EMPTY_MAP;
}
boolean firstEntry = true;
for (Iterator iter = idRepoNames.iterator(); iter.hasNext(); ) {
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
String name = (String) iter.next();
tblModel.setValue(TBL_DATA_NAME, name);
try {
String type = model.getIDRepoType(curRealm, name);
String displayName = (String) mapTypeToDisplayName.get(type);
if (displayName == null) {
displayName = type;
}
tblModel.setValue(TBL_DATA_TYPE, displayName);
} catch (AMConsoleException e) {
tblModel.setValue(TBL_DATA_TYPE, "");
}
tblModel.setValue(TBL_DATA_ACTION_HREF, stringToHex(name));
cache.add(name);
}
szCache.setValue((ArrayList) cache);
} else {
szCache.setValue(null);
}
}
Aggregations