]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 7 Dec 2012 14:24:01 +0000 (14:24 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 7 Dec 2012 14:24:01 +0000 (14:24 +0000)
fluidbook/tools/fwstk/lib/commons-io-2.4.jar [new file with mode: 0644]
fluidbook/tools/fwstk/nbproject/configs/Make_texts_indices.properties [new file with mode: 0644]
fluidbook/tools/fwstk/nbproject/private/config.properties
fluidbook/tools/fwstk/nbproject/private/configs/Make_texts_indices.properties [new file with mode: 0644]
fluidbook/tools/fwstk/nbproject/private/private.xml
fluidbook/tools/fwstk/nbproject/project.properties
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.document.php

diff --git a/fluidbook/tools/fwstk/lib/commons-io-2.4.jar b/fluidbook/tools/fwstk/lib/commons-io-2.4.jar
new file mode 100644 (file)
index 0000000..90035a4
Binary files /dev/null and b/fluidbook/tools/fwstk/lib/commons-io-2.4.jar differ
diff --git a/fluidbook/tools/fwstk/nbproject/configs/Make_texts_indices.properties b/fluidbook/tools/fwstk/nbproject/configs/Make_texts_indices.properties
new file mode 100644 (file)
index 0000000..259a5c6
--- /dev/null
@@ -0,0 +1 @@
+$label=Make texts indices\r
index 9d6df0f95eac7e0bed4af6b3fca67bc21f4bef06..65acd29973bd31002b49a458255a678ddb1900b5 100644 (file)
@@ -1 +1 @@
-config=Extract_texts\r
+config=Make_texts_indices\r
diff --git a/fluidbook/tools/fwstk/nbproject/private/configs/Make_texts_indices.properties b/fluidbook/tools/fwstk/nbproject/private/configs/Make_texts_indices.properties
new file mode 100644 (file)
index 0000000..8ef236f
--- /dev/null
@@ -0,0 +1 @@
+application.args=--makeTexts H:\\Documents\\fwstk\\mktexts\\%s10.txt\r
index 3a048af1e057cbbb598834d8fff6f350697fc0e4..4ffd82c2462382b8a9ccf59c15a3ee79930199c7 100644 (file)
@@ -2,13 +2,4 @@
 <project-private xmlns="http://www.netbeans.org/ns/project-private/1">\r
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>\r
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>\r
-    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/Main.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/cube/util/Array.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/layout/Word.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/layout/LayoutStripper.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/CustomStripper.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/TextsThread.java</file>\r
-        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/Link.java</file>\r
-    </open-files>\r
 </project-private>\r
index 1d69fd6264e888ec11375e3eda039e25e9b6d13c..0a8e12808efc954a12470535c714e5a73025993c 100644 (file)
@@ -30,6 +30,7 @@ excludes=
 file.reference.avalon-framework-4.1.4.jar=lib/avalon-framework-4.1.4.jar\r
 file.reference.bcmail-jdk16-146.jar=lib/bcmail-jdk16-146.jar\r
 file.reference.bcprov-jdk16-146.jar=lib/bcprov-jdk16-146.jar\r
+file.reference.commons-io-2.4.jar=lib\\commons-io-2.4.jar\r
 file.reference.commons-logging-1.1.1.jar=lib/commons-logging-1.1.1.jar\r
 file.reference.fontbox-1.7.1.jar=lib\\fontbox-1.7.1.jar\r
 file.reference.FWSTK_Resources.jar=../FWSTK_Resources/dist/FWSTK_Resources.jar\r
@@ -51,7 +52,8 @@ javac.classpath=\
     ${file.reference.fontbox-1.7.1.jar}:\\r
     ${file.reference.jempbox-1.7.1.jar}:\\r
     ${file.reference.pdfbox-1.7.1.jar}:\\r
-    ${file.reference.icu4j-50_1.jar}\r
+    ${file.reference.icu4j-50_1.jar}:\\r
+    ${file.reference.commons-io-2.4.jar}\r
 # Space-separated list of extra javac options\r
 javac.compilerargs=\r
 javac.deprecation=false\r
index cf31c311b334d9987e31b7c1503ca4ca1c0df19a..ee216bcf2d2aed497666f236025d3f4a961d3021 100644 (file)
@@ -691,6 +691,12 @@ class wsDAOBook extends commonDAO {
 \r
        public function makeTextsIndexes($book, $pages, &$index, &$textes) {\r
 \r
+               $prefix = '';\r
+               if ($book->parametres->textExtraction == 'poppler') {\r
+                       $prefix = 'p';\r
+               }\r
+\r
+\r
                $dir = WS_BOOKS . '/index/' . $book->book_id;\r
                if ($book->parametres->ignoreSearchSeparators != '') {\r
                        $dir.='/' . sha1($book->parametres->ignoreSearchSeparators);\r
@@ -699,8 +705,8 @@ class wsDAOBook extends commonDAO {
                        mkdir($dir, 0777, true);\r
                }\r
 \r
-               $ifilec = $dir . '/index.json';\r
-               $tfilec = $dir . '/textes.json';\r
+               $ifilec = $dir . '/' . $prefix . 'index.json';\r
+               $tfilec = $dir . '/' . $prefix . 'textes.json';\r
 \r
                if (file_exists($ifilec) && file_exists($tfilec) && (min(filemtime($ifilec), filemtime($tfilec)) >= $book->composition_update)) {\r
                        $index = file_get_contents($ifilec);\r
@@ -730,8 +736,8 @@ class wsDAOBook extends commonDAO {
                $index = array();\r
                $textes = array();\r
                foreach ($pages as $book_page => $infos) {\r
-                       $tfile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.txt';\r
-                       $ifile = WS_DOCS . '/' . $infos['document_id'] . '/i' . $infos['document_page'] . '.txt';\r
+                       $tfile = WS_DOCS . '/' . $infos['document_id'] . '/' . $prefix . 'p' . $infos['document_page'] . '.txt';\r
+                       $ifile = WS_DOCS . '/' . $infos['document_id'] . '/' . $prefix . 'i' . $infos['document_page'] . '.txt';\r
                        $text = file_get_contents($tfile);\r
                        $ipage = file_get_contents($ifile);\r
 \r
index fb316ef1f9035727d0119fdaac8294c1004df51a..1beb811cfae00231701d7f5827c90bdce2718ccf 100644 (file)
@@ -123,8 +123,12 @@ class wsBookParametres extends wsParametres {
                $this->fields['ignoreSearch'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Mots à ignorer'),\r
                        'hint' => __('Liste des mots à ignorer séparés par des virgules'), 'grade' => 5);\r
                $this->fields['ignoreSearchSeparators'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Caractères à ne pas considérer comme un séparateur de mot'));\r
+               $this->fields['textExtraction'] = array('type' => 'combo', 'default' => 'pdfbox', 'editable' => true, 'label' => __("Méthode d'extraction des textes"),\r
+                       'datas' => array(__('PDFBox') => 'pdfbox',\r
+                               __('Poppler') => 'poppler'));\r
+\r
                $this->forms['search'] = array('label' => __('Moteur de recherche'),\r
-                       'fieldsnames' => array('search', 'ignoreSearch', 'ignoreSearchSeparators'));\r
+                       'fieldsnames' => array('search', 'ignoreSearch', 'ignoreSearchSeparators', 'textExtraction'));\r
 \r
                $this->fields['soundTheme'] = array('type' => 'combo', 'default' => 'classic', 'editable' => true, 'label' => __("Thème sonore"),\r
                        'datas' => array(__('Pas de son') => '',\r
index da911fd70f2384278835228a14fa0604eff63168..0daec3afd77722073f83cc4edb2d4d5c4f068cf1 100644 (file)
@@ -892,13 +892,13 @@ class wsDocument extends cubeMetier {
                }\r
 \r
                if (is_null($page)) {\r
-                       $pointer = gzopen($this->log . '/commons.log.gz', 'ab');\r
+                       $pointer = fopen($this->log . '/commons.log', 'ab');\r
                } else {\r
-                       $pointer = gzopen($this->log . '/p' . $page . '.log.gz', 'ab');\r
+                       $pointer = fopen($this->log . '/p' . $page . '.log', 'ab');\r
                }\r
 \r
-               gzwrite($pointer, $c);\r
-               gzclose($pointer);\r
+               fwrite($pointer, $c);\r
+               fclose($pointer);\r
        }\r
 \r
        public function __destruct() {\r