Skip to content

An ArchivesSpace plugin that supports uploading external documents to be stored in OnBase. Developed for Dartmouth College.

Notifications You must be signed in to change notification settings

hudmol/aspace_onbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aspace_onbase

An ArchivesSpace plugin that supports uploading external documents to be stored in OnBase. Developed for Dartmouth College.

Installing it

To install, just activate the plugin in your config/config.rb file by including an entry such as:

 # If you have other plugins loaded, just add 'container_management' to
 # the list
 AppConfig[:plugins] = ['local', 'other_plugins', 'aspace_onbase']

And then clone the aspace_onbase repository into your ArchivesSpace plugins directory. For example:

 cd /path/to/your/archivesspace/plugins
 git clone https://github.com/hudmol/aspace_onbase.git aspace_onbase

Database Migration

This plugin comes with some database schema changes that need to be applied. To run the migration:

  1. Run the database setup script to update all tables to the latest version:

     cd /path/to/archivesspace
     scripts/setup-database.sh
    

Configuration

This plugin requires the following configuration:

 AppConfig[:onbase_robi_url] = "http://url.of.your.robi.service/api/documents"
 AppConfig[:onbase_robi_username] = "username"
 AppConfig[:onbase_robi_password] = "password"

 # Upload keywords to Onbase every 10 seconds
 AppConfig[:onbase_keyword_job_interval_seconds] = 10

 # Find and remove ArchivesSpace Onbase documents that were never
 # linked to an ArchivesSpace record (once a minute).
 AppConfig[:onbase_delete_unlinked_documents_cron] = "* * * * *"

 # When deleting an unlinked document, only consider deleting
 # records that have been unlinked more than this many seconds.
 #
 # Note: newly created Onbase documents (that have never been
 # linked to anything) are never deleted automatically.
 AppConfig[:unlinked_onbase_document_ttl_seconds = 86400

 # Find and removed Onbase documents (in ArchivesSpace) that don't
 # exist in OnBase anymore
 #
 # This can take a while, so just run once a day (1:05am)
 AppConfig[:onbase_delete_obsolete_documents_cron] = "5 1 * * *"

Document Types and Keywords

The file lib/document_keyword_definitions.rb describes the Document Types available to records and their mappings to the keywords to be generated by the system or required for user input.

For example:

 "SPCL-Preservation Photos" => {
   :supported_records => [:event],
   :fields => [
     {:type => "text", :keyword => :conservation_number},
     {:type => "generated", :generator => :event_system_id},
     {:type => "generated", :generator => :linked_record_system_id},
     {:type => "generated", :generator => :record_identifier},
   ]
 },

This entry defines the "SPCL-Preservation Photos" document type which is only available to event records. The document type requires one user defined keyword "conservation_number" and three system generated keywords "event_system_id", "linked_record_system_id" and "record_identifier".

System generated keywords are generated upon save of the record containing the onbase document. Each :generator entry has a corresponding definition in backend/model/document_keywords_generator.rb that defines the logic for producing the keywords. For example, :event_system_id maps to logic to extract the event's database ID with a label "Event ID":

 GENERATORS = {
     :event_system_id => proc {|record| Keyword.new(:event_id_keyword, DocumentKeywordsGenerator.just_id(record['uri']))},
     ...

Once generated, these Keyword objects are then serialized to JSON and formatted to match the keyword structure required by the ROBI service.

Mapping keyword codes to Onbase keywords

As discussed, keywords are produced via two means:

  • By "generated" field definitions. The generator code is invoked, and produces a Keyword instance to be sent to OnBase.

  • By "text" field definitions. These correspond to text input boxes that are filled in manually by users. These get sent through directly to OnBase as keywords.

In both cases, we end up with a symbol representing a keyword that should be mapped to a string from the OnBase controlled vocabulary. These mappings are located in the keywords.yml file at the top of the plugin distribution. If new keywords are added to OnBase they'll need to be added to this file too.

About

An ArchivesSpace plugin that supports uploading external documents to be stored in OnBase. Developed for Dartmouth College.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •