X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/fb2d5b78a90d3042f7eb5e8e419fcbe6e62fd00d..dfedb5880720a3927da6d01cfdfa1ac861cc286d:/doc/solr-conf/velocity/richtext-doc.vm?ds=sidebyside diff --git a/doc/solr-conf/velocity/richtext-doc.vm b/doc/solr-conf/velocity/richtext-doc.vm new file mode 100644 index 0000000..0336818 --- /dev/null +++ b/doc/solr-conf/velocity/richtext-doc.vm @@ -0,0 +1,52 @@ +#if($doc.getFieldValue('title')) + #set($title = $esc.html($doc.getFirstValue('title'))) +#else + #set($title = "["+$doc.getFieldValue('id')+"]") +#end +#if($doc.getFieldValue('url')) + #set($url = $doc.getFieldValue('url')) +#elseif($doc.getFieldValue('resourcename')) + #set($url = "file:///$doc.getFieldValue('resourcename')") +#else + #set($url = "$doc.getFieldValue('id')") +#end +#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)) +#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 +