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

Le Nouveau opencms at lenouveau.fr
Wed Jul 10 09:37:57 CEST 2013


Hi Paul,

Didn't know this useful option.
Not excatly what I was expecting (not intuitive, as you have to change the
date to see futur news), but could solve my problem.

Thanks.

LeNouveau


2013/7/9 Paul-Inge Flakstad <flakstad at npolar.no>

>  Hi LeNouveau,
> The OpenCms workplace has a "time warp" feature which enables you to view the site as it would appear at the time you specify there. Possibly this could be of help in your situation?
> Cheers,
> Paul
>
> Sendt fra min Sony Xperia™-smarttelefon
>
> Le Nouveau <opencms at lenouveau.fr>:
>
>
>  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 ^^
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130710/5c5844f5/attachment.htm>


More information about the opencms-dev mailing list