() {{
- put("application/x-7z-compressed", "7z");
- put("application/postscript", "ai");
- put("application/pgp-signature", "asc");
- put("application/octet-stream", "bin");
- put("application/x-bzip2", "bz2");
- put("text/x-c", "c");
- put("application/vnd.ms-htmlhelp", "chm");
- put("application/java-vm", "class");
- put("text/css", "css");
- put("text/csv", "csv");
- put("application/x-debian-package", "deb");
- put("application/msword", "doc");
- put("message/rfc822", "eml");
- put("image/gif", "gif");
- put("application/winhlp", "hlp");
- put("text/html", "html");
- put("application/java-archive", "jar");
- put("text/x-java-source", "java");
- put("image/jpeg", "jpeg");
- put("application/javascript", "js");
- put("application/vnd.oasis.opendocument.chart", "odc");
- put("application/vnd.oasis.opendocument.formula", "odf");
- put("application/vnd.oasis.opendocument.graphics", "odg");
- put("application/vnd.oasis.opendocument.image", "odi");
- put("application/vnd.oasis.opendocument.presentation", "odp");
- put("application/vnd.oasis.opendocument.spreadsheet", "ods");
- put("application/vnd.oasis.opendocument.text", "odt");
- put("application/pdf", "pdf");
- put("application/pgp-encrypted", "pgp");
- put("image/png", "png");
- put("application/vnd.ms-powerpoint", "ppt");
- put("audio/x-pn-realaudio", "ram");
- put("application/x-rar-compressed", "rar");
- put("application/vnd.rn-realmedia", "rm");
- put("application/rtf", "rtf");
- put("application/x-shockwave-flash", "swf");
- put("application/vnd.sun.xml.calc", "sxc");
- put("application/vnd.sun.xml.draw", "sxd");
- put("application/vnd.sun.xml.impress", "sxi");
- put("application/vnd.sun.xml.writer", "sxw");
- put("application/x-tar", "tar");
- put("application/x-tex", "tex");
- put("text/plain", "txt");
- put("text/x-vcard", "vcf");
- put("application/vnd.visio", "vsd");
- put("audio/x-wav", "wav");
- put("audio/x-ms-wma", "wma");
- put("video/x-ms-wmv", "wmv");
- put("application/vnd.ms-excel", "xls");
- put("application/xml", "xml");
- put("application/x-xpinstall", "xpi");
- put("application/zip", "zip");
- }};
- context.put("mimeToExt", mimeToExt);
-
String layout_template = request.getParams().get("v.layout");
String json_wrapper = request.getParams().get("v.json");
boolean wrap_response = (layout_template != null) || (json_wrapper != null);
diff --git a/solr/example/solr/collection1/conf/velocity/richtext-doc.vm b/solr/example/solr/collection1/conf/velocity/richtext-doc.vm
index 0336818f4a6..ab18d72bf27 100644
--- a/solr/example/solr/collection1/conf/velocity/richtext-doc.vm
+++ b/solr/example/solr/collection1/conf/velocity/richtext-doc.vm
@@ -1,3 +1,59 @@
+## Mimetype to extension map for detecting file type and show icon
+## List of types match the icons in /solr/img/filetypes
+#set($extMap = {"application/x-7z-compressed": "7z",
+ "application/postscript": "ai",
+ "application/pgp-signature": "asc",
+ "application/octet-stream": "bin",
+ "application/x-bzip2": "bz2",
+ "text/x-c": "c",
+ "application/vnd.ms-htmlhelp": "chm",
+ "application/java-vm": "class",
+ "text/css": "css",
+ "text/csv": "csv",
+ "application/x-debian-package": "deb",
+ "application/msword": "doc",
+ "message/rfc822": "eml",
+ "image/gif": "gif",
+ "application/winhlp": "hlp",
+ "text/html": "html",
+ "application/java-archive": "jar",
+ "text/x-java-source": "java",
+ "image/jpeg": "jpeg",
+ "application/javascript": "js",
+ "application/vnd.oasis.opendocument.chart": "odc",
+ "application/vnd.oasis.opendocument.formula": "odf",
+ "application/vnd.oasis.opendocument.graphics": "odg",
+ "application/vnd.oasis.opendocument.image": "odi",
+ "application/vnd.oasis.opendocument.presentation": "odp",
+ "application/vnd.oasis.opendocument.spreadsheet": "ods",
+ "application/vnd.oasis.opendocument.text": "odt",
+ "application/pdf": "pdf",
+ "application/pgp-encrypted": "pgp",
+ "image/png": "png",
+ "application/vnd.ms-powerpoint": "ppt",
+ "audio/x-pn-realaudio": "ram",
+ "application/x-rar-compressed": "rar",
+ "application/vnd.rn-realmedia": "rm",
+ "application/rtf": "rtf",
+ "application/x-shockwave-flash": "swf",
+ "application/vnd.sun.xml.calc": "sxc",
+ "application/vnd.sun.xml.draw": "sxd",
+ "application/vnd.sun.xml.impress": "sxi",
+ "application/vnd.sun.xml.writer": "sxw",
+ "application/x-tar": "tar",
+ "application/x-tex": "tex",
+ "text/plain": "txt",
+ "text/x-vcard": "vcf",
+ "application/vnd.visio": "vsd",
+ "audio/x-wav": "wav",
+ "audio/x-ms-wma": "wma",
+ "video/x-ms-wmv": "wmv",
+ "application/vnd.ms-excel": "xls",
+ "application/xml": "xml",
+ "application/x-xpinstall": "xpi",
+ "application/zip": "zip"})
+
+
#if($doc.getFieldValue('title'))
#set($title = $esc.html($doc.getFirstValue('title')))
#else
@@ -13,10 +69,16 @@
#set($supportedtypes = "7z;ai;aiff;asc;audio;bin;bz2;c;cfc;cfm;chm;class;conf;cpp;cs;css;csv;deb;divx;doc;dot;eml;enc;file;gif;gz;hlp;htm;html;image;iso;jar;java;jpeg;jpg;js;lua;m;mm;mov;mp3;mpg;odc;odf;odg;odi;odp;ods;odt;ogg;pdf;pgp;php;pl;png;ppt;ps;py;ram;rar;rb;rm;rpm;rtf;sig;sql;swf;sxc;sxd;sxi;sxw;tar;tex;tgz;txt;vcf;video;vsd;wav;wma;wmv;xls;xml;xpi;xvid;zip")
#set($ct = $list.get($doc.getFirstValue('content_type').split(";"),0))
#set($filename = $doc.getFieldValue('resourcename'))
-#set($filetype = $mimeToExt.get($ct))
+
+#set($filetype = false)
+#set($filetype = $extMap.get($ct))
+##TODO: falling back to file extension is convenient, except when you don't have an icon for that extension
+## example "application/vnd.openxmlformats-officedocument.wordprocessingml.document" document
+## with a .docx extension. It'd be nice to fall back to an "unknown" or the existing "file" type
+## We sort of do this below, but only if the filename has no extension (anything after the last dot).
#if(!$filetype)#set($filetype = $filename.substring($filename.lastIndexOf(".")).substring(1))#end
-#if(!$filetype)#set($filetype = "file")#end
-#if(!$supportedtypes.contains($filetype))#set($filetype = "file")#end
+##if(!$filetype)#set($filetype = "file")#end
+##if(!$supportedtypes.contains($filetype))#set($filetype = "file")#end
## Small file type icons from http://www.splitbrain.org/projects/file_icons (public domain)
@@ -29,7 +91,7 @@
#if($ct) ($ct)#end
#if($doc.getFieldValue('author'))Author: #field('author')
#end
-#if($doc.getFieldValue('last_modified'))Last-modified: #field('last_modified')
#end
+#if($doc.getFieldValue('last_modified'))last-modified: #field('last_modified')
#end
#field('content')
#set($mlt = $mltResults.get($docId))
diff --git a/solr/licenses/velocity-1.6.4.jar.sha1 b/solr/licenses/velocity-1.6.4.jar.sha1
deleted file mode 100644
index f4d25f52242..00000000000
--- a/solr/licenses/velocity-1.6.4.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-fcc58693dd8fc83d714fba149789be37cc19b66d
diff --git a/solr/licenses/velocity-1.7.jar.sha1 b/solr/licenses/velocity-1.7.jar.sha1
new file mode 100644
index 00000000000..e522a852a0f
--- /dev/null
+++ b/solr/licenses/velocity-1.7.jar.sha1
@@ -0,0 +1 @@
+2ceb567b8f3f21118ecdec129fe1271dbc09aa7a