Improve meta data of imported files (#24)

* Set ``alternative`` to the ``description`` if available.

* Set ``creator_tool`` to the "destination.one".

* Set ``source`` to the URL of the fetched image.
This commit is contained in:
Daniel Siepmann 2023-06-19 10:22:54 +02:00 committed by GitHub
parent bae680025e
commit c56a10b748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 51 additions and 24 deletions

View file

@ -152,7 +152,9 @@ class FilesAssignment
$this->metaDataRepository->update($file->getUid(), [
'title' => $this->getShortenedString($mediaObject['value'], 100),
'description' => $mediaObject['description'] ?? '',
'alternative' => 'DD Import',
'alternative' => $mediaObject['description'] ?? '',
'creator_tool' => 'destination.one',
'source' => $mediaObject['url'] ?? '',
]);
}

View file

@ -41,6 +41,14 @@ Features
That ensures that modifications during import or while editing records are flushing
corresponding pages.
* Improve handling of file meta data during import from destination.one.
* Set ``alternative`` to the ``description`` if available.
* Set ``creator_tool`` to the "destination.one".
* Set ``source`` to the URL of the fetched image.
Fixes
-----

View file

@ -8,6 +8,10 @@ abstract class AbstractTest extends AbstractFunctionalTestCase
{
protected function setUp(): void
{
$this->coreExtensionsToLoad = [
'filemetadata',
];
parent::setUp();
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/Structure.php');

View file

@ -17,7 +17,7 @@
,3,1,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,
"sys_file_metadata",,,,,,,,,,,,,,,,,,,,,
,"uid","pid","title","description","alternative",,,,,,,,,,,,,,,,
,1,0,"This title is longer then the supported 255 chars as limited by default by TYPO3 database. Also c …","This is a supported description","DD Import",,,,,,,,,,,,,,,,
,1,0,"This title is longer then the supported 255 chars as limited by default by TYPO3 database. Also c …","This is a supported description","This is a supported description",,,,,,,,,,,,,,,,
"sys_file_reference",,,,,,,,,,,,,,,,,,,,,
,"uid","uid_local","uid_foreign","tablenames","fieldname","title","description",,,,,,,,,,,,,,
,1,1,1,"tx_events_domain_model_event","images",,,,,,,,,,,,,,,,

1 tx_events_domain_model_organizer
17 3 1 tx_events_domain_model_event categories
18 sys_file_metadata
19 uid pid title description alternative
20 1 0 This title is longer then the supported 255 chars as limited by default by TYPO3 database. Also c … This is a supported description DD Import This is a supported description
21 sys_file_reference
22 uid uid_local uid_foreign tablenames fieldname title description
23 1 1 1 tx_events_domain_model_event images

View file

@ -58,7 +58,9 @@ return [
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg',
],
[
'uid' => 2,
@ -66,7 +68,9 @@ return [
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
'alternative' => 'Description of Tueftlerzeit',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg',
],
],
];

View file

@ -90,7 +90,9 @@ return [
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg',
],
[
'uid' => 2,
@ -98,7 +100,9 @@ return [
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
'alternative' => 'Description of Tueftlerzeit',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg',
],
[
'uid' => 3,
@ -106,7 +110,9 @@ return [
'file' => 3,
'title' => 'Lutherkirche.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg',
],
],
];

View file

@ -81,7 +81,9 @@ return [
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg',
],
[
'uid' => 2,
@ -89,7 +91,9 @@ return [
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
'alternative' => 'Description of Tueftlerzeit',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg',
],
[
'uid' => 3,
@ -97,7 +101,9 @@ return [
'file' => 3,
'title' => 'Lutherkirche.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg',
],
],
];

View file

@ -57,16 +57,12 @@ return [
'pid' => 0,
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
],
[
'uid' => 2,
'pid' => 0,
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
],
],
'tx_events_domain_model_event' => [

View file

@ -58,7 +58,9 @@ return [
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg',
],
[
'uid' => 2,
@ -66,7 +68,9 @@ return [
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
'alternative' => 'Description of Tueftlerzeit',
'creator_tool' => 'destination.one',
'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg',
],
],
];

View file

@ -57,16 +57,12 @@ return [
'pid' => 0,
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
],
[
'uid' => 2,
'pid' => 0,
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
],
],
];

View file

@ -64,7 +64,7 @@ return [
'file' => 1,
'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg',
'description' => '',
'alternative' => 'DD Import',
'alternative' => '',
],
[
'uid' => 2,
@ -72,7 +72,7 @@ return [
'file' => 2,
'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg',
'description' => 'Description of Tueftlerzeit',
'alternative' => 'DD Import',
'alternative' => 'Description of Tueftlerzeit',
],
],
'tx_events_domain_model_event' => [

View file

@ -18,9 +18,10 @@
"php": "~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"typo3/cms-core": "^10.4 || ^11.5",
"typo3/cms-extbase": "^10.4 || ^11.5",
"typo3/cms-filelist": "^10.4 || ^11.5",
"typo3/cms-filemetadata": "^10.4 || ^11.5",
"typo3/cms-fluid": "^10.4 || ^11.5",
"typo3/cms-frontend": "^10.4 || ^11.5",
"typo3/cms-filelist": "^10.4 || ^11.5"
"typo3/cms-frontend": "^10.4 || ^11.5"
},
"autoload": {
"psr-4": {