Skip to content

Commit

Permalink
Fixed bug NAS-2636 - removed reference to H3 remote access page in Si…
Browse files Browse the repository at this point in the history
…teSection class and add English label to H3 Remote Access page
  • Loading branch information
svcarlsen committed May 5, 2017
1 parent 89af8dd commit e5d7152
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class SiteSection {
/** The resource bundle with translations of this sitesection. */
private String bundle;
/**
* Extension used for JSP files, including '.' separator.
* Extension used for JSP files, including '.' separator.
*/
private static final String JSP_EXTENSION = ".jsp";
/**
Expand Down Expand Up @@ -94,7 +94,14 @@ public SiteSection(String mainname, String prefix, int visiblePages, String[][]
if (pageAndTitle.length != 2) {
throw new ArgumentNotValid("Must have exactly page and title in " + prefix);
}
this.pagesAndTitles.put(prefix + "-" + pageAndTitle[0] + JSP_EXTENSION, pageAndTitle[1]);
// Handle links outside webpages directory
// Assume pageurl ending with / as external url requiring no prefix
String pageurl= prefix + "-" + pageAndTitle[0] + JSP_EXTENSION;
if (pageAndTitle[0].endsWith("/")) {
pageurl = pageAndTitle[0]; // Add no prefix
}
String pagelabel = pageAndTitle[1];
this.pagesAndTitles.put(pageurl, pagelabel);
}
}

Expand Down Expand Up @@ -150,20 +157,14 @@ public void generateNavigationTree(JspWriter out, String url, Locale locale) thr
}
out.print("<tr>");
out.print("<td>&nbsp; &nbsp; <a href=\"/" + HTMLUtils.encode(dirname) + "/"
+ HTMLUtils.encode(pageAndTitle.getKey()) + "\"> "
//+ HTMLUtils.encode(pageAndTitle.getKey())
+ pageAndTitle.getKey() // Don't encode this
+ "\"> "
+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle, locale, pageAndTitle.getValue()))
+ "</a></td>");
out.print("</tr>\n");
i++;
}
if (this.getClass().getName().equalsIgnoreCase("dk.netarkivet.harvester.webinterface.HistorySiteSection")) {
out.print("<tr>");
out.print("<td>&nbsp; &nbsp; <a href=\"/" + HTMLUtils.encode(dirname) + "/"
+ HTMLUtils.encode("history") + "/\"> "
+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle, locale, "H3 Remote Access"))
+ "</a></td>");
out.print("</tr>\n");
}
}
}

Expand Down Expand Up @@ -198,7 +199,6 @@ private String getPage(String url) {
* @return The dirname.
*/
public String getDirname() {
return dirname;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public class HistorySiteSection extends SiteSection {
public HistorySiteSection() {
super("sitesection;history",
"Harveststatus",
2,
3,
new String[][] {
{"alljobs", "pagetitle;all.jobs"},
//{"deprecatedperdomain", "pagetitle;all.jobs.per.domain"},
{"running", "pagetitle;all.jobs.running"},
{"history/", "pagetitle;h3.remote.access"}, // refer to webpage outside of webpages directory
{"running-jobdetails", "pagetitle;running.job.details"},
{"perhd", "pagetitle;all.jobs.per.harvestdefinition"},
{"perharvestrun", "pagetitle;all.jobs.per.harvestrun"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,5 @@ running.jobs.monitor.no.hosts.enabled = No hosts enabled.
running.jobs.monitor.crawllog.cache.disabled.for = Crawllog caching disabled for
running.jobs.monitor.no.hosts.disable = No hosts disabled.
configure = Configure
## H3 labels
pagetitle;h3.remote.access = H3 Remote Access

0 comments on commit e5d7152

Please sign in to comment.