Class: SfxDb::AzTitle

Inherits:
SfxDbBase
  • Object
show all
Defined in:
app/models/sfx_db/az_title.rb

Instance Method Summary collapse

Methods inherited from SfxDbBase

fetch_sfx_urls, #readonly?

Instance Method Details

#to_context_objectObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/models/sfx_db/az_title.rb', line 18

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.('jtitle', self.TITLE_DISPLAY)
  co.referent.('object_id', self.OBJECT_ID.to_s)

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