mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add support for new conversion service
This commit is contained in:
parent
6838c26c5f
commit
4e8bb56821
|
@ -31,6 +31,11 @@ class SeedDMS_FulltextService {
|
|||
*/
|
||||
protected $converters;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
protected $conversionmgr;
|
||||
|
||||
/**
|
||||
* Max file size for imediate indexing
|
||||
*/
|
||||
|
@ -43,6 +48,7 @@ class SeedDMS_FulltextService {
|
|||
public function __construct() {
|
||||
$this->services = array();
|
||||
$this->converters = array();
|
||||
$this->conversionmgr = null;
|
||||
$this->maxsize = 0;
|
||||
$this->index = null;
|
||||
$this->search = null;
|
||||
|
@ -57,6 +63,18 @@ class SeedDMS_FulltextService {
|
|||
$this->converters = $converters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set conversion service manager
|
||||
*
|
||||
* A conversion manager is a service for converting files from one format
|
||||
* to another format.
|
||||
*
|
||||
* @param object $conversionmgr
|
||||
*/
|
||||
function setConversionMgr($conversionmgr) { /* {{{ */
|
||||
$this->conversionmgr = $conversionmgr;
|
||||
} /* }}} */
|
||||
|
||||
public function setMaxSize($maxsize) {
|
||||
$this->maxsize = $maxsize;
|
||||
}
|
||||
|
@ -80,7 +98,7 @@ class SeedDMS_FulltextService {
|
|||
$nocontent = ($object->getLatestContent()->getFileSize() > $this->maxsize) && !$forceupdate;
|
||||
else
|
||||
$nocontent = true;
|
||||
return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $this->converters, $nocontent, $this->cmdtimeout);
|
||||
return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $this->conversionmgr ? $this->conversionmgr : $this->converters, $nocontent, $this->cmdtimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,4 +66,5 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
|
|||
}
|
||||
}
|
||||
|
||||
require_once("inc.ConversionInit.php");
|
||||
require_once('inc.FulltextInit.php');
|
||||
|
|
|
@ -42,6 +42,7 @@ if($settings->_enableFullSearch) {
|
|||
}
|
||||
}
|
||||
$fulltextservice->setConverters(isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null);
|
||||
$fulltextservice->setConversionMgr($conversionmgr);
|
||||
$fulltextservice->setMaxSize($settings->_maxSizeForFullText);
|
||||
$fulltextservice->setCmdTimeout($settings->_cmdTimeout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user