Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
// @spec openspec/changes/cmdb-export-import/tasks.md#task-8
['name' => 'cmdbImport#import', 'url' => '/api/cmdb-import', 'verb' => 'POST'],
['name' => 'cmdbImport#cancel', 'url' => '/api/cmdb-import/{operationId}/cancel', 'verb' => 'POST'],
// The mapping the CMDB import uses, read-only — same posture as the import (Nextcloud admins only, CSRF).
// @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
['name' => 'settings#getCmdbImportMapping', 'url' => '/api/settings/cmdb-import/mapping', 'verb' => 'GET'],

// User Groups management routes
['name' => 'settings#getGenericUserGroups', 'url' => '/api/settings/user-groups/generic', 'verb' => 'GET'],
Expand Down
35 changes: 32 additions & 3 deletions docs/features/cmdb-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,37 @@ pass PHP's `upload_max_filesize` and `post_max_size` and the web server's
request size limit. Like the mapping files, the profile is part of the app:
a change made on the server is overwritten by the next app update.

## Viewing the mapping

The section shows the mapping the next import runs, read-only. Open
**Administration settings → Stackiq → CMDB import** and press **Mapping
(read-only)** under the import form. The block shows:

- the sheets the import reads, the match column (`APPID`), the name column,
the required columns and the date columns;
- one table per pack (application, Supplier organisation, municipality,
usage, business owner), with the pack's file, name and version;
- per row of a table: the column in the export, the field it goes to,
whether the column is required, the transformation (as is, trim, date,
lookup, yes/no lookup, join, constant) and its details, such as the export
values a lookup recognises and what each becomes.

The block reads the files through the same loader the import uses, so what
it shows is what the import does. When a file is invalid, the block shows
`MAPPING_UNAVAILABLE` with the file and the reason instead of the tables, and
the import refuses to run with the same code. The sheet names in the
section's help text come from the same answer.

The block is only for viewing: nothing in it changes the mapping. The data
behind it is also available to Nextcloud administrators as
`GET /apps/stackiq/api/settings/cmdb-import/mapping`.

## Adjusting the mapping

The mapping from columns to fields is not in code. It is a set of JSON files
in `lib/Settings/cmdb-import/`, executed by OpenRegister's mapping engine:
in `lib/Settings/cmdb-import/`, executed by OpenRegister's mapping engine.
It cannot be changed in the section; **Mapping (read-only)** shows which
file and which entry hold a column, so you know what to change:

| File | What it maps |
|---|---|
Expand All @@ -361,5 +388,7 @@ it to the `map` of the hosting-model lookup in `topdesk-module.json`:
To accept a new "Applicatie Status" value, add it to the `map` of the status
lookup in `topdesk-usage.json`. The packs are checked by OpenRegister when an import
starts; an invalid pack stops the import with `MAPPING_UNAVAILABLE` before
any row is read. A mapping file changed on the server is overwritten by the
next app update, so propose lasting changes to the app itself.
any row is read. After saving a file, reload the settings page: **Mapping
(read-only)** then shows the new mapping, or the reason the file is
refused. A mapping file changed on the server is overwritten by the next app
update, so propose lasting changes to the app itself.
35 changes: 34 additions & 1 deletion l10n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,40 @@ OC.L10N.register(
"The workbook holds more than {count} different texts, the most the import reads.": "The workbook holds more than {count} different texts, the most the import reads.",
"Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.": "Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.",
"In development since": "In development since",
"In use since": "In use since"
"In use since": "In use since",
"Application (module)": "Application (module)",
"Supplier organisation (Vendor)": "Supplier organisation (Vendor)",
"Municipality (from the import options)": "Municipality (from the import options)",
"Business owner (contact person)": "Business owner (contact person)",
"As is": "As is",
"Trim": "Trim",
"Date": "Date",
"Lookup": "Lookup",
"Yes/no lookup": "Yes/no lookup",
"Join": "Join",
"Constant": "Constant",
"Any other value: {value}": "Any other value: {value}",
"Joined with the columns {columns}, separated by \"{separator}\"": "Joined with the columns {columns}, separated by \"{separator}\"",
"Value: {value}": "Value: {value}",
"Read as {source}, stored as {target}": "Read as {source}, stored as {target}",
"Mapping (read-only)": "Mapping (read-only)",
"The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.": "The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.",
"Loading the mapping…": "Loading the mapping…",
"The mapping could not be loaded.": "The mapping could not be loaded.",
"{file}: {name}, version {version}": "{file}: {name}, version {version}",
"This pack maps no columns": "This pack maps no columns",
"Yes": "Yes",
"No": "No",
"Sheets read": "Sheets read",
"Match column": "Match column",
"Name column": "Name column",
"Required columns": "Required columns",
"Date columns": "Date columns",
"Column in the export": "Column in the export",
"Field": "Field",
"Transformation": "Transformation",
"The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.": "The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.",
"The import mapping could not be read. The details are in the Nextcloud log.": "The import mapping could not be read. The details are in the Nextcloud log."
},
"nplurals=2; plural=(n != 1);"
)
35 changes: 34 additions & 1 deletion l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,39 @@
"The workbook holds more than {count} different texts, the most the import reads.": "The workbook holds more than {count} different texts, the most the import reads.",
"Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.": "Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.",
"In development since": "In development since",
"In use since": "In use since"
"In use since": "In use since",
"Application (module)": "Application (module)",
"Supplier organisation (Vendor)": "Supplier organisation (Vendor)",
"Municipality (from the import options)": "Municipality (from the import options)",
"Business owner (contact person)": "Business owner (contact person)",
"As is": "As is",
"Trim": "Trim",
"Date": "Date",
"Lookup": "Lookup",
"Yes/no lookup": "Yes/no lookup",
"Join": "Join",
"Constant": "Constant",
"Any other value: {value}": "Any other value: {value}",
"Joined with the columns {columns}, separated by \"{separator}\"": "Joined with the columns {columns}, separated by \"{separator}\"",
"Value: {value}": "Value: {value}",
"Read as {source}, stored as {target}": "Read as {source}, stored as {target}",
"Mapping (read-only)": "Mapping (read-only)",
"The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.": "The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.",
"Loading the mapping…": "Loading the mapping…",
"The mapping could not be loaded.": "The mapping could not be loaded.",
"{file}: {name}, version {version}": "{file}: {name}, version {version}",
"This pack maps no columns": "This pack maps no columns",
"Yes": "Yes",
"No": "No",
"Sheets read": "Sheets read",
"Match column": "Match column",
"Name column": "Name column",
"Required columns": "Required columns",
"Date columns": "Date columns",
"Column in the export": "Column in the export",
"Field": "Field",
"Transformation": "Transformation",
"The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.": "The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.",
"The import mapping could not be read. The details are in the Nextcloud log.": "The import mapping could not be read. The details are in the Nextcloud log."
}
}
35 changes: 34 additions & 1 deletion l10n/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,40 @@ OC.L10N.register(
"The workbook holds more than {count} different texts, the most the import reads.": "De werkmap bevat meer dan {count} verschillende teksten, het maximum dat de import leest.",
"Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.": "Samen verwijzen de cellen van de werkmap naar meer dan {size} gedeelde tekst, het maximum dat de import leest.",
"In development since": "In ontwikkeling sinds",
"In use since": "In gebruik sinds"
"In use since": "In gebruik sinds",
"Application (module)": "Applicatie (module)",
"Supplier organisation (Vendor)": "Leveranciersorganisatie (Vendor)",
"Municipality (from the import options)": "Gemeente (uit de importopties)",
"Business owner (contact person)": "Business owner (contactpersoon)",
"As is": "Ongewijzigd",
"Trim": "Spaties weghalen",
"Date": "Datum",
"Lookup": "Opzoektabel",
"Yes/no lookup": "Ja/nee-opzoektabel",
"Join": "Samenvoegen",
"Constant": "Vaste waarde",
"Any other value: {value}": "Elke andere waarde: {value}",
"Joined with the columns {columns}, separated by \"{separator}\"": "Samengevoegd met de kolommen {columns}, gescheiden door \"{separator}\"",
"Value: {value}": "Waarde: {value}",
"Read as {source}, stored as {target}": "Gelezen als {source}, opgeslagen als {target}",
"Mapping (read-only)": "Mapping (alleen-lezen)",
"The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.": "De mapping die de volgende import uitvoert: de tabbladen die hij leest en, per pack, welke kolom van de export naar welk veld gaat. Hij wordt gelezen uit de bestanden onder lib/Settings/cmdb-import van de app op de server; een bestand dat daar is aangepast wordt bij de volgende app-update overschreven.",
"Loading the mapping…": "Mapping laden…",
"The mapping could not be loaded.": "De mapping kon niet worden geladen.",
"{file}: {name}, version {version}": "{file}: {name}, versie {version}",
"This pack maps no columns": "Dit pack koppelt geen kolommen",
"Yes": "Ja",
"No": "Nee",
"Sheets read": "Gelezen tabbladen",
"Match column": "Koppelkolom",
"Name column": "Naamkolom",
"Required columns": "Verplichte kolommen",
"Date columns": "Datumkolommen",
"Column in the export": "Kolom in de export",
"Field": "Veld",
"Transformation": "Transformatie",
"The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.": "De mapping van de import kan niet worden getoond: OpenRegister ontbreekt of een mappingbestand is ongeldig.",
"The import mapping could not be read. The details are in the Nextcloud log.": "De mapping van de import kon niet worden gelezen. De details staan in het Nextcloud-logboek."
},
"nplurals=2; plural=(n != 1);"
)
35 changes: 34 additions & 1 deletion l10n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,39 @@
"The workbook holds more than {count} different texts, the most the import reads.": "De werkmap bevat meer dan {count} verschillende teksten, het maximum dat de import leest.",
"Together, the cells of the workbook reference more than {size} of shared text, the most the import reads.": "Samen verwijzen de cellen van de werkmap naar meer dan {size} gedeelde tekst, het maximum dat de import leest.",
"In development since": "In ontwikkeling sinds",
"In use since": "In gebruik sinds"
"In use since": "In gebruik sinds",
"Application (module)": "Applicatie (module)",
"Supplier organisation (Vendor)": "Leveranciersorganisatie (Vendor)",
"Municipality (from the import options)": "Gemeente (uit de importopties)",
"Business owner (contact person)": "Business owner (contactpersoon)",
"As is": "Ongewijzigd",
"Trim": "Spaties weghalen",
"Date": "Datum",
"Lookup": "Opzoektabel",
"Yes/no lookup": "Ja/nee-opzoektabel",
"Join": "Samenvoegen",
"Constant": "Vaste waarde",
"Any other value: {value}": "Elke andere waarde: {value}",
"Joined with the columns {columns}, separated by \"{separator}\"": "Samengevoegd met de kolommen {columns}, gescheiden door \"{separator}\"",
"Value: {value}": "Waarde: {value}",
"Read as {source}, stored as {target}": "Gelezen als {source}, opgeslagen als {target}",
"Mapping (read-only)": "Mapping (alleen-lezen)",
"The mapping the next import runs: the sheets it reads and, per pack, which column of the export goes to which field. It is read from the files under lib/Settings/cmdb-import of the app on the server; a file changed there is overwritten by the next app update.": "De mapping die de volgende import uitvoert: de tabbladen die hij leest en, per pack, welke kolom van de export naar welk veld gaat. Hij wordt gelezen uit de bestanden onder lib/Settings/cmdb-import van de app op de server; een bestand dat daar is aangepast wordt bij de volgende app-update overschreven.",
"Loading the mapping…": "Mapping laden…",
"The mapping could not be loaded.": "De mapping kon niet worden geladen.",
"{file}: {name}, version {version}": "{file}: {name}, versie {version}",
"This pack maps no columns": "Dit pack koppelt geen kolommen",
"Yes": "Ja",
"No": "Nee",
"Sheets read": "Gelezen tabbladen",
"Match column": "Koppelkolom",
"Name column": "Naamkolom",
"Required columns": "Verplichte kolommen",
"Date columns": "Datumkolommen",
"Column in the export": "Kolom in de export",
"Field": "Veld",
"Transformation": "Transformatie",
"The import mapping cannot be shown: OpenRegister is missing or a mapping file is invalid.": "De mapping van de import kan niet worden getoond: OpenRegister ontbreekt of een mappingbestand is ongeldig.",
"The import mapping could not be read. The details are in the Nextcloud log.": "De mapping van de import kon niet worden gelezen. De details staan in het Nextcloud-logboek."
}
}
Loading
Loading