app/models/bplmodels/mods_desc_metadata.rb
#include Hydra::Datastream::CommonModsIndexMethods
# MODS XML constants.
include Hydra::Datastream::CommonModsIndexMethods
MODS XML constants.
include Hydra :: Datastream :: CommonModsIndexMethods MODS XML constants .
def insert_subject_name(name=nil, type=nil, authority=nil, valueURI=nil, date=nil)
      subject_index = self.mods(0).subject.count
      if name.is_a?String
        self.mods(0).subject(subject_index).name(0).name_part_actual(0, name)
        self.mods(0).subject(subject_index).name(0).name_part_actual(1, date) unless date.blank?
        self.mods(0).subject(subject_index).name(0).name_part_actual(1).type = 'date' unless date.blank?
      elsif name.is_a?Array
        name.each_with_index do |name_part, index|
          self.mods(0).subject(subject_index).name(0).name_part_actual(index,
                                                                       Bplmodels::DatastreamInputFuncs.utf8Encode(name_part))
        end
      end
      unless authority.blank?
        self.mods(0).subject(subject_index).name(0).authority = authority
        self.mods(0).subject(subject_index).name(0).authority_uri = BplEnrich::Authorities.authority_uri(authority)
      end
      self.mods(0).subject(subject_index).name(0).value_uri = valueURI unless valueURI.blank?
      self.mods(0).subject(subject_index).name(0).type = type unless type.blank?
    end
def insert_subject_name ( name = nil , type = nil , authority = nil , valueURI = nil , date = nil ) subject_index = self . mods ( 0 ) . subject . count if name . is_a? String self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . name_part_actual ( 0 , name ) self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . name_part_actual ( 1 , date ) unless date . blank? self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . name_part_actual ( 1 ) . type = 'date' unless date . blank? elsif name . is_a? Array name . each_with_index do | name_part , index | self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . name_part_actual ( index , Bplmodels :: DatastreamInputFuncs . utf8Encode ( name_part ) ) end end unless authority . blank? self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . authority = authority self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . authority_uri = BplEnrich :: Authorities . authority_uri ( authority ) end self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . value_uri = valueURI unless valueURI . blank? self . mods ( 0 ) . subject ( subject_index ) . name ( 0 ) . type = type unless type . blank? end
include Hydra::Datastream::CommonModsIndexMethods
MODS XML constants.
include Hydra :: Datastream :: CommonModsIndexMethods MODS XML constants .
#Date
name
type
authority
valueURI
date