aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/param.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/param.rb')
-rw-r--r--lib/sisu/v4/param.rb109
1 files changed, 69 insertions, 40 deletions
diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb
index e3742967..40f9b983 100644
--- a/lib/sisu/v4/param.rb
+++ b/lib/sisu/v4/param.rb
@@ -607,62 +607,52 @@ module SiSU_Param
end
self
end
- def classify
- a=@s.split(/(\n%\s.+?$|[ ]*)(?:\n[ ]*(?=:)|\Z)/m)
+ def identifier
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
- def coverage
- s=@h['coverage']
- l,n=Db[:col_classify_short],'classify.coverage'
+ def oclc
+ s=@h['oclc']
+ l,n=Db[:col_library],'identifier.oclc'
validate_length(s,l,n)
end
- def relation
- s=@h['relation']
- l,n=Db[:col_classify_short],'classify.short'
+ def isbn
+ s=@h['isbn']
+ l,n=Db[:col_small],'identifier.isbn'
validate_length(s,l,n)
end
- def subject
- s=@h['subject']
- l,n=Db[:col_classify_txt_short],'classify.subject'
+ def pg
+ s=@h['pg']
+ l,n=Db[:col_small],'identifier.pg'
validate_length(s,l,n)
end
+ self
+ end
+ def classify
+ a=@s.split(/(\n%\s.+?$|[ ]*)(?:\n[ ]*(?=:)|\Z)/m)
+ @h=build_hash(a)
def topic_register
s=@h['topic_register']
l,n=Db[:col_info_note],'classify.topic_register'
validate_length(s,l,n)
end
- def type
- s=@h['type']
- l,n=Db[:col_classify_txt_short],'classify.type'
+ def subject
+ s=@h['subject']
+ l,n=Db[:col_txt_long],'classify.subject'
validate_length(s,l,n)
end
- def identifier
- s=@h['identifier']
- l,n=Db[:col_classify_identify],'classify.identifier'
+ def keywords
+ s=@h['keywords']
+ l,n=Db[:col_txt_long],'classify.keywords'
validate_length(s,l,n)
end
def loc
s=@h['loc']
- l,n=Db[:col_classify_library],'classify.loc'
+ l,n=Db[:col_library],'classify.loc'
validate_length(s,l,n)
end
def dewey
s=@h['dewey']
- l,n=Db[:col_classify_library],'classify.dewey'
- validate_length(s,l,n)
- end
- def oclc
- s=@h['oclc']
- l,n=Db[:col_classify_library],'classify.oclc'
- validate_length(s,l,n)
- end
- def pg
- s=@h['pg']
- l,n=Db[:col_classify_small],'classify.pg'
- validate_length(s,l,n)
- end
- def isbn
- s=@h['isbn']
- l,n=Db[:col_classify_small],'classify.isbn'
+ l,n=Db[:col_library],'classify.dewey'
validate_length(s,l,n)
end
self
@@ -780,17 +770,50 @@ module SiSU_Param
def notes
a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
+ def description
+ s=@h['description']
+ l,n=Db[:col_info_note],'notes.description'
+ validate_length(s,l,n)
+ end
def abstract
- @h['abstract']
+ s=@h['abstract']
+ l,n=Db[:col_info_note],'notes.abstract'
+ validate_length(s,l,n)
end
def comment
- @h['comment']
+ s=@h['comment']
+ l,n=Db[:col_info_note],'notes.comment'
+ validate_length(s,l,n)
end
- def description
- @h['description']
+ def coverage
+ s=@h['coverage']
+ l,n=Db[:col_info_note],'notes.coverage'
+ validate_length(s,l,n)
+ end
+ def relation
+ s=@h['relation']
+ l,n=Db[:col_info_note],'notes.relation'
+ validate_length(s,l,n)
+ end
+ def source
+ s=@h['source']
+ l,n=Db[:col_txt_long],'notes.source'
+ validate_length(s,l,n)
end
def history
- @h['history']
+ s=@h['history']
+ l,n=Db[:col_txt_long],'notes.history'
+ validate_length(s,l,n)
+ end
+ def type
+ s=@h['type']
+ l,n=Db[:col_txt_long],'notes.relation'
+ validate_length(s,l,n)
+ end
+ def format
+ s=@h['format']
+ l,n=Db[:col_txt_short],'notes.format'
+ validate_length(s,l,n)
end
def prefix
@h['prefix']
@@ -1005,6 +1028,8 @@ module SiSU_Param
@rights=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).rights
when /^@classify:(.+)/m; classify=$1 #% * header metadata - classify
@classify=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).classify
+ when /^@identifier:(.+)/m; identify=$1 #% * header metadata - identifier
+ @identifier=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).identifier
when /^@original:(.+)/m #% * header metadata - original (document)
@original=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).original
@source=@original.source
@@ -1321,7 +1346,11 @@ module SiSU_Param
# end if @flv
@lang=@lang.uniq
@fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c])
- @identifier="#{@env.url.root}/#{@fnb}/#{@fn[:toc]}" #DC note constructed dc identifier
+ #if @identifier.is_a?(Array)
+ # @identifier[:sisupod]=sisupod_hash_value
+ #else @identifier={ sisupod: sisupod_hash_value }
+ #end
+ #"#{@env.url.root}/#{@fnb}/#{@fn[:toc]}" #DC note constructed dc identifier
if @en[:note] > 0 \
and @en[:sum] > 0
if @en[:sum] > 0