Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uniform title and language notes via TAMU module #18

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -93,7 +93,7 @@ public function getDefaultCoreSpecs()
);
$spec->setLine(
'Language Notes',
'getLanguageNote',
'getLanguageNotes',
null,
['itemPrefix' => '<span property="notesLanguage">',
'itemSuffix' => '</span>']
Expand Down
Loading