2015-08-10 11:35:59 -04:00
|
|
|
|
2015-05-21 21:23:27 -04:00
|
|
|
#set($docId = $doc.getFirstValue($request.schema.uniqueKeyField.name))
|
|
|
|
|
|
|
|
## Load Mime-Type List and Mapping
|
|
|
|
#parse('mime_type_lists.vm')
|
|
|
|
|
|
|
|
## Title
|
|
|
|
#if($doc.getFieldValue('title'))
|
|
|
|
#set($title = $esc.html($doc.getFirstValue('title')))
|
|
|
|
#else
|
|
|
|
#set($title = "$doc.getFirstValue('id').substring($math.add(1,$doc.getFirstValue('id').lastIndexOf('/')))")
|
|
|
|
#end
|
|
|
|
|
2015-08-10 11:35:59 -04:00
|
|
|
## Date
|
|
|
|
#if($doc.getFieldValue('attr_meta_creation_date'))
|
|
|
|
#set($date = $esc.html($doc.getFirstValue('attr_meta_creation_date')))
|
|
|
|
#else
|
|
|
|
#set($date = "No date found")
|
|
|
|
#end
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-21 21:23:27 -04:00
|
|
|
## URL
|
|
|
|
#if($doc.getFieldValue('url'))
|
|
|
|
#set($url = $doc.getFieldValue('url'))
|
|
|
|
#elseif($doc.getFieldValue('resourcename'))
|
|
|
|
#set($url = "file:///$doc.getFirstValue('resourcename')")
|
|
|
|
#else
|
|
|
|
#set($url = "$doc.getFieldValue('id')")
|
|
|
|
#end
|
|
|
|
|
|
|
|
## Sort out Mime-Type
|
|
|
|
#set($ct = $list.get($doc.getFirstValue('content_type').split(";"),0))
|
|
|
|
#set($filename = $doc.getFirstValue('resourcename'))
|
|
|
|
#set($filetype = false)
|
|
|
|
#set($filetype = $mimeExtensionsMap.get($ct))
|
|
|
|
#if(!$filetype)
|
|
|
|
#set($filetype = $filename.substring($filename.lastIndexOf(".")).substring(1))
|
|
|
|
#end
|
|
|
|
#if(!$filetype)
|
|
|
|
#set($filetype = "file")
|
|
|
|
#end
|
|
|
|
#if(!$supportedMimeTypes.contains($filetype))
|
|
|
|
#set($filetype = "file")
|
|
|
|
#end
|
|
|
|
|
|
|
|
<div class="result-document">
|
|
|
|
<span class="result-title">
|
|
|
|
<img src="#{url_root}/img/filetypes/${filetype}.png" align="center">
|
|
|
|
<b>$title</b>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div>
|
2015-08-10 11:35:59 -04:00
|
|
|
id: $docId </br>
|
2015-05-21 21:23:27 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
#set($pad = "")
|
|
|
|
#foreach($v in $response.response.highlighting.get($docId).get("content"))
|
2015-06-07 15:24:48 -04:00
|
|
|
$pad$esc.html($v).replace("HL_START","<em>").replace("HL_END","</em>")
|
2015-05-21 21:23:27 -04:00
|
|
|
#set($pad = " ... ")
|
|
|
|
#end
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<a href="#" class="debug" onclick='jQuery(this).next().toggle(); return false;'>toggle explain</a>
|
|
|
|
<pre style="display: none;">
|
|
|
|
$esc.html($response.getExplainMap().get($doc.getFirstValue('id')))
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<a href="#" class="debug" onclick='jQuery(this).next().toggle(); return false;'>show all fields</a>
|
|
|
|
<pre style="display:none;">
|
|
|
|
#foreach($fieldname in $doc.fieldNames)
|
|
|
|
<span>$fieldname :</span>
|
|
|
|
<span>#foreach($value in $doc.getFieldValues($fieldname))$esc.html($value)#end</span>
|
|
|
|
#end
|
|
|
|
</pre>
|
2015-08-10 11:35:59 -04:00
|
|
|
|