Wiki source code of Link the Documentation Page to its Extension or Package
Last modified by Eleni Cojocariu on 2026/10/02 09:11
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
| 2 | {{toc/}} | ||
| 3 | {{/box}} | ||
| 4 | |||
| 5 | |||
| 6 | Each documentation page must document either a specific extension or an NPM package. There are, however, cases such as installation or upgrade pages, where the documentation does not relate to any specific extension. In those cases, no Technical ID needs to be associated with the page. | ||
| 7 | |||
| 8 | When a documentation page does document a specific extension or NPM package, it must be associated with the **Technical ID** of what it documents: | ||
| 9 | |||
| 10 | * the **extension ID**, if the page documents an XWiki extension, | ||
| 11 | * the **NPM package name**, if the page documents an NPM package. | ||
| 12 | |||
| 13 | This association is important because the documentation is considered part of the extension it documents. For example, if an extension is removed, its documentation could easily be also removed with it. | ||
| 14 | |||
| 15 | When creating a documentation page, you must fill in the "Technical ID" field within the [[documentation page structure of XWiki.org>>xwiki:documentation.extensions.user.documentation.documentation-xwiki-org.page-structure-xwikiorg.WebHome]], if the page has a "Technical ID" associated. In cases where no "Technical ID" is linked (for example, installation pages), you do not need to fill in this field. Filling this links each documentation page on the main wiki to the extension it comes from, or to the NPM package it comes from. | ||
| 16 | |||
| 17 | == Fill In the ##Extension Id## to the Page == | ||
| 18 | |||
| 19 | To fill in the Extension ID for a [[documentation page>>xwiki:documentation.extensions.user.documentation.create-documentation-page.WebHome]], | ||
| 20 | |||
| 21 | 1.Make sure the documentation page has an object of type ##DocApp.Code.DocumentationExtensionClass##. This object contains the ##Technical Id## field, which is where you will fill in the ID: | ||
| 22 | |||
| 23 | ((( | ||
| 24 | {{image reference="technical-id.png" size="large" alt="The Technical ID field on the documentation page"/}} | ||
| 25 | ))) | ||
| 26 | |||
| 27 | 1. Go to the [[extension>>extensions:Main.WebHome]] page that provides the feature documented in your page. | ||
| 28 | 1. Locate the ##Id## metadata, which is stored in the ##xobject## of type ##ExtensionCode## Class. | ||
| 29 | 1. Access and copy the ID using the [[Object Editor>>xwiki:documentation.xs.user.base.page.edit.edit-object-editor.WebHome]], as illustrated below:((( | ||
| 30 | {{image reference="DocId.png" size="extra"/}} | ||
| 31 | |||
| 32 | * If the extension page does not exist on Extensions, it needs to be [[imported>>extensions:ExtensionCode.ImportExtension]]. Make sure to [[handle the extension page properly>>Community.DocGuide.MigrateDocumentation.HandleOriginalDocumentationPages.WebHome||anchor="HWhenthePageNoLongerContainsDocumentationContent"]] and add the "Documentation" button as described. | ||
| 33 | * If the page exists but the ##Id## field is not filled in, it needs to be completed. | ||
| 34 | ** The Extension ##id## follows the format ##<groupId>:<artifactId>##, where the ##artifactId## corresponds to the extension name (e.g., ##org.xwiki.platform:xwiki-platform-icon-api##). | ||
| 35 | ))) | ||
| 36 | 1. Paste the ##id## from there in the Technical Id field from the documentation page. | ||
| 37 | |||
| 38 | **Note**: This extension ID from the Technical Id field must match exactly the one filled in the [["Website" field from the extension page>>Community.DocGuide.HandleExtensionPages.WebHome]], so that the "Documentation" button correctly lists the documentation pages associated with this extension ID. If the extension ID is prefixed (e.g., with ##xwiki:##) in this field, the same prefix must also be specified in the "Website" field. | ||
| 39 | |||
| 40 | == Fill In the NPM Package == | ||
| 41 | |||
| 42 | 1. Go to [[npmjs.com>>https://www.npmjs.com]]. | ||
| 43 | 1. Search for the ##XWiki## package you are looking for. |