Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DS-3145] Configure rootpath in REST Reports (/handle, /xmlui/handle, /jspui/handle) #1366

Merged
merged 2 commits into from Apr 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions dspace-rest/src/main/webapp/static/reports/restCollReport.js
Expand Up @@ -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");
};
Expand Down Expand Up @@ -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){
Expand Down
6 changes: 3 additions & 3 deletions dspace-rest/src/main/webapp/static/reports/restQueryReport.js
Expand Up @@ -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<mdCols.length; i++) {
Expand Down Expand Up @@ -156,7 +156,7 @@ var QueryReport = function() {

if (colnum == 2) {
var anchor = $(col).find("a");
var href = anchor.is("a") ? anchor.attr("href").replace(/\/handle\//,"") : $(col).text();
var href = anchor.is("a") ? anchor.attr("href").replace(self.ROOTPATH,"") : $(col).text();
data += "\"" + href + "\"";
} else {
data += self.exportCell(col); }
Expand Down
3 changes: 3 additions & 0 deletions dspace-rest/src/main/webapp/static/reports/restReport.js
Expand Up @@ -10,6 +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/"

//Override this to return obj.id for DSpace 5 versions
this.getId = function(obj) {
Expand Down