Hi, Youcef,

> ________________________________________
> From: [email protected] [[email protected]] On Behalf Of Bey Youcef 
> [[email protected]]
> 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 
[email protected] 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
> [email protected]
> 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
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to