sufia-models 4.0.0.beta2 → 4.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/actors/sufia/generic_file/actor.rb +118 -0
- data/app/models/batch.rb +3 -3
- data/app/models/checksum_audit_log.rb +3 -3
- data/app/models/collection.rb +41 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file.rb +33 -43
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/accessible_attributes.rb +3 -3
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/audit.rb +12 -18
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/characterization.rb +1 -8
- data/app/models/concerns/sufia/generic_file/derivatives.rb +26 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/export.rb +13 -13
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/featured.rb +0 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/metadata.rb +0 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/mime_types.rb +15 -1
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/permissions.rb +5 -1
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/reload_on_save.rb +0 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/trophies.rb +0 -0
- data/app/models/concerns/sufia/generic_file/versions.rb +16 -0
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/virus_check.rb +2 -3
- data/{lib/sufia/models → app/models/concerns/sufia}/generic_file/web_form.rb +9 -2
- data/app/models/concerns/sufia/properties_datastream_behavior.rb +3 -4
- data/app/models/concerns/sufia/user.rb +2 -2
- data/app/models/datastreams/fits_datastream.rb +137 -136
- data/app/models/datastreams/generic_file_rdf_datastream.rb +6 -0
- data/app/models/datastreams/paranoid_rights_datastream.rb +3 -3
- data/app/models/file_usage.rb +53 -0
- data/app/models/follow.rb +2 -4
- data/app/models/geo_names_resource.rb +5 -7
- data/app/models/local_authority.rb +14 -14
- data/app/models/single_use_link.rb +1 -1
- data/app/models/sufia/download.rb +9 -0
- data/app/models/trophy.rb +1 -1
- data/app/services/sufia/{usage_statistics.rb → analytics.rb} +1 -24
- data/app/services/sufia/id_service.rb +2 -2
- data/lib/generators/sufia/models/install_generator.rb +5 -2
- data/lib/generators/sufia/models/templates/config/setup_mail.rb +1 -1
- data/lib/generators/sufia/models/templates/config/sufia.rb +5 -3
- data/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb +6 -6
- data/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +2 -3
- data/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +20 -20
- data/lib/sufia/ability.rb +1 -1
- data/lib/sufia/models/engine.rb +3 -9
- data/lib/sufia/models/file_content/versions.rb +3 -3
- data/lib/sufia/models/jobs/active_fedora_pid_based_job.rb +6 -2
- data/lib/sufia/models/jobs/batch_update_job.rb +6 -10
- data/lib/sufia/models/jobs/characterize_job.rb +1 -13
- data/lib/sufia/models/jobs/create_derivatives_job.rb +14 -0
- data/lib/sufia/models/jobs/import_url_job.rb +27 -23
- data/lib/sufia/models/version.rb +1 -1
- data/lib/tasks/sufia-models_tasks.rake +1 -1
- data/sufia-models.gemspec +1 -1
- metadata +65 -64
- data/lib/sufia/models/generic_file/actions.rb +0 -50
- data/lib/sufia/models/generic_file/derivatives.rb +0 -31
- data/lib/sufia/models/generic_file/thumbnail.rb +0 -37
- data/lib/sufia/models/generic_file/versions.rb +0 -16
- data/lib/sufia/models/jobs/transcode_audio_job.rb +0 -15
- data/lib/sufia/models/jobs/transcode_video_job.rb +0 -15
- data/lib/sufia/models/solr_document_behavior.rb +0 -118
@@ -0,0 +1,26 @@
|
|
1
|
+
module Sufia
|
2
|
+
module GenericFile
|
3
|
+
module Derivatives
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
include Hydra::Derivatives
|
8
|
+
|
9
|
+
makes_derivatives do |obj|
|
10
|
+
case obj.mime_type
|
11
|
+
when *pdf_mime_types
|
12
|
+
obj.transform_datastream :content, { thumbnail: { format: 'jpg', size: '338x493', datastream: 'thumbnail' } }
|
13
|
+
when *office_document_mime_types
|
14
|
+
obj.transform_datastream :content, { thumbnail: { format: 'jpg', size: '200x150>', datastream: 'thumbnail' } }, processor: :document
|
15
|
+
when *audio_mime_types
|
16
|
+
obj.transform_datastream :content, { mp3: { format: 'mp3', datastream: 'mp3' }, ogg: { format: 'ogg', datastream: 'ogg' } }, processor: :audio
|
17
|
+
when *video_mime_types
|
18
|
+
obj.transform_datastream :content, { webm: { format: 'webm', datastream: 'webm' }, mp4: { format: 'mp4', datastream: 'mp4' }, thumbnail: { format: 'jpg', datastream: 'thumbnail' } }, processor: :video
|
19
|
+
when *image_mime_types
|
20
|
+
obj.transform_datastream :content, { thumbnail: { format: 'jpg', size: '200x150>', datastream: 'thumbnail' } }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -46,19 +46,19 @@ module Sufia
|
|
46
46
|
export_text = []
|
47
47
|
export_text << "url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&rfr_id=info%3Asid%2Fblacklight.rubyforge.org%3Agenerator"
|
48
48
|
field_map = {
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
49
|
+
title: 'title',
|
50
|
+
creator: 'creator',
|
51
|
+
subject: 'subject',
|
52
|
+
description: 'description',
|
53
|
+
publisher: 'publisher',
|
54
|
+
contributor: 'contributor',
|
55
|
+
date_created: 'date',
|
56
|
+
resource_type: 'format',
|
57
|
+
identifier: 'identifier',
|
58
|
+
language: 'language',
|
59
|
+
tag: 'relation',
|
60
|
+
based_near: 'coverage',
|
61
|
+
rights: 'rights'
|
62
62
|
}
|
63
63
|
field_map.each do |element, kev|
|
64
64
|
values = self.send(element)
|
File without changes
|
File without changes
|
@@ -19,6 +19,10 @@ module Sufia
|
|
19
19
|
self.class.audio_mime_types.include? self.mime_type
|
20
20
|
end
|
21
21
|
|
22
|
+
def office_document?
|
23
|
+
self.class.office_document_mime_types.include? self.mime_type
|
24
|
+
end
|
25
|
+
|
22
26
|
def file_format
|
23
27
|
return nil if self.mime_type.blank? and self.format_label.blank?
|
24
28
|
return self.mime_type.split('/')[1]+ " ("+self.format_label.join(", ")+")" unless self.mime_type.blank? or self.format_label.blank?
|
@@ -28,7 +32,7 @@ module Sufia
|
|
28
32
|
|
29
33
|
module ClassMethods
|
30
34
|
def image_mime_types
|
31
|
-
['image/png','image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif']
|
35
|
+
['image/png', 'image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif']
|
32
36
|
end
|
33
37
|
|
34
38
|
def pdf_mime_types
|
@@ -44,6 +48,16 @@ module Sufia
|
|
44
48
|
# audio/mpeg is the mime type that fits 0.6.0 returns for an mp3 file.
|
45
49
|
['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wave', 'audio/x-wav', 'audio/ogg']
|
46
50
|
end
|
51
|
+
|
52
|
+
def office_document_mime_types
|
53
|
+
['text/rtf',
|
54
|
+
'application/msword',
|
55
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
56
|
+
'application/vnd.ms-excel',
|
57
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
58
|
+
'application/vnd.ms-powerpoint',
|
59
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation']
|
60
|
+
end
|
47
61
|
end
|
48
62
|
end
|
49
63
|
end
|
@@ -7,7 +7,7 @@ module Sufia
|
|
7
7
|
include Hydra::AccessControls::Visibility
|
8
8
|
|
9
9
|
included do
|
10
|
-
has_metadata "rightsMetadata", :
|
10
|
+
has_metadata "rightsMetadata", type: ParanoidRightsDatastream
|
11
11
|
validate :paranoid_permissions
|
12
12
|
end
|
13
13
|
|
@@ -34,6 +34,10 @@ module Sufia
|
|
34
34
|
perms.map {|p| { name: p.name, access: p.access, type:p.type } }
|
35
35
|
end
|
36
36
|
|
37
|
+
def public?
|
38
|
+
read_groups.include?('public')
|
39
|
+
end
|
40
|
+
|
37
41
|
private
|
38
42
|
|
39
43
|
def permission_hash
|
File without changes
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Sufia
|
2
|
+
module GenericFile
|
3
|
+
module Versions
|
4
|
+
def record_version_committer(user)
|
5
|
+
version = content.latest_version
|
6
|
+
# content datastream not (yet?) present
|
7
|
+
return if version.nil?
|
8
|
+
VersionCommitter.create(obj_id: version.pid,
|
9
|
+
datastream_id: version.dsid,
|
10
|
+
version_id: version.versionID,
|
11
|
+
committer_login: user.user_key)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -20,14 +20,13 @@ module Sufia
|
|
20
20
|
t.path
|
21
21
|
end
|
22
22
|
end
|
23
|
-
Sufia::GenericFile::
|
23
|
+
Sufia::GenericFile::Actor.virus_check(path)
|
24
24
|
true
|
25
25
|
rescue Sufia::VirusFoundError => virus
|
26
26
|
logger.warn(virus.message)
|
27
|
-
errors.add(:
|
27
|
+
errors.add(:base, virus.message)
|
28
28
|
false
|
29
29
|
end
|
30
|
-
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
@@ -28,7 +28,14 @@ module Sufia
|
|
28
28
|
def terms_for_display
|
29
29
|
# 'type' is the RDF.type assertion, which is not present by default, but may be
|
30
30
|
# provided in some RDF schemas
|
31
|
-
self.
|
31
|
+
self.class.terms_for_display
|
32
|
+
end
|
33
|
+
|
34
|
+
module ClassMethods
|
35
|
+
def terms_for_display
|
36
|
+
[:resource_type, :title, :creator, :contributor, :description, :tag, :rights, :publisher, :date_created,
|
37
|
+
:date_uploaded, :date_modified, :subject, :language, :identifier, :based_near, :related_url]
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
def to_jq_upload
|
@@ -37,7 +44,7 @@ module Sufia
|
|
37
44
|
"size" => self.file_size,
|
38
45
|
"url" => "/files/#{noid}",
|
39
46
|
"thumbnail_url" => self.pid,
|
40
|
-
"delete_url" => "deleteme", # generic_file_path(:
|
47
|
+
"delete_url" => "deleteme", # generic_file_path(id: id),
|
41
48
|
"delete_type" => "DELETE"
|
42
49
|
}
|
43
50
|
end
|
@@ -4,12 +4,12 @@ module Sufia
|
|
4
4
|
|
5
5
|
included do
|
6
6
|
set_terminology do |t|
|
7
|
-
t.root(:
|
7
|
+
t.root(path: "fields")
|
8
8
|
# This is where we put the user id of the object depositor -- impacts permissions/access controls
|
9
|
-
t.depositor :
|
9
|
+
t.depositor index_as: [:symbol, :stored_searchable]
|
10
10
|
# This is where we put the relative path of the file if submitted as a folder
|
11
11
|
t.relative_path
|
12
|
-
t.import_url path: 'importUrl', :
|
12
|
+
t.import_url path: 'importUrl', index_as: :symbol
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -25,6 +25,5 @@ module Sufia
|
|
25
25
|
def prefix
|
26
26
|
""
|
27
27
|
end
|
28
|
-
|
29
28
|
end
|
30
29
|
end
|
@@ -8,7 +8,7 @@ module Sufia::User
|
|
8
8
|
include Blacklight::User
|
9
9
|
include Hydra::User
|
10
10
|
|
11
|
-
delegate :can?, :cannot?, :
|
11
|
+
delegate :can?, :cannot?, to: :ability
|
12
12
|
|
13
13
|
# set this up as a messageable object
|
14
14
|
acts_as_messageable
|
@@ -18,7 +18,7 @@ module Sufia::User
|
|
18
18
|
# Users should be followable
|
19
19
|
acts_as_followable
|
20
20
|
|
21
|
-
mount_uploader :avatar, AvatarUploader, :
|
21
|
+
mount_uploader :avatar, AvatarUploader, mount_on: :avatar_file_name
|
22
22
|
validates_with AvatarValidator
|
23
23
|
has_many :trophies
|
24
24
|
end
|
@@ -1,182 +1,183 @@
|
|
1
1
|
class FitsDatastream < ActiveFedora::OmDatastream
|
2
2
|
include OM::XML::Document
|
3
|
+
|
3
4
|
def prefix
|
4
5
|
""
|
5
6
|
end
|
6
7
|
|
7
8
|
set_terminology do |t|
|
8
|
-
t.root(:
|
9
|
-
:
|
10
|
-
:
|
9
|
+
t.root(path: "fits",
|
10
|
+
xmlns: "http://hul.harvard.edu/ois/xml/ns/fits/fits_output",
|
11
|
+
schema: "http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd")
|
11
12
|
t.identification {
|
12
13
|
t.identity {
|
13
|
-
t.format_label(:
|
14
|
-
t.mime_type(:
|
14
|
+
t.format_label(path: {attribute: "format"})
|
15
|
+
t.mime_type(path: {attribute: "mimetype"}, index_as: [:stored_searchable])
|
15
16
|
}
|
16
17
|
}
|
17
18
|
t.fileinfo {
|
18
|
-
t.file_size(:
|
19
|
-
t.last_modified(:
|
20
|
-
t.filename(:
|
21
|
-
t.original_checksum(:
|
22
|
-
t.rights_basis(:
|
23
|
-
t.copyright_basis(:
|
24
|
-
t.copyright_note(:
|
19
|
+
t.file_size(path: "size")
|
20
|
+
t.last_modified(path: "lastmodified")
|
21
|
+
t.filename(path: "filename")
|
22
|
+
t.original_checksum(path: "md5checksum")
|
23
|
+
t.rights_basis(path: "rightsBasis")
|
24
|
+
t.copyright_basis(path: "copyrightBasis")
|
25
|
+
t.copyright_note(path: "copyrightNote")
|
25
26
|
}
|
26
|
-
t.filestatus {
|
27
|
-
t.well_formed(:
|
28
|
-
t.valid(:
|
29
|
-
t.status_message(:
|
27
|
+
t.filestatus {
|
28
|
+
t.well_formed(path: "well-formed")
|
29
|
+
t.valid(path: "valid")
|
30
|
+
t.status_message(path: "message")
|
30
31
|
}
|
31
32
|
t.metadata {
|
32
33
|
t.document {
|
33
|
-
t.file_title(:
|
34
|
-
t.file_author(:
|
35
|
-
t.file_language(:
|
36
|
-
t.page_count(:
|
37
|
-
t.word_count(:
|
38
|
-
t.character_count(:
|
39
|
-
t.paragraph_count(:
|
40
|
-
t.line_count(:
|
41
|
-
t.table_count(:
|
42
|
-
t.graphics_count(:
|
34
|
+
t.file_title(path: "title")
|
35
|
+
t.file_author(path: "author")
|
36
|
+
t.file_language(path: "language")
|
37
|
+
t.page_count(path: "pageCount")
|
38
|
+
t.word_count(path: "wordCount")
|
39
|
+
t.character_count(path: "characterCount")
|
40
|
+
t.paragraph_count(path: "paragraphCount")
|
41
|
+
t.line_count(path: "lineCount")
|
42
|
+
t.table_count(path: "tableCount")
|
43
|
+
t.graphics_count(path: "graphicsCount")
|
43
44
|
}
|
44
45
|
t.image {
|
45
|
-
t.byte_order(:
|
46
|
-
t.compression(:
|
47
|
-
t.width(:
|
48
|
-
t.height(:
|
49
|
-
t.color_space(:
|
50
|
-
t.profile_name(:
|
51
|
-
t.profile_version(:
|
52
|
-
t.orientation(:
|
53
|
-
t.color_map(:
|
54
|
-
t.image_producer(:
|
55
|
-
t.capture_device(:
|
56
|
-
t.scanning_software(:
|
57
|
-
t.exif_version(:
|
58
|
-
t.gps_timestamp(:
|
59
|
-
t.latitude(:
|
60
|
-
t.longitude(:
|
46
|
+
t.byte_order(path: "byteOrder")
|
47
|
+
t.compression(path: "compressionScheme")
|
48
|
+
t.width(path: "imageWidth")
|
49
|
+
t.height(path: "imageHeight")
|
50
|
+
t.color_space(path: "colorSpace")
|
51
|
+
t.profile_name(path: "iccProfileName")
|
52
|
+
t.profile_version(path: "iccProfileVersion")
|
53
|
+
t.orientation(path: "orientation")
|
54
|
+
t.color_map(path: "colorMap")
|
55
|
+
t.image_producer(path: "imageProducer")
|
56
|
+
t.capture_device(path: "captureDevice")
|
57
|
+
t.scanning_software(path: "scanningSoftwareName")
|
58
|
+
t.exif_version(path: "exifVersion")
|
59
|
+
t.gps_timestamp(path: "gpsTimeStamp")
|
60
|
+
t.latitude(path: "gpsDestLatitude")
|
61
|
+
t.longitude(path: "gpsDestLongitude")
|
61
62
|
}
|
62
63
|
t.text {
|
63
|
-
t.character_set(:
|
64
|
-
t.markup_basis(:
|
65
|
-
t.markup_language(:
|
64
|
+
t.character_set(path: "charset")
|
65
|
+
t.markup_basis(path: "markupBasis")
|
66
|
+
t.markup_language(path: "markupLanguage")
|
66
67
|
}
|
67
68
|
t.audio {
|
68
|
-
t.duration(:
|
69
|
-
t.bit_depth(:
|
70
|
-
t.sample_rate(:
|
71
|
-
t.channels(:
|
72
|
-
t.data_format(:
|
73
|
-
t.offset(:
|
69
|
+
t.duration(path: "duration")
|
70
|
+
t.bit_depth(path: "bitDepth")
|
71
|
+
t.sample_rate(path: "sampleRate")
|
72
|
+
t.channels(path: "channels")
|
73
|
+
t.data_format(path: "dataFormatType")
|
74
|
+
t.offset(path: "offset")
|
74
75
|
}
|
75
76
|
t.video {
|
76
|
-
t.width(:
|
77
|
-
t.height(:
|
78
|
-
t.duration(:
|
79
|
-
t.sample_rate(:
|
80
|
-
t.frame_rate(:
|
77
|
+
t.width(path: "imageWidth")
|
78
|
+
t.height(path: "imageHeight")
|
79
|
+
t.duration(path: "duration")
|
80
|
+
t.sample_rate(path: "sampleRate")
|
81
|
+
t.frame_rate(path: "frameRate")
|
81
82
|
}
|
82
83
|
}
|
83
|
-
t.format_label(:
|
84
|
-
t.mime_type(:
|
85
|
-
t.file_size(:
|
86
|
-
t.last_modified(:
|
87
|
-
t.filename(:
|
88
|
-
t.original_checksum(:
|
89
|
-
t.rights_basis(:
|
90
|
-
t.copyright_basis(:
|
91
|
-
t.copyright_note(:
|
92
|
-
t.well_formed(:
|
93
|
-
t.valid(:
|
94
|
-
t.status_message(:
|
95
|
-
t.file_title(:
|
96
|
-
t.file_author(:
|
97
|
-
t.page_count(:
|
98
|
-
t.file_language(:
|
99
|
-
t.word_count(:
|
100
|
-
t.character_count(:
|
101
|
-
t.paragraph_count(:
|
102
|
-
t.line_count(:
|
103
|
-
t.table_count(:
|
104
|
-
t.graphics_count(:
|
105
|
-
t.byte_order(:
|
106
|
-
t.compression(:
|
107
|
-
t.width(:
|
108
|
-
t.video_width( :
|
109
|
-
t.height(:
|
110
|
-
t.video_height(:
|
111
|
-
t.color_space(:
|
112
|
-
t.profile_name(:
|
113
|
-
t.profile_version(:
|
114
|
-
t.orientation(:
|
115
|
-
t.color_map(:
|
116
|
-
t.image_producer(:
|
117
|
-
t.capture_device(:
|
118
|
-
t.scanning_software(:
|
119
|
-
t.exif_version(:
|
120
|
-
t.gps_timestamp(:
|
121
|
-
t.latitude(:
|
122
|
-
t.longitude(:
|
123
|
-
t.character_set(:
|
124
|
-
t.markup_basis(:
|
125
|
-
t.markup_language(:
|
126
|
-
t.duration(:
|
127
|
-
t.video_duration(:
|
128
|
-
t.bit_depth(:
|
129
|
-
t.sample_rate(:
|
130
|
-
t.video_sample_rate(:
|
131
|
-
t.channels(:
|
132
|
-
t.data_format(:
|
133
|
-
t.offset(:
|
134
|
-
t.frame_rate(:
|
84
|
+
t.format_label(proxy: [:identification, :identity, :format_label])
|
85
|
+
t.mime_type(proxy: [:identification, :identity, :mime_type])
|
86
|
+
t.file_size(proxy: [:fileinfo, :file_size])
|
87
|
+
t.last_modified(proxy: [:fileinfo, :last_modified])
|
88
|
+
t.filename(proxy: [:fileinfo, :filename])
|
89
|
+
t.original_checksum(proxy: [:fileinfo, :original_checksum])
|
90
|
+
t.rights_basis(proxy: [:fileinfo, :rights_basis])
|
91
|
+
t.copyright_basis(proxy: [:fileinfo, :copyright_basis])
|
92
|
+
t.copyright_note(proxy: [:fileinfo, :copyright_note])
|
93
|
+
t.well_formed(proxy: [:filestatus, :well_formed])
|
94
|
+
t.valid(proxy: [:filestatus, :valid])
|
95
|
+
t.status_message(proxy: [:filestatus, :status_message])
|
96
|
+
t.file_title(proxy: [:metadata, :document, :file_title])
|
97
|
+
t.file_author(proxy: [:metadata, :document, :file_author])
|
98
|
+
t.page_count(proxy: [:metadata, :document, :page_count])
|
99
|
+
t.file_language(proxy: [:metadata, :document, :file_language])
|
100
|
+
t.word_count(proxy: [:metadata, :document, :word_count])
|
101
|
+
t.character_count(proxy: [:metadata, :document, :character_count])
|
102
|
+
t.paragraph_count(proxy: [:metadata, :document, :paragraph_count])
|
103
|
+
t.line_count(proxy: [:metadata, :document, :line_count])
|
104
|
+
t.table_count(proxy: [:metadata, :document, :table_count])
|
105
|
+
t.graphics_count(proxy: [:metadata, :document, :graphics_count])
|
106
|
+
t.byte_order(proxy: [:metadata, :image, :byte_order])
|
107
|
+
t.compression(proxy: [:metadata, :image, :compression])
|
108
|
+
t.width(proxy: [:metadata, :image, :width])
|
109
|
+
t.video_width( proxy: [:metadata, :video, :width])
|
110
|
+
t.height(proxy: [:metadata, :image, :height])
|
111
|
+
t.video_height(proxy: [:metadata, :video, :height])
|
112
|
+
t.color_space(proxy: [:metadata, :image, :color_space])
|
113
|
+
t.profile_name(proxy: [:metadata, :image, :profile_name])
|
114
|
+
t.profile_version(proxy: [:metadata, :image, :profile_version])
|
115
|
+
t.orientation(proxy: [:metadata, :image, :orientation])
|
116
|
+
t.color_map(proxy: [:metadata, :image, :color_map])
|
117
|
+
t.image_producer(proxy: [:metadata, :image, :image_producer])
|
118
|
+
t.capture_device(proxy: [:metadata, :image, :capture_device])
|
119
|
+
t.scanning_software(proxy: [:metadata, :image, :scanning_software])
|
120
|
+
t.exif_version(proxy: [:metadata, :image, :exif_version])
|
121
|
+
t.gps_timestamp(proxy: [:metadata, :image, :gps_timestamp])
|
122
|
+
t.latitude(proxy: [:metadata, :image, :latitude])
|
123
|
+
t.longitude(proxy: [:metadata, :image, :longitude])
|
124
|
+
t.character_set(proxy: [:metadata, :text, :character_set])
|
125
|
+
t.markup_basis(proxy: [:metadata, :text, :markup_basis])
|
126
|
+
t.markup_language(proxy: [:metadata, :text, :markup_language])
|
127
|
+
t.duration(proxy: [:metadata, :audio, :duration])
|
128
|
+
t.video_duration(proxy: [:metadata, :video, :duration])
|
129
|
+
t.bit_depth(proxy: [:metadata, :audio, :bit_depth])
|
130
|
+
t.sample_rate(proxy: [:metadata, :audio, :sample_rate])
|
131
|
+
t.video_sample_rate(proxy: [:metadata, :video, :sample_rate])
|
132
|
+
t.channels(proxy: [:metadata, :audio, :channels])
|
133
|
+
t.data_format(proxy: [:metadata, :audio, :data_format])
|
134
|
+
t.offset(proxy: [:metadata, :audio, :offset])
|
135
|
+
t.frame_rate(proxy: [:metadata, :video, :frame_rate])
|
135
136
|
end
|
136
137
|
|
137
138
|
def self.xml_template
|
138
139
|
builder = Nokogiri::XML::Builder.new do |xml|
|
139
|
-
xml.fits(:
|
140
|
+
xml.fits(xmlns: 'http://hul.harvard.edu/ois/xml/ns/fits/fits_output',
|
140
141
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
141
142
|
'xsi:schemaLocation' =>
|
142
143
|
"http://hul.harvard.edu/ois/xml/ns/fits/fits_output
|
143
144
|
http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd",
|
144
|
-
:
|
145
|
-
:
|
145
|
+
version: "0.6.0",
|
146
|
+
timestamp: "1/25/12 11:04 AM") {
|
146
147
|
xml.identification {
|
147
|
-
xml.identity(:
|
148
|
-
:
|
149
|
-
xml.tool(:
|
150
|
-
xml.version(:
|
151
|
-
xml.externalIdentifier(:
|
148
|
+
xml.identity(format: '', mimetype: '',
|
149
|
+
toolname: 'FITS', toolversion: '') {
|
150
|
+
xml.tool(toolname: '', toolversion: '')
|
151
|
+
xml.version(toolname: '', toolversion: '')
|
152
|
+
xml.externalIdentifier(toolname: '', toolversion: '')
|
152
153
|
}
|
153
154
|
}
|
154
155
|
xml.fileinfo {
|
155
|
-
xml.size(:
|
156
|
-
xml.creatingApplicatioName(:
|
157
|
-
:
|
158
|
-
xml.lastmodified(:
|
159
|
-
xml.filepath(:
|
160
|
-
xml.filename(:
|
161
|
-
xml.md5checksum(:
|
162
|
-
xml.fslastmodified(:
|
156
|
+
xml.size(toolname: '', toolversion: '')
|
157
|
+
xml.creatingApplicatioName(toolname: '', toolversion: '',
|
158
|
+
status: '')
|
159
|
+
xml.lastmodified(toolname: '', toolversion: '', status: '')
|
160
|
+
xml.filepath(toolname: '', toolversion: '', status: '')
|
161
|
+
xml.filename(toolname: '', toolversion: '', status: '')
|
162
|
+
xml.md5checksum(toolname: '', toolversion: '', status: '')
|
163
|
+
xml.fslastmodified(toolname: '', toolversion: '', status: '')
|
163
164
|
}
|
164
165
|
xml.filestatus {
|
165
|
-
xml.tag! "well-formed", :
|
166
|
-
xml.valid(:
|
166
|
+
xml.tag! "well-formed", toolname: '', toolversion: '', status: ''
|
167
|
+
xml.valid(toolname: '', toolversion: '', status: '')
|
167
168
|
}
|
168
169
|
xml.metadata {
|
169
170
|
xml.document {
|
170
|
-
xml.title(:
|
171
|
-
xml.author(:
|
172
|
-
xml.pageCount(:
|
173
|
-
xml.isTagged(:
|
174
|
-
xml.hasOutline(:
|
175
|
-
xml.hasAnnotations(:
|
176
|
-
xml.isRightsManaged(:
|
177
|
-
:
|
178
|
-
xml.isProtected(:
|
179
|
-
xml.hasForms(:
|
171
|
+
xml.title(toolname: '', toolversion: '', status: '')
|
172
|
+
xml.author(toolname: '', toolversion: '', status: '')
|
173
|
+
xml.pageCount(toolname: '', toolversion: '')
|
174
|
+
xml.isTagged(toolname: '', toolversion: '')
|
175
|
+
xml.hasOutline(toolname: '', toolversion: '')
|
176
|
+
xml.hasAnnotations(toolname: '', toolversion: '')
|
177
|
+
xml.isRightsManaged(toolname: '', toolversion: '',
|
178
|
+
status: '')
|
179
|
+
xml.isProtected(toolname: '', toolversion: '')
|
180
|
+
xml.hasForms(toolname: '', toolversion: '', status: '')
|
180
181
|
}
|
181
182
|
}
|
182
183
|
}
|