aboutsummaryrefslogtreecommitdiffhomepage
path: root/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi')
-rw-r--r--data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi72
1 files changed, 36 insertions, 36 deletions
diff --git a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
index f4c5382a..5bef900e 100644
--- a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
+++ b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
=begin
- * Name: SiSU information Structuring Universe
+ * Name: SiSU information Structuring Universe
* Author: Ralph Amissah
* http://www.jus.uio.no/sisu
* http://www.jus.uio.no/sisu/SiSU/download
@@ -39,11 +39,11 @@
SiSU was first released to the public on January 4th 2005
SiSU uses:
-
+
* Standard SiSU markup syntax,
* Standard SiSU meta-markup syntax, and the
* Standard SiSU object citation numbering and system
-
+
© Ralph Amissah 1997, current 2006.
All Rights Reserved.
@@ -68,7 +68,7 @@ class Form
@base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can
@tip=if checked_tip =~/\S/
'<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; </font>'
- else ''
+ else ''
end
end
def submission_form
@@ -105,7 +105,7 @@ class Form
</td><td valign=\"top\">
#@tip
</td></tr>
-</table>
+</table>
<font size="2" color="#222222">
<input type="checkbox" name="echo" #@checked_echo> echo
<input type="checkbox" name="searched" #@checked_searched> searched
@@ -339,10 +339,10 @@ class Dbi_search_statement
%{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr ;}
end
def sql_select_body_format
- %{<font color="#666666" size="2">#{sql_select_body}</font>}
+ %{<font color="#666666" size="2">#{sql_select_body}</font>}
end
def sql_select_endnotes_format
- %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}
+ %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}
end
def contents
@conn.select_all(sql_select_body)
@@ -674,8 +674,8 @@ FCGI.each_cgi do |cgi|
@search=Hash.new
@search[:text],@search[:endnotes]=Array.new,Array.new
q=CGI.new
- @db=if cgi['db'] =~/\S+/:
- @stub=/SiSU_(\S+)/.match(cgi['db'])[1]
+ @db=if cgi['db'] =~/\S+/:
+ @stub=/SiSU_(\S+)/.match(cgi['db'])[1]
cgi['db']
else
@stub='sisu'
@@ -685,17 +685,17 @@ FCGI.each_cgi do |cgi|
if cgi['view']=~/text/: checked_index,checked_text='','checked'
else checked_index,checked_text='checked',''
end
- checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
- checked_searched='checked' if cgi['searched'] =~/\S/
- checked_tip='checked' if cgi['tip'] =~/\S/
- checked_echo='checked' if cgi['echo'] =~/\S/
- checked_sql='checked' if cgi['sql'] =~/\S/
- if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
+ checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
+ checked_searched='checked' if cgi['searched'] =~/\S/
+ checked_tip='checked' if cgi['tip'] =~/\S/
+ checked_echo='checked' if cgi['echo'] =~/\S/
+ checked_sql='checked' if cgi['sql'] =~/\S/
+ if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
- checked_none=''
- elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
+ checked_none=''
+ elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
checked_none='checked'
- checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
else checked_ignore='checked'
end
selected_db=case cgi['db']
@@ -708,7 +708,7 @@ FCGI.each_cgi do |cgi|
when /SiSU_sisu/: "/home/ralph/sisu_www/sisu/sisu_sqlite.db"
end
@dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ?
- @conn=DBI.connect(@dbi)
+ @conn=DBI.connect(@dbi)
search_field=cgi['find'] if cgi['find'] # =~/\S+/
@search_for=Search_request.new(search_field,q) #.analyze #% search_for
#% searches
@@ -740,7 +740,7 @@ FCGI.each_cgi do |cgi|
canned_search_url=if checked_all =~/checked/
"#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"
else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1"
- end
+ end
@search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
@search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
canned_note='previous search url:'
@@ -759,7 +759,7 @@ FCGI.each_cgi do |cgi|
af.gsub!(/%2B/,' ')
analyze_format=af
st=af.split(/\s*;\s*/)
- search_field=st.join("\n")
+ search_field=st.join("\n")
end
green=%{<font size="2" color="#004000">}
the_can=%{<font size="2" color="#666666">#{canned_note}<br> <a href="#{canned_search_url}">#{canned_search_url}</a></font><br>}
@@ -795,7 +795,7 @@ WOK
#dbi_canning
@header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form
@tail=Tail.new.tail
- unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
+ 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
@@ -814,7 +814,7 @@ WOK
@body_main=Array.new
@endnotes=Array.new
oldtid=0
- if @text_search_flag
+ 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
@@ -831,14 +831,14 @@ WOK
#metadata_found_body
if c["tid"].to_i != oldtid.to_i
title=%{<a href="#@hosturl/#@stub/#{location}/">#{c["title"]}</a> by #{c["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></a><br>} if file_suffix=~/s/ #hmm watch file_suffix
- if @text_search_flag: title='<br><hr>'+title
- else title='<br>'+title
+ if @text_search_flag: title='<br><hr>'+title
+ else title='<br>'+title
end
@counter_txt_doc+=1
oldtid=c["tid"].to_i
else title=''
end
- if @text_search_flag
+ 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 !!
@@ -857,22 +857,22 @@ WOK
@search_regx=search_regex.to_s
end
matched_para=c["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
- %{<hr><p><font size="2">ocn <b><a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a></b>:</font></p>#{matched_para}}
+ %{<hr><p><font size="2">ocn <b><a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a></b>:</font></p>#{matched_para}}
elsif c["suffix"] =~/1/ #doc
%{#{title}<hr><p><font size="2">ocn #{c["ocn"]}:#{c["body"]}}
end
@counter_txt_ocn+=1
output=if c["seg"] =~/\S+/: title+text
- else text
+ else text
end
elsif cgi['view']=~/index/ #% idx body
if c["suffix"] !~/1/ #seg
- index=%{<a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a>, } if @text_search_flag
+ index=%{<a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a>, } if @text_search_flag
elsif c["suffix"] =~/1/ #doc
- index=%{<a href="#@hosturl/#@stub/#{location}/doc.html##{c["ocn"]}">#{c["ocn"]}</a>, }
+ index=%{<a href="#@hosturl/#@stub/#{location}/doc.html##{c["ocn"]}">#{c["ocn"]}</a>, }
end
- if c["seg"] =~/\S+/
- if @text_search_flag
+ if c["seg"] =~/\S+/
+ if @text_search_flag
@counter_txt_ocn+=1
output=title+index
end
@@ -883,8 +883,8 @@ WOK
end
end
end
- else output=title
- end
+ else output=title
+ end
@counters_txt=if @counter_txt_doc > 0
%{<font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}
else ''
@@ -898,7 +898,7 @@ WOK
file_suffix=e["filename"][/.+?\.(ss[ftm])/, 1]
#metadata_found_endnotes
if @text_search_flag
- if e["metadata_tid"].to_i != oldtid.to_i
+ if e["metadata_tid"].to_i != oldtid.to_i
title=%{<br><hr><a href="#@hosturl/#@stub/#{location}/">#{e["title"]}</a> by #{e["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></a><br>} if file_suffix=~/s/
@counter_endn_doc+=1
oldtid=e["metadata_tid"].to_i
@@ -907,7 +907,7 @@ WOK
if cgi['view']=~/text/ #% txt endnotes
@counter_endn_ocn+=1
matched_endnote=e["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
- output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl/#@stub/#{location}/endnotes.html##{e["nr"]}">#{e["nr"]}</a></b> referred to from ocn <a href="#@hosturl/#@stub/#{location}/doc.html##{e["ocn"]}">#{e["ocn"]}</a>:</font> #{matched_endnote}}
+ output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl/#@stub/#{location}/endnotes.html##{e["nr"]}">#{e["nr"]}</a></b> referred to from ocn <a href="#@hosturl/#@stub/#{location}/doc.html##{e["ocn"]}">#{e["ocn"]}</a>:</font> #{matched_endnote}}
elsif cgi['view']=~/index/ #% idx endnotes
@counter_endn_ocn+=1
output=%{#{title}<a href="#@hosturl/#@stub/#{location}/endnotes.html#_#{e["nr"]}">#{e["nr"]}</a> [&sect; <a href="#@hosturl/#@stub/#{location}/doc.html##{e["ocn"]}">#{e["ocn"]}</a>], }