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.0alpha12 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha11 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha10 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha9 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha8 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha7 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha6 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha5 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha4 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha3 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha2 app/models/sfx_db/az_title_v2.rb
umlaut-3.0.0alpha1 app/models/sfx_db/az_title_v2.rb