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

LIBHYDRA-573. Remove Archelon vocabulary management functionality #397

Merged
merged 19 commits into from
Apr 10, 2024

Conversation

dsteelma-umd
Copy link
Contributor

Removed the following Rails models related to the Archelon vocabulary management functionality, as well as associated controllers, tests, views, routes, and other configuration:

  • Vocabulary
  • Type
  • Datatype
  • Individual

The Archelon functionality needed to retrieve a vocabulary from the vocabulary server, and various parsing and display functions were added in the following new classes:

  • VocabularyService - Used to retrieve a vocabulary from the vocabulary server. Also includes functions to convert VocabularyTerm arrays into an “options” hash suitable for display in HTML “select” drop-down lists
  • Vocabulary - An immutable data class encapsulating a single Vocabulary
  • VocabularyTerm - An immutable data class encapsulating a single term within a vocabulary

To simplify the client code, the classes are designed using “null object” pattern, in that the VocabularyService will always return a valid Vocabulary object, even when a vocabulary does not exist, or a network error occurs – it will simply be a vocabulary with an empty list of VocabularyTerms. A “terms?” method has been added to verify whether or not a Vocabulary object actually has terms.

The VocabularyTerm object currently only allows a single “same_as” value to be associated with a vocabulary term. Based on discussions with Peter Eichman, while LIBHYDRA-390 suggests that multiple “same_as” values for a single vocabulary term may eventually be supported, it was not necessary to add that functionality at this time.

A database migration to drop the “vocabulary”, “type”, “datatype”, and “individual” database tables is not included in this issue (see LIBHYDRA-574). This is to give us time to evaluate the Grove vocabulary management application, and the Archelon changes before permanently deleting the database tables in production.

Additional Cleanup

The following were also removed as part of a general cleanup (they were typically no longer relevant even before this issue):

  • Removed "VOCAB_PUBLICATION_BASE_URI" environment variable
  • Deleted "public/published_vocabularies" directory

https://umd-dit.atlassian.net/browse/LIBHYDRA-573

Removed the "Vocabularies" link from the "Manage" drop-down menu
as the minimal "remove Vocabulary" change, and to prepare for removing
the Vocabulary functionality entirely.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Added a "Vocab" object that retrieves vocabulary information from
the vocabulary server.

Methods have been added to the "Vocab" object to make it a "drop-in"
replacement of the Vocabulary model in the non-Vocabulary code.

Refactored "VocabService" to support the "Vocab" object, pulling out the
"vocab_options_hash_by_identifier" method to retrieve an unfiltered
vocabulary based solely on the vocabulary identifier.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Refactored non-Vocabulary code that used the "Vocabulary" model with
calls to the "Vocab" object.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Removed the following models, and related controller, test, and other
related files:

* Vocabulary
* Type
* Individual
* Datatype

Removed related I18n settings from "en.yml"

Updated "app/models/import_job.rb" to properly call the "Vocab.find_by"
method.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
* Removed "VocabularyEditors" from CAS authentication and LDAP lookup
* Removed "VocabularyEditors" permission checking
* Removed additional I18n terms
* Removed development database seeding of Vocabulary/Datatype tables
* Removed unnecessary test fixtures
* Removed unnecessary CSS definitions
* Modified the "cas_authorization_test" to verify case-insensitive
  group name matches using the "Administrators" group
* Removed "vocab:import" Rake task documentation

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Removed "Vocab.all" method because there is no way to retrieve a list
of all the vocabularies from the vocabulary server. The "all" method
is only used on the "react_components" page, and so modified that page
with a list of sample vocabularies to display.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Moved "Vocab" class to be a nested class in "VocabService".

Moved class methods in "Vocab" into the "VocabService" class and updated
code.

Refactored code that used the "Vocab" class to use
"VocabService::Vocab".

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Removed routes from "routes.rb" for Vocabulary, Type, Individual, and
Datatype models and controllers that have been removed.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Simplified VocabService class and associated Vocab class, removing
unnecessary methods and simplifying the interface as much as possible.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Also renamed "VocabService.find_by" to "VocabService.get_vocabulary" and
simplified the interfaces as much as possible.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
The "Vocab*" classes (VocabService, Vocab, VocabTerm) were originally
named "Vocab" to distinguish them from the exsting "Vocabulary" model
class.

After discussions with Peter Eichman, now that the "Vocabulary" model
has been removed, would like the new classes to use "Vocabulary"
instead of "Vocab" to be more consistent with the class naming in Grove.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Replaced the "filtered_options" method in "VocabularyService" with
"filtered_terms" method, which is more generic, and potentially more
useful.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Added a "terms?" method that returns true only if a Vocabulary has
one or more terms.

Replaced instances of "vocab.nil?" in the codebase, (reversing the
logic) with "vocab.terms?", as the VocabularyService will always return
a non-nil Vocabulary object.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Removed the "VOCAB_PUBLICATION_BASE_URI" environment variable as it is
no longer used.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
The "public/published_vocabularies" directory is no longer needed,
and so has been removed.

Also removed the "public/published_vocabularies" configuration in
the ".gitignore" file, to highlight any files the user might have for
deletion.

Left the "public/published_vocabularies" configuration in the
".dockerignore" file for the moment, to ensure that any lingering
contents in that directory will never be added to a Docker image.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
Added documentation about the Vocabulary functionality in Archelon
and related configuration.

https://umd-dit.atlassian.net/browse/LIBHYDRA-573
@dsteelma-umd dsteelma-umd changed the title Feature/libhydra 573 LIBHYDRA-573. Remove Archelon vocabulary management functionality Apr 10, 2024
@dsteelma-umd dsteelma-umd force-pushed the feature/LIBHYDRA-573 branch from 77e9ca4 to b4ceb01 Compare April 10, 2024 12:00
@dsteelma-umd dsteelma-umd force-pushed the feature/LIBHYDRA-573 branch from b4ceb01 to 7d52cbf Compare April 10, 2024 12:04
@peichman-umd peichman-umd merged commit c7e9403 into umd-lib:develop Apr 10, 2024
1 check passed
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.

None yet

2 participants