]> _ Git - cubeextranet.git/commitdiff
#1866
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 9 Jan 2018 14:44:17 +0000 (14:44 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 9 Jan 2018 14:44:17 +0000 (14:44 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.document.php

index 6d851b1af26dbe3853239912a5d83e950bdbbc1f..5f560cfc20ecb7fa6a0263f17d93710f8ddd50fd 100644 (file)
@@ -1117,10 +1117,11 @@ class wsMaintenance {
                        $fwstk->setPath(CONVERTER_PATH);
                        $fwstk->setArg('--input ' . $out . '/crop.pdf');
                        $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt');
+                       $fwstk->setArg('--extractTextsMethod ' .  $book->parametres->textExtraction);
                        if ($book->parametres->ignoreSearchSeparators != '') {
                                $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators);
                        }
-                       $fwstk->setArg('--threads 4');
+                       $fwstk->setArg('--threads 1');
                        $fwstk->execute();
 
                        $res = $fwstk->commande . "\n\n";
@@ -1539,6 +1540,13 @@ class wsMaintenance {
                exit;
        }
 
+       public static function installWescoVentes() {
+               $exporter = new wsExporter();
+               $exporter->export(15296, $x, 'install_ftp', 'online', "wescogrolj-catalogca:b9uA7U72eW@ftp.cluster023.hosting.ovh.net", '');
+               header('Location: http://www.wesco-group.com/download/Catalogues/2017/Wesco-Rapport-ventes-0-12-ans/');
+               exit;
+       }
+
        public static function fixStats($args) {
                commonDroits::min(5);
                $book = trim($args[0], ' .');
index 93eb9b5226490438267cba8cfede9f4a15c733fb..daf17d2069c050e9261a118092830667eabd39ff 100644 (file)
@@ -855,9 +855,10 @@ class wsDAOBook extends commonDAO {
                $prefix = '';
                if ($book->parametres->textExtraction == 'poppler') {
                        $prefix = 'p';
+               } else if ($book->parametres->textExtraction == 'fluidbook') {
+                       $prefix = 'f';
                }
 
-
                $dir = WS_BOOKS . '/index/' . $book->book_id;
                if ($book->parametres->ignoreSearchSeparators != '') {
                        $dir .= '/' . sha1($book->parametres->ignoreSearchSeparators);
@@ -893,6 +894,7 @@ class wsDAOBook extends commonDAO {
                                $fwstk->setPath(CONVERTER_PATH);
                                $fwstk->setArg('--input ' . $out . '/crop.pdf');
                                $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt');
+                               $fwstk->setArg('--extractTextsMethod ' . $book->parametres->textExtraction);
                                $fwstk->setArg('--threads 1');
                                $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators);
                                $fwstk->execute();
@@ -907,8 +909,18 @@ class wsDAOBook extends commonDAO {
 
                        if (!file_exists($tfile) || !file_exists($ifile)) {
                                $daoDoc = new wsDAODocument($core->con);
-                               $doc = $daoDoc->selectById($infos['document_id']);
-                               $doc->getLinksAndTexts();
+                               $out = wsDocument::getDir($infos['document_id']);
+
+                               $fwstk = new cubeCommandLine('fwstk.sh');
+                               $fwstk->setPath(CONVERTER_PATH);
+                               $fwstk->setArg('--input ' . $out . '/crop.pdf');
+                               $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt');
+                               $fwstk->setArg('--extractTextsMethod ' . $book->parametres->textExtraction);
+                               if ($book->parametres->ignoreSearchSeparators != '') {
+                                       $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators);
+                               }
+                               $fwstk->setArg('--threads 1');
+                               $fwstk->execute();
                        }
 
                        CubeIT_Util_Gzip::compressIfNotCompressed($tfile);
index 8dc5a5a3564a28228d55bc336135dede011a6005..54173bbb08c0a761c3053996ebb0f9f80594f805 100644 (file)
@@ -221,7 +221,8 @@ class wsBookParametres extends wsParametres {
                $this->fields['ignoreWordLimit'] = ['type' => 'integer', 'default' => 3, 'editable' => true, 'label' => __('Ignorer les mots de moins de X caractères')];
                $this->fields['textExtraction'] = array('type' => 'combo', 'default' => 'pdfbox', 'editable' => true, 'label' => __("Méthode d'extraction des textes"),
                                                        'datas' => array(__('PDFBox') => 'pdfbox',
-                                                                        __('Poppler') => 'poppler'));
+                                                                        __('Poppler') => 'poppler',
+                                                                        __('Fluidbook (expérimentation basée sur PDFBox)') => 'fluidbook'));
                $this->fields['searchShowNoResultsPages'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Afficher les pages sans résultats"));
                $this->fields['searchPageSelectionAlgorithm'] = array('type' => 'combo', 'editable' => true, 'default' => 'AND',
                                                                      'datas' => [__('les double-pages qui contiennent tous les mots recherchés (ET logique)') => 'AND', __('les double-page qui contiennent un des mots recherché (OU logique)') => 'OR'], 'label' => __('Algorithme de sélection des résultats'));
@@ -514,7 +515,7 @@ class wsBookParametres extends wsParametres {
                $this->fields['scorm_variables'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Variables SCORM'), 'grade' => 5, 'hint' => __('Laisser vide pour utiliser le titre de la publication'));
 
                $this->forms['scorm'] = array('label' => __('SCORM'),
-                                             'fieldsnames' => array('scorm_enable', 'scorm_id', 'scorm_org', 'scorm_title','scorm_variables'));
+                                             'fieldsnames' => array('scorm_enable', 'scorm_id', 'scorm_org', 'scorm_title', 'scorm_variables'));
        }
 
 }
index c3b347a48d35ae6ff6ead3887b28a18594787ddf..8dde71763886a484caec5c287f287113df6476fe 100644 (file)
@@ -280,7 +280,7 @@ class wsDocument extends cubeMetier {
                if ($this->CropAndCut()) {
                        $this->getInfos($this->cropped, true);
                }
-               $this->getLinksAndTexts();
+               $this->getLinks();
        }
 
        public function CropAndCut() {
@@ -342,11 +342,10 @@ class wsDocument extends cubeMetier {
                }
        }
 
-       public function getLinksAndTexts() {
+       public function getLinks() {
                $fwstk = new cubeCommandLine('fwstk.sh');
                $fwstk->setPath(CONVERTER_PATH);
                $fwstk->setArg('--input ' . $this->cropped);
-               $fwstk->setArg('--extractTexts ' . $this->out . '%s%d.txt');
                $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');
                $fwstk->setArg('--threads 1');
                $fwstk->execute();