Module: Ddr::Models::HasStructMetadata

Extended by:
ActiveSupport::Concern
Included in:
Component, Item
Defined in:
lib/ddr/models/has_struct_metadata.rb

Instance Method Summary collapse

Instance Method Details

#build_default_structureObject



20
21
22
23
24
25
26
27
# File 'lib/ddr/models/has_struct_metadata.rb', line 20

def build_default_structure
  structure = Ddr::Models::Structure.new(Ddr::Models::Structure.template)
  children = find_children
  children.each do |child|
    add_to_struct_map(structure, child)
  end
  structure
end

#multires_image_file_paths(type = 'default') ⇒ Object



29
30
31
# File 'lib/ddr/models/has_struct_metadata.rb', line 29

def multires_image_file_paths(type='default')
  ::SolrDocument.find(id).multires_image_file_paths(type)
end

#structureObject



11
12
13
14
15
16
17
18
# File 'lib/ddr/models/has_struct_metadata.rb', line 11

def structure
  unless @structure
    if attached_files[Ddr::Models::File::STRUCT_METADATA].content
      @structure = Ddr::Models::Structure.new(Nokogiri::XML(attached_files[Ddr::Models::File::STRUCT_METADATA].content))
    end
  end
  @structure
end