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(-) (limited to 'lib') 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(-) (limited to 'lib') 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 --- lib/sisu/v0/cgi_pgsql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 --- lib/sisu/v0/cgi_sql_common.rb | 6 +++--- lib/sisu/v0/defaults.rb | 4 ++-- lib/sisu/v0/texpdf_format.rb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') 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}" <