start implementing reindex action
authorIRI <>
Fri, 09 Apr 2010 18:18:55 +0200
changeset 41 a63a8ff719ff
parent 40 2dcf4fe5175f
child 42 a2b6a65ec553
start implementing reindex action
web/thdProject/apps/backend/modules/film/actions/actions.class.php
web/thdProject/apps/backend/modules/film/config/generator.yml
web/thdProject/apps/frontend/modules/editor/templates/_player.php
web/thdProject/apps/frontend/modules/films/templates/_filmList.php
web/thdProject/apps/frontend/modules/films/templates/viewFilmListSuccess.php
web/thdProject/apps/frontend/modules/films/templates/viewTopFilmListSuccess.php
web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php
web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php
web/thdProject/apps/frontend/modules/homepage/templates/_resultList.php
web/thdProject/apps/frontend/modules/search/templates/_searchList.php
web/thdProject/apps/frontend/modules/tag/templates/_player.php
web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php
web/thdProject/data/fixtures/data.yml
web/thdProject/lib/model/doctrine/ThdFilm.class.php
--- a/web/thdProject/apps/backend/modules/film/actions/actions.class.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/backend/modules/film/actions/actions.class.php	Fri Apr 09 18:18:55 2010 +0200
@@ -13,4 +13,22 @@
  */
 class filmActions extends autoFilmActions
 {
+	public function executeListReindex(sfWebRequest $request) {
+		sfContext::getInstance()->getLogger()->info("FilmAction : listReindex");
+		
+		//empty solr
+		//empty sonyengine
+		
+		// get all films
+		// add film to film array for sonyengine
+		// for each film get all segments
+		// get all tags
+		// add to film array for sony engine
+		// solr index film
+
+		// add all films to sonyengine
+		// add all tags to sony engine
+		
+		$this->redirect("@thd_film_film");
+	}
 }
--- a/web/thdProject/apps/backend/modules/film/config/generator.yml	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/backend/modules/film/config/generator.yml	Fri Apr 09 18:18:55 2010 +0200
@@ -13,7 +13,10 @@
     config:
       actions: ~
       fields:  ~
-      list:    ~
+      list:
+        actions:
+          _new : ~
+          reindex : {label: Reindex}
       filter:  ~
       form:    ~
       edit:    ~
--- a/web/thdProject/apps/frontend/modules/editor/templates/_player.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/editor/templates/_player.php	Fri Apr 09 18:18:55 2010 +0200
@@ -96,7 +96,7 @@
 			echo " <span class=\"ost\">{".$film->getOriginalTitle()."}</span>";
 		}
 	?>
-	<span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectors(), 'name'); ?></span></h1>
+	<span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span></h1>
 	<div class="section">
 		<div id="player" class="player-ba"></div>
 		<div id="segmentMarkerButtons" style="text-align:center;opacity:0.5">
--- a/web/thdProject/apps/frontend/modules/films/templates/_filmList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/films/templates/_filmList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -15,7 +15,7 @@
 	<li>
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/apps/frontend/modules/films/templates/viewFilmListSuccess.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/films/templates/viewFilmListSuccess.php	Fri Apr 09 18:18:55 2010 +0200
@@ -17,7 +17,7 @@
 	<li>
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/apps/frontend/modules/films/templates/viewTopFilmListSuccess.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/films/templates/viewTopFilmListSuccess.php	Fri Apr 09 18:18:55 2010 +0200
@@ -17,7 +17,7 @@
 	<li>
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -15,7 +15,7 @@
 	<li>
 		<div id="player-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title" target="_top"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title" target="_top"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -16,7 +16,7 @@
 	<li>
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_resultList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_resultList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -13,7 +13,7 @@
 		// image file
 		$video_file = $item->getVideos();
 		// directors list
-		$directors = json_decode($item->getDirectors(), true);
+		$directors = json_decode($item->getDirectorsArray(), true);
 	?>
 	<li>	
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo $imagePath.$image_file[0]['file'].".jpg"; ?>') no-repeat;" href="<?php echo 	$videoPath.$video_file[0]['file'].".f4v";?>"">
--- a/web/thdProject/apps/frontend/modules/search/templates/_searchList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/_searchList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -11,7 +11,7 @@
 		// image file
 		$video_file = $item->getVideos();
 		// directors list
-		$directors = json_decode($item->getDirectors(), true);
+		$directors = json_decode($item->getDirectorsArray(), true);
 	?>
 	<li>	
 		<div id="player-<?php echo $ref; ?>" class="player-item" style="background:transparent url('/posters/<?php echo $image_file[0]['file'].".jpg"; ?>') no-repeat;" href="<?php echo $videoPath.$video_file[0]['file'].".f4v";?>">
--- a/web/thdProject/apps/frontend/modules/tag/templates/_player.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/templates/_player.php	Fri Apr 09 18:18:55 2010 +0200
@@ -90,7 +90,7 @@
 			echo " <span class=\"ost\">{".$film->getOriginalTitle()."}</span>";
 		}
 	?>
-	<span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectors(), 'name'); ?></span></h1>
+	<span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span></h1>
 	<div class="section">
 		<div id="player" class="player-ba"></div>	
 	<div class="tag-action"><a href="" class="link-button">Tagger le film</a></div>
--- a/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php	Fri Apr 09 18:18:55 2010 +0200
@@ -16,7 +16,7 @@
 	<li>
 		<div id="playerMostTagged-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
 			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectors(), 'name'); ?></span>
+		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
 		    </div>
 		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
 		     <div class="tags">
--- a/web/thdProject/data/fixtures/data.yml	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/data/fixtures/data.yml	Fri Apr 09 18:18:55 2010 +0200
@@ -10,7 +10,7 @@
     original_title: null
     production_countries: '[{"label":"France"}]'
     production_year: '2000'
-    uniqueid: '1'
+    uniqueid: 'DCFF65E8-A1D3-9198-B0E6AF96CEB52705'
   ThdFilm_2:
     ref: '025001'
     title: 'A travers la forêt'
@@ -22,7 +22,7 @@
     original_title: null
     production_countries: '[{"label":"France"}]'
     production_year: '2004'
-    uniqueid: '2'
+    uniqueid: 'DCFF65F7-F57A-CA9C-8F59463F79FD8BB7'
   ThdFilm_3:
     ref: '039031'
     title: 'Après lui'
@@ -34,7 +34,7 @@
     original_title: null
     production_countries: '[{"label":"France"}]'
     production_year: '2006'
-    uniqueid: '3'
+    uniqueid: 'DCFF6607-04F7-5BF5-FF993C70537DCC06'
   ThdFilm_4:
     ref: '013002'
     title: 'Buenos Aires 100 km'
@@ -46,7 +46,7 @@
     original_title: 'Buenos Aires 100 kilómetros'
     production_countries: '[{"label":"Argentine"},{"label":"France"},{"label":"Espagne"}]'
     production_year: '2004'
-    uniqueid: '4'
+    uniqueid: 'DCFF6617-C505-BD60-5BFBBE7A2CF29B1E'
 ThdImage:
   ThdImage_1:
     ThdFilm: ThdFilm_1
--- a/web/thdProject/lib/model/doctrine/ThdFilm.class.php	Wed Apr 07 18:06:27 2010 +0200
+++ b/web/thdProject/lib/model/doctrine/ThdFilm.class.php	Fri Apr 09 18:18:55 2010 +0200
@@ -33,15 +33,15 @@
       return json_decode($data[$attr], true);
     }
 
-    public function getDirectors() {
+    public function getDirectorsArray() {
       return $this->decodeJsonData('directors');
     }
 
-    public function getActors() {
+    public function getActorsArray() {
       return $this->decodeJsonData('actors');
     }
 
-    public function getProductionCountries() {
+    public function getProductionCountriesArray() {
       return $this->decodeJsonData('production_countries');
     }