list.jsp revision 59b6a8c0cc6ef741a7180504b3c371e67c2aa338
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoCDDL HEADER START
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoThe contents of this file are subject to the terms of the
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoCommon Development and Distribution License (the "License").
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoYou may not use this file except in compliance with the License.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoSee LICENSE.txt included in this distribution for the specific
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscolanguage governing permissions and limitations under the License.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoWhen distributing Covered Code, include this CDDL HEADER in each
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscofile and include the License file at LICENSE.txt.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoIf applicable, add the following below this CDDL HEADER, with the
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscofields enclosed by brackets "[]" replaced with your own identifying
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscoinformation: Portions Copyright [yyyy] [name of copyright owner]
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoCDDL HEADER END
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders HatlenCopyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos KoscoPortions Copyright 2011 Jens Elkner.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco--%><%@page import="
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscoorg.opensolaris.opengrok.analysis.FileAnalyzer.Genre,
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Koscoorg.opensolaris.opengrok.analysis.FileAnalyzerFactory,
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen // need to set it here since requesting parameters
bfc104f8240fac5b59d4347db4c27be705f6dfc2Knut Anders Hatlen if (request.getCharacterEncoding() == null) {
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen Annotation annotation = cfg.getAnnotation();
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen if (annotation != null) {
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen cfg.addHeaderData("<style type=\"text/css\">"
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen + ".blame .r { width: " + (r == 0 ? 6 : r) + "ex; } "
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen + ".blame .a { width: " + (a == 0 ? 6 : a) + "ex; } "
4750e1be4c1b2ba11705d5b73b86dd1b9dd4e1acKnut Anders Hatlen + "</style>");
50203181d8c071cfd69cb197b5da0eda5c4d6372Jens Elkner%><script type="text/javascript">/* <![CDATA[ */
50203181d8c071cfd69cb197b5da0eda5c4d6372Jens Elknerdocument.pageReady.push(function() { pageReadyList();});
c6e0f8b39af7343c04ec7558a085c965159f4ea0Lubos Kosco/* ]]> */</script>
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco/* ---------------------- list.jsp start --------------------- */
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco cfg = PageConfig.get(request);
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco File resourceFile = cfg.getResourceFile();
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco String path = cfg.getPath();
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco String basename = resourceFile.getName();
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco String rawPath = request.getContextPath() + Prefix.RAW_P + path;
817883e9f0d419428e8236a09b77cdeeaa034df7Knut Anders Hatlen Reader r = null;
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco // valid resource is requested
817883e9f0d419428e8236a09b77cdeeaa034df7Knut Anders Hatlen // mast.jsp assures, that resourceFile is valid and not /
b645988bdc1cf4f2f82b8c00ed041ddddd822c24Lubos Kosco Project activeProject = Project.getProject(resourceFile);
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco String cookieValue = cfg.getRequestedProjectsAsString();
Set<String> projects = cfg.getRequestedProjects();
cookieValue = cookieValue.length() == 0
: activeProject.getDescription() + '/' + cookieValue;
// TODO hmmm, projects.jspf doesn't set a path
response.addCookie(cookie);
DirectoryListing dl = new DirectoryListing(cfg.getEftarReader());
List<String> files = cfg.getResourceFileList();
if (!files.isEmpty()) {
List<String> readMes = dl.listTo(resourceFile, out, path, files);
File[] catfiles = cfg.findDataFiles(readMes);
for (int i=0; i < catfiles.length; i++) {
%><h3><%= readMes.get(i) %></h3>
Util.dump(out, catfiles[i], catfiles[i].getName().endsWith(".gz"));
} else if (rev.length() != 0) {
FileAnalyzerFactory a = AnalyzerGuru.find(basename);
Genre g = AnalyzerGuru.getGenre(a);
in = HistoryGuru.getInstance()
error = e.getMessage();
a = AnalyzerGuru.find(in);
g = AnalyzerGuru.getGenre(a);
rev.substring(2) %></span>
if (g == Genre.PLAIN) {
Annotation annotation = cfg.getAnnotation();
//annotation.writeTooltipMap(out);
AnalyzerGuru.writeXref(a, r, out, defs,
annotation, Project.getProject(resourceFile));
} else if (g == Genre.IMAGE) {
} else if (g == Genre.HTML) {
Util.dump(out, r);
error = e.getMessage();
try { r.close(); in = null;}
try { in.close(); }
} else if (g == Genre.IMAGE) {
if (!cfg.annotate()) {
xrefFile = cfg.findDataFile();
FileAnalyzerFactory a = AnalyzerGuru.find(basename);
Genre g = AnalyzerGuru.getGenre(a);
a = AnalyzerGuru.find(bin);
g = AnalyzerGuru.getGenre(a);
if (g == Genre.IMAGE) {
} else if ( g == Genre.HTML) {
Util.dump(out, r);
} else if (g == Genre.PLAIN) {
Definitions defs = IndexDatabase.getDefinitions(resourceFile);
Annotation annotation = cfg.getAnnotation();
AnalyzerGuru.writeXref(a, r, out, defs, annotation,
Project.getProject(resourceFile));
try { r.close(); bin = null; }
try { bin.close(); }
/* ---------------------- list.jsp end --------------------- */
include file="foot.jspf"