diff --git a/plugins/ktstandard/contents/PowerpointIndexer.php b/plugins/ktstandard/contents/PowerpointIndexer.php new file mode 100644 index 0000000..6bf08b5 --- /dev/null +++ b/plugins/ktstandard/contents/PowerpointIndexer.php @@ -0,0 +1,30 @@ +oDocument = $oDocument; + } + + function transform() { + $oStorage = KTStorageManagerUtil::getSingleton(); + $sFile = $oStorage->temporaryFile($this->oDocument); + + $cmdline = array("catppt", $sFile); + $myfilename = tempnam("/tmp", "kt.catppt"); + $command = KTUtil::safeShellString($cmdline) . " >> " . $myfilename; + system($command); + $contents = file_get_contents($myfilename); + unlink($myfilename); + if (empty($contents)) { + return; + } + $aInsertValues = array( + 'document_id' => $this->oDocument->getId(), + 'document_text' => $contents, + ); + $sTable = KTUtil::getTableName('document_text'); + DBUtil::autoInsert($sTable, $aInsertValues, array('noid' => true)); + } +} + +?>