/**
* @see org.olat.core.gui.components.table.TableDataModel#getValueAt(int, int)
*/
public Object getValueAt(int row, int col) {
WikiPage page = (WikiPage) objects.get(row);
switch (col) {
case 0:
return String.valueOf(page.getVersion());
case 1:
return new Date(page.getModificationTime());
case 2:
return String.valueOf(page.getViewCount());
case 3:
long key = page.getModifyAuthor();
return key != 0 ? ManagerFactory.getManager().loadIdentityByKey(Long.valueOf(page.getModifyAuthor())).getName() :"n/a";
//TODO:gs:a loadIdenitiesByKeys(List keys) would be much more performant as each lookup get one database lookup
case 4:
int v = page.getVersion();
if(v == 0) return new String("");
return String.valueOf(v-1) + " " +trans.translate("to") + " " + String.valueOf(v);
case 5:
return page.getUpdateComment();
default:
return "ERROR";
}
}