From fb20770a4b7f21e6f8b2ef975b0a77eab637ff50 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 9 Oct 2010 22:54:08 -0400 Subject: param, metadata rights, keep colon separator from interfering with urls (+changelog) --- CHANGELOG_v2 | 2 ++ data/doc/sisu/v2/CHANGELOG | 2 ++ lib/sisu/v2/param.rb | 44 ++++++++++++++++++++++++++++++++------------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/CHANGELOG_v2 b/CHANGELOG_v2 index d27ff32d..fbe60bf4 100644 --- a/CHANGELOG_v2 +++ b/CHANGELOG_v2 @@ -27,6 +27,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.5.orig.tar.gz * shared_metadata, fix cornercase odt document breakage when matching and representing " ", "&" and urls in metadata + * param, metadata rights, keep colon separator from interfering with urls + %% 2.7.4.orig.tar.gz (2010-10-08:40/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.4.orig.tar.gz 3d36b407f7f2df7b260f0a7932adf520a0539f8578dac59c6ca6de3bbfd03e62 2743433 sisu_2.7.4.orig.tar.gz diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG index 6f8b3edf..da409f26 100644 --- a/data/doc/sisu/v2/CHANGELOG +++ b/data/doc/sisu/v2/CHANGELOG @@ -27,6 +27,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.5.orig.tar.gz * shared_metadata, fix cornercase odt document breakage when matching and representing " ", "&" and urls in metadata + * param, metadata rights, keep colon separator from interfering with urls + %% 2.7.4.orig.tar.gz (2010-10-08:40/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.4.orig.tar.gz 3d36b407f7f2df7b260f0a7932adf520a0539f8578dac59c6ca6de3bbfd03e62 2743433 sisu_2.7.4.orig.tar.gz diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index b44a5b8e..78cad7c6 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -427,32 +427,52 @@ module SiSU_Param l,n=Db[:col_info_note],'rights.license' validate_length(s,l,n) end + def sep(str) + (str =~/https?:\/\/\S+$/) ? ' ;' : ';' + end def all s=if @h['all']; @h['all'] else - s=copyright.text + ';' + s='' + if defined? copyright.text \ + and copyright.text \ + and not copyright.text.empty? + v=sep(copyright.text) + s +=copyright.text + v + end if defined? copyright.translation \ - and copyright.translation - s +='
translation ' + copyright.translation + ';' + and copyright.translation \ + and not copyright.translation.empty? + v=sep(copyright.translation) + s +='
translation ' + copyright.translation + v end if defined? copyright.illustrations \ - and copyright.illustrations - s +='
illustrations ' + copyright.illustrations + ';' + and copyright.illustrations \ + and not copyright.illustrations.empty? + v=sep(copyright.illustrations) + s +='
illustrations ' + copyright.illustrations + v end if defined? copyright.photographs \ - and copyright.photographs - s +='
photographs ' + copyright.photographs + ';' + and copyright.photographs \ + and not copyright.photographs.empty? + v=sep(copyright.photographs) + s +='
photographs ' + copyright.photographs + v end if defined? copyright.digitization \ - and copyright.digitization - s +='
digitization ' + copyright.digitization + ';' + and copyright.digitization \ + and not copyright.digitization.empty? + v=sep(copyright.digitization) + s +='
digitization ' + copyright.digitization + v end if defined? copyright.audio \ - and copyright.audio - s +='
audio ' + copyright.audio + ';' + and copyright.audio \ + and not copyright.audio.empty? + v=sep(copyright.audio) + s +='
audio ' + copyright.audio + v end if defined? copyright.license \ - and copyright.license + and copyright.license \ + and not copyright.license.empty? s +='
License: ' + copyright.license end if s.empty? -- cgit v1.2.3