tableModel.removeRow(0);
}
FolderNodeBean folderNode = (FolderNodeBean) actualNode.getUserObject();
try {
for (Iterator<Document> it = okmDocument.getChilds(token, folderNode.getFolder().getPath()).getItem().iterator(); it.hasNext();) {
Document doc = it.next();
Object[] data = new Object[7];
if (doc.isLocked() && !doc.isCheckedOut()) {
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/lock.gif");
buf = new byte[1024*10];
size = is.read(buf);
data[0] = new ImageIcon(buf);
} else {
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
buf = new byte[1024*10];
size = is.read(buf);
data[0] = new ImageIcon(buf);
}
if (doc.isCheckedOut()) {
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/edit.gif");
buf = new byte[1024*10];
size = is.read(buf);
data[1] = new ImageIcon(buf);
} else {
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
buf = new byte[1024*10];
size = is.read(buf);
data[1] = new ImageIcon(buf);
}
try {
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/mime/" + doc.getMimeType() + ".gif");
buf = new byte[1024*10];
size = is.read(buf);
data[2] = new ImageIcon(buf);
} catch (Exception e) {
// Case mime type is not in added icons !!
is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
buf = new byte[1024*10];
size = is.read(buf);
data[2] = new ImageIcon(buf);
}
data[3] = doc;
data[4] = doc.getAuthor();
data[5] = doc.getActualVersion().getName();
DateFormat df = new SimpleDateFormat(OpenKMAddOn.get().getLang().getString("date.pattern"));
Calendar cal = doc.getLastModified().toGregorianCalendar();
df.format(cal.getTime());
data[6] = df.format(cal.getTime());
tableModel.addRow(data);
}
pack();