1. Made minor changes as to how the csv were rendered.

2. Made change in the dummy vis client to link to a unique coauthors csv file.
This commit is contained in:
cdtank 2010-07-06 23:55:30 +00:00
parent 6a499d164f
commit 55cb5cf88b
2 changed files with 17 additions and 12 deletions

View file

@ -223,23 +223,20 @@ public class VisualizationRequestHandler {
private void generateCsvFileBuffer(Map<String, Set<Node>> yearToCoauthors, PrintWriter printWriter) {
CSVWriter csvWriter = new SimpleWriter(printWriter);
// CSVWriter csvWriter = new SimpleWriter(printWriter);
try {
csvWriter.append(new String[]{"Year", "Number of Authors", "Authors"});
printWriter.append("\"Year\", \"Number of Co-Authors\", \"Co-Author(s)\"\n");
for (Entry<String, Set<Node>> currentEntry : yearToCoauthors.entrySet()) {
csvWriter.append(new Object[]{currentEntry.getKey(),
currentEntry.getValue().size(),
getCoauthorsString(currentEntry.getValue())});
printWriter.append("\"" + currentEntry.getKey() + "\","
+ "\"" + currentEntry.getValue().size() + "\","
+ "\"" + getCoauthorsString(currentEntry.getValue()) + "\"\n"
);
}
} catch (IOException e) {
e.printStackTrace();
}
printWriter.flush();
}
@ -249,7 +246,7 @@ public class VisualizationRequestHandler {
StringBuilder coAuthorsMerged = new StringBuilder();
for (Node currCoAuthor : coAuthors) {
coAuthorsMerged.append(currCoAuthor.getNodeName() + ", ");
coAuthorsMerged.append(currCoAuthor.getNodeName() + " | ");
}
return coAuthorsMerged.toString();