From dd06badb5909a061c35da8bae4b4b7aa2c6cc988 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 24 Jan 2014 15:53:54 +0000 Subject: [PATCH] --- fluidbook/tools/FWSTK_Resources/build.xml | 3 +- .../FWSTK_Resources/nbproject/build-impl.xml | 589 ++++++++++++++---- .../nbproject/genfiles.properties | 8 +- .../nbproject/private/private.properties | 2 +- .../nbproject/private/private.xml | 6 +- .../tools/fwstk/nbproject/build-impl.xml | 11 +- .../tools/fwstk/nbproject/genfiles.properties | 4 +- .../fwstk/nbproject/private/config.properties | 2 +- .../private/configs/Extract_texts.properties | 2 +- .../tools/fwstk/nbproject/private/private.xml | 5 +- inc/ws/Controlleur/class.ws.maintenance.php | 24 +- inc/ws/DAO/class.ws.dao.book.php | 1 + inc/ws/Metier/class.ws.document.php | 1 + 13 files changed, 526 insertions(+), 132 deletions(-) diff --git a/fluidbook/tools/FWSTK_Resources/build.xml b/fluidbook/tools/FWSTK_Resources/build.xml index 9491597e0..f12672826 100644 --- a/fluidbook/tools/FWSTK_Resources/build.xml +++ b/fluidbook/tools/FWSTK_Resources/build.xml @@ -51,8 +51,7 @@ -init-macrodef-junit: defines macro for junit execution -init-macrodef-debug: defines macro for class debugging -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) + -do-jar: JAR building run: execution of project -javadoc-build: Javadoc generation test-report: JUnit report generation diff --git a/fluidbook/tools/FWSTK_Resources/nbproject/build-impl.xml b/fluidbook/tools/FWSTK_Resources/nbproject/build-impl.xml index 1683df74b..aa5c322c1 100644 --- a/fluidbook/tools/FWSTK_Resources/nbproject/build-impl.xml +++ b/fluidbook/tools/FWSTK_Resources/nbproject/build-impl.xml @@ -12,18 +12,18 @@ is divided into following sections: - execution - debugging - javadoc - - junit compilation - - junit execution - - junit debugging + - test compilation + - test execution + - test debugging - applet - cleanup --> - + - + @@ -79,6 +79,7 @@ is divided into following sections: + @@ -96,10 +97,11 @@ is divided into following sections: - + - - + + + @@ -116,12 +118,6 @@ is divided into following sections: - - - - - - @@ -140,24 +136,12 @@ is divided into following sections: - + - + - - - - - - - - - - - - @@ -181,6 +165,7 @@ is divided into following sections: + @@ -210,7 +195,15 @@ is divided into following sections: - + + + + + + + + + @@ -223,7 +216,29 @@ is divided into following sections: + + + + + + + + + + + + + + + + + + + + + + @@ -277,6 +292,7 @@ is divided into following sections: + @@ -316,6 +332,7 @@ is divided into following sections: + @@ -356,11 +373,57 @@ is divided into following sections: - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -368,33 +431,277 @@ is divided into following sections: + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -409,6 +716,7 @@ is divided into following sections: + @@ -425,10 +733,13 @@ is divided into following sections: - + Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + @@ -486,6 +797,7 @@ is divided into following sections: + @@ -502,6 +814,7 @@ is divided into following sections: + @@ -509,6 +822,7 @@ is divided into following sections: + @@ -535,12 +849,15 @@ is divided into following sections: + + + - - + + @@ -552,7 +869,7 @@ is divided into following sections: - + @@ -580,7 +897,7 @@ is divided into following sections: - + - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - java -cp "${run.classpath.with.dist.jar}" ${main.class} - - + - + - + - + + + + + + @@ -710,23 +1011,41 @@ is divided into following sections: - + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" - + + + + + + + + + + + + + + + + + - + + - + + - + + + This target only works when run from inside the NetBeans IDE. @@ -804,8 +1127,9 @@ is divided into following sections: - + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. @@ -813,12 +1137,8 @@ is divided into following sections: - - + + This target only works when run from inside the NetBeans IDE. @@ -830,12 +1150,8 @@ is divided into following sections: - - + + This target only works when run from inside the NetBeans IDE. @@ -857,6 +1173,42 @@ is divided into following sections: + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + @@ -875,6 +1235,7 @@ is divided into following sections: + @@ -891,7 +1252,7 @@ is divided into following sections: @@ -934,14 +1295,14 @@ is divided into following sections: - + Some tests failed; see details above. @@ -954,39 +1315,40 @@ is divided into following sections: Must select some files in the IDE or set test.includes - + Some tests failed; see details above. + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + - + Must select one file in the IDE or set test.class - - - - - - - - - - - - - - - + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + @@ -1051,9 +1413,12 @@ is divided into following sections: - - - + + + + + + diff --git a/fluidbook/tools/FWSTK_Resources/nbproject/genfiles.properties b/fluidbook/tools/FWSTK_Resources/nbproject/genfiles.properties index 6242e3a15..08b596a72 100644 --- a/fluidbook/tools/FWSTK_Resources/nbproject/genfiles.properties +++ b/fluidbook/tools/FWSTK_Resources/nbproject/genfiles.properties @@ -1,8 +1,8 @@ build.xml.data.CRC32=2ca38d56 -build.xml.script.CRC32=a4d12ab0 -build.xml.stylesheet.CRC32=28e38971@1.44.1.45 +build.xml.script.CRC32=36c3b32a +build.xml.stylesheet.CRC32=8064a381@1.68.1.46 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=2ca38d56 -nbproject/build-impl.xml.script.CRC32=accc921f -nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45 +nbproject/build-impl.xml.script.CRC32=54d9b89d +nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46 diff --git a/fluidbook/tools/FWSTK_Resources/nbproject/private/private.properties b/fluidbook/tools/FWSTK_Resources/nbproject/private/private.properties index 5b986322c..54afe752e 100644 --- a/fluidbook/tools/FWSTK_Resources/nbproject/private/private.properties +++ b/fluidbook/tools/FWSTK_Resources/nbproject/private/private.properties @@ -1,2 +1,2 @@ compile.on.save=true -user.properties.file=C:\\Users\\Cube\\.netbeans\\7.0\\build.properties +user.properties.file=H:\\Applications\\Roaming\\Netbeans\\7.4\\user\\build.properties diff --git a/fluidbook/tools/FWSTK_Resources/nbproject/private/private.xml b/fluidbook/tools/FWSTK_Resources/nbproject/private/private.xml index 6c4cdc21b..dcca50e20 100644 --- a/fluidbook/tools/FWSTK_Resources/nbproject/private/private.xml +++ b/fluidbook/tools/FWSTK_Resources/nbproject/private/private.xml @@ -2,9 +2,7 @@ - - file:/H:/Works/extranet/fluidbook/tools/FWSTK_Resources/src/org/apache/pdfbox/resources/cmap/Add-RKSJ-V - file:/H:/Works/extranet/fluidbook/tools/FWSTK_Resources/src/org/apache/pdfbox/resources/cmap/Identity-H - file:/H:/Works/extranet/fluidbook/tools/FWSTK_Resources/src/org/apache/pdfbox/resources/cmap/UniKS-UCS2-V + + diff --git a/fluidbook/tools/fwstk/nbproject/build-impl.xml b/fluidbook/tools/fwstk/nbproject/build-impl.xml index bc9e7a52c..3ce365776 100644 --- a/fluidbook/tools/fwstk/nbproject/build-impl.xml +++ b/fluidbook/tools/fwstk/nbproject/build-impl.xml @@ -193,7 +193,12 @@ is divided into following sections: - + + + + + + @@ -839,7 +844,7 @@ is divided into following sections: - + @@ -851,7 +856,7 @@ is divided into following sections: - + diff --git a/fluidbook/tools/fwstk/nbproject/genfiles.properties b/fluidbook/tools/fwstk/nbproject/genfiles.properties index 0b4dfa4d0..111fd3fa1 100644 --- a/fluidbook/tools/fwstk/nbproject/genfiles.properties +++ b/fluidbook/tools/fwstk/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.68.1.46 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=75d32fc3 -nbproject/build-impl.xml.script.CRC32=e1985bd5 -nbproject/build-impl.xml.stylesheet.CRC32=cdba79fa@1.68.1.46 +nbproject/build-impl.xml.script.CRC32=773be4cd +nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46 diff --git a/fluidbook/tools/fwstk/nbproject/private/config.properties b/fluidbook/tools/fwstk/nbproject/private/config.properties index 5aa2fea7b..9d6df0f95 100644 --- a/fluidbook/tools/fwstk/nbproject/private/config.properties +++ b/fluidbook/tools/fwstk/nbproject/private/config.properties @@ -1 +1 @@ -config=Extract_Links +config=Extract_texts diff --git a/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties b/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties index 1d3c1d34e..ffa17a714 100644 --- a/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties +++ b/fluidbook/tools/fwstk/nbproject/private/configs/Extract_texts.properties @@ -1 +1 @@ -application.args=--input H:\\Documents\\fwstk\\texts\\document.pdf --extractTexts H:\\Documents\\fwstk\\texts\\%s%d.txt +application.args=--input H:\\Documents\\fwstk\\texts\\document.pdf --extractTexts H:\\Documents\\fwstk\\texts\\%s%d.txt --threads 1 diff --git a/fluidbook/tools/fwstk/nbproject/private/private.xml b/fluidbook/tools/fwstk/nbproject/private/private.xml index dcca50e20..226920c84 100644 --- a/fluidbook/tools/fwstk/nbproject/private/private.xml +++ b/fluidbook/tools/fwstk/nbproject/private/private.xml @@ -3,6 +3,9 @@ - + + file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/Main.java + file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/TextsThread.java + diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 801a72dbd..7f10c3985 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -842,7 +842,7 @@ class wsMaintenance { $dao->setLinksAndRulers($book_id, json_encode($newlinks), json_encode($rulers), 'Offset links positions (' . $direction . ' :: ' . $value . ')', $core->user->utilisateur_id); } - public function extractTexts($args) { + public static function extractTexts($args) { global $core; $book_id = $args[0]; $dao = new wsDAOBook($core->con); @@ -865,7 +865,29 @@ class wsMaintenance { if ($book->parametres->ignoreSearchSeparators != '') { $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators); } + $fwstk->setArg('--threads 1'); $fwstk->execute(); + fb($fwstk->commande); + fb($fwstk->output); + } + + $dir = WS_BOOKS . '/index/' . $book->book_id; + if ($book->parametres->ignoreSearchSeparators != '') { + $dir.='/' . sha1($book->parametres->ignoreSearchSeparators); + } + + $prefixes = array('', 'p'); + foreach ($prefixes as $prefix) { + $ifilec = $dir . '/' . $prefix . 'index.json'; + $tfilec = $dir . '/' . $prefix . 'textes.json'; + + $files = array($ifilec, $tfilec); + + foreach ($files as $f) { + if (file_exists($f)) { + unlink($f); + } + } } } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 0c8549e76..d9c58b96d 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -837,6 +837,7 @@ class wsDAOBook extends commonDAO { $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $out . '/crop.pdf'); $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt'); + $fwstk->setArg('--threads 1'); $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators); $fwstk->execute(); } diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 3bdd425e7..a951cdc24 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -353,6 +353,7 @@ class wsDocument extends cubeMetier { $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(); $this->addToLog($fwstk); -- 2.39.5