]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 6 Jan 2011 13:11:19 +0000 (13:11 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 6 Jan 2011 13:11:19 +0000 (13:11 +0000)
inc/ws/Controlleur/class.ws.conversion.session.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.document.php
swf/_src/assets/picto_informations.png [new file with mode: 0644]
swf/_src/assets/picto_logs_document.png [new file with mode: 0644]
swf/_src/assets/picto_logs_page.png [new file with mode: 0644]
swf/_src/composerLibrary.swc
swf/_src/wsComposerLibrary.fla

index cace59595b22e4a2bec708459ddefceba443a802..cda50adcbc7429616f23f40826eaf5b745d34499 100644 (file)
@@ -66,20 +66,28 @@ class wsConversionSession {
                trigger_error(count($this->documents));\r
 \r
                foreach($this->documents as $doc) {\r
-                       $this->currentDoc = $doc;\r
-                       $this->serialize();\r
-                       $this->currentDoc->globalOperations();\r
-                       $this->updateCountPages();\r
-                       $this->currentDoc = $dao->updateFromObject($this->currentDoc);\r
-\r
                        if ($this->documentsPages[$doc->document_id] == 'all') {\r
                                $docPages = range(1, $doc->generalInfos['pages']);\r
+                               $range = null;\r
+                               $onlyTexts = false;\r
                        } else {\r
                                $docPages = $this->documentsPages[$doc->document_id];\r
+                               $range = array();\r
+                               foreach($docPages as $p) {\r
+                                       $range[] = $p;\r
+                               }\r
+                               $range = implode(',', $range);\r
+                               $onlyTexts = true;\r
                        }\r
 \r
-                       foreach($docPages as $i=>$page) {\r
-                               $this->currentDocPage = $i+1;\r
+                       $this->currentDoc = $doc;\r
+                       $this->serialize();\r
+                       $this->currentDoc->globalOperations($range, $onlyTexts);\r
+                       $this->updateCountPages();\r
+                       $this->currentDoc = $dao->updateFromObject($this->currentDoc);\r
+\r
+                       foreach($docPages as $i => $page) {\r
+                               $this->currentDocPage = $i + 1;\r
                                $this->totalDocPage = count($docPages);\r
                                $this->setProgress(($this->processedPages / $this->totalPages) * 100);\r
                                $this->currentDoc->processOnePage($page, false);\r
index e36cd5e809362a8acbdc3e7b9ed9aa6d249c6523..ffffb63bd16dd9b5dba37a79e852fc5510eaac1a 100644 (file)
@@ -102,6 +102,32 @@ class wsFlash extends cubeFlashGateway {
                }\r
        }\r
 \r
+       public function processConversionSessionAsync()\r
+       {\r
+               cubePHP::neverStop();\r
+               try {\r
+                       $conversion = wsConversionSession::openFromGUID($_POST['sessionConversionGUID']);\r
+                       $conversion->process();\r
+               }\r
+               catch(Exception $e) {\r
+                       file_put_contents(CACHE . '/conversionExceptions.txt', print_r($e, true), FILE_APPEND);\r
+               }\r
+               $conversion->destroy();\r
+       }\r
+\r
+       public function getConversionSessionProgress()\r
+       {\r
+               set_time_limit(1);\r
+               $session = wsConversionSession::openFromGUID($_SESSION['sessionConversionGUID']);\r
+               $p = $session->getProgress();\r
+               $this->xml->addChild('progress', $p['progress']);\r
+               $this->xml->addChild('processedDoc', $p['processedDoc']);\r
+               $this->xml->addChild('totalDoc', $p['totalDoc']);\r
+               $this->xml->addChild('currentDoc', $p['currentDoc']);\r
+               $this->xml->addChild('currentDocPage', $p['currentDocPage']);\r
+               $this->xml->addChild('totalDocPage', $p['totalDocPage']);\r
+       }\r
+\r
        public function uploadThemeFile()\r
        {\r
                foreach($_FILES as $varname => $infos) {\r
@@ -204,6 +230,10 @@ class wsFlash extends cubeFlashGateway {
                        $pa->addAttribute('document_page', $info['document_page']);\r
                        $pa->addAttribute('width', $dim[0]);\r
                        $pa->addAttribute('height', $dim[1]);\r
+                       $pa->addAttribute('resolution', $info['resolution']);\r
+                       $pa->addAttribute('quality', $info['quality']);\r
+                       $pa->addAttribute('methode', $info['method']);\r
+                       $pa->addAttribute('objects', $info['objects']);\r
                        $docs[] = $info['document_id'];\r
                        $defaultNum[] = $info['defaultNum'];\r
                }\r
@@ -216,32 +246,6 @@ class wsFlash extends cubeFlashGateway {
                }\r
        }\r
 \r
-       public function processConversionSessionAsync()\r
-       {\r
-               cubePHP::neverStop();\r
-               try {\r
-                       $conversion = wsConversionSession::openFromGUID($_POST['sessionConversionGUID']);\r
-                       $conversion->process();\r
-               }\r
-               catch(Exception $e) {\r
-                       file_put_contents(CACHE . '/conversionExceptions.txt', print_r($e, true), FILE_APPEND);\r
-               }\r
-               $conversion->destroy();\r
-       }\r
-\r
-       public function getConversionSessionProgress()\r
-       {\r
-               set_time_limit(1);\r
-               $session = wsConversionSession::openFromGUID($_SESSION['sessionConversionGUID']);\r
-               $p = $session->getProgress();\r
-               $this->xml->addChild('progress', $p['progress']);\r
-               $this->xml->addChild('processedDoc', $p['processedDoc']);\r
-               $this->xml->addChild('totalDoc', $p['totalDoc']);\r
-               $this->xml->addChild('currentDoc', $p['currentDoc']);\r
-               $this->xml->addChild('currentDocPage', $p['currentDocPage']);\r
-               $this->xml->addChild('totalDocPage', $p['totalDocPage']);\r
-       }\r
-\r
        public function getTheme()\r
        {\r
                global $core;\r
index 0afe5c99c72516fa8e76316a4f7799ef3a3a73ce..42b6b191d090834ebee4a5700ce03c45dc83a554 100644 (file)
@@ -161,10 +161,14 @@ class wsDAOBook extends extranetDAO {
        public function getPagesOfBook($book_id)\r
        {\r
                $pages = array();\r
-               $r = $this->con->select('SELECT b.*,d.numberSections AS num,d.pages AS doc_pages FROM book_pages b LEFT JOIN documents d ON d.document_id=b.document_id WHERE b.book_id=\'' . $this->con->escape($book_id) . '\' ORDER BY book_page');\r
+               $r = $this->con->select('SELECT b.*,d.numberSections AS num,d.conversionInfos AS conversion,d.pages AS doc_pages FROM book_pages b LEFT JOIN documents d ON d.document_id=b.document_id WHERE b.book_id=\'' . $this->con->escape($book_id) . '\' ORDER BY book_page');\r
                while ($r->fetch()) {\r
                        $n = explode(',', $r->num);\r
-                       $pages[$r->book_page] = array('document_id' => $r->document_id, 'document_page' => $r->document_page, 'defaultNum' => $n[$r->document_page-1], 'nb_pages' => $r->doc_pages);\r
+                       if ($r->conversion != '') {\r
+                               $c = unserialize($r->conversion);\r
+                               $c = $c->pages[$r->document_page];\r
+                       }\r
+                       $pages[$r->book_page] = array('document_id' => $r->document_id, 'document_page' => $r->document_page, 'defaultNum' => $n[$r->document_page-1], 'nb_pages' => $r->doc_pages, 'resolution' => $c->resolution, 'quality' => $c->quality, 'method' => $c->method, 'objects' => $c->objects);\r
                }\r
                return $pages;\r
        }\r
@@ -462,11 +466,10 @@ class wsDAOBook extends extranetDAO {
                $twords = explode("\n", trim($ipage));\r
 \r
                foreach($twords as $woadata) {\r
-\r
                        list($woa, $worddata) = explode(',', trim($woadata));\r
                        list($total, $wordslist) = explode("\t", $worddata, 2);\r
 \r
-                       if($woa==''){\r
+                       if ($woa == '') {\r
                                continue;\r
                        }\r
 \r
@@ -513,8 +516,7 @@ class wsDAOBook extends extranetDAO {
         */\r
        public function compile3($book_id, $complete)\r
        {\r
-               //cubePHP::neverStop();\r
-\r
+               // cubePHP::neverStop();\r
                $filesToCopy = array();\r
                $finalDir = WS_BOOKS . '/final/' . $book_id . '/';\r
                $workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
@@ -546,22 +548,22 @@ class wsDAOBook extends extranetDAO {
 \r
                $flex = new cubeFlexCompiler('FluidbookDatas', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH);\r
                $flexLight = new cubeFlexCompiler('FluidbookDatasLight', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH);\r
-               $flex->addVariable('links', $book->links,false,true,'JSONObject');\r
-               $flex->addVariable('signature', $exportSignature,false,true,'JSONObject');\r
-               $flexLight->addVariable('datas', $book->parametres->toStandardObject(),false,true,'JSONObject');\r
+               $flex->addVariable('links', $book->links, false, true, 'JSONObject');\r
+               $flex->addVariable('signature', $exportSignature, false, true, 'JSONObject');\r
+               $flexLight->addVariable('datas', $book->parametres->toStandardObject(), false, true, 'JSONObject');\r
                $flexLight->addVariable('id', $book_id, false, true, 'uint');\r
 \r
-               $flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions),false,true,'JSONObject');\r
-               $flex->addVariable('chapters', $book->chapters,false,true,'JSONObject');\r
+               $flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions), false, true, 'JSONObject');\r
+               $flex->addVariable('chapters', $book->chapters, false, true, 'JSONObject');\r
                $flex->addVariable('extras', '<extras>' . $book->extras . '</extras>', false, true, 'XML');\r
                $flex->addVariable('numerotation', $book->numerotation, false, true, 'String');\r
-               $flexLight->addVariable('theme', $theme->parametres->toStandardObject(),false,true,'JSONObject');\r
+               $flexLight->addVariable('theme', $theme->parametres->toStandardObject(), false, true, 'JSONObject');\r
                $flexLight->addVariable('pages', count($pages));\r
                $flexLight->addVariable('fwidth', round($size[0]), false, true, 'Number');\r
                $flexLight->addVariable('fheight', round($size[1]), false, true, 'Number');\r
                $flexLight->addVariable('pagesInDatas', $complete, false, true, 'Boolean');\r
-               $flex->addVariable('index', $index,false,true,'JSONObject');\r
-               $flex->addVariable('textes', $textes,false,true,'JSONObject');\r
+               $flex->addVariable('index', $index, false, true, 'JSONObject');\r
+               $flex->addVariable('textes', $textes, false, true, 'JSONObject');\r
                foreach($pages as $i => $infos) {\r
                        $swffile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf';\r
                        if ($i == 1) {\r
index 48c60cc6a099618a5a4894b9158be04a4b752307..3959590c9872aa46b81d3ba24d380c9ad8fc2c14 100644 (file)
@@ -214,13 +214,13 @@ class wsDocument extends cubeMetier {
                return $this->generalInfos['pages'];\r
        }\r
 \r
-       public function globalOperations()\r
+       public function globalOperations($range = null, $onlyTexts = false)\r
        {\r
                $this->getInfos();\r
                if ($this->CropAndCut()) {\r
                        $this->getInfos($this->cropped, true);\r
                }\r
-               $this->getLinksAndTexts();\r
+               $this->getLinksAndTexts($range, $onlyTexts);\r
        }\r
 \r
        public function CropAndCut()\r
@@ -291,20 +291,25 @@ class wsDocument extends cubeMetier {
                }\r
        }\r
 \r
-       public function processRange($range)\r
+       public function processRange($pages)\r
        {\r
                foreach($pages as $i) {\r
                        $this->processOnePage($i);\r
                }\r
        }\r
 \r
-       public function getLinksAndTexts()\r
+       public function getLinksAndTexts($range, $onlyTexts = false)\r
        {\r
                $fwstk = new cubeCommandLine('fwstk');\r
                $fwstk->setPath(CONVERTER_PATH);\r
                $fwstk->setArg('--input ' . $this->cropped);\r
                $fwstk->setArg('--extractTexts ' . $this->out . '%s%d.txt');\r
-               $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');\r
+               if (!$onlyTexts) {\r
+                       $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');\r
+               }\r
+               if (!is_null($range)) {\r
+                       $fwstk->setArg('--range ' . $range);\r
+               }\r
                $fwstk->execute();\r
                $this->addToLog($fwstk);\r
 \r
@@ -334,7 +339,7 @@ class wsDocument extends cubeMetier {
 \r
        public function makeMiniShot($page)\r
        {\r
-               $this->makeShotFixedWidth($page, 'p', 200, 90, 4, 'GS');\r
+               $this->makeShotFixedWidth($page, 'p', 100, 90, 4, 'GS');\r
        }\r
 \r
        public function makeRealShot($page)\r
@@ -759,7 +764,6 @@ disablelinks                Disable links.
                fwrite($pointer, $c);\r
        }\r
 \r
-\r
        public function __destruct()\r
        {\r
                if (isset($this->common_log_pointer) && is_resource($this->common_log_pointer)) {\r
diff --git a/swf/_src/assets/picto_informations.png b/swf/_src/assets/picto_informations.png
new file mode 100644 (file)
index 0000000..12cd1ae
Binary files /dev/null and b/swf/_src/assets/picto_informations.png differ
diff --git a/swf/_src/assets/picto_logs_document.png b/swf/_src/assets/picto_logs_document.png
new file mode 100644 (file)
index 0000000..f3fbed0
Binary files /dev/null and b/swf/_src/assets/picto_logs_document.png differ
diff --git a/swf/_src/assets/picto_logs_page.png b/swf/_src/assets/picto_logs_page.png
new file mode 100644 (file)
index 0000000..f07f449
Binary files /dev/null and b/swf/_src/assets/picto_logs_page.png differ
index 029669f9d6f4d3a9c1a6aad6e0f0917f51087783..4f5fe67be6317136b6e84ce2cc98833bcd07cd84 100644 (file)
Binary files a/swf/_src/composerLibrary.swc and b/swf/_src/composerLibrary.swc differ
index c5fb39ccd2ce10b2d25b63c638919be2193816af..73c9fec24cf02384818c50d5891acb70fa360f9c 100644 (file)
Binary files a/swf/_src/wsComposerLibrary.fla and b/swf/_src/wsComposerLibrary.fla differ