From: vincent@cubedesigners.com Date: Thu, 6 Jan 2011 13:11:19 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b678c5514d14738ab667d59344accd39f85d0f21;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.conversion.session.php b/inc/ws/Controlleur/class.ws.conversion.session.php index cace59595..cda50adcb 100644 --- a/inc/ws/Controlleur/class.ws.conversion.session.php +++ b/inc/ws/Controlleur/class.ws.conversion.session.php @@ -66,20 +66,28 @@ class wsConversionSession { trigger_error(count($this->documents)); foreach($this->documents as $doc) { - $this->currentDoc = $doc; - $this->serialize(); - $this->currentDoc->globalOperations(); - $this->updateCountPages(); - $this->currentDoc = $dao->updateFromObject($this->currentDoc); - if ($this->documentsPages[$doc->document_id] == 'all') { $docPages = range(1, $doc->generalInfos['pages']); + $range = null; + $onlyTexts = false; } else { $docPages = $this->documentsPages[$doc->document_id]; + $range = array(); + foreach($docPages as $p) { + $range[] = $p; + } + $range = implode(',', $range); + $onlyTexts = true; } - foreach($docPages as $i=>$page) { - $this->currentDocPage = $i+1; + $this->currentDoc = $doc; + $this->serialize(); + $this->currentDoc->globalOperations($range, $onlyTexts); + $this->updateCountPages(); + $this->currentDoc = $dao->updateFromObject($this->currentDoc); + + foreach($docPages as $i => $page) { + $this->currentDocPage = $i + 1; $this->totalDocPage = count($docPages); $this->setProgress(($this->processedPages / $this->totalPages) * 100); $this->currentDoc->processOnePage($page, false); diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index e36cd5e80..ffffb63bd 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -102,6 +102,32 @@ class wsFlash extends cubeFlashGateway { } } + public function processConversionSessionAsync() + { + cubePHP::neverStop(); + try { + $conversion = wsConversionSession::openFromGUID($_POST['sessionConversionGUID']); + $conversion->process(); + } + catch(Exception $e) { + file_put_contents(CACHE . '/conversionExceptions.txt', print_r($e, true), FILE_APPEND); + } + $conversion->destroy(); + } + + public function getConversionSessionProgress() + { + set_time_limit(1); + $session = wsConversionSession::openFromGUID($_SESSION['sessionConversionGUID']); + $p = $session->getProgress(); + $this->xml->addChild('progress', $p['progress']); + $this->xml->addChild('processedDoc', $p['processedDoc']); + $this->xml->addChild('totalDoc', $p['totalDoc']); + $this->xml->addChild('currentDoc', $p['currentDoc']); + $this->xml->addChild('currentDocPage', $p['currentDocPage']); + $this->xml->addChild('totalDocPage', $p['totalDocPage']); + } + public function uploadThemeFile() { foreach($_FILES as $varname => $infos) { @@ -204,6 +230,10 @@ class wsFlash extends cubeFlashGateway { $pa->addAttribute('document_page', $info['document_page']); $pa->addAttribute('width', $dim[0]); $pa->addAttribute('height', $dim[1]); + $pa->addAttribute('resolution', $info['resolution']); + $pa->addAttribute('quality', $info['quality']); + $pa->addAttribute('methode', $info['method']); + $pa->addAttribute('objects', $info['objects']); $docs[] = $info['document_id']; $defaultNum[] = $info['defaultNum']; } @@ -216,32 +246,6 @@ class wsFlash extends cubeFlashGateway { } } - public function processConversionSessionAsync() - { - cubePHP::neverStop(); - try { - $conversion = wsConversionSession::openFromGUID($_POST['sessionConversionGUID']); - $conversion->process(); - } - catch(Exception $e) { - file_put_contents(CACHE . '/conversionExceptions.txt', print_r($e, true), FILE_APPEND); - } - $conversion->destroy(); - } - - public function getConversionSessionProgress() - { - set_time_limit(1); - $session = wsConversionSession::openFromGUID($_SESSION['sessionConversionGUID']); - $p = $session->getProgress(); - $this->xml->addChild('progress', $p['progress']); - $this->xml->addChild('processedDoc', $p['processedDoc']); - $this->xml->addChild('totalDoc', $p['totalDoc']); - $this->xml->addChild('currentDoc', $p['currentDoc']); - $this->xml->addChild('currentDocPage', $p['currentDocPage']); - $this->xml->addChild('totalDocPage', $p['totalDocPage']); - } - public function getTheme() { global $core; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 0afe5c99c..42b6b191d 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -161,10 +161,14 @@ class wsDAOBook extends extranetDAO { public function getPagesOfBook($book_id) { $pages = array(); - $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 = $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'); while ($r->fetch()) { $n = explode(',', $r->num); - $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); + if ($r->conversion != '') { + $c = unserialize($r->conversion); + $c = $c->pages[$r->document_page]; + } + $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); } return $pages; } @@ -462,11 +466,10 @@ class wsDAOBook extends extranetDAO { $twords = explode("\n", trim($ipage)); foreach($twords as $woadata) { - list($woa, $worddata) = explode(',', trim($woadata)); list($total, $wordslist) = explode("\t", $worddata, 2); - if($woa==''){ + if ($woa == '') { continue; } @@ -513,8 +516,7 @@ class wsDAOBook extends extranetDAO { */ public function compile3($book_id, $complete) { - //cubePHP::neverStop(); - + // cubePHP::neverStop(); $filesToCopy = array(); $finalDir = WS_BOOKS . '/final/' . $book_id . '/'; $workingDir = WS_BOOKS . '/working/' . $book_id . '/'; @@ -546,22 +548,22 @@ class wsDAOBook extends extranetDAO { $flex = new cubeFlexCompiler('FluidbookDatas', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH); $flexLight = new cubeFlexCompiler('FluidbookDatasLight', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH); - $flex->addVariable('links', $book->links,false,true,'JSONObject'); - $flex->addVariable('signature', $exportSignature,false,true,'JSONObject'); - $flexLight->addVariable('datas', $book->parametres->toStandardObject(),false,true,'JSONObject'); + $flex->addVariable('links', $book->links, false, true, 'JSONObject'); + $flex->addVariable('signature', $exportSignature, false, true, 'JSONObject'); + $flexLight->addVariable('datas', $book->parametres->toStandardObject(), false, true, 'JSONObject'); $flexLight->addVariable('id', $book_id, false, true, 'uint'); - $flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions),false,true,'JSONObject'); - $flex->addVariable('chapters', $book->chapters,false,true,'JSONObject'); + $flex->addVariable('traductions', wsLang::getTraductionWithId($book->traductions), false, true, 'JSONObject'); + $flex->addVariable('chapters', $book->chapters, false, true, 'JSONObject'); $flex->addVariable('extras', '' . $book->extras . '', false, true, 'XML'); $flex->addVariable('numerotation', $book->numerotation, false, true, 'String'); - $flexLight->addVariable('theme', $theme->parametres->toStandardObject(),false,true,'JSONObject'); + $flexLight->addVariable('theme', $theme->parametres->toStandardObject(), false, true, 'JSONObject'); $flexLight->addVariable('pages', count($pages)); $flexLight->addVariable('fwidth', round($size[0]), false, true, 'Number'); $flexLight->addVariable('fheight', round($size[1]), false, true, 'Number'); $flexLight->addVariable('pagesInDatas', $complete, false, true, 'Boolean'); - $flex->addVariable('index', $index,false,true,'JSONObject'); - $flex->addVariable('textes', $textes,false,true,'JSONObject'); + $flex->addVariable('index', $index, false, true, 'JSONObject'); + $flex->addVariable('textes', $textes, false, true, 'JSONObject'); foreach($pages as $i => $infos) { $swffile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf'; if ($i == 1) { diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 48c60cc6a..3959590c9 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -214,13 +214,13 @@ class wsDocument extends cubeMetier { return $this->generalInfos['pages']; } - public function globalOperations() + public function globalOperations($range = null, $onlyTexts = false) { $this->getInfos(); if ($this->CropAndCut()) { $this->getInfos($this->cropped, true); } - $this->getLinksAndTexts(); + $this->getLinksAndTexts($range, $onlyTexts); } public function CropAndCut() @@ -291,20 +291,25 @@ class wsDocument extends cubeMetier { } } - public function processRange($range) + public function processRange($pages) { foreach($pages as $i) { $this->processOnePage($i); } } - public function getLinksAndTexts() + public function getLinksAndTexts($range, $onlyTexts = false) { $fwstk = new cubeCommandLine('fwstk'); $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'); + if (!$onlyTexts) { + $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv'); + } + if (!is_null($range)) { + $fwstk->setArg('--range ' . $range); + } $fwstk->execute(); $this->addToLog($fwstk); @@ -334,7 +339,7 @@ class wsDocument extends cubeMetier { public function makeMiniShot($page) { - $this->makeShotFixedWidth($page, 'p', 200, 90, 4, 'GS'); + $this->makeShotFixedWidth($page, 'p', 100, 90, 4, 'GS'); } public function makeRealShot($page) @@ -759,7 +764,6 @@ disablelinks Disable links. fwrite($pointer, $c); } - public function __destruct() { if (isset($this->common_log_pointer) && is_resource($this->common_log_pointer)) { diff --git a/swf/_src/assets/picto_informations.png b/swf/_src/assets/picto_informations.png new file mode 100644 index 000000000..12cd1aef9 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 index 000000000..f3fbed0dc 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 index 000000000..f07f449a4 Binary files /dev/null and b/swf/_src/assets/picto_logs_page.png differ diff --git a/swf/_src/composerLibrary.swc b/swf/_src/composerLibrary.swc index 029669f9d..4f5fe67be 100644 Binary files a/swf/_src/composerLibrary.swc and b/swf/_src/composerLibrary.swc differ diff --git a/swf/_src/wsComposerLibrary.fla b/swf/_src/wsComposerLibrary.fla index c5fb39ccd..73c9fec24 100644 Binary files a/swf/_src/wsComposerLibrary.fla and b/swf/_src/wsComposerLibrary.fla differ