minor fixes related to path construction
authorSvjatoslav Agejenko <n0@n0-Aspire-8920.(none)>
Sun, 3 Feb 2013 12:25:54 +0000 (14:25 +0200)
committerSvjatoslav Agejenko <n0@n0-Aspire-8920.(none)>
Sun, 3 Feb 2013 12:25:54 +0000 (14:25 +0200)
src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java
src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java

index d4fd7e3..f659a35 100644 (file)
@@ -17,15 +17,17 @@ import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Picture;
 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);
        }
 
@@ -73,7 +75,7 @@ public class WebIndexer extends AbstractIndexer {
        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();
 
index c51d7fa..96f498e 100755 (executable)
@@ -166,7 +166,7 @@ public class MixedLayout implements Layout {
                                .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
@@ -174,7 +174,7 @@ public class MixedLayout implements Layout {
                                .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");
@@ -191,7 +191,7 @@ public class MixedLayout implements Layout {
                                                + "<b/>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                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");