From 3993be7dfe7097abfb00ff2b685ca0dc47acfe09 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 16 Jul 2007 12:46:18 +0100 Subject: refactoring, tidy --- lib/sisu/v0/db_import.rb | 180 +++++++++++++++++++++++------------------------ 1 file changed, 87 insertions(+), 93 deletions(-) diff --git a/lib/sisu/v0/db_import.rb b/lib/sisu/v0/db_import.rb index b9528063..91360613 100644 --- a/lib/sisu/v0/db_import.rb +++ b/lib/sisu/v0/db_import.rb @@ -364,23 +364,15 @@ module SiSU_DB_import if data[/^([123])~\s+(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] @col[:lev],txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6,$7 @col[:lid]+=1 - if txt =~/~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') + if txt =~/~[{\[][*+]?(\d+)\s+.+?[}\]]~/ + endnotes(txt).range + if txt =~/~\{.+?\}~/; @en << endnotes(txt).standard + end + if txt =~/~\[\*.+?\]~/; @en_ast << endnotes(txt).asterisk + end + if txt =~/~\[\+.+?\]~/; @en_pls << endnotes(txt).plus + end + txt=endnotes(txt).clean_text end @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,txt,@col).lev4_minus special_character_escape(@col[:body]) @@ -412,23 +404,15 @@ module SiSU_DB_import end @env=SiSU_Env::Info_env.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#@hname.html" - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,%{\\1}) - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,%{\\1}) - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,%{\\1}) + if txt =~/~[{\[][*+]?(\d+)\s+.+?[}\]]~/ + endnotes(txt).range + if txt =~ /~\{.+?\}~/; @en << endnotes(txt).standard + end + if txt =~/~\[\*.+?\]~/; @en_ast << endnotes(txt).asterisk + end + if txt =~/~\[\+.+?\]~/; @en_pls << endnotes(txt).plus + end + txt=endnotes(txt).clean_text(@base_url) end @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,txt,@col).lev4_plus special_character_escape(@col[:body]) @@ -458,23 +442,15 @@ module SiSU_DB_import end @env=SiSU_Env::Info_env.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#@hname.html" - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,%{\\1}) - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,%{\\1}) - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,%{\\1}) + if txt =~/~[{\[][*+]?(\d+)\s+.+?[}\]]~/ + endnotes(txt).range + if txt =~ /~\{.+?\}~/; @en << endnotes(txt).standard + end + if txt =~/~\[\*.+?\]~/; @en_ast << endnotes(txt).asterisk + end + if txt =~/~\[\+.+?\]~/; @en_pls << endnotes(txt).plus + end + txt=endnotes(txt).clean_text(@base_url) end @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,txt,@col).lev4_plus special_character_escape(@col[:body]) @@ -504,23 +480,15 @@ module SiSU_DB_import end @env=SiSU_Env::Info_env.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#@hname.html" - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,%{\\1}) - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,%{\\1}) - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,%{\\1}) + if txt =~/~[{\[][*+]?(\d+)\s+.+?[}\]]~/ + endnotes(txt).range + if txt =~ /~\{.+?\}~/; @en << endnotes(txt).standard + end + if txt =~/~\[\*.+?\]~/; @en_ast << endnotes(txt).asterisk + end + if txt =~/~\[\+.+?\]~/; @en_pls << endnotes(txt).plus + end + txt=endnotes(txt).clean_text(@base_url) end @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,txt,@col).lev4_plus special_character_escape(@col[:body]) @@ -545,24 +513,15 @@ module SiSU_DB_import end @env=SiSU_Env::Info_env.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#@hname.html" - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,%{\\1}) - #txt.gsub!(/~\{(\d+).+?\}~/,'^[\1]') # remove endnote, keep endnote reference number, display as, e.g. [^1] - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,%{\\1}) - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,%{\\1}) + if txt =~/~[{\[][*+]?(\d+)\s+.+?[}\]]~/ + endnotes(txt).range + if txt =~ /~\{.+?\}~/; @en << endnotes(txt).standard + end + if txt =~/~\[\*.+?\]~/; @en_ast << endnotes(txt).asterisk + end + if txt =~/~\[\+.+?\]~/; @en_pls << endnotes(txt).plus + end + txt=endnotes(txt).clean_text(@base_url) end if @sql_type=~/pg/ and txt.size > (document_clean - 1) #% examine pg build & remove limitation puts "\n\nTOO LARGE (TXT - see error log)\n\n" @@ -688,15 +647,50 @@ module SiSU_DB_import ensure end end - def endnote_range(word_array) - @col[:en_a]=@col[:en_z]=nil - word_array.each do |w| - if w[/~[{\[][*+]?(\d+)\s+.+?[}\]]~/] # not tested since change 2003w31 - @col[:en_a]=$1 unless @col[:en_a] - @col[:en_z]=@col[:en_a].dup unless @col[:en_a] - @col[:en_z]=$1 if @col[:en_a] + def endnotes(txt) + @txt=txt + def standard + x=if @txt =~ /~\{.+?\}~/; @txt.scan(/~\{(\d+).+?\}~/) + else nil + end + end + def asterisk + x=if @txt =~/~\[\*.+?\]~/; @txt.scan(/~\[[*](\d+).+?\]~/) + else nil + end + end + def plus + x=if @txt =~/~\[\+.+?\]~/; @txt.scan(/~\[[+](\d+).+?\]~/) + else nil + end + end + def clean_text(base_url=nil) + if base_url + @txt.gsub!(/~\{(\d+).+?\}~/,%{\\1}) + @txt.gsub!(/~\[([*]\d+).+?\]~/,%{\\1}) + @txt.gsub!(/~\[([+]\d+).+?\]~/,%{\\1}) + else + @txt.gsub!(/~\{(\d+).+?\}~/,'\1') + @txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') + @txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') + end + @txt + end + def range + @col[:en_a]=@col[:en_z]=nil + if @txt =~ /~\{.+?\}~|~\[([*]\d+).+?\]~|~\[([+]\d+).+?\]~/ + word_array=@txt.scan(/\S+/) + word_array.each do |w| + if w[/~[{\[][*+]?(\d+)\s+.+?[}\]]~/] # not tested since change 2003w31 + @col[:en_a]=$1 unless @col[:en_a] + @col[:en_z]=@col[:en_a].dup unless @col[:en_a] + @col[:en_z]=$1 if @col[:en_a] + end + end end + @col end + self end def import_db_urls(dbi_unit,meta) #% import documents OID - populate database begin -- cgit v1.2.3 From 7b15f4d032cbc8e0a313a48095373216a942ede9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 16 Jul 2007 12:50:53 +0100 Subject: cgi_sql_common, generated sample search form, indentation --- lib/sisu/v0/cgi_sql_common.rb | 304 +++++++++++++++++++++--------------------- 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index 50fce2fc..633be166 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -488,7 +488,7 @@ module SiSU_CGI_sql end else if page.to_s =~ /^1$/; '' - elsif /^[2]$/ + elsif page.to_s =~ /^2$/ %{

<<  @@ -749,178 +749,178 @@ module SiSU_CGI_sql #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} WOK - #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} - #dbi_canning - @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form - unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ - print "Content-type: text/html\n\n" - puts (@header+@tail) - else #% searches - s1=if @search_for.text1 =~/\S/ - @search_for.text1 - else 'Unavailable' + #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} + #dbi_canning + @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form + unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ + print "Content-type: text/html\n\n" + puts (@header+@tail) + else #% searches + s1=if @search_for.text1 =~/\S/ + @search_for.text1 + else 'Unavailable' + end + if checked_case=~/\S/ + @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} + else + @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + end + #dbi_request + dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case) + @text_search_flag=false + @text_search_flag=dbi_statement.text_search_flag + s_contents=dbi_statement.contents + s_endnotes=dbi_statement.endnotes + @body_main,@endnotes=[],[] + @search_regx=nil + oldtid=0 + if @text_search_flag + if checked_sql =~/\S/ + sql_select_body=dbi_statement.sql_select_body_format + sql_select_endnotes=dbi_statement.sql_select_endnotes_format + else sql_select_body,sql_select_endnotes='','' end - if checked_case=~/\S/ - @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'} - @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} - else - @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} - @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + @body_main << '



Main Text:
' << sql_select_body + @endnotes << '



Endnotes:
' << sql_select_endnotes + else + end + #text_objects_body + s_contents.each do |c| #% text body + location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' end - #dbi_request - dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case) - @text_search_flag=false - @text_search_flag=dbi_statement.text_search_flag - s_contents=dbi_statement.contents - s_endnotes=dbi_statement.endnotes - @body_main,@endnotes=[],[] - @search_regx=nil - oldtid=0 - if @text_search_flag - if checked_sql =~/\S/ - sql_select_body=dbi_statement.sql_select_body_format - sql_select_endnotes=dbi_statement.sql_select_endnotes_format - else sql_select_body,sql_select_endnotes='','' + #metadata_found_body + if c['tid'].to_i != oldtid.to_i + ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}" + else c['title'] end - @body_main << '



Main Text:
' << sql_select_body - @endnotes << '



Endnotes:
' << sql_select_endnotes - else - end - #text_objects_body - s_contents.each do |c| #% text body - location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] - file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1] - lang=if location =~ /\S+?~(\S\S\S?)$/ - l=location[/\S+?~(\S\S\S?)$/,1] - location.gsub!(/(\S+?)~\S\S\S?/,'\1') - l=".#{l}" - else '' + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } end - #metadata_found_body - if c['tid'].to_i != oldtid.to_i - ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}" - else c['title'] - end - can_txt_srch=if cgi['view']=~/index/; %{red bullet } - else %{red bullet } - end - title=%{toc html #{ti} by #{c['creator']} #{can_txt_srch}toc html pdf portrait pdf landscape odf manifest
} if file_suffix=~/s/ #hmm watch file_suffix - if @text_search_flag; title='

'+title - else title='
'+title - end - @counter_txt_doc+=1 - oldtid=c['tid'].to_i - else title='' + title=%{toc html #{ti} by #{c['creator']} #{can_txt_srch}toc html pdf portrait pdf landscape odf manifest
} if file_suffix=~/s/ #hmm watch file_suffix + if @text_search_flag; title='

'+title + else title='
'+title end - if @text_search_flag - if cgi['view']=~/text/ #% txt body - text=if c['suffix'] !~/1/ #seg - if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! - unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1) - elsif q['s1'] =~/\S+/; CGI.unescape(q['s1']) - else nil - end - @search_regx=if unescaped_search #check - search_regex=[] - build=unescaped_search.scan(/\S+/).each do |g| - if g.to_s =~/(AND|OR)/ - search_regex << '|' - else search_regex << %{#{g.to_s}} - end - end - search_regex=search_regex.join(' ') - search_regex=search_regex.gsub(/\s*\|\s*/,'|') - Regexp.new(search_regex, Regexp::IGNORECASE) - else nil - end + @counter_txt_doc+=1 + oldtid=c['tid'].to_i + else title='' + end + if @text_search_flag + if cgi['view']=~/text/ #% txt body + text=if c['suffix'] !~/1/ #seg + if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! + unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1) + elsif q['s1'] =~/\S+/; CGI.unescape(q['s1']) else nil end - matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) - matched=c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) - else c['body'] + @search_regx=if unescaped_search #check + search_regex=[] + build=unescaped_search.scan(/\S+/).each do |g| + if g.to_s =~/(AND|OR)/ + search_regex << '|' + else search_regex << %{#{g.to_s}} + end + end + search_regex=search_regex.join(' ') + search_regex=search_regex.gsub(/\s*\|\s*/,'|') + Regexp.new(search_regex, Regexp::IGNORECASE) + else nil end - %{

ocn #{c['ocn']}:

#{matched_para}} - elsif c['suffix'] =~/1/ #doc - %{#{title}

ocn #{c['ocn']}:#{c['body']}} + else nil end - @counter_txt_ocn+=1 - output=if c['seg'] =~/\S+/; title+text - else text - end - elsif cgi['view']=~/index/ #% idx body - if c['suffix'] !~/1/ #seg - index=%{#{c['ocn']}, } if @text_search_flag - elsif c['suffix'] =~/1/ #doc - index=%{#{c['ocn']}, } + matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else c['body'] end - if c['seg'] =~/\S+/ - if @text_search_flag - @counter_txt_ocn+=1 - output=title+index - end - else + %{


ocn #{c['ocn']}:

#{matched_para}} + elsif c['suffix'] =~/1/ #doc + %{#{title}

ocn #{c['ocn']}:#{c['body']}} + end + @counter_txt_ocn+=1 + output=if c['seg'] =~/\S+/; title+text + else text + end + elsif cgi['view']=~/index/ #% idx body + if c['suffix'] !~/1/ #seg + index=%{#{c['ocn']}, } if @text_search_flag + elsif c['suffix'] =~/1/ #doc + index=%{#{c['ocn']}, } + end + if c['seg'] =~/\S+/ + if @text_search_flag @counter_txt_ocn+=1 - output=unless c['suffix'] =~/1/; title+index - else %{#{title}#{c['ocn'].sort}, } - end + output=title+index end - end - else output=title - end - @counters_txt=if @counter_txt_doc > 0 - if checked_stats =~/\S/ - @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i - over='over' - true - else - over='' - false + else + @counter_txt_ocn+=1 + output=unless c['suffix'] =~/1/; title+index + else %{#{title}#{c['ocn'].sort}, } end - %{


Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} - else '' end - else '' end - @body_main << output #+ details + else output=title end - #text_objects_endnote - oldtid = 0 - s_endnotes.each do |e| #% endnotes - location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] - file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1] - lang=if location =~ /\S+?~(\S\S\S?)$/ - l=location[/\S+?~(\S\S\S?)$/,1] - location.gsub!(/(\S+?)~\S\S\S?/,'\1') - l=".#{l}" + @counters_txt=if @counter_txt_doc > 0 + if checked_stats =~/\S/ + @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i + over='over' + true + else + over='' + false + end + %{
Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} else '' end + else '' + end + @body_main << output #+ details + end + #text_objects_endnote + oldtid = 0 + s_endnotes.each do |e| #% endnotes + location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end #metadata_found_endnotes - if @text_search_flag - if e['metadata_tid'].to_i != oldtid.to_i - ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}" - else e['title'] - end - can_txt_srch=if cgi['view']=~/index/; %{red bullet } - else %{red bullet } - end - title=%{

toc html #{ti} by #{e['creator']} #{can_txt_srch}toc html pdf portraitpdf landscape odf manifest
} if file_suffix=~/s/ - @counter_endn_doc+=1 - oldtid=e['metadata_tid'].to_i - else title = '' + if @text_search_flag + if e['metadata_tid'].to_i != oldtid.to_i + ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}" + else e['title'] end - if cgi['view']=~/text/ #% txt endnotes - @counter_endn_ocn+=1 - matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) - matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) - else e['body'] - end - output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} - elsif cgi['view']=~/index/ #% idx endnotes - @counter_endn_ocn+=1 - output=%{#{title}#{e['nr']}#{e['ocn']}], } + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } + end + title=%{

toc html #{ti} by #{e['creator']} #{can_txt_srch}toc html pdf portrait pdf landscape odf manifest
} if file_suffix=~/s/ + @counter_endn_doc+=1 + oldtid=e['metadata_tid'].to_i + else title = '' + end + if cgi['view']=~/text/ #% txt endnotes + @counter_endn_ocn+=1 + matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else e['body'] end - @counters_endn=if @counter_endn_doc > 0 - if checked_stats =~/\S/ + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + elsif cgi['view']=~/index/ #% idx endnotes + @counter_endn_ocn+=1 + output=%{#{title}#{e['nr']}#{e['ocn']}], } + end + @counters_endn=if @counter_endn_doc > 0 + if checked_stats =~/\S/ @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i over='over' true -- cgit v1.2.3 From 1aac76e1431d796c1df1cabd0124d3dbb174e750 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 16 Jul 2007 12:55:09 +0100 Subject: scope in matches of individual documents where AND is used as text matching criteria --- CHANGELOG | 18 +++++++++++++++--- lib/sisu/v0/cgi_pgsql.rb | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9c4cafd0..518b0640 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,11 +6,23 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.55.4.orig.tar.gz (2007-07-21:29/6) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.4.orig.tar.gz + sisu_0.55.4.orig.tar.gz + sisu_0.55.4-1.dsc + sisu_0.55.4-1.diff.gz + + * db import, minor refactor + + * cgi fixes + * search form pre/next + * scope for matches in individual documents + %% sisu_0.55.3.orig.tar.gz (2007-07-14:28/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.3.orig.tar.gz - sisu_0.55.3.orig.tar.gz - sisu_0.55.3-1.dsc - sisu_0.55.3-1.diff.gz + d540a4f656393449c5f4ad5b7a5b5245 1267096 sisu_0.55.3.orig.tar.gz + a0c2e3c6ab5e59c9e675ae48ed2582cb 606 sisu_0.55.3-1.dsc + 9e0ae70f83fa29c10aaf8a9626aaed8e 142063 sisu_0.55.3-1.diff.gz * url * matching improved diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index b3a7a82b..d4c620a5 100644 --- a/lib/sisu/v0/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -173,7 +173,7 @@ module SiSU_CGI_pgsql #% search[:text].each{|x| @search_text << "#{x} AND " } @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(documents\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') + @search_text.gsub!(/(documents\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)') search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') -- cgit v1.2.3 From 54e91dad80eb2235214bf69ca0977b5513258ccd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 20 Jul 2007 07:39:01 +0100 Subject: output comment on better reliance on standards and being software libre --- CHANGELOG | 4 ++-- lib/sisu/v0/cgi_sql_common.rb | 6 +++--- lib/sisu/v0/defaults.rb | 4 ++-- lib/sisu/v0/texpdf_format.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 518b0640..7e5a2289 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,13 +6,13 @@ Reverse Chronological: %% STABLE MANIFEST -%% sisu_0.55.4.orig.tar.gz (2007-07-21:29/6) +%% sisu_0.55.4.orig.tar.gz (2007-07-20:29/5) http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.4.orig.tar.gz sisu_0.55.4.orig.tar.gz sisu_0.55.4-1.dsc sisu_0.55.4-1.diff.gz - * db import, minor refactor + * db import, minor refactoring * cgi fixes * search form pre/next diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index 633be166..ac2958d1 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -593,8 +593,8 @@ module SiSU_CGI_sql software infrastructure, with the usual GPL (or OSS) suspects.
- Better - "performance, reliability, scalability, security & total cost of ownership" - [not to mention flexibility & choice] + Better - "adherence to standards, performance, reliability, scalability, security & total cost of ownership" + [not to mention flexibility & choice] and it is software libre.
Get With the Future @@ -701,7 +701,7 @@ module SiSU_CGI_sql end canned_note='search url:' else - @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index" + @@canned_search_url="#@base?db=#{@db}&view=index" canned_note='search url example:' end if search_field =~/\S+/ diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb index 6585e700..4963e882 100644 --- a/lib/sisu/v0/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -1397,8 +1397,8 @@ WOK software infrastructure, with the usual GPL (or OSS) suspects.
- Better - "performance, reliability, scalability, security & total cost of ownership" - [not to mention flexibility & choice] + Better - "adherence to standards, performance, reliability, scalability, security & total cost of ownership" + [not to mention flexibility & choice] and it is software libre.
Get With the Future
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 72cd3932..4a8d2cb5 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -947,7 +947,7 @@ WOK lastdone="Last Generated on: #{Time.now}" rubyv="Ruby version: #{@md.ruby_version}" < Date: Fri, 20 Jul 2007 07:42:20 +0100 Subject: changelog and version updated --- conf/sisu/version.yml | 6 +++--- data/doc/sisu/CHANGELOG | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/conf/sisu/version.yml b/conf/sisu/version.yml index 61ff519d..88590b9c 100644 --- a/conf/sisu/version.yml +++ b/conf/sisu/version.yml @@ -1,5 +1,5 @@ --- -:date_stamp: 2007w28/6 -:date: "2007-07-14" +:date_stamp: 2007w29/5 +:date: "2007-07-20" :project: SiSU -:version: 0.55.3 +:version: 0.55.4 diff --git a/data/doc/sisu/CHANGELOG b/data/doc/sisu/CHANGELOG index 9c4cafd0..7e5a2289 100644 --- a/data/doc/sisu/CHANGELOG +++ b/data/doc/sisu/CHANGELOG @@ -6,11 +6,23 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.55.4.orig.tar.gz (2007-07-20:29/5) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.4.orig.tar.gz + sisu_0.55.4.orig.tar.gz + sisu_0.55.4-1.dsc + sisu_0.55.4-1.diff.gz + + * db import, minor refactoring + + * cgi fixes + * search form pre/next + * scope for matches in individual documents + %% sisu_0.55.3.orig.tar.gz (2007-07-14:28/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.3.orig.tar.gz - sisu_0.55.3.orig.tar.gz - sisu_0.55.3-1.dsc - sisu_0.55.3-1.diff.gz + d540a4f656393449c5f4ad5b7a5b5245 1267096 sisu_0.55.3.orig.tar.gz + a0c2e3c6ab5e59c9e675ae48ed2582cb 606 sisu_0.55.3-1.dsc + 9e0ae70f83fa29c10aaf8a9626aaed8e 142063 sisu_0.55.3-1.diff.gz * url * matching improved -- cgit v1.2.3