# HG changeset patch # User ymh # Date 1272597497 -7200 # Node ID e5f3770296ade93f07dea1d39b7b8b42d4ef6fbe # Parent ea5e48bf2a7a306743517f674815728b02470fcb add reflexonomy diff -r ea5e48bf2a7a -r e5f3770296ad engine/sonyengine/mosatags.sonyengine.war Binary file engine/sonyengine/mosatags.sonyengine.war has changed diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php --- a/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php Fri Apr 30 05:18:17 2010 +0200 @@ -3,7 +3,7 @@ diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php --- a/web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php Fri Apr 30 05:18:17 2010 +0200 @@ -27,22 +27,69 @@ $this->distance = $this->distance * ($this->direction=='more'?1.0:-1.0) / 100.0; - $sonyengine = SonyengineClient::getInstance(); - $result = $client->engineFind($this->film_uniqueid,$this->tag,$this->distance,true); + $client = SonyengineClient::getInstance(); + $results = $client->engineFind($this->film_uniqueid,$this->tag,$this->distance,true); foreach($results as $res) { $primaryKeys[] = $res['id']; } + + if(!empty($primaryKeys)) + { + $resultFilm = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); + } + else + { + $resultFilm = array(); + } + + if(count($resultFilm) > 0) { + $this->film = $resultFilm[0]; + } + else { + $this->film = null; + } + + $pageNb = (int) $this->getRequestParameter('page_nb', 1); + $this->pageIndex = $pageNb -1; + $this->pageNbItems = 10; + $this->indexNbItems = 2; + + + + $solr = uvmcSolrServicesManager::getInstance()->getService(); + $response = $solr->search("tags:".$this->tag, $this->pageIndex * $this->pageNbItems, $this->pageNbItems); + + $results = unserialize($response->getRawResponse()); + + $primaryKeys = array(); + foreach($results['response']['docs'] as $doc) + { + $primaryKeys[] = $doc['id']; + } if(!empty($primaryKeys)) { - $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); + $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); } else { $this->mostTaggedFilms = array(); } + + if(count($this->mostTaggedFilms) > 0) { + + $taggedfilms = array(); + foreach($this->mostTaggedFilms as $film) { + if($this->film == null || $this->film.id != $film.id) { + $taggedfilms[] = $film; + } + } + $this->mostTaggedFilms = $taggedfilms; + } + + return sfView::SUCCESS; } } diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/actions/components.class.php --- a/web/thdProject/apps/frontend/modules/reflex/actions/components.class.php Thu Apr 29 11:57:20 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -from('ThdFilm F') - ->leftJoin('F.images I ') - ->leftJoin('F.videos V') - ->where("F.ref='{$ref}'"); - //$this->film = $query->execute(); - // if (!$this->film) return sfView::NONE; - - // retrieve tags infos - // $film = $this->film(); - - - return sfView::SUCCESS; - - } - - public function executePlayer() { - $this->film_uniqueid = (string) $request->getParameter('film_uniqueid'); - // retrieve infos in database - - $query = Doctrine_Query::create() - ->from('ThdFilm F') - ->leftJoin('F.images I ') - ->leftJoin('F.videos V') - ->where("F.uniqueid='{$film_uniqueid}'"); - $this->film = $query->execute()->getFirst(); - if (!$this->film) return sfView::NONE; - - // retrieve video infos - $videos = $this->film->getVideos(); - $this->filmVideo = ($videos) ? $videos[0] : null; - - return sfView::SUCCESS; - } - - -} \ No newline at end of file diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/config/view.yml --- a/web/thdProject/apps/frontend/modules/reflex/config/view.yml Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/reflex/config/view.yml Fri Apr 30 05:18:17 2010 +0200 @@ -4,7 +4,4 @@ javascripts: [ /js/flowplayer/flowplayer-3.1.0.min.js, /js/flowplayer/uc.flowplayer.config.js] - - components: - sideBar: [ tag, tagNavigator ] - \ No newline at end of file + \ No newline at end of file diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/templates/_player.php --- a/web/thdProject/apps/frontend/modules/reflex/templates/_player.php Thu Apr 29 11:57:20 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ - -
-

getTitle(); - // original title if exist - - if($film->getOriginalTitle()!= null) - { - echo " {".$film->getOriginalTitle()."}"; - } - ?> - De getDirectorsArray(), 'name'); ?>

- -
diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/templates/_suggestionFilmList.php --- a/web/thdProject/apps/frontend/modules/reflex/templates/_suggestionFilmList.php Thu Apr 29 11:57:20 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - -
-

Les films suivants

- -
\ No newline at end of file diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php --- a/web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php Fri Apr 30 05:18:17 2010 +0200 @@ -1,3 +1,10 @@ -

Résultats de la recherche reflexonomique

- - 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems)); ?> + +$film, "tag"=>$tag)); ?> + + +

Résultats de la recherche reflexonomique

+$film, "tag"=>$tag)); ?> + +

Pas de résultats de la recherche reflexonomique pour le tag

+ + 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems, "tag"=>$tag)); ?> diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/actions/components.class.php --- a/web/thdProject/apps/frontend/modules/tag/actions/components.class.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/actions/components.class.php Fri Apr 30 05:18:17 2010 +0200 @@ -4,41 +4,24 @@ { public function executeTagNavigator() { - $ref = '058000'; - - // retrieve infos in database - $query = Doctrine_Query::create() - ->from('ThdFilm F') - ->leftJoin('F.images I ') - ->leftJoin('F.videos V') - ->where("F.ref='{$ref}'"); - $this->film = $query->execute(); - if (!$this->film) return sfView::NONE; - // retrieve tags infos - $film = $this->film; - - return sfView::SUCCESS; + if($this->film) + return sfView::SUCCESS; + else + return sfView::NONE; } public function executePlayer() { - $ref = '058000'; - - // retrieve infos in database - $query = Doctrine_Query::create() - ->from('ThdFilm F') - ->leftJoin('F.images I ') - ->leftJoin('F.videos V') - ->where("F.ref='{$ref}'"); - $this->film = $query->execute()->getFirst(); - if (!$this->film) return sfView::NONE; - - // retrieve video infos - $film = $this->film; - $videos = $this->film->getVideos(); - $this->filmVideo = ($videos) ? $videos[0] : null; - - return sfView::SUCCESS; + + if($this->film) { + $videos = $this->film->getVideos(); + $this->filmVideo = ($videos) ? $videos[0] : null; + + return sfView::SUCCESS; + } + else + return sfView::NONE; + } diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php --- a/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php Fri Apr 30 05:18:17 2010 +0200 @@ -26,13 +26,27 @@ if(!empty($primaryKeys)) { - $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); + $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys); } else { $this->mostTaggedFilms = array(); } + if(count($this->mostTaggedFilms) > 0) { + + $taggedfilms = array(); + foreach($this->mostTaggedFilms as $film) { + if(!isset($this->film)) { + $this->film = $film; + } + else { + $taggedfilms[] = $film; + } + } + $this->mostTaggedFilms = $taggedfilms; + } + return sfView::SUCCESS; } } \ No newline at end of file diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/config/view.yml --- a/web/thdProject/apps/frontend/modules/tag/config/view.yml Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/config/view.yml Fri Apr 30 05:18:17 2010 +0200 @@ -6,5 +6,5 @@ components: - sideBar: [ tag, tagNavigator ] +# sideBar: [ tag, tagNavigator ] \ No newline at end of file diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/templates/_player.php --- a/web/thdProject/apps/frontend/modules/tag/templates/_player.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/templates/_player.php Fri Apr 30 05:18:17 2010 +0200 @@ -1,98 +1,3 @@ - -
-

getTitle(); - // original title if exist - - if($film->getOriginalTitle()!= null) - { - echo " {".$film->getOriginalTitle()."}"; - } - ?> - De getDirectorsArray(), 'name'); ?>

- +
+ $film, 'size' => 'big')); ?>
diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php --- a/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php Fri Apr 30 05:18:17 2010 +0200 @@ -1,14 +1,13 @@
-

Les films suivants

+

Autre films associés au tag

    getRef().'&film_slug='.$item->getSlugUrl()); + $tagFilmUri = url_for('@editVideoSegment?film_slug='.$item->getSlugUrl()); ?>
  • $item, 'actionUri' => $tagFilmUri)); ?> -
diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php --- a/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php Fri Apr 30 05:18:17 2010 +0200 @@ -1,14 +1,16 @@
+

Tags associés à cet extrait

    - + getDistinctTags() as $tag):?>
  • - +
    -
    +
    -
  • -
-
\ No newline at end of file +
+
+ + + + +

Pas de tags associés

+ +
diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/modules/tag/templates/viewTagListSuccess.php --- a/web/thdProject/apps/frontend/modules/tag/templates/viewTagListSuccess.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/modules/tag/templates/viewTagListSuccess.php Fri Apr 30 05:18:17 2010 +0200 @@ -1,3 +1,6 @@ + +$film)); ?> +

Résultats pour :

- - 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems)); ?> +$film)); ?> + 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems, 'tag' => $tag)); ?> diff -r ea5e48bf2a7a -r e5f3770296ad web/thdProject/apps/frontend/templates/layout.php --- a/web/thdProject/apps/frontend/templates/layout.php Thu Apr 29 11:57:20 2010 +0200 +++ b/web/thdProject/apps/frontend/templates/layout.php Fri Apr 30 05:18:17 2010 +0200 @@ -19,12 +19,19 @@
-