.setEnabled(false));
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class).setEnabled(false));
String rawUrl = RawServlet.asLink(getContextUrl(), repositoryName, objectId, blobPath);
add(new ExternalLink("rawLink", rawUrl));
add(new CommitHeaderPanel("commitHeader", objectId));
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));
Component c = new Label("blobText", JGitUtils.getStringContent(r, objectId, encodings));
WicketUtils.setCssClass(c, "plainprint");
add(c);
} else {
// standard blob view
String extension = null;
if (blobPath.lastIndexOf('.') > -1) {
extension = blobPath.substring(blobPath.lastIndexOf('.') + 1).toLowerCase();
}
// see if we should redirect to the doc page
MarkupProcessor processor = new MarkupProcessor(app().settings(), app().xssFilter());
for (String ext : processor.getMarkupExtensions()) {
if (ext.equals(extension)) {
setResponsePage(DocPage.class, params);
return;
}
}
RevCommit commit = getCommit();
// blob page links
add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
WicketUtils.newPathParameter(repositoryName, objectId, blobPath)));
add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
WicketUtils.newPathParameter(repositoryName, objectId, blobPath)));
String rawUrl = RawServlet.asLink(getContextUrl(), repositoryName, objectId, blobPath);
add(new ExternalLink("rawLink", rawUrl));
add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));
// Map the extensions to types
Map<String, Integer> map = new HashMap<String, Integer>();
for (String ext : app().settings().getStrings(Keys.web.prettyPrintExtensions)) {
map.put(ext.toLowerCase(), 1);