private function buildCHMIndex()
 {
     $sourcePath = $this->book->getPagesSourcePath();
     $toc = $this->book->getStructureHolder()->getToc();
     $indexBuilder = new IndexBuilder($sourcePath, $toc);
     $myIndexRender = new IndexRender($indexBuilder, $this->book, null);
     $content = $myIndexRender->renderCHMIndex();
     file_put_contents($this->outputPath . $this->booKey . '.hhk', $content);
     echo "chm index built\n";
 }
 private function getContent($pathBuilder)
 {
     $templateClass = colesoApplication::getConfigVal('/bulldoc/textProcessingClass');
     $t = new $templateClass();
     $t->setOutputMode($this->book->getOutputMode());
     $fileName = $this->sourcePath . $pathBuilder;
     $params = array('root' => $pathBuilder->getRootPath(), 'path' => $pathBuilder, 'structure' => $this->structureHolder);
     $pageData = $this->structureHolder->getPage($pathBuilder);
     if ($pathBuilder->isIndex()) {
         $content = '';
         if (file_exists($fileName)) {
             $content .= $t->parseFile($fileName, $params);
         }
         $content .= $this->navTemplate->parseItem('toc', $this->buildIndex($pathBuilder));
         return $content;
     } elseif ($pageData['type'] == 'index') {
         $myIndexBuilder = new IndexBuilder($this->sourcePath, $this->structureHolder->getToc());
         $myIndexRender = new IndexRender($myIndexBuilder, $this->book, $this->themeManager);
         return $myIndexRender->render($pathBuilder);
     } elseif (file_exists($fileName)) {
         return $t->parseFile($fileName, $params);
     } else {
         return colesoApplication::getMessage('bulldoc', 'underconstruction');
     }
 }