aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG_v222
-rw-r--r--conf/sisu/v2/version.yml6
-rw-r--r--data/doc/sisu/v2/CHANGELOG22
-rw-r--r--data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi20
-rw-r--r--lib/sisu/v1/cgi_sql_common.rb26
-rw-r--r--lib/sisu/v1/harvest_topics.rb12
-rw-r--r--lib/sisu/v2/cgi_pgsql.rb10
-rw-r--r--lib/sisu/v2/cgi_sql_common.rb27
-rw-r--r--lib/sisu/v2/db_create.rb17
-rw-r--r--lib/sisu/v2/harvest_authors.rb46
-rw-r--r--lib/sisu/v2/harvest_topics.rb54
-rw-r--r--lib/sisu/v2/sysenv.rb5
12 files changed, 152 insertions, 115 deletions
diff --git a/CHANGELOG_v2 b/CHANGELOG_v2
index 48c6c0fc..297522f7 100644
--- a/CHANGELOG_v2
+++ b/CHANGELOG_v2
@@ -12,11 +12,27 @@ Reverse Chronological:
%% Development branch UNSTABLE
+%% 2.0.5.orig.tar.gz (2010-03-31:13/3)
+http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5.orig.tar.gz
+ sisu_2.0.5.orig.tar.gz
+ sisu_2.0.5-1.dsc
+ sisu_2.0.5-1.diff.gz
+
+ * bug fixes
+ * harvest, fixes bug in harvest_topics (v2)
+ * manifest, search form for db fixed
+ * sql, postgresql search form, next page, previous page
+ * db_create, comments causing issues for sqlite
+
+ * sql, search form, clearer information when results exceed match limit set
+
+ * harvest, add search form for directory, if configured in sisurc.yml
+
%% 2.0.4.orig.tar.gz (2010-03-23:12/2)
http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4.orig.tar.gz
- sisu_2.0.4.orig.tar.gz
- sisu_2.0.4-1.dsc
- sisu_2.0.4-1.diff.gz
+ 7fb8b578813fbd6cd4bf441e8eefeb9b52860064d1c66b83889bfc65468c90fd 2737242 sisu_2.0.4.orig.tar.gz
+ 262c08353f44e75f1f0da02ab4f7d5a843da687ddfd416ed4c2b7ad08f1226a7 1145 sisu_2.0.4-1.dsc
+ 62b077a6334f049f574ef3c77bbabf094345540afb0f0ce52692181d3017b279 275441 sisu_2.0.4-1.diff.gz
* bug fixes
* correct method call for md.title.full a number of places [in db_import,
diff --git a/conf/sisu/v2/version.yml b/conf/sisu/v2/version.yml
index c908e9cc..8fd9c471 100644
--- a/conf/sisu/v2/version.yml
+++ b/conf/sisu/v2/version.yml
@@ -1,5 +1,5 @@
---
-:version: 2.0.4
-:date_stamp: 2010w12/2
-:date: "2010-03-23"
+:version: 2.0.5
+:date_stamp: 2010w13/3
+:date: "2010-03-31"
:project: SiSU
diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG
index c6a4af68..b5a08aa7 100644
--- a/data/doc/sisu/v2/CHANGELOG
+++ b/data/doc/sisu/v2/CHANGELOG
@@ -12,11 +12,27 @@ Reverse Chronological:
%% Development branch UNSTABLE
+%% 2.0.5.orig.tar.gz (2010-03-31:13/3)
+http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5.orig.tar.gz
+ sisu_2.0.5.orig.tar.gz
+ sisu_2.0.5-1.dsc
+ sisu_2.0.5-1.diff.gz
+
+ * bug fixes
+ * harvest, fixes bug in harvest_topics (v2)
+ * manifest, search form for db fixed
+ * sql, postgresql search form, next page, previous page
+ * db_create, comments causing issues for sqlite
+
+ * sql, search form, clearer information when results exceed match limit set
+
+ * harvest, add search form for directory, if configured in sisurc.yml
+
%% 2.0.4.orig.tar.gz (2010-03-23:12/2)
http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4.orig.tar.gz
- sisu_2.0.4.orig.tar.gz
- sisu_2.0.4-1.dsc
- sisu_2.0.4-1.diff.gz
+ 7fb8b578813fbd6cd4bf441e8eefeb9b52860064d1c66b83889bfc65468c90fd 2737242 sisu_2.0.4.orig.tar.gz
+ 262c08353f44e75f1f0da02ab4f7d5a843da687ddfd416ed4c2b7ad08f1226a7 1145 sisu_2.0.4-1.dsc
+ 62b077a6334f049f574ef3c77bbabf094345540afb0f0ce52692181d3017b279 275441 sisu_2.0.4-1.diff.gz
* bug fixes
* correct method call for md.title.full a number of places [in db_import,
diff --git a/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi b/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
index 61d3af36..6575cf4c 100644
--- a/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
+++ b/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
@@ -57,7 +57,7 @@
Download the latest version of SiSU (and SiSU markup samples):~{ Breakage and Fixes Report<br> http://www.jus.uio.no/sisu/SiSU/breakage_and_fixes.html }~
-_* {~^ sisu_2.0.4.orig.tar.gz (2010-03-22:12/1) }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4.orig.tar.gz
+_* {~^ sisu_2.0.5.orig.tar.gz (2010-03-27:12/6) }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5.orig.tar.gz
_* {~^ sisu-markup-samples_1.0.10.orig.tar.gz (of 2008-10-09:40/4 ) }http://www.jus.uio.no/sisu/pkg/src/sisu-markup-samples_1.0.10.orig.tar.gz ~{ <br>1e769b5c2c2d6135c3f5a14ede1d019f77588c7024168c756c7093510145c7dc 3442966 }~ *~sisu-markup-samples
@@ -104,11 +104,11 @@ group{
*{Source}*
-{~^ sisu_2.0.4.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4.orig.tar.gz
+{~^ sisu_2.0.5.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5.orig.tar.gz
-{~^ sisu_2.0.4-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4-1.diff.gz
+{~^ sisu_2.0.5-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5-1.diff.gz
-{~^ sisu_2.0.4-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.4-1.dsc
+{~^ sisu_2.0.5-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_2.0.5-1.dsc
}group
@@ -116,15 +116,15 @@ group{
*{Debs}*
-{~^ sisu_2.0.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_2.0.4-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~
+{~^ sisu_2.0.5-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_2.0.5-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~
-{~^ sisu-complete_2.0.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_2.0.4-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~
+{~^ sisu-complete_2.0.5-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_2.0.5-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~
-{~^ sisu-pdf_2.0.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_2.0.4-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~
+{~^ sisu-pdf_2.0.5-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_2.0.5-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~
-{~^ sisu-postgresql_2.0.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_2.0.4-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~
+{~^ sisu-postgresql_2.0.5-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_2.0.5-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~
-{~^ sisu-sqlite_2.0.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_2.0.4-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~
+{~^ sisu-sqlite_2.0.5-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_2.0.5-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~
}group
@@ -154,7 +154,7 @@ The RPM is generated from the source file using Alien.~{ http://www.kitenet.net/
sudo rpm -i [package name]
-_* {~^ sisu-2.0.4-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-2.0.4-2.noarch.rpm ~{ <br>created using alien }~
+_* {~^ sisu-2.0.5-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-2.0.5-2.noarch.rpm ~{ <br>created using alien }~
_* {~^ sisu-markup-samples_1.0.10.orig-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-markup-samples_1.0.6.orig-2.noarch.rpm ~{ <br> http://www.jus.uio.no/sisu/archive/pool/non-free/s/sisu-markup-samples/sisu-markup-samples_1.0.10-1_all.deb <br> created using: alien -r sisu_0.70.5-1_all.deb }~
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 + '&ltd=' + sql_limit.to_s + '&off=' + @offset_next.to_s
end
def previous
- @offset_previous >= 0 ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : ''
+ @offset_previous >= 0 \
+ ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \
+ : ''
end
def start
@@canned_search_url.to_s + '&ltd=' + 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 + '&ltd=' + sql_limit.to_s + '&off=' + @offset_next.to_s
end
def previous
- @offset_previous >= (0 ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '')
+ @offset_previous >= 0 \
+ ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \
+ : ''
end
def start
@@canned_search_url.to_s + '&ltd=' + 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">&nbsp;HOME&nbsp;</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>]&nbsp;&nbsp;#{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>]&nbsp;&nbsp;#{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">&nbsp;HOME&nbsp;</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>,&nbsp;}
- end
+ a << (x =~/[0-9]/) \
+ ? '' \
+ : %{<a href="##{x}">#{x}</a>,&nbsp;}
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