From 399e6eaa0597b59b20135da362da894e09630e8b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:17:56 -0400 Subject: v3: sql db, constants, cgi-sql, structure changed, creator.editor field added --- lib/sisu/v3/db_columns.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lib/sisu/v3/db_columns.rb') diff --git a/lib/sisu/v3/db_columns.rb b/lib/sisu/v3/db_columns.rb index d8a6f3cf..99118f92 100644 --- a/lib/sisu/v3/db_columns.rb +++ b/lib/sisu/v3/db_columns.rb @@ -273,6 +273,7 @@ module SiSU_DB_columns #% creator @creator: :author: + :editor: :contributor: :illustrator: :photographer: @@ -353,6 +354,34 @@ module SiSU_DB_columns end self end + def creator_editor + def name + 'creator_editor' + end + def create_column + "#{name} VARCHAR(#{Db[:col_name]}) NULL," + end + def column_comment + %{COMMENT ON COLUMN metadata_and_text.#{name} + IS 'metadata document editor name(s)';} + end + def tuple + t=if defined? @md.creator.editor_detail \ + and @md.creator.editor_detail.class==Array \ + and @md.creator.editor_detail.length > 0 + txt=@md.creator.editor_detail #dc + txt='' + @md.creator.editor_detail.each do |h| + txt=txt + %{#{h[:the]}, #{h[:others]}; } + end + txt.gsub!(/[;, ]+\s*$/,'') + special_character_escape(txt) + ["#{name}, ","'#{txt}', "] + else ['',''] + end + end + self + end def creator_contributor # DublinCore 6 - contributor def name 'creator_contributor' -- cgit v1.2.3