Module: Sufia::Arkivo

Defined in:
lib/sufia/arkivo.rb,
lib/sufia/arkivo/actor.rb,
lib/sufia/arkivo/config.rb,
lib/sufia/arkivo/metadata_munger.rb,
lib/sufia/arkivo/schema_validator.rb,
lib/sufia/arkivo/create_subscription_job.rb

Defined Under Namespace

Classes: Actor, CreateSubscriptionJob, InvalidItem, MetadataMunger, SchemaValidator, SubscriptionError

Constant Summary collapse

VERSION =
Sufia::VERSION
CREATOR_TYPES =
['author', 'interviewer', 'director', 'scriptwriter',
 'inventor', 'composer', 'cartographer', 'programmer', 'artist',
 'bookAuthor'
].freeze
CONTRIBUTOR_TYPES =
['contributor', 'editor', 'translator', 'seriesEditor',
 'interviewee', 'producer', 'castMember', 'sponsor', 'counsel',
 'attorneyAgent', 'recipient', 'performer', 'wordsBy', 'commenter',
 'presenter', 'guest', 'podcaster', 'reviewedAuthor', 'cosponsor'
].freeze
ITEM_SCHEMA =
{
  type: 'object',
  properties: {
    token: { type: 'string', required: true },
    metadata: {
      type: 'object',
      required: true,
      properties: {
        title: { type: 'string', required: true },
        rights: { type: 'string', required: true },
        resourceType: { type: 'string' },
        description: { type: 'string' },
        publisher: { type: 'string' },
        dateCreated: { type: 'string' },
        basedNear: { type: 'string' },
        identifier: { type: 'string' },
        url: { type: 'string' },
        language: { type: 'string' }
      }
    },
    file: {
      type: 'object',
      required: true,
      properties: {
        base64: { type: 'string', required: true },
        md5: { type: 'string', required: true },
        filename: { type: 'string', required: true },
        contentType: { type: 'string', required: true }
      }
    }
  }
}.freeze

Class Method Summary collapse

Class Method Details

.configObject



3
4
5
# File 'lib/sufia/arkivo/config.rb', line 3

def self.config
  @config ||= YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'arkivo.yml'))).result).with_indifferent_access[Rails.env]
end

.new_subscription_urlObject



7
8
9
# File 'lib/sufia/arkivo/config.rb', line 7

def self.new_subscription_url
  '/api/subscription'
end