From f02303793d83b29307255f1c2c5e435e4d15966b Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Tue, 30 Apr 2013 18:14:13 +1200 Subject: [PATCH] BUG moving new getContent method into DataObject, not Controller --- code/DMSDocument.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index c09f091..26398dc 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -802,6 +802,19 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { $file->delete(); } + /** + * 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; + } + } + } class DMSDocument_Controller extends Controller { @@ -944,18 +957,5 @@ 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; - } - } - }