Creating a Digital Collection - OregonDigital/oregondigital GitHub Wiki

How to Create a New Collection in Oregon Digital

Start with the console (rails c):

[1] pry(main)> col = GenericCollection.new(:pid => "oregondigital:braceros")                         
=> #<GenericCollection:0x3d2eae4>
[2] pry(main)> col.title = "Braceros in Oregon Photography"                                          
=> "Braceros in Oregon Photography"
[3] pry(main)> col.save!
=> true

Now add an institutional affiliation to the collection. Use the URIs:

These are from DBpedia (see: OregonDigital::ControlledVocabularies::Organization).

[4] pry(main)> uo = OregonDigital::ControlledVocabularies::Organization.new("http://dbpedia.org/resource/University_of_Oregon")
=> #<OregonDigital::ControlledVocabularies::Organization:0x7135d2e(default)>
[5] pry(main)> col.institution = uo
=> #<OregonDigital::ControlledVocabularies::Organization:0x7135d2e(default)>
[6] pry(main)> col.save!
=> true

Once the Digital Collection is ready to be public, ideally with some items and Set Page(s) in place, review:

[7] pry(main)> col.review!
=> true

It should now be live on the Digital Collections A-Z List.

Custom Set Pages

Custom set pages are stored in a separate Git repository at https://github.com/OregonDigital/oregon-digital-set-content

These files are pulled into the Hydra repository via a command-line rake task: rake sets:content:sync that clones the set content repo and creates symlinks under /app/views/sets for each of the folders. To test a specific branch of the oregon-digital-set-content repository, you can set an environment variable, "BRANCH": rake sets:content:sync BRANCH=feature/new-set-content.

The folder name should match the collection PID (minus 'oregondigital:').

Facets are automatically displayed on all pages.

Images, Javascript and stylesheets are stored in type-specific folders under /assets:

  • assets/images
  • assets/javascripts
  • assets/stylesheets

Rails view pages and partials are stored under /content. index.html.erb will render at /sets/[set_name] Other pages, such as Related: related.html.erb will render at /sets/page/related

Multiple pages under one set can be created, but do not show up in any menu unless directly added. A list of links to available pages can be stored in the partial: _additional_links.html.erb If this file exists for a given set it will be automatically displayed. External links can also be included here.