From 687b4f5f971c979d15099181b40d86b183632620 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Tue, 30 Apr 2013 18:07:57 +1200 Subject: [PATCH] NEW adding content method for compatibility with TextExtraction module --- code/DMSDocument.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 35e3e32..c09f091 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -944,5 +944,18 @@ class DMSDocument_Controller extends Controller { return $linkText; } + /** + * Get Content For FullTextSearch module (using Solr) */ + function getContent() { + if (class_exists('FileTextExtractor')) { + // Determine which extractor can process this file. + $extractor = FileTextExtractor::for_file($this->owner->FullPath); + if (!$extractor) return null; + + $text = $extractor->getContent($this->owner->FullPath); + return $text; + } + } + }