Import old-site downloads and add a type taxonomy

New CLI command vitec:import-downloads: reads the JSON export of the
old site (www.vitec.com/import), cuts it out of the surrounding page
template by brace counting, and imports the downloads idempotently by
slug. Scope is deliberately narrow: only files under
/fileadmin/downloads/Collateral/, records without title or file are
skipped, records sharing one file_url are merged. Files are fetched
resumably into fileadmin/downloads/Collateral/ and stored on pid 29.

Legacy filenames are normalized on fetch so every imported file
matches the <prefix>__<filetype>__<NN>-<letter> version convention:
__NN_A -> __NN-A, ___NN -> __NN, __NNA -> __NN-A, and a bare __NN
gets -A appended as its initial revision. Verified against the full
export: all 179 names match afterwards, none of the already-correct
ones change.

tx_vitec_domain_model_download gains a second category field "type"
(display taxonomy: Datasheet, Success Story, Brochure, Software) next
to the filename-driven filetype categories. No SQL change needed -
the core generates columns for category fields. The three download
renderers emit the field as a string analogous to filetype; MM rows
are distinguished by fieldname, existing queries filter on it and
remain unaffected.

Import values are matched via the custom columns sys_category.filetype
and .type (falling back to title); missing categories are created
(filetype under --category-parent, default 4; type under a "Download
Type" parent).

getDownloadFile() in the three download renderers gains a filepath
fallback (FAL -> convention -> filepath) as a safety net for any
future filename that escapes the convention - previously such records
emitted file: null.

Architecture spec bumped to v1.7.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 12:08:48 +02:00
parent 27cc22dc69
commit baa0fdd331
7 changed files with 926 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ return [
],
'types' => [
'1' => ['showitem' => 'hidden, title, slug, keywords, teaser, description,
--div--;File, useolddl, file, fileprefix, categories,
--div--;File, useolddl, file, fileprefix, categories, type,
--div--;Visibility, hideonapp, hideonwebsite, hideondatasheets, hideonproducts,
--div--;Currently not in use,icon, filepath, private_download, onlyondatasheets, sort1, sort2, sort3,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
@@ -112,6 +112,14 @@ return [
'type' => 'category'
]
],
'type' => [
'exclude' => true,
'label' => 'Type',
'description' => 'Display taxonomy (Datasheet, Success Story, ...) - independent of the filename-driven filetype categories.',
'config' => [
'type' => 'category'
]
],
'title' => [
'exclude' => true,
'label' => 'Title',