Getting documents list of a Blog Category

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting documents list of a Blog Category

Bey Youcef
Hi All,

I'm trying to do the following task without any success.

Getting a list of documents of a specific Blog Category (Let's say Category
"C"). After getting all documents of "C", then getting from each document
the "Summary" field.

Would it be possible to lead me on how to do this task in Velocity?

Any help will be strongly appreciated.

ps. I'm working on Google Map extension for supporting several positions; I
will push it as soon as I finish it.

Best wishes

Youcef
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: Getting documents list of a Blog Category

rrodriguezIDIS
Hi, Youcef,

> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Bey Youcef [[hidden email]]
> Sent: 03 April 2013 19:30
> To: XWiki Developers
> Subject: [xwiki-devs]  Getting documents list of a Blog Category
>
> Hi All,
>
> I'm trying to do the following task without any success.
>
> Getting a list of documents of a specific Blog Category (Let's say Category
> "C"). After getting all documents of "C", then getting from each document
> the "Summary" field.
>
> Would it be possible to lead me on how to do this task in Velocity?
>

Yes, it is possible. Blog entry are "regular" XWiki documents with a BlogPostClass class instance. As any other item within XWiki. All you have to do is to ask for any document holding a BlogPostClass instance with a given value in the property category and ask for the content of the extract property.

Blog.CategorySheet document in your installation should offer all the clues you are needing. Just take a look at it and try to understand how it works...

http://your.host.here/bin/edit/Blog/CategorySheet?language=en&editor=wiki

Some thing much simpler as an entry-level example...

{{velocity filter="none"}}
#set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='Blog.BlogPostClass' ")
#foreach ($item in $xwiki.searchDocuments($sql))
#set($itemdoc = $xwiki.getDocument($item))
* [[$itemdoc.fullName>>$itemdoc.fullName]] {{html}}$itemdoc.category{{/html}} $itemdoc.extract
#end
{{/velocity}}

Here you have a lot of nice query examples...

http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples

> Any help will be strongly appreciated.
>

I think it would have been better if you had sent the message to [hidden email] as it only involves the use of conventional XWiki methods.

HTH!

Ricardo


> ps. I'm working on Google Map extension for supporting several positions; I
> will push it as soon as I finish it.
>
> Best wishes
>
> Youcef
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs

Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.

Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.

See more languages: http://www.sergas.es/aviso_confidencialidad.htm
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Reply | Threaded
Open this post in threaded view
|

Re: Getting documents list of a Blog Category

Bey Youcef
In reply to this post by Bey Youcef
Hi Ricardo,

It helped me and solved my problem as well !

I've other questions, but as you suggested, I will post them to Users group.

Thaaaaanks so much,


Best wishes.
Youcef


On Wed, Apr 3, 2013 at 7:30 PM, Bey Youcef <[hidden email]> wrote:

>
> Hi All,
>
> I'm trying to do the following task without any success.
>
> Getting a list of documents of a specific Blog Category (Let's say
> Category "C"). After getting all documents of "C", then getting from each
> document the "Summary" field.
>
> Would it be possible to lead me on how to do this task in Velocity?
>
> Any help will be strongly appreciated.
>
> ps. I'm working on Google Map extension for supporting several positions;
> I will push it as soon as I finish it.
>
> Best wishes
>
> Youcef
>
>
>
>
>
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs