<?xml version="1.0"?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"> <jsp:directive.page import="java.util.*,com.perforce.api.*" contentType="text/html;charset=ISO-8859-1"/> <jsp:directive.include file="session.jsp"/> <jsp:declaration> public String getFileType(String file) { String lower = file.toLowerCase(); if (file.endsWith(".sh") || file.endsWith(".csh")) return "shellscript"; if (file.endsWith(".html") || file.endsWith(".htm")) return "html"; if (file.endsWith(".c")) return "source_c"; if (file.endsWith(".h")) return "source_h"; if (file.endsWith(".java")) return "source_java"; if (file.endsWith(".pl")) return "source_pl"; if (file.endsWith(".cpp")) return "source_cpp"; if (file.endsWith(".py")) return "source_py"; if (lower.endsWith("readme") || lower.endsWith("readme.txt")) return "readme"; if (file.endsWith(".txt")) return "txt"; if (file.endsWith(".tar")) return "tar"; if (file.endsWith(".tgz")) return "tgz"; if (file.endsWith(".deb") || file.endsWith("/debian/control") || file.endsWith("/debian/changelog") || file.endsWith("/debian/rules") || file.endsWith("/debian/postinst") || file.endsWith("/debian/preinst") || file.endsWith("/debian/postrm") || file.endsWith("/debian/prerm")) return "deb"; if (file.endsWith(".pdf")) return "pdf"; if (file.endsWith(".ps")) return "postscript"; if (lower.endsWith("makefile")) return "make"; if (file.endsWith(".png") || file.endsWith(".gif") || file.endsWith(".jpg") || file.endsWith(".bmp")) return "image"; if (file.endsWith(".wav") || file.endsWith(".mp3")) return "sound"; if (file.endsWith(".mpg") || file.endsWith(".avi")) return "video"; return "unknown"; } </jsp:declaration> <jsp:scriptlet>title="P4JSP Browser";</jsp:scriptlet> <jsp:text><HTML><HEAD> <jsp:directive.include file="head.jsp"/> </HEAD> <BODY bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"> <TABLE width="780" cellspacing="0" cellpadding="0" border="0"> <jsp:directive.include file="navbar.jsp"/> <TR><TD><TABLE width="100%" cellspacing="0" cellpadding="0" border="0"> <TR><TD width="21"><IMG src="images/s.gif" width="21" rowspan="10"/></TD><TD width="100%"> <H1>Browse:</H1> <PRE> <jsp:scriptlet> String path = request.getParameter("path"); if (null == path) path = "//"; if (!path.endsWith("/")) path += "/"; out.print("<BR/>"); DirEntry dir = new DirEntry(env, path); String[] dirs = dir.getDirNames(); int i; out.print("<TABLE>"); out.print("<TR><TD><IMG width=\"16\" height=\"16\" src=\"images/root.png\"/></TD>"); out.print("<TD><A href=\"browse.jsp\">// - all depots</A></TD></TR>"); out.print("<TR><TD/><TD colspan=\"3\">"+Utils.formatDepotPath(path, "<A href=\"browse.jsp?path={0}\">{1}</A>", null, null, true)+"</TD></TR>"); for (i = 0; i < dirs.length; i++) { out.print("<TR><TD><IMG width=\"16\" height=\"16\" src=\"images/folder.png\"/></TD>"); out.print("<TD><A href=\"browse.jsp?path="+path+dirs[i]+"\">"+dirs[i]+"</A></TD></TR>"); } FileEntry[] files = dir.getFiles(); FileEntry fent; if (0 < files.length) { </jsp:scriptlet> <TR><TH/><TH>File</TH><TH>Type</TH><TH>Rev</TH><TH>Action</TH><TH>Modtime</TH></TR> <jsp:scriptlet> } for (i = 0; i < files.length; i++) { fent = files[i]; fent.setTimeFormat("MM/dd/yy HH:mm"); out.print("<TR><TD><IMG width=\"16\" height=\"16\" src=\"images/"+getFileType(fent.getDepotPath())+".png\"/></TD>"); out.print("<TD><A href=\"file.jsp?path="+fent.getDepotPath()+"\">"+fent.getName()+"</A></TD>"); out.print("<TD>"+fent.getHeadType()+"</TD>"); out.print("<TD><A href=\"view.jsp?path="+URLEncoder.encode(fent.getDepotPath()+"#"+fent.getHeadRev())+"\">"+fent.getHeadRev()+"</A></TD>"); out.print("<TD>"); if (1 < fent.getHeadRev()) { out.print("<A href=\"diff.jsp?path="+URLEncoder.encode(fent.getDepotPath())+"&r1="+(fent.getHeadRev()-1)+"&r2="+fent.getHeadRev()+"\">"+fent.getHeadAction()+"</A>"); } else { out.print(fent.getHeadAction()); } out.print("</TD>"); out.print("<TD>"+fent.getHeadTimeString()+"</TD>"); out.print("</TR>"); } out.print("</TABLE>"); </jsp:scriptlet> </PRE> </TD></TR> </TABLE></TD></TR> </TABLE></BODY></HTML></jsp:text> </jsp:root>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 2206 | David Markley |
Removed all use of the common tag library and any specific inclusion of the crimson API. |
||
#5 | 2070 | David Markley | Updated to work with Tomcat 4.0.4 | ||
#4 | 1843 | David Markley | Added missing images and better ties to itself. | ||
#3 | 1842 | David Markley | Updated pages to include titles and added view and diff pages. | ||
#2 | 1836 | David Markley | Added file information and improved item listings. | ||
#1 | 1824 | David Markley | Added initial files for p4jsp. |