aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/manifest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/manifest.rb')
-rw-r--r--lib/sisu/v4/manifest.rb329
1 files changed, 169 insertions, 160 deletions
diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb
index 6f751a24..9c4fceb9 100644
--- a/lib/sisu/v4/manifest.rb
+++ b/lib/sisu/v4/manifest.rb
@@ -507,77 +507,58 @@ WOK
end
end
def metadata_tests
- if defined? @md.title.full \
- and @md.title.full=~/\S+/
- id,info=@translate.full_title,@md.title.full
- metadata(id,info)
- end
- if defined? @md.creator.author \
- and @md.creator.author=~/\S+/
- id,info=@translate.author,@md.creator.author
- metadata(id,info)
- end
- if defined? @md.creator.editor \
- and @md.creator.editor=~/\S+/
- id,info=@translate.editor,@md.creator.editor
- metadata(id,info)
- end
- if defined? @md.creator.contributor \
- and @md.creator.contributor=~/\S+/
- id,info=@translate.contributor,@md.creator.contributor
- metadata(id,info)
- end
- if defined? @md.creator.translator \
- and @md.creator.translator=~/\S+/
- id,info=@translate.translator,@md.creator.translator
- metadata(id,info)
- end
- if defined? @md.creator.illustrator \
- and @md.creator.illustrator=~/\S+/
- id,info=@translate.illustrator,@md.creator.illustrator
- metadata(id,info)
- end
- if defined? @md.publisher \
- and @md.publisher=~/\S+/ #dc
- id,info=@translate.publisher,@md.publisher
- metadata(id,info)
- end
- if defined? @md.creator.prepared_by \
- and @md.creator.prepared_by=~/\S+/
- id,info=@translate.prepared_by,@md.creator.prepared_by
- metadata(id,info)
- end
- if defined? @md.creator.digitized_by \
- and @md.creator.digitized_by=~/\S+/
- id,info=@translate.digitized_by,@md.creator.digitized_by
- metadata(id,info)
- end
- if defined? @md.classify.subject \
- and @md.classify.subject=~/\S+/
- id,info=@translate.subject,@md.classify.subject
- metadata(id,info)
- end
- if defined? @md.notes.description \
- and @md.notes.description=~/\S+/
- id,info=@translate.description,@md.notes.description
- metadata(id,info)
- end
- if defined? @md.notes.abstract \
- and @md.notes.abstract=~/\S+/
- id,info=@translate.abstract,@md.notes.abstract
- metadata(id,info)
+ if defined? @md.title #%
+ if defined? @md.title.full \
+ and @md.title.full=~/\S+/
+ id,info=@translate.full_title,@md.title.full
+ metadata(id,info)
+ end
end
- if defined? @md.type \
- and @md.type=~/\S+/ #dc
- id,info=@translate.type,@md.type
- metadata(id,info)
+ if defined? @md.creator #%
+ if defined? @md.creator.author \
+ and @md.creator.author=~/\S+/
+ id,info=@translate.author,@md.creator.author
+ metadata(id,info)
+ end
+ if defined? @md.creator.editor \
+ and @md.creator.editor=~/\S+/
+ id,info=@translate.editor,@md.creator.editor
+ metadata(id,info)
+ end
+ if defined? @md.creator.contributor \
+ and @md.creator.contributor=~/\S+/
+ id,info=@translate.contributor,@md.creator.contributor
+ metadata(id,info)
+ end
+ if defined? @md.creator.translator \
+ and @md.creator.translator=~/\S+/
+ id,info=@translate.translator,@md.creator.translator
+ metadata(id,info)
+ end
+ if defined? @md.creator.illustrator \
+ and @md.creator.illustrator=~/\S+/
+ id,info=@translate.illustrator,@md.creator.illustrator
+ metadata(id,info)
+ end
+ if defined? @md.creator.prepared_by \
+ and @md.creator.prepared_by=~/\S+/
+ id,info=@translate.prepared_by,@md.creator.prepared_by
+ metadata(id,info)
+ end
+ if defined? @md.creator.digitized_by \
+ and @md.creator.digitized_by=~/\S+/
+ id,info=@translate.digitized_by,@md.creator.digitized_by
+ metadata(id,info)
+ end
end
- if defined? @md.rights.all \
- and @md.rights.all=~/\S+/ #dc
- id,info=@translate.rights,@md.rights.all
- metadata(id,info)
+ if defined? @md.rights
+ if defined? @md.rights.all \
+ and @md.rights.all=~/\S+/ #dc
+ id,info=@translate.rights,@md.rights.all
+ metadata(id,info)
+ end
end
- if defined? @md.date.published
+ if defined? @md.date #%
if defined? @md.date.published \
and @md.date.published=~/\S+/ #dc
id,info=@translate.date,@md.date.published
@@ -609,108 +590,136 @@ WOK
metadata(id,info)
end
end
- if defined? @md.title.language \
- and @md.title.language=~/\S+/
- id,info=@translate.language,@md.title.language
- metadata(id,info)
- end
- if defined? @md.original.language \
- and @md.original.language=~/\S+/
- id,info=@translate.language_original,@md.original.language
- metadata(id,info)
- end
- if defined? @md.classify.format \
- and @md.classify.format=~/\S+/
- id,info=@transate.format,@md.classify.format
- metadata(id,info)
- end
- if defined? @md.classify.identifier \
- and @md.classify.identifier=~/\S+/
- id,info=@translate.identifier,@md.classify.identifier
- metadata(id,info)
- end
- if defined? @md.original.source \
- and @md.original.source=~/\S+/
- id,info=@translate.source,@md.original.source
- metadata(id,info)
- end
- if defined? @md.classify.relation \
- and @md.classify.relation=~/\S+/
- id,info=@translate.relation,@md.classify.relation
- metadata(id,info)
- end
- if defined? @md.classify.coverage \
- and @md.classify.coverage=~/\S+/
- id,info=@translate.coverage,@md.classify.coverage
- metadata(id,info)
- end
- if defined? @md.classify.keywords \
- and @md.classify.keywords=~/\S+/
- id,info=@translate.keywords,@md.classify.keywords
- metadata(id,info)
- end
- if defined? @md.notes.comment \
- and @md.notes.comment=~/\S+/
- id,info=@translate.comments,@md.notes.comment
- metadata(id,info)
- end
- if defined? @md.classify.loc \
- and @md.classify.loc=~/\S+/
- id,info=@translate.cls_loc,@md.classify.loc
- metadata(id,info)
- end
- if defined? @md.classify.dewey \
- and @md.classify.dewey=~/\S+/
- id,info=@translate.cls_dewey,@md.classify.dewey
- metadata(id,info)
- end
- if defined? @md.classify.oclc \
- and @md.classify.oclc=~/\S+/
- id,info=@translate.cls_oclc,@md.classify.oclc
- @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{id}:</p></th><td>\n}
- @manifest[:html] << %{<p class="left"><a href="http://worldcat.org/oclc/#{info}">#{info}</a></p>\n}
- @manifest[:html] << %{</td></tr>\n}
- end
- if defined? @md.classify.pg \
- and @md.classify.pg=~/\S+/
- id,info=@translate.cls_gutenberg,@md.classify.pg
- metadata(id,info)
- end
- if defined? @md.classify.isbn \
- and @md.classify.isbn=~/\S+/
- id,info=@translate.cls_isbn,@md.classify.isbn
+ if defined? @md.publisher \
+ and @md.publisher=~/\S+/ #dc
+ id,info=@translate.publisher,@md.publisher
metadata(id,info)
end
- if defined? @md.notes.prefix_a \
- and @md.notes.prefix_a=~/\S+/
- id,info=@translate.prefix_a,@md.notes.prefix_a
- metadata(id,info)
+ if defined? @md.notes #%
+ if defined? @md.notes.description \
+ and @md.notes.description=~/\S+/
+ id,info=@translate.description,@md.notes.description
+ metadata(id,info)
+ end
+ if defined? @md.notes.abstract \
+ and @md.notes.abstract=~/\S+/
+ id,info=@translate.abstract,@md.notes.abstract
+ metadata(id,info)
+ end
+ if defined? @md.notes.comment \
+ and @md.notes.comment=~/\S+/
+ id,info=@translate.comments,@md.notes.comment
+ metadata(id,info)
+ end
+ if defined? @md.notes.prefix_a \
+ and @md.notes.prefix_a=~/\S+/
+ id,info=@translate.prefix_a,@md.notes.prefix_a
+ metadata(id,info)
+ end
+ if defined? @md.notes.prefix_b \
+ and @md.notes.prefix_b=~/\S+/
+ id,info=@translate.prefix_b,@md.notes.prefix_b
+ metadata(id,info)
+ end
end
- if defined? @md.notes.prefix_b \
- and @md.notes.prefix_b=~/\S+/
- id,info=@translate.prefix_b,@md.notes.prefix_b
- metadata(id,info)
+ if defined? @md.title #%
+ if defined? @md.title.language \
+ and @md.title.language=~/\S+/
+ id,info=@translate.language,@md.title.language
+ metadata(id,info)
+ end
+ if defined? @md.original.language \
+ and @md.original.language=~/\S+/
+ id,info=@translate.language_original,@md.original.language
+ metadata(id,info)
+ end
end
- if defined? @md.topic_register_array \
- and @md.topic_register_array.length > 0
- @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{@translate.topic_register}:</p></th><td>\n}
- @md.topic_register_array.each do |t|
- t.each_with_index do |st,i|
- if st.is_a?(Array)
- st.each do |v|
- if v.is_a?(Array)
- v.each do |w,i|
- @manifest[:html] << %{<p class="it#{i}">#{w}</p>\n}
+ if defined? @md.classify #%
+ if defined? @md.topic_register_array \
+ and @md.topic_register_array.length > 0
+ @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{@translate.topic_register}:</p></th><td>\n}
+ @md.topic_register_array.each do |t|
+ t.each_with_index do |st,i|
+ if st.is_a?(Array)
+ st.each do |v|
+ if v.is_a?(Array)
+ v.each do |w,i|
+ @manifest[:html] << %{<p class="it#{i}">#{w}</p>\n}
+ end
+ else
+ @manifest[:html] << %{<p class="it#{i}">#{v}</p>\n}
end
- else
- @manifest[:html] << %{<p class="it#{i}">#{v}</p>\n}
end
+ else @manifest[:html] << %{<p class="it#{i}">#{st}</p>\n}
end
- else @manifest[:html] << %{<p class="it#{i}">#{st}</p>\n}
end
end
+ @manifest[:html] << %{</td></tr>\n}
+ end
+ if defined? @md.classify.subject \
+ and @md.classify.subject=~/\S+/
+ id,info=@translate.subject,@md.classify.subject
+ metadata(id,info)
+ end
+ if defined? @md.classify.keywords \
+ and @md.classify.keywords=~/\S+/
+ id,info=@translate.keywords,@md.classify.keywords
+ metadata(id,info)
+ end
+ if defined? @md.classify.loc \
+ and @md.classify.loc=~/\S+/
+ id,info=@translate.cls_loc,@md.classify.loc
+ metadata(id,info)
+ end
+ if defined? @md.classify.dewey \
+ and @md.classify.dewey=~/\S+/
+ id,info=@translate.cls_dewey,@md.classify.dewey
+ metadata(id,info)
+ end
+ if defined? @md.notes.coverage \
+ and @md.notes.coverage=~/\S+/
+ id,info=@translate.coverage,@md.notes.coverage
+ metadata(id,info)
+ end
+ if defined? @md.notes.relation \
+ and @md.notes.relation=~/\S+/
+ id,info=@translate.relation,@md.notes.relation
+ metadata(id,info)
end
- @manifest[:html] << %{</td></tr>\n}
+ if defined? @md.notes.type \
+ and @md.notes.type=~/\S+/ #dc
+ id,info=@translate.type,@md.notes.type
+ metadata(id,info)
+ end
+ if defined? @md.notes.format \
+ and @md.notes.format=~/\S+/
+ id,info=@transate.format,@md.notes.format
+ metadata(id,info)
+ end
+ end
+ if defined? @md.identifier #%
+ if defined? @md.identifier.oclc \
+ and @md.identifier.oclc=~/\S+/
+ id,info=@translate.cls_oclc,@md.identifier.oclc
+ @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{id}:</p></th><td>\n}
+ @manifest[:html] << %{<p class="left"><a href="http://worldcat.org/oclc/#{info}">#{info}</a></p>\n}
+ @manifest[:html] << %{</td></tr>\n}
+ end
+ if defined? @md.identifier.pg \
+ and @md.identifier.pg=~/\S+/
+ id,info=@translate.cls_gutenberg,@md.identifier.pg
+ metadata(id,info)
+ end
+ if defined? @md.identifier.isbn \
+ and @md.identifier.isbn=~/\S+/
+ id,info=@translate.cls_isbn,@md.identifier.isbn
+ metadata(id,info)
+ end
+ end
+ if defined? @md.original.source \
+ and @md.original.source=~/\S+/
+ id,info=@translate.source,@md.original.source
+ metadata(id,info)
end
if @md.fns
id,info=@translate.sourcefile,@md.fns