[opencms-dev] Listing all news, even the non-released ones

Le Nouveau opencms at lenouveau.fr
Tue Jul 9 16:32:52 CEST 2013


Hi,

First of all, sorry if this mailing is not made to solve my problem, I
wasn't sure.
If it's the case, please tell me.

I would like to list all my news, even the non-released ones if I'm
connected as an admin.

Here is my JSP code :
<cms:contentload collector="byQuery"
      param="fq=type:news&sort=collector.date_prop
desc|createPath=/.content/news/news_%(number:5).html"
      editable="true"
      pageSize="${nbResults}"
      pageIndex="1"
      pageNavLength="${nbResults}">
   [...]
</cms:contentload>

Here is my XSD code :
<mapping>
  <mapping element="Date" mapto="property:collector.date"/>
   <mapping element="Date" mapto="attribute:datereleased"/>
</mappings>

But the problem with this code, is that it's impossible to display news
released in the futur, even as Admin.
According to logs, all news are matched, but once displayed I only have
released ones.




So, I tried not to mapp "attribute:datereleased".
JSP Code :
<cms:contentload collector="byQuery"
      param="fq=type:news&fq=collector.date_prop:[* TO
NOW]&sort=collector.date_prop
desc|createPath=/.content/news/news_%(number:5).html"
      editable="true"
      pageSize="${nbResults}"
      pageIndex="1"
      pageNavLength="${nbResults}">
   [...]
</cms:contentload>
(As Admin, I use the same request but without "collector.date_prop:[* TO
NOW]"

With in my XSD :
<mapping>
  <mapping element="Date" mapto="property:collector.date"/>
</mappings>

But this time, collector.date_prop isn't well read :
fq=collector.date_prop:[* TO NOW] returns everything (even 1 mounth later)
fq=collector.date_prop:[* TO NOW] returns nothing
I imagined it's because of timestamp problems (sometimes in sec, sometimes
in millisec), but nothing to prove it.



So, do someone know how to solve my problem ?
What am I doing wrong ?

Thanks in advance for help.

Regards,
LeNouveau

PS : Sorry for my english too ^^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130709/b63d62ac/attachment.htm>


More information about the opencms-dev mailing list