list.jsp revision d8371503c60e1f6933455e25b1cc47e4858a3a43
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeCDDL HEADER START
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeThe contents of this file are subject to the terms of the
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeCommon Development and Distribution License (the "License").
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeYou may not use this file except in compliance with the License.
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeSee LICENSE.txt included in this distribution for the specific
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyelanguage governing permissions and limitations under the License.
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeWhen distributing Covered Code, include this CDDL HEADER in each
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyefile and include the License file at LICENSE.txt.
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeIf applicable, add the following below this CDDL HEADER, with the
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyefields enclosed by brackets "[]" replaced with your own identifying
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyeinformation: Portions Copyright [yyyy] [name of copyright owner]
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeCDDL HEADER END
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyeCopyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond NorbyePortions Copyright 2011 Jens Elkner.
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye--%><%@page import="
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyeorg.opensolaris.opengrok.analysis.FileAnalyzer.Genre,
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyeorg.opensolaris.opengrok.analysis.FileAnalyzerFactory,
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye // need to set it here since requesting parameters
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye cfg = PageConfig.get(request);
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye Annotation annotation = cfg.getAnnotation();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye if (annotation != null) {
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye + ".blame .r { width: " + (r == 0 ? 6 : r) + "ex; } "
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye + ".blame .a { width: " + (a == 0 ? 6 : a) + "ex; } "
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye + "</style>");
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye%><script type="text/javascript">/* <![CDATA[ */
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbyedocument.pageReady.push(function() { pageReadyList();});
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye/* ]]> */</script>
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye/* ---------------------- list.jsp start --------------------- */
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye cfg = PageConfig.get(request);
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye File resourceFile = cfg.getResourceFile();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye String path = cfg.getPath();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye String basename = resourceFile.getName();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye String rawPath = request.getContextPath() + Prefix.DOWNLOAD_P + path;
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye Reader r = null;
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye // valid resource is requested
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye // mast.jsp assures, that resourceFile is valid and not /
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye Project activeProject = Project.getProject(resourceFile);
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye String cookieValue = cfg.getRequestedProjectsAsString();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye if (activeProject != null) {
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye Set<String> projects = cfg.getRequestedProjects();
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye if (!projects.contains(activeProject.getDescription())) {
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye // update cookie
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye cookieValue = cookieValue.length() == 0
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye : activeProject.getDescription() + '/' + cookieValue;
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye Cookie cookie = new Cookie("OpenGrokProject", cookieValue);
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye // TODO hmmm, projects.jspf doesn't set a path
96c1ae30d032621b47c4ac375b151ddaef5f1507Trond Norbye cookie.setPath(request.getContextPath() + '/');
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"