Fixed the bug related to "loading up Co-Author/Co-PI" visualizations and their dependency on the domain name.

This commit is contained in:
bkoniden 2010-11-23 23:02:39 +00:00
parent dec86a43fa
commit 4bb68f332e
4 changed files with 29 additions and 11 deletions

View file

@ -310,9 +310,25 @@ function nodeClickedJS(json){
}
function encodeURL(url){
var domainURL = 'http://vivo-vis-bkoniden.slis.indiana.edu/';
return domainURL + url.replace(/&/g,'%26');
/*
* Inside both of these functions, '&' are replaced with '%26' because we are externally
* passing two parameters to the flash code using flashvars (see renderCoAuthorshipVisualization())
* and they are delimited using '&' too.
*/
function getEncodedCoAuthorURL(){
var queryString = "uri="+ egoURI + "&vis=coauthorship&render_mode=data";
// console.log('domainParam is '+ domainParam);
// console.log('CoAuthorURL is ' + domainParam + '?' + queryString.replace(/&/g, '%26'));
return domainParam + '?' + queryString.replace(/&/g, '%26');
}
function getEncodedCoPIURL(){
var queryString = "uri="+ egoURI+ "&vis=coprincipalinvestigator&render_mode=data";
// console.log('CoPIURL is ' + domainParam + '?' + queryString.replace(/&/g, '%26') );
return domainParam + '?' + queryString.replace(/&/g, '%26');
}
function renderCoAuthorshipVisualization() {
@ -353,7 +369,8 @@ function renderCoAuthorshipVisualization() {
//coAuthorUrl=/vivo1/visualization?vis=coauthorship%26render_mode=data%26uri=http%3A%2F%2Fvivo.iu.edu%2Findividual%2FBrnerKaty&labelField=label&coPIUrl=/vivo1/visualization?vis=coprincipalinvestigator%26render_mode=data%26uri=http%3A%2F%2Fvivo.iu.edu%2Findividual%2FBrnerKaty&labelField=label
AC_FL_RunContent(
"src", swfLink,
"flashVars", 'coAuthorUrl='+ encodeURL(egoCoAuthorshipDataFeederURL) + '&coPIUrl=' + encodeURL(egoCoPIDataFeederURL) ,
// "flashVars", 'coAuthorUrl='+ encodeURL(egoCoAuthorshipDataFeederURL) + '&coPIUrl=' + encodeURL(egoCoPIDataFeederURL) ,
"flashVars", 'coAuthorUrl='+ getEncodedCoAuthorURL() + '&coPIUrl=' + getEncodedCoPIURL() ,
"width", "800",
"height", "850",
"align", "top",

View file

@ -18,8 +18,6 @@
<c:set var='numOfAuthors' value='${requestScope.numOfAuthors}' />
<c:set var='numOfCoAuthorShips' value='${requestScope.numOfCoAuthorShips}' />
<c:set var='completeURL' value='${requestScope.completeURL}' />
<c:url var="egoVivoProfileURL" value="/individual">
<c:param name="uri" value="${requestScope.egoURIParam}" />
</c:url>
@ -43,6 +41,7 @@ $(document).ready(function(){
$("#coauth_table_container").empty().html('<img id="loadingData" with="auto" src="${loadingImageLink}" />');
</c:if>
processProfileInformation("ego_label",
"ego_moniker",
"ego_profile_image",
@ -61,7 +60,6 @@ $(document).ready(function(){
<div id="body">
<div>complete URL = '${completeURL} '</div>
<!--[if IE]>
<style type="text/css">

View file

@ -58,6 +58,7 @@ var egoCoAuthorshipDataFeederURL = "${egoCoAuthorshipDataFeederURL}";
var egoCoAuthorsListDataFileURL = "${egoCoAuthorsListDataFileURL}";
var egoCoPIDataFeederURL = "${egoCoPIDataFeederURL}";
var contextPath = "${contextPath}";
var domainParam = "${requestScope.completeURL}";
// -->
</script>

View file

@ -374,11 +374,13 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
private String getCompleteURL(HttpServletRequest request) throws MalformedURLException {
String file = request.getRequestURI();
System.out.println("getRequestURI() = "+ file + "getQueryString() ="+request.getQueryString()+ "getScheme() = "+ request.getScheme());
System.out.println("getServerName() = "+ request.getServerName() + "getServerPort() ="+request.getServerPort());
// System.out.println("\ngetRequestURI() --> "+ file + "\ngetQueryString() --> "+request.getQueryString()+ "\ngetScheme() --> "+ request.getScheme());
// System.out.println("\ngetServerName() --> "+ request.getServerName() + "\ngetServerPort() --> "+request.getServerPort());
URL reconstructedURL = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), file);
// System.out.println("\nReconstructed URL is --> " + reconstructedURL);
return reconstructedURL.toString();
}