set cmd to class name of conversion service

This commit is contained in:
Uwe Steinmann 2021-11-19 13:34:21 +01:00
parent bb10ff084b
commit be2de9cfc1
2 changed files with 6 additions and 3 deletions

View File

@ -182,11 +182,14 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
$mimetype = $version->getMimeType();
$this->mimetype = $mimetype;
if(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) {
if($convcmd->hasService($mimetype, 'text/plain')) {
if($service = $convcmd->getService($mimetype, 'text/plain')) {
$content = $convcmd->convert($path, $mimetype, 'text/plain');
if($content) {
self::setContent($content);
}
$this->cmd = get_class($service);
} else {
$this->cmd = 'No service to convert '.$mimetype.' to text/plain';
}
} else {
$content = '';

View File

@ -182,12 +182,12 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
$mimetype = $version->getMimeType();
$this->mimetype = $mimetype;
if(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) {
if($convcmd->hasService($mimetype, 'text/plain')) {
if($service = $convcmd->getService($mimetype, 'text/plain')) {
$content = $convcmd->convert($path, $mimetype, 'text/plain');
if($content) {
self::setContent($content);
}
$this->cmd = get_class($convcmd);
$this->cmd = get_class($service);
} else {
$this->cmd = 'No service to convert '.$mimetype.' to text/plain';
}