Sha256: 49c04675f2873f0f5f3604ed5e9f4caf893261465ddff1a7c0219188d62d9b8f

Contents?: true

Size: 796 Bytes

Versions: 41

Compression:

Stored size: 796 Bytes

Contents

require 'solrizer/field_name_mapper'

#this class represents a MetadataDatastream, a special case of ActiveFedora::Datastream
module ActiveFedora::MetadataDatastreamHelper 
  
  attr_accessor :fields, :xml_loaded
  
  module ClassMethods
    
    #get the Class's field list
    def fields
      @@classFields
    end
    
  end
  
  def self.included(klass)
    klass.extend(ClassMethods)
    klass.send(:include, Solrizer::FieldNameMapper)
  end

  def ensure_xml_loaded
    return if xml_loaded 
    self.xml_loaded = true
    if new?
      ## Load up the template
      self.class.from_xml nil, self
    else
      self.class.from_xml content, self
    end
  end
  
  def serialize! # :nodoc:
    if dirty?
      return unless xml_loaded 
      self.content = self.to_xml 
    end
  end

end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
active-fedora-5.0.0.rc3 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.0.0.rc2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.0.0.rc1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.6.0.rc4 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.6.0.rc3 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.6.0.rc2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.6.0.rc1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.5.3 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.5.2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.5.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.5.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.4.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.4.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.3.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.2.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.1.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.0.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.0.0.rc20 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.0.0.rc19 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-4.0.0.rc18 lib/active_fedora/metadata_datastream_helper.rb