Unified Documents Application
| Contrib extension which depends on xwiki-platform |
| Type | XAR |
| Category | Other |
| Developed by | Clément Aubin, slauriere |
| Active Installs | 0 |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Description
The unified documents application allows building large XWiki documents that are multilingual and created from an assembly of multiple sections. Each section can then be edited separately.
The application currently integrates also a system based on the Publication Workflow Application to publish the sections.
General overview

Setup & general usage
The following section presents a simple deployment use-case for the application. As part of this example, we will be using a part of the structure of the General Conditions that XWiki SAS uses for its products.
Sections names
To start using the application, you will need to first create Sections. Sections will be very simple documents that just contain the title of a section you would like to include within your unified documents.
Once the Unified Documents application is installed, you can create the first sections under the page UnifiedDocument.Section. For each section, create a new page of type “Section name” and give it a title.


Section names are here only to help define the “skeleton” of the documents that will be produced. The contents of each section will be separately created, through section contents.
De-coupling section names and section contents allow having multiple translations of one section, and thus multiple translations of a unified document.
Section contents
Each section content document will be linked to a section. One section can thus have multiple section contents (one in each language).
Setup
Section contents should be edited through a publication workflow by default. The setup of a publication workflow for editing section contents is out of the scope of this documentation.
Depending on your use-case, you may want to create sections in different parts of the wiki. Start by creating a page that will contain all the section contents that you plan to create, then update the section content template provider to suggest the creation of section contents within the page you created. The template provider is accessible in the document : UnifiedDocument.Code.SectionContent.SectionContentTemplateProvider. In this example, we will simply create a page UnifiedDocument.Contents to list our contents.


Creating new section contents
Once the setup of the space where section contents will be created is done, you can start adding contents for your unified documents. When creating a new section content, select the template “Section”.
Upon creation of the section, you will need to provide the section name to which this section content corresponds. The application will automatically check if a section content for the given section name, in the current language already exists, in order to prevent duplicates.

image-20221128102755-6.png
Once saved, you will be able to start writing the contents of the section.

The application allows to configure whether the section name of a section content can be modified after the section content has been modified. When refactoring unified documents, it can be useful indeed to purposely modify the section name of a section content to a different value. This option can be activated in the Unified Document section of the Administration module. Beware that when it is activated, it is up to users to make sure that a section is used only by one section content.
Unified documents
Unified documents can be created with the template "Unified document" :

Upon creating a unified document, you will be able to select the "Content space" of the document, which corresponds to the location in XWiki where published section contents are defined.
When editing the Unified Document, you will be able to add new sections to be displayed and organize them to create the structure of the document. Section numbering is done automatically.



Glossary entries in Unified Documents
If the Glossary Application is installed on the wiki, any Unified document can be configured to display the contents of the document (through the {{glossaryEntries/}} macro) on the document. The Unified Document can be configured to display these glossary entries :
- Always (in the wiki and in exports)
- Only during exports of the document
- Never
Table of contents
The application provides a table of contents ready to be integrated to browse contents within a unified document, through the panel UnifiedDocument.Code.UnifiedDocument.UnifiedDocumentTocPanel.
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:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Versions
Dependencies
Dependencies for this extension (org.xwiki.contrib.unifieddocument:application-unified-documents-ui 1.2.7):