From b99b01e184445dbe1348f1a041df0acbba141a02 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 23 May 2012 19:25:27 +0200 Subject: [PATCH] Remove baseurl --- hudson/fixtures.sql | 5 +-- lib/Alchemy/Phrasea/Application/Overview.php | 3 -- .../Phrasea/Controller/Admin/Subdefs.php | 2 +- lib/classes/databox.class.php | 8 ++-- lib/classes/databox/subdef.class.php | 16 +------- lib/classes/media/subdef.class.php | 41 +++---------------- lib/classes/record/adapter.class.php | 25 +++++------ lib/conf.d/bases_structure.xml | 10 ----- lib/conf.d/data_templates/en-simple.xml | 11 ----- lib/conf.d/data_templates/fr-simple.xml | 11 ----- templates/web/admin/subdefs.twig | 9 ---- .../Phrasea/Application/OverviewTest.php | 24 +++-------- tests/databox/databox_subdefTest.php | 7 ---- tests/media/media_subdefTest.php | 9 ---- 14 files changed, 30 insertions(+), 151 deletions(-) diff --git a/hudson/fixtures.sql b/hudson/fixtures.sql index be27dda8ac..68676965fb 100644 --- a/hudson/fixtures.sql +++ b/hudson/fixtures.sql @@ -743,7 +743,7 @@ CREATE TABLE `cache` ( LOCK TABLES `cache` WRITE; /*!40000 ALTER TABLE `cache` DISABLE KEYS */; -INSERT INTO `cache` VALUES (3,3,3,'2012-04-27 00:06:55','2012-04-27 02:06:56','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0db_test\0localhost\0\0\0\0\0\0\0� \0\0\0\0\0\0root\0\0\0\0toor\0\0\0\0db_test\0\n\n /tmp/db_test/documents\n \n \n \n /tmp/db_test/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n \n image\n \n \n \n \n /tmp/db_test/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n 800\n video\n yes\n \n libfaac\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/db_test/subdefs\n 200\n gif\n 500\n no\n web//db_test/subdefs\n \n \n \n \n /tmp/db_test/subdefs\n 200\n image\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n audio\n yes\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n flexpaper\n no\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n resample\n 72\n 200\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n resample\n 72\n web//db_test/subdefs\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0test\0\0\0\0\n \n 0\n \n \n \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0coll2\0\0\0\n \n 0\n \n \n \0\0\0','a:1:{i:0;i:0;}','Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0','127.0.0.1','Apple','Firefox','12.0','1280x800','','0000-00-00 00:00:00',NULL,NULL); +INSERT INTO `cache` VALUES (3,3,3,'2012-04-27 00:06:55','2012-04-27 02:06:56','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0db_test\0localhost\0\0\0\0\0\0\0� \0\0\0\0\0\0root\0\0\0\0toor\0\0\0\0db_test\0\n\n /tmp/db_test/documents\n \n \n \n /tmp/db_test/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n image\n \n \n \n \n /tmp/db_test/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n \n \n \n \n \n \n /tmp/db_test/subdefs\n 800\n video\n yes\n libfaac\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/db_test/subdefs\n 200\n gif\n 500\n no\n \n \n \n \n /tmp/db_test/subdefs\n 200\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n audio\n yes\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n flexpaper\n no\n \n \n \n \n /tmp/db_test/subdefs\n image\n resample\n 72\n 200\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n resample\n 72\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0test\0\0\0\0\n \n 0\n \n \n \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0coll2\0\0\0\n \n 0\n \n \n \0\0\0','a:1:{i:0;i:0;}','Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0','127.0.0.1','Apple','Firefox','12.0','1280x800','','0000-00-00 00:00:00',NULL,NULL); /*!40000 ALTER TABLE `cache` ENABLE KEYS */; UNLOCK TABLES; @@ -2235,7 +2235,7 @@ CREATE TABLE `pref` ( LOCK TABLES `pref` WRITE; /*!40000 ALTER TABLE `pref` DISABLE KEYS */; -INSERT INTO `pref` VALUES (1,'thesaurus','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(2,'structure','\n\n /tmp/db_test/documents\n \n \n \n /tmp/db_test/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n \n image\n \n \n \n \n /tmp/db_test/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n 800\n video\n yes\n \n libfaac\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/db_test/subdefs\n 200\n gif\n 500\n no\n web//db_test/subdefs\n \n \n \n \n /tmp/db_test/subdefs\n 200\n image\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n audio\n yes\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n flexpaper\n no\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n resample\n 72\n 200\n no\n web//db_test/subdefs\n \n \n \n \n \n \n /tmp/db_test/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n resample\n 72\n web//db_test/subdefs\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n','','2012-04-27 02:06:34','2012-04-27 02:06:31'),(3,'cterms','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(4,'indexes','1','','2012-04-27 02:06:31','2012-04-27 02:06:31'),(5,'ToU','','fr_FR','0000-00-00 00:00:00','2012-04-27 02:06:31'),(6,'ToU','','ar_SA','0000-00-00 00:00:00','2012-04-27 02:06:31'),(7,'ToU','','de_DE','0000-00-00 00:00:00','2012-04-27 02:06:31'),(8,'ToU','','en_GB','0000-00-00 00:00:00','2012-04-27 02:06:31'),(9,'version','3.7.0.0.a2','','2012-04-27 02:06:33','0000-00-00 00:00:00'); +INSERT INTO `pref` VALUES (1,'thesaurus','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(2,'structure','\n\n /tmp/db_test/documents\n \n \n \n /tmp/db_test/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n image\n \n \n \n \n /tmp/db_test/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n \n \n \n \n \n \n /tmp/db_test/subdefs\n 800\n video\n yes\n libfaac\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/db_test/subdefs\n 200\n gif\n 500\n no\n \n \n \n \n /tmp/db_test/subdefs\n 200\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n audio\n yes\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n flexpaper\n no\n \n \n \n \n /tmp/db_test/subdefs\n image\n resample\n 72\n 200\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n resample\n 72\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n','','2012-04-27 02:06:34','2012-04-27 02:06:31'),(3,'cterms','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(4,'indexes','1','','2012-04-27 02:06:31','2012-04-27 02:06:31'),(5,'ToU','','fr_FR','0000-00-00 00:00:00','2012-04-27 02:06:31'),(6,'ToU','','ar_SA','0000-00-00 00:00:00','2012-04-27 02:06:31'),(7,'ToU','','de_DE','0000-00-00 00:00:00','2012-04-27 02:06:31'),(8,'ToU','','en_GB','0000-00-00 00:00:00','2012-04-27 02:06:31'),(9,'version','3.7.0.0.a2','','2012-04-27 02:06:33','0000-00-00 00:00:00'); /*!40000 ALTER TABLE `pref` ENABLE KEYS */; UNLOCK TABLES; @@ -2384,7 +2384,6 @@ CREATE TABLE `subdef` ( `name` char(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, `path` char(255) COLLATE utf8_unicode_ci NOT NULL, `file` char(255) COLLATE utf8_unicode_ci NOT NULL, - `baseurl` char(255) COLLATE utf8_unicode_ci NOT NULL, `width` int(10) unsigned NOT NULL DEFAULT '0', `height` int(10) unsigned NOT NULL DEFAULT '0', `mime` char(64) COLLATE utf8_unicode_ci NOT NULL, diff --git a/lib/Alchemy/Phrasea/Application/Overview.php b/lib/Alchemy/Phrasea/Application/Overview.php index 15f021b142..03bbc55d13 100644 --- a/lib/Alchemy/Phrasea/Application/Overview.php +++ b/lib/Alchemy/Phrasea/Application/Overview.php @@ -31,9 +31,6 @@ return call_user_func( $deliver_content = function(\Session_Handler $session, \record_adapter $record, $subdef, $watermark, $stamp, $app) { $file = $record->get_subdef($subdef); - if ($file->get_baseurl() !== '') { - return $app->redirect($file->get_url()); - } $pathIn = $pathOut = $file->get_pathfile(); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php index a7d6b62d7b..abcd8a5187 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php @@ -92,7 +92,7 @@ class Subdefs implements ControllerProviderInterface $class = $request->get($post_sub . '_class'); $downloadable = $request->get($post_sub . '_downloadable'); - $defaults = array('path', 'baseurl', 'meta', 'mediatype'); + $defaults = array('path', 'meta', 'mediatype'); foreach ($defaults as $def) { $parm_loc = $request->get($post_sub . '_' . $def); diff --git a/lib/classes/databox.class.php b/lib/classes/databox.class.php index 35ae5181ba..7306469cc2 100644 --- a/lib/classes/databox.class.php +++ b/lib/classes/databox.class.php @@ -845,7 +845,7 @@ class databox extends base return $this; } - public function setNewStructure(\SplFileInfo $data_template, $path_web, $path_doc, $baseurl) + public function setNewStructure(\SplFileInfo $data_template, $path_web, $path_doc) { if ( ! file_exists($data_template->getPathname())) { throw new \InvalidArgumentException(sprintf('File %s does not exists')); @@ -853,11 +853,9 @@ class databox extends base $contents = file_get_contents($data_template->getPathname()); - $baseurl = $baseurl ? p4string::addEndSlash($baseurl) : ''; - $contents = str_replace( - array("{{dataurl}}", "{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}") - , array($baseurl, $this->dbname, $path_web, $path_doc) + array("{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}") + , array($this->dbname, $path_web, $path_doc) , $contents ); diff --git a/lib/classes/databox/subdef.class.php b/lib/classes/databox/subdef.class.php index d47826c469..8e8bb7515b 100644 --- a/lib/classes/databox/subdef.class.php +++ b/lib/classes/databox/subdef.class.php @@ -35,7 +35,6 @@ class databox_subdef protected $name; protected $path; protected $subdef_group; - protected $baseurl; protected $labels = array(); protected $write_meta; protected $downloadable; @@ -75,8 +74,6 @@ class databox_subdef $this->downloadable = p4field::isyes($sd->attributes()->downloadable); $this->path = trim($sd->path) !== '' ? p4string::addEndSlash(trim($sd->path)) : ''; - $this->baseurl = trim($sd->baseurl) !== '' ? p4string::addEndSlash(trim($sd->baseurl)) : false; - $this->write_meta = p4field::isyes((string) $sd->meta); foreach ($sd->label as $label) { @@ -137,15 +134,6 @@ class databox_subdef return $this->devices; } - /** - * - * @return string - */ - public function get_baseurl() - { - return $this->baseurl; - } - /** * The current SubdefType the subdef converts documents * @@ -363,10 +351,10 @@ class databox_subdef if ($sd->size) { $video->setOptionValue(Video::OPTION_SIZE, (int) $sd->size); } - if ($sd->a_codec) { + if ($sd->acodec) { $video->setOptionValue(Video::OPTION_ACODEC, (string) $sd->acodec); } - if ($sd->v_codec) { + if ($sd->vcodec) { $video->setOptionValue(Video::OPTION_VCODEC, (string) $sd->vcodec); } if ($sd->fps) { diff --git a/lib/classes/media/subdef.class.php b/lib/classes/media/subdef.class.php index 324d040642..b665a22ae5 100644 --- a/lib/classes/media/subdef.class.php +++ b/lib/classes/media/subdef.class.php @@ -26,12 +26,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface */ protected $mime; - /** - * - * @var string - */ - protected $baseurl; - /** * * @var string @@ -176,7 +170,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->width = $datas['width']; $this->height = $datas['height']; $this->etag = $datas['etag']; - $this->baseurl = $datas['baseurl']; $this->path = $datas['path']; $this->file = $datas['file']; $this->is_physically_present = $datas['physically_present']; @@ -192,7 +185,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $connbas = $this->record->get_databox()->get_connection(); - $sql = 'SELECT subdef_id, name, baseurl, file, width, height, mime, + $sql = 'SELECT subdef_id, name, file, width, height, mime, path, size, substit, created_on, updated_on, etag FROM subdef WHERE name = :name AND record_id = :record_id'; @@ -212,7 +205,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->width = (int) $row['width']; $this->height = (int) $row['height']; $this->mime = $row['mime']; - $this->baseurl = trim($row['baseurl']); $this->file = $row['file']; $this->etag = $row['etag']; $this->path = p4string::addEndSlash($row['path']); @@ -239,7 +231,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface 'mime' => $this->mime , 'width' => $this->width , 'height' => $this->height - , 'baseurl' => $this->baseurl , 'etag' => $this->etag , 'path' => $this->path , 'file' => $this->file @@ -290,7 +281,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->mime = 'image/png'; $this->width = 256; $this->height = 256; - $this->baseurl = 'skins/icons/substitution/'; $this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/'; $this->file = 'regroup_thumb.png'; $this->is_substituted = true; @@ -301,7 +291,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->mime = 'image/png'; $this->width = 256; $this->height = 256; - $this->baseurl = 'skins/icons/substitution/'; $this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/'; $this->file = str_replace('+', '%20', $mime) . '.png'; $this->is_substituted = true; @@ -310,7 +299,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->is_physically_present = false; if ( ! file_exists($this->path . $this->file)) { - $this->baseurl = 'skins/icons/'; $this->path = $registry->get('GV_RootPath') . 'www/skins/icons/'; $this->file = 'substitution.png'; $this->is_substituted = true; @@ -440,15 +428,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface return $this->path; } - /** - * - * @return string - */ - public function get_baseurl() - { - return $this->baseurl; - } - /** * * @return string @@ -696,7 +675,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface return $datas; } - public static function create(record_Interface $record, $name, Media $media, $baseurl = '') + public static function create(record_Interface $record, $name, Media $media) { $databox = $record->get_databox(); $connbas = $databox->get_connection(); @@ -707,7 +686,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $params = array( ':path' => $path, ':file' => $newname, - ':baseurl' => $baseurl, ':width' => 0, ':height' => 0, ':mime' => $media->getFile()->getMimeType(), @@ -728,7 +706,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface } $sql = "UPDATE subdef - SET path = :path, file = :file, baseurl = :baseurl + SET path = :path, file = :file , width = :width , height = :height, mime = :mime , size = :size, dispatched = :dispatched, updated_on = NOW() WHERE subdef_id = :subdef_id"; @@ -736,9 +714,9 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $params[':subdef_id'] = $subdef->get_subdef_id(); } catch (\Exception_Media_SubdefNotFound $e) { $sql = "INSERT INTO subdef - (record_id, name, path, file, baseurl, width + (record_id, name, path, file, width , height, mime, size, dispatched, created_on, updated_on) - VALUES (:record_id, :name, :path, :file, :baseurl, :width, :height + VALUES (:record_id, :name, :path, :file, :width, :height , :mime, :size, :dispatched, NOW(), NOW())"; $params[':record_id'] = $record->get_record_id(); @@ -767,15 +745,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface */ protected function generate_url($random = false) { - if ($this->baseurl !== '') { - $registry = registry::get_instance(); - $this->url = $registry->get('GV_STATIC_URL') - . '/' . p4string::addEndSlash($this->baseurl) - . $this->file . ($random ? '?rand=' . mt_rand(10000, 99999) : ''); - - return; - } - if (in_array($this->mime, array('video/mp4'))) { $token = p4file::apache_tokenize($this->get_pathfile()); if ($token) { diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index f5e8117fef..a120006fc5 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -630,7 +630,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface $searchDevices = array_merge((array) $devices, (array) databox_subdef::DEVICE_ALL); - foreach ($this->databox->get_subdef_structure() as $databoxSubdefs) { + foreach ($this->databox->get_subdef_structure() as $group => $databoxSubdefs) { + + if ($this->get_type() != $group) { + continue; + } foreach ($databoxSubdefs as $databoxSubdef) { @@ -982,14 +986,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface $path_file_dest = $path . $newfilename; } - if (trim($subdef_def->get_baseurl()) !== '') { - $base_url = str_replace( - array($subdef_def->get_path(), $newfilename) - , array($subdef_def->get_baseurl(), '') - , $path_file_dest - ); - } - try { $Core = \bootstrap::getCore(); $Core['media-alchemyst']->open($media->getFile()->getRealPath()) @@ -1013,8 +1009,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $connbas = connection::getPDOConnection($this->get_sbas_id()); $sql = 'UPDATE subdef - SET baseurl = :baseurl, - file = :filename, + SET file = :filename, width = :width, height = :height, mime = :mime, @@ -1026,7 +1021,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface $params = array( ':record_id' => $this->record_id, ':name' => $name, - ':baseurl' => $base_url, ':filename' => $subdefFile->getFilename(), ':mime' => $subdefFile->getMimeType(), ':path' => $subdefFile->getPath(), @@ -1691,9 +1685,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface if (file_exists($pathdest)) { $media = \MediaVorus\MediaVorus::guess(new \SplFileInfo($pathdest)); - $baseurl = $subdef->get_baseurl() ? $subdef->get_baseurl() . substr(dirname($pathdest), strlen($subdef->get_path())) : ''; - media_subdef::create($this, $subdef->get_name(), $media, $baseurl); + media_subdef::create($this, $subdef->get_name(), $media); } $this->clearSubdefCache($subdefname); @@ -1728,6 +1721,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface $Core = \bootstrap::getCore(); try { + if (null === $this->get_hd_file()) { + return; + } + $Core['media-alchemyst']->open($this->get_hd_file()->getPathname()); $Core['media-alchemyst']->turnInto($pathdest, $subdef_class->getSpecs()); $Core['media-alchemyst']->close(); diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index e052db7c73..d3a3518494 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -6777,16 +6777,6 @@ - - baseurl - char(255) - - - - - - - width int(10) unsigned diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index bcf9900e23..14f52ee1eb 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -12,7 +12,6 @@ no 75 yes - image @@ -26,7 +25,6 @@ 75 no image - {{dataurl}}/{{basename}}/subdefs @@ -38,7 +36,6 @@ 800 video yes - libfaac libx264 1000 @@ -53,7 +50,6 @@ gif 500 no - {{dataurl}}/{{basename}}/subdefs @@ -62,7 +58,6 @@ 200 image no - {{dataurl}}/{{basename}}/subdefs @@ -73,7 +68,6 @@ {{datapathnoweb}}{{basename}}/subdefs audio yes - @@ -81,7 +75,6 @@ {{datapathweb}}{{basename}}/subdefs image no - {{dataurl}}/{{basename}}/subdefs @@ -91,7 +84,6 @@ {{datapathnoweb}}{{basename}}/subdefs flexpaper no - @@ -102,7 +94,6 @@ 72 200 no - {{dataurl}}/{{basename}}/subdefs @@ -115,7 +106,6 @@ no resample 72 - @@ -125,7 +115,6 @@ no resample 72 - {{dataurl}}/{{basename}}/subdefs diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index 1ad99c68d4..accb24429e 100755 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -11,7 +11,6 @@ no 75 yes - image @@ -25,7 +24,6 @@ 75 no image - {{dataurl}}/{{basename}}/subdefs @@ -36,7 +34,6 @@ 800 video yes - libfaac libx264 1000 @@ -51,7 +48,6 @@ gif 500 no - {{dataurl}}/{{basename}}/subdefs @@ -60,7 +56,6 @@ 200 image no - {{dataurl}}/{{basename}}/subdefs @@ -70,7 +65,6 @@ {{datapathnoweb}}{{basename}}/subdefs audio yes - @@ -79,7 +73,6 @@ image 200 no - {{dataurl}}/{{basename}}/subdefs @@ -89,7 +82,6 @@ {{datapathnoweb}}{{basename}}/subdefs flexpaper no - @@ -100,7 +92,6 @@ 72 200 no - {{dataurl}}/{{basename}}/subdefs @@ -113,7 +104,6 @@ no resample 72 - @@ -123,7 +113,6 @@ no resample 72 - {{dataurl}}/{{basename}}/subdefs diff --git a/templates/web/admin/subdefs.twig b/templates/web/admin/subdefs.twig index b8b87941b6..21d5dc16c7 100644 --- a/templates/web/admin/subdefs.twig +++ b/templates/web/admin/subdefs.twig @@ -241,15 +241,6 @@ - - - {% trans 'Baseurl' %} - - - - - - {% trans 'Write Metas' %} diff --git a/tests/Alchemy/Phrasea/Application/OverviewTest.php b/tests/Alchemy/Phrasea/Application/OverviewTest.php index f3d6732126..2c751b52b0 100644 --- a/tests/Alchemy/Phrasea/Application/OverviewTest.php +++ b/tests/Alchemy/Phrasea/Application/OverviewTest.php @@ -25,19 +25,11 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract $crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/preview/'); $response = $this->client->getResponse(); - if (static::$records['record_1']->get_preview()->get_baseurl() !== '') { - $this->assertEquals(302, $response->getStatusCode()); - $url = p4string::delEndSlash($registry->get('GV_ServerName')) . $response->headers->get('Location'); - $headers = http_query::getHttpHeaders($url); - $this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $headers['content_type']); - $this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $headers['download_content_length']); - } else { - $this->assertEquals(200, $response->getStatusCode()); - $content_disposition = explode(';', $response->headers->get('content-disposition')); - $this->assertEquals($content_disposition[0], 'attachment'); - $this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $response->headers->get('content-type')); - $this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $response->headers->get('content-length')); - } + $this->assertEquals(200, $response->getStatusCode()); + $content_disposition = explode(';', $response->headers->get('content-disposition')); + $this->assertEquals($content_disposition[0], 'attachment'); + $this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $response->headers->get('content-type')); + $this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $response->headers->get('content-length')); $crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/asubdefthatdoesnotexists/'); $response = $this->client->getResponse(); @@ -81,11 +73,7 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract $crawler = $this->client->request('GET', $url); $response = $this->client->getResponse(); - if (static::$records['record_1']->get_preview()->get_baseurl() !== '') { - $this->assertEquals(302, $response->getStatusCode()); - } else { - $this->assertEquals(200, $response->getStatusCode()); - } + $this->assertEquals(200, $response->getStatusCode()); $url = $url . 'view/'; $crawler = $this->client->request('GET', $url); diff --git a/tests/databox/databox_subdefTest.php b/tests/databox/databox_subdefTest.php index 509f5195dd..eafa36fdbf 100644 --- a/tests/databox/databox_subdefTest.php +++ b/tests/databox/databox_subdefTest.php @@ -13,7 +13,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase * @covers databox_subdef::get_labels * @covers databox_subdef::getSubdefGroup * @covers databox_subdef::getSubdefType - * @covers databox_subdef::get_baseurl * @covers databox_subdef::get_path * @covers databox_subdef::getSpecs * @covers databox_subdef::getOptions @@ -24,7 +23,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase $xml = ' /home/datas/noweb/db_alch_phrasea/subdefs/ - yes image @@ -40,7 +38,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase $this->assertEquals(databox_subdef::CLASS_PREVIEW, $object->get_class()); $this->assertEquals('/home/datas/noweb/db_alch_phrasea/subdefs/', $object->get_path()); - $this->assertEquals('', $object->get_baseurl()); $this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType()); $this->assertEquals($type, $object->getSubdefGroup()); @@ -82,7 +79,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase * @covers databox_subdef::get_labels * @covers databox_subdef::getSubdefGroup * @covers databox_subdef::getSubdefType - * @covers databox_subdef::get_baseurl * @covers databox_subdef::get_path * @covers databox_subdef::getSpecs * @covers databox_subdef::getOptions @@ -93,7 +89,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase $xml = ' /home/datas/noweb/db_alch_phrasea/video/ - /video/ no video 196 @@ -112,7 +107,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase $this->assertEquals(databox_subdef::CLASS_THUMBNAIL, $object->get_class()); $this->assertEquals('/home/datas/noweb/db_alch_phrasea/video/', $object->get_path()); - $this->assertEquals('/video/', $object->get_baseurl()); $this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType()); $this->assertEquals($type, $object->getSubdefGroup()); @@ -152,7 +146,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase $xml = ' /home/datas/noweb/db_alch_phrasea/video/ - web//db_alch_beta/subdefs/ no gif 200 diff --git a/tests/media/media_subdefTest.php b/tests/media/media_subdefTest.php index 4b3716a2a0..b9a539d026 100644 --- a/tests/media/media_subdefTest.php +++ b/tests/media/media_subdefTest.php @@ -144,15 +144,6 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract $this->assertEquals(dirname(self::$objectNotPresent->get_pathfile()) . DIRECTORY_SEPARATOR, self::$objectNotPresent->get_path()); } - /** - * @covers media_subdef::get_baseurl - */ - public function testGet_baseurl() - { - $this->assertInternalType('string', self::$objectPresent->get_baseurl()); - $this->assertInternalType('string', self::$objectNotPresent->get_baseurl()); - } - /** * @covers media_subdef::get_file */