--- a/build/README Fri Apr 16 11:35:35 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Folder that gather all necessary ressources (scripots) to maitain the project
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/deploy.launch Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk" path="1" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento default="true"/> </runtimeClasspathEntry> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.variableClasspathEntry"> <memento path="3" variableString="${project_loc}engine/build/lib/catalina-ant.jar"/> </runtimeClasspathEntry> "/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${project_loc:engine/build/deploy.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Durl=http://localhot:8080/manager -Dusername=tomcat -Dpassword=tomcat"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
--- a/build/deploy.xml Fri Apr 16 11:35:35 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ======================================================================
- Mar 18, 2010 4:31:09 PM
-
- project
- description
-
- ymh
- ====================================================================== -->
-<project name="project" default="deploy_all" basedir="..">
- <description>
- description
- </description>
- <property name="url" value="http://localhost:9080/manager" />
- <property name="username" value="tomcat"/>
- <property name="password" value="tomcat"/>
- <property name="solr.path" value="/solr" />
- <property name="sonyengine.path" value="/sonyengine" />
- <property name="build" value="${basedir}/engine" />
-
- <!-- Configure the custom Ant tasks for the Manager application -->
- <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
- <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
- <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
- <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/>
- <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"/>
- <taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
- <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
- <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
-
- <target name="deploy_solr">
- <deploy
- localwar="${build}${solr.path}/apache-solr-1.4.0.war"
- url="${url}"
- username="${username}"
- password="${password}"
- path="${solr.path}"
- config="${build}${solr.path}/context.xml"
- >
- </deploy>
- </target>
-
- <target name="deploy_sonyengine">
- <echo>${build}${sonyengine.path}/mosatags.sonyengine.war</echo>
- <deploy
- localwar="${build}${sonyengine.path}/mosatags.sonyengine.war"
- url="${url}"
- username="${username}"
- password="${password}"
- path="${sonyengine.path}"
- config="${build}${sonyengine.path}/context.xml"
- >
- </deploy>
- </target>
-
- <target name="reload_sonyengine" description="Reload web application">
- <reload url="${url}" username="${username}" password="${password}"
- path="${sonyengine.path}"/>
- </target>
-
- <target name="reload_solr" description="Reload web application">
- <reload url="${url}" username="${username}" password="${password}"
- path="${solr.path}"/>
- </target>
-
- <target name="undeploy_sonyengine" description="Remove web application">
- <undeploy url="${url}" username="${username}" password="${password}"
- path="${sonyengine.path}"/>
- </target>
- <target name="undeploy_solr" description="Remove web application">
- <undeploy url="${url}" username="${username}" password="${password}"
- path="${solr.path}"/>
- </target>
-
- <!-- =================================
- target: deploy_all
- ================================= -->
- <target name="deploy_all" depends="deploy_solr, deploy_sonyengine" description="²description">
- </target>
-
-</project>
Binary file build/lib/catalina-ant.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/engine/build/README Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,1 @@
+Folder that gather all necessary ressources (scripots) to maitain the project
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/engine/build/deploy.xml Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ======================================================================
+ Mar 18, 2010 4:31:09 PM
+
+ project
+ description
+
+ ymh
+ ====================================================================== -->
+<project name="project" default="deploy_all" basedir="..">
+ <description>
+ description
+ </description>
+ <property name="url" value="http://localhost:9080/manager" />
+ <property name="username" value="tomcat"/>
+ <property name="password" value="tomcat"/>
+ <property name="solr.path" value="/solr" />
+ <property name="sonyengine.path" value="/sonyengine" />
+ <property name="build" value="${basedir}/engine" />
+
+ <!-- Configure the custom Ant tasks for the Manager application -->
+ <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
+ <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
+ <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
+ <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/>
+ <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"/>
+ <taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
+ <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
+ <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
+
+ <target name="deploy_solr">
+ <deploy
+ localwar="${build}${solr.path}/apache-solr-1.4.0.war"
+ url="${url}"
+ username="${username}"
+ password="${password}"
+ path="${solr.path}"
+ config="${build}${solr.path}/context.xml"
+ >
+ </deploy>
+ </target>
+
+ <target name="deploy_sonyengine">
+ <echo>${build}${sonyengine.path}/mosatags.sonyengine.war</echo>
+ <deploy
+ localwar="${build}${sonyengine.path}/mosatags.sonyengine.war"
+ url="${url}"
+ username="${username}"
+ password="${password}"
+ path="${sonyengine.path}"
+ config="${build}${sonyengine.path}/context.xml"
+ >
+ </deploy>
+ </target>
+
+ <target name="reload_sonyengine" description="Reload web application">
+ <reload url="${url}" username="${username}" password="${password}"
+ path="${sonyengine.path}"/>
+ </target>
+
+ <target name="reload_solr" description="Reload web application">
+ <reload url="${url}" username="${username}" password="${password}"
+ path="${solr.path}"/>
+ </target>
+
+ <target name="undeploy_sonyengine" description="Remove web application">
+ <undeploy url="${url}" username="${username}" password="${password}"
+ path="${sonyengine.path}"/>
+ </target>
+ <target name="undeploy_solr" description="Remove web application">
+ <undeploy url="${url}" username="${username}" password="${password}"
+ path="${solr.path}"/>
+ </target>
+
+ <!-- =================================
+ target: deploy_all
+ ================================= -->
+ <target name="deploy_all" depends="deploy_solr, deploy_sonyengine" description="²description">
+ </target>
+
+</project>
Binary file engine/build/lib/catalina-ant.jar has changed
--- a/web/thdProject/apps/frontend/config/routing.yml Fri Apr 16 11:35:35 2010 +0200
+++ b/web/thdProject/apps/frontend/config/routing.yml Tue Apr 20 10:26:29 2010 +0200
@@ -49,13 +49,12 @@
########
# TAGGING
########
-
+
tagging:
url: /tagging/:tag/:page_nb
- param: { module: tag, action: index, tag:all, page_nb: 1 }
+ param: { module: tag, action: index, tag: all, page_nb: 1 }
requirements: { page_nb: \d+ }
-
########
# FILMS
########
@@ -69,9 +68,18 @@
url: /top-des-films/:page/:page_nb
param: { module: films, action: viewTopFilmList, page: page, page_nb: 1 }
-
-
+
+#########
+# REFLEXONOMIES
+#########
+
+searchReflex:
+ url: /reflex/:film_uniqueid/:tag/:direction/:distance
+ param: { module: reflex, action: index, tag: all, direction: more, distance: 5 }
+ requirements: { direction: more|less, distance: \d+ }
+
+
default_index:
url: /:module
param: { action: index }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,48 @@
+<?php
+
+/**
+ * reflex actions.
+ *
+ * @package thd
+ * @subpackage reflex
+ * @author Your name here
+ * @version SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
+ */
+class reflexActions extends sfActions
+{
+ /**
+ * Executes index action
+ *
+ * @param sfRequest $request A request object
+ */
+ public function executeIndex(sfWebRequest $request)
+ {
+ ///reflex/:film_uniqueid/:tag/:direction
+ // Parse request parameters
+ $format = $request->getRequestFormat();
+ $this->film_uniqueid = (string) $request->getParameter('film_uniqueid');
+ $this->tag = (string) $request->getParameter('tag');
+ $this->direction = (string) $request->getParameter('direction');
+ $this->distance = (int)$request->getParameter('distance');
+
+ $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);
+ foreach($results as $res)
+ {
+ $primaryKeys[] = $res['id'];
+ }
+
+ if(!empty($primaryKeys))
+ {
+ $this->mostTaggedFilms = Doctrine::getTable('ThdFilm')->findByScoredId($primaryKeys);
+ }
+ else
+ {
+ $this->mostTaggedFilms = array();
+ }
+
+ return sfView::SUCCESS;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/actions/components.class.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,31 @@
+<?php
+
+class reflexComponents extends sfComponents
+{
+
+ public function executeReflexNavigator() {
+
+ }
+
+ public function executePlayer() {
+ $ref = '013002';
+ $film_slug = 'apres-lui';
+
+ // 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
+ $videos = $this->film->getVideos();
+ $this->filmVideo = ($videos) ? $videos[0] : null;
+
+ return sfView::SUCCESS;
+ }
+
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/config/view.yml Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,10 @@
+all:
+
+ stylesheets: [ /css/flashplayer.css, search.css ]
+
+ 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/templates/_player.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,98 @@
+<script type="text/javascript">
+ // Charge le player
+ flowplayer("player", "<?php echo flash_path('flowplayer-3.1.2.swf') ?>",
+ {
+ clip: {url: "<?php echo video_path($filmVideo['file']); ?>",
+ autoPlay: false,
+ autoBuffering: true,
+ onSeek: function() {
+ playerSeek();
+ }
+ },
+
+ plugins: {
+
+ content: {url: "<?php echo flash_path('flowplayer.content-3.1.0.swf') ?>",
+ backgroundColor: 'transparent',
+ display: 'none',
+ style: {p: {fontSize: 15}}
+ }
+
+ },
+
+ onLoad: function() {
+ playerLoaded(this);
+ },
+
+ onUnload: function() {
+ playerUnloaded(this);
+ },
+ onError: function(code,msg) {
+ alert(msg);
+ },
+ });
+
+
+ function loadSegments() {
+
+ if ($f().getClip() == undefined) {
+ window.setTimeout("loadSegments()",2000);
+ return false;
+ }
+
+ var duration = Math.round($f().getClip().fullDuration*10) * 100;
+
+
+ var segments = tagTool.segments;
+
+ for (seg in segments) {
+ var segd = segments[seg].sout - segments[seg].sin;
+ var percent = Math.round(segd * 100 / duration);
+ var offset = Math.round(segments[seg].sin * 100 / duration);
+ var c = $('#seg_container_template').clone().removeAttr("id");
+ $("#segments").append(c);
+ $("span", c).html('<strong>' + tagTool.segments[seg].tag +'</strong> par ' + segments[seg].user);
+ $("#seg_0", c).css({'margin-left': offset+'%', 'width': percent+'%'})
+ .attr('id', 'seg_' + seg)
+ .click(function() {
+ seg_id = $(this).attr("id");
+ seg_id = seg_id.substr(seg_id.indexOf('_') + 1);
+ tagTool.playSegment(seg_id, $("#pauseAfter").val());
+ });
+ c.show();
+ }
+ }
+
+
+ function playerSeek() {
+ tagTool.rebuildCurrentTags(tagTool.player.getTime() * 1000);
+ }
+
+
+ function playerLoaded(player) {
+
+ // Charge les tags
+
+
+ tagTool.player = $f("player");
+ tagTool.showTagInPage = false;
+
+ }
+ </script>
+<div id="editor">
+ <h1><?php
+
+ echo $film->getTitle();
+ // original title if exist
+
+ if($film->getOriginalTitle()!= null)
+ {
+ echo " <span class=\"ost\">{".$film->getOriginalTitle()."}</span>";
+ }
+ ?>
+ <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>
+ </div>
+</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/templates/_suggestionFilmList.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,15 @@
+<div id="suggestionFilm-list">
+ <h3 class="head">Les films suivants</h3>
+ <ul>
+
+ <?php
+ foreach($mostTaggedFilms as $item):
+ $tagFilmUri = url_for('@editor?ref='.$item->getRef().'&film_slug='.$item->getSlugUrl());
+ ?>
+ <li>
+ <?php include_component('partials', 'filmItem', Array('film' => $item, 'actionUri' => $tagFilmUri)); ?>
+ <div class="tag-action"><a href="<?php echo $tagFilmUri ?>" class="link-button">Tagger le film</a></div>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+</div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/templates/_tagNavigator.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,12 @@
+<div id="tagNavigator-list">
+ <h3>Autres Tags associés à cet extrait</h3>
+ <ul>
+ <li>
+ <div><span class="tag"><a href="<?php echo "" ?>">-</a>tristesse<a href="<?php echo "" ?>">+</a></span></div>
+ </li>
+ <!-- tag activated -->
+ <li>
+ <div class="tagActivated"><a href="">Enterrement <div class="btnClose">X</div></a></div>
+ </li>
+ </ul>
+</div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,3 @@
+<h3 class="head">Résultats de la recherche reflexonomique</i></h3>
+<?php include_component( "tag", "player" ) ?>
+<?php include_partial('tag/suggestionFilmList', array('filter' => 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems)); ?>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/apps/frontend/modules/search/actions/viewTagListAction.class.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,38 @@
+<?php
+
+class viewTagListAction extends sfAction {
+
+ public function execute($request) {
+
+ // Parse request parameters
+ $format = $request->getRequestFormat();
+ $this->tag = (string) $request->getParameter('tag');
+ $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);
+ }
+ else
+ {
+ $this->mostTaggedFilms = array();
+ }
+
+ return sfView::SUCCESS;
+ }
+}
\ No newline at end of file
--- a/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php Fri Apr 16 11:35:35 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php Tue Apr 20 10:26:29 2010 +0200
@@ -2,7 +2,7 @@
<h3>Autres Tags associés à cet extrait</h3>
<ul>
<li>
- <div class="tag">tristesse</div>
+ <div><span class="tag"><a href="<?php echo url_for('@searchReflex?film_uniqueid=&tag=tristesse&direction=less&distance=5'); ?>">-</a>tristesse<a href="<?php echo "" ?>">+</a></span></div>
</li>
<!-- tag activated -->
<li>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/test/functional/frontend/reflexActionsTest.php Tue Apr 20 10:26:29 2010 +0200
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/reflex/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'reflex')->
+ isParameter('action', 'index')->
+ end()->
+
+ with('response')->begin()->
+ isStatusCode(200)->
+ checkElement('body', '!/This is a temporary page/')->
+ end()
+;