Skip to content

Hyrax Walkthrough

Mark Bussey edited this page Oct 21, 2019 · 1 revision

Goals:

  • Understand the way an item in Hyrax
    • is displayed in the User Interface,
    • is represented in the application Code
    • is stored in Fedora
    • is indexed in Solr

Steps

  1. Inspect an empty repository You rarely see this in the real world...

  2. Set up a user and create a work using the User Interface

    • Go to http://localhost:3000, click on the Login link in the upper right-hand corner
    • If you haven't created a user yet, click the Sign up link just below the login button
    • Enter your chosen e-mail and password
    • From your Dashboard, click on the Works link in the left-hand navigation bar
    • Click on the Add new work button to add a new item to the repository Notice the Requirements section in the SAVE WORK panel
    • Fill out the fields marked with blue required labels Notice the Requirements section in the SAVE WORK panel
    • Click on the Files tab
    • Click on the + Add Files button and select a file to upload Notice the Requirements section in the SAVE WORK panel
    • Click the checkbox for the deposit agreement and click the SAVE button
    • Wait a second and take a look at your new Work!
  3. Now that you have something in your repository, let's take a look at it

    • User Interface: go to http://localhost:3000, click on the search icon you should see your new item listed in the results along with a facet list to the left
    • Code: from the Rails console, check Image.count, then Collection.count again you now have 1 work and no collections
    • Fedora: go to http://localhost:8984/rest/dev note the number of new children in this container - can you figure out what any of them are?
    • Solr: go to http://localhost:8983/solr/#/ucla2019/core-overview check whether the document counts under "Statistics" has changed
  4. Find a work by its identifier Do a search from the user interface and click on your work, you can read the id from the work's URL

    • User Interface: go to http://localhost:3000/concern/images/IDENTIFIER
    • Code: i = Image.find(id)
    • Fedora: First find the work using the Rails console, then get a link to it using i.uri HINT Because we are using a docker-compose file, the console is giving us the within-container uri. In order to access it on your browser, you will need to change the beginning of the uri to http://localhost:8984/rest/dev...
    • Solr: go to http://localhost:8983/solr/#/ucla2019/query enter id:your_work_id_here in the q field and click the "Execute Query" button

Exercises

  1. Add an optional field using the User Interface

    • Verify the change in the Code. HINT use the ID in the url and use it to find the item using the console. You might need to use the .reload method on your work to refresh attributes in memory.
    • Verify the change in Fedora.
    • Verify the change in Solr.
  2. What other fields are available? Does what you see in the User Interface match the code at hyrax/basic_metadata.rb? Also see: https://github.com/no-reply/sufia-profile/blob/master/profile.md

  3. What happens when you add multiple entries for a field?

  4. What happens when you remove all the entries for a field?

  5. Add a second description using the console. HINT you'll need to use the .save method to make changes in memory persist to Solr and Fedora.

    • Verify the change in the User Interface.
    • Verify the change in Fedora.
    • Verify the change in Solr.
  6. Find the access controls in Fedora

    • Change the access control (visibility) using the User Interface
    • What changes in Fedora
  7. Create an empty Collection using the User Interface

    • Verify that Collection.count has changed in the rails console
    • What does the collection look like in Code?
    • What does the collection look like in Fedora?
    • What does the collection look like in Solr?
  8. Add a new Work to your collection using the User Interface

    • What does the Work look like in CODE
    • What does the collection look like now in Code?
    • What does the collection look like now in Fedora?
    • What does the collection look like now in Solr?
    • What does the Work look like in Solr? HINT If the file does not initially attach, check the url and the position of ?locale=en and remove and refresh if necessary.
  9. Attach an image to a Work using the UI. Then look at FileSets (#file_sets) and Files (#files) in the Rails console (NOTE: the #files method may be called on a FileSet instance)