<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to sort page provider result by number of downloads ? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320650#M7651</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Thanks for your answer.&lt;/P&gt;
&lt;P&gt;That's what I was thinking to do with an event listener but I can not find event listener for download event.&lt;/P&gt;
&lt;P&gt;Do you have any advice to create a listener on the download event?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 07:11:52 GMT</pubDate>
    <dc:creator>Yvan_Frezefond</dc:creator>
    <dc:date>2019-06-21T07:11:52Z</dc:date>
    <item>
      <title>How to sort page provider result by number of downloads ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320648#M7649</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;What is the best solution to sort page provider result by number of downloads ?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 08:37:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320648#M7649</guid>
      <dc:creator>Yvan_Frezefond</dc:creator>
      <dc:date>2019-06-12T08:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort page provider result by number of downloads ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320649#M7650</link>
      <description>&lt;P&gt;You can sort the list of results based on a field. That mean, you can order only based on information you have stored. The number of downloads of a document is not stored by default, you will need to store that value in a custom field for example, and then sort results based on that field.&lt;/P&gt;
&lt;P&gt;One way of doing it is by creating a listener that increases the value of the custom field every time someone downloads a file.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 16:05:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320649#M7650</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2019-06-20T16:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort page provider result by number of downloads ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320650#M7651</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Thanks for your answer.&lt;/P&gt;
&lt;P&gt;That's what I was thinking to do with an event listener but I can not find event listener for download event.&lt;/P&gt;
&lt;P&gt;Do you have any advice to create a listener on the download event?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 07:11:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320650#M7651</guid>
      <dc:creator>Yvan_Frezefond</dc:creator>
      <dc:date>2019-06-21T07:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort page provider result by number of downloads ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320651#M7652</link>
      <description>&lt;P&gt;Hi Yvan, if you haven't found a solution for this, my advice is to try to track the downloads by restricting them to a custom user action, so that users can only download by clicking this particular custom download button. Then you can attach a counter to that custom user action.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 23:08:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320651#M7652</guid>
      <dc:creator>LaraGranite_</dc:creator>
      <dc:date>2019-07-09T23:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort page provider result by number of downloads ?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320652#M7653</link>
      <description>&lt;P&gt;Hi LaraGranite,&lt;/P&gt;
&lt;P&gt;Thanks for your answer.&lt;/P&gt;
&lt;P&gt;I was thinking to to that but I think that the the easiest way to do it is with a listener as said by Rodri.&lt;/P&gt;
&lt;P&gt;Here is how I do that :&lt;/P&gt;
&lt;P&gt;download-listener-contrib.xml :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;component name="fr.mycompany.listener" version="1.0"&amp;gt;    &amp;lt;extension target="org.nuxeo.ecm.core.event.EventServiceComponent" point="listener"&amp;gt;        &amp;lt;listener name="downloadListener" async="true" postCommit="true"                  class="fr.mycompany.listener.DownloadListener"&amp;gt;            &amp;lt;event&amp;gt;download&amp;lt;/event&amp;gt;        &amp;lt;/listener&amp;gt;    &amp;lt;/extension&amp;gt;&amp;lt;/component&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DownloadListener.java :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;package fr.mycompany.listener;import org.nuxeo.ecm.core.event.Event;import org.nuxeo.ecm.core.event.EventContext;import org.nuxeo.ecm.core.event.EventListener;public class DownloadListener implements EventListener {    @Override    public void handleEvent(Event event) {        // Incrementing download count property    }}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 07:48:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-sort-page-provider-result-by-number-of-downloads/m-p/320652#M7653</guid>
      <dc:creator>Yvan_Frezefond</dc:creator>
      <dc:date>2019-07-10T07:48:31Z</dc:date>
    </item>
  </channel>
</rss>

