Question How do I retrieve properties from a class?

It is a powerful XWiki feature to create new classes, thus new documents holding the properties of this new class. For instance you can create a class Contacts.ContactClass with three string properties "firstname", "surname" and "phone" and use it to create new documents. Each of them will hold all of some of these three piece of information. To have a better idea about how to do that, you might be want to follow the FAQs tutorial

It is frequent that once you have a number of this newly created documents, you want to retrieve a list/table with the available information filtered or not. XWiki has at least two methods that allow you to do that:

  1. $xwiki.searchDocument, the first part of the HQL sentence comes given by the method itself.

    2. $, it will accept any HQL or XPath sentences as parameter.

You will find this clearly documented in the API documentation. Here a link to 1.3.2 API

Be aware that API could change. The update documentation is generated every. Check this out if you are having some problem/doubt when working with these methods.


Get Connected