diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-03-31 19:45:04 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-03-31 19:45:04 -0400 |
commit | 9ec3ebbcab149c92fada936fe7af6d91672a0908 (patch) | |
tree | 60b650949f8c0440895d790a4355e8f8ae1260d4 /lib | |
parent | debian/changelog (2.0.4-1) (diff) | |
parent | update: changelog, version (2.0.5) (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v1/cgi_sql_common.rb | 26 | ||||
-rw-r--r-- | lib/sisu/v1/harvest_topics.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v2/cgi_pgsql.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v2/cgi_sql_common.rb | 27 | ||||
-rw-r--r-- | lib/sisu/v2/db_create.rb | 17 | ||||
-rw-r--r-- | lib/sisu/v2/harvest_authors.rb | 46 | ||||
-rw-r--r-- | lib/sisu/v2/harvest_topics.rb | 54 | ||||
-rw-r--r-- | lib/sisu/v2/sysenv.rb | 5 |
8 files changed, 101 insertions, 96 deletions
diff --git a/lib/sisu/v1/cgi_sql_common.rb b/lib/sisu/v1/cgi_sql_common.rb index 9900ff43..5b2ef9b2 100644 --- a/lib/sisu/v1/cgi_sql_common.rb +++ b/lib/sisu/v1/cgi_sql_common.rb @@ -285,8 +285,8 @@ module SiSU_CGI_sql @date_available=q['dta'] if q['dta']=~/\S/ @date_valid=q['dtv'] if q['dtv']=~/\S/ @filename=if q['doc'] and q['search'] !~/search db/; q['doc'] - elsif q['fns']=~/\S/; q['fns']ยท - end + elsif q['fns']=~/\S/; q['fns'] + end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 end @@ -448,7 +448,9 @@ module SiSU_CGI_sql @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s end def previous - @offset_previous >= 0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '' + @offset_previous >= 0 \ + ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \ + : '' end def start @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s @@ -877,14 +879,15 @@ module SiSU_CGI_sql 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' + @@lt_t=if @counter_txt_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{<hr /><font size="2" color="#666666">Found in the main body of #{@counter_txt_doc} documents, and at #{over} #{@counter_txt_ocn} locations within.</font><br />} + %{<hr /><font size="2" color="#666666">Found in the main body of #{over_this_number} #{@counter_txt_doc} documents, and at #{over_limit} #{@counter_txt_ocn} locations within.</font><br />} else '' end else '' @@ -930,14 +933,15 @@ module SiSU_CGI_sql 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' + @@lt_e=if @counter_endn_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{<font size="2" color="#666666">Found in the endnotes of #{@counter_endn_doc} documents, and at #{over} #{@counter_endn_ocn} locations within.</font><br />} + %{<font size="2" color="#666666">Found in the endnotes of #{over_this_number} #{@counter_endn_doc} documents, and at #{over_limit} #{@counter_endn_ocn} locations within.</font><br />} else '' end end diff --git a/lib/sisu/v1/harvest_topics.rb b/lib/sisu/v1/harvest_topics.rb index 3ebd2da6..2ac181d0 100644 --- a/lib/sisu/v1/harvest_topics.rb +++ b/lib/sisu/v1/harvest_topics.rb @@ -91,7 +91,7 @@ module HARVEST_topics idx_array=HARVEST_topics::Harvest.new(file_array,filename,idx_array).extract_harvest end the_idx=HARVEST_topics::Index.new(idx_array,@@the_idx_topics).construct_book_topic_index - #HARVEST_topics::Output_index.new(the_idx).screen_print.cycle + #HARVEST_topics::Output_index.new('',the_idx).screen_print.cycle if @opt.cmd.inspect =~/[VM]/ HARVEST_topics::Output_index.new(@opt,the_idx).html_print.html_songsheet puts "file://#{@env.path.output_md_harvest}/harvest_topics.html" puts "file://#{@env.path.pwd}/harvest_topics.html" if @opt.cmd.inspect =~/-M/ @@ -125,7 +125,9 @@ module HARVEST_topics break if @title and @subtitle and @author and @idx_lst end @fulltitle=@subtitle ? (@title + ' - ' + @subtitle) : @title - if @title and @author_format and @idx_list + if @title \ + and @author_format \ + and @idx_list creator=FORMAT::Author.new(@author_format.strip).author_details @authors,@authorship=creator[:authors],creator[:authorship] file=if filename=~/~[a-z]{2,3}\.ss[mt]$/ @@ -141,10 +143,10 @@ module HARVEST_topics idxl=[] g.each do |i| i.strip! - idxl << { :filename => filename, :file => file, :rough_idx => i, :title => @fulltitle, :author => creator, :page => page} + idxl << { :filename =>filename,:file =>file,:rough_idx =>i,:title =>@fulltitle,:author =>creator,:page =>page} end idxl - else { :filename => filename, :file => file, :rough_idx => @idx_list, :title => @fulltitle, :author => creator, :page => page } + else { :filename =>filename,:file =>file,:rough_idx =>@idx_list,:title =>@fulltitle,:author =>creator,:page =>page} end else p "missing author field: #@filename title: #@title; author: #@author_format; idx: #@idx_list" @@ -167,7 +169,7 @@ module HARVEST_topics s=n.sub(/(.+?)(?:,.+|$)/,'\1').gsub(/\s+/,'_') names += %{<a href="harvest_authors.html##{s}">#{n}</a>, } end - hash << { :filename => idx[:filename], :file => idx[:file], :author => names, :title => idx[:title], :page => idx[:page] } + hash << { :filename =>idx[:filename],:file =>idx[:file],:author =>names,:title =>idx[:title],:page =>idx[:page]} end def construct_book_topic_index idx_array=@idx_array diff --git a/lib/sisu/v2/cgi_pgsql.rb b/lib/sisu/v2/cgi_pgsql.rb index bc47b0bc..db2d8267 100644 --- a/lib/sisu/v2/cgi_pgsql.rb +++ b/lib/sisu/v2/cgi_pgsql.rb @@ -68,6 +68,7 @@ module SiSU_CGI_pgsql @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) @db=SiSU_Env::Info_db.new + @cgi_file_name="sisu_#{SiSU_version_dir}_pgsql.cgi" end def pgsql serve=[] @@ -93,7 +94,7 @@ module SiSU_CGI_pgsql end f2 << " end\n" if FileTest.writable?('.') - output=File.open('sisu_pgsql.cgi','w') + output=File.open(@cgi_file_name,'w') output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons1_pgsql << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2 a=%{ generated sisu_pgsql.cgi, BASED ON ALREADY EXISTING directories that could potentially be used to populate postgresql db, (-D) @@ -103,9 +104,10 @@ module SiSU_CGI_pgsql c=case @webserv when /pwd/; '' else "if necessary make the directory /usr/lib/cgi-bin : - sudo cp -vi #{Dir.pwd}/sisu_pgsql.cgi /usr/lib/cgi-bin/. - sudo chmod -v 755 /usr/lib/cgi-bin/sisu_pgsql.cgi - (copy sisu_pgsql.cgi to your cgi directory) and set file permissions to 755" + sudo cp -vi #{Dir.pwd}/#{@cgi_file_name} /usr/lib/cgi-bin/. + sudo chmod -v 755 /usr/lib/cgi-bin/#{@cgi_file_name} + sudo ln -s /usr/lib/cgi-bin/#{@cgi_file_name} /usr/lib/cgi-bin/sisu_pgsql.cgi + (copy #{@cgi_file_name} to your cgi directory) set file permissions to 755, and make symbolic link to sisu_pgsql.cgi" end a=%{#{c} #{@env.webserv_base_cgi}/cgi-bin/sisu_pgsql.cgi diff --git a/lib/sisu/v2/cgi_sql_common.rb b/lib/sisu/v2/cgi_sql_common.rb index f7b035db..0c3977c4 100644 --- a/lib/sisu/v2/cgi_sql_common.rb +++ b/lib/sisu/v2/cgi_sql_common.rb @@ -282,7 +282,7 @@ module SiSU_CGI_sql @date_modified=q['dtm'] if q['dtm']=~/\S/ @date_available=q['dta'] if q['dta']=~/\S/ @date_valid=q['dtv'] if q['dtv']=~/\S/ - @filename=if q['doc'] and q['search'] !~/search db/; q['doc'] #if q['doc']; q['doc'] + @filename=if q['doc'] and q['search'] !~/search db/; q['doc'] elsif q['fns']=~/\S/; q['fns'] end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@ -446,7 +446,9 @@ module SiSU_CGI_sql @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s end def previous - @offset_previous >= (0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '') + @offset_previous >= 0 \ + ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \ + : '' end def start @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s @@ -851,9 +853,6 @@ module SiSU_CGI_sql end @counter_txt_ocn+=1 output=title+text - #output=if c['seg'] =~/\S+/; title+text - #else text #check - #end else #elsif cgi['view']=~/index/ #% idx body if c['suffix'] !~/1/ #seg index=%{<a href="#{@hosturl_files}/#{@stub}/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag @@ -876,14 +875,15 @@ module SiSU_CGI_sql 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' + @@lt_t=if @counter_txt_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{<hr /><font size="2" color="#666666">Found in the main body of #{@counter_txt_doc} documents, and at #{over} #{@counter_txt_ocn} locations within.</font><br />} + %{<hr /><font size="2" color="#666666">Found in the main body of #{over_this_number} #{@counter_txt_doc} documents, and at #{over_limit} #{@counter_txt_ocn} locations within.</font><br />} else '' end else '' @@ -929,14 +929,15 @@ module SiSU_CGI_sql 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' + @@lt_e=if @counter_endn_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{<font size="2" color="#666666">Found in the endnotes of #{@counter_endn_doc} documents, and at #{over} #{@counter_endn_ocn} locations within.</font><br />} + %{<font size="2" color="#666666">Found in the endnotes of #{over_this_number} #{@counter_endn_doc} documents, and at #{over_limit} #{@counter_endn_ocn} locations within.</font><br />} else '' end end diff --git a/lib/sisu/v2/db_create.rb b/lib/sisu/v2/db_create.rb index d46fd4c3..feba670c 100644 --- a/lib/sisu/v2/db_create.rb +++ b/lib/sisu/v2/db_create.rb @@ -65,7 +65,9 @@ module SiSU_DB_create def initialize(opt,conn,file,sql_type='pg') @opt,@conn,@file,@sql_type=opt,conn,file,sql_type @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - @comment=Comment.new(@conn,@sql_type) + @comment=(@sql_type=='pg') \ + ? (Comment.new(@conn,@sql_type)) \ + : nil @@dl ||=SiSU_Env::Info_env.new.digest.length end def available @@ -167,7 +169,7 @@ module SiSU_DB_create topic_register VARCHAR(#{lt_topic_register}) NULL ); }) - @comment.metadata + @comment.psql.metadata if @comment end def documents # create documents base print %{ @@ -208,7 +210,7 @@ module SiSU_DB_create types CHAR(1) NULL ); }) - @comment.documents + @comment.psql.documents if @comment end def endnotes print %{ @@ -230,7 +232,7 @@ module SiSU_DB_create metadata_tid BIGINT REFERENCES metadata ); }) - @comment.endnotes + @comment.psql.endnotes if @comment end def endnotes_asterisk print %{ @@ -252,7 +254,7 @@ module SiSU_DB_create metadata_tid BIGINT REFERENCES metadata ); }) - @comment.endnotes_asterisk + @comment.psql.endnotes_asterisk if @comment end def endnotes_plus print %{ @@ -274,7 +276,7 @@ module SiSU_DB_create metadata_tid BIGINT REFERENCES metadata ); }) - @comment.endnotes_plus + @comment.psql.endnotes_plus if @comment end def urls # create documents file links mapping print %{ @@ -304,7 +306,7 @@ module SiSU_DB_create sisupod varchar(512) ); }) - @comment.urls + @comment.psql.urls if @comment end self end @@ -313,7 +315,6 @@ module SiSU_DB_create def initialize(conn,sql_type='pg') @conn=conn if sql_type =~ /pg/; psql - else none end end def psql diff --git a/lib/sisu/v2/harvest_authors.rb b/lib/sisu/v2/harvest_authors.rb index 75fad6f6..33042dcf 100644 --- a/lib/sisu/v2/harvest_authors.rb +++ b/lib/sisu/v2/harvest_authors.rb @@ -69,11 +69,9 @@ module HARVEST_authors def songsheet files,idx_array=[],[] @file_list.each do |f| - if f =~/.+?\.ss[tm]$/ - files << f[/(.+?\.ss[tm])$/,1] - else - print "not .sst or .ssm ? << #{f} >> " - end + (f =~/.+?\.ss[tm]$/) \ + ? (files << f[/(.+?\.ss[tm])$/,1]) \ + : (print "not .sst or .ssm ? << #{f} >> ") end files.each do |filename| file_array=[] @@ -92,7 +90,7 @@ module HARVEST_authors the_idx=HARVEST_authors::Index.new(idx_array,@@the_idx_authors).construct_book_author_index HARVEST_authors::Output_index.new(@opt,the_idx).html_print.html_songsheet puts "file://#{@env.path.output_md_harvest}/harvest_authors.html" - puts "file://#{@env.path.pwd}/harvest_authors.html" if @opt.cmd.inspect =~/-M/ + puts "file://#{@env.path.pwd}/harvest_authors.html" if @opt.cmd.inspect =~/M/ end end class Harvest @@ -101,7 +99,7 @@ module HARVEST_authors end def extract_harvest data,filename,idx_array=@data,@filename,@idx_array - @orig_pub,@title,@subtitle,@fulltitle,@author,@author_format,@date=nil,nil,nil,nil,nil,nil,nil + @title,@subtitle,@fulltitle,@author,@author_format,@date=nil,nil,nil,nil,nil,nil @authors=[] rgx={} rgx[:author]=/^@creator:(?:[ ]+|.+?:author:[ ]+)(.+?)(?:\||\n)/m @@ -121,10 +119,10 @@ module HARVEST_authors if para=~ rgx[:date] @date=rgx[:date].match(para)[1] end - break if @title and @subtitle and @author and @date and @orig_pub + break if @title and @subtitle and @author and @date end - @fulltitle=(@subtitle ? (@title + ' - ' + @subtitle) : @title) - if @title and @author_format #and @orig_pub (publication details) + @fulltitle=@subtitle ? (@title + ' - ' + @subtitle) : @title + if @title and @author_format creator=FORMAT::Author.new(@author_format.strip).author_details @authors,@authorship=creator[:authors],creator[:authorship] file=if filename=~/~[a-z]{2,3}\.ss[mt]$/ @@ -135,9 +133,9 @@ module HARVEST_authors filename.sub(/\.ss[mt]$/,'') end page="sisu_manifest#{lang}.html" - idx_array <<= { :filename => filename, :file => file, :orig_pub => @orig_pub, :date => @date, :title => @fulltitle, :author => creator, :page => page } + idx_array <<= { :filename => filename, :file => file, :date => @date, :title => @fulltitle, :author => creator, :page => page } else - #p "missing author field: #{@filename} title: #{@title}; author: #{@author_format}; idx: #{@orig_pub}" + #p "missing author field: #{@filename} title: #{@title}; author: #{@author_format}" end idx_array.flatten! idx_array @@ -177,10 +175,9 @@ module HARVEST_authors def html_file_open @output={} @output[:html]=File.new("#{@env.path.output_md_harvest}/harvest_authors.html",'w') - @output[:html_mnt]= if @opt.cmd.inspect =~/-M/ - File.new("#{@env.path.pwd}/harvest_authors.html",'w') - else nil - end + @output[:html_mnt]=(@opt.cmd.inspect =~/M/) \ + ? File.new("#{@env.path.pwd}/harvest_authors.html",'w') \ + : nil end def html_file_close @output[:html].close @@ -196,10 +193,9 @@ module HARVEST_authors html_file_close end def html_head_adjust(type='') - css_path=if type !~/maintenance/ - '../_sisu/css/harvest.css' - else 'harvest.css' - end + css_path=(type !~/maintenance/) \ + ? '../_sisu/css/harvest.css' \ + : 'harvest.css' sv=SiSU_Env::Info_version.instance.get_version <<WOK <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" @@ -221,11 +217,12 @@ module HARVEST_authors <a name="start" id="start"></a> <h1>SiSU Metadata Harvest - Authors</h1> <p>[<a href="../index.html"> HOME </a>] also see <a href="harvest_topics.html">SiSU Metadata Harvest - Topics</a></p> +<p>#{@env.widget_static.search_form}</p> <hr /> WOK end def html_head - @output[:html_mnt] << html_head_adjust('maintenance') if @opt.cmd.inspect =~/-M/ + @output[:html_mnt] << html_head_adjust('maintenance') if @opt.cmd.inspect =~/M/ @output[:html] << html_head_adjust end def html_alph @@ -290,10 +287,9 @@ WOK works=[] a[1][:md].each do |x| work=[ "#{x[:date]} #{x[:title]}", %{<p class="publication">#{x[:date]} <a href="../#{x[:file]}/#{x[:page]}">#{x[:title]}</a>, #{x[:author][:authors_s]}</p>} ] - works<<=if @output[:html_mnt].class==File - work.concat([%{<p class="publication">[<a href="#{x[:file]}.sst">src</a>] #{x[:date]} <a href="file://#{@env.path.output}/#{x[:file]}/#{x[:page]}">#{x[:title]}</a>, #{x[:author][:authors_s]} -- [<a href="#{x[:file]}.sst">#{x[:file]}.sst</a>]</p>}]) - else work - end + works<<=(@output[:html_mnt].class==File) \ + ? (work.concat([%{<p class="publication">[<a href="#{x[:file]}.sst">src</a>] #{x[:date]} <a href="file://#{@env.path.output}/#{x[:file]}/#{x[:page]}">#{x[:title]}</a>, #{x[:author][:authors_s]} -- [<a href="#{x[:file]}.sst">#{x[:file]}.sst</a>]</p>}])) \ + : work end works.sort_by {|x| x[0]}.each do |x| @output[:html] << x[1] diff --git a/lib/sisu/v2/harvest_topics.rb b/lib/sisu/v2/harvest_topics.rb index cf913b80..45b14496 100644 --- a/lib/sisu/v2/harvest_topics.rb +++ b/lib/sisu/v2/harvest_topics.rb @@ -69,11 +69,9 @@ module HARVEST_topics def songsheet files,idx_array=[],[] @file_list.each do |f| - if f =~/.+?\.ss[tm]$/ - files << f[/(.+?\.ss[tm])$/,1] - else - print "not .sst or .ssm ? << #{f} >> " - end + (f =~/.+?\.ss[tm]$/) \ + ? (files << f[/(.+?\.ss[tm])$/,1]) \ + : (print "not .sst or .ssm ? << #{f} >> ") end files.each do |filename| file_array=[] @@ -87,17 +85,18 @@ module HARVEST_topics end end end - idx_array=HARVEST_topics::Harvest.new(file_array,filename,idx_array).extract_harvest + idx_array=HARVEST_topics::Harvest.new(@opt,file_array,filename,idx_array).extract_harvest end the_idx=HARVEST_topics::Index.new(idx_array,@@the_idx_topics).construct_book_topic_index + #HARVEST_topics::Output_index.new('',the_idx).screen_print.cycle if @opt.cmd.inspect =~/[VM]/ HARVEST_topics::Output_index.new(@opt,the_idx).html_print.html_songsheet puts "file://#{@env.path.output_md_harvest}/harvest_topics.html" - puts "file://#{@env.path.pwd}/harvest_topics.html" if @opt.cmd.inspect =~/-M/ + puts "file://#{@env.path.pwd}/harvest_topics.html" if @opt.cmd.inspect =~/M/ end end class Harvest - def initialize(data,filename,idx_array) - @data,@filename,@idx_array=data,filename,idx_array + def initialize(opt,data,filename,idx_array) + @opt,@data,@filename,@idx_array=opt,data,filename,idx_array end def extract_harvest data,filename,idx_array=@data,@filename,@idx_array @@ -120,10 +119,12 @@ module HARVEST_topics if para=~ rgx[:author] @author_format=rgx[:author].match(para)[1] end - break if @title and @subtitle and @author and @idx_lst #and @date + break if @title and @subtitle and @author and @idx_lst end - @fulltitle=(@subtitle ? (@title + ' - ' + @subtitle) : @title) - if @title and @author_format and @idx_list + @fulltitle=@subtitle ? (@title + ' - ' + @subtitle) : @title + if @title \ + and @author_format \ + and @idx_list creator=FORMAT::Author.new(@author_format.strip).author_details @authors,@authorship=creator[:authors],creator[:authorship] file=if filename=~/~[a-z]{2,3}\.ss[mt]$/ @@ -142,10 +143,10 @@ module HARVEST_topics idxl << { :filename =>filename,:file =>file,:rough_idx =>i,:title =>@fulltitle,:author =>creator,:page =>page} end idxl - else { :filename =>filename,:file =>file,:rough_idx =>@idx_list,:title =>@fulltitle,:author =>creator,:page =>page } + else { :filename =>filename,:file =>file,:rough_idx =>@idx_list,:title =>@fulltitle,:author =>creator,:page =>page} end else - p "missing required field in #{@filename} - [title]: <<#{@title}>>; [author]: <<#{@author_format}>>; [idx]: <<#{@idx_list}>>" + p "missing required field in #{@filename} - [title]: <<#{@title}>>; [author]: <<#{@author_format}>>; [idx]: <<#{@idx_list}>>" if @opt.cmd.inspect =~/[VM]/ end idx_array.flatten! idx_array @@ -165,7 +166,7 @@ module HARVEST_topics s=n.sub(/(.+?)(?:,.+|$)/,'\1').gsub(/\s+/,'_') names += %{<a href="harvest_authors.html##{s}">#{n}</a>, } end - hash << { :filename =>idx[:filename],:file =>idx[:file],:author => names,:title =>idx[:title],:page =>idx[:page] } + hash << { :filename =>idx[:filename],:file =>idx[:file],:author =>names,:title =>idx[:title],:page =>idx[:page]} end def construct_book_topic_index idx_array=@idx_array @@ -276,10 +277,9 @@ module HARVEST_topics html_file_close end def html_head_adjust(type='') - css_path=if type !~/maintenance/ - '../_sisu/css/harvest.css' - else 'harvest.css' - end + css_path=(type !~/maintenance/) \ + ? '../_sisu/css/harvest.css' \ + : 'harvest.css' sv=SiSU_Env::Info_version.instance.get_version <<WOK <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" @@ -301,23 +301,23 @@ module HARVEST_topics <a name="start" id="start"></a> <h1>SiSU Metadata Harvest - Topics</h1> <p>[<a href="../index.html"> HOME </a>] also see <a href="harvest_authors.html">SiSU Metadata Harvest - Authors</a></p> +<p>#{@env.widget_static.search_form}</p> <hr /> WOK end def html_head - @output[:html_mnt] << html_head_adjust('maintenance') if @opt.cmd.inspect =~/-M/ + @output[:html_mnt] << html_head_adjust('maintenance') if @opt.cmd.inspect =~/M/ @output[:html] << html_head_adjust end def html_alph a=[] a << '<p>' @alph.each do |x| - a << if x =~/[0-9]/; '' - else - %{<a href="##{x}">#{x}</a>, } - end + a << (x =~/[0-9]/) \ + ? '' \ + : %{<a href="##{x}">#{x}</a>, } end - @output[:html_mnt] << a if @opt.cmd.inspect =~/-M/ + @output[:html_mnt] << a if @opt.cmd.inspect =~/M/ @output[:html] << a.join end def html_tail @@ -407,7 +407,7 @@ WOK if key.length > 0 key.sort.each do |m| attrib="lev#{lv}" - lv==(0 ? do_string_name(attrib,m) : do_string(attrib,m)) + lv==0 ? do_string_name(attrib,m) : do_string(attrib,m) do_case(lv,hash[m]) end end @@ -417,7 +417,7 @@ WOK case when y==String attrib="lev#{lv}" - lv==(0 ? do_string_name(attrib,a) : do_string(attrib,a)) + lv==0 ? do_string_name(attrib,a) : do_string(attrib,a) when y==Array do_array(lv,a) when y==Hash diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index ddb48bba..88195630 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -1190,7 +1190,6 @@ WOK <input type="text" name="s1" size="24" maxlength="255" /> <br /> <input type="hidden" name="db" value="#{db}" /> -<input type="hidden" name="fns" value="#{@fnb}" /> <input type="hidden" name="doc" value="#{@fnb}" /> <input type="submit" name="search" value="search doc" /> <input type="submit" name="search" value="search db" /> @@ -1205,7 +1204,7 @@ WOK <input type="text" name="s1" size="24" maxlength="255" /> <br /> <input type="hidden" name="db" value="#{db}" /> -<input type="submit" /> +<input type="submit" name="search" value="search db" /> </font> </form> <!-- SiSU Search --> } @@ -1786,7 +1785,7 @@ WOK if defined? @rc['search']['sisu']['title'] \ and @rc['search']['sisu']['title'] =~/\S+/ @rc['search']['sisu']['title'] - else %{SiSU search form (sample):} + else %{(SiSU (generated sample) search form} end end def output_tell |