Skip to content

Commit

Permalink
Add colon and add in to journal article footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Dec 10, 2024
1 parent 840b887 commit 28aaf7f
Showing 1 changed file with 87 additions and 74 deletions.
161 changes: 87 additions & 74 deletions Classes/Processing/BibEntryConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class BibEntryConfig
'separator' => ', '
]
];

const EDITOR = [
'compound' => [
'fields' => [
Expand All @@ -55,6 +56,7 @@ class BibEntryConfig
'separator' => ', '
]
];

const TRANSLATOR = [
'compound' => [
'fields' => [
Expand All @@ -75,62 +77,145 @@ 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',
'conditionValue' => '',
'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 ];
Expand All @@ -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. ', ', '),
Expand All @@ -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., '),
Expand Down Expand Up @@ -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' ]
];
}

0 comments on commit 28aaf7f

Please sign in to comment.