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

Improved RIS export #3954

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open

Conversation

damien-git
Copy link
Contributor

This PR adds additional tags to the RIS export. A number of them are based on new SolrMarc functions, so they are specific to this driver.

New tags:

  • ST (short title)
  • L4 (page URL as an attachment)
  • AB (abstract)
  • AV (notes)
  • CN (call number)
  • J2 (alternate title)

Updated tags:

  • KW (keywords - from the topics/subjects; getTopics was not implemented before)
  • DO (DOI identifier, removing markup from EDS)

There might be ways to improve the way this implementation works with other drivers...

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @damien-git -- this looks like a significant improvement. I have a few suggested adjustments/improvements; see below.

module/VuFind/src/VuFind/RecordDriver/SolrMarc.php Outdated Show resolved Hide resolved
*
* @param string $field Marc field to search within
* @param array $subfield Sub-fields to return or empty for all
* @param string $indNum The Marc indicator to filter for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you replaced the $indNum and $indValue parameters with a single array of indicator filters, and then any rows that match a filter will be allowed through? This way, instead of doing array merging in some of the functions below, you could request everything at once -- e.g.

        return array_merge(
            $this->getMarcFieldWithInd('520', null, '1', ''),
            $this->getMarcFieldWithInd('520', null, '1', '0'),
            $this->getMarcFieldWithInd('520', null, '1', '2'),
            $this->getMarcFieldWithInd('520', null, '1', '3'),
            $this->getMarcFieldWithInd('520', null, '1', '8'),
        );

becomes:

        return $this->getMarcFieldWithInd('520', null, [['1' => ''], ['1' => '0'], ['1' => '2'], ['1' => '3'], ['1' => '8']]);

Of course, there are other ways you could slice this... I'm just thinking the "array of arrays" approach might be more flexible since it would allow you to specify patterns that match two indicators at once if that need should arise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could set things up so the array could include an array of values, meaning "any of these" and that would reduce it down to:

return $this->getMarcFieldWithInd('520', null, [['1' => ['', '0', '2', '3', '8']]]);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion! I did that refactoring and added some unit tests to get SolrMarc.php back to 100% coverage.

module/VuFind/src/VuFind/RecordDriver/SolrMarc.php Outdated Show resolved Hide resolved
module/VuFind/src/VuFind/RecordDriver/SolrMarc.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants