diff --git a/.gitignore b/.gitignore index 8540401..34aa121 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ Build/dist/* Build/node_modules/* +.idea/ +.Build/ +Build/testing-docker/.env +composer.lock +public/ diff --git a/Classes/Command/CalculateTablesCommand.php b/Classes/Command/CalculateTablesCommand.php index 6c98cf4..81cf357 100644 --- a/Classes/Command/CalculateTablesCommand.php +++ b/Classes/Command/CalculateTablesCommand.php @@ -1,6 +1,6 @@ get('mpdb_core'); + $coreExtConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('mpdb_core'); $prefix = $coreExtConf['prefix']; $params = [ @@ -243,13 +243,13 @@ protected function commitChunk(Collection $chunk, string $index): void */ protected function commitPublishedItemTables(): void { - if ($this->client->indices()->exists(['index' => $this->prefix . PublishedItemController::TABLE_INDEX_NAME])) { + if ($this->client->indices()->exists(['index' => $this->prefix . PublishedItemController::TABLE_INDEX_NAME])->asBool()) { $this->client->indices()->delete(['index' => $this->prefix . PublishedItemController::TABLE_INDEX_NAME]); } - if ($this->client->indices()->exists(['index' => $this->prefix . WorkController::TABLE_INDEX_NAME])) { + if ($this->client->indices()->exists(['index' => $this->prefix . WorkController::TABLE_INDEX_NAME])->asBool()) { $this->client->indices()->delete(['index' => $this->prefix . WorkController::TABLE_INDEX_NAME]); } - if ($this->client->indices()->exists(['index' => $this->prefix . PersonController::TABLE_INDEX_NAME])) { + if ($this->client->indices()->exists(['index' => $this->prefix . PersonController::TABLE_INDEX_NAME])->asBool()) { $this->client->indices()->delete(['index' => $this->prefix . PersonController::TABLE_INDEX_NAME]); } @@ -310,7 +310,7 @@ protected static function samplePublishedItemData(array $publishedItem): array { $publishedSubitems = Collection::wrap($publishedItem['_source']['published_subitems'])-> map(function ($item) { return self::samplePublishedSubitemData($item); })-> - toArray(); + all(); return [ $publishedItem['_id'] => @@ -356,10 +356,10 @@ protected static function samplePublishedSubitemData(array $publishedSubitem): a $result = [ 'id' => $publishedSubitem['mvdb_id'], - 'prints_by_date' => $printsByDate->toArray(), - 'prints_per_year' => $printsPerYear->toArray(), - 'prints_by_date_cumulative' => $printsByDateCumulative->toArray(), - 'prints_per_year_cumulative' => $printsPerYearCumulative->toArray() + 'prints_by_date' => $printsByDate->values(), + 'prints_per_year' => $printsPerYear->values(), + 'prints_by_date_cumulative' => $printsByDateCumulative->values(), + 'prints_per_year_cumulative' => $printsPerYearCumulative->values() ]; foreach(explode(',', $extConf['movingAverages']) as $years) { diff --git a/Classes/Command/IndexPublishersCommand.php b/Classes/Command/IndexPublishersCommand.php index 6d670d6..5be9a6b 100644 --- a/Classes/Command/IndexPublishersCommand.php +++ b/Classes/Command/IndexPublishersCommand.php @@ -1,6 +1,6 @@ from(self::TABLE_NAME); - if ($this->client->indices()->exists(['index' => $prefix . self::INDEX_NAME])) { + if ($this->client->indices()->exists(['index' => $prefix . self::INDEX_NAME])->asBool()) { $this->client->indices()->delete(['index' => $prefix . self::INDEX_NAME]); } Collection::wrap($qb->execute()->fetchAll())-> filter(function ($publisher) { return $this->isPublic($publisher); })-> - //pluck('uid', self::NAME_COLNAME, self::SHORTHAND_COLNAME)//-> each(function ($publisher) { $this->indexPublisher($publisher); }); return 0; diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 7cfacbe..844dfb7 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -3,9 +3,9 @@ use Illuminate\Support\Collection; use Slub\MpdbCore\Controller\AbstractController as CoreAbstractController; +use Slub\MpdbCore\Services\SearchServiceInterface; +use Slub\MpdbCore\Services\SearchServiceNotFoundException; use Slub\MpdbPresentation\Command\IndexPublishersCommand; -use Slub\MpdbPresentation\Services\SearchServiceInterface; -use Slub\MpdbPresentation\Services\SearchServiceNotFoundException; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; @@ -18,32 +18,18 @@ abstract class AbstractController extends CoreAbstractController const DASHBOARD_TARGET = 'tx_mpdbpresentation_dashboard'; const RESULT_COUNT = 25; const INDICES = [ - 'person' => [ - 'symbol' => '🧍', - 'controller' => 'Person' - ], - 'work' => [ - 'symbol' => '📄', - 'controller' => 'Work' - ], - 'published_item' => [ - 'symbol' => '📕', - 'controller' => 'PublishedItem' - ], - 'instrument' => [ - 'symbol' => '🎺', - 'controller' => 'Instrument' - ], - 'genre' => [ - 'symbol' => '🎶', - 'controller' => 'Genre' - ] + 'person' => [ + 'controller' => 'Person', + 'translation' => 'person' ], + 'work' => [ + 'controller' => 'Work', + 'translation' => 'work' ], + 'published_item' => [ + 'controller' => 'PublishedItem', + 'translation' => 'publishedItem' ] ]; - const EXT_NAME = 'MpdbPresentation'; - protected Collection $localizedIndices; protected Collection $publishers; - protected SearchServiceInterface $searchService; public function initializeShowAction() { @@ -55,34 +41,6 @@ public function initializeShowAction() pluck('_source'); } - /** - * @throws SearchServiceNotFoundException - */ - protected function initializeAction(): void - { - $this->localizedIndices = Collection::wrap(self::INDICES)-> - mapWithKeys(function ($array, $key) { return self::localizeIndex($array, $key); }); - - $searchService = GeneralUtility::makeInstanceService('search'); - if (is_object($searchService)) { - $this->searchService = $searchService; - } else { - throw new SearchServiceNotFoundException(); - } - - $this->searchService-> - setSize(self::RESULT_COUNT); - } - - private static function localizeIndex(array $array, string $key): array - { - $coreExtConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('mpdb_core'); - $body = $array; - $translation = LocalizationUtility::translate($key, self::EXT_NAME); - $body['translation'] = ucwords($translation); - return [ $key => $body ]; - } - protected function getJsCall(Collection $data, Collection $publishers = null, string $title): string { $movingAverages = explode(',', GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('mpdb_presentation')['movingAverages']); diff --git a/Classes/Controller/IndexController.php b/Classes/Controller/IndexController.php index 704fa37..0985806 100644 --- a/Classes/Controller/IndexController.php +++ b/Classes/Controller/IndexController.php @@ -25,7 +25,7 @@ public function searchAction(array $config = []): ResponseInterface $this->view->assign('entities', $entities->all()); $this->view->assign('config', $config); - $this->view->assign('indices', $this->localizedIndices->all()); + $this->view->assign('indices', self::INDICES); $this->view->assign('totalItems', $totalItems); $this->view->assign('publishers', $publishers->all()); $this->view->assign('resultCount', self::RESULT_COUNT); diff --git a/Classes/Controller/PersonController.php b/Classes/Controller/PersonController.php index d1b972d..111c1c6 100755 --- a/Classes/Controller/PersonController.php +++ b/Classes/Controller/PersonController.php @@ -41,6 +41,13 @@ public function showAction(GndPerson $person) setIndex(self::TABLE_INDEX_NAME)-> setId($person->getGndId())-> search(); + $hasPrints = $document-> + get('published_items')-> + pluck('published_subitems')-> + flatten(1)-> + pluck('prints_by_date')-> + filter()-> + count(); $visualizationCall = $this->getJsCall($document, $this->publishers, $personData['name']); $this->view->assign('publishers', $this->publishers->all()); @@ -49,22 +56,15 @@ public function showAction(GndPerson $person) $this->view->assign('dashboardTarget', self::DASHBOARD_TARGET); $this->view->assign('person', $personData); $this->view->assign('graphTarget', self::GRAPH_TARGET); + $this->view->assign('hasPrints', $hasPrints); } - protected function get(GndPerson $person): array + protected function get(GndPerson $person): Collection { - $params = [ - 'index' => 'person', - 'body' => [ - 'query' => [ - 'match' => [ - 'uid' => $person->getUid() - ] - ] - ] - ]; - - $personData = $this->elasticClient->search($params); - return $personData['hits']['hits'][0]['_source']; + return $this->searchService-> + reset()-> + setIndex('person')-> + setId($person->getGndId())-> + search(); } } diff --git a/Classes/Controller/PublishedItemController.php b/Classes/Controller/PublishedItemController.php index 36217b0..dcb58d7 100755 --- a/Classes/Controller/PublishedItemController.php +++ b/Classes/Controller/PublishedItemController.php @@ -55,7 +55,7 @@ public function showAction(PublishedItem $publishedItem) foreach ($publisherMikroItems as $publisherMikroItem) { $publisherActions = array_merge( $publisherActions, - $this->publisherActionRepository->findByPublisherMikroItem($publisherMikroItem)->toArray() + $this->publisherActionRepository->findByPublishedsubitem($publisherMikroItem)->toArray() ); } usort($publisherActions, $sortByDate); diff --git a/Classes/Controller/WelcomeController.php b/Classes/Controller/WelcomeController.php new file mode 100644 index 0000000..8949cbc --- /dev/null +++ b/Classes/Controller/WelcomeController.php @@ -0,0 +1,62 @@ +, SLUB Dresden + * + ***/ +/** + * PublishedItemController + */ +class WelcomeController extends AbstractController +{ + + /** + * action welcome + * + * @return void + */ + public function welcomeAction(): ResponseInterface + { + $bodyText = $this->configurationManager->getContentObject()->getFieldVal('bodytext'); + $and = LocalizationUtility::translate('LLL:EXT:mpdb_presentation/Resources/Private/Language/locallang:and'); + + $entityCount = $this->searchService-> + setIndex(PublishedItemController::TABLE_INDEX_NAME)-> + count(); + + $publishers = $this->searchService-> + reset()-> + setIndex(Publisher::INDEX_NAME)-> + search()-> + pluck('_source')-> + map(function ($publisher) { return self::getPublisherName($publisher); })-> + join(', ', ' ' . $and . ' '); + + $processedText = Str::of($bodyText)->replace('{{ publishers }}', $publishers)-> + replace('{{ count }}', $entityCount); + + $this->view->assign('processedText', $processedText); + + return $this->htmlResponse(); + } + + private static function getPublisherName(Collection $publisher): string + { + return $publisher->get('name') . ' (' . $publisher->get('shorthand') . ')'; + } + +} diff --git a/Classes/Controller/WorkController.php b/Classes/Controller/WorkController.php index 852108f..55d68d5 100755 --- a/Classes/Controller/WorkController.php +++ b/Classes/Controller/WorkController.php @@ -7,6 +7,7 @@ use \TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; use \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; use \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser; +use \Slub\MpdbCore\Command\IndexCommand; use \Slub\MpdbCore\Domain\Model\Publisher; use \Slub\MpdbCore\Domain\Model\PublisherMakroItem; use \Slub\MpdbCore\Lib\DbArray; @@ -41,81 +42,29 @@ class WorkController extends AbstractController */ public function showAction(GndWork $work) { - if (isset($GLOBALS['BE_USER'])) { - $level = -1; - } else { - $level = 2; - } if ($work->getSuperWork()) { $work = $work->getSuperWork(); } - //$publisherMakroItems = $this->publisherMakroItemRepository->lookupByWork($work);//->toArray(); - //$publisherMikroItems = $this->publisherMikroItemRepository->lookupByWork($work)->toArray(); - - $outMakros = []; - $outMikros = []; - //foreach ($publisherMakroItems as $makro) { - //if ($makro->getFinal() >= $level) { - //$outMakros[] = $makro; - //$outMikros = array_merge($outMikros, $makro->getPublisherMikroItems()->toArray()); - //} - //} - - $publisherActions = []; - foreach ($outMikros as $publisherMikroItem) { - $publisherActions = array_merge( - $publisherActions, - $this->publisherActionRepository->findByPublisherMikroItem($publisherMikroItem)->toArray() - ); - } - - $getPublishedItems = function ($subWork) { - $makros = $this->publisherMakroItemRepository->lookupByWork($subWork, $this->level); - foreach ($makros as $makro) { - foreach ($makro->getPublisherMikroItems() as $mikro) { - $mikros[] = $mikro; - } - } - return [ - 'subWork' => $subWork, - 'makros' => $makros, - 'mikros' => $mikros ?? [] - ]; - }; - - /* - $subWorks = (new DbArray()) - ->set($this->workRepository->findBySuperWork($work)->toArray()) - ->map( $getPublishedItems ) - ->filter( function ($subwork) { return $subwork['makros'] != []; }) - ->toArray(); - - $sw = $this->workRepository->findBySuperWork($work); - foreach ($subWorks as $subWork) { - $subPublisherMakroItems = $this->publisherMakroItemRepository->lookupByWork($work); - - $outMikros = []; - $publisherActions = []; - foreach ($subPublisherMakroItems as $makro) { - if ($makro->getFinal() >= $level) { - $outMakros[] = $makro; - $outMikros = array_merge($outMikros, $makro->getPublisherMikroItems()->toArray()); - } - } - foreach ($outMikros as $mikro) { - $publisherActions = array_merge($publisherActions, $mikro->getPublisherActions()->toArray()); - } - foreach ($subWork['mikros'] as $mikro) { - $publisherActions = array_merge($publisherActions, $mikro->getPublisherActions()->toArray()); - } - } - */ + $indexedWork = $this->searchService-> + reset()-> + setIndex(IndexCommand::WORK_INDEX)-> + setId($work->getGndId())-> + search(); $document = $this->searchService-> reset()-> setIndex(self::TABLE_INDEX_NAME)-> setId($work->getGndId())-> search(); + $hasPrints = $document-> + get('published_items')-> + pluck('published_subitems')-> + flatten(1)-> + pluck('prints_by_date')-> + filter()-> + count(); + $publishedItems = $this->publishedItemRepository->findByContainedWorks($work->getUid()); + $altTitles = explode(' $ ', $work->getAltTitles()); $visualizationCall = $this->getJsCall($document, $this->publishers, $work->getFullTitle()); $this->view->assign('publishers', $this->publishers); @@ -123,10 +72,9 @@ public function showAction(GndWork $work) $this->view->assign('tableTarget', self::TABLE_TARGET); $this->view->assign('dashboardTarget', self::DASHBOARD_TARGET); $this->view->assign('graphTarget', self::GRAPH_TARGET); - $this->view->assign('work', $work); - //$this->view->assign('subWorks', $subWorks); - //$this->view->assign('publisherMikroItems', $outMikros); - //$this->view->assign('publisherActions', $publisherActions); - //$this->view->assign('publisherMakroItems', $outMakros); + $this->view->assign('work', $indexedWork); + $this->view->assign('publishedItems', $publishedItems); + $this->view->assign('altTitles', $altTitles); + $this->view->assign('hasPrints', $hasPrints); } } diff --git a/Configuration/Icons.php b/Configuration/Icons.php index 3fe7b90..4410d20 100644 --- a/Configuration/Icons.php +++ b/Configuration/Icons.php @@ -10,5 +10,9 @@ 'mpdb_res_icon' => [ 'provider' => SvgIconProvider::class, 'source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_res_icon.svg' + ], + 'mpdb_wel_icon' => [ + 'provider' => SvgIconProvider::class, + 'source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_wel_icon.svg' ] ]; diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index e589f73..d86952a 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -2,7 +2,6 @@ declare(strict_types=1); -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; defined('TYPO3') or die(); @@ -18,23 +17,20 @@ ); })(); +(static function (): void { + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + // extension name, matching the PHP namespaces (but without the vendor) + 'MpdbPresentation', + // arbitrary, but unique plugin name (not visible in the backend) + 'Mpdbwelcome', + // plugin title, as visible in the drop-down in the backend, use "LLL:" for localization + 'Music publisher database welcome plugin' + ); +})(); + $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['tx_mpdbpresentation_mpdbresearch'] = 'mpdb_res_icon'; -$GLOBALS['TCA']['tt_content']['types']['tx_mpdbpresentation_mpdbresearch'] = [ - 'showitem' => ' - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, - --palette--;;general, - header; Title, - bodytext;LLL:EXT:core/Resources/Private/Language/Form/locallang_ttc.xlf:bodytext_formlabel, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, - --palette--;;hidden, - --palette--;;acces, - ', - 'columnsOverrides' => [ - 'bodytext' => [ - 'config' => [ - 'enableRichtext' => true, - 'richtextConfiguration' => 'default' - ] - ] - ] +$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['tx_mpdbpresentation_mpdbwelcome'] = 'mpdb_wel_icon'; + +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'] = [ + 'mpdbpresentation_mpdbwelcome' => 'bodytext' ]; diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index d18c84d..9acc57d 100755 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -13,6 +13,17 @@ plugin.tx_mpdbpresentation_mpdbapi { } } +plugin.tx_mpdbpresentation_mpdbwelcome { + view { + # cat=plugin.tx_mpdbpresentation_mpdbwelcome/file; type=string; label=Path to template root (FE) + templateRootPath = EXT:mpdb_presentation/Resources/Private/Templates/ + # cat=plugin.tx_mpdbpresentation_mpdbwelcome/file; type=string; label=Path to template partials (FE) + partialRootPath = EXT:mpdb_presentation/Resources/Private/Partials/ + # cat=plugin.tx_mpdbpresentation_mpdbwelcome/file; type=string; label=Path to template layouts (FE) + layoutRootPath = EXT:mpdb_presentation/Resources/Private/Layouts/ + } +} + plugin.tx_mpdbpresentation_mpdbresearch { view { # cat=plugin.tx_mpdbpresentation_mpdbresearch/file; type=string; label=Path to template root (FE) diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index ac971d3..0ece0f2 100755 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -53,6 +53,39 @@ plugin.tx_mpdbpresentation_mpdbresearch { teamPage { pid = {$config.teamPage.pid} } + guidelinePage { + pid = {$config.guidelinePage.pid} + } + abbrPage { + pid = {$config.abbrPage.pid} + } + } +} + +plugin.tx_mpdbpresentation_mpdbwelcome { + view { + templateRootPaths.0 = EXT:tx_mpdb_presentation/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_mpdbpresentation_mpdbwelcome.view.templateRootPath} + partialRootPaths.0 = EXT:tx_mpdb_presentation/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_mpdbpresentation_mpdbwelcome.view.partialRootPath} + layoutRootPaths.0 = EXT:tx_mpdb_presentation/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_mpdbpresentation_mpdbwelcome.view.layoutRootPath} + } + persistence { + storagePid = {$plugin.tx_mpdbpresentation_mpdbwelcome.persistence.storagePid} + #recursive = 1 + } + features { + #skipDefaultArguments = 1 + # if set to 1, the enable fields are ignored in BE context + ignoreAllEnableFieldsInBe = 0 + # Should be on by default, but can be disabled if all action in the plugin are uncached + requireCHashArgumentForActionArguments = 1 + } + settings { + researchPage { + pid = {$config.researchPage.pid} + } } } @@ -72,7 +105,4 @@ page { subitemController = EXT:mpdb_presentation/Resources/Public/JavaScript/SubitemController.js graphController = EXT:mpdb_presentation/Resources/Public/JavaScript/GraphController.js } - includeCSS { - mpdb_presentation_styles = EXT:mpdb_presentation/Resources/Public/Css/layout.css - } } diff --git a/README.md b/README.md index 5242489..6e4947b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,44 @@ $ typo3 mpdb_presentation:indexpublishers $ typo3 mpdb_presentation:calculatetables ``` +# Welcome plugin + +The extension comes with a welcome plugin which displays a text that may be set in the "Plugin" tab of the plugin properties. +Inside that text, you can use `{{ count }}` to get the number of published items in your elasticsearch index and `{{ publishers }}` to get a localized list of the publishers in the index. +A sample text may look like + +```txt +Willkommen auf der Homepage der mvdb. + +Die Musikverlagsdatenbank enthält {{ count }} Datensätze zu Ausgaben der Musikverlage {{ publishers }}. Die Daten wurden anhand der Geschäftsbücher der Verlage erschlossen, und enthalten neben Angaben zu Verlagsnummern und Druckauflagen auch bibliograhischen Normdateninformationen der GND. + +Nach welcher Ausgabe suchen Sie? +(Achtung: Bitte beachten Sie die Hinweise zu Verlässlichkeit, Umfang und Interpretation der Daten in den Datenerfassungsrichtlinien.) +``` + +# Plugin configuration + +In order to get all links and redirects running, you need to provide your researchPage, teamPage, guidelinePage and abbrPage as constants in your Typoscript template as well as the storagePid. +An example configuration is here: + +```txt +config { + researchPage { + pid = + } + teamPage { + pid = + } + guidelinePage { + pid = + } + abbrPage { + pid = + } +} +plugin.tx_mpdbpresentation_mpdbresearch.persistence.storagePid = +``` + # Maintainer If you have any questions or encounter any problems, please do not hesitate to contact me. diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf new file mode 100644 index 0000000..b2b7f63 --- /dev/null +++ b/Resources/Private/Language/de.locallang.xlf @@ -0,0 +1,169 @@ + + + +
+ + + next page + nächste Seite + + + previous page + vorherige Seite + + + to + bis + + + of + von + + + result type + Ergebnistyp + + + publisher + Verlag + + + page + Seite + + + no results found + keine Ergebnisse gefunden + + + Search + Suchen + + + Music Publisher Database Entry + Musikverlagsdatenbank Einstieg + + + The research plugin of the Music Publisher Database. + Das Rechercheplugin der Musikverlagsdatenbank. + + + Music Publisher Database Welcome + Musikverlagsdatenbank Willkommen + + + The welcome plugin of the Music Publisher Database. + Das Begrüßungsplugin der Musikverlagsdatenbank + + + Person + Person + + + Work + Werk + + + Published Item + Verlagsartikel + + + These data are retrieved from the Integrated Authority File (Gemeinsame Normdatei). + Diese Daten stammen aus der Gemeinsamen Normdatei (GND). + + + Life data + Lebensdaten + + + supplementary title information + Ergänzende Titelinformationen + + + printed in + gedruckt in + + + partial works + Teilwerke + + + There are no prints of this work recorded in the database. + Von diesem Werk sind keine Drucke in der Datenbank aufgezeichnet. + + + No works by %s have been found. + Es wurden keine Werke von %s gefunden. + + + published by %s + verlegt von %s + + + Works by %s in the Music Publisher Database + Werke von %s in der Musikverlagsdatenbank + + + unknown + unbekannt + + + + We differentiate prints of single works, versions and collections. + Collections are classified as explored, if all contained work have been reconstructed. + They are classified as partially explored, if only some contained works have been reconstructed, and as unexplored otherwise. + Apart from that we differentiate some educational and theoretical works. + + + In der mvdb wird zwischen Drucken von Einzelwerken, Variationen bzw. Bearbeitungen und Sammlungen unterschieden. + Sammlungen werden als erschlossen bezeichnet, falls alle enthaltenen Werke rekonstruiert werden, als teilerschlossen, falls nur einige enthaltene Werke bekannt sind, und andernfalls als unerschlossen. + Daneben werden vereinzelt Schulwerke und theoretische Werke erfasst. + + + + contained work + enthaltenes Werk + + + contained works + enthaltene Werke + + + edited work + bearbeitetes Werk + + + No workdata could be found for this item. + Für diesen Verlagsartikel konnten keine Werkdaten erschlossen werden. + + + for + für + + + No work data could be found for this published item. + Für diesen Verlagsartikel konnten keine Werkdaten erschlossen werden. + + + Economic data + Wirtschaftsdaten + + + No economic data + Keine Wirtschaftsdaten + + + No economic data could be retrieved for several published items. + Für einige Verlagsartikel konnten keine Wirtschaftsdaten gefunden werden. + + + The type of the published item indicates, whether it is a simple work print, a collection print, a version or something else. + Der Typ des Verlagsartikels gibt an, ob es sich um einen einfachen Werkdruck, einen Sammeldruck, eine Bearbeitung oder etwas anderes handelt. + + + and + und + + + + diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index b623321..a3bd08a 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -1,23 +1,116 @@ - -
- - - Musikverlagsdatenbank Einstieg - - - Das Rechercheplugin der Musikverlagsdatenbank. - - - person + +
+ + + next page + + + previous page + + + to + + + of + + + result type + + + publisher + + + page + + + no results found + + + Search + + + Music Publisher Database Entry + + + The research plugin of the Music Publisher Database. + + + Music Publisher Database Welcome + + + The welcome plugin of the Music Publisher Database. + + + Person + + + Work + + + Published Item + + + These data are retrieved from the Integrated Authority File (Gemeinsame Normdatei). + + + Life data + + + unknown + + + Works by %s in the Music Publisher Database + + + published by %s + + + No works by %s have been found. + + + There are no prints of this work recorded in the database. + + + supplementary title information + + + printed in + + + partial works + + + for + + + No work data could be found for this published item. + + + Economic data - - work + + No economic data - - published item + + No economic data could be retrieved for several published items. - - + + contained work + + + contained works + + + edited work + + + The type of the published item indicates, whether it is a simple work print, a collection print, a version or something else. + + + and + + + diff --git a/Resources/Private/Language/locallang_mpdbresearch.xlf b/Resources/Private/Language/locallang_mpdbresearch.xlf new file mode 100644 index 0000000..c1f5dcf --- /dev/null +++ b/Resources/Private/Language/locallang_mpdbresearch.xlf @@ -0,0 +1,8 @@ + + + +
+ + + + diff --git a/Resources/Private/Layouts/Research.html b/Resources/Private/Layouts/Research.html index f25b550..0cbcf6d 100644 --- a/Resources/Private/Layouts/Research.html +++ b/Resources/Private/Layouts/Research.html @@ -3,7 +3,7 @@ - + diff --git a/Resources/Private/Partials/Index/IndexPicker.html b/Resources/Private/Partials/Index/IndexPicker.html index 5e300a7..8b44ef6 100644 --- a/Resources/Private/Partials/Index/IndexPicker.html +++ b/Resources/Private/Partials/Index/IndexPicker.html @@ -3,16 +3,27 @@
    {mpdbpres:setConfig(config:searchconfig,key:'index',value:key)} -
  • - - {index.translation} - -
  • + + +
  • + + + +
  • +
    + +
  • + + + +
  • +
    +
  • {mpdbpres:setConfig(config:searchconfig,key:'index',value:'')} - đź—™ + X
diff --git a/Resources/Private/Partials/Index/Pagination.html b/Resources/Private/Partials/Index/Pagination.html index fc6b5a5..5edb01e 100644 --- a/Resources/Private/Partials/Index/Pagination.html +++ b/Resources/Private/Partials/Index/Pagination.html @@ -17,24 +17,30 @@ {firstResult - resultCount} {mpdbpres:setConfig(config:config,key:'from',value:from)} - letzte Seite + - {firstResult+1} bis - - - {lastResult} - - - {totalItems} - - - von {totalItems} + +

+ {firstResult+1} + + + + {lastResult} + + + {totalItems} + + + + {totalItems} +

+ {firstResult + resultCount} {mpdbpres:setConfig(config:config,key:'from',value:from)} - nächste Seite + diff --git a/Resources/Private/Partials/Index/PublisherPicker.html b/Resources/Private/Partials/Index/PublisherPicker.html index 71765de..06c0cc3 100644 --- a/Resources/Private/Partials/Index/PublisherPicker.html +++ b/Resources/Private/Partials/Index/PublisherPicker.html @@ -3,11 +3,11 @@
    {mpdbpres:setConfig(config:searchconfig,key:'publisher',value:publisher.shorthand)} - + -
  • +
  • - {publisher.name} + {publisher.shorthand}
  • @@ -23,7 +23,7 @@
  • {mpdbpres:setConfig(config:searchconfig,key:'publisher',value:'')} - đź—™ + X
diff --git a/Resources/Private/Partials/Index/SearchSlot.html b/Resources/Private/Partials/Index/SearchSlot.html index c716141..379da0c 100644 --- a/Resources/Private/Partials/Index/SearchSlot.html +++ b/Resources/Private/Partials/Index/SearchSlot.html @@ -2,15 +2,16 @@ {namespace mpdbpres=Slub\MpdbPresentation\ViewHelpers} - +
- Suchbegriff - +
- 🔎 + + + {mpdbpres:setConfig(config:searchConfig,key:'searchTerm',value:'')} - - 🗙 + + X
diff --git a/Resources/Private/Partials/Person/ListView.html b/Resources/Private/Partials/Person/ListView.html index 332866b..b6a95ce 100644 --- a/Resources/Private/Partials/Person/ListView.html +++ b/Resources/Private/Partials/Person/ListView.html @@ -1,40 +1,44 @@ -
- Person -
-
- - {entity._source.name} - +
+
+ +
-
-
- - - {entity._source.date_of_birth -> f:format.date(format:"%Y")}–{entity._source.date_of_death -> f:format.date(format:"%Y")} +
+
+ + {entity._source.name} + +
+
+
+ + + {entity._source.date_of_birth -> f:format.date(format:"%Y")}–{entity._source.date_of_death -> f:format.date(format:"%Y")} + + + + + + {entity._id} + + + + + - - - - - {entity._id} +
+
+ + + {work.full_title} - - ℹ️ + + ({work.publishers}) - - -
-
- - - {work.full_title} - - - ({work.publishers}) - - , - + , + +
diff --git a/Resources/Private/Partials/PublishedItem/ListView.html b/Resources/Private/Partials/PublishedItem/ListView.html index 726ada5..c281da6 100644 --- a/Resources/Private/Partials/PublishedItem/ListView.html +++ b/Resources/Private/Partials/PublishedItem/ListView.html @@ -1,29 +1,33 @@ -
- Verlagsartikel -
-
- - {entity._source.title} - +
+
+ +
-
-
- - - {entity._source.works.0.composers.0.name} - - - - - {entity._source.date_of_production -> f:format.date(format:"%Y")} - - +
+
+ + {entity._source.title} +
-
- - {published_subitem.mvdb_id}, - +
+
+ + + {entity._source.works.0.composers.0.name} + + + + + {entity._source.date_of_production -> f:format.date(format:"%Y")} + + +
+
+ + {published_subitem.mvdb_id}, + +
diff --git a/Resources/Private/Partials/Work/ListView.html b/Resources/Private/Partials/Work/ListView.html index 83d27f8..5052c8f 100644 --- a/Resources/Private/Partials/Work/ListView.html +++ b/Resources/Private/Partials/Work/ListView.html @@ -1,37 +1,46 @@ -
- Werk -
-
- - {entity._source.full_title} - +
+
+ +
-
-
- - {entity._source.composers.0.name} - - - - {entity._source.date_of_production -> f:format.date(format:"%Y")} +
+
+ + {entity._source.full_title} + +
+
+
+ + {entity._source.composers.0.name} - - - - - {entity._id} + + + op. {entity._source.opus_no} - - ℹ️ + + + + {entity._source.date_of_production -> f:format.date(format:"%Y")} - - -
-
- - {published_item.mvdb_id}, - + + + + + {entity._id} + + + + + + +
+
+ + {published_item.mvdb_id}, + +
diff --git a/Resources/Private/Templates/Index/Search.html b/Resources/Private/Templates/Index/Search.html index ee5bcb8..64910ee 100644 --- a/Resources/Private/Templates/Index/Search.html +++ b/Resources/Private/Templates/Index/Search.html @@ -5,14 +5,27 @@ -
- -
-
- -
- -
-
-

Tabellen Klicken zum Ausblenden

-
+
+

{publishedItem.publicComment}

+ + +
+
+
+ {visualizationCall->f:format.raw()} +
+ +

+ +

+

+ +

+
+
+
- {visualizationCall->f:format.raw()}
diff --git a/Resources/Private/Templates/Welcome/Welcome.html b/Resources/Private/Templates/Welcome/Welcome.html new file mode 100644 index 0000000..97f7ea1 --- /dev/null +++ b/Resources/Private/Templates/Welcome/Welcome.html @@ -0,0 +1,19 @@ + + +{namespace mpdbpres=Slub\MpdbPresentation\ViewHelpers} + + + + + + + + + + + +

+ {processedText} +

+ +
diff --git a/Resources/Private/Templates/Work/Show.html b/Resources/Private/Templates/Work/Show.html index 4f9e120..84517b0 100755 --- a/Resources/Private/Templates/Work/Show.html +++ b/Resources/Private/Templates/Work/Show.html @@ -1,279 +1,244 @@ - + -This Template is responsible for displaying a single view for a domain object + This Template is responsible for displaying a single view for a domain object -If you modify this template, do not forget to change the overwrite settings -in /Configuration/ExtensionBuilder/settings.yaml: - Resources: + If you modify this template, do not forget to change the overwrite settings + in /Configuration/ExtensionBuilder/settings.yaml: + Resources: Private: - Templates: - Show.html: keep + Templates: + Show.html: keep -Otherwise your changes will be overwritten the next time you save the extension in the extension builder + Otherwise your changes will be overwritten the next time you save the extension in the extension builder - - -

- Werkdatensatz -

-

- - {work.fullTitle} - - - op. {work.opusNo} - - - {work.indexNo} - -

- - - -
-

Alternativtitel klicken zum Anzeigen

-

{work.altTitles}

-
-
- -
-

- Werkdaten nach gemeinsamer Normdatei der DNB - - - - GND-ID {work.gndId} - - - - - lokaler Werkdatensatz - - - + + +

+

- - - - - - - - - - +

+ + {work.full_title} + + + op. {work.opus_no} -

- - - - - - - - - - - - - - - - - - - - + + {work.index_no} - - - - - - -
- Normtitel - - {work.title} -
- Ergänzende Titelinformationen - - - - Nummerierung: {work.titleNo} - - - - - Instrument: {work.titleInstrument} - - - - - Tonart: {work.tonality} - - -
- Komponist - - - - - {work.firstcomposer.name} - - - - ({work.firstcomposer.dateOfBirth->f:format.date(format:'Y')}– - {work.firstcomposer.dateOfDeath->f:format.date(format:'Y')}) - - - - - Komponist unbekannt - - -
- Produktionsjahr - - {work.dateOfProduction->f:format.date(format:'Y')} -
- geografischer Code - - {work.geographicAreaCode} -
- Gattung - - - - {form.name} - - -
- Instrumentierung - - - - {instrument.name} - - -
- -
- -

Wirtschaftsdaten

- -
-

Grafische Darstellung Klicken zum Ausblenden

-
-

Hilfe zur Grafik Klicken zum Anzeigen

-
-

- Die Matrixdarstellung schlĂĽsselt auf, in welchen Verlagsartikeln (also: Ausgaben) ein Werk in der mvdb erfasst ist. - Die Listen sind hierarchisiert geordnet zuerst nach VerlagskĂĽrzel, dann nach Verlagsartikel und schlieĂźlich nach den darin enthaltenen Teilartikeln. - Das ist an den Stammbaum-Strukturen ablesbar. -

-

- An den Punkten in den senkrechten Spalten lässt sich die jeweilige Ausgabeform ablesen: - Jeder Zeile entspricht genau eine Spalte. - Die Gesamtauflage des Verlagsartikels ist dann im Balken rechts summiert. -

-

- Unterhalb der Matrix werden die Häufigkeiten der verschiedenen Ausgabeformen im Querschnitt der Verlagsartikel summiert. -

-

- Datumsspannen und genaue Mengeangaben werden angezeigt, wenn man mit dem Mauszeiger über die Punkte und Balken fährt -

-
-
-
-
-
-
-

Tabellen Klicken zum Ausblenden

-
-
+ + +
- -

Teilwerke

-
    - -
  • - {subWork.subWork.fullTitle} - - op. {subWork.subWork.opusNo} - - - {subWork.subWork.indexNo} - - - - - ({subWork.subWork.gndId}) - - - - (lokaler Datensatz) - - - - gedruckt in: - - - {makro.mvdbId}: {makro.title} - - - -
  • -
    -
-
- -
- -
-
- {subWork.subWork.title} {subWork.subWork.titleNo} -
-
- {subWork.subWork.gndId} -
-
- +
+
+
+

+ + {work.gnd_id} + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {work.generic_title} +
+ + + {title} +
+ + + + + : + {work.title_no} + + + + + : + {work.title_instrument} + + + + + : + {work.tonality} + + +
+ + + + + + {work.composers.0.name} + + + + ({work.composers.0.dateOfBirth->f:format.date(format:'Y')}– + {work.composers.0.dateOfDeath->f:format.date(format:'Y')}) + + + + + + + + + +
+ + + {work.date_of_production->f:format.date(format:'Y')} +
+ + + {work.geographic_area_code} +
+ + + + + {genre.name} + + +
+ + + + + {instrument.name} + + +
- -
+
+ + +
+
+
+ {visualizationCall->f:format.raw()} +
+ +

+ +

+

+ +

+
+
+
+
- -

Gedruckt in

+ +

+ +

+
    + +
  • + {subWork.subWork.fullTitle} + + op. {subWork.subWork.opusNo} + + + {subWork.subWork.indexNo} + + + ({subWork.subWork.gndId}) + + + + + + {makro.mvdbId}: {makro.title} + + + +
  • +
    +
+
- - -
    - -
  • - - {publisherMakroItem.mvdbId}: {publisherMakroItem.title} - -
  • -
    -
-
- - Das Werk ist in keinem Verlagsartikel in der mvdb gedruckt worden. - -
-
+ + +

+ +

- {visualizationCall->f:format.raw()} - +
    + +
  • + + {item.mvdb_id}: {item.title} + +
  • +
    +
+
+ + + + + +
+ - - + + diff --git a/Resources/Public/Css/layout.css b/Resources/Public/Css/layout.css deleted file mode 100644 index 09b8dad..0000000 --- a/Resources/Public/Css/layout.css +++ /dev/null @@ -1,40 +0,0 @@ -div.entity-list-item { - margin-top: 20px; - padding-bottom: 10px; - border-bottom: solid; - border-color: lightgray; - border-width: 1px; -} -div.entity-list-item a { - font-weight: bold; -} -div.entity-list-item a:hover { - text-decoration: none; -} -div.entity-list-item div.entity-type { - margin-bottom: -10px; -} -div.entity-list-item div.entity-title a { - font-size: 150%; - color: black; -} -div.entity-list-item div.entity-preview { - font-size: 90%; - max-height: 2.7em; - overflow: hidden; - text-overflow: "..."; - color: darkgray; -} -div.entity-list-item span.entity-life-span, -div.entity-list-item span.entity-date-of-production, -div.entity-list-item span.entity-composer { - margin-right: 30px; -} -div.entity-list-item div.index-picker { - @include pagination-container; -} -div#tx_mpdbpresentation_table { - width: 100%; - max-width: 1200px; - overflow: auto; -} diff --git a/Resources/Public/Css/styles.css b/Resources/Public/Css/styles.css deleted file mode 100644 index 94f5519..0000000 --- a/Resources/Public/Css/styles.css +++ /dev/null @@ -1,34 +0,0 @@ -div.entity-list-item { - margin-top: 20px; - padding-bottom: 10px; - border-bottom: solid; - border-color: lightgray; - border-width: 1px; -} - -div.entity-list-item div.entity-type { - margin-bottom: -10px; -} - -div.entity-list-item div.entity-title a { - font-size: 150%; - font-weight: bold; - color: black; -} - -div.entity-list-item div.entity-preview { - font-size: 90%; - max-height: 2.7em; - overflow: hidden; - text-overflow: "..."; - color: darkgray; -} - -div.entity-list-item span.entity-gnd-link a { - font-weight: bold; -} - -div.entity-list-item span.entity-life-span, div.entity-list-item span.entity-date-of-production, div.entity-list-item span.entity-composer { - margin-right: 30px; -} - diff --git a/Resources/Public/Icons/mpdb_fe_icons.svg b/Resources/Public/Icons/mpdb_fe_icons.svg new file mode 100644 index 0000000..2ff08f9 --- /dev/null +++ b/Resources/Public/Icons/mpdb_fe_icons.svg @@ -0,0 +1,54 @@ + + diff --git a/Resources/Public/Icons/mpdb_icon_gnd.svg b/Resources/Public/Icons/mpdb_icon_gnd.svg new file mode 100644 index 0000000..e532e2c --- /dev/null +++ b/Resources/Public/Icons/mpdb_icon_gnd.svg @@ -0,0 +1,45 @@ + + + + + + + + + + diff --git a/Resources/Public/Icons/mpdb_icon_item.svg b/Resources/Public/Icons/mpdb_icon_item.svg new file mode 100644 index 0000000..667f9aa --- /dev/null +++ b/Resources/Public/Icons/mpdb_icon_item.svg @@ -0,0 +1,46 @@ + + diff --git a/Resources/Public/Icons/mpdb_icon_person.svg b/Resources/Public/Icons/mpdb_icon_person.svg new file mode 100644 index 0000000..f11b5d7 --- /dev/null +++ b/Resources/Public/Icons/mpdb_icon_person.svg @@ -0,0 +1,44 @@ + + diff --git a/Resources/Public/Icons/mpdb_icon_search.svg b/Resources/Public/Icons/mpdb_icon_search.svg new file mode 100644 index 0000000..dc05a11 --- /dev/null +++ b/Resources/Public/Icons/mpdb_icon_search.svg @@ -0,0 +1,41 @@ + + diff --git a/Resources/Public/Icons/mpdb_icon_work.svg b/Resources/Public/Icons/mpdb_icon_work.svg new file mode 100644 index 0000000..3a32a3d --- /dev/null +++ b/Resources/Public/Icons/mpdb_icon_work.svg @@ -0,0 +1,44 @@ + + diff --git a/Resources/Public/Icons/mpdb_wel_icon.svg b/Resources/Public/Icons/mpdb_wel_icon.svg new file mode 100644 index 0000000..b5ee1a7 --- /dev/null +++ b/Resources/Public/Icons/mpdb_wel_icon.svg @@ -0,0 +1,76 @@ + + + + + + + + mpdb + Wel + + diff --git a/Resources/Public/JavaScript/DashboardController.js b/Resources/Public/JavaScript/DashboardController.js index 043650a..2419e58 100644 --- a/Resources/Public/JavaScript/DashboardController.js +++ b/Resources/Public/JavaScript/DashboardController.js @@ -19,24 +19,32 @@ const tx_publisherdb_dashboardController = { const excludedItems = target.append('div') .attr('id', 'dashboard-excluded-items'); + excludedItems.append('h3') + .text('Ausgeschlossene Verlagsartikel'); if (tx_publisherdb_visualizationStatus.excludedElements.length) { - excludedItems.append('h3') - .text('Ausgeschlossene Einheiten'); const excludedItemList = excludedItems.append('div') .attr('class', 'tiny button-group'); + d3.select('tx_mpdbpresentation_excludeinfo'); excludedItemList.selectAll(`a.${tx_publisherdb_dashboardExcludedItem}`) .data(tx_publisherdb_visualizationStatus.excludedElements.sort()) .join('a') .attr('class', `${tx_publisherdb_dashboardExcludedItem} primary button hollow include-element`) .attr('id', d => d) .html(d => d); + } else { + excludedItems.append('p') + .style('font-style', 'italic') + .style('font-size', '80%') + .attr('id', 'tx_mpdbpresentation_excludeinfo') + .text('keine Verlagsartikel ausgeschlossen') } + /* const excludedYears = target.append('div') .attr('id', 'dashboard-excluded-years'); + excludedYears.append('h3') + .text('Ausgeschlossene Jahre'); if (tx_publisherdb_visualizationStatus.excludedYears.length) { - excludedYears.append('h3') - .text('Ausgeschlossene Jahre'); const excludedYearList = excludedYears.append('div') .attr('class', 'tiny button-group'); excludedYearList.selectAll(`a.${tx_publisherdb_dashboardExcludedYear}`) @@ -46,11 +54,12 @@ const tx_publisherdb_dashboardController = { .attr('id', d => d) .html(d => d); } + */ const movingAverages = target.append('div') .attr('id', 'dashboard-moving-averages') movingAverages.append('h3') - .html('Gleitende Mittelwerte'); + .html('Anzeige'); const movingAveragesList = movingAverages.append('div') .attr('class', 'tiny button-group'); tx_publisherdb_visualizationStatus.movingAverages.forEach( ma => { @@ -64,10 +73,12 @@ const tx_publisherdb_dashboardController = { .attr('id', 'dashboard-set-cumulative') .attr('class', 'primary button hollow dashboard-set-cumulativity') .html('kumulativ'); + /* movingAveragesList.append('a') .attr('id', 'dashboard-set-absolute') .attr('class', 'primary button hollow dashboard-set-cumulativity') .html('absolut'); + */ movingAveragesList.append('a') .attr('id', 'dashboard-set-per-year') .attr('class', 'primary button hollow dashboard-set-granularity') @@ -99,7 +110,7 @@ const tx_publisherdb_dashboardController = { $('a.dashboard-set-cumulativity').click ( e => { if (e.currentTarget.id == 'dashboard-set-cumulative') { tx_publisherdb_visualizationStatus.config = { - granularity: tx_publisherdb_visualizationStatus.config.granularity, + granularity: tx_publisherdb_granularity.PER_YEAR, cumulativity: tx_publisherdb_cumulativity.CUMULATIVE, movingAverage: -1 } @@ -115,22 +126,22 @@ const tx_publisherdb_dashboardController = { $('a.dashboard-set-granularity').click ( e => { if (e.currentTarget.id == 'dashboard-set-per-year') { tx_publisherdb_visualizationStatus.config = { - granularity: tx_publisherdb_visualizationStatus.config.granularity, - cumulativity: tx_publisherdb_cumulativity.PER_YEAR, + cumulativity: tx_publisherdb_cumulativity.ABSOLUTE, + granularity: tx_publisherdb_granularity.PER_YEAR, movingAverage: -1 } } else { tx_publisherdb_visualizationStatus.config = { - granularity: tx_publisherdb_visualizationStatus.config.granularity, - cumulativity: tx_publisherdb_cumulativity.BY_DATE, + cumulativity: tx_publisherdb_cumulativity.ABSOLUTE, + granularity: tx_publisherdb_granularity.BY_DATE, movingAverage: -1 } } }); - const publishers = target.append('div') - .attr('id', 'dashboard-publishers'); if (!tx_publisherdb_visualizationStatus.isPublishedItem) { + const publishers = target.append('div') + .attr('id', 'dashboard-publishers'); publishers.append('h3') .text('Verlage'); const publisherList = publishers.append('div') diff --git a/Resources/Public/JavaScript/GraphController.js b/Resources/Public/JavaScript/GraphController.js index 1491695..47edf95 100644 --- a/Resources/Public/JavaScript/GraphController.js +++ b/Resources/Public/JavaScript/GraphController.js @@ -8,22 +8,35 @@ const tx_publisherdb_graphController = { calculateAxis() { this._yearScale = d3.scaleLinear() .domain(d3.extent(tx_publisherdb_visualizationStatus.years)) + .range([0, this.timeseriesWidth]); + this._yearBandScale = d3.scaleBand() .range([0, this.timeseriesWidth]) - .nice(); + .domain(tx_publisherdb_visualizationStatus.years); this._yearAxis = d3.axisBottom() .tickFormat(d3.format(' ')) .scale(this._yearScale); + this._yearBandAxis = d3.axisBottom() + .tickFormat(d3.format(' ')) + .scale(this._yearBandScale) + .tickValues(this._yearScale.ticks()); }, render() { + const graphType = + tx_publisherdb_visualizationStatus.targetData == 'prints_per_year' || + tx_publisherdb_visualizationStatus.targetData == 'prints_by_date' ? + 'columns' : 'area'; const target = d3.select(`#${this._target}`); target.html(''); const width = $(`#${this._target}`).width(); const margin = Math.log2(width) * 3 + 10; - this.barplotWidth = tx_publisherdb_visualizationStatus.singleItem ? 0 : (width - 3 * margin) / 4; + this.barplotWidth = + tx_publisherdb_visualizationStatus.singleItem || + tx_publisherdb_visualizationStatus.targetData == 'prints_per_year_cumulative' ? + 0 : (width - 3 * margin) / 4; this.timeseriesWidth = width - 3 * margin - this.barplotWidth; this.calculateAxis(); @@ -37,7 +50,7 @@ const tx_publisherdb_graphController = { .attr('transform', `translate(${margin},${margin})`); const qScale = d3.scaleLinear() - .domain(d3.extent(tx_publisherdb_visualizationStatus.summedYearData, d => d.total)); + .domain([0, d3.max(tx_publisherdb_visualizationStatus.summedYearData, d => d.total)]); const qAxis = d3.axisRight() .scale(this.qScale); @@ -48,10 +61,12 @@ const tx_publisherdb_graphController = { data: tx_publisherdb_visualizationStatus.summedYearData.map(d => ({year: d.year, quantity: d.total})), qAxis: qAxis, qScale: qScale, - tAxis: this._yearAxis, + tAxis: graphType == 'area' ? this._yearAxis : this._yearBandAxis, tScale: this._yearScale, margin: margin, - isMain: true + title: '', + isMain: true, + type: graphType }; const mainTimeseries = new TimeseriesView(timeseriesConfig); @@ -63,29 +78,33 @@ const tx_publisherdb_graphController = { const subitemsTarget = svg.append('g') .attr('id', 'graph-subitems') .attr('transform', `translate(${margin},${2 * margin + timeseriesHeight})`); - const barplotTarget = svg.append('g') - .attr('id', 'graph-barplot') - .attr('transform', `translate(${2 * margin + this.timeseriesWidth},${2 * margin + mainTimeseries.height})`); const subitemConfig = { target: subitemsTarget, startY: timeseriesHeight + margin * 2, width: this.timeseriesWidth, - tAxis: this._yearAxis, + tAxis: graphType == 'area' ? this._yearAxis : this._yearBandAxis, data: tx_publisherdb_visualizationStatus.summedYearData, tScale: this._yearScale, - margin: margin + titles: tx_publisherdb_visualizationStatus.subitemIds, + margin: margin, + type: graphType }; tx_publisherdb_subitemController.config = subitemConfig; svg.attr('height', mainTimeseries.height + tx_publisherdb_subitemController.height + margin * 4); - const barplotConfig = { - target: barplotTarget, - width: this.barplotWidth, - height: tx_publisherdb_subitemController.height - }; - tx_publisherdb_barplotController.config = barplotConfig; + if (tx_publisherdb_visualizationStatus.targetData != 'prints_per_year_cumulative') { + const barplotTarget = svg.append('g') + .attr('id', 'graph-barplot') + .attr('transform', `translate(${2 * margin + this.timeseriesWidth},${2 * margin + mainTimeseries.height})`); + const barplotConfig = { + target: barplotTarget, + width: this.barplotWidth, + height: tx_publisherdb_subitemController.height + }; + tx_publisherdb_barplotController.config = barplotConfig; + } } } } diff --git a/Resources/Public/JavaScript/SubitemController.js b/Resources/Public/JavaScript/SubitemController.js index 69306b0..1bf6f89 100644 --- a/Resources/Public/JavaScript/SubitemController.js +++ b/Resources/Public/JavaScript/SubitemController.js @@ -7,7 +7,9 @@ const tx_publisherdb_subitemController = { this.tAxis = config.tAxis; this.tScale = config.tScale; this.data = config.data; + this.titles = config.titles; this.margin = config.margin; + this.type = config.type; this.init(); }, @@ -29,8 +31,10 @@ const tx_publisherdb_subitemController = { tScale: this.tScale, qScale: qScale, data: data, + title: this.titles[i], margin: this.margin, - isMain: false + isMain: false, + type: this.type }; const view = new TimeseriesView(config); diff --git a/Resources/Public/JavaScript/TableController.js b/Resources/Public/JavaScript/TableController.js index cef2f83..86cbd89 100644 --- a/Resources/Public/JavaScript/TableController.js +++ b/Resources/Public/JavaScript/TableController.js @@ -13,58 +13,33 @@ const tx_publisherdb_tableController = { set target(target) { this._target = target; - this._sorting = { - by: 'year', - asc: true - }; this.render(); - //this.registerEvents(); this.colorSortButtons(); }, - sort(a, b) { - if (tx_publisherdb_tableController._sorting.by == 'year') { - return tx_publisherdb_tableController._sorting.asc ? - a.year - b.year : b.year - a.year; - } else if (tx_publisherdb_tableController._sorting.by == 'total') { - const totalA = a.items.reduce((a, b) => a.quantity + b.quantity); - const totalB = b.items.reduce((a, b) => a.quantity + b.quantity); - const quantityDiff = tx_publisherdb_tableController._sorting.asc ? - totalA - totalB : totalB - totalA; - if (quantityDiff) { - return quantityDiff; - } - return a.year - b.year; - } else { - const quantityA = a.items.filter(item => item.id == tx_publisherdb_tableController._sorting.by)[0]['quantity']; - const quantityB = b.items.filter(item => item.id == tx_publisherdb_tableController._sorting.by)[0]['quantity']; - const quantityDiff = tx_publisherdb_tableController._sorting.asc ? - quantityA - quantityB : quantityB - quantityA; - if (quantityDiff) { - return quantityDiff; - } - return a.year - b.year; - } - }, - colorSortButtons() { - const ascSelector = this._sorting.asc ? 'asc' : 'desc'; - const sortSelector = `${tx_publisherdb_tableSortItem}-${this._sorting.by}`; + const ascSelector = tx_publisherdb_visualizationStatus.sorting.asc ? 'asc' : 'desc'; + const sortSelector = `${tx_publisherdb_tableSortItem}-${tx_publisherdb_visualizationStatus.sorting.by}`; d3.selectAll('a.sort-btn span').style('color', ''); d3.selectAll(`a.sort-btn#${sortSelector} span.${ascSelector}`).style('color', 'black'); }, render() { + // set formatters const formatNumber = x => Intl.NumberFormat('de-DE').format(x); + const formatDate = x => d3.timeFormat('%d.%m.%Y')(d3.isoParse(x)); const createButton = (cl, label) => id => ` ${label} `; const createSortButton = tx_publisherdb_visualizationStatus._config.cumulativity == tx_publisherdb_cumulativity.CUMULATIVE ? _ => '' : createButton('sort-btn', '↑↓'); const createExcludeYearButton = tx_publisherdb_visualizationStatus.singleYear ? _ => '' : createButton('exclude-btn', 'x'); const createExcludeItemButton = tx_publisherdb_visualizationStatus.singleItem ? _ => '' : createButton('exclude-btn', 'x'); + + // init const target = d3.select(`#${this._target}`); target.html(''); + // create table and header const table = target.append('table') .attr('class', 'table') .attr('class', tx_publisherdb_tableClass); @@ -72,12 +47,19 @@ const tx_publisherdb_tableController = { const tableHead = table.append('thead'); const headRow = tableHead.append('tr'); - headRow.append('th') + const yearHead = headRow.append('th'); + yearHead .attr('scope', 'col') .attr('class', tx_publisherdb_tableSort) .attr('id', tx_publisherdb_tableYear) - .attr('class', 'text-right') - .html(createSortButton(`${tx_publisherdb_tableSortItem}-year`) + 'Jahr'); + .attr('class', 'text-right'); + + if (tx_publisherdb_visualizationStatus.singlePrint) { + yearHead.html('Datum'); + } else { + yearHead.html(createSortButton(`${tx_publisherdb_tableSortItem}-year`) + ' Jahr'); + } + headRow.selectAll(`th.${tx_publisherdb_tableYear}`) .data(tx_publisherdb_visualizationStatus.subitemIds) .join('th') @@ -85,11 +67,21 @@ const tx_publisherdb_tableController = { .attr('class', tx_publisherdb_tableYear) .attr('id', d => d) .attr('class', 'text-right') - .html( - d => createSortButton(`${tx_publisherdb_tableSortItem}-${d}`) + - createExcludeItemButton(`${tx_publisherdb_tableExcludeItem}-${d}`) + d - ); - if (!tx_publisherdb_visualizationStatus.singleItem) { + .html(d => tx_publisherdb_visualizationStatus.singleItem ? d : createSortButton(`${tx_publisherdb_tableSortItem}-${d}`) + + createExcludeItemButton(`${tx_publisherdb_tableExcludeItem}-${d}`) + d); + + + if (tx_publisherdb_visualizationStatus.singlePrint) { + headRow.selectAll(`th.${tx_publisherdb_tableYear}`).html(d => d); + } else { + headRow.selectAll(`th.${tx_publisherdb_tableYear}`).html(d => createSortButton(`${tx_publisherdb_tableSortItem}-${d}`) + + createExcludeItemButton(`${tx_publisherdb_tableExcludeItem}-${d}`) + d); + } + + if ( + !tx_publisherdb_visualizationStatus.singleItem && + tx_publisherdb_visualizationStatus.targetData != 'prints_by_date' + ) { headRow.append('th') .attr('scope', 'col') .attr('class', tx_publisherdb_tableSort) @@ -98,30 +90,46 @@ const tx_publisherdb_tableController = { .html(createSortButton(`${tx_publisherdb_tableSortItem}-total`) + 'Total'); } + // create body const tableBody = table.append('tbody'); + const bodyRows = tableBody.selectAll('tr') - .data(tx_publisherdb_visualizationStatus.summedYearData) + .data( + tx_publisherdb_visualizationStatus.targetData == 'prints_by_date' ? + tx_publisherdb_visualizationStatus.printsByDates : + tx_publisherdb_visualizationStatus.summedYearData + ) .join('tr'); bodyRows.append('th') .attr('class', tx_publisherdb_tableRow) .attr('scope', 'row') .attr('class', 'text-right') - .html(d => createExcludeYearButton(`${tx_publisherdb_tableExcludeYear}-${d.year}`) + d.year); + .html(d => tx_publisherdb_visualizationStatus.targetData == 'prints_by_date' ? + formatDate(d.date) : d.year); + bodyRows.selectAll(`td.${tx_publisherdb_tableData}`) .data(d => d.items) .join('td') .attr('class', tx_publisherdb_tableData) .attr('class', 'text-right') .html(d => formatNumber(d)); - if (!tx_publisherdb_visualizationStatus.singleItem) { - bodyRows.append('th') - .attr('class', `${tx_publisherdb_tableYear}-total`) - .attr('class', 'text-right') - .attr('scope', 'row') - .html(d => formatNumber(d.total)); + + if (tx_publisherdb_visualizationStatus.targetData != 'prints_by_date') { + if (!tx_publisherdb_visualizationStatus.singleItem) { + bodyRows.append('th') + .attr('class', `${tx_publisherdb_tableYear}-total`) + .attr('class', 'text-right') + .attr('scope', 'row') + .html(d => formatNumber(d.total)); + } } - if (tx_publisherdb_visualizationStatus._config.cumulativity != tx_publisherdb_cumulativity.CUMULATIVE && !tx_publisherdb_visualizationStatus.singleYear) { + if ( + tx_publisherdb_visualizationStatus._config.cumulativity != + tx_publisherdb_cumulativity.CUMULATIVE && + !tx_publisherdb_visualizationStatus.singleYear && + !tx_publisherdb_visualizationStatus.singlePrint + ) { const tableFoot = table.append('tfoot'); const footRow = tableFoot.append('tr'); footRow.append('th') @@ -136,7 +144,10 @@ const tx_publisherdb_tableController = { .attr('scope', 'col') .attr('class', 'text-right') .html(d => formatNumber(d.sum)); - if (!tx_publisherdb_visualizationStatus.singleItem) { + if ( + !tx_publisherdb_visualizationStatus.singleItem && + tx_publisherdb_visualizationStatus.targetData != 'prints_by_date' + ) { const total = tx_publisherdb_visualizationStatus.sums .map(d => +d.sum) .reduce((a, b) => a + b); @@ -153,16 +164,17 @@ const tx_publisherdb_tableController = { registerEvents() { $('a.sort-btn').click( e => { const id = e.currentTarget.id.replace(`${tx_publisherdb_tableSortItem}-`, ''); - if (this._sorting.by == id) { - this._sorting.asc = !this._sorting.asc; + if (tx_publisherdb_visualizationStatus.sorting.by == id) { + tx_publisherdb_visualizationStatus.sorting.asc = !tx_publisherdb_visualizationStatus.sorting.asc; } else { - this._sorting.by = id; + tx_publisherdb_visualizationStatus.sorting.by = id; if (id == 'year') { - this._sorting.asc = true; + tx_publisherdb_visualizationStatus.sorting.asc = true; } else { - this._sorting.asc = false; + tx_publisherdb_visualizationStatus.sorting.asc = false; } } + tx_publisherdb_visualizationStatus.updateData(); this.render(); this.colorSortButtons(); }); diff --git a/Resources/Public/JavaScript/TimeseriesView.js b/Resources/Public/JavaScript/TimeseriesView.js index fb68554..a74562e 100644 --- a/Resources/Public/JavaScript/TimeseriesView.js +++ b/Resources/Public/JavaScript/TimeseriesView.js @@ -13,6 +13,8 @@ class TimeseriesView { this.data = config.data; this.margin = config.margin; this.isMain = config.isMain; + this.title = config.title; + this.type = config.type; this.init(); } @@ -29,6 +31,8 @@ class TimeseriesView { } render() { + this.target.append('text') + .text(this.title); const qScale = this.qScale.range([this._height, 0]); const qAxis = d3.axisRight() .scale(this.qScale) @@ -43,22 +47,32 @@ class TimeseriesView { .y1(d => this.qScale(d.quantity)) .curve(d3.curveBumpX); - this.target.append('path') - .attr('d', area(this.data)) - .attr('fill', 'hsla(45,100%,80%,100%)'); + const bandScale = d3.scaleBand() + .range([0, this.width]) + .domain(this.data.map(d => d.year)) + .align(.5) + .paddingOuter(.1) + .paddingInner(.2); this.target.append('g') .attr('transform', `translate(${this.width},0)`) .call(qAxis); - /* - this.target.selectAll('circle') - .data(this.data) - .join('circle') - .attr('cx', d => this.tScale(+d.year)) - .attr('cy', d => this.qScale(d.quantity)) - .attr('fill', 'black') - .attr('r', d => d.quantity > 0 ? 2 : 0); -*/ + if (this.type == 'area') { + this.target.append('path') + .attr('d', area(this.data)) + .attr('fill', 'hsla(45,100%,80%,100%)'); + + } else { + this.target.selectAll('rect') + .data(this.data) + .join('rect') + .attr('y', d => this.qScale(d.quantity)) + .attr('x', d => bandScale(+d.year)) + .attr('width', d => bandScale.bandwidth()) + .attr('height', d => this._height - this.qScale(d.quantity)) + .attr('fill', 'hsl(45,100%,80%)'); + } + } } diff --git a/Resources/Public/JavaScript/VisualizationController.js b/Resources/Public/JavaScript/VisualizationController.js index 1a2d695..a0140ab 100644 --- a/Resources/Public/JavaScript/VisualizationController.js +++ b/Resources/Public/JavaScript/VisualizationController.js @@ -10,7 +10,8 @@ let tx_publisherdb_visualizationController = { const firstTwoCapitals = /\b[A-Z][A-Z]/; const realisedPublishers = tx_publisherdb_visualizationStatus.data.published_items - .map(d => firstTwoCapitals.exec(d.id)[0]); + ?.map(d => firstTwoCapitals.exec(d.id)[0]) ?? + firstTwoCapitals.exec(tx_publisherdb_visualizationStatus.data.id); const uniqueRealisedPublishers = [ ... new Set(realisedPublishers) ]; const publisherMap = uniqueRealisedPublishers .map(d => ({ @@ -32,8 +33,10 @@ let tx_publisherdb_visualizationController = { reduce( (a, b) => a < b ? a : b ); tx_publisherdb_tableController.target = config.tableTarget; - tx_publisherdb_dashboardController.target = config.dashboardTarget; - tx_publisherdb_graphController.target = config.graphTarget; + if (!tx_publisherdb_visualizationStatus.singlePrint){ + tx_publisherdb_dashboardController.target = config.dashboardTarget; + tx_publisherdb_graphController.target = config.graphTarget; + } tx_publisherdb_visualizationStatus.registerView(tx_publisherdb_tableController); tx_publisherdb_visualizationStatus.registerView(tx_publisherdb_dashboardController); diff --git a/Resources/Public/JavaScript/VisualizationStatus.js b/Resources/Public/JavaScript/VisualizationStatus.js index da1d983..379c89d 100644 --- a/Resources/Public/JavaScript/VisualizationStatus.js +++ b/Resources/Public/JavaScript/VisualizationStatus.js @@ -28,9 +28,15 @@ let tx_publisherdb_visualizationStatus = { _publishers: [], singleItem: false, singleYear: false, + singlePrint: false, _years: [], _subitemIds: [], + sorting: { + by: 'year', + asc: true + }, + set subitemIds (subitemIds) { this._subitemIds = subitemIds; if (this._subitemIds.length == 1) { @@ -92,18 +98,6 @@ let tx_publisherdb_visualizationStatus = { return this._publishers; }, - /* - set granularity (granularity) { - this._granularity = granularity; - this.updateView(); - }, - - set cumulativity (cumulativity) { - this._cumulativity = cumulativity; - this.updateView(); - }, - */ - set excludedYears (excludedYears) { this._excludedYears = excludedYears; this.updateView(); @@ -122,6 +116,38 @@ let tx_publisherdb_visualizationStatus = { set data (data) { this._isPublishedItem = data.published_subitems ? true : false; this._data = data; + + const publishedSubitems = this._data.published_subitems ?? + this._data.published_items.flatMap(({id, published_subitems}) => published_subitems); + if ( + publishedSubitems.length == 1 && + publishedSubitems[0].prints_per_year.length == 1 + ) { + this.singlePrint = true; + this._config.granularity = tx_publisherdb_granularity.BY_DATE; + } + + const suborder = this._isPublishedItem ? data.published_subitems : + data.published_items + .map(published_item => published_item.published_subitems) + .flat(); + const dates = suborder.filter(published_subitem => published_subitem.prints_by_date) + .map(published_subitem => published_subitem.prints_by_date) + .flat() + .map(print => print.date); + const uniqueDates = [ ... new Set(dates) ]; + + this.printsByDates = uniqueDates.map(date => ({ + date: date, items: + suborder.map( subitem => + subitem.prints_by_date?.filter(print => print.date== date).length > 0 ? + subitem.prints_by_date.filter(print => print.date == date)[0]['quantity'] : 0 + ) + }) + ).sort( (printA, printB) => + printA.date < printB.date ? -1 : 1 + ); + this.updateView(); }, @@ -201,6 +227,8 @@ let tx_publisherdb_visualizationStatus = { }, updateData() { + // unification function + const unify = date => d3.isoParse(`${date}`).getYear() + 1900; // retrieve published subitems const publishedSubitems = this.isPublishedItem ? this.data.published_subitems : this.data.published_items.map(d => d.published_subitems).flat(); @@ -215,10 +243,10 @@ let tx_publisherdb_visualizationStatus = { // retrieve per year data including totals for table body const years = publishedSubitems.map(subitem => { const targetData = subitem[this.targetData] ?? []; - return targetData.map(print => print.date); + return targetData.map(print => unify(print.date)); }) .flat(); - this.years = d3.range(d3.min(years), d3.max(years)) + this.years = d3.range(+d3.min(years), +d3.max(years) + 1) .filter(year => !this.excludedYears.includes(year)); const yearData = this.years.map(year => ({ @@ -228,7 +256,7 @@ let tx_publisherdb_visualizationStatus = { .filter(item => currentPublisherRegex ? currentPublisherRegex.test(item.id) : true) .map(prints => { const targetData = prints[this.targetData] ?? []; - const targetPrint = targetData.filter(print => print.date == year); + const targetPrint = targetData.filter(print => unify(print.date) == year); return { id: prints.id, quantity: targetPrint.length > 0 ? targetPrint[0].quantity : 0 @@ -237,6 +265,21 @@ let tx_publisherdb_visualizationStatus = { })) .sort(this.sort) .map(item => ({ year: item.year, items: item.items.map(i => i.quantity) })); + + if (this.targetData == 'prints_per_year_cumulative') { + for(let i = 0; i < yearData.length; i++) { + for (let j = 0; j < yearData[i].items.length; j++) { + if (yearData[i].items[j] == 0 && i > 0) { + let runner = i - 1; + while (runner > 0 && yearData[runner].items[j] == 0) { + runner--; + } + yearData[i].items[j] = yearData[runner].items[j]; + } + } + } + } + this.summedYearData = yearData.map(({year, items}) => ({ year, items, total: items.reduce((a, b) => +a + b) @@ -257,5 +300,30 @@ let tx_publisherdb_visualizationStatus = { registerView: function (view) { this._views.push(view); + }, + + sort(a, b) { + if (tx_publisherdb_visualizationStatus.sorting.by == 'year') { + return tx_publisherdb_visualizationStatus.sorting.asc ? + a.year - b.year : b.year - a.year; + } else if (tx_publisherdb_visualizationStatus.sorting.by == 'total') { + const totalA = a.items.map(item => item.quantity).reduce((c, d) => c + d); + const totalB = b.items.map(item => item.quantity).reduce((c, d) => c + d); + const quantityDiff = tx_publisherdb_visualizationStatus.sorting.asc ? + totalA - totalB : totalB - totalA; + if (quantityDiff) { + return quantityDiff; + } + return a.year - b.year; + } else { + const quantityA = a.items.filter(item => item.id == tx_publisherdb_visualizationStatus.sorting.by)[0]['quantity']; + const quantityB = b.items.filter(item => item.id == tx_publisherdb_visualizationStatus.sorting.by)[0]['quantity']; + const quantityDiff = tx_publisherdb_visualizationStatus.sorting.asc ? + quantityA - quantityB : quantityB - quantityA; + if (quantityDiff) { + return quantityDiff; + } + return a.year - b.year; + } } } diff --git a/Resources/Public/Scss/layout.less b/Resources/Public/Scss/layout.less deleted file mode 100644 index 00aaf48..0000000 --- a/Resources/Public/Scss/layout.less +++ /dev/null @@ -1 +0,0 @@ -@import 'research_plugin'; diff --git a/Resources/Public/Scss/research_plugin.less b/Resources/Public/Scss/research_plugin.less deleted file mode 100644 index 6fcf1fe..0000000 --- a/Resources/Public/Scss/research_plugin.less +++ /dev/null @@ -1,49 +0,0 @@ -div.entity-list-item { - margin-top: 20px; - padding-bottom: 10px; - border-bottom: solid; - border-color: lightgray; - border-width: 1px; - - a { - font-weight: bold; - } - - a:hover { - text-decoration: none; - } - - div.entity-type { - margin-bottom: -10px; - } - - div.entity-title { - a { - font-size: 150%; - color:black; - } - } - - div.entity-preview { - font-size: 90%; - max-height: 2.7em; - overflow: hidden; - text-overflow: "..."; - color: darkgray; - } - - span.entity-life-span, span.entity-date-of-production, span.entity-composer { - margin-right: 30px; - } - - div.index-picker { - @include pagination-container; - } - -} - -div#tx_mpdbpresentation_table { - width: 100%; - max-width: 1200px; - overflow: auto; -} diff --git a/composer.json b/composer.json index 4b29ddd..3509008 100755 --- a/composer.json +++ b/composer.json @@ -10,10 +10,11 @@ ], "require": { "typo3/cms-core": "^11", - "elasticsearch/elasticsearch": "^7", - "slub/mpdb-core": "dev-main", + "elasticsearch/elasticsearch": "^8", + "slub/mpdb-core": "dev-test", "fluidtypo3/vhs": "^6", - "illuminate/collections": "^8" + "illuminate/collections": "^8", + "illuminate/support": "^8" }, "config": { "vendor-dir": ".Build/vendor", diff --git a/ext_localconf.php b/ext_localconf.php index eef7933..0555cef 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -6,38 +6,30 @@ use \Slub\MpdbPresentation\Controller\PublishedItemController; use \Slub\MpdbPresentation\Controller\InstrumentController; use \Slub\MpdbPresentation\Controller\FormController; -use \Slub\MpdbPresentation\Services\ElasticSearchService; +use \Slub\MpdbPresentation\Controller\WelcomeController; use \TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3_MODE') || die('Access denied.'); -ExtensionManagementUtility::addService( - 'MpdbPresentation', - 'search', - 'tx_mpdbpresentation_elasticsearch', - [ - 'title' => 'Elasticsearch Service', - 'description' => 'Provides the frontend with a connection to elasticsearch', - 'subtype' => '', - 'available' => true, - 'priority' => 50, - 'quality' => 50, - 'os' => '', - 'exec' => '', - 'className' => ElasticSearchService::class, - ] -); - - call_user_func( function() { \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'MpdbPresentation', - 'Fepublisherapi', + 'Mpdbpublisherapi', + [ + \Slub\MpdbPresentation\Controller\ApiController::class => 'api' + ], + // non-cacheable actions + [ ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'MpdbPresentation', + 'Mpdbwelcome', [ - \SLUB\MpdbPresentation\Controller\ApiController::class => 'api' + WelcomeController::class => 'welcome' ], // non-cacheable actions [ ] @@ -73,18 +65,57 @@ function() list_type = tx_mpdbpresentation_mpdbresearch } } + mpdbpresentation_mpdbwelcome { + iconIdentifier = mpdb_wel_icon + title = LLL:EXT:mpdb_presentation/Resources/Private/Language/locallang.xlf:welcome_title + description = LLL:EXT:mpdb_presentation/Resources/Private/Language/locallang.xlf:welcome_description + tt_content_defValues { + CType = list + list_type = tx_mpdbpresentation_mpdbwelcome + } + } } show = * } }' ); - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + $iconRegistry->registerIcon( + 'mpdb_presentation-work', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_icon_work.svg'] + ); + $iconRegistry->registerIcon( + 'mpdb_presentation-person', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_icon_person.svg'] + ); + $iconRegistry->registerIcon( + 'mpdb_presentation-item', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_icon_item.svg'] + ); + $iconRegistry->registerIcon( + 'mpdb_presentation-gnd', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_icon_gnd.svg'] + ); + $iconRegistry->registerIcon( + 'mpdb_presentation-search', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/mpdb_icon_search.svg'] + ); $iconRegistry->registerIcon( 'mpdb_presentation-plugin-fepublisherdb', \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/user_plugin_fepublisherdb.svg'] ); - + $iconRegistry->registerIcon( + 'mpdb_presentation-plugin-fewelcome', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:mpdb_presentation/Resources/Public/Icons/user_plugin_welcome.svg'] + ); } );