[opencms-dev] Listing all news, even the non-released ones
Paul-Inge Flakstad
flakstad at npolar.no
Tue Jul 9 17:14:33 CEST 2013
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 ^^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130709/c6c67e65/attachment.htm>
More information about the opencms-dev
mailing list