1. Refactored code to use a utility method instead of having the same method being defined in each of the vis request handlers.

2. Adding a "person level" vis package to handle combination of sparkline & co-authorship vis page.
3. Testing out the concept of accessing fields of a class form jsp page.
This commit is contained in:
cdtank 2010-07-01 15:54:11 +00:00
parent d87ffcc3be
commit 0e8e1dc9e2
16 changed files with 848 additions and 152 deletions

View file

@ -161,35 +161,37 @@ function processProfileInformation(nameContainerID,
function nodeClickedJS(obj){
function nodeClickedJS(json){
var obj = jQuery.parseJSON(json);
$("#newsLetter").attr("style","visibility:visible");
$("#authorName").empty().append(obj[0]);
$("#works").empty().append(obj[1]);
$("#authorName").empty().append(obj.name);
$("#works").empty().append(obj.number_of_authored_works);
/*
* Here obj[7] points to the uri of that individual
* Here obj.url points to the uri of that individual
*/
if(obj[7]){
$("#profileUrl").attr("href", getWellFormedURLs(obj[7], "profile"));
$("#coAuthorshipVisUrl").attr("href", getWellFormedURLs(obj[7], "coauthorship"));
if(obj.url){
$("#profileUrl").attr("href", getWellFormedURLs(obj.url, "profile"));
$("#coAuthorshipVisUrl").attr("href", getWellFormedURLs(obj.url, "coauthorship"));
processProfileInformation("",
"profileMoniker",
"profileImage",
jQuery.parseJSON(getWellFormedURLs(obj[7], "profile_info")));
jQuery.parseJSON(getWellFormedURLs(obj.url, "profile_info")));
} else{
$("#profileUrl").attr("href","#");
$("#coAuthorshipVisUrl").attr("href","#");
}
$("#coAuthorName").empty().append(obj[0]);
$("#coAuthorName").empty().append(obj.name);
$("#coAuthors").empty().append(obj[5]);
$("#firstPublication").empty().append((obj[3])?obj[3]+" First Publication":"");
$("#lastPublication").empty().append((obj[4])?obj[4]+" Last Publication":"");
$("#coAuthors").empty().append(obj.num_coauthors);
$("#firstPublication").empty().append((obj.earliest_publication)?obj.earliest_publication+" First Publication":"");
$("#lastPublication").empty().append((obj.latest_publication)?obj.latest_publication+" Last Publication":"");
// obj[7]:the url parameter for node
// obj.url:the url parameter for node
}