See below Antonio 2008/5/15 Vincent Massol <[email protected]>:
Hi Antonio,
On May 15, 2008, at 9:42 PM, Antonio Goncalves wrote:
Thanks Jean-Vincent it works. Two more questions.
1) On the API (
it says that the method getWeb is deprecated and that we should use getSpace. But when I do the following it doesn't work (doc.space instead of doc.web) :
#set($query="where doc.*space*='Main'") #set($results = $xwiki.searchDocuments($query, 5, 0)) #foreach ($item in $results) * $item <br/> #end
Looking at the API this should work no ?
no :)
This javadoc is about the XWiki Java API. The string you're using for the query is not calling Java code. It's just a HQL string for doing & query.
Ok. I really thought both things were related. I though doc was just an instance of the Document class.
2) the code ** $item <br/>* just gives me the title of the page, and what if I want to include the entire content of each page. How can I do that ?
Check the javadoc for the Document object.
You'll get the Document object like this: $xwiki.getDocument($item)
Note that there are lots of code snippets that should provide examples on this in code.xwiki.org, in the snippets area. Let us know where you'd have expected help on this in xwiki.org so that we can fix it.
One thing that really would help is to be able to search for code. If you go to code.xwiki.org and search for the string "getDocument" no result is found.
Thanks -Vincent
2008/5/15, Jean-Vincent Drean <[email protected]>:
On Thu, May 15, 2008 at 6:33 PM, Antonio Goncalves <[email protected]> wrote:
so I've tried several queries but in vain. I would like to do something
like
that :
#set($query="where spaces='MySpace'") #set($results = $xwiki.searchDocuments($query, 5, 0)) #foreach ($item in $results) * $item <br/> #end
Any idea ?
Hi,
You can try this :
#set($query="where doc.web='Main'") #set($results = $xwiki.searchDocuments($query, 5, 0)) #foreach ($item in $results) * $item <br/> #end
Other examples are available here : http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- -- Antonio Goncalves ([email protected]) Software architect Paris JUG leader : www.parisjug.org Web site : www.antoniogoncalves.org Blog: jroller.com/agoncal LinkedIn: www.linkedin.com/in/agoncal