First read Development.md for SoftServ specific instructions.
This repo was created with the intention of being our main hydra head for while. The goal is to implement hydra 11 in a docker container while also scripting in things to generate our new hydra heads every time we have to make a new "head" or repository.
bin/rails generate hydra:install
has also been run. The following will walk you through setting up the new hydra head. Understand that there will be manual tasks that must be done outside of this before you know if everything worked properly.
Copy and rename this directory from git to your desktop. Name it hydra-#{projectname}
for consistancy.
This is an important step. In creating new hydra repos, we don't want to over-ride this current repo.
sudo rm -rf .git
.git
directory and delete it manually. Using the terminal change directory to wvu_setup directory. From this directory you will see a setup.rb file. Open this file and change the information for your specific repository.
#!/usr/bin/env ruby
. This ensures the the file will be run as a ruby file and an executable. cd wvu_setup
ruby setup.rb
There isn't any way to script all of this without lots of pre-planning and forcing hydra to adhear to a certain standard.
There are three really important models in the new hydra setups.
MAIN_MODEL which will later be named, the model name you setup in the setup scripts will have to setup with various properties mapped to dublic core, or another standard that has been setup in the hydra community. Check out the RDF Vocab and Standards.
Application helper has definitions for the keywords, meta-description, and application name. Some of this needs changed, do this by going to hydra/helpers/application_helper.rb
The catalog controller is a file that must be setup form specific to your hydra head and your data. The key thing to remember here, is that the catalog is searching solr, not fedora. The data that your going to get and index needs to be the solr params that were saved during the import. Your also going to have to correlate these items to the mappings in your model.
Example:
--- Catalog Controller ---
config.add_search_field('description') do |field|
description_field = Solrizer.solr_name("description", :stored_searchable)
field.solr_local_parameters = {
qf: description_field,
pf: description_field
}
end
--- Model ---
property :description, predicate: ::RDF::Vocab::DC.description, multiple: false do |index|
index.type :text
index.as :stored_searchable
end
This is a huge step in the hydra head process. In the github there is a project called mfcs-exports. These are created from MFCS as a way to import metadata and images for various reasons. The first step is to setup an export using JSON, some have XML exports, but lets try to make all of them JSON for our uses. The import script will then consist of a json parse and insert into database.
For import create a new directory called import and make the file import.rb. Use existing projects as an example, but understand each one is different based on the items exported from MFCS. GBE is the most recent.
To import files use the following commands
bash -c "clear && docker exec -it {container} sh"
to open up a session in the new container RAILS_ENV=development ruby import/import.rb
to run an import into the fedora and solr dev sectionsRAILS_ENV=development ruby import/explode_fcrepo_solr.rb
to clear the development databases ONLY DO IN DEVELOPMENT NEVER PROD This should be primarily used for testing import scripts. If you get an error it might be with the database make sure you change it in your config file to what your database is named thats in your compose file. Alternatively it could be in your configuration files of the docker-compose file, or in the hydra/configs
docker exec -it {container} rake db:create
docker exec -it {container} rake db:migrate
You must have VPN access in development to access the fedora and solr storage, it will not load, import, or delete without being on the VPN or being a recongized server that has access to the databases.
For each project you will have to configure to the type of data your viewing. You may also have to-rework this functionality when dealing with peformance and visual aspects.
For each project a custom background banner needs to be made, also including any custom items that the project is deemed to need.
Documentation for setting up OAI-PMH stuff.
include BlacklightOaiProvider::CatalogControllerBehavior
configure_blacklight block
## OAIPMH
config.oai = {
provider: {
repository_name: 'George Bird Evans Collection',
repository_url: 'https://gbe.lib.wvu.edu',
record_prefix: 'https://gbe.lib.wvu.edu/catalog/',
admin_email: 'djdavis@mail.wvu.edu'
},
document: {
limit: 25
}
}
solr_document.rb
include BlacklightOaiProvider::SolrDocumentBehavior
use_extension Blacklight::Document::DublinCore
field_semantics.merge!(
alternative: 'collection_name_tesim',
source: 'collection_number_tesim',
identifier: 'identifier_tesim',
title: 'title_tesim',
creator: 'creator_tesim',
date: 'date_tesim',
subject: 'subject_tesim',
coverage: 'geography_tesim',
accrualMethod: 'acquisition_method_tesim',
dateAccepted: 'date_acquired_tesim',
description: 'description_tesim'
)
concern :oai_provider, BlacklightOaiProvider::Routes::Provider.new
at the top of the routes.rb file, and concerns :oai_provider
inside of the resource for the catalog.