Database List

Last modified by Vincent Massol on 2020/02/17

Note that the following screenshots are taken from using AWM but you'll find the same properties when using the class editor.

Displaying XWikiDocument properties

To display XWikiDocument properties values like doc.title, doc.author, doc.fullName (see full list on the Hibernate mapping document) from another application (represented for example by the class Domains.Code.DomainClass)you can use the following fields:

  • XWIKI CLASS NAME (the class for the application you want to pull the data from)
  • ID FIELD NAME (usually "doc.fullName" to uniquely identify the document(s) selected)
  • VALUE FIELD NAME (usually doc.title because it represents the pretty name displayed to the user)

AWM Example

Displaying custom properties

When you need to display a certain property value from another application (represented for example by the class application.Code.applicationClass) inside the database list you should use the "Hibernate Query" field. For example, to fill in the list with the values of the property "shortText1" (property name automatically generated by the AWM wizard) for an AWM "application", the "Hibernate Query" field should use the following value (assuming "shortText1" is "Short Text" which means "StringProperty" for the Hibernate mapping):

select d.fullName, prop.id.value from XWikiDocument as d, BaseObject as o,
  StringProperty as prop where o.name = d.fullName and o.className = 'application.Code.applicationClass'
 and d.fullName <> 'application.Code.applicationTemplate' and o.id=prop.id.id and prop.id.name='shortText1'

AWM Example

How it looks in a LiveTable

  • The "application list" property is displayed using a "database list" and the "Hibernate Query" above
  • The "domains" property is displayed using a "database list" and the XWikiDocument properties

Related Reading

Get Connected