Data Model

Version 64.6 by Eleni Cojocariu on 2025/10/22 10:02

XWiki is not just your average wiki engine; it exposes a flexible data model that can be leveraged at the presentation level. Combined with its powerful presentation level scripting capabilities, XWiki's data model can help you build simple to complex Web applications with little or no need to access the XWiki core. In other words, you can build custom applications through the XWiki web interface without having to compile, package, and deploy software components.

This area explains XWiki's data model of Classes, Properties, and Objects for those users who want to build applications primarily at the presentation level. It will help you understand how you can achieve significant features by programming at this level alone.

For information about XWiki's underlying database schema (tables and fields), see: XWiki's Database Schema.

XWiki Classes, Objects, and Properties

If you are familiar with object oriented programming, you understand the concept of classes, properties, and objects. The presentation level data model that XWiki exposes is much the same.

Classes

See XWiki Classes.

Properties
Properties are the characteristics that an object can have. In a class definition, the properties define the data fields that each unique instance of the class can have values for. Properties have displayers which control how the property value is displayed in view or edit mode. Some displayers use advanced pickers to help you input a valid property value.
XWiki currently supports the following kinds of properties (data types):
 Field Type Since Version  Description  Screenshots
String Allows to store and display one line texts  
TextArea Allows to store and display large text fields (text and wysiwyg) 
Number Allows to store and display Numbers of type integer,long,float,double 
Password Allows to store password fields which can be encrypted or hashed  
EMail4.2M3 Allows to store email fields that can be obfuscated at display time  
Boolean Allows to store and display boolean values (yes/no or 1/0) which can be displayed as select or checkbox fields  
Static List Allows to store and display single-select or multi-select fields that can be displayed as select, checkbox, radio or suggests fields. The possible values of static list fields are configured in the field definition.
Database List Allows to store and display single-select or multi-select fields that can be displayed as select, checkbox, radio or suggests fields. The possible values of database list fields are taken from the execution of a query on other XWiki data such as pages or objects. The query is typically expressed in the Hibernate Query Language (see XWiki Query Module) and it can use the Velocity script notation (as long as the XWiki class author has the required scripting permission) for including dynamic parameters such as the current page space, the current time, etc.dbListSuggestInput.png
Database Tree List Same as a Database List field, with the addition that the data can be displayed as a tree, using the Yahoo Javascript Tree library  
Page4.2M3Same as a Database List field, but made to store XWiki page names. 

pageSuggestInput.png

Date Allows to store and display date or datetime values. A date picker is used automatically for this field as shown below. 

dateTimePicker.png

User List Allows to store and display single-select or multi-select users. The field uses a user picker as shown below.

userPicker-singleSelection.pnguserPicker-multipleSelection.pnguserPicker-view.png

Group List Allows to store and display single-select or multi-select groups. The field uses a user picker as shown below.

groupPicker-editMultiple.png

Computed Pseudofield4.2M3Allows to create a pseudo field for which the display can be configured using a custom displayer and the value retrieved by using a script. It allows to combine other fields together. 
Time Zone7.3M1Allow to display and edit Time Zones. 
Objects

See XWiki Objects.

Suggested Reading

  • Armed with your knowledge of Classes and Objects you could try creating a small application, such as:
  • You could also start understanding how to display properties of Objects in wiki pages by using Scripting.
  • You could also try using the App Within Minutes extension which simplifies how to get started developing an application with little required knowledge. After your application is generated, if you wish to go further and develop new features for your app, you'll need to use your knowledge about Classes, Objects and Scripting.
  • More information on the Custom Display field and an example

Get Connected