xWiki Structured Data and LiveTable: Beyond Wiki Pages
Most people think of a wiki as a collection of text pages. xWiki challenges that assumption with a structured data layer that turns the platform into a low-code application builder. Through custom classes, object properties, and the LiveTable macro, you can create dynamic, queryable data applications directly within your wiki, no external database or framework required. Asset trackers, contact directories, inventory systems, and project registries all become wiki-native applications that your team can build and maintain without developer involvement.
App Within Minutes
xWiki's App Within Minutes (AWM) wizard is the fastest path from idea to working application. The wizard walks you through defining a data structure, choosing which fields to display, and generating the pages needed to create, list, and view records. Behind the scenes, AWM creates an XWiki class with the properties you define, a sheet page that controls how individual records render, and a home page with a LiveTable that displays all records in a sortable, filterable grid.
The entire process takes minutes rather than days, and the resulting application is immediately usable by your team. AWM supports common field types including text, numbers, dates, drop-down lists, user references, and boolean checkboxes. For most departmental data management needs, AWM produces a fully functional application without any code.
Defining Custom Classes and Properties
When AWM's wizard does not offer enough control, you can define XWiki classes directly through the Class Editor. A class is a schema definition that describes the properties an object can have. Each property has a type, validation rules, and display configuration. The available property types cover a wide range of data modeling needs:
| Property Type | Use Case | Example |
|---|---|---|
| String | Short text values | Asset name, serial number |
| TextArea | Long-form text or wiki content | Description, notes |
| Number | Integer or decimal values | Quantity, price, score |
| Date | Date and time values | Purchase date, warranty expiry |
| Boolean | True/false flags | Active status, approval flag |
| StaticList | Predefined options | Priority (Low/Medium/High) |
| DBList | Dynamic list from database query | Department selector from org chart |
| Users | Reference to wiki users | Assigned owner, reviewer |
| Page | Reference to other wiki pages | Related documentation link |
Classes are defined once and instantiated as objects attached to wiki pages. Each wiki page can hold objects from multiple classes, enabling rich compositions. A project page might carry a ProjectInfo object with structured metadata alongside free-form wiki content that provides narrative context.
LiveTable: Dynamic Data Display
The LiveTable macro is the primary interface for viewing and interacting with structured data collections. It renders a dynamic table that loads data via AJAX, supports column sorting, per-column text filtering, and pagination. Users interact with LiveTable as they would with a spreadsheet or database view, but the underlying data lives within wiki pages as XWiki objects.
Embedding a LiveTable on any wiki page requires a macro call that specifies the class to query and the columns to display. A basic LiveTable for an asset tracking application might be configured as follows:
{{velocity}}
#set($collist = ['doc.name', 'asset_name', 'serial_number', 'location', 'assigned_to', 'purchase_date', 'status'])
#set($colprops = {
'asset_name' : { 'type': 'text', 'link': 'view', 'sortable': true, 'filterable': true },
'serial_number' : { 'type': 'text', 'sortable': true, 'filterable': true },
'location' : { 'type': 'text', 'sortable': true, 'filterable': true },
'assigned_to' : { 'type': 'text', 'sortable': true },
'purchase_date' : { 'type': 'date', 'sortable': true },
'status' : { 'type': 'list', 'sortable': true, 'filterable': true }
})
#set($options = { 'className': 'AssetTracker.AssetClass', 'resultPage': 'AssetTracker.LiveTableResults' })
#livetable('assets' $collist $colprops $options)
{{/velocity}}
LiveTable handles pagination transparently, loading only the visible rows from the server. This makes it efficient even for datasets with thousands of records, as long as the underlying queries are properly indexed. The filtering controls update results in real time, providing an interactive experience that rivals dedicated database front-ends.
CRUD Operations on Structured Data
Creating, reading, updating, and deleting records in a structured data application follows a natural wiki workflow. Creating a new record means creating a new wiki page with an object of the appropriate class attached. The sheet page, which AWM or you configure, renders a form for data entry. Editing a record is editing the wiki page, with the form fields bound to object properties. Deletion removes the page and its objects.
This wiki-native approach to CRUD means that structured data inherits all of xWiki's content management features: version history, diff views, access control, comments, and notifications. Every change to a record is tracked in the page history, providing a complete audit trail. This is a significant advantage over standalone database applications where audit logging must be implemented separately.
Building Custom Applications
The combination of classes, sheets, and LiveTables forms a toolkit for building a wide variety of internal applications. An IT asset tracker records hardware inventory with fields for serial numbers, locations, assigned users, and warranty dates. A contact management system stores client details with company associations and interaction history. A change management application tracks requests through approval workflows with status fields and date stamps.
Each of these applications lives within xWiki alongside your documentation and knowledge base content. There is no context switching between a wiki for documentation and a separate tool for data management. A project documentation space can embed a LiveTable showing all open issues, pulling data from an IssueTracker class defined in the same wiki. This integration between narrative content and structured data is xWiki's distinctive strength.
HQL Queries for Advanced Data Access
When LiveTable's built-in filtering is insufficient, xWiki provides direct access to data through HQL (Hibernate Query Language) queries. HQL lets you write SQL-like queries against the wiki's object store, joining across classes, filtering on complex conditions, and aggregating values. A Velocity script can execute an HQL query and render the results in any format, from a simple list to a chart or a custom HTML table.
#set($query = $services.query.hql("select obj.name, prop_status.value, prop_date.value
from BaseObject obj, StringProperty prop_status, DateProperty prop_date
where obj.className = 'AssetTracker.AssetClass'
and prop_status.id.id = obj.id and prop_status.id.name = 'status'
and prop_date.id.id = obj.id and prop_date.id.name = 'purchase_date'
and prop_status.value = 'Active'
order by prop_date.value desc"))
#set($results = $query.execute())
#foreach($row in $results)
## process each row
#end
HQL queries are powerful but should be used judiciously. Complex queries against large datasets can be expensive, so ensure your database is properly indexed and consider caching query results for frequently accessed reports. For organizations running multi-wiki deployments, HQL queries respect wiki boundaries by default, ensuring data isolation between tenants.
Integration with Wiki Content
Structured data applications gain their full value when they connect to the broader wiki ecosystem. A LiveTable embedded in a department's home page provides at-a-glance visibility into tracked items. Velocity macros can pull structured data into narrative pages, generating dynamic summaries like "There are currently 47 active assets across 3 locations." Notification rules can trigger when specific field values change, alerting stakeholders to status transitions without requiring them to poll the LiveTable.
For organizations that need to produce formal reports from structured data, xWiki's PDF export capabilities can render LiveTable data as formatted tables in printed documents. Combined with custom themes for branding, structured data applications become end-to-end business tools that span from data entry through reporting.
xWiki's structured data capabilities turn your wiki into a platform for building the internal tools your team actually needs. From simple lists to complex multi-entity applications, MassiveGRID's managed xWiki hosting ensures your data applications run on fast, reliable infrastructure with database performance tuned for structured queries. Contact us to discuss how MassiveGRID can support your xWiki application development.
MassiveGRID provides optimized cloud hosting for xWiki deployments, with SSD-backed databases, tuned JVM configurations, and proactive monitoring that keeps structured data applications responsive under production workloads.