Class: Libis::Tools::MetsFile::Representation
- Includes:
- MetsObject
- Defined in:
- lib/libis/tools/mets_objects.rb
Overview
Container class for creating a representation in the METS.
Instance Attribute Summary collapse
-
#access_right_id ⇒ Object
The currently allowed attributes on this class.
-
#carrier ⇒ Object
The currently allowed attributes on this class.
-
#content ⇒ Object
The currently allowed attributes on this class.
-
#context ⇒ Object
The currently allowed attributes on this class.
-
#dc_record ⇒ Object
The currently allowed attributes on this class.
-
#digital_original ⇒ Object
The currently allowed attributes on this class.
-
#entity_type ⇒ Object
The currently allowed attributes on this class.
-
#env_dependencies ⇒ Object
The currently allowed attributes on this class.
-
#environments ⇒ Object
The currently allowed attributes on this class.
-
#group_id ⇒ Object
The currently allowed attributes on this class.
-
#hardware ⇒ Object
The currently allowed attributes on this class.
-
#hardware_ids ⇒ Object
The currently allowed attributes on this class.
-
#hardware_infos ⇒ Object
The currently allowed attributes on this class.
-
#label ⇒ Object
The currently allowed attributes on this class.
-
#order ⇒ Object
The currently allowed attributes on this class.
-
#original_name ⇒ Object
The currently allowed attributes on this class.
-
#preservation_levels ⇒ Object
The currently allowed attributes on this class.
-
#preservation_type ⇒ Object
The currently allowed attributes on this class.
-
#priority ⇒ Object
The currently allowed attributes on this class.
-
#relationship_infos ⇒ Object
The currently allowed attributes on this class.
-
#representation_code ⇒ Object
The currently allowed attributes on this class.
-
#software_ids ⇒ Object
The currently allowed attributes on this class.
-
#software_infos ⇒ Object
The currently allowed attributes on this class.
-
#source_metadata ⇒ Object
The currently allowed attributes on this class.
-
#usage_type ⇒ Object
The currently allowed attributes on this class.
-
#user_a ⇒ Object
The currently allowed attributes on this class.
-
#user_b ⇒ Object
The currently allowed attributes on this class.
-
#user_c ⇒ Object
The currently allowed attributes on this class.
Instance Method Summary collapse
-
#amd ⇒ Object
This method creates the appropriate DnxSections based on what attributes are filled in.
-
#xml_id ⇒ Object
The id that will be used in the XML file to reference this representation.
Methods included from MetsObject
#id, #initialize, #set_from_hash, #set_id, #to_s
Instance Attribute Details
#access_right_id ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def access_right_id @access_right_id end |
#carrier ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def carrier @carrier end |
#content ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def content @content end |
#context ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def context @context end |
#dc_record ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def dc_record @dc_record end |
#digital_original ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def digital_original @digital_original end |
#entity_type ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def entity_type @entity_type end |
#env_dependencies ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def env_dependencies @env_dependencies end |
#environments ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def environments @environments end |
#group_id ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def group_id @group_id end |
#hardware ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def hardware @hardware end |
#hardware_ids ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def hardware_ids @hardware_ids end |
#hardware_infos ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def hardware_infos @hardware_infos end |
#label ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def label @label end |
#order ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def order @order end |
#original_name ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def original_name @original_name end |
#preservation_levels ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def preservation_levels @preservation_levels end |
#preservation_type ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def preservation_type @preservation_type end |
#priority ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def priority @priority end |
#relationship_infos ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def relationship_infos @relationship_infos end |
#representation_code ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def representation_code @representation_code end |
#software_ids ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def software_ids @software_ids end |
#software_infos ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def software_infos @software_infos end |
#source_metadata ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def @source_metadata end |
#usage_type ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def usage_type @usage_type end |
#user_a ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def user_a @user_a end |
#user_b ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def user_b @user_b end |
#user_c ⇒ Object
The currently allowed attributes on this class. The attributes will typically be used in DnxSections.
350 351 352 |
# File 'lib/libis/tools/mets_objects.rb', line 350 def user_c @user_c end |
Instance Method Details
#amd ⇒ Object
This method creates the appropriate DnxSections based on what attributes are filled in.
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
# File 'lib/libis/tools/mets_objects.rb', line 364 def amd dnx = {} tech_data = [] # General characteristics data = { preservationType: preservation_type, usageType: usage_type, DigitalOriginal: digital_original, label: label, representationEntityType: entity_type, contentType: content, contextType: context, hardwareUsed: hardware, physicalCarrierMedia: carrier, deliveryPriority: priority, orderingSequence: order, RepresentationCode: representation_code, RepresentationOriginalName: original_name, UserDefinedA: user_a, UserDefinedB: user_b, UserDefinedC: user_c, }.cleanup tech_data << GeneralRepCharacteristics.new(data) unless data.empty? # Object characteristics data = { groupID: group_id }.cleanup tech_data << ObjectCharacteristics.new(data) unless data.empty? # Preservation level if preservation_levels data_list = [] preservation_levels.each do |preservation_level| data = { preservationLevelValue: preservation_level[:value], preservationLevelRole: preservation_level[:role], preservationLevelRationale: preservation_level[:rationale], preservationLevelDateAssigned: preservation_level[:date], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << PreservationLevel.new(array: data_list) unless data_list.empty? end # Dependencies if env_dependencies data_list = [] env_dependencies.each do |dependency| data = { dependencyName: dependency[:name], dependencyIdentifierType1: dependency[:type1], dependencyIdentifierValue1: dependency[:value1], dependencyIdentifierType2: dependency[:type2], dependencyIdentifierValue2: dependency[:value2], dependencyIdentifierType3: dependency[:type3], dependencyIdentifierValue3: dependency[:value3], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << EnvironmentDependencies.new(array: data_list) unless data_list.empty? end # Hardware registry id if hardware_ids data_list = [] hardware_ids.each do |id| data = { registryId: id }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << EnvHardwareRegistry.new(array: data_list) unless data_list.empty? end # Software registry id if software_ids data_list = [] software_ids.each do |id| data = { registryId: id }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << EnvSoftwareRegistry.new(array: data_list) unless data_list.empty? end # Hardware if hardware_infos data_list = [] hardware_infos.each do |hardware| data = { hardwareName: hardware[:name], hardwareType: hardware[:type], hardwareOtherInformation: hardware[:info], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << EnvironmentHardware.new(array: data_list) unless data_list.empty? end # Software if software_infos data_list = [] software_infos.each do |software| data = { softwareName: software[:name], softwareVersion: software[:version], softwareType: software[:type], softwareOtherInformation: software[:info], softwareDependancy: software[:dependency], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << EnvironmentSoftware.new(array: data_list) unless data_list.empty? end # Relationship if relationship_infos data_list = [] relationship_infos.each do |relationship| data = { relationshipType: relationship[:type], relationshipSubType: relationship[:subtype], relatedObjectIdentifierType1: relationship[:type1], relatedObjectIdentifierValue1: relationship[:id1], relatedObjectSequence1: relationship[:seq1], relatedObjectIdentifierType2: relationship[:type2], relatedObjectIdentifierValue2: relationship[:id2], relatedObjectSequence2: relationship[:seq2], relatedObjectIdentifierType3: relationship[:type3], relatedObjectIdentifierValue3: relationship[:id3], relatedObjectSequence3: relationship[:seq3], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << RelationShip.new(array: data_list) unless data_list.empty? end # Environment if environments data_list = [] environments.each do |environment| data = { environmentCharacteristic: environment[:characteristic], environmentPurpose: environment[:purpose], environmentNote: environment[:note], }.cleanup data_list << OpenStruct.new(data) unless data.empty? end tech_data << Environment.new(array: data_list) unless data_list.empty? end # Finally assemble technical section dnx[:tech] = tech_data unless tech_data.empty? # Rights section rights_data = [] data = { policyId: access_right_id }.cleanup rights_data << AccessRightsPolicy.new(data) unless data.empty? dnx[:rights] = rights_data unless rights_data.empty? # Source metadata if .each_with_index do |, i| dnx["source-#{[:type].to_s.upcase}-#{i}"] = [:data] end end dnx end |
#xml_id ⇒ Object
The id that will be used in the XML file to reference this representation.
359 360 361 |
# File 'lib/libis/tools/mets_objects.rb', line 359 def xml_id "rep#{@id}" end |