Method: Libis::Tools::MetsFile#amd_info=

Defined in:
lib/libis/tools/mets_file.rb

#amd_info=(hash) ⇒ Object

Sets the attributes for the global amd section.

sections automatically.

The following names are currently supported:
* status
* entity_type
* user_a
* user_b
* user_c
* submission_reason
* retention_id - RentionPolicy ID
* harvest_url
* harvest_id
* harvest_target
* harvest_group
* harvest_date
* harvest_time
* collection_id - Collection ID where the IE should be added to
* access_right - AccessRight ID
*  - Array with hashes like {type: 'MyXML', data: '<xml ....>'}

Parameters:

  • hash (Hash)

    name, value pairs for the DNX sections. Each will go into it’s appropriate AMD and DNX



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/libis/tools/mets_file.rb', line 197

def amd_info=(hash)
  tech_data = []
  data = {
      groupID: hash[:group_id]
  }.cleanup
  tech_data << ObjectCharacteristics.new(data) unless data.empty?
  data = {
      status: hash[:status],
      IEEntityType: hash[:entity_type],
      UserDefinedA: hash[:user_a],
      UserDefinedB: hash[:user_b],
      UserDefinedC: hash[:user_c],
      submissionReason: hash[:submission_reason],
  }.cleanup
  tech_data << GeneralIECharacteristics.new(data) unless data.empty?
  data = {
      policyId: hash[:retention_id],
  }.cleanup
  tech_data << RetentionPolicy.new(data) unless data.empty?
  data = {
      primarySeedURL: hash[:harvest_url],
      WCTIdentifier: hash[:harvest_id],
      targetName: hash[:harvest_target],
      group: hash[:harvest_group],
      harvestDate: hash[:harvest_date],
      harvestTime: hash[:harvest_time],
  }.cleanup
  tech_data << WebHarvesting.new(data) unless data.empty?
  data = {
      collectionId: hash[:collection_id]
  }.cleanup
  tech_data << Collection.new(data) unless data.empty?
  @dnx[:tech] = tech_data unless tech_data.empty?
  data = {
      policyId: hash[:access_right]
  }.cleanup
  rights_data = []
  rights_data << AccessRightsPolicy.new(data) unless data.empty?
  @dnx[:rights] = rights_data unless rights_data.empty?
  (hash[:source_metadata] || []).each_with_index do |, i|
    @dnx["source-#{metadata[:type].to_s.upcase}-#{i+1}"] = [:data]
  end
end