Skip to content

Commit

Permalink
add uniform title and language notes via TAMU module
Browse files Browse the repository at this point in the history
  • Loading branch information
jsavell committed Jul 15, 2024
1 parent 33eebef commit e52020b
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 25 deletions.
52 changes: 37 additions & 15 deletions module/TAMU/config/module.config.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
<?php
namespace TAMU\Module\Config;

return [
'vufind' => [
'plugin_managers' => [
'ils_driver' => [
'factories' => [
'TAMU\\ILS\\Driver\\Folio' => 'VuFind\\ILS\\Driver\\FolioFactory',
],
'aliases' => [
'VuFind\\ILS\\Driver\\Folio' => 'TAMU\\ILS\\Driver\\Folio',
]
],
],
],
];
return array (
'vufind' =>
array (
'plugin_managers' =>
array (
'ils_driver' =>
array (
'factories' =>
array (
'TAMU\\ILS\\Driver\\Folio' => 'VuFind\\ILS\\Driver\\FolioFactory',
),
'aliases' =>
array (
'VuFind\\ILS\\Driver\\Folio' => 'TAMU\\ILS\\Driver\\Folio',
),
),
'recorddriver' =>
array (
'factories' =>
array (
'TAMU\\RecordDriver\\SolrMarc' => 'TAMU\\RecordDriver\\SolrDefaultFactory',
),
'aliases' =>
array (
'VuFind\\RecordDriver\\SolrMarc' => 'TAMU\\RecordDriver\\SolrMarc',
),
'delegators' =>
array (
'TAMU\\RecordDriver\\SolrMarc' =>
array (
0 => 'TAMU\\RecordDriver\\IlsAwareDelegatorFactory',
),
),
),
),
),
);
10 changes: 1 addition & 9 deletions module/TAMU/src/TAMU/RecordDriver/DefaultRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,5 @@
*/
class DefaultRecord extends \VuFind\RecordDriver\DefaultRecord
{
/**
* Get an array of all the language notes associated with the record.
*
* @return array
*/
public function getLanguageNote()
{
return (array)($this->fields['language-notes'] ?? []);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace TAMU\RecordDriver;

class IlsAwareDelegatorFactory extends \VuFind\RecordDriver\IlsAwareDelegatorFactory
{
}

8 changes: 8 additions & 0 deletions module/TAMU/src/TAMU/RecordDriver/SolrDefaultFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace TAMU\RecordDriver;

class SolrDefaultFactory extends \VuFind\RecordDriver\SolrDefaultFactory
{
}

24 changes: 24 additions & 0 deletions module/TAMU/src/TAMU/RecordDriver/SolrMarc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace TAMU\RecordDriver;

class SolrMarc extends \VuFind\RecordDriver\SolrMarc
{
/**
* Get the uniform title from the 130a field
*/
public function getUniformTitle()
{
return $this->fields['uniform_title_str_mv'] ?? [];
}

/**
* Get an array of all the language notes associated with the record.
*
* @return array
*/
public function getLanguageNotes()
{
return (array)($this->fields['language-notes'] ?? []);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public function getDefaultCoreSpecs()
null,
['recordLink' => 'title']
);
$spec->setLine(
'Uniform Title',
'getUniformTitle'
);
$spec->setMultiLine(
'Authors',
'getDeduplicatedAuthors',
Expand All @@ -94,6 +98,13 @@ public function getDefaultCoreSpecs()
['itemPrefix' => '<span property="notesLanguage">',
'itemSuffix' => '</span>']
);
$spec->setLine(
'Language Notes',
'getLanguageNotes',
null,
['itemPrefix' => '<span property="notesLanguage">',
'itemSuffix' => '</span>']
);
$spec->setTemplateLine(
'Published',
'getPublicationDetails',
Expand Down
3 changes: 2 additions & 1 deletion themes/TAMU/theme.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
'favicon' => 'favicon.ico',
'helpers' => [
'factories' => [
'TAMU\View\Helper\Root\Record' => 'VuFind\View\Helper\Root\RecordFactory'
'TAMU\View\Helper\Root\Record' => 'VuFind\View\Helper\Root\RecordFactory',
'VuFind\View\Helper\Root\RecordDataFormatter' => 'TAMU\View\Helper\Root\RecordDataFormatterFactory',
],
'aliases' => [
'record' => 'TAMU\View\Helper\Root\Record'
Expand Down

0 comments on commit e52020b

Please sign in to comment.