-
Notifications
You must be signed in to change notification settings - Fork 1
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
Updating allinson flex features #231
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit will filter out metadata fields that are meant to be admin only from displaying in the UV. This is done by adding a reject if the Allinson Flex profile indicates that this field is `admin_only`.
Allinson Flex profiles don't have an option other than indicating which fields to be facetable. This commit will make QA work for Allinson Flex by assuming the field names "rights_statement" and "license" will be QA fields.
This configuration allows you to sort the metadata within an application that uses Allinson Flex. In a non-Allinson Flex application, you would use the IiifPrint.config.metadata_fields to sort the metadata. However, in Allinson Flex, the fields come in according to the m3 profile. This configuration allows you to use an Array of Symbols to sort the metadata in an intentional way. Some profiles have fields with the same name repeated. This commit will remove repeated fields though this functionality just takes the first field and ignores the rest. This isn't very controlled at the moment but works for Essi's situation. Ex. Imagine if you had fields of: [ #<AllinsonFlex::ProfileProperty id: nil, name: "title", indexing: ["stored_searchable"]>, #<AllinsonFlex::ProfileProperty id: nil, name: "title", indexing: ["stored_searchable"]> ] The first object would yield Title: My Sweet Title and the second field would yield Photograph Information: My Sweet Title The second field would be ignored since the value is the same as the first field. This is how Essi displays their metadata so we will use this method until told otherwise.
For Essi to use the #manifest_metadata method, we need to ensure that the `model` is a SolrDocument. We will now make a check to see if the `model` is a SolrDocument, and if not, we will attempt to convert it to one.
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
jeremyf
reviewed
May 1, 2023
Prior to this we might still do conversion work on the model; which was not desirous.
This commit will add a method called #solr_document to the SolrDocument to return itself. This will be useful because in the IiifManifestPresenterBehavior we want to ensure that we pass the SolrDocument into IiifPrint#manifest_metadata_from.
This commit will remove any magic strings and move them to the configuration. This favors configuring questioning authority fields over a hard coded set of defaults. This commmit also, the #qa_field? call.
This commit gets rid of a lot of loops and consolidates it into fewer calls to hopefully improve performance.
kirkkwang
force-pushed
the
updating-allinson-flex-features
branch
from
May 2, 2023 02:11
671f602
to
fcca437
Compare
jeremyf
approved these changes
May 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Filter out admin_only fields
This commit will filter out metadata fields that are meant to be admin
only from displaying in the UV. This is done by adding a reject if the
Allinson Flex profile indicates that this field is
admin_only
.Make QA work for allinson_flex
Allinson Flex profiles don't have an option other than indicating which
fields to be facetable. This commit will make QA work for Allinson Flex
by assuming the field names "rights_statement" and "license" will be QA
fields.
Add a way to sort Allinson Flex metadata
This configuration allows you to sort the metadata within an application
that uses Allinson Flex. In a non-Allinson Flex application, you would
use the
IiifPrint.config.metadata_fields
to sort the metadata. However,in Allinson Flex, the fields come in according to the m3 profile. This
configuration allows you to use an Array of Symbols to sort the metadata
in an intentional way.
Some profiles have fields with the same name repeated. This commit will
remove repeated fields though this functionality just takes the first
field and ignores the rest. This isn't very controlled at the moment
but works for Essi's situation.
Ex. Imagine if you had fields of:
The first object would yield
Title: My Sweet Title
and the second field would yield
Photograph Information: My Sweet Title
The second field would be ignored since the value is the same as the
first field. This is how Essi displays their metadata so we will use
this method until told otherwise.
Ensure we're using a SolrDcoument
For Essi to use the #manifest_metadata method, we need to ensure that
the
model
is a SolrDocument. We will now make a check to see if themodel
is a SolrDocument, and if not, we will attempt to convert it toone.