bplmodels 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +0 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/bplmodels/application.js +15 -0
- data/app/assets/stylesheets/bplmodels/application.css +13 -0
- data/app/controllers/bplmodels/application_controller.rb +4 -0
- data/app/helpers/bplmodels/application_helper.rb +4 -0
- data/app/models/bplmodels/audio_file.rb +14 -0
- data/app/models/bplmodels/book.rb +35 -0
- data/app/models/bplmodels/card.rb +35 -0
- data/app/models/bplmodels/characterization.rb +92 -0
- data/app/models/bplmodels/collection.rb +118 -0
- data/app/models/bplmodels/complex_object_base.rb +24 -0
- data/app/models/bplmodels/correspondence.rb +35 -0
- data/app/models/bplmodels/document.rb +35 -0
- data/app/models/bplmodels/document_file.rb +8 -0
- data/app/models/bplmodels/ephemera.rb +35 -0
- data/app/models/bplmodels/file.rb +151 -0
- data/app/models/bplmodels/file_content_datastream.rb +10 -0
- data/app/models/bplmodels/fits_datastream.rb +190 -0
- data/app/models/bplmodels/image.rb +14 -0
- data/app/models/bplmodels/image_file.rb +18 -0
- data/app/models/bplmodels/institution.rb +159 -0
- data/app/models/bplmodels/manuscript.rb +34 -0
- data/app/models/bplmodels/map.rb +34 -0
- data/app/models/bplmodels/mods_desc_metadata.rb +1826 -0
- data/app/models/bplmodels/musical_notation.rb +34 -0
- data/app/models/bplmodels/newspaper.rb +15 -0
- data/app/models/bplmodels/nom_terminology.rb +1242 -0
- data/app/models/bplmodels/non_photographic_print.rb +34 -0
- data/app/models/bplmodels/oai_collection.rb +19 -0
- data/app/models/bplmodels/oai_metadata.rb +75 -0
- data/app/models/bplmodels/oai_object.rb +45 -0
- data/app/models/bplmodels/object.rb +36 -0
- data/app/models/bplmodels/object_base.rb +1241 -0
- data/app/models/bplmodels/objects/collection.rb~ +28 -0
- data/app/models/bplmodels/objects/image.rb~ +59 -0
- data/app/models/bplmodels/objects/postcard.rb~ +56 -0
- data/app/models/bplmodels/organizational_set.rb +25 -0
- data/app/models/bplmodels/periodical.rb +37 -0
- data/app/models/bplmodels/photographic_print.rb +34 -0
- data/app/models/bplmodels/relation_base.rb +99 -0
- data/app/models/bplmodels/scrapbook.rb +35 -0
- data/app/models/bplmodels/simple_object_base.rb +27 -0
- data/app/models/bplmodels/sound_recording.rb +15 -0
- data/app/models/bplmodels/system_collection.rb +8 -0
- data/app/models/bplmodels/uploads_set.rb +3 -0
- data/app/models/bplmodels/workflow_metadata.rb +99 -0
- data/app/views/layouts/bplmodels/application.html.erb +14 -0
- data/config/application.rb +6 -0
- data/config/predicate_mappings.yml +61 -0
- data/config/routes.rb +2 -0
- data/lib/bplmodels.rb +21 -0
- data/lib/bplmodels/constants.rb +119 -0
- data/lib/bplmodels/datastream_input_funcs.rb +949 -0
- data/lib/bplmodels/engine.rb +5 -0
- data/lib/bplmodels/engine.rb~ +5 -0
- data/lib/bplmodels/finder.rb +192 -0
- data/lib/bplmodels/object_funcs.rb +10 -0
- data/lib/bplmodels/version.rb +3 -0
- data/lib/tasks/bplmodels_tasks.rake +4 -0
- data/test/bplmodels_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- metadata +234 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class Correspondence < Bplmodels::ComplexObjectBase
|
3
|
+
#has_file_datastream :name => 'productionMaster', :type => ActiveFedora::Datastream
|
4
|
+
|
5
|
+
|
6
|
+
#A collection can have another collection as a member, or an image
|
7
|
+
def insert_member(fedora_object)
|
8
|
+
if (fedora_object.instance_of?(Bplmodels::ImageFile))
|
9
|
+
|
10
|
+
#add to the members ds
|
11
|
+
members.insert_member(:member_id=>fedora_object.pid, :member_title=>fedora_object.titleSet_display, :member_type=>fedora_object.fedora_name)
|
12
|
+
|
13
|
+
#add to the rels-ext ds
|
14
|
+
fedora_object.object << self
|
15
|
+
self.image_files << fedora_object
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
fedora_object.save!
|
20
|
+
self.save!
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def fedora_name
|
25
|
+
'correspondence'
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_solr(doc = {} )
|
29
|
+
doc = super(doc)
|
30
|
+
doc['active_fedora_model_ssi'] = self.class.name
|
31
|
+
doc
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class Document < Bplmodels::SimpleObjectBase
|
3
|
+
#has_file_datastream :name => 'productionMaster', :type => ActiveFedora::Datastream
|
4
|
+
|
5
|
+
|
6
|
+
#A collection can have another collection as a member, or an image
|
7
|
+
def insert_member(fedora_object)
|
8
|
+
if (fedora_object.instance_of?(Bplmodels::ImageFile))
|
9
|
+
|
10
|
+
#add to the members ds
|
11
|
+
members.insert_member(:member_id=>fedora_object.pid, :member_title=>fedora_object.titleSet_display, :member_type=>fedora_object.fedora_name)
|
12
|
+
|
13
|
+
#add to the rels-ext ds
|
14
|
+
fedora_object.object << self
|
15
|
+
self.image_files << fedora_object
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
fedora_object.save!
|
20
|
+
self.save!
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def fedora_name
|
25
|
+
'document'
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_solr(doc = {} )
|
29
|
+
doc = super(doc)
|
30
|
+
doc['active_fedora_model_ssi'] = self.class.name
|
31
|
+
doc
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class DocumentFile < Bplmodels::File
|
3
|
+
|
4
|
+
has_many :next_document, :class_name => "Bplmodels::DocumentFile", :property=> :is_preceding_document_of
|
5
|
+
|
6
|
+
has_many :prev_document, :class_name => "Bplmodels::DocumentFile", :property=> :is_following_document_of
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class Ephemera < Bplmodels::SimpleObjectBase
|
3
|
+
#has_file_datastream :name => 'productionMaster', :type => ActiveFedora::Datastream
|
4
|
+
|
5
|
+
|
6
|
+
#A collection can have another collection as a member, or an image
|
7
|
+
def insert_member(fedora_object)
|
8
|
+
if (fedora_object.instance_of?(Bplmodels::ImageFile))
|
9
|
+
|
10
|
+
#add to the members ds
|
11
|
+
members.insert_member(:member_id=>fedora_object.pid, :member_title=>fedora_object.titleSet_display, :member_type=>fedora_object.fedora_name)
|
12
|
+
|
13
|
+
#add to the rels-ext ds
|
14
|
+
fedora_object.object << self
|
15
|
+
self.image_files << fedora_object
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
fedora_object.save!
|
20
|
+
self.save!
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def fedora_name
|
25
|
+
'ephemera'
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_solr(doc = {} )
|
29
|
+
doc = super(doc)
|
30
|
+
doc['active_fedora_model_ssi'] = self.class.name
|
31
|
+
doc
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class File < ActiveFedora::Base
|
3
|
+
include Hydra::AccessControls::Permissions
|
4
|
+
include Hydra::ModelMethods
|
5
|
+
|
6
|
+
include Bplmodels::Characterization
|
7
|
+
|
8
|
+
include ActiveFedora::Auditable
|
9
|
+
include Hydra::Derivatives
|
10
|
+
|
11
|
+
has_file_datastream 'preProductionNegativeMaster', versionable: true, label: 'preProductionNegativeMaster datastream'
|
12
|
+
|
13
|
+
has_file_datastream 'productionMaster', versionable: true, label: 'productionMaster datastream', type: FileContentDatastream
|
14
|
+
|
15
|
+
has_file_datastream 'accessMaster', versionable: false, label: 'accessMaster datastream'
|
16
|
+
|
17
|
+
has_file_datastream 'thumbnail300', versionable: false, label:'thumbnail300 datastream'
|
18
|
+
|
19
|
+
has_file_datastream 'access800', versionable: false, label:'access800 datastream'
|
20
|
+
|
21
|
+
belongs_to :object, :class_name => "Bplmodels::ObjectBase", :property => :is_image_of
|
22
|
+
|
23
|
+
belongs_to :exemplary, :class_name => "Bplmodels::ObjectBase", :property => :is_exemplary_image_of
|
24
|
+
|
25
|
+
# Uses the Hydra Rights Metadata Schema for tracking access permissions & copyright
|
26
|
+
has_metadata :name => "rightsMetadata", :type => Hydra::Datastream::RightsMetadata
|
27
|
+
|
28
|
+
has_metadata :name => "ARCHV-EXIF", :type => ActiveFedora::Datastream, :label=>'Archive image EXIF metadata'
|
29
|
+
|
30
|
+
has_metadata :name => "workflowMetadata", :type => WorkflowMetadata
|
31
|
+
|
32
|
+
def apply_default_permissions
|
33
|
+
self.datastreams["rightsMetadata"].update_permissions( "group"=>{"Repository Administrators"=>"edit"} )
|
34
|
+
self.save
|
35
|
+
end
|
36
|
+
|
37
|
+
def save
|
38
|
+
self.add_relationship(:has_model, "info:fedora/afmodel:Bplmodels_File")
|
39
|
+
super()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_solr(doc = {} )
|
43
|
+
doc = super(doc)
|
44
|
+
if self.workflowMetadata.marked_for_deletion.present?
|
45
|
+
doc['marked_for_deletion_bsi'] = self.workflowMetadata.marked_for_deletion.first
|
46
|
+
doc['marked_for_deletion_reason_ssi'] = self.workflowMetadata.marked_for_deletion.reason.first
|
47
|
+
end
|
48
|
+
|
49
|
+
doc['checksum_file_md5_ssi'] = self.productionMaster.checksum
|
50
|
+
|
51
|
+
doc
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def generate_derivatives
|
56
|
+
case self.productionMaster.mimeType
|
57
|
+
when 'application/pdf'
|
58
|
+
#transform_datastream :productionMaster, { :thumb => "100x100>" }
|
59
|
+
when 'audio/wav'
|
60
|
+
#transform_datastream :productionMaster, { :mp3 => {format: 'mp3'}, :ogg => {format: 'ogg'} }, processor: :audio
|
61
|
+
when 'video/avi'
|
62
|
+
#transform_datastream :productionMaster, { :mp4 => {format: 'mp4'}, :webm => {format: 'webm'} }, processor: :video
|
63
|
+
when 'image/tiff', 'image/png', 'image/jpg'
|
64
|
+
begin
|
65
|
+
transform_datastream :productionMaster, { :testJP2k => { recipe: :default, datastream: 'accessMaster' } }, processor: 'jpeg2k_image'
|
66
|
+
rescue => error
|
67
|
+
if error.message.include?('compressed TIFF files')
|
68
|
+
Magick::limit_resource(:memory, 5500000000)
|
69
|
+
Magick::limit_resource(:map, 5500000000)
|
70
|
+
#jp2_img = Magick::Image.read("#{self.fedora_connection[0].options[:url]}/objects/#{self.pid}datastreams/productionMaster/content").first
|
71
|
+
jp2_img = Magick::Image.from_blob(self.productionMaster.content).first
|
72
|
+
self.accessMaster.content = jp2_img.to_blob { self.format = "jp2" }
|
73
|
+
self.accessMaster.mimeType = 'image/jp2'
|
74
|
+
jp2_img.destroy!
|
75
|
+
else
|
76
|
+
raise error
|
77
|
+
end
|
78
|
+
end
|
79
|
+
transform_datastream :productionMaster, { :thumb => {size: "300x300>", datastream: 'thumbnail300', format: 'jpg'} }
|
80
|
+
transform_datastream :productionMaster, { :thumb => {size: "x800>", datastream: 'access800', format: 'jpg'} }
|
81
|
+
self.accessMaster.dsLabel = self.productionMaster.label
|
82
|
+
self.thumbnail300.dsLabel = self.productionMaster.label
|
83
|
+
self.access800.dsLabel = self.productionMaster.label
|
84
|
+
when 'image/jpeg' #FIXME
|
85
|
+
Magick::limit_resource(:memory, 5500000000)
|
86
|
+
Magick::limit_resource(:map, 5500000000)
|
87
|
+
jp2_img = Magick::Image.from_blob(self.productionMaster.content).first
|
88
|
+
self.accessMaster.content = jp2_img.to_blob { self.format = "jp2" }
|
89
|
+
self.accessMaster.mimeType = 'image/jp2'
|
90
|
+
jp2_img.destroy!
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def derivative_service(is_new)
|
95
|
+
response = Typhoeus::Request.post(DERIVATIVE_CONFIG_GLOBAL['url'] + "/processor/byfile.json", :params => {:pid=>self.pid, :new=>is_new, :environment=>Bplmodels.environment})
|
96
|
+
puts response.body.to_s
|
97
|
+
as_json = JSON.parse(response.body)
|
98
|
+
|
99
|
+
if as_json['result'] == "false"
|
100
|
+
raise "Error Generating Derivatives For Object: " + pid
|
101
|
+
end
|
102
|
+
|
103
|
+
return true
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
#Expects the following args:
|
108
|
+
#parent_pid => id of the parent object
|
109
|
+
#local_id => local ID of the object
|
110
|
+
#local_id_type => type of that local ID
|
111
|
+
#label => label of the collection
|
112
|
+
#institution_pid => instituional access of this file
|
113
|
+
def self.mint(args)
|
114
|
+
|
115
|
+
#TODO: Duplication check here to prevent over-writes?
|
116
|
+
|
117
|
+
args[:namespace_id] ||= ARK_CONFIG_GLOBAL['namespace_commonwealth_pid']
|
118
|
+
|
119
|
+
response = Typhoeus::Request.post(ARK_CONFIG_GLOBAL['url'] + "/arks.json", :params => {:ark=>{:parent_pid=>args[:parent_pid], :namespace_ark => ARK_CONFIG_GLOBAL['namespace_commonwealth_ark'], :namespace_id=>args[:namespace_id], :url_base => ARK_CONFIG_GLOBAL['ark_commonwealth_base'], :model_type => self.name, :local_original_identifier=>args[:local_id], :local_original_identifier_type=>args[:local_id_type]}})
|
120
|
+
as_json = JSON.parse(response.body)
|
121
|
+
|
122
|
+
#Below stopped working suddenly?
|
123
|
+
=begin
|
124
|
+
dup_check = ActiveFedora::Base.find(:pid=>as_json["pid"])
|
125
|
+
if dup_check.present?
|
126
|
+
return as_json["pid"]
|
127
|
+
end
|
128
|
+
=end
|
129
|
+
|
130
|
+
Bplmodels::File.find_in_batches('id'=>as_json["pid"]) do |group|
|
131
|
+
group.each { |solr_result|
|
132
|
+
return as_json["pid"]
|
133
|
+
}
|
134
|
+
end
|
135
|
+
|
136
|
+
object = self.new(:pid=>as_json["pid"])
|
137
|
+
|
138
|
+
object.label = args[:label]
|
139
|
+
|
140
|
+
object.read_groups = ["public"]
|
141
|
+
object.edit_groups = ["superuser", "admin[#{args[:institution_pid]}]"] if args[:institution_pid].present?
|
142
|
+
|
143
|
+
object.workflowMetadata.item_ark_info.ark_id = args[:local_id]
|
144
|
+
object.workflowMetadata.item_ark_info.ark_type = args[:local_id_type]
|
145
|
+
object.workflowMetadata.item_ark_info.ark_parent_pid = args[:parent_pid]
|
146
|
+
|
147
|
+
return object
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
module Bplmodels
|
2
|
+
class FitsDatastream < ActiveFedora::OmDatastream
|
3
|
+
include OM::XML::Document
|
4
|
+
|
5
|
+
#Required for Active Fedora 9
|
6
|
+
def prefix(path=nil)
|
7
|
+
return ''
|
8
|
+
end
|
9
|
+
|
10
|
+
set_terminology do |t|
|
11
|
+
t.root(path: "fits",
|
12
|
+
xmlns: "http://hul.harvard.edu/ois/xml/ns/fits/fits_output",
|
13
|
+
schema: "http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd")
|
14
|
+
t.identification {
|
15
|
+
t.identity {
|
16
|
+
t.format_label(path: {attribute: "format"})
|
17
|
+
t.mime_type(path: {attribute: "mimetype"}, index_as: [:stored_searchable])
|
18
|
+
}
|
19
|
+
}
|
20
|
+
t.fileinfo {
|
21
|
+
t.file_size(path: "size")
|
22
|
+
t.last_modified(path: "lastmodified")
|
23
|
+
t.filename(path: "filename")
|
24
|
+
t.original_checksum(path: "md5checksum")
|
25
|
+
t.rights_basis(path: "rightsBasis")
|
26
|
+
t.copyright_basis(path: "copyrightBasis")
|
27
|
+
t.copyright_note(path: "copyrightNote")
|
28
|
+
}
|
29
|
+
t.filestatus {
|
30
|
+
t.well_formed(path: "well-formed")
|
31
|
+
t.valid(path: "valid")
|
32
|
+
t.status_message(path: "message")
|
33
|
+
}
|
34
|
+
t.metadata {
|
35
|
+
t.document {
|
36
|
+
t.file_title(path: "title")
|
37
|
+
t.file_author(path: "author")
|
38
|
+
t.file_language(path: "language")
|
39
|
+
t.page_count(path: "pageCount")
|
40
|
+
t.word_count(path: "wordCount")
|
41
|
+
t.character_count(path: "characterCount")
|
42
|
+
t.paragraph_count(path: "paragraphCount")
|
43
|
+
t.line_count(path: "lineCount")
|
44
|
+
t.table_count(path: "tableCount")
|
45
|
+
t.graphics_count(path: "graphicsCount")
|
46
|
+
}
|
47
|
+
t.image {
|
48
|
+
t.byte_order(path: "byteOrder")
|
49
|
+
t.compression(path: "compressionScheme")
|
50
|
+
t.width(path: "imageWidth")
|
51
|
+
t.height(path: "imageHeight")
|
52
|
+
t.color_space(path: "colorSpace")
|
53
|
+
t.profile_name(path: "iccProfileName")
|
54
|
+
t.profile_version(path: "iccProfileVersion")
|
55
|
+
t.orientation(path: "orientation")
|
56
|
+
t.color_map(path: "colorMap")
|
57
|
+
t.image_producer(path: "imageProducer")
|
58
|
+
t.capture_device(path: "captureDevice")
|
59
|
+
t.scanning_software(path: "scanningSoftwareName")
|
60
|
+
t.exif_version(path: "exifVersion")
|
61
|
+
t.gps_timestamp(path: "gpsTimeStamp")
|
62
|
+
t.latitude(path: "gpsDestLatitude")
|
63
|
+
t.longitude(path: "gpsDestLongitude")
|
64
|
+
}
|
65
|
+
t.text {
|
66
|
+
t.character_set(path: "charset")
|
67
|
+
t.markup_basis(path: "markupBasis")
|
68
|
+
t.markup_language(path: "markupLanguage")
|
69
|
+
}
|
70
|
+
t.audio {
|
71
|
+
t.duration(path: "duration")
|
72
|
+
t.bit_depth(path: "bitDepth")
|
73
|
+
t.sample_rate(path: "sampleRate")
|
74
|
+
t.channels(path: "channels")
|
75
|
+
t.data_format(path: "dataFormatType")
|
76
|
+
t.offset(path: "offset")
|
77
|
+
}
|
78
|
+
t.video {
|
79
|
+
t.width(path: "imageWidth")
|
80
|
+
t.height(path: "imageHeight")
|
81
|
+
t.duration(path: "duration")
|
82
|
+
t.sample_rate(path: "sampleRate")
|
83
|
+
t.frame_rate(path: "frameRate")
|
84
|
+
}
|
85
|
+
}
|
86
|
+
t.format_label(proxy: [:identification, :identity, :format_label])
|
87
|
+
t.mime_type(proxy: [:identification, :identity, :mime_type])
|
88
|
+
t.file_size(proxy: [:fileinfo, :file_size])
|
89
|
+
t.last_modified(proxy: [:fileinfo, :last_modified])
|
90
|
+
t.filename(proxy: [:fileinfo, :filename])
|
91
|
+
t.original_checksum(proxy: [:fileinfo, :original_checksum])
|
92
|
+
t.rights_basis(proxy: [:fileinfo, :rights_basis])
|
93
|
+
t.copyright_basis(proxy: [:fileinfo, :copyright_basis])
|
94
|
+
t.copyright_note(proxy: [:fileinfo, :copyright_note])
|
95
|
+
t.well_formed(proxy: [:filestatus, :well_formed])
|
96
|
+
t.valid(proxy: [:filestatus, :valid])
|
97
|
+
t.status_message(proxy: [:filestatus, :status_message])
|
98
|
+
t.file_title(proxy: [:metadata, :document, :file_title])
|
99
|
+
t.file_author(proxy: [:metadata, :document, :file_author])
|
100
|
+
t.page_count(proxy: [:metadata, :document, :page_count])
|
101
|
+
t.file_language(proxy: [:metadata, :document, :file_language])
|
102
|
+
t.word_count(proxy: [:metadata, :document, :word_count])
|
103
|
+
t.character_count(proxy: [:metadata, :document, :character_count])
|
104
|
+
t.paragraph_count(proxy: [:metadata, :document, :paragraph_count])
|
105
|
+
t.line_count(proxy: [:metadata, :document, :line_count])
|
106
|
+
t.table_count(proxy: [:metadata, :document, :table_count])
|
107
|
+
t.graphics_count(proxy: [:metadata, :document, :graphics_count])
|
108
|
+
t.byte_order(proxy: [:metadata, :image, :byte_order])
|
109
|
+
t.compression(proxy: [:metadata, :image, :compression])
|
110
|
+
t.width(proxy: [:metadata, :image, :width])
|
111
|
+
t.video_width( proxy: [:metadata, :video, :width])
|
112
|
+
t.height(proxy: [:metadata, :image, :height])
|
113
|
+
t.video_height(proxy: [:metadata, :video, :height])
|
114
|
+
t.color_space(proxy: [:metadata, :image, :color_space])
|
115
|
+
t.profile_name(proxy: [:metadata, :image, :profile_name])
|
116
|
+
t.profile_version(proxy: [:metadata, :image, :profile_version])
|
117
|
+
t.orientation(proxy: [:metadata, :image, :orientation])
|
118
|
+
t.color_map(proxy: [:metadata, :image, :color_map])
|
119
|
+
t.image_producer(proxy: [:metadata, :image, :image_producer])
|
120
|
+
t.capture_device(proxy: [:metadata, :image, :capture_device])
|
121
|
+
t.scanning_software(proxy: [:metadata, :image, :scanning_software])
|
122
|
+
t.exif_version(proxy: [:metadata, :image, :exif_version])
|
123
|
+
t.gps_timestamp(proxy: [:metadata, :image, :gps_timestamp])
|
124
|
+
t.latitude(proxy: [:metadata, :image, :latitude])
|
125
|
+
t.longitude(proxy: [:metadata, :image, :longitude])
|
126
|
+
t.character_set(proxy: [:metadata, :text, :character_set])
|
127
|
+
t.markup_basis(proxy: [:metadata, :text, :markup_basis])
|
128
|
+
t.markup_language(proxy: [:metadata, :text, :markup_language])
|
129
|
+
t.duration(proxy: [:metadata, :audio, :duration])
|
130
|
+
t.video_duration(proxy: [:metadata, :video, :duration])
|
131
|
+
t.bit_depth(proxy: [:metadata, :audio, :bit_depth])
|
132
|
+
t.sample_rate(proxy: [:metadata, :audio, :sample_rate])
|
133
|
+
t.video_sample_rate(proxy: [:metadata, :video, :sample_rate])
|
134
|
+
t.channels(proxy: [:metadata, :audio, :channels])
|
135
|
+
t.data_format(proxy: [:metadata, :audio, :data_format])
|
136
|
+
t.offset(proxy: [:metadata, :audio, :offset])
|
137
|
+
t.frame_rate(proxy: [:metadata, :video, :frame_rate])
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.xml_template
|
141
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
142
|
+
xml.fits(xmlns: 'http://hul.harvard.edu/ois/xml/ns/fits/fits_output',
|
143
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
144
|
+
'xsi:schemaLocation' =>
|
145
|
+
"http://hul.harvard.edu/ois/xml/ns/fits/fits_output
|
146
|
+
http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd",
|
147
|
+
version: "0.6.0",
|
148
|
+
timestamp: "1/25/12 11:04 AM") {
|
149
|
+
xml.identification {
|
150
|
+
xml.identity(format: '', mimetype: '',
|
151
|
+
toolname: 'FITS', toolversion: '') {
|
152
|
+
xml.tool(toolname: '', toolversion: '')
|
153
|
+
xml.version(toolname: '', toolversion: '')
|
154
|
+
xml.externalIdentifier(toolname: '', toolversion: '')
|
155
|
+
}
|
156
|
+
}
|
157
|
+
xml.fileinfo {
|
158
|
+
xml.size(toolname: '', toolversion: '')
|
159
|
+
xml.creatingApplicatioName(toolname: '', toolversion: '',
|
160
|
+
status: '')
|
161
|
+
xml.lastmodified(toolname: '', toolversion: '', status: '')
|
162
|
+
xml.filepath(toolname: '', toolversion: '', status: '')
|
163
|
+
xml.filename(toolname: '', toolversion: '', status: '')
|
164
|
+
xml.md5checksum(toolname: '', toolversion: '', status: '')
|
165
|
+
xml.fslastmodified(toolname: '', toolversion: '', status: '')
|
166
|
+
}
|
167
|
+
xml.filestatus {
|
168
|
+
xml.tag! "well-formed", toolname: '', toolversion: '', status: ''
|
169
|
+
xml.valid(toolname: '', toolversion: '', status: '')
|
170
|
+
}
|
171
|
+
xml.metadata {
|
172
|
+
xml.document {
|
173
|
+
xml.title(toolname: '', toolversion: '', status: '')
|
174
|
+
xml.author(toolname: '', toolversion: '', status: '')
|
175
|
+
xml.pageCount(toolname: '', toolversion: '')
|
176
|
+
xml.isTagged(toolname: '', toolversion: '')
|
177
|
+
xml.hasOutline(toolname: '', toolversion: '')
|
178
|
+
xml.hasAnnotations(toolname: '', toolversion: '')
|
179
|
+
xml.isRightsManaged(toolname: '', toolversion: '',
|
180
|
+
status: '')
|
181
|
+
xml.isProtected(toolname: '', toolversion: '')
|
182
|
+
xml.hasForms(toolname: '', toolversion: '', status: '')
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
end
|
187
|
+
builder.doc
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|