diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 81c1174dcf8..af56f70b89f 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -22,7 +22,27 @@ $Id$ ================== 5.0.0 ================== -(No changes) +Versions of Major Components +--------------------- +Apache Tika 1.2 +Carrot2 3.5.0 +Velocity 1.7 and Velocity Tools 2.0 +Apache UIMA 2.3.1 +Apache ZooKeeper 3.4.5 + +Upgrading from Solr 4.x +---------------------- + +TBD... + +Detailed Change List +---------------------- + +Other Changes +---------------------- + +* SOLR-3735: Relocate the example mime-to-extension mapping, and + upgrade Velocity Engine to 1.7 (ehatcher) ================== 4.1.0 ================== diff --git a/solr/contrib/velocity/ivy.xml b/solr/contrib/velocity/ivy.xml index 8bb470299dc..e907049cd99 100644 --- a/solr/contrib/velocity/ivy.xml +++ b/solr/contrib/velocity/ivy.xml @@ -21,7 +21,7 @@ - + diff --git a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java index 1b640359c8c..703e0af2ff9 100644 --- a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java +++ b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java @@ -30,8 +30,6 @@ import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.tools.generic.*; import java.io.*; -import java.util.HashMap; -import java.util.Map; import java.util.Properties; public class VelocityResponseWriter implements QueryResponseWriter { @@ -84,64 +82,6 @@ public class VelocityResponseWriter implements QueryResponseWriter { context.put("engine", engine); // for $engine.resourceExists(...) - // Mimetype to extension map for detecting file type and show icon - // List of types match the icons in /solr/img/filetypes - Map mimeToExt = new HashMap() {{ - 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