From 55cb5cf88b5f68cc9add0b8202eaf62f6d76f0a6 Mon Sep 17 00:00:00 2001 From: cdtank Date: Tue, 6 Jul 2010 23:55:30 +0000 Subject: [PATCH] 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. --- .../VisualizationRequestHandler.java | 21 ++++++++----------- .../visualization/dummy_vis_client.jsp | 8 +++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/VisualizationRequestHandler.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/VisualizationRequestHandler.java index fb64bfb4f..15153b804 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/VisualizationRequestHandler.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/VisualizationRequestHandler.java @@ -223,23 +223,20 @@ public class VisualizationRequestHandler { private void generateCsvFileBuffer(Map> 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> 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(); diff --git a/webapp/web/templates/visualization/dummy_vis_client.jsp b/webapp/web/templates/visualization/dummy_vis_client.jsp index e846f6293..a04048c9a 100644 --- a/webapp/web/templates/visualization/dummy_vis_client.jsp +++ b/webapp/web/templates/visualization/dummy_vis_client.jsp @@ -211,6 +211,13 @@ + + + + + + + @@ -312,6 +319,7 @@ $(document).ready(function() { vis link for coauthorship -> "Erb, Hollis Nancy"   Data   Person Level +  Unique Coauthors CSV Data
vis link for coauthorship -> "Not Working" {"Crane, Brian"}  Data