public class WebIndexer extends AbstractIndexer {
private final String globalPrefix;
+ private final String jspPath;
- public WebIndexer(final String globalPrefix) {
+ public WebIndexer(final String globalPrefix, final String jspPath) {
this.globalPrefix = globalPrefix;
+ this.jspPath = jspPath;
}
@Override
public String getDirectoryUrl(final AbstractFile directory,
final IndexingContext context) {
- return "photos.jsp?path=" + context.getLocalUrl() + "/"
+ return jspPath + context.getLocalUrl() + "/"
+ UrlParamEncoder.encode(directory.fileName);
}
public String getParentDirectoryUrl(final IndexingContext context) {
final StringBuffer result = new StringBuffer();
- result.append("photos.jsp?path=");
+ result.append(jspPath);
final List<String> components = context.getLocalPathComponents();
.append("<source type=\"video/ogg\" codecs=\"theora, vorbis\" src=\""
+ indexingContext.getGlobalUrl()
+ UrlParamEncoder.encode(indexingContext.getLocalUrl()
- + file.fileName) + "\">\n");
+ + "/" + file.fileName) + "\">\n");
filesHtml.append("</source>\n");
// if browser cannot play video directry, fall back to java Applet
.append("<applet code=\"com.fluendo.player.Cortado.class\" archive=\"http://theora.org/cortado.jar\" width=\"800\" height=\"600\">\n");
filesHtml.append(" <param name=\"url\" value=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl()
+ + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+ file.fileName) + "\"/>\n");
filesHtml.append(" <param name=\"keepAspect\" value=\"true\"/>\n");
filesHtml.append(" <param name=\"autoPlay\" value=\"false\"/>\n");
+ "<b/> ");
filesHtml.append("<a href=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl()
+ + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+ file.fileName) + "\">download as OGV</a>\n");
filesHtml.append("</TD></TR>\n");