velocityHqlExamples

Version 9.2 by Vincent Massol on 2008/07/31
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Velocity HQL query examples

XWiki allows user to access documents and objects with hql queries in Velocity scripts.

Invalid macro parameters used for the [toc] macro. Cause: [Failed to validate bean: [must be greater than or equal to 1]]. Click on this message for details.

Public API (searchDocuments)

With this API the query consist in the WHERE condition.\ Any user with edit rights can use this API (as in write a script using it).\ Any user with view rights can view the result of such a query.

You can execute queries as follows:

#set($query="where doc.creator='XWiki.VincentMassol'")
#set($results = $xwiki.searchDocuments($query, 5, 0))
#foreach ($item in $results)
* $item
#end

Simple Query

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:Documentation.DevGuide.Scripting.velocityHqlExamples.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

Tags: HQL
   

Get Connected