diff --git a/productMods/templates/visualization/co_authorship.jsp b/productMods/templates/visualization/co_authorship.jsp index eb4bef51..c1207708 100644 --- a/productMods/templates/visualization/co_authorship.jsp +++ b/productMods/templates/visualization/co_authorship.jsp @@ -1,279 +1,261 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData"%> + <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - - - + + + - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - -Co-Authorship Visualization - - - - - - - - - - - - - - - - - - -
- -<%-- Label --%> -
-
- -
-
-<%-- Moniker--%> -
-
-
- -
-
-
- -<%-- Image --%> -
-
-
-
-
-
+ + + + +
+ + + <%-- Image --%> +
+ + <%-- Label --%> +

+ + <%-- Moniker--%> + + + +
+ + + + +
This information is based solely on publications which have been loaded into the VIVO system. + This may only be a small sample of the person's total work.
+ +

Co-Author Network + + + (GraphML File)

+
+ + + + + + + + Currently there are no ${authorsText} papers for + this author in the VIVO database. + +
+ + + + Currently there are no papers for + this author in the VIVO database. + + + +
+ + + +
+ + +
+ +
+ +
+
-
 First - Publication
-
 Last Publication

- +
+ +
 
+ +
+
- -
-
+
  Publication(s)
+
  Co-author(s)
+ + + +
-Download co-authorship newtwork as .graphml file. + -
+ +
+ +

Tables

+ +
+

+ ${egoPubSparkline.table} +

+
+ + + +
+

+
+ +
+ +
+ +
+
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Publications per year
YearPublications
20044
20052
11
Unknown1
- -Download data as .csv file. - - - - - - - - - - - - - - - - - - - - - - - - - - -
Co - Authorhips
NamePublications
20044
20052
11
Unknown1
- - - - - - - - - + \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java index de49eb59..e733a222 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java @@ -9,6 +9,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.Map.Entry; +import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -18,6 +19,8 @@ import org.apache.commons.logging.Log; import com.hp.hpl.jena.query.DataSource; +import edu.cornell.mannlib.vitro.webapp.beans.Portal; +import edu.cornell.mannlib.vitro.webapp.controller.Controllers; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; @@ -90,6 +93,27 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { prepareNetworkDataResponse(authorNodesAndEdges, response); return; } + } else { + + RequestDispatcher requestDispatcher = null; + + prepareStandaloneResponse( + egoURI, + authorNodesAndEdges, + vitroRequest, + request); + + requestDispatcher = request.getRequestDispatcher(Controllers.BASIC_JSP); + + try { + requestDispatcher.forward(request, response); + } catch (Exception e) { + log.error("EntityEditController could not forward to view."); + log.error(e.getMessage()); + log.error(e.getStackTrace()); + } + + } } catch (MalformedQueryParametersException e) { @@ -217,4 +241,38 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { } } + /** + * When the page for person level visualization is requested. + * @param egoURI + * @param coAuthorshipVO + * @param vitroRequest + * @param request + */ + private void prepareStandaloneResponse( + String egoURI, + CoAuthorshipData coAuthorshipVO, + VitroRequest vitroRequest, + HttpServletRequest request) { + + Portal portal = vitroRequest.getPortal(); + + request.setAttribute("egoURIParam", egoURI); + + String title = ""; + if (coAuthorshipVO.getNodes() != null && coAuthorshipVO.getNodes().size() > 0) { + request.setAttribute("numOfAuthors", coAuthorshipVO.getNodes().size()); + title = coAuthorshipVO.getEgoNode().getNodeName() + " - "; + } + + if (coAuthorshipVO.getEdges() != null && coAuthorshipVO.getEdges().size() > 0) { + request.setAttribute("numOfCoAuthorShips", coAuthorshipVO.getEdges().size()); + } + + + request.setAttribute("title", title + "Co-Authorship Visualization"); + request.setAttribute("portalBean", portal); + request.setAttribute("scripts", "/templates/visualization/person_level_inject_head.jsp"); + request.setAttribute("bodyJsp", "/templates/visualization/co_authorship.jsp"); + } + }