]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 16 Oct 2011 03:47:16 +0000 (03:47 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 16 Oct 2011 03:47:16 +0000 (03:47 +0000)
fluidbook/tools/fwstk/nbproject/private/private.properties
inc/config.inc.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/packager/_common.php

index c85e5f3f2e1a01c3d61bf97f79be5499643ed027..75eb4042cfe9916c9d015a70e633193825e04eb6 100644 (file)
@@ -4,4 +4,4 @@ do.depend=false
 do.jar=true\r
 javac.debug=true\r
 javadoc.preview=true\r
-user.properties.file=C:\\Users\\Vincent\\.netbeans\\7.0\\build.properties\r
+user.properties.file=C:\\Users\\Cube\\.netbeans\\7.0\\build.properties\r
index 9a9b95671140f03d75a3fd93ad505227bf485218..6fb0f412207a9a86dca79a70c8a4d64059f5c838 100644 (file)
@@ -14,6 +14,7 @@ define('CONVERTER_PATH', '/bin:/usr/bin:/usr/local/bin:/home/extranet/www/fluidb
 define('MXMLC_PATH', '/usr/local/flex/bin/mxmlc');\r
 define('MXMLC_PATH_3', '/usr/local/flex_sdk_3.6/bin/mxmlc');\r
 define('AS3_SOURCES', '/home/ws/sources/as3');\r
+define('AS3_FLUIDBOOK_SOURCES', '/home/ws/sources/fluidbook');\r
 \r
 define('MONITOR_PERFS', true);\r
 \r
@@ -32,7 +33,7 @@ define('WS_CACHE', WS_FILES . '/cache');
 define('WS_COMPILE_ASSETS', WS_FILES . '/compile');\r
 define('WS_SOUNDS', WS_FILES . '/sounds');\r
 define('WS_TOOLS', WS_FILES . '/tools');\r
-define('WS_SHM','/dev/shm');\r
+define('WS_SHM', '/dev/shm');\r
 \r
 define('WORKER_PREFIX', 'worker.');\r
 \r
index fdddd347e1e5bcaed04877b13c9154d29df6c861..9b2ad9027805ff6df1c0c6c20bc0be29a77e3df9 100644 (file)
@@ -917,6 +917,22 @@ html{height:100%}' . "\n";
                exit;\r
        }\r
 \r
+       public static function testAIR($args) {\r
+               global $core;\r
+               commonDroits::min(5);\r
+               if (!isset($args[1])) {\r
+                       $args[1] = 2964;\r
+               }\r
+               self::checkDocumentVersionOfBook($args[1]);\r
+               cubePHP::neverStop();\r
+               $dao = new wsDAOBook($core->con);\r
+\r
+               header('Content-type: text/plain');\r
+               ob_end_clean();\r
+               echo $dao->compileAIR($args[1]);\r
+               exit;\r
+       }\r
+\r
        public static function testLinksCSV($args) {\r
                global $core;\r
                commonDroits::min(5);\r
index 1bac59d515ca16214541add71d105b29e6235182..f9e74551d383270d6ebf24173b93a4bd63efbee9 100644 (file)
@@ -673,24 +673,99 @@ class wsDAOBook extends commonDAO {
                $this->touchCompile($book_id);\r
        }\r
 \r
-       /**\r
-        * wsDAOBook::compile3()\r
-        *\r
-        * @param mixed $book_id\r
-        * @param mixed $complete\r
-        * @return\r
-        */\r
        public function compile3($book_id, $complete) {\r
-               cubePHP::neverStop();\r
-               $filesToCopy = array();\r
-               $finalDir = WS_BOOKS . '/final/' . $book_id . '/';\r
-               $workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
+               $res = '';\r
+\r
                $compilerDir = WS_BOOKS . '/datasCompiler/' . $book_id . '/';\r
+               $finalDir = WS_BOOKS . '/final/' . $book_id . '/';\r
+\r
+               $book = $this->selectById($book_id);\r
+               $pages = $this->getPagesOfBook($book_id);\r
+\r
+               $flex = new cubeFlexCompiler('FluidbookDatas', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH, 10);\r
+               $flexLight = new cubeFlexCompiler('FluidbookDatasLight', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH, 10);\r
+\r
+               $filesToCopy = array();\r
+\r
+               $this->compileFlex($book_id, $complete, $compilerDir, $finalDir, $filesToCopy, $book, $pages, $flex, $flexLight);\r
+\r
+               $flexLight->addVariable('checksum', $hash, false, true, 'String');\r
+               $res .= $flex->compile() . "\n\n-------------------\n\n";\r
+               $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf'));\r
+               $res .= $flexLight->compile();\r
+\r
+               $filesToCopy['data/fd.swf'] = $compilerDir . '/FluidbookDatas.swf';\r
+               $filesToCopy['data/fdl.swf'] = $compilerDir . '/FluidbookDatasLight.swf';\r
+               // Copy of files\r
+               // Check if dest dir exists\r
+               if (!file_exists($finalDir . 'data')) {\r
+                       mkdir($finalDir . 'data', 0777, true);\r
+               }\r
+               // Check working dir\r
+               if (file_exists($workingDir)) {\r
+                       $dr = opendir($workingDir);\r
+                       while ($file = readdir($dr)) {\r
+                               if ($file == '.' || $file == '..') {\r
+                                       continue;\r
+                               }\r
+                               $filesToCopy['data/' . $file] = $workingDir . '/' . $file;\r
+                       }\r
+               }\r
+\r
+               foreach ($filesToCopy as $local => $source) {\r
+                       $localPath = $finalDir . $local;\r
+                       // if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
+                       if (is_dir($source)) {\r
+                               continue;\r
+                       }\r
+                       copy($source, $localPath);\r
+                       // }\r
+               }\r
+\r
+               $this->compilePDF($book, $pages);\r
+               $this->indexPDF($book, $pages);\r
+               $this->compileHTML5($book_id);\r
+               $this->compileWidget($book, $pages);\r
+\r
+               $this->touchCompile($book_id);\r
+\r
+               return $res;\r
+       }\r
+\r
+       public function compileAir($book_id) {\r
+               $compilerDir = WS_BOOKS . '/air/' . $book_id . '/compiler';\r
+               $finalDir = WS_BOOKS . '/air/' . $book_id . '/';\r
 \r
-               $res = '';\r
                $book = $this->selectById($book_id);\r
                $pages = $this->getPagesOfBook($book_id);\r
 \r
+               $src = AS3_FLUIDBOOK_SOURCES . '/_src/';\r
+               $lib10 = AS3_FLUIDBOOK_SOURCES . '/lib10/';\r
+               $libs = array(\r
+                       $src,\r
+                       $lib10,\r
+                       AS3_SOURCES,\r
+                       $src . 'lib/fluidbook3dLibrary.swc',\r
+                       $src . 'lib/mdm.swc',\r
+                       $lib10 . 'flash.swc',\r
+                       $lib10 . 'flex.swc',\r
+                       $lib10 . 'framework.swc',\r
+               );\r
+               $flex = new cubeFlexCompiler('FluidbookAirProjector' . $book_id, $compilerDir, 'com.fluidbook.player.AIRMain', $libs, '/usr/local/flex_sdk_4.5/bin/mxmlc', 'air', 45,800,600,true);\r
+\r
+               $this->compileFlex($book_id, true, $compilerDir, $finalDir, $filesToCopy, $book, $pages, $flex, $flex);\r
+\r
+               return $flex->compile();\r
+       }\r
+\r
+       public function compileFlex($book_id, $complete, $compilerDir, $finalDir, &$filesToCopy, $book, $pages, $flex, $flexLight) {\r
+               cubePHP::neverStop();\r
+\r
+\r
+               $workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
+\r
+               $res = '';\r
+\r
                $daoDoc = new wsDAODocument($this->con);\r
                $firstDoc = $daoDoc->selectById($pages[1]['document_id']);\r
                $size = $firstDoc->generalInfos['size'];\r
@@ -722,8 +797,6 @@ class wsDAOBook extends commonDAO {
                $this->makeTextsIndexes($book_id, $index, $textes);\r
                $daoDoc->getLinksAndRulers($book_id, $links, $rulers);\r
 \r
-               $flex = new cubeFlexCompiler('FluidbookDatas', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH, 10);\r
-               $flexLight = new cubeFlexCompiler('FluidbookDatasLight', $compilerDir, 'flash.display.Sprite', explode(';', AS3_SOURCES), MXMLC_PATH, 10);\r
 \r
                $imagesassets = array();\r
                $id = 1;\r
@@ -874,48 +947,6 @@ class wsDAOBook extends commonDAO {
                $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset);\r
                $flex->addFont(FONT_PATH . '/FluidbookCredits.ttf', 'CreditsFont', 'ASCII');\r
                $flexLight->addFont(FONT_PATH . '/FluidbookLoader.ttf', 'LoaderFont', 'Numerals');\r
-               $flexLight->addVariable('checksum', $hash, false, true, 'String');\r
-               $res .= $flex->compile() . "\n\n-------------------\n\n";\r
-               $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf'));\r
-               $res .= $flexLight->compile();\r
-\r
-\r
-               $filesToCopy['data/fd.swf'] = $compilerDir . '/FluidbookDatas.swf';\r
-               $filesToCopy['data/fdl.swf'] = $compilerDir . '/FluidbookDatasLight.swf';\r
-               // Copy of files\r
-               // Check if dest dir exists\r
-               if (!file_exists($finalDir . 'data')) {\r
-                       mkdir($finalDir . 'data', 0777, true);\r
-               }\r
-               // Check working dir\r
-               if (file_exists($workingDir)) {\r
-                       $dr = opendir($workingDir);\r
-                       while ($file = readdir($dr)) {\r
-                               if ($file == '.' || $file == '..') {\r
-                                       continue;\r
-                               }\r
-                               $filesToCopy['data/' . $file] = $workingDir . '/' . $file;\r
-                       }\r
-               }\r
-\r
-               foreach ($filesToCopy as $local => $source) {\r
-                       $localPath = $finalDir . $local;\r
-                       // if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
-                       if (is_dir($source)) {\r
-                               continue;\r
-                       }\r
-                       copy($source, $localPath);\r
-                       // }\r
-               }\r
-\r
-               $this->compilePDF($book, $pages);\r
-               $this->indexPDF($book, $pages);\r
-               $this->compileHTML5($book_id);\r
-               $this->compileWidget($book, $pages);\r
-\r
-               $this->touchCompile($book_id);\r
-\r
-               return $res;\r
        }\r
 \r
        public function compileWidget($book, $pages) {\r
@@ -1018,7 +1049,7 @@ class wsDAOBook extends commonDAO {
        public function compilePDF($book, $pages) {\r
                $finalPDF = WS_BOOKS . '/final/' . $book->book_id . '/data/document.pdf';\r
 \r
-               if (!$book->parametres->pdf && $book->parametres->mobileVersion!='pdf') {\r
+               if (!$book->parametres->pdf && $book->parametres->mobileVersion != 'pdf') {\r
                        // Si l'export PDF n'est pas activĂ© on supprime le fichier si il existe\r
                        if (file_exists($finalPDF)) {\r
                                unlink($finalPDF);\r
index 1014e7e83a21658d6fe24075d4ab2fa04326dd92..31f24a4abdb25a61cf2280e4578e32607116df79 100644 (file)
@@ -5,5 +5,5 @@ $__autoload['wsPackagerHTML'] = dirname(__FILE__) . '/class.ws.packager.html.php
 $__autoload['wsPackagerWinEXE'] = dirname(__FILE__) . '/class.ws.packager.win.exe.php';\r
 $__autoload['wsPackagerWinCD'] = dirname(__FILE__) . '/class.ws.packager.win.cd.php';\r
 $__autoload['wsPackagerMacEXE'] = dirname(__FILE__) . '/class.ws.packager.mac.exe.php';\r
-$__autoload['wsPackagerWinINST'] = dirname(__FILE__) . '/class.ws.packager.win.inst.php';\r
+$__autoload['wsPackagerAIR'] = dirname(__FILE__) . '/class.ws.packager.air.php';\r
 ?>
\ No newline at end of file