Sha256: be1176bf0bbda0105cbabd8181fbb5ea6c7493d1d01a55b09dcecebfafc18759

Contents?: true

Size: 1.08 KB

Versions: 32

Compression:

Stored size: 1.08 KB

Contents

# The SFX A-Z "version 2" title table. 

module SfxDb
  class AzTitleV2 < SfxDbBase
    self.table_name = 'AZ_TITLE'
    self.primary_key = 'OBJECT_ID' # This is a lie, it's really a compound pk, but it works anyway for what we need. Rails doesn't do compound pks formally. 

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

               

    def to_context_object
      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.publishers.first
      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

32 entries across 32 versions & 1 rubygems

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