1. added a VO for the person pub count data. The goal is to be able to get specific parts of the visualization like download data link, table etc.
2. modified peson pub count to make use of the VO. 3. Made changes to the front-end code for the co-authorship to include all the person-level objects. 4. cleaned & refactored the code.
This commit is contained in:
parent
94755a7f73
commit
7564c9b24e
5 changed files with 495 additions and 112 deletions
|
@ -0,0 +1,84 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount;
|
||||
|
||||
public class VisVOContainer {
|
||||
|
||||
/*
|
||||
* For now sparklineNumPublicationsText & sparklinePublicationRangeText is left
|
||||
* as empty but later on we would want to leverage the granularity that this
|
||||
* provides.
|
||||
* */
|
||||
private String sparklineNumPublicationsText = "";
|
||||
private String sparklinePublicationRangeText = "";
|
||||
|
||||
private Integer earliestRenderedPublicationYear;
|
||||
private Integer latestRenderedPublicationYear;
|
||||
|
||||
private String table = "";
|
||||
|
||||
private String downloadDataLink = "";
|
||||
private String fullTimelineNetworkLink = "";
|
||||
|
||||
private String sparklineContent;
|
||||
private String sparklineContext;
|
||||
|
||||
public String getSparklineNumPublicationsText() {
|
||||
return sparklineNumPublicationsText;
|
||||
}
|
||||
public void setSparklineNumPublicationsText(String sparklineNumPublicationsText) {
|
||||
this.sparklineNumPublicationsText = sparklineNumPublicationsText;
|
||||
}
|
||||
public String getSparklinePublicationRangeText() {
|
||||
return sparklinePublicationRangeText;
|
||||
}
|
||||
public void setSparklinePublicationRangeText(
|
||||
String sparklinePublicationRangeText) {
|
||||
this.sparklinePublicationRangeText = sparklinePublicationRangeText;
|
||||
}
|
||||
public Integer getEarliestRenderedPublicationYear() {
|
||||
return earliestRenderedPublicationYear;
|
||||
}
|
||||
public void setEarliestRenderedPublicationYear(
|
||||
Integer earliestRenderedPublicationYear) {
|
||||
this.earliestRenderedPublicationYear = earliestRenderedPublicationYear;
|
||||
}
|
||||
public Integer getLatestRenderedPublicationYear() {
|
||||
return latestRenderedPublicationYear;
|
||||
}
|
||||
public void setLatestRenderedPublicationYear(
|
||||
Integer latestRenderedPublicationYear) {
|
||||
this.latestRenderedPublicationYear = latestRenderedPublicationYear;
|
||||
}
|
||||
public String getTable() {
|
||||
return table;
|
||||
}
|
||||
public void setTable(String table) {
|
||||
this.table = table;
|
||||
}
|
||||
public String getDownloadDataLink() {
|
||||
return downloadDataLink;
|
||||
}
|
||||
public void setDownloadDataLink(String downloadDataLink) {
|
||||
this.downloadDataLink = downloadDataLink;
|
||||
}
|
||||
public String getFullTimelineNetworkLink() {
|
||||
return fullTimelineNetworkLink;
|
||||
}
|
||||
public void setFullTimelineNetworkLink(String fullTimelineNetworkLink) {
|
||||
this.fullTimelineNetworkLink = fullTimelineNetworkLink;
|
||||
}
|
||||
|
||||
public String getSparklineContent() {
|
||||
return sparklineContent;
|
||||
}
|
||||
public void setSparklineContent(String shortSparklineContent) {
|
||||
this.sparklineContent = shortSparklineContent;
|
||||
}
|
||||
|
||||
public String getSparklineContext() {
|
||||
return sparklineContext;
|
||||
}
|
||||
public void setSparklineContext(String shortSparklineContext) {
|
||||
this.sparklineContext = shortSparklineContext;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,6 +5,7 @@ import java.net.URLEncoder;
|
|||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
|
@ -35,24 +36,74 @@ public class VisualizationCodeGenerator {
|
|||
private static final String SHORT_SPARKLINE_MODE_URL_HANDLE = "short";
|
||||
|
||||
private static final String FULL_SPARKLINE_MODE_URL_HANDLE = "full";
|
||||
|
||||
|
||||
private Map<String, Integer> yearToPublicationCount;
|
||||
|
||||
private Log log;
|
||||
|
||||
public VisualizationCodeGenerator(Map<String, Integer> yearToPublicationCount, Log log) {
|
||||
private VisVOContainer valueObjectContainer;
|
||||
|
||||
public VisualizationCodeGenerator(String requestURI,
|
||||
String individualURIParam,
|
||||
String visMode,
|
||||
String visContainer,
|
||||
List<BiboDocument> authorDocuments,
|
||||
Map<String, Integer> yearToPublicationCount,
|
||||
VisVOContainer valueObjectContainer,
|
||||
Log log) {
|
||||
|
||||
this.yearToPublicationCount = yearToPublicationCount;
|
||||
this.valueObjectContainer = valueObjectContainer;
|
||||
this.log = log;
|
||||
|
||||
generateVisualizationCode(requestURI,
|
||||
individualURIParam,
|
||||
visMode,
|
||||
visContainer,
|
||||
authorDocuments);
|
||||
|
||||
|
||||
}
|
||||
public String getMainVisualizationCode(List<BiboDocument> authorDocuments,
|
||||
Set<String> publishedYears,
|
||||
|
||||
private void generateVisualizationCode(String requestURI,
|
||||
String individualURIParam,
|
||||
String visMode,
|
||||
String providedVisContainerID) {
|
||||
String visContainer,
|
||||
List<BiboDocument> authorDocuments) {
|
||||
|
||||
valueObjectContainer.setSparklineContent(getMainVisualizationCode(authorDocuments,
|
||||
visMode,
|
||||
visContainer));
|
||||
|
||||
|
||||
valueObjectContainer.setSparklineContext(getVisualizationContextCode(requestURI,
|
||||
individualURIParam,
|
||||
visMode));
|
||||
|
||||
}
|
||||
|
||||
// public VisVOContainer getValueObjectContainer() {
|
||||
//
|
||||
//
|
||||
//
|
||||
// return valueObjectContainer;
|
||||
// }
|
||||
|
||||
private String getMainVisualizationCode(List<BiboDocument> authorDocuments,
|
||||
String visMode,
|
||||
String providedVisContainerID) {
|
||||
|
||||
int numOfYearsToBeRendered = 0;
|
||||
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
|
||||
int shortSparkMinYear = currentYear - 10 + 1;
|
||||
|
||||
/*
|
||||
* This is required because when deciding the range of years over which the vis
|
||||
* was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
|
||||
* */
|
||||
Set<String> publishedYears = new HashSet(yearToPublicationCount.keySet());
|
||||
publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||
|
||||
/*
|
||||
* We are setting the default value of minPublishedYear to be 10 years before
|
||||
* the current year (which is suitably represented by the shortSparkMinYear),
|
||||
|
@ -157,6 +208,14 @@ public class VisualizationCodeGenerator {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* By default these represents the range of the rendered sparks. Only in case of
|
||||
* "short" sparkline mode we will set the Earliest RenderedPublication year to
|
||||
* "currentYear - 10".
|
||||
* */
|
||||
valueObjectContainer.setEarliestRenderedPublicationYear(minPublishedYear);
|
||||
valueObjectContainer.setLatestRenderedPublicationYear(currentYear);
|
||||
|
||||
/*
|
||||
* The Full Sparkline will be rendered by default. Only if the url has specific mention of
|
||||
* SHORT_SPARKLINE_MODE_URL_HANDLE then we render the short sparkline and not otherwise.
|
||||
|
@ -169,6 +228,8 @@ public class VisualizationCodeGenerator {
|
|||
* They both side-effect "visualizationCode"
|
||||
* */
|
||||
if (SHORT_SPARKLINE_MODE_URL_HANDLE.equalsIgnoreCase(visMode)) {
|
||||
|
||||
valueObjectContainer.setEarliestRenderedPublicationYear(shortSparkMinYear);
|
||||
generateShortSparklineVisualizationContent(currentYear,
|
||||
shortSparkMinYear,
|
||||
visContainerID,
|
||||
|
@ -184,6 +245,9 @@ public class VisualizationCodeGenerator {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
log.debug(visualizationCode);
|
||||
|
@ -231,6 +295,8 @@ public class VisualizationCodeGenerator {
|
|||
"renderedShortSparks += data.getValue(value, 1);" +
|
||||
"});\n");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Generate the text introducing the vis.
|
||||
* */
|
||||
|
@ -303,7 +369,7 @@ public class VisualizationCodeGenerator {
|
|||
"</script>\n";
|
||||
}
|
||||
|
||||
public String getVisualizationContextCode(String uri, String individualURI, String visMode) {
|
||||
private String getVisualizationContextCode(String uri, String individualURI, String visMode) {
|
||||
|
||||
String visualizationContextCode = "";
|
||||
if (SHORT_SPARKLINE_MODE_URL_HANDLE.equalsIgnoreCase(visMode)) {
|
||||
|
@ -333,27 +399,33 @@ public class VisualizationCodeGenerator {
|
|||
|
||||
String downloadFileCode;
|
||||
if (yearToPublicationCount.size() > 0) {
|
||||
downloadFileCode = "Download data as <a href='" + uri.toString() + "?" +
|
||||
VisualizationFrameworkConstants.INDIVIDUAL_URI_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(individualURI,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
VisualizationFrameworkConstants.VIS_TYPE_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(VisualizationController
|
||||
.PERSON_PUBLICATION_COUNT_VIS_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
VisualizationFrameworkConstants.RENDER_MODE_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(VisualizationFrameworkConstants.DATA_RENDER_MODE_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"'>.csv</a> file.<br />";
|
||||
|
||||
|
||||
String downloadURL = uri.toString()
|
||||
+ "?" + VisualizationFrameworkConstants.INDIVIDUAL_URI_URL_HANDLE
|
||||
+ "=" + URLEncoder.encode(individualURI,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString()
|
||||
+ "&" + VisualizationFrameworkConstants.VIS_TYPE_URL_HANDLE
|
||||
+ "=" + URLEncoder.encode(VisualizationController
|
||||
.PERSON_PUBLICATION_COUNT_VIS_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString()
|
||||
+ "&" + VisualizationFrameworkConstants.RENDER_MODE_URL_HANDLE
|
||||
+ "=" + URLEncoder.encode(VisualizationFrameworkConstants.DATA_RENDER_MODE_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString();
|
||||
downloadFileCode = "Download data as <a href='" + downloadURL + "'>.csv</a> file.<br />";
|
||||
|
||||
valueObjectContainer.setDownloadDataLink(downloadURL);
|
||||
} else {
|
||||
downloadFileCode = "No data available to export.<br />";
|
||||
|
||||
valueObjectContainer.setDownloadDataLink("#");
|
||||
}
|
||||
|
||||
divContextCode.append("<p>" + generateDataTable() +
|
||||
String tableCode = generateDataTable();
|
||||
|
||||
divContextCode.append("<p>" + tableCode +
|
||||
downloadFileCode + "</p>");
|
||||
|
||||
valueObjectContainer.setTable(tableCode);
|
||||
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -373,22 +445,27 @@ public class VisualizationCodeGenerator {
|
|||
|
||||
String fullTimelineLink;
|
||||
if (yearToPublicationCount.size() > 0) {
|
||||
fullTimelineLink = "<a href='" + uri.toString() + "?" +
|
||||
VisualizationFrameworkConstants.INDIVIDUAL_URI_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(individualURI,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
"vis" +
|
||||
"=" + URLEncoder.encode(VisualizationController
|
||||
.PERSON_PUBLICATION_COUNT_VIS_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
VisualizationFrameworkConstants.RENDER_MODE_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(VisualizationFrameworkConstants.STANDALONE_RENDER_MODE_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"'>View full timeline and network.</a><br />";
|
||||
String fullTimelineNetworkURL = uri.toString() + "?" +
|
||||
VisualizationFrameworkConstants.INDIVIDUAL_URI_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(individualURI,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
"vis" +
|
||||
"=" + URLEncoder.encode(VisualizationController
|
||||
.PERSON_PUBLICATION_COUNT_VIS_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString() +
|
||||
"&" +
|
||||
VisualizationFrameworkConstants.RENDER_MODE_URL_HANDLE +
|
||||
"=" + URLEncoder.encode(VisualizationFrameworkConstants.STANDALONE_RENDER_MODE_URL_VALUE,
|
||||
VisualizationController.URL_ENCODING_SCHEME).toString();
|
||||
fullTimelineLink = "<a href='" + fullTimelineNetworkURL + "'>View full timeline and network.</a><br />";
|
||||
|
||||
valueObjectContainer.setFullTimelineNetworkLink(fullTimelineNetworkURL);
|
||||
|
||||
} else {
|
||||
|
||||
fullTimelineLink = "No data available to render full timeline.<br />";
|
||||
valueObjectContainer.setFullTimelineNetworkLink("#");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -109,26 +109,28 @@ public class VisualizationRequestHandler {
|
|||
* Computations required to generate HTML for the sparklines & related context.
|
||||
* */
|
||||
|
||||
/*
|
||||
* This is required because when deciding the range of years over which the vis
|
||||
* was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
|
||||
* */
|
||||
Set<String> publishedYears = new HashSet(yearToPublicationCount.keySet());
|
||||
publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||
VisVOContainer valueObjectContainer = new VisVOContainer();
|
||||
|
||||
VisualizationCodeGenerator visualizationCodeGenerator =
|
||||
new VisualizationCodeGenerator(yearToPublicationCount, log);
|
||||
new VisualizationCodeGenerator(vitroRequest.getRequestURI(),
|
||||
individualURIParam,
|
||||
visMode,
|
||||
visContainer,
|
||||
authorDocuments,
|
||||
yearToPublicationCount,
|
||||
valueObjectContainer,
|
||||
log);
|
||||
|
||||
String visContentCode = visualizationCodeGenerator
|
||||
.getMainVisualizationCode(authorDocuments,
|
||||
publishedYears,
|
||||
visMode,
|
||||
visContainer);
|
||||
|
||||
String visContentCode = valueObjectContainer.getSparklineContent();
|
||||
|
||||
String visContextCode = visualizationCodeGenerator
|
||||
.getVisualizationContextCode(vitroRequest.getRequestURI(),
|
||||
individualURIParam,
|
||||
visMode);
|
||||
String visContextCode = valueObjectContainer.getSparklineContext();
|
||||
|
||||
System.out.println("ft url - " + valueObjectContainer.getFullTimelineNetworkLink());
|
||||
System.out.println("dnld fl - " + valueObjectContainer.getDownloadDataLink());
|
||||
System.out.println("table - " + valueObjectContainer.getTable());
|
||||
System.out.println("min - " + valueObjectContainer.getEarliestRenderedPublicationYear());
|
||||
System.out.println("max - " + valueObjectContainer.getLatestRenderedPublicationYear());
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,7 +30,6 @@ function getWellFormedURLs(given_uri, type) {
|
|||
dataType: "text",
|
||||
async: false,
|
||||
success:function(data){
|
||||
console.log("PROF - " + data);
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
|
@ -44,33 +43,123 @@ function getWellFormedURLs(given_uri, type) {
|
|||
dataType: "text",
|
||||
async: false,
|
||||
success:function(data){
|
||||
console.log("IMAGE - " + data);
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
return contextPath + finalURL;
|
||||
// return finalURL;
|
||||
return finalURL;
|
||||
|
||||
} else if (type == "profile_info") {
|
||||
|
||||
var profileInfoJSON = $.ajax({
|
||||
url: contextPath + "/admin/visQuery",
|
||||
data: ({vis: "utilities", vis_mode: "PROFILE_INFO", uri: given_uri}),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success:function(data){
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
return profileInfoJSON;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
$.fn.image = function(src, successFunc, failureFunc){
|
||||
return this.each(function(){
|
||||
var i = new Image();
|
||||
i.src = src;
|
||||
i.onerror = failureFunc;
|
||||
i.onload = successFunc;
|
||||
|
||||
// console.dir(i);
|
||||
// this.appendChild(i);
|
||||
|
||||
return i;
|
||||
var profileImage = new Image();
|
||||
profileImage.src = src;
|
||||
profileImage.width = 150;
|
||||
profileImage.onerror = failureFunc;
|
||||
profileImage.onload = successFunc;
|
||||
|
||||
|
||||
return profileImage;
|
||||
});
|
||||
}
|
||||
|
||||
function setProfileImage(imageContainerID, rawPath, contextPath) {
|
||||
|
||||
if (imageContainerID == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var imageLink = contextPath + rawPath;
|
||||
|
||||
var imageContainer = $("#" + imageContainerID);
|
||||
imageContainer.image(imageLink,
|
||||
function(){
|
||||
imageContainer.empty().append(this);
|
||||
},
|
||||
function(){
|
||||
//For performing any action on failure to
|
||||
//find the image.
|
||||
imageContainer.empty();
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function setProfileMoniker(monikerContainerID, moniker) {
|
||||
|
||||
if (monikerContainerID == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#" + monikerContainerID).empty().text(moniker);
|
||||
|
||||
}
|
||||
|
||||
function setProfileName(nameContainerID, name) {
|
||||
|
||||
if (nameContainerID == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#" + nameContainerID).empty().text(name);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function processProfileInformation(nameContainerID,
|
||||
monikerContainerID,
|
||||
imageContainerID,
|
||||
profileInfoJSON) {
|
||||
|
||||
|
||||
var name, imageRawPath, imageContextPath, moniker;
|
||||
|
||||
$.each(profileInfoJSON, function(key, set){
|
||||
|
||||
if (key.search(/imageThumb/i) > -1) {
|
||||
|
||||
imageRawPath = set[0];
|
||||
|
||||
} else if (key.search(/imageContextPath/i) > -1) {
|
||||
|
||||
imageContextPath = set[0];
|
||||
|
||||
} else if (key.search(/moniker/i) > -1) {
|
||||
|
||||
moniker = set[0];
|
||||
|
||||
} else if (key.search(/label/i) > -1) {
|
||||
|
||||
name = set[0];
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
setProfileName(nameContainerID, name);
|
||||
setProfileMoniker(monikerContainerID, moniker);
|
||||
setProfileImage(imageContainerID, imageRawPath, imageContextPath);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function nodeClickedJS(obj){
|
||||
|
||||
|
@ -84,28 +173,17 @@ function nodeClickedJS(obj){
|
|||
if(obj[7]){
|
||||
$("#profileUrl").attr("href", getWellFormedURLs(obj[7], "profile"));
|
||||
$("#coAuthorshipVisUrl").attr("href", getWellFormedURLs(obj[7], "coauthorship"));
|
||||
var imageLink = getWellFormedURLs(obj[7], "image");
|
||||
processProfileInformation("",
|
||||
"profileMoniker",
|
||||
"profileImage",
|
||||
jQuery.parseJSON(getWellFormedURLs(obj[7], "profile_info")));
|
||||
|
||||
} else{
|
||||
$("#profileUrl").attr("href","#");
|
||||
$("#coAuthorshipVisUrl").attr("href","#");
|
||||
}
|
||||
|
||||
var imageContainer = $("#profileImage");
|
||||
imageContainer.image(imageLink,
|
||||
function(){
|
||||
imageContainer.append(this);
|
||||
},
|
||||
function(){
|
||||
/*
|
||||
* For performing any action on failure to
|
||||
* find the image.
|
||||
*/
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$("#coAuthorName").empty().append(obj[name]);
|
||||
$("#coAuthorName").empty().append(obj[0]);
|
||||
|
||||
$("#coAuthors").empty().append(obj[5]);
|
||||
$("#firstPublication").empty().append((obj[3])?obj[3]+" First Publication":"");
|
||||
|
@ -115,7 +193,27 @@ function nodeClickedJS(obj){
|
|||
|
||||
}
|
||||
|
||||
function renderVisualization() {
|
||||
function renderSparklineVisualization(visualizationURL) {
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
//$("#ego_sparkline").empty().html('<img src="${loadingImageLink}" />');
|
||||
|
||||
$.ajax({
|
||||
url: visualizationURL,
|
||||
dataType: "html",
|
||||
success:function(data){
|
||||
$("#ego_sparkline").html(data);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function renderCoAuthorshipVisualization() {
|
||||
|
||||
//Version check for the Flash Player that has the ability to start Player
|
||||
//Product Install (6.0r65)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
|
||||
<c:set var="portalBean" value="${requestScope.portalBean}" />
|
||||
<c:set var="portalBean" value="${requestScope.portalBean}" />
|
||||
<c:set var="themeDir">
|
||||
<c:out value="${portalBean.themeDir}" />
|
||||
|
@ -16,17 +17,23 @@
|
|||
<c:param name="labelField" value="name" />
|
||||
</c:url>
|
||||
|
||||
|
||||
<c:url var="egoSparklineVisURL" value="/admin/visQuery">
|
||||
<c:param name="render_mode" value="dynamic"/>
|
||||
<c:param name="container" value="ego_sparkline"/>
|
||||
<c:param name="vis" value="person_pub_count"/>
|
||||
<c:param name="vis_mode" value="full"/>
|
||||
<c:param name="uri" value="${requestScope.egoURIParam}"/>
|
||||
</c:url>
|
||||
|
||||
<c:url var="jquery" value="/js/jquery.js" />
|
||||
<c:url var="adobeFlashDetector"
|
||||
value="/js/visualization/coauthorship/AC_OETags.js" />
|
||||
<c:url var="coAuthorShipJavaScript"
|
||||
value="/js/visualization/coauthorship/co_authorship.js" />
|
||||
<c:url var="style"
|
||||
value="/${themeDir}css/visualization/coauthorship/style.css" />
|
||||
<c:url var="noImage"
|
||||
value="/${themeDir}site_icons/visualization/coauthorship/no_image.png" />
|
||||
<c:url var="swfLink"
|
||||
value="/${themeDir}site_icons/visualization/coauthorship/CoAuthor.swf" />
|
||||
<c:url var="adobeFlashDetector" value="/js/visualization/coauthorship/AC_OETags.js" />
|
||||
<c:url var="coAuthorShipJavaScript" value="/js/visualization/coauthorship/co_authorship.js" />
|
||||
<c:url var="googleVisualizationAPI" value="http://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D"/>
|
||||
<c:url var="style" value="/${themeDir}css/visualization/coauthorship/style.css" />
|
||||
<c:url var="noImage" value="/${themeDir}site_icons/visualization/coauthorship/no_image.png" />
|
||||
<c:url var="swfLink" value="/${themeDir}site_icons/visualization/coauthorship/CoAuthor.swf" />
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
@ -62,20 +69,66 @@ var contextPath = "${contextPath}";
|
|||
</script>
|
||||
|
||||
<script type="text/javascript" src="${jquery}"></script>
|
||||
<script type="text/javascript" src="${googleVisualizationAPI}"></script>
|
||||
<link href="${style}" rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<script type="text/javascript" src="${coAuthorShipJavaScript}"></script>
|
||||
|
||||
<style type="text/css">
|
||||
#ego_sparkline {
|
||||
cursor:pointer;
|
||||
height:36px;
|
||||
margin-left:24%;
|
||||
margin-top:-18%;
|
||||
position:absolute;
|
||||
width:380px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="topNav">
|
||||
<h1>Co-Author <span>Network</span></h1>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="body">
|
||||
|
||||
|
||||
<%-- Label --%>
|
||||
<div class="datatypePropertyValue">
|
||||
<div class="statementWrap">
|
||||
<span id="ego_label"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- Moniker--%>
|
||||
<div class="datatypeProperties">
|
||||
<div class="datatypePropertyValue">
|
||||
<div class="statementWrap">
|
||||
<span id="ego_moniker" class="moniker"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- Image --%>
|
||||
<div class="datatypeProperties">
|
||||
<div class="datatypePropertyValue">
|
||||
<div id="ego_profile-image" class="statementWrap thumbnail">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- Sparkline --%>
|
||||
<div class="datatypeProperties">
|
||||
<div class="datatypePropertyValue">
|
||||
<div id="ego_sparkline">
|
||||
|
||||
${requestScope.egoURIParam}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="topShadow"></div>
|
||||
<div id="bodyPannel" style="height: 900px;"><br class="spacer" />
|
||||
<div id="visPanel" style="float: left; width: 610px;">
|
||||
|
@ -84,7 +137,7 @@ var contextPath = "${contextPath}";
|
|||
|
||||
<!--
|
||||
|
||||
renderVisualization();
|
||||
renderCoAuthorshipVisualization();
|
||||
|
||||
//-->
|
||||
|
||||
|
@ -104,9 +157,7 @@ renderVisualization();
|
|||
<div class="middle" id="nodeData">
|
||||
<div id="profileImage"></div>
|
||||
<div class="bold"><strong><span id="authorName"> </span></strong></div>
|
||||
<!-- <div class="italicize">Professor</div>
|
||||
<div class="italicize">Department of <span>???</span></div>
|
||||
--> <br />
|
||||
<div class="italicize"><span id="profileMoniker"></span></div>
|
||||
<div class="works"><span class="numbers" style="width: 40px;"
|
||||
id="works">6</span> <span class="title">Works</span></div>
|
||||
<div class="works"><span class="numbers" style="width: 40px;"
|
||||
|
@ -116,33 +167,105 @@ renderVisualization();
|
|||
Publication</span></div>
|
||||
<div id="lastPublication"><span></span> Last Publication</div>
|
||||
<br />
|
||||
<div><a href="#" id="profileUrl">Go to VIVO profile</a></div>
|
||||
<div><a href="#" id="profileUrl">VIVO profile</a></div>
|
||||
<br />
|
||||
<div><a href="#" id="coAuthorshipVisUrl">Go to ego-centric
|
||||
co-author network of <span id="coAuthorName"></span></a></div>
|
||||
<div><a href="#" id="coAuthorshipVisUrl">Co-author network of <span id="coAuthorName"></span></a></div>
|
||||
</div>
|
||||
<div id="image_test"></div>
|
||||
<br class="spacer"> <span class="nlbottom"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Download co-authorship newtwork as <a href="/vivo1/admin/visQuery?uri=http%3A%2F%2Fvivo.library.cornell.edu%2Fns%2F0.1%23individual5748&vis=person_pub_count&render_mode=data">.graphml</a> file.
|
||||
|
||||
<div id="bottomShadow"></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="spacer" />
|
||||
|
||||
<table id="publications_data_table">
|
||||
<caption>Publications per year</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Year</th>
|
||||
<th>Publications</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>2004</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2005</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unknown</td>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Download data as <a href="/vivo1/admin/visQuery?uri=http%3A%2F%2Fvivo.library.cornell.edu%2Fns%2F0.1%23individual5748&vis=person_pub_count&render_mode=data">.csv</a> file.
|
||||
|
||||
<table id="coauthorships_data_table">
|
||||
<caption>Co - Authorhips</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Publications</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>2004</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2005</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Unknown</td>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
processProfileInformation("ego_label",
|
||||
"ego_moniker",
|
||||
"ego_profile-image",
|
||||
jQuery.parseJSON(getWellFormedURLs("${requestScope.egoURIParam}", "profile_info")));
|
||||
|
||||
renderSparklineVisualization("${egoSparklineVisURL}");
|
||||
|
||||
|
||||
var obj = jQuery.parseJSON('{"name":"John"}');
|
||||
console.log(obj)
|
||||
//console.log(obj)
|
||||
|
||||
var obj = jQuery.parseJSON('{"imageOffset2":["sup"],"A":["2001","2002","2003","2090","Unknown"],"B":["2001","2002","2003","2090","Unknown"],"C":["2001","2002","2003","2090","Unknown"],"imageOffset":["2090","2002","2003","2001"]}');
|
||||
console.log(obj)
|
||||
//console.log(obj)
|
||||
|
||||
$.each(obj, function(i, item){
|
||||
console.log("i - " + i + " item - " + item);
|
||||
//console.log("i - " + i + " item - " + item);
|
||||
$.each(item, function(index, vals) {
|
||||
console.log(index + " - val - " + vals);
|
||||
//console.log(index + " - val - " + vals);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -150,6 +273,5 @@ $(document).ready(function(){
|
|||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue