Module: Hyrax::Arkivo

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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
Hyrax::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 },
        license: { 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/hyrax/arkivo/config.rb', line 3

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

.new_subscription_urlObject



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

def self.new_subscription_url
  '/api/subscription'
end