application_formHelper to manage Database List values (used like a Static list) of a class (i18n version)
Developed by

Guillaume Delhumeau

0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


This application is an helper for simple users that allows them to design the fields of a DataBase List, which is used as a Static List that users can easily edit, without needing editing rights on the class. This new version handle the internationalization, but if you don't need it, you can use the simple DBList Manager Application.

This application does not handle the multiple selection.



Just write:
{{mldblist_manager property='..' wikiclass='..' showQuery='true|false' documentHandler='..' showTitle='true|false' /}}

Where :

  • "property" is the property of the class to manage (must be a Database List!).
  • "wikiclass" is the class which contains the property.
  • "showQuery" (optional) is for the class designer: display or not the query to put on the "Hibernate Query" field of the property. (default: false)
  • "documentHandler" (optional) is the document where the Database list entries will be saved. Default: the current document where is used this macro.
  • "showTitle" (optional) shows or not the title. (default: true)

Then, in your class, you can create a 'Database List' property and fill in the 'Hibernate Query' the content that you can display with showQuery parameter of the macro.


Then, instead of writing:

You can write:
{{mldblist_display property='myProperty' objClass='MySpace.MyClass' objNumber="$doc.getObject('MySpace.MyClass').getNumber()" /}}

Options are:

  • "property" is the name of the field to display
  • "objClass" is the class of the object to display
  • "objNumber" is the number of the object to display
  • "objDoc" is the document that contains the object to display (default: current document)
  • "mode" is the mode of the rendering (could be 'view' or 'edit', default: the current edition mode)
  • "fieldName is the name of the input field (only when the mode is 'edit', default: something like MySpace.MyClass_0_myProperty)

Examples of use


  1. In your class, add a Database List field
  2. In the page where you want the user can customise it, call the macro:
  3. Get the Hibernate Query
  4. Put it on the "Hibernate Query" field of your property in your class:
  5. Add some values using the macro


The '$obj.display()' equivalent

#set($obj = $doc.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" /}}

The '$obj.get()' equivalent

#set($obj = $doc.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" mode="view"/}}

An object of an other document

#set($document = $xwiki.getDocument('MyTest.MyDatas'))
#set($obj = $document.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" objDoc='MyTest.MyDatas'/}}

Tested on

This extension has been tested with the following configurations.

Extension VersionXWiki FlavorNotes
1.0XWiki Enterprise 3.5.1, 6.0.1

On 6.0.1 - Missing translations

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Don't forget to add Macros.MLDBListManagerTranslations to your translation files.

Release Notes


First version!
Soon on contrib.

Created by Guillaume Delhumeau on 2012/10/01 18:06

Get Connected