diff --git a/components/ILIAS/MetaData/classes/XML/Copyright/CopyrightHandler.php b/components/ILIAS/MetaData/classes/XML/Copyright/CopyrightHandler.php index b25f4d0241ee..5299e797a6a0 100644 --- a/components/ILIAS/MetaData/classes/XML/Copyright/CopyrightHandler.php +++ b/components/ILIAS/MetaData/classes/XML/Copyright/CopyrightHandler.php @@ -30,7 +30,6 @@ class CopyrightHandler implements CopyrightHandlerInterface { protected CopyrightRepository $copyright_repository; protected IdentifierHandler $identifier_handler; - protected CopyrightRenderer $copyright_renderer; protected SettingsInterface $settings; /** @@ -41,12 +40,10 @@ class CopyrightHandler implements CopyrightHandlerInterface public function __construct( CopyrightRepository $copyright_repository, IdentifierHandler $identifier_handler, - CopyrightRenderer $copyright_renderer, SettingsInterface $settings ) { $this->copyright_repository = $copyright_repository; $this->identifier_handler = $identifier_handler; - $this->copyright_renderer = $copyright_renderer; $this->settings = $settings; } diff --git a/components/ILIAS/MetaData/classes/XML/Services/Services.php b/components/ILIAS/MetaData/classes/XML/Services/Services.php index a7433d346053..72e181a141f7 100644 --- a/components/ILIAS/MetaData/classes/XML/Services/Services.php +++ b/components/ILIAS/MetaData/classes/XML/Services/Services.php @@ -83,7 +83,6 @@ public function standardWriter(): WriterInterface new CopyrightHandler( $this->copyright_services->repository(), $this->copyright_services->identifiersHandler(), - $this->copyright_services->renderer(), \ilMDSettings::_getInstance() ), $this->path_services->pathFactory(), @@ -106,7 +105,6 @@ public function standardReader(): ReaderInterface $copyright_handler = new CopyrightHandler( $this->copyright_services->repository(), $this->copyright_services->identifiersHandler(), - $this->copyright_services->renderer(), \ilMDSettings::_getInstance() ); return $this->standard_reader = new StandardReader( @@ -144,7 +142,6 @@ public function simpleDCWriter(): SimpleDCInterface new CopyrightHandler( $this->copyright_services->repository(), $this->copyright_services->identifiersHandler(), - $this->copyright_services->renderer(), \ilMDSettings::_getInstance() ), new LinkGenerator( diff --git a/components/ILIAS/MetaData/docs/oaipmh.md b/components/ILIAS/MetaData/docs/oaipmh.md index 4d727a465db1..feb701403320 100644 --- a/components/ILIAS/MetaData/docs/oaipmh.md +++ b/components/ILIAS/MetaData/docs/oaipmh.md @@ -172,4 +172,4 @@ are derived as follows: | source | `resource > identifier > entry` of `relation` where `kind > value` is 'isbasedon' | any | | | relation | `resource > identifier > entry` of `relation` where `kind > value` is not 'isbasedon' | any | | | coverage | `general > coverage > string` | any | with corresponding `general > coverage > language` as `xml:lang` attribute | -| rights | `rights > description > string` | 1 | If a [pre-configured license](copyrights.md) is chosen for the Object, it is given by its link. If no copyright is set, the default copyright is used. | +| rights | `rights > description > string` | 1 | If a [pre-configured license](copyrights.md) is chosen for the Object, it is given by its link (or its full name, if it does not have a link). If no copyright is set, the default copyright is used. | diff --git a/components/ILIAS/MetaData/tests/XML/Copyright/CopyrightHandlerTest.php b/components/ILIAS/MetaData/tests/XML/Copyright/CopyrightHandlerTest.php index 76ba75d97dd8..1e92e59a645c 100644 --- a/components/ILIAS/MetaData/tests/XML/Copyright/CopyrightHandlerTest.php +++ b/components/ILIAS/MetaData/tests/XML/Copyright/CopyrightHandlerTest.php @@ -148,16 +148,6 @@ public function buildIdentifierFromEntryID(int $entry_id): string }; } - protected function getRenderer(): RendererInterface - { - return new class () extends NullRenderer { - public function toString(CopyrightDataInterface $copyright): string - { - return 'rendered full name: "' . $copyright->fullName() . '" and link: "' . $copyright->link() . '"'; - } - }; - } - protected function getSettings(bool $selection_active): SettingsInterface { return new class ($selection_active) extends NullSettings { @@ -177,7 +167,6 @@ public function testIsCopyrightSelectionActiveTrue(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -189,7 +178,6 @@ public function testIsCopyrightSelectionActiveFalse(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(false) ); @@ -206,12 +194,11 @@ public function testCopyrightAsString(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); $this->assertSame( - 'rendered full name: "second entry" and link: "http://www.example2.com"', + 'http://www.example2.com', $handler->copyrightAsString('valid_identifier_55') ); } @@ -226,7 +213,6 @@ public function testCopyrightAsStringInactiveCPSelection(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(false) ); @@ -246,7 +232,6 @@ public function testCopyrightAsStringInvalidAsIdentifier(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -266,12 +251,11 @@ public function testCopyrightAsStringEntryIdNotFound(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); $this->assertSame( - 'rendered full name: "" and link: ""', + '', $handler->copyrightAsString('valid_identifier_678') ); } @@ -286,7 +270,6 @@ public function testCopyrightForExportInvalidAsIdentifier(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -306,7 +289,6 @@ public function testCopyrightForExportEntryIdNotFound(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -326,7 +308,6 @@ public function testCopyrightForExportInactiveCPSelection(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(false) ); @@ -346,7 +327,6 @@ public function testCopyrightForExportEmpty(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -366,7 +346,6 @@ public function testCopyrightForExportHasLink(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -386,7 +365,6 @@ public function testCopyrightForExportHasFullName(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -406,7 +384,6 @@ public function testCopyrightForExportHasFullNameAndLink(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -426,7 +403,6 @@ public function testCopyrightForExportHasNoFullNameOrLink(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -446,7 +422,6 @@ public function testCopyrightFromExportNoMatches(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -466,7 +441,6 @@ public function testCopyrightFromExportURLWithNoMatchesShouldBeUnchanged(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -490,7 +464,6 @@ public function testCopyrightFromExportNoMatchesContainsFullName(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -510,7 +483,6 @@ public function testCopyrightFromExportInactiveCPSelection(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(false) ); @@ -530,7 +502,6 @@ public function testCopyrightFromExportMatchesByFullName(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -554,7 +525,6 @@ public function testCopyrightFromExportMultipleMatchesByFullName(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -574,7 +544,6 @@ public function testCopyrightFromExportMatchesByLink(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -594,7 +563,6 @@ public function testCopyrightFromExportMultipleMatchesByLink(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) ); @@ -614,7 +582,6 @@ public function testCopyrightFromExportMatchesByLinkButDifferentScheme(): void $handler = new CopyrightHandler( $this->getCopyrightRepository(...$entries), $this->getIdentifierHandler(), - $this->getRenderer(), $this->getSettings(true) );