From 0fe9fa8431d1ba348a4eab30919a8bba893f2fba Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 25 Apr 2016 15:14:20 -0700 Subject: [PATCH 1/2] Control rootpath --- .../src/main/webapp/static/reports/restCollReport.js | 6 +++--- .../src/main/webapp/static/reports/restQueryReport.js | 6 +++--- dspace-rest/src/main/webapp/static/reports/restReport.js | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dspace-rest/src/main/webapp/static/reports/restCollReport.js b/dspace-rest/src/main/webapp/static/reports/restCollReport.js index 124f226c68a0..76a9547f8bec 100644 --- a/dspace-rest/src/main/webapp/static/reports/restCollReport.js +++ b/dspace-rest/src/main/webapp/static/reports/restCollReport.js @@ -127,10 +127,10 @@ var CollReport = function() { var tr = self.myHtmlUtil.addTr(tbody); tr.attr("cid", coll.id).attr("index",index).addClass(index % 2 == 0 ? "odd data" : "even data"); self.myHtmlUtil.addTd(tr, index + 1).addClass("num"); - var parval = self.myHtmlUtil.getAnchor(top.name, "/handle/" + top.handle); + var parval = self.myHtmlUtil.getAnchor(top.name, self.ROOTPATH + top.handle); self.myHtmlUtil.addTd(tr, parval).addClass("title comm"); - self.myHtmlUtil.addTdAnchor(tr, coll.name, "/handle/" + coll.handle).addClass("title"); + self.myHtmlUtil.addTdAnchor(tr, coll.name, self.ROOTPATH + coll.handle).addClass("title"); var td = self.myHtmlUtil.addTd(tr, "").addClass("num").addClass("link").addClass("numCount"); td = self.myHtmlUtil.addTd(tr, "").addClass("num").addClass("numFiltered"); }; @@ -422,7 +422,7 @@ var CollReport = function() { tr.addClass(index % 2 == 0 ? "odd data" : "even data"); self.myHtmlUtil.addTd(tr, offset+index+1).addClass("num"); self.myHtmlUtil.addTd(tr, self.getId(item)); - self.myHtmlUtil.addTdAnchor(tr, item.handle, "/handle/" + item.handle); + self.myHtmlUtil.addTdAnchor(tr, item.handle, self.ROOTPATH + item.handle); self.myHtmlUtil.addTd(tr, item.name).addClass("ititle"); if (fields != null) { $.each(fields, function(index, field){ diff --git a/dspace-rest/src/main/webapp/static/reports/restQueryReport.js b/dspace-rest/src/main/webapp/static/reports/restQueryReport.js index ab6c7e132e39..d045614ea865 100644 --- a/dspace-rest/src/main/webapp/static/reports/restQueryReport.js +++ b/dspace-rest/src/main/webapp/static/reports/restQueryReport.js @@ -108,9 +108,9 @@ var QueryReport = function() { if (item.parentCollection == null) { self.myHtmlUtil.addTd(tr, "--"); } else { - self.myHtmlUtil.addTdAnchor(tr, item.parentCollection.name, "/handle/" + item.parentCollection.handle); + self.myHtmlUtil.addTdAnchor(tr, item.parentCollection.name, self.ROOTPATH + item.parentCollection.handle); } - self.myHtmlUtil.addTdAnchor(tr, item.handle, "/handle/" + item.handle); + self.myHtmlUtil.addTdAnchor(tr, item.handle, self.ROOTPATH + item.handle); self.myHtmlUtil.addTd(tr, item.name); for(var i=0; i Date: Wed, 27 Apr 2016 08:54:24 -0700 Subject: [PATCH 2/2] Set default to work on demo.dspace.org Since any one of the 3 paths could be chosen, the default will be set to work in demo.dspace.org. --- dspace-rest/src/main/webapp/static/reports/restReport.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-rest/src/main/webapp/static/reports/restReport.js b/dspace-rest/src/main/webapp/static/reports/restReport.js index 61d6385c2717..e762d04d6297 100644 --- a/dspace-rest/src/main/webapp/static/reports/restReport.js +++ b/dspace-rest/src/main/webapp/static/reports/restReport.js @@ -10,9 +10,9 @@ var Report = function() { this.COLL_LIMIT = 500; this.COUNT_LIMIT = 500; this.ITEM_LIMIT = 100; - //this.ROOTPATH = "/xmlui/handle/" - //this.ROOTPATH = "/jspui/handle/" - this.ROOTPATH = "/handle/" + this.ROOTPATH = "/xmlui/handle/" + //this.ROOTPATH = "/jspui/handle/" + //this.ROOTPATH = "/handle/" //Override this to return obj.id for DSpace 5 versions this.getId = function(obj) {