Sha256: b0f8f27caf48942df120998f6fc9c780070ae84f6e7054ea97fda5856c898be0

Contents?: true

Size: 1.13 KB

Versions: 30

Compression:

Stored size: 1.13 KB

Contents

module SfxDb
  class AzTitle < SfxDbBase
    self.table_name = 'AZ_TITLE_VER3'
    self.primary_key = 'AZ_TITLE_VER3_ID'

    belongs_to :object,
               :foreign_key => 'OBJECT_ID',
               :class_name => "SfxDb::Object"

    has_many  :az_additional_titles,
               :foreign_key => 'AZ_TITLE_VER3_ID'
    has_many  :az_letter_groups,
               :foreign_key => 'AZ_TITLE_VER3_ID'


    def to_context_object
      #require 'openurl'
      co = OpenURL::ContextObject.new
      # Make sure it uses a journal type referent please, that's what we've
      # got here.
      co.referent = OpenURL::ContextObjectEntity.new_from_format( 'info:ofi/fmt:xml:xsd:journal' )
      
      
      co.referent.set_metadata('jtitle', self.TITLE_DISPLAY)
      co.referent.set_metadata('object_id', self.OBJECT_ID.to_s)

      # Add publisher stuff, if possible.
      pub = self.object ? self.object.publishers.first : nil
      if ( pub )
        co.referent.set_metadata('pub', pub.PUBLISHER_DISPLAY )
        co.referent.set_metadata('place', pub.PLACE_OF_PUBLICATION_DISPLAY)
      end      
      
      return co
    end
    
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
umlaut-3.0.3 app/models/sfx_db/az_title.rb
umlaut-3.0.2 app/models/sfx_db/az_title.rb
umlaut-3.0.1 app/models/sfx_db/az_title.rb
umlaut-3.0.0 app/models/sfx_db/az_title.rb
umlaut-3.0.0rc1 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta10 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta9 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta8 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta7 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta6 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta5 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta4 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta3 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta2 app/models/sfx_db/az_title.rb
umlaut-3.0.0beta1 app/models/sfx_db/az_title.rb
umlaut-3.0.0alpha15 app/models/sfx_db/az_title.rb
umlaut-3.0.0alpha14 app/models/sfx_db/az_title.rb
umlaut-3.0.0alpha13 app/models/sfx_db/az_title.rb
umlaut-3.0.0alpha12 app/models/sfx_db/az_title.rb
umlaut-3.0.0alpha11 app/models/sfx_db/az_title.rb