J'ai eu l'occasion il y a déjà quelque temps d'ajouter un fil rss pour un besoin d'affichage spécifique de certaines ressources.
En quelques mots, il s'agissait de produire un fil rss contenant une liste de publications scientifiques qui est affichée ensuite par un composant Infoglue.
Il fallait modifier le contenu du fil pour l'adapter à la demande:
Au lieu du fil rss :
<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <item> <title>Adult/young ratio influences song acquisition in female European starlings (Sturnus vulgaris)</title> <description>One parallel between humans and most songbirds is the fact that young require social interactions with an adult to acquire specific vocalizations. Songbirds are considered good models for comparative studies, although reports to date concern almost exclusively male songbirds. In addition, adult influence on vocal communication is generally investigated only in restricted social contexts (usually dyads). Here, we analysed song learning and spatial associations among young female starlings that were maintained for one year in dyads (1 adult/1 young), triads (2 adults/1 young) or larger group (7 young/2 adults). Segregation by age was seen in the triads and in the larger group. The influence of adults (proportion of songs copied from adults) decreased as social complexity increased. Unusual temporal features were observed in young maintained in triads and young neglected copying adult songs in the presence of peers. These results are among the first to explore the circumstances under which females learn and from whom they learn. They also add new insight to a wide range of questions about social influences on learning.</description> <author>Bertin, A.; Hausberger, M.; Henry, L.; Richard-Yris, M.-A.; EthoS, UMR 6552; CNRS; Université de Rennes 1</author> <pubDate>Wed, 31 Dec 2008 23:00:00 GMT</pubDate> <link>http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939</link> <guid isPermaLink="true">rennes1-ori-wf-1-1939</guid> <content:encoded><![CDATA[ <br/><b>URL: <a href="http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939" target="_blank">http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939</a></b> ]]></content:encoded> </item> .... </channel> </rss>Il fallait le fil :
<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> ... <item> <title>Adult/young ratio influences song acquisition in female European starlings (Sturnus vulgaris)</title> <description>Journal of Comparative Psychology, 2009, 123, 195-203</description> <author>Bertin, A.; Hausberger, M.; Henry, L.; Richard-Yris, M.-A.; EthoS, UMR 6552; CNRS; Université de Rennes 1</author> <pubDate>[2009]</pubDate> <link>http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939</link> <guid isPermaLink="true">rennes1-ori-wf-1-1939</guid> <content:encoded><![CDATA[ <br/><b>URL: <a href="http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939" target="_blank">http://localhost:8184/ori-oai-search/notice/view/rennes1-ori-wf-1-1939</a></b> ]]></content:encoded> </item> .... </channel> </rss>
En gros, il fallait modifier le contenu des champs rss <description> et <pubDate>.
Voici les extraits des fichiers modifiés.
Pour la partie configuration (config.xml) :
<!-- Menu permettant de construire le fil rss de publications scientifiques décrites en DC -->
<advanced_search hide="true" key="advanced" file="ur1-scd-dc_advanced.xml">
<hidden_fields>
<hidden_field vocabularyId="search_metadata_namespaces:dc">
<metadata>md-ori-oai-namespace</metadata>
</hidden_field>
</hidden_fields>
<result_fields id="publication_no_fulltext"/>
<sort_fields id="year_author"/>
<rss_fields id="publication"/>
</advanced_search>
...
<!-- ======== result
fields pour le fil rss publication ======== -->
<result_fields
id="publication_no_fulltext"
jsp_file="documents-results-ur1-scd.jsp">
...
<result_field
key="resource">
<metadata>//dc:source</metadata>
<metadata>//dc:identifier</metadata>
</result_field>
</result_fields>
...
<!-- ======== rss
fields ======== -->
<rss_fields
id="notice" link="notice">
<title>title</title>
<author>author</author>
<description>description</description>
<pubDate>date</pubDate>
</rss_fields>
<! le nouveau fil rss
-->
<rss_fields id="publication"
link="publication">
<title>title</title>
<author>author</author>
<description>resource</description>
<pubDate>date</pubDate>
</rss_fields>
Par exemple, pour afficher le contenu du champ rss <description> :
<c:if test="${rssDescription!=null}">
<c:if test="${resultFieldKey==rssDescription}">
<c:forEach begin="0" end="${resultField.metadatasSize-1}" var="index_md">
<c:set var="md_name" value="${resultField.metadatas[index_md].name}" />
<c:set var="values_size" value="${result.values[md_name].transformedValuesSize}" />
<c:if test="${values_size!=0}">
<c:if test="${resultField.key=='description'}">
<c:forEach begin="0" end="${values_size-1}" var="index_value">
<c:set var="cell_content" value="${cell_content}${result.values[md_name].transformedValues[index_value]}" />
<c:if test="${index_value!=(values_size-1)}">
<c:set var="cell_content" value="${cell_content}<br/>" />
</c:if>
</c:forEach>
</c:if>
<c:if test="${resultField.key=='resource'}">
<c:forEach begin="0" end="${values_size-1}" var="index_value">
<c:set var="value_to_add" value="${result.values[md_name].transformedValues[index_value]}" />
<c:if test="${not (fn:startsWith(value_to_add, 'http')) and not (fn:startsWith(value_to_add, 'https'))}">
<c:if test="${not (fn:endsWith(cell_content, '-- ')) and cell_content!='' and value_to_add!=null}">
<c:set var="cell_content" value="${cell_content} -- " />
</c:if>
<c:set var="cell_content" value="${cell_content}${value_to_add}" />
</c:if>
</c:forEach>
</c:if>
</c:if>
</c:forEach>
</c:if>
<c:if test="${cell_content!=''}">
<description><c:out value="${cell_content}"/></description>
</c:if>
</c:if>
Pour modifier l'affichage du contenu de <pubDate> , on se sert du lien link="publication" déclaré dans la configuration du fil rss :
<c:if test="${rssPubDate!=null}">
<c:if test="${resultFieldKey==rssPubDate}">
<c:forEach begin="0" end="${resultField.metadatasSize-1}" var="index_md">
<c:set var="md_name" value="${resultField.metadatas[index_md].name}" />
<c:choose>
<c:when test="${rssLink=='publication'}">
<c:set var="cell_content" value="${result.values[md_name].retrievedValues}" />
</c:when>
<c:otherwise>
<c:set var="cell_content" value="${result.values[md_name].dateValue}" />
</c:otherwise>
</c:choose>
</c:forEach>
</c:if>
<c:if test="${cell_content!=''}">
<pubDate><c:out value="${cell_content}"/></pubDate>
</c:if>
</c:if>
En espérant que ça t'aide,
Henri
Le 29/03/2011 14:30, fabien.peslier@univ-angers.fr a écrit :
" type="cite">Bonjour, Aie, dommage... Je vais continuer à chercher alors, et poster la réponse ici... si je la trouve ! :) Cordialement, Fabien Peslier
-- Henri Jacob Centre de Ressources Informatiques (CRI) Université de Rennes 1 tel: 02 23 23 71 37