From 28aaf7f38a731452e14b0fe41b2e2cf8491e735a Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 10 Dec 2024 18:29:54 +0100 Subject: [PATCH] Add colon and add in to journal article footer --- Classes/Processing/BibEntryConfig.php | 161 ++++++++++++++------------ 1 file changed, 87 insertions(+), 74 deletions(-) diff --git a/Classes/Processing/BibEntryConfig.php b/Classes/Processing/BibEntryConfig.php index 33a84d5..108d7f4 100644 --- a/Classes/Processing/BibEntryConfig.php +++ b/Classes/Processing/BibEntryConfig.php @@ -35,6 +35,7 @@ class BibEntryConfig 'separator' => ', ' ] ]; + const EDITOR = [ 'compound' => [ 'fields' => [ @@ -55,6 +56,7 @@ class BibEntryConfig 'separator' => ', ' ] ]; + const TRANSLATOR = [ 'compound' => [ 'fields' => [ @@ -75,55 +77,65 @@ class BibEntryConfig 'separator' => ', ' ] ]; + const TITLE = [ 'field' => 'title' ]; + const PUBLICATION_TITLE = [ 'field' => 'publicationTitle', 'conditionField' => 'publicationTitle', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const BOOK_TITLE = [ 'field' => 'bookTitle', 'conditionField' => 'bookTitle', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const UNIVERSITY = [ 'field' => 'university', 'conditionField' => 'university', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const VOLUME = [ 'field' => 'volume', 'conditionField' => 'volume', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const ISSUE = [ 'field' => 'issue', 'conditionField' => 'issue', 'conditionValue' => '', 'conditionRelation' => 'neq' ]; + const PLACE = [ 'field' => 'place', 'conditionField' => 'place', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const DATE = [ 'field' => 'date', 'conditionField' => 'date', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const PAGES = [ 'field' => 'pages', 'conditionField' => 'pages', 'conditionValue' => '', 'conditionRelation' => 'neq', ]; + const NUMBER_OF_VOLUMES = [ 'field' => 'numberOfVolumes', 'conditionField' => 'numberOfVolumes', @@ -131,6 +143,79 @@ class BibEntryConfig 'conditionRelation' => 'neq', ]; + const SEARCHABLE_FIELDS = [ + [ + 'compound' => [ + 'fields' => [ + [ + 'field' => 'firstName', + 'conditionField' => 'creatorType', + 'conditionValue' => 'author', + 'conditionRelation' => 'eq' + ], + [ + 'field' => 'lastName', + 'conditionField' => 'creatorType', + 'conditionValue' => 'author', + 'conditionRelation' => 'eq' + ] + ], + 'field' => 'creators', + 'separator' => ' ', + 'postfix' => ' ' + ] + ], + [ + 'field' => 'title', + 'postfix' => ' ' + ], + [ + 'field' => 'university', + 'postfix' => ' ' + ], + [ + 'field' => 'bookTitle', + 'postfix' => ' ' + ], + [ + 'field' => 'series', + 'postfix' => ' ' + ], + [ + 'field' => 'publicationTitle', + 'postfix' => ' ' + ], + [ + 'field' => 'place', + 'postfix' => ' ' + ], + [ + 'field' => 'date', + 'postfix' => ' ' + ] + ]; + + const BOOSTED_FIELDS = [ + [ + 'compound' => [ + 'fields' => [ + [ + 'field' => 'lastName', + 'conditionField' => 'creatorType', + 'conditionValue' => 'author', + 'conditionRelation' => 'eq' + ] + ], + 'field' => 'creators', + 'separator' => ' ', + 'reverseFirst' => true, + 'postfix' => ' ' + ] + ], + [ 'field' => 'title' ], + [ 'field' => 'date' ] + ]; + public static function getAuthorHeader(): array { return [ self::AUTHOR ]; @@ -149,7 +234,7 @@ public static function getBody(): array public static function getArticleFooter(): array { return [ - self::postfix(self::PUBLICATION_TITLE, ' '), + self::circumfix(self::PUBLICATION_TITLE, 'in: ', ' '), self::postfix(self::VOLUME, ' '), self::circumfix(self::DATE, '(', '), '), self::circumfix(self::ISSUE, 'Nr. ', ', '), @@ -160,7 +245,7 @@ public static function getArticleFooter(): array public static function getBookSectionFooter(): array { return [ - self::circumfix(self::BOOK_TITLE, 'In ', ', '), + self::circumfix(self::BOOK_TITLE, 'in: ', ', '), self::circumfix(self::EDITOR, 'hg. von ', ', '), self::circumfix(self::TRANSLATOR, 'übers. von ', ', '), self::postfix(self::NUMBER_OF_VOLUMES, 'Bde., '), @@ -236,76 +321,4 @@ private static function surroundComma(array $field): array { return self::comma(self::surround($field)); } - - const SEARCHABLE_FIELDS = [ - [ - 'compound' => [ - 'fields' => [ - [ - 'field' => 'firstName', - 'conditionField' => 'creatorType', - 'conditionValue' => 'author', - 'conditionRelation' => 'eq' - ], - [ - 'field' => 'lastName', - 'conditionField' => 'creatorType', - 'conditionValue' => 'author', - 'conditionRelation' => 'eq' - ] - ], - 'field' => 'creators', - 'separator' => ' ', - 'postfix' => ' ' - ] - ], - [ - 'field' => 'title', - 'postfix' => ' ' - ], - [ - 'field' => 'university', - 'postfix' => ' ' - ], - [ - 'field' => 'bookTitle', - 'postfix' => ' ' - ], - [ - 'field' => 'series', - 'postfix' => ' ' - ], - [ - 'field' => 'publicationTitle', - 'postfix' => ' ' - ], - [ - 'field' => 'place', - 'postfix' => ' ' - ], - [ - 'field' => 'date', - 'postfix' => ' ' - ] - ]; - const BOOSTED_FIELDS = [ - [ - 'compound' => [ - 'fields' => [ - [ - 'field' => 'lastName', - 'conditionField' => 'creatorType', - 'conditionValue' => 'author', - 'conditionRelation' => 'eq' - ] - ], - 'field' => 'creators', - 'separator' => ' ', - 'reverseFirst' => true, - 'postfix' => ' ' - ] - ], - [ 'field' => 'title' ], - [ 'field' => 'date' ] - ]; }