Skip to content

Commit eea2d4e

Browse files
authored
Fix#187: Refactor product schema (openSUSE#197)
These changes reflect broad architectural shifts and naming conventions throughout the entire configuration system. * **Rebranding**: The naming convention has shifted from Docserv to Portal. This is reflected in namespace changes and element renaming (e.g., `<product>` is now part of a portal root). * **Documentation-First Design**: The schema now heavily utilizes `db:refname` and `db:refpurpose` annotations for almost every element and attribute. This allows for automated generation of human-readable documentation directly from the RNC file. * *Enhanced Modularity**: The schema now explicitly supports splitting large configuration files into smaller, more manageable parts. By utilizing inclusion mechanisms, you can maintain different sections of the portal (like `<categories>` or specific products) in separate files, leading to a cleaner and more maintainable structure. * **Implicit Language Logic**: Master/source language identification has shifted from a boolean attribute (`@default`) to a value-based system. The schema now assumes `en-us` is the source locale for products and deliverables. * **Migration Tooling**: To facilitate the transition, an XSLT migration stylesheet is available. This tool automates the conversion of version 6.0 configuration files to the 7.0 format, handling the renaming of elements, restructuring of attributes, and the removal of deprecated metadata. Version 7.0 introduces several elements to support a more hierarchical portal structure and better metadata documentation. * New elements * New `<portal>` element (root element of everything) * Add optional `<spotlight>` element The `linkend` attribute points to a specific product, docset, or deliverable. Two possible notations: with and without text (empty element). * Insert XInclude definition Disable specific attributes like `xpointer`, `fragid`, `language`, and `accept`. * Add `<productfamilies>` and `<series>` to portal Both contain an `<item id="..."> ... </item>`. Having text inside `<item>` makes it easier and we don't need an additional `name` attribute. * Changed content models * The `start` pattern allows `<product>`, `<docset>`, `<categories>`, `<category>`, and `<descriptions>`. * Simplified `<link>`: Allows multiple URLs in `<link>`. This makes it possible to have different formats. Additionally allow a `<desc>` element to describe the resource. * Major elements now support `<xi:include>`, allowing configuration files to be broken into smaller, manageable chunks. * `<ref/>` contains only a `@linkend` attribute to link to a resource. You don't need `dc`, `product`, or some other strange combination. * Renamed elements * `<desc>` -> `<descriptions>` Move <desc> elements into a parent <descriptions> * `<builddocs>` -> `<resources>` Container for definitions of resources * `<overridedesc>` -> `<descriptions>` Version-specific content * `<builddocs>/<language>` -> `<locale>` Require at least one <locale> with lang="en-us" as default language. * Removed elements * Disable `<param>` in `<deliverable>` * Remove `<buildcontainer>` from `<builddocs>` * Remove ds.deliverablerestricted ds.subdeliverablerestricted * New attributes * Add xml:base for all start elements This is needed when elements are xincluded they get automatically a xml:base attribute. * Add `family` and `series` for `<product>` * Add optional `rank` in `<product>` * Optional `sitemap` for `<deliverable>` * Add `linkend` in `<language>` * Include `lang` in `<url>` * Changed attributes * Use xsd:language for ds.type.lang pattern The xsd:token isn't the right one. * Make schemaversion optional on <product> * Add datatypes library (xsd prefix) * Raise `schemaversion` value to `7.0` * Change type from xsd:token to xsd:IDREFS for `category` * Renamed attributes * `productid`, `categoryid`, `setid`, `linkid` are all "id" now They are of type ID (not just token or string) * Removed attributes * `meta` in deliverable * `default` in `<desc>` Use required lang="en-us" instead of default="true" * Remove double ds.titleformat.attr definition
1 parent bde1dda commit eea2d4e

361 files changed

Lines changed: 75163 additions & 926 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,4 @@ audit_reports/
289289
git_repos/
290290
.DS_Store
291291
lean_audit.txt
292+
output/
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Portal Configuration
2+
3+
This directory contains:
4+
5+
* A RELAX NG schema (`src/docbuild/config/xml/data/product-config-schema.rnc`).
6+
It's the successor of the previous Docserv product schema.
7+
* An example `config.d` directory.
8+
9+
## File structure
10+
11+
The `config.d` directory contains several subdirectories
12+
13+
```text
14+
config.d/
15+
├── categories/
16+
│ ├── [... more languages ...]
17+
│ ├── de-de.xml
18+
│ └── en-us.xml
19+
├── cloudnative/
20+
│ ├── [... similar to sles/... ]
21+
│ └── cloudnative.xml
22+
├── portal.xml
23+
└── sles/
24+
├── desc
25+
│ ├── [... more languages ...]
26+
│ ├── descriptions.xml
27+
│ ├── de-de.xml
28+
│ └── en-us.xml
29+
├── docsets
30+
│ ├── [... more docsets ...]
31+
│ └── 16.0.xml
32+
└── sles.xml
33+
```
34+
35+
* `config.d/`: the configuration directory with all portal configuration
36+
* `categories/`: A directory that contains all categories.
37+
* `portal.xml`: The main entry file which references all categories and
38+
product configuration.
39+
* `sles/sles.xml`: The main product configuration for SLES.
40+
* `sles/desc/`: contains all language specific descriptions.
41+
* `sles/docsets/`: contains all docsets of a product.
42+
Depending on the complexity of the product, this may not always be
43+
needed. For SLES, it would probably useful.
44+
45+
## Creating combined config
46+
47+
To create a single XML config, use the following command:
48+
49+
```shell
50+
xmllint --xinclude \
51+
--output portal-$(date --iso-8601).xml \
52+
src/docbuild/config/xml/data/config.d/portal.xml
53+
```
54+
55+
## Migrating to the new portal schema
56+
57+
To migrate an old Docserv stitchfile to a _single portal XML config_, use
58+
the following command:
59+
60+
```shell
61+
$ xsltproc --param use.xincludes "0" \
62+
--stringparam outputdir "./" \
63+
--stringparam outputfile portal-test.xml \
64+
--stringparam schemafile "portal-config.rnc" \
65+
convert-v6-to-v7.xsl docserv-stitch-2026-??-??.xml
66+
Written file: "portal-test.xml"
67+
```
68+
69+
The result is written to the file `portal-test.xml`.
70+
71+
The XSLT parameters have the following meaning:
72+
73+
* `use.xinclude` (default: `false()`): split the result config into different files and use XInclude elements to refer to.
74+
* `outputdir` (default `output/`): determines the directory to write output files to. Mind the trailing slash.
75+
* `outputfile` (default: `portal.xml`): The main output base filename.
76+
* `schemafile` (default: empty): The RNG or RNC schema file that is referenced in a `<?xml-model?>` processing instruction at the header.
77+
The stylesheet takes care of the format and creates the appropriate PI.
78+
79+
To create a splited XML config, use the following command:
80+
81+
82+
```shell
83+
xsltproc --xinclude \
84+
--param use.xinclude 1 \
85+
--stringparam outputdir "config.d/" \
86+
convert-v6-to-v7.xsl \
87+
docserv-stitch-2026-??-??.xml
88+
```
89+
90+
## General Changes
91+
These changes reflect broad architectural shifts and naming conventions throughout the entire configuration system.
92+
93+
* **Rebranding**: The naming convention has shifted from "Docserv²" to "Portal."
94+
95+
* **Enhanced Modularity**: The schema now explicitly supports splitting large configuration files into smaller, more manageable parts. By utilizing inclusion mechanisms, you can maintain different sections of the portal (like `<categories>` or specific products) in separate files, leading to a cleaner and more maintainable structure.
96+
97+
* **Documentation-First Design**: The schema now heavily utilizes `db:refname` and `db:refpurpose` annotations for almost every element and attribute. This allows for automated generation of human-readable documentation directly from the RNC file.
98+
99+
* **Implicit Language Logic**: Master/source language identification has shifted from a boolean attribute (`@default`) to a value-based system. The schema now assumes `en-us` is the default language for products and deliverables.
100+
101+
* **Migration Tooling**: To facilitate the transition, an XSLT migration stylesheet is available. This tool automates the conversion of version 6.0 configuration files to the 7.0 format, handling the renaming of elements, restructuring of attributes, and the removal of deprecated metadata.
102+
103+
* **Resolving Ambiguity**: Some elements were used in multiple contexts, for example, the multipurpose `<language>` element. The new portal schema resolves this ambiguity.
104+
105+
## New Elements and Attributes
106+
Version 7.0 introduces several elements to support a more hierarchical portal structure and better metadata documentation.
107+
108+
### Elements
109+
* `<portal>`: The new root element for the entire portal configuration.
110+
* `<spotlight>`: Used to highlight specific products or deliverables on the entry page.
111+
* `<productfamilies>`: A container for defining product family groupings.
112+
* `<series>`: Defines series/tabs (e.g., SBP, TRD, Products & Solutions).
113+
* `<item>`: Generic element for entries within a family or series.
114+
* `<descriptions>`: A unified wrapper for product or version descriptions.
115+
* `<categories>`: A wrapper for grouping category definitions.
116+
* `<resources>`: Replaces the old `<builddocs>` element for defining deliverables.
117+
* `<prebuilt>`: Specifically for defining pre-built content links with metadata.
118+
* `<xi:include>`: An XInclude element pointing to an external XML resource to facilitate modularity.
119+
120+
### Attributes
121+
122+
* `@schemaversion`: Replaces the previous versioning logic for stricter validation against the 7.0 spec.
123+
* `@rank`: Determines the sorting order of products on the portal homepage.
124+
* `@family`: Links a product to a specific product family via `IDREF`.
125+
* `@series`: Links a product to a specific series/tab via IDREF.
126+
* `@path`: Used on products and docsets to specify relative directory names.
127+
* `@linkend`: Used in `<ref\>` elements to point to external link identifiers.
128+
* `@treatment`: Defines how version-specific descriptions interact with global ones (append, prepend, or replace).
129+
* `@sitemap`: Determines whether the resource is included in the sitemap. Default is `true`.
130+
131+
## Renamed Elements and Attributes
132+
133+
Many elements were renamed to move away from "Docserv²" terminology and adopt a cleaner "Portal" naming convention.
134+
135+
| Old Name (v6.0) | New Name (v7.0) | Context |
136+
| :---- | :---- | :---- |
137+
| `<desc>` | `<descriptions>` | Move a single description into a parent `<descriptions>` |
138+
| `<builddocs>` | `<resources>` | Container for definitions of resources |
139+
| `<overridedesc>` | `<descriptions>` | Version-specific content |
140+
| `<language>` (in resources) | `<locale>` | Regional build definitions |
141+
| `@productid` | `@id` (type ID) | Unique identifier for products |
142+
| `@setid` | `@id` (type ID) | Unique identifier for docsets |
143+
| `@categoryid` | `@id` (type ID) | Unique identifier for categories |
144+
| `@linkid` | `@id` (type ID) | Unique identifier for external links |
145+
146+
## Removed Elements and Attributes
147+
148+
The following items were deprecated or removed to simplify the build process and clean up the configuration.
149+
150+
* `<buildcontainer>`: Support for specifying custom Docker images per version has been removed.
151+
* `<param>`: Support for custom XSLT parameters via the config file is removed.
152+
* `@translation-type`: The distinction between "list" and "full" translations has been replaced by a more flexible \<locale\> and reference model.
153+
* `@default`: This attribute (previously used in `<desc>` and `<language>` to flag the source/master language) has been removed. Language master ship is now determined by the explicit `en-us` value in the `@lang` attribute.
154+
* `@meta` from `<deliverable>`
155+
156+
## Changed Content Models
157+
The structure of the schema has evolved to be more modular and better documented.
158+
159+
### Modularization (XInclude)
160+
Major elements now support `xi:include`, allowing configuration files to be broken into smaller, manageable chunks.
161+
162+
## link
163+
Allows multiple URLs in `<link>`. This makes it possible to have different formats. Additionally allow a `<desc>` element to describe the resource.
164+
165+
The minimum structure is this:
166+
167+
```xml
168+
<external>
169+
<link category="about" gated="false">
170+
<!-- Cardinality for <url>: one or more -->
171+
<url href="http://example.com" format="html"/>
172+
<descriptions>
173+
<desc lang="en-us">
174+
<title></title>
175+
</desc>
176+
<!-- more <desc> for other languages -->
177+
</descriptions>
178+
</link>
179+
</external>
180+
```
181+
182+
### Deliverable References
183+
In version 7.0, translations of deliverables are primarily handled as references (`<ref\>`) back to the source DC file in the en-us locale, rather than duplicating the full deliverable metadata.
184+
185+
Additionally, the `<ref/>` contains only a `@linkend` attribute to link to a resource. You don't need `dc`, `product`, or other strange combinations anymore.
186+
187+
### Expanded Root Element Support
188+
The schema no longer restricts the start of a document to just a product definition. It now allows for much more variety in valid root elements, supporting the standalone definition of `<product>`s, `<docset>`s, `<categories>`, and more.
189+
190+
### Simplified External Link Model
191+
The model for external links has been significantly flattened. The previous hierarchical structure involving nested `<language>` elements has been removed. Now, a `<link>` directly contains a list of `<url>` elements and a unified `<descriptions>` block, simplifying how external resources are defined across different locales.
192+
193+
194+
## Additional Sources
195+
196+
* https://github.com/openSUSE/docbuild/pull/197
197+
* https://confluence.suse.com/x/0QB5e
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<product xmlns:xi="http://www.w3.org/2001/XInclude" id="appliance" family="f.linux" series="s.pas" rank="04150">
3+
<name>Appliance building</name>
4+
<acronym>appliance</acronym>
5+
<maintainers>
6+
<!-- <contact>[email protected]</contact> -->
7+
<contact>[email protected]</contact>
8+
<contact>[email protected]</contact>
9+
</maintainers>
10+
<xi:include href="desc/desc.xml"/>
11+
<!-- Description is needed for validation, even if empty. Do not remove! -->
12+
<xi:include href="kiwi-9.xml"/>
13+
<xi:include href="keg-2.xml"/>
14+
</product>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<descriptions xmlns:xi="http://www.w3.org/2001/XInclude">
3+
<xi:include href="en-us.xml"/>
4+
</descriptions>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<desc lang="en-us">
3+
<title>Linux system appliance building</title>
4+
5+
</desc>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<docset xmlns:xi="http://www.w3.org/2001/XInclude" lifecycle="supported" id="appliance.keg-2" path="keg-2">
3+
<name>Keg Image Description Generator</name>
4+
<version>2</version>
5+
<descriptions treatment="append">
6+
<desc lang="en-us">
7+
<p>
8+
Keg is a tool which helps to create and manage image descriptions
9+
suitable for the KIWI appliance builder. The primary use case for keg
10+
are situations where many image descriptions must be managed and the
11+
image descriptions have considerable overlap with respect to content
12+
and setup.
13+
</p>
14+
</desc>
15+
</descriptions>
16+
<resources>
17+
<git remote="https://github.com/SUSE-Enceladus/keg.git"/>
18+
<locale lang="en-us" sitemap="false">
19+
<branch>main</branch>
20+
<subdir>doc</subdir>
21+
<deliverable id="app.keg-2.dc-keg" type="dc">
22+
<dc file="DC-keg">
23+
<format epub="0" html="1" pdf="1" single-html="1"/>
24+
</dc>
25+
</deliverable>
26+
</locale>
27+
</resources>
28+
</docset>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<docset xmlns:xi="http://www.w3.org/2001/XInclude" lifecycle="supported" id="appliance.kiwi-9" path="kiwi-9">
3+
<name>KIWI Appliance Builder</name>
4+
<version>9</version>
5+
<descriptions treatment="append">
6+
<desc lang="en-us">
7+
<p>
8+
KIWI NG (Next Generation) is the command-line utility to build Linux
9+
system appliances. The documentation published here is written for the
10+
latest KIWI NG upstream version. The upstream version may be slightly
11+
ahead of the version shipped in the latest release of SUSE Linux
12+
Enterprise.
13+
</p>
14+
<p>
15+
Builds of the upstream version of KIWI NG for your OS version are
16+
<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">available from OBS</a>.
17+
These builds are supported on a best-effort basis.
18+
</p>
19+
</desc>
20+
<desc lang="de-de">
21+
<p>
22+
KIWI NG (Nächste Generation) ist ein Kommandozeilenwerkzeug, mit dem sich
23+
Linux-System-Appliances erstellen lassen.
24+
Die hier veröffentlichte Dokumentation wurde für die neueste Version von
25+
KIWI NG erstellt.
26+
Diese Upstream-Version kann etwas anders funktionieren, als die Version,
27+
die in der aktuellen Version von SUSE Linux Enterprise enthalten ist.
28+
</p>
29+
<p>
30+
Builds der Upstream-Version von KIWI NG für Ihr Betriebssystem finden Sie
31+
<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">im OBS</a>.
32+
Wir bemühen uns, diese Builds zu unterstützen.
33+
</p>
34+
</desc>
35+
<desc lang="es-es">
36+
<p>
37+
KIWI NG (Next Generation) es la utilidad de línea de comandos para crear
38+
dispositivos de sistema Linux.
39+
La documentación publicada aquí está escrita para la versión de nivel
40+
superior más reciente de KIWI NG.
41+
Esta versión puede funcionar de forma ligeramente diferente a la versión
42+
incluida en la versión más reciente de SUSE Linux Enterprise.
43+
</p>
44+
<p>
45+
Las compilaciones de la versión de nivel superior de KIWI NG para la
46+
versión de su sistema operativo están
47+
<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">disponibles en OBS</a>.
48+
La asistencia para estas compilaciones se ofrece con una filosofía de
49+
mejor esfuerzo.
50+
</p>
51+
</desc>
52+
<desc lang="fr-fr">
53+
<p>
54+
KIWI NG (Next Generation) est l'utilitaire de ligne de
55+
commande qui permet de créer des applicatifs système Linux.
56+
La documentation publiée ici est destinée à la dernière version en
57+
amont de KIWI NG.
58+
Cette version en amont peut fonctionner légèrement différemment de
59+
celle livrée dans la dernière édition de SUSE Linux Enterprise.
60+
</p>
61+
<p>
62+
Les builds de la version en amont de KIWI NG pour votre version de
63+
système d'exploitation sont
64+
<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">disponibles sur OBS</a>.
65+
Ces builds sont pris en charge du mieux possible.
66+
</p>
67+
</desc>
68+
<desc lang="ja-jp">
69+
<p>
70+
KIWI NG (Next Generation)は、Linuxシステムアプライアンスを構築するためのコマンドラインユーティリティです。ここで公開されているマニュアルは、最新のKIWI NGアップストリームバージョン用に作成されています。このアップストリームバージョンは、SUSE Linux Enterpriseの最新リリースで出荷されたバージョンとは若干異なる動作をする場合があります。
71+
</p>
72+
<p>
73+
ご使用のOSバージョン向けKIWI NGのアップストリームバージョンのビルドは、<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">OBSから入手可能</a>です。これらのビルドは、ベストエフォートベースでサポートされています。
74+
</p>
75+
</desc>
76+
<desc lang="pt-br">
77+
<p>
78+
KIWI NG (Next Generation) é o utilitário de linha de comando para criar
79+
aplicações de sistema Linux.
80+
A documentação publicada aqui foi escrita para a versão de upstream
81+
mais recente do KIWI NG.
82+
Essa versão de upstream pode funcionar de maneira um pouco diferente da
83+
versão fornecida no último lançamento do SUSE Linux Enterprise.
84+
</p>
85+
<p>
86+
Os builds da versão de upstream do KIWI NG referentes à sua versão do OS estão
87+
<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">disponíveis no OBS</a>.
88+
Esses builds são suportados na base dos melhores esforços.
89+
</p>
90+
</desc>
91+
<desc lang="zh-cn">
92+
<p>
93+
KIWI NG(下一代)是用于构建 Linux 系统设备的命令行实用程序。此处发布的文档是为最新的 KIWI NG 上游版本编写的。此上游版本的工作方式可能与最新的 SUSE Linux Enterprise 版本中随附的版本略有不同。
94+
</p>
95+
<p>
96+
适用于您的操作系统版本的 KIWI NG 上游版本的内部版本<a href="https://download.opensuse.org/repositories/Virtualization:/Appliances:/Builder">可从 OBS 获得</a>。我们会尽最大努力为这些内部版本提供支持。
97+
</p>
98+
</desc>
99+
</descriptions>
100+
<resources>
101+
<git remote="https://github.com/OSInside/kiwi-suse-doc.git"/>
102+
<locale lang="en-us" sitemap="false">
103+
<branch>master</branch>
104+
<subdir>doc/build</subdir>
105+
<deliverable id="app.kiwi-9.dc-kiwi" type="dc">
106+
<dc file="DC-kiwi">
107+
<format epub="0" html="1" pdf="1" single-html="1"/>
108+
</dc>
109+
</deliverable>
110+
</locale>
111+
</resources>
112+
</docset>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<categories xmlns:xi="http://www.w3.org/2001/XInclude">
3+
<xi:include href="categories/en-us.xml"/>
4+
<xi:include href="categories/de-de.xml"/>
5+
<xi:include href="categories/es-es.xml"/>
6+
<xi:include href="categories/fr-fr.xml"/>
7+
<xi:include href="categories/ja-jp.xml"/>
8+
<xi:include href="categories/ko-kr.xml"/>
9+
<xi:include href="categories/pt-br.xml"/>
10+
<xi:include href="categories/zh-cn.xml"/>
11+
</categories>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<category lang="de-de">
3+
<language linkend="cat.about" title="Über"/>
4+
<language linkend="cat.deployment" title="Bereitstellung"/>
5+
<language linkend="cat.initial-config" title="Erstmalige Konfiguration"/>
6+
<language linkend="cat.update-upgrade" title="Update &amp; Upgrade"/>
7+
<language linkend="cat.administration" title="Administration"/>
8+
<language linkend="cat.container-virtualization" title="Container und Virtualisierung"/>
9+
<language linkend="cat.product-usage" title="Verwendung des Produkts"/>
10+
<language linkend="cat.security-compliance" title="Sicherheit und Konformität"/>
11+
<language linkend="cat.tuning-performance" title="Tuning &amp; Leistung"/>
12+
<language linkend="cat.solution-doc" title="Dokumentation zur Lösung"/>
13+
<language linkend="cat.additional-doc" title="Weitere Dokumentation"/>
14+
<language linkend="cat.best-practices" title="Bewährte Methoden"/>
15+
</category>

0 commit comments

Comments
 (0)