From 61a1a2a834510f5f3f3026de7f371b26a501e4c5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 8 Feb 2014 23:38:40 -0500 Subject: examples: nginx conf; cgi search forms pgsql & sqlite --- data/doc/sisu/CHANGELOG_v5 | 4 + data/doc/sisu/CHANGELOG_v6 | 4 + data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi | 886 ++++++++++++--------- data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi | 877 +++++++++++--------- data/sisu/conf/nginx/sites-available/sisu_search | 83 ++ .../conf/nginx/sites-available/sisu_search_srv | 84 ++ 6 files changed, 1200 insertions(+), 738 deletions(-) create mode 100644 data/sisu/conf/nginx/sites-available/sisu_search create mode 100644 data/sisu/conf/nginx/sites-available/sisu_search_srv (limited to 'data') diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 19501071..5ce22013 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -40,6 +40,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.3.orig.tar.xz * cgi, search form (generator), using cgi ENV variables +* examples + * nginx conf + * cgi search forms pgsql & sqlite + %% 5.3.2.orig.tar.xz (2014-02-05:05/3) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.3.2 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.3.2-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 922603f1..c1b1c58e 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.3.orig.tar.xz * cgi, search form (generator), using cgi ENV variables +* examples + * nginx conf + * cgi search forms pgsql & sqlite + %% 6.0.2.orig.tar.xz (2014-02-05:05/3) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_6.0.2 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_6.0.2-1 diff --git a/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi index c196c756..2f6f93e4 100644 --- a/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi +++ b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi @@ -13,15 +13,13 @@ * Author: Ralph Amissah - * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Ralph Amissah All Rights Reserved. + * Copyright: (C) 1997 - 2014, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: SiSU, a framework for document structuring, publishing and search - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Ralph Amissah + Copyright (C) Ralph Amissah This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -39,7 +37,7 @@ If you have Internet connection, the latest version of the GPL should be available at these locations: - + * SiSU uses: @@ -59,28 +57,36 @@ =end - require 'cgi' - require 'fcgi' - require 'dbi' - @version='sisu_search_pgsql' - @image_src="http://localhost/sisu/_sisu/image" - @hosturl_db="http://localhost" - @hosturl_files="http://www.jus.uio.no" - @port="5432" - user='' - @@limit,@@offset=1000,0 - @base="#@hosturl_db/cgi-bin/#@version.cgi" + begin + require 'cgi' + require 'fcgi' + require 'dbi' + rescue LoadError + puts 'cgi, fcgi or dbi NOT FOUND (LoadError)' + end + @stub_default='manual' + @image_src="http://#{ENV['HTTP_HOST']}/_sisu/image_sys" + @hosturl_cgi="http://#{ENV['HTTP_HOST']}#{ENV['PATH_INFO']}" + @hosturl_files="http://#{ENV['HTTP_HOST']}" + @output_dir_structure_by='language' + @lingual='multi' + @port='5432' + @db_name_prefix='SiSUv6a_' + @user='ralph' # check user name for access to pg database: e.g. www-data or 'ralph' + @base="http://#{ENV['HTTP_HOST']}#{ENV['PATH_INFO']}#{ENV['SCRIPT_NAME']}" +#Common TOP + @@offset=0 @@canned_search_url=@base @color_heading='#DDFFAA' @color_match='#ffff48' class Form - def initialize(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='') + def initialize(base,search_field,selected_db,result_type,checked_sql_limit,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='') search_note='' if checked_searched !~/\S/ the_can='' if checked_url !~/\S/ search_field='' if checked_echo !~/\S/ - @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=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 + @base,@search_field,@selected_db,@result_type,@checked_sql_limit,@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=base,search_field,selected_db,result_type,checked_sql_limit,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 @tip=if checked_tip =~/\S/ - 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' else '' end end @@ -96,54 +102,70 @@ - + - +
SiSU --> - - +
+ + +
+
+ SiSU + +
+ git + +
+
+
-
+
- + - #@tip - #@search_note - #@the_can + #{@tip} + #{@search_note} + #{@the_can}
- + to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below)
- index - text / grep - case sensitive + index + text / grep + case sensitive +
+ match limit: + 1,000 + 2,500
- echo query - result stats - search url - searched - available fields - sql statement + echo query + result stats + search url + searched + available fields + sql statement
checks: - default - selected - all - none + default + selected + all + none
@@ -151,19 +173,21 @@ WOK end end - class Search_request #% search_for - attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename + class SearchRequest #% search_for + attr_accessor :text1,:fulltext,:keywords,:title,:author,:topic_register,:subject,:description,:publisher,:editor,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename def initialize(search_field='',q='') @search_field,@q=search_field,q - @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' + @text1=@fulltext=@keywords=@title=@author=@topic_register=@subject=@description=@publisher=@editor=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' if @search_field=~/\S/ @text1=text_to_match('text:') - @keywords=text_to_match('key(?:words?)?:') + @fulltext=text_to_match('fulltxt:') + @topic_register=text_to_match('topic_register:') @title=text_to_match('title:') # DublinCore 1 - title @author=text_to_match('(?:author|creator)s?:') # DublinCore 2 - creator/author @subject=text_to_match('subj(?:ect)?:') # DublinCore 3 - subject @description=text_to_match('description:') # DublinCore 4 - description @publisher=text_to_match('pub(?:lisher)?:') # DublinCore 5 - publisher + @editor=text_to_match('editor:') @contributor=text_to_match('contributor:') # DublinCore 6 - contributor @date=text_to_match('date:') # DublinCore 7 - date dd-mm-yy @type=text_to_match('type:') # DublinCore 8 - type @@ -174,6 +198,7 @@ @relation=text_to_match('relation:') # DublinCore 13 - relation @coverage=text_to_match('coverage:') # DublinCore 14 - coverage @rights=text_to_match('rights:') # DublinCore 15 - rights + @keywords=text_to_match('key(?:words?)?:') @comment=text_to_match('comment:') @abstract=text_to_match('abs(?:tract)?:') @owner=text_to_match('owner:') @@ -183,15 +208,18 @@ @date_available=text_to_match('date_available:') @date_valid=text_to_match('date_valid:') @filename=text_to_match('filename:') - @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename + @text1=text_to_match unless @keywords or @author or @title or @text1 or @fulltext or @comment or @abstract or @rights or @subject or @publisher or @date or @filename or @topic_register else @text1=q['s1'] if q['s1']=~/\S/ + @fulltext=q['ft'] if q['ft']=~/\S/ @keywords=q['key'] if q['key']=~/\S/ @title=q['ti'] if q['ti']=~/\S/ @author=q['au'] if q['au']=~/\S/ + @topic_register=q['tr'] if q['tr']=~/\S/ @subject=q['sj'] if q['sj']=~/\S/ @description=q['dsc'] if q['dsc']=~/\S/ @publisher=q['pb'] if q['pb']=~/\S/ + @editor=q['cntr'] if q['cntr']=~/\S/ @contributor=q['cntr'] if q['cntr']=~/\S/ @date=q['dt'] if q['dt']=~/\S/ @type=q['ty'] if q['ty']=~/\S/ @@ -208,50 +236,50 @@ @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=q['fns'] if q['fns']=~/\S/ + @filename=if q['doc'] and q['search'] !~/search db/ then q['doc'] + elsif q['fns']=~/\S/ then q['fns'] + end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 end end def text_to_match(identifier='') m={ - :string => /#{identifier}\s*(.+?)/, - :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, - :word => /#{identifier}[\s(]*(\S+)/ + string: /#{identifier}\s*(.+?)/, + string: /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, + word: /#{identifier}[\s(]*(\S+)/ } search_string=if @search_field =~m[:word] - search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] - elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] + search_string=if @search_field =~m[:braces] then m[:braces].match(@search_field)[1] + elsif @search_field =~m[:string] then m[:string].match(@search_field)[1] else str=m[:word].match(@search_field)[1] - str.gsub!(/[()]/,'') + str=str.gsub(/[()]/,'') str end - search_string.strip! - search_string.gsub!(/\s+/,'+') - search_string + search_string=search_string.strip.gsub(/\s+/,'+') #else # "__" end end end - class Dbi_search_string + class DBI_SearchString def initialize(l,t,q,cse=false) @l,@t,@q,@c=l,t,q,cse end def string - search={ :search => [],:flag => false } + search={ search: [], flag: false } if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + if @t =~/\S+/ then unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/ then unescaped_search=CGI.unescape(@q) end search_construct=[] - if @c - unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '") - unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)") + unescaped_search=if @c + unescaped_search.gsub(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~\( '"). + gsub(/(.+)/,"#{@l}~\( '\\1' \)") else - unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~*\( '") - unescaped_search.gsub!(/(.+)/,"#@l~*\( '\\1' \)") + unescaped_search.gsub(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~*\( '"). + gsub(/(.+)/,"#{@l}~*\( '\\1' \)") end search_construct << unescaped_search search_construct=search_construct.join(' ') @@ -262,180 +290,217 @@ search end end - class Dbi_search_statement + class DBI_SearchStatement attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit def initialize(conn,search_for,q,c) @conn=conn @text_search_flag=false - @sql_statement={ :body=>'',:endnotes=>'',:range=>'' } + @sql_statement={ body: '', endnotes: '', range: '' } #@offset||=@@offset #@offset+=@@limit - search={ :text => [],:endnotes => [] } - cse=if c =~/\S/; true - else false - end - st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string - se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string + search={ text: [], endnotes: [] } + cse=(c =~/\S/) ? true : false + st=DBI_SearchString.new('doc_objects.clean',search_for.text1,q['s1'],cse).string + se=DBI_SearchString.new('endnotes.clean',search_for.text1,q['s1'],cse).string @text_search_flag=st[:flag] if st[:flag] search[:text] << st[:search] search[:endnotes] << se[:search] end - st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string + st=DBI_SearchString.new('metadata_and_text.fulltext',search_for.fulltext,q['ft'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string + st=DBI_SearchString.new('metadata_and_text.title',search_for.title,q['ti'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string + st=DBI_SearchString.new('metadata_and_text.creator_author',search_for.author,q['au'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_topic_register',search_for.topic_register,q['tr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_subject',search_for.subject,q['sj'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_keywords',search_for.keywords,q['key'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_description',search_for.description,q['dsc'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string + st=DBI_SearchString.new('metadata_and_text.publisher',search_for.publisher,q['pb'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string + st=DBI_SearchString.new('metadata_and_text.creator_editor',search_for.editor,q['cntr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string + st=DBI_SearchString.new('metadata_and_text.creator_contributor',search_for.contributor,q['cntr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string + st=DBI_SearchString.new('metadata_and_text.date_published',search_for.date,q['dt'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_type',search_for.type,q['ty'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string + st=DBI_SearchString.new('metadata_and_text.original_source',search_for.source,q['src'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string + st=DBI_SearchString.new('metadata_and_text.language_document_char',search_for.language,q['lang'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_relation',search_for.relation,q['rel'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_coverage',search_for.coverage,q['cov'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string + st=DBI_SearchString.new('metadata_and_text.rights_all',search_for.rights,q['cr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_comment',search_for.comment,q['co'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=DBI_SearchString.new('metadata_and_text.notes_abstract',search_for.abstract,q['ab'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=DBI_SearchString.new('metadata_and_text.src_filename',search_for.filename,q['fns'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 - @search_text,@search_endnotes=[],[] - #% - 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[: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)') + @search_text,@search_endnotes='','' + @search_text=search[:text].flatten.join(' AND ') + @search_text=@search_text.gsub(/(doc_objects\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)') + @search_endnotes=search[:endnotes].flatten.join(' AND ') + @search_endnotes=@search_endnotes.gsub(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') end def sql_offset @@offset end - def sql_limit + def sql_match_limit @@limit end def sql_canned_search - @offset_next=sql_offset.to_i + sql_limit.to_i - @offset_previous=sql_offset.to_i - sql_limit.to_i + @offset_next=sql_offset.to_i + sql_match_limit.to_i + @offset_previous=sql_offset.to_i - sql_match_limit.to_i def current - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s + @@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + sql_offset.to_s end def next - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s + @@canned_search_url.to_s + '<d=' + sql_match_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_match_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 + @@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + 0.to_s end self end - def sql_canned_search_url(ok) - if ok - can=sql_canned_search - page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i - case page.to_s - when /^1$/ - %{

+ def pre_next(beyond_limit,img) + can=sql_canned_search + page=(sql_offset.to_i + sql_match_limit.to_i)/sql_match_limit.to_i + if beyond_limit + if page.to_s =~ /^1$/ + %{
pg. #{page.to_s} -   > + +  >> +
} - when /^2$/ - %{

- <   + elsif page.to_s =~ /^2$/ + %{
+ + <<  + pg. #{page.to_s} -   > + +  >> +
} else - %{

- |<   - <   + %{
+ + |<  + + + <<  + + pg. #{page.to_s} + +  >> + +
} + end + else + if page.to_s =~ /^1$/ then '' + elsif page.to_s =~ /^2$/ + %{
+ + <<  + + pg. #{page.to_s} +
} + else + %{
+ + |<  + + + <<  + pg. #{page.to_s} -   >
} end - else '' end end def sql_select_body limit ||=@@limit offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:body]=%{SELECT metadata_and_text.title, metadata_and_text.creator_author, metadata_and_text.src_filename, metadata_and_text.language_document_char, metadata_and_text.notes_suffix, doc_objects.body, doc_objects.seg, doc_objects.ocn, metadata_and_text.tid FROM doc_objects, metadata_and_text WHERE (#{@search_text}) AND doc_objects.metadata_tid = metadata_and_text.tid ORDER BY metadata_and_text.language_document_char, metadata_and_text.title, metadata_and_text.src_filename, doc_objects.ocn} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:body] + ' ' + @sql_statement[:range] select @@ -443,7 +508,7 @@ def sql_select_endnotes limit ||=@@limit offset ||=@@offset - @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.subtitle, 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, metadata.filename, endnotes.nr} + @sql_statement[:endnotes]=%{SELECT metadata_and_text.title, metadata_and_text.creator_author, metadata_and_text.src_filename, metadata_and_text.language_document_char, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata_and_text, endnotes WHERE (#{@search_endnotes}) AND metadata_and_text.tid = endnotes.metadata_tid ORDER BY metadata_and_text.language_document_char, metadata_and_text.title, metadata_and_text.src_filename, endnotes.nr} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] select @@ -467,26 +532,29 @@ + @@ -516,7 +597,7 @@
-

- - SiSU - -

-
+ + +
+
+ SiSU + +
+ git + +
+

Generated by - - SiSU 0.55.3 2007-07-10 (2007w28/2) + SiSU 6.0.3 2014-02-06 (2014w05/4)
- + SiSU © Ralph Amissah - 1993, current 2007. + 1993, current 2014. All Rights Reserved.
- - SiSU - is software for document structuring, publishing and search, + SiSU is software for document structuring, publishing and search,
www.jus.uio.no/sisu @@ -495,20 +563,33 @@ www.sisudoc.org + sources + + git.sisudoc.org +
w3 since October 3 1993 - + ralph@amissah.com +
+ mailing list subscription + + http://lists.sisudoc.org/listinfo/sisu + +
+ + sisu@lists.sisudoc.org +

SiSU using:
Standard SiSU markup syntax,
Standard SiSU meta-markup syntax, and the -
Standard SiSU object citation numbering and system, (object/text positioning system) +
Standard SiSU object citation numbering and system, (object/text identifying/locating system)
- © Ralph Amissah 1997, current 2007. + © Ralph Amissah 1997, current 2014. All Rights Reserved.

- GPLv3 + .:

@@ -540,14 +621,6 @@ software infrastructure, with the usual GPL (or OSS) suspects. -
- Better - "performance, reliability, scalability, security & total cost of ownership" - [not to mention flexibility & choice] -
- Get With the Future - - Way Better! -

@@ -560,18 +633,25 @@ @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','','' FCGI.each_cgi do |cgi| begin # all code goes in begin section - @search={ :text => [],:endnotes => [] } + @search={ text: [], endnotes: [] } q=CGI.new - @db=if cgi['db'] =~/\S+/; - @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + @db=if cgi['db'] =~ /#{@db_name_prefix}(\S+)/ + @stub=$1 cgi['db'] else - @stub='sisu' - 'SiSU_sisu' + @stub=@stub_default + @db_name_prefix + @stub end checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','','' - if cgi['view']=~/text/; checked_index,checked_text='','checked' - else checked_index,checked_text='checked','' + result_type=(cgi['view']=~/text/) \ + ? result_type={ index: '', text: 'checked'} + : result_type={ index: 'checked', text: ''} + @@limit=if cgi['sql_match_limit'].to_s=~/2500/ + checked_sql_limit={ l1000: '', l2500: 'checked'} + '2500' + else + checked_sql_limit={ l1000: 'checked', l2500: ''} + '1000' end checked_echo='checked' if cgi['echo'] =~/\S/ checked_stats='checked' if cgi['stats'] =~/\S/ @@ -598,24 +678,24 @@ checked_echo=checked_stats=checked_url='checked' checked_searched=checked_tip=checked_case=checked_sql='' end - selected_db=case cgi['db'] - when /SiSU_pace/; '' - when /SiSU_sisu/; '' - end + selected_db=%{} dbi="dbi:Pg:database=#{@db};port=#{@port}" - @conn=DBI.connect(dbi,user) + @conn=DBI.connect(dbi,@user) search_field=cgi['find'] if cgi['find'] # =~/\S+/ - @search_for=Search_request.new(search_field,q) #.analyze #% search_for + @search_for=SearchRequest.new(search_field,q) #.analyze #% search_for #% searches #Canned_search.new(@base,@search_for.text1,cgi) - if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/ + if @search_for.text1=~/\S+/ or @search_for.fulltext=~/\S+/ or @search_for.author=~/\S+/ or @search_for.topic_register=~/\S+/ #and search_field =~/\S/ s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/ + ft='&ft=' + CGI.escape(@search_for.fulltext) if @search_for.fulltext=~/\S/ key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/ ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/ au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/ + tr='&tr=' + CGI.escape(@search_for.topic_register) if @search_for.topic_register=~/\S/ sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/ dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/ pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/ + edt='&edt=' + CGI.escape(@search_for.editor) if @search_for.editor=~/\S/ cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/ dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/ ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/ @@ -633,33 +713,35 @@ dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/ dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ - @@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}#{fns}&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}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" - end - @canned_base_url="#@base?#{s1}&db=#{cgi['db']}" + @@canned_search_url=(checked_all =~/checked/) \ + ? "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" + : "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" + mod=ft=~/\S+/ ? (ft.gsub(/ft/,'s1')) : s1 + @canned_base_url="#{@base}?#{mod}&db=#{cgi['db']}" if checked_case=~/\S/ - @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 + @search[:text][1]=%{doc_objects.clean~'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 else - @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1 + @search[:text][1]=%{doc_objects.clean~*'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1 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+/ analyze_format=search_field.gsub(/\s*\n/,'; ') elsif checked_all =~/checked/ or checked_url =~/checked/ - canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/) + canned_search=@@canned_search_url.scan(/(?:s1|ft|au|ti|fns|tr)=[^&]+/) af=canned_search.join('; ') - af.gsub!(/s1=/,'text: ') - af.gsub!(/au=/,'author: ') - af.gsub!(/ti=/,'title: ') - af.gsub!(/fns=/,'filename: ') - af.gsub!(/%2B/,' ') + af=af.gsub(/s1=/,'text: '). + gsub(/ft=/,'fulltxt: '). + gsub(/au=/,'author: '). + gsub(/ti=/,'title: '). + gsub(/fns=/,'filename: '). + gsub(/tr=/,'topic_register: '). + gsub(/%2B/,' ') analyze_format=af st=af.split(/\s*;\s*/) search_field=st.join("\n") @@ -667,232 +749,292 @@ green=%{} canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) the_can=%{#{canned_note} #{canned_search_url_txt}
} - 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_subject=p_filename='' + p_text=p_fulltext=p_keywords=p_title=p_author=p_topic_register=p_subject=p_description=p_publisher=p_editor=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='' + p_filename=%{filename: #{green}#{@search_for.filename}

} if @search_for.filename =~/\S+/ p_text=%{text: #{green}#{@search_for.text1}
} if @search_for.text1 =~/\S+/ - p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ - p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ - p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ - p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ - p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ - p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ - p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ - p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ - p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ - p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ search_note=<<-WOK - database: #{green}#@db; selected view: #{green}#{cgi['view']} + database: #{green}#{@db}; selected view: #{green}#{cgi['view']} search string: "#{green}#{analyze_format}"
- #{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} + #{p_text} #{p_fulltext} #{p_keywords} #{p_title} #{p_author} #{p_topic_register} #{p_subject} #{p_description} #{p_publisher} #{p_editor} #{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,result_type,checked_sql_limit,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=(@search_for.text1 =~/\S/) \ + ? @search_for.text1 + : 'Unavailable' + if checked_case=~/\S/ + @search[:text]<<%{doc_objects.clean~'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} + else + @search[:text]<<%{doc_objects.clean~*'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + end + #% dbi_request + dbi_statement=DBI_SearchStatement.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)}'} + @body_main << '



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



Endnotes:
' << sql_select_endnotes + else + end + @hostpath="#{@hosturl_files}/#{@stub}" + def path_manifest(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + @lingual =='mono' \ + ? "#{@hostpath}/#{fn}/sisu_manifest.html" + : "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html" + when 'filetype' + @lingual =='mono' \ + ? "#{@hostpath}/manifest/#{fn}.html" + : "#{@hostpath}/manifest/#{fn}.#{ln}.html" else - @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} - @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + "#{@hostpath}/#{ln}/manifest/#{fn}.html" 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 - @body_main << '



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



Endnotes:
' << sql_select_endnotes + end + def path_html_seg(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + "#{@hostpath}/#{fn}" + when 'filetype' + "#{@hostpath}/html/#{fn}" else + "#{@hostpath}/#{ln}/html/#{fn}" 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 - #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='' - 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 + end + def path_toc(fn,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/toc.html" + : "#{path_html_seg(fn,ln)}/toc.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/toc.html" + end + end + def path_filename(fn,seg,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/#{seg}.html" + : "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/#{seg}.html" + end + end + def path_endnotes(fn,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/endnotes.html" + : "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/endnotes.html" + end + end + def path_html_doc(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/scroll.html" + : "#{path_html_seg(fn,ln)}/scroll.#{ln}.html" + when 'filetype' + @lingual =='mono' \ + ? "#{@hostpath}/html/#{fn}.html" + : "#{@hostpath}/html/#{fn}.#{ln}.html" + else + "#{@hostpath}/#{ln}/html/#{fn}.html" + end + end + #% text_objects_body + s_contents.each do |c| #% text body + location=c['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1] + file_suffix=c['src_filename'][/.+?\.(ssm\.sst|sst)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location=location.gsub(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #% metadata_found_body + if c['tid'].to_i != oldtid.to_i + ti=c['title'] + can_txt_srch=(cgi['view']=~/index/) \ + ? %{search } + : %{search } + title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix + title=@text_search_flag \ + ? '

'+title + : '
'+title + @counter_txt_doc+=1 + oldtid=c['tid'].to_i + else title='' + end + if @text_search_flag + if cgi['view']=~/text/ \ + or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% 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'] - end - %{

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=title+index - end - else - @counter_txt_ocn+=1 - output=unless c['suffix'] =~/1/; title+index - else %{#{title}#{c['ocn'].sort}, } + @search_regx=if unescaped_search #check + search_regex=[] + build=unescaped_search.scan(/\S+/).each do |g| + (g.to_s =~/(AND|OR)/) \ + ? (search_regex << '|') + : (search_regex << %{#{g.to_s}}) + end + search_regex=search_regex.join(' ') + search_regex=search_regex.gsub(/\s*\|\s*/,'|') + Regexp.new(search_regex, Regexp::IGNORECASE) + else nil end + else nil end + matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) \ + ? (c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) + : c['body'] + %{


ocn #{c['ocn']}:

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

ocn #{c['ocn']}:#{c['body']}} 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 + @counter_txt_ocn+=1 + output=title+text + else #elsif cgi['view']=~/index/ #% idx body + if c['suffix'] !~/1/ #seg + index=%{#{c['ocn']}, } if @text_search_flag + elsif c['suffix'] =~/1/ #doc #FIX + index=%{#{c['ocn']}, } + end + if c['seg'] =~/\S+/ + if @text_search_flag + @counter_txt_ocn+=1 + output=title+index end - %{


Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} - else '' + else + @counter_txt_ocn+=1 + output=c['suffix'] !~/1/ \ + ? title+index + : %{#{title}#{c['ocn'].sort}, } 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=(@counter_txt_ocn==dbi_statement.sql_match_limit.to_i) ? true : false + start=(@@offset.to_i+1).to_s + range=(@@offset.to_i+@counter_txt_ocn.to_i).to_s + %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} else '' end + else '' + end + @body_main << output #+ details + end + #text_objects_endnote + oldtid = 0 + s_endnotes.each do |e| #% endnotes + location=e['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1] + file_suffix=e['src_filename'][/.+?\.(ssm\.sst|sst)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location=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 = '' - 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']}], } - 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 - else - over='' - false - end - %{Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.
} - else '' - end + if @text_search_flag + if e['metadata_tid'].to_i != oldtid.to_i + ti=e['title'] + can_txt_srch=(cgi['view']=~/index/) \ + ? %{search } + : %{search } + title=%{

toc html #{ti} [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}toc html manifest
} if file_suffix=~/s/ + @counter_endn_doc+=1 + oldtid=e['metadata_tid'].to_i + else title = '' + end + if cgi['view']=~/text/ \ + or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt endnotes + @counter_endn_ocn+=1 + matched_endnote=(@search_regx.to_s.is_a?(String) \ + && @search_regx.to_s=~/\S\S+/) \ + ? (matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) + : e['body'] + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + else #elsif cgi['view']=~/index/ #doc #FIX #% 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=@counter_endn_ocn==dbi_statement.sql_match_limit.to_i \ + ? true + : false + start=(@@offset.to_i+1).to_s + range=(@@offset.to_i+@counter_endn_ocn.to_i).to_s + %{Found #{@counter_endn_ocn} times in the endnotes of #{@counter_endn_doc} documents [ matches #{start} to #{range} ]
} + else '' end - @endnotes << output #+ details - else @endnotes=[] #does not take out yet end + @endnotes << output #+ details + else @endnotes='' #does not take out yet end - offset=dbi_statement.sql_offset.to_s - limit=dbi_statement.sql_limit.to_s - @@lt_t ||=false; @@lt_e ||=false - canned=if (@@lt_t or @@lt_e) - dbi_statement.sql_canned_search_url(true).to_s - else - dbi_statement.sql_canned_search_url(false).to_s - end - limit=dbi_statement.sql_limit.to_s - cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes end + offset=dbi_statement.sql_offset.to_s + limit=dbi_statement.sql_match_limit.to_s + @@lt_t ||=false; @@lt_e ||=false + canned=(@@lt_t or @@lt_e) \ + ? dbi_statement.pre_next(true,@image_src).to_s + : dbi_statement.pre_next(false,@image_src).to_s + limit=dbi_statement.sql_match_limit.to_s + cgi.out{@header.force_encoding("UTF-8") + @counters_txt.force_encoding("UTF-8") + @counters_endn.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @body_main.force_encoding("UTF-8") + @endnotes.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @tail.force_encoding("UTF-8")} #% print cgi_output_header+counters+body+endnotes + end rescue Exception => e s='
' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
           s << CGI::escapeHTML(e.message) + '
' diff --git a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi index 34bb3748..2bd9c09a 100644 --- a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi +++ b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi @@ -13,15 +13,13 @@ * Author: Ralph Amissah - * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Ralph Amissah All Rights Reserved. + * Copyright: (C) 1997 - 2014, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: SiSU, a framework for document structuring, publishing and search - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Ralph Amissah + Copyright (C) Ralph Amissah This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -39,7 +37,7 @@ If you have Internet connection, the latest version of the GPL should be available at these locations: - + * SiSU uses: @@ -59,26 +57,34 @@ =end - require 'cgi' - require 'fcgi' - require 'dbi' - @version='sisu_search_sqlite' - @image_src="http://localhost/sisu/_sisu/image" - @hosturl_db="http://localhost" - @hosturl_files="http://www.jus.uio.no" - @@limit,@@offset=1000,0 - @base="#@hosturl_db/cgi-bin/#@version.cgi" + begin + require 'cgi' + require 'fcgi' + require 'dbi' + rescue LoadError + puts 'cgi, fcgi or dbi NOT FOUND (LoadError)' + end + @stub_default='sisu_sqlite' + @image_src="http://#{ENV['HTTP_HOST']}/_sisu/image_sys" + @hosturl_cgi="http://#{ENV['HTTP_HOST']}#{ENV['PATH_INFO']}" + @hosturl_files="http://#{ENV['HTTP_HOST']}" + @output_dir_structure_by='language' + @lingual='multi' + @db_name_prefix='SiSUv6a_' + @base="http://#{ENV['HTTP_HOST']}#{ENV['PATH_INFO']}#{ENV['SCRIPT_NAME']}" +#Common TOP + @@offset=0 @@canned_search_url=@base @color_heading='#DDFFAA' @color_match='#ffff48' class Form - def initialize(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='') + def initialize(base,search_field,selected_db,result_type,checked_sql_limit,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='') search_note='' if checked_searched !~/\S/ the_can='' if checked_url !~/\S/ search_field='' if checked_echo !~/\S/ - @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=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 + @base,@search_field,@selected_db,@result_type,@checked_sql_limit,@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=base,search_field,selected_db,result_type,checked_sql_limit,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 @tip=if checked_tip =~/\S/ - 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' else '' end end @@ -94,53 +100,68 @@ - + - +
SiSU --> - - +
+ + +
+
+ SiSU + +
+ git + +
+
+
- +
- + - #@tip - #@search_note - #@the_can + #{@tip} + #{@search_note} + #{@the_can}
- + to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below)
- index - text / grep + index + text / grep +
+ match limit: + 1,000 + 2,500
- echo query - result stats - search url - searched - available fields - sql statement + echo query + result stats + search url + searched + available fields + sql statement
checks: - default - selected - all - none + default + selected + all + none
@@ -148,19 +169,21 @@ WOK end end - class Search_request #% search_for - attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename + class SearchRequest #% search_for + attr_accessor :text1,:fulltext,:keywords,:title,:author,:topic_register,:subject,:description,:publisher,:editor,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename def initialize(search_field='',q='') @search_field,@q=search_field,q - @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' + @text1=@fulltext=@keywords=@title=@author=@topic_register=@subject=@description=@publisher=@editor=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' if @search_field=~/\S/ @text1=text_to_match('text:') - @keywords=text_to_match('key(?:words?)?:') + @fulltext=text_to_match('fulltxt:') + @topic_register=text_to_match('topic_register:') @title=text_to_match('title:') # DublinCore 1 - title @author=text_to_match('(?:author|creator)s?:') # DublinCore 2 - creator/author @subject=text_to_match('subj(?:ect)?:') # DublinCore 3 - subject @description=text_to_match('description:') # DublinCore 4 - description @publisher=text_to_match('pub(?:lisher)?:') # DublinCore 5 - publisher + @editor=text_to_match('editor:') @contributor=text_to_match('contributor:') # DublinCore 6 - contributor @date=text_to_match('date:') # DublinCore 7 - date dd-mm-yy @type=text_to_match('type:') # DublinCore 8 - type @@ -171,6 +194,7 @@ @relation=text_to_match('relation:') # DublinCore 13 - relation @coverage=text_to_match('coverage:') # DublinCore 14 - coverage @rights=text_to_match('rights:') # DublinCore 15 - rights + @keywords=text_to_match('key(?:words?)?:') @comment=text_to_match('comment:') @abstract=text_to_match('abs(?:tract)?:') @owner=text_to_match('owner:') @@ -180,15 +204,18 @@ @date_available=text_to_match('date_available:') @date_valid=text_to_match('date_valid:') @filename=text_to_match('filename:') - @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename + @text1=text_to_match unless @keywords or @author or @title or @text1 or @fulltext or @comment or @abstract or @rights or @subject or @publisher or @date or @filename or @topic_register else @text1=q['s1'] if q['s1']=~/\S/ + @fulltext=q['ft'] if q['ft']=~/\S/ @keywords=q['key'] if q['key']=~/\S/ @title=q['ti'] if q['ti']=~/\S/ @author=q['au'] if q['au']=~/\S/ + @topic_register=q['tr'] if q['tr']=~/\S/ @subject=q['sj'] if q['sj']=~/\S/ @description=q['dsc'] if q['dsc']=~/\S/ @publisher=q['pb'] if q['pb']=~/\S/ + @editor=q['cntr'] if q['cntr']=~/\S/ @contributor=q['cntr'] if q['cntr']=~/\S/ @date=q['dt'] if q['dt']=~/\S/ @type=q['ty'] if q['ty']=~/\S/ @@ -205,46 +232,46 @@ @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=q['fns'] if q['fns']=~/\S/ + @filename=if q['doc'] and q['search'] !~/search db/ then q['doc'] + elsif q['fns']=~/\S/ then q['fns'] + end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 end end def text_to_match(identifier='') m={ - :string => /#{identifier}\s*(.+?)/, - :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, - :word => /#{identifier}[\s(]*(\S+)/ + string: /#{identifier}\s*(.+?)/, + string: /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, + word: /#{identifier}[\s(]*(\S+)/ } search_string=if @search_field =~m[:word] - search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] - elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] + search_string=if @search_field =~m[:braces] then m[:braces].match(@search_field)[1] + elsif @search_field =~m[:string] then m[:string].match(@search_field)[1] else str=m[:word].match(@search_field)[1] - str.gsub!(/[()]/,'') + str=str.gsub(/[()]/,'') str end - search_string.strip! - search_string.gsub!(/\s+/,'+') - search_string + search_string=search_string.strip.gsub(/\s+/,'+') #else # "__" end end end - class Dbi_search_string + class DBI_SearchString def initialize(l,t,q,cse=false) @l,@t,@q=l,t,q end def string - search={ :search => [],:flag => false } + search={ search: [], flag: false } if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + if @t =~/\S+/ then unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/ then unescaped_search=CGI.unescape(@q) end search_construct=[] - unescaped_search.gsub!(/\s*(AND|OR)\s*/,"%' \) \\1 #@l LIKE \( '%") - unescaped_search.gsub!(/(.+)/,"#@l LIKE \( '%\\1%' \)") + unescaped_search=unescaped_search.gsub(/\s*(AND|OR)\s*/,"%' \) \\1 #{@l} LIKE \( '%"). + gsub(/(.+)/,"#{@l} LIKE \( '%\\1%' \)") search_construct << unescaped_search search_construct=search_construct.join(' ') search[:search] << search_construct @@ -254,180 +281,217 @@ search end end - class Dbi_search_statement + class DBI_SearchStatement attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit def initialize(conn,search_for,q,c) @conn=conn @text_search_flag=false - @sql_statement={ :body=>'',:endnotes=>'',:range=>'' } + @sql_statement={ body: '', endnotes: '', range: '' } #@offset||=@@offset #@offset+=@@limit - search={ :text => [],:endnotes => [] } - cse=if c =~/\S/; true - else false - end - st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string - se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string + search={ text: [], endnotes: [] } + cse=(c =~/\S/) ? true : false + st=DBI_SearchString.new('doc_objects.clean',search_for.text1,q['s1'],cse).string + se=DBI_SearchString.new('endnotes.clean',search_for.text1,q['s1'],cse).string @text_search_flag=st[:flag] if st[:flag] search[:text] << st[:search] search[:endnotes] << se[:search] end - st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string + st=DBI_SearchString.new('metadata_and_text.fulltext',search_for.fulltext,q['ft'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=DBI_SearchString.new('metadata_and_text.title',search_for.title,q['ti'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=DBI_SearchString.new('metadata_and_text.creator_author',search_for.author,q['au'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_topic_register',search_for.topic_register,q['tr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_subject',search_for.subject,q['sj'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string + st=DBI_SearchString.new('metadata_and_text.classify_keywords',search_for.keywords,q['key'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_description',search_for.description,q['dsc'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string + st=DBI_SearchString.new('metadata_and_text.publisher',search_for.publisher,q['pb'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string + st=DBI_SearchString.new('metadata_and_text.creator_editor',search_for.editor,q['cntr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string + st=DBI_SearchString.new('metadata_and_text.creator_contributor',search_for.contributor,q['cntr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string + st=DBI_SearchString.new('metadata_and_text.date_published',search_for.date,q['dt'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_type',search_for.type,q['ty'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string + st=DBI_SearchString.new('metadata_and_text.original_source',search_for.source,q['src'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string + st=DBI_SearchString.new('metadata_and_text.language_document_char',search_for.language,q['lang'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_relation',search_for.relation,q['rel'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_coverage',search_for.coverage,q['cov'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string + st=DBI_SearchString.new('metadata_and_text.rights_all',search_for.rights,q['cr'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_comment',search_for.comment,q['co'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string + st=DBI_SearchString.new('metadata_and_text.notes_abstract',search_for.abstract,q['ab'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end - st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string + st=DBI_SearchString.new('metadata_and_text.src_filename',search_for.filename,q['fns'],cse).string if st[:flag] search[:text] << st[:search] search[:endnotes] << st[:search] end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 - @search_text,@search_endnotes=[],[] - #% - search[:text].each{|x| @search_text << "#{x} AND " } - @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') - search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } - @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') + @search_text,@search_endnotes='','' + @search_text=search[:text].flatten.join(' AND ') + @search_text=@search_text.gsub(/(doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') + @search_endnotes=search[:endnotes].flatten.join(' AND ') + @search_endnotes=@search_endnotes.gsub(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') end def sql_offset @@offset end - def sql_limit + def sql_match_limit @@limit end def sql_canned_search - @offset_next=sql_offset.to_i + sql_limit.to_i - @offset_previous=sql_offset.to_i - sql_limit.to_i + @offset_next=sql_offset.to_i + sql_match_limit.to_i + @offset_previous=sql_offset.to_i - sql_match_limit.to_i def current - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s + @@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + sql_offset.to_s end def next - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s + @@canned_search_url.to_s + '<d=' + sql_match_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_match_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 + @@canned_search_url.to_s + '<d=' + sql_match_limit.to_s + '&off=' + 0.to_s end self end - def sql_canned_search_url(ok) - if ok - can=sql_canned_search - page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i - case page.to_s - when /^1$/ - %{

+ def pre_next(beyond_limit,img) + can=sql_canned_search + page=(sql_offset.to_i + sql_match_limit.to_i)/sql_match_limit.to_i + if beyond_limit + if page.to_s =~ /^1$/ + %{
pg. #{page.to_s} -   > + +  >> +
} - when /^2$/ - %{

- <   + elsif page.to_s =~ /^2$/ + %{
+ + <<  + pg. #{page.to_s} -   > + +  >> +
} else - %{

- |<   - <   + %{
+ + |<  + + + <<  + + pg. #{page.to_s} + +  >> + +
} + end + else + if page.to_s =~ /^1$/ then '' + elsif page.to_s =~ /^2$/ + %{
+ + <<  + + pg. #{page.to_s} +
} + else + %{
+ + |<  + + + <<  + pg. #{page.to_s} -   >
} end - else '' end end def sql_select_body limit ||=@@limit offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:body]=%{SELECT metadata_and_text.title, metadata_and_text.creator_author, metadata_and_text.src_filename, metadata_and_text.language_document_char, metadata_and_text.notes_suffix, doc_objects.body, doc_objects.seg, doc_objects.ocn, metadata_and_text.tid FROM doc_objects, metadata_and_text WHERE #{@search_text} AND doc_objects.metadata_tid = metadata_and_text.tid ORDER BY metadata_and_text.language_document_char, metadata_and_text.title, metadata_and_text.src_filename, doc_objects.ocn} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:body] + ' ' + @sql_statement[:range] select @@ -435,7 +499,7 @@ def sql_select_endnotes limit ||=@@limit offset ||=@@offset - @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.subtitle, 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, metadata.filename, endnotes.nr} + @sql_statement[:endnotes]=%{SELECT metadata_and_text.title, metadata_and_text.creator_author, metadata_and_text.src_filename, metadata_and_text.language_document_char, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata_and_text, endnotes WHERE #{@search_endnotes} AND metadata_and_text.tid = endnotes.metadata_tid ORDER BY metadata_and_text.language_document_char, metadata_and_text.title, metadata_and_text.src_filename, endnotes.nr} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] select @@ -459,26 +523,29 @@ + @@ -508,7 +588,7 @@
-

- - SiSU - -

-
+ + +
+
+ SiSU + +
+ git + +
+

Generated by - - SiSU 0.55.3 2007-07-10 (2007w28/2) + SiSU 6.0.3 2014-02-06 (2014w05/4)
- + SiSU © Ralph Amissah - 1993, current 2007. + 1993, current 2014. All Rights Reserved.
- - SiSU - is software for document structuring, publishing and search, + SiSU is software for document structuring, publishing and search,
www.jus.uio.no/sisu @@ -487,20 +554,33 @@ www.sisudoc.org + sources + + git.sisudoc.org +
w3 since October 3 1993 - + ralph@amissah.com +
+ mailing list subscription + + http://lists.sisudoc.org/listinfo/sisu + +
+ + sisu@lists.sisudoc.org +

SiSU using:
Standard SiSU markup syntax,
Standard SiSU meta-markup syntax, and the -
Standard SiSU object citation numbering and system, (object/text positioning system) +
Standard SiSU object citation numbering and system, (object/text identifying/locating system)
- © Ralph Amissah 1997, current 2007. + © Ralph Amissah 1997, current 2014. All Rights Reserved.

- GPLv3 + .:

@@ -532,14 +612,6 @@ software infrastructure, with the usual GPL (or OSS) suspects. -
- Better - "performance, reliability, scalability, security & total cost of ownership" - [not to mention flexibility & choice] -
- Get With the Future - - Way Better! -

@@ -552,18 +624,25 @@ @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','','' FCGI.each_cgi do |cgi| begin # all code goes in begin section - @search={ :text => [],:endnotes => [] } + @search={ text: [], endnotes: [] } q=CGI.new - @db=if cgi['db'] =~/\S+/; - @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + @db=if cgi['db'] =~ /#{@db_name_prefix}(\S+)/ + @stub=$1 cgi['db'] else - @stub='sisu' - 'SiSU_sisu' + @stub=@stub_default + @db_name_prefix + @stub end checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','','' - if cgi['view']=~/text/; checked_index,checked_text='','checked' - else checked_index,checked_text='checked','' + result_type=(cgi['view']=~/text/) \ + ? result_type={ index: '', text: 'checked'} + : result_type={ index: 'checked', text: ''} + @@limit=if cgi['sql_match_limit'].to_s=~/2500/ + checked_sql_limit={ l1000: '', l2500: 'checked'} + '2500' + else + checked_sql_limit={ l1000: 'checked', l2500: ''} + '1000' end checked_echo='checked' if cgi['echo'] =~/\S/ checked_stats='checked' if cgi['stats'] =~/\S/ @@ -591,28 +670,32 @@ checked_searched=checked_tip=checked_case=checked_sql='' end selected_db=case cgi['db'] - when /SiSU_pace/; '' - when /SiSU_sisu/; '' + when /SiSUv6a_manual/ then '' + when /SiSUv6a_sisu/ then '' end db_name='sisu_sqlite.db' db_sqlite=case cgi['db'] - when /SiSU_pace/; "/home/ralph/sisu_www/pace/sisu_sqlite.db" - when /SiSU_sisu/; "/home/ralph/sisu_www/sisu/sisu_sqlite.db" + when /SiSUv6a_manual/ then "/srv/www/manual/#{db_name}" + when /SiSUv6a_sisu/ then "/srv/www/sisu/#{db_name}" + else '/srv/www/manual/#{db_name}' end - @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? + @dbi="DBI:SQLite3:#{db_sqlite}" #sqlite3 ? @conn=DBI.connect(@dbi) search_field=cgi['find'] if cgi['find'] # =~/\S+/ - @search_for=Search_request.new(search_field,q) #.analyze #% search_for + @search_for=SearchRequest.new(search_field,q) #.analyze #% search_for #% searches #Canned_search.new(@base,@search_for.text1,cgi) - if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/ + if @search_for.text1=~/\S+/ or @search_for.fulltext=~/\S+/ or @search_for.author=~/\S+/ or @search_for.topic_register=~/\S+/ #and search_field =~/\S/ s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/ + ft='&ft=' + CGI.escape(@search_for.fulltext) if @search_for.fulltext=~/\S/ key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/ ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/ au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/ + tr='&tr=' + CGI.escape(@search_for.topic_register) if @search_for.topic_register=~/\S/ sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/ dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/ pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/ + edt='&edt=' + CGI.escape(@search_for.editor) if @search_for.editor=~/\S/ cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/ dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/ ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/ @@ -630,33 +713,35 @@ dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/ dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ - @@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}#{fns}&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}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" - end - @canned_base_url="#@base?#{s1}&db=#{cgi['db']}" + @@canned_search_url=(checked_all =~/checked/) \ + ? "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" + : "#{@base}?#{s1}#{ft}#{key}#{ti}#{au}#{tr}#{sj}#{dsc}#{pb}#{edt}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" + mod=ft=~/\S+/ ? (ft.gsub(/ft/,'s1')) : s1 + @canned_base_url="#{@base}?#{mod}&db=#{cgi['db']}" if checked_case=~/\S/ - @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 + @search[:text][1]=%{doc_objects.clean~'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 else - @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1 + @search[:text][1]=%{doc_objects.clean~*'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1 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+/ analyze_format=search_field.gsub(/\s*\n/,'; ') elsif checked_all =~/checked/ or checked_url =~/checked/ - canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/) + canned_search=@@canned_search_url.scan(/(?:s1|ft|au|ti|fns|tr)=[^&]+/) af=canned_search.join('; ') - af.gsub!(/s1=/,'text: ') - af.gsub!(/au=/,'author: ') - af.gsub!(/ti=/,'title: ') - af.gsub!(/fns=/,'filename: ') - af.gsub!(/%2B/,' ') + af=af.gsub(/s1=/,'text: '). + gsub(/ft=/,'fulltxt: '). + gsub(/au=/,'author: '). + gsub(/ti=/,'title: '). + gsub(/fns=/,'filename: '). + gsub(/tr=/,'topic_register: '). + gsub(/%2B/,' ') analyze_format=af st=af.split(/\s*;\s*/) search_field=st.join("\n") @@ -664,232 +749,292 @@ green=%{} canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) the_can=%{#{canned_note} #{canned_search_url_txt}
} - 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_subject=p_filename='' + p_text=p_fulltext=p_keywords=p_title=p_author=p_topic_register=p_subject=p_description=p_publisher=p_editor=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='' + p_filename=%{filename: #{green}#{@search_for.filename}

} if @search_for.filename =~/\S+/ p_text=%{text: #{green}#{@search_for.text1}

} if @search_for.text1 =~/\S+/ - p_keywords=%{keywords: #{green}#{@search_for.keywords}

} if @search_for.keywords =~/\S+/ + p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ - p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ - p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ - p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ - p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ - p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ - p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ - p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ - p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ - p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ search_note=<<-WOK - database: #{green}#@db; selected view: #{green}#{cgi['view']} + database: #{green}#{@db}; selected view: #{green}#{cgi['view']} search string: "#{green}#{analyze_format}"
- #{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} + #{p_text} #{p_fulltext} #{p_keywords} #{p_title} #{p_author} #{p_topic_register} #{p_subject} #{p_description} #{p_publisher} #{p_editor} #{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,result_type,checked_sql_limit,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=(@search_for.text1 =~/\S/) \ + ? @search_for.text1 + : 'Unavailable' + if checked_case=~/\S/ + @search[:text]<<%{doc_objects.clean~'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} + else + @search[:text]<<%{doc_objects.clean~*'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + end + #% dbi_request + dbi_statement=DBI_SearchStatement.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)}'} + @body_main << '



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



Endnotes:
' << sql_select_endnotes + else + end + @hostpath="#{@hosturl_files}/#{@stub}" + def path_manifest(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + @lingual =='mono' \ + ? "#{@hostpath}/#{fn}/sisu_manifest.html" + : "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html" + when 'filetype' + @lingual =='mono' \ + ? "#{@hostpath}/manifest/#{fn}.html" + : "#{@hostpath}/manifest/#{fn}.#{ln}.html" else - @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} - @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + "#{@hostpath}/#{ln}/manifest/#{fn}.html" 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 - @body_main << '



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



Endnotes:
' << sql_select_endnotes + end + def path_html_seg(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + "#{@hostpath}/#{fn}" + when 'filetype' + "#{@hostpath}/html/#{fn}" else + "#{@hostpath}/#{ln}/html/#{fn}" 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 - #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='' - 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 + end + def path_toc(fn,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/toc.html" + : "#{path_html_seg(fn,ln)}/toc.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/toc.html" + end + end + def path_filename(fn,seg,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/#{seg}.html" + : "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/#{seg}.html" + end + end + def path_endnotes(fn,ln=nil) + if @output_dir_structure_by =='filename' \ + or @output_dir_structure_by =='filetype' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/endnotes.html" + : "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html" + else + "#{path_html_seg(fn,ln)}/endnotes.html" + end + end + def path_html_doc(fn,ln=nil) + case @output_dir_structure_by + when 'filename' + @lingual =='mono' \ + ? "#{path_html_seg(fn,ln)}/scroll.html" + : "#{path_html_seg(fn,ln)}/scroll.#{ln}.html" + when 'filetype' + @lingual =='mono' \ + ? "#{@hostpath}/html/#{fn}.html" + : "#{@hostpath}/html/#{fn}.#{ln}.html" + else + "#{@hostpath}/#{ln}/html/#{fn}.html" + end + end + #% text_objects_body + s_contents.each do |c| #% text body + location=c['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1] + file_suffix=c['src_filename'][/.+?\.(ssm\.sst|sst)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location=location.gsub(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #% metadata_found_body + if c['tid'].to_i != oldtid.to_i + ti=c['title'] + can_txt_srch=(cgi['view']=~/index/) \ + ? %{search } + : %{search } + title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix + title=@text_search_flag \ + ? '

'+title + : '
'+title + @counter_txt_doc+=1 + oldtid=c['tid'].to_i + else title='' + end + if @text_search_flag + if cgi['view']=~/text/ \ + or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% 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'] - end - %{

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=title+index - end - else - @counter_txt_ocn+=1 - output=unless c['suffix'] =~/1/; title+index - else %{#{title}#{c['ocn'].sort}, } + @search_regx=if unescaped_search #check + search_regex=[] + build=unescaped_search.scan(/\S+/).each do |g| + (g.to_s =~/(AND|OR)/) \ + ? (search_regex << '|') + : (search_regex << %{#{g.to_s}}) + end + search_regex=search_regex.join(' ') + search_regex=search_regex.gsub(/\s*\|\s*/,'|') + Regexp.new(search_regex, Regexp::IGNORECASE) + else nil end + else nil end + matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) \ + ? (c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) + : c['body'] + %{


ocn #{c['ocn']}:

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

ocn #{c['ocn']}:#{c['body']}} 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 + @counter_txt_ocn+=1 + output=title+text + else #elsif cgi['view']=~/index/ #% idx body + if c['suffix'] !~/1/ #seg + index=%{#{c['ocn']}, } if @text_search_flag + elsif c['suffix'] =~/1/ #doc #FIX + index=%{#{c['ocn']}, } + end + if c['seg'] =~/\S+/ + if @text_search_flag + @counter_txt_ocn+=1 + output=title+index end - %{


Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} - else '' + else + @counter_txt_ocn+=1 + output=c['suffix'] !~/1/ \ + ? title+index + : %{#{title}#{c['ocn'].sort}, } 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=(@counter_txt_ocn==dbi_statement.sql_match_limit.to_i) ? true : false + start=(@@offset.to_i+1).to_s + range=(@@offset.to_i+@counter_txt_ocn.to_i).to_s + %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} else '' end + else '' + end + @body_main << output #+ details + end + #text_objects_endnote + oldtid = 0 + s_endnotes.each do |e| #% endnotes + location=e['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1] + file_suffix=e['src_filename'][/.+?\.(ssm\.sst|sst)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location=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 = '' - 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']}], } - 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 - else - over='' - false - end - %{Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.
} - else '' - end + if @text_search_flag + if e['metadata_tid'].to_i != oldtid.to_i + ti=e['title'] + can_txt_srch=(cgi['view']=~/index/) \ + ? %{search } + : %{search } + title=%{

toc html #{ti} [#{e['language_document_char']}] by #{e['creator_author']} #{can_txt_srch}toc html manifest
} if file_suffix=~/s/ + @counter_endn_doc+=1 + oldtid=e['metadata_tid'].to_i + else title = '' + end + if cgi['view']=~/text/ \ + or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt endnotes + @counter_endn_ocn+=1 + matched_endnote=(@search_regx.to_s.is_a?(String) \ + && @search_regx.to_s=~/\S\S+/) \ + ? (matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})) + : e['body'] + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + else #elsif cgi['view']=~/index/ #doc #FIX #% 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=@counter_endn_ocn==dbi_statement.sql_match_limit.to_i \ + ? true + : false + start=(@@offset.to_i+1).to_s + range=(@@offset.to_i+@counter_endn_ocn.to_i).to_s + %{Found #{@counter_endn_ocn} times in the endnotes of #{@counter_endn_doc} documents [ matches #{start} to #{range} ]
} + else '' end - @endnotes << output #+ details - else @endnotes=[] #does not take out yet end + @endnotes << output #+ details + else @endnotes='' #does not take out yet end - offset=dbi_statement.sql_offset.to_s - limit=dbi_statement.sql_limit.to_s - @@lt_t ||=false; @@lt_e ||=false - canned=if (@@lt_t or @@lt_e) - dbi_statement.sql_canned_search_url(true).to_s - else - dbi_statement.sql_canned_search_url(false).to_s - end - limit=dbi_statement.sql_limit.to_s - cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes end + offset=dbi_statement.sql_offset.to_s + limit=dbi_statement.sql_match_limit.to_s + @@lt_t ||=false; @@lt_e ||=false + canned=(@@lt_t or @@lt_e) \ + ? dbi_statement.pre_next(true,@image_src).to_s + : dbi_statement.pre_next(false,@image_src).to_s + limit=dbi_statement.sql_match_limit.to_s + cgi.out{@header.force_encoding("UTF-8") + @counters_txt.force_encoding("UTF-8") + @counters_endn.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @body_main.force_encoding("UTF-8") + @endnotes.force_encoding("UTF-8") + canned.force_encoding("UTF-8") + @tail.force_encoding("UTF-8")} #% print cgi_output_header+counters+body+endnotes + end rescue Exception => e s='
' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
           s << CGI::escapeHTML(e.message) + '
' diff --git a/data/sisu/conf/nginx/sites-available/sisu_search b/data/sisu/conf/nginx/sites-available/sisu_search new file mode 100644 index 00000000..0eb9f8ae --- /dev/null +++ b/data/sisu/conf/nginx/sites-available/sisu_search @@ -0,0 +1,83 @@ +# You may add here your +# server { +# ... +# } +# statements for each of your virtual hosts to this file + +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# http://wiki.nginx.org/Pitfalls +# http://wiki.nginx.org/QuickStart +# http://wiki.nginx.org/Configuration +# +# Generally, you will want to move this file somewhere, and start with a clean +# file but keep this around for reference. Or just disable in sites-enabled. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + root /srv/www; + #root /usr/share/nginx/html; + index index.html toc.html; + + #cat /usr/share/doc/fcgiwrap/examples/nginx.conf + # Include this file on your nginx.conf to support debian cgi-bin scripts using + # fcgiwrap + location /cgi-bin/ { + # Disable gzip (it makes scripts feel slower since they have to complete + # before getting gzipped) + gzip off; + + # Set the root to /usr/lib (inside this location this means that we are + # giving access to the files under /usr/lib/cgi-bin) + root /usr/lib; + + # Fastcgi socket + fastcgi_pass unix:/var/run/fcgiwrap.socket; + + # Fastcgi parameters, include the standard ones + include /etc/nginx/fastcgi_params; + + # Adjust non standard parameters (SCRIPT_FILENAME) + fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name; + } + + # Make site accessible from http://localhost/ + server_name localhost; + + #location / { + # # First attempt to serve request as file, then + # # as directory, then fall back to displaying a 404. + # try_files $uri $uri/ =404; + # # Uncomment to enable naxsi on this location + # # include /etc/nginx/naxsi.rules + #} + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + #error_page 500 502 503 504 /50x.html; + #location = /50x.html { + # root /usr/share/nginx/html; + #} +} + +# another virtual host using mix of IP-, name-, and port-based configuration +# +#server { +# listen 8000; +# listen somename:8080; +# server_name somename alias another.alias; +# root html; +# index index.html index.htm; +# +# location / { +# try_files $uri $uri/ =404; +# } +#} diff --git a/data/sisu/conf/nginx/sites-available/sisu_search_srv b/data/sisu/conf/nginx/sites-available/sisu_search_srv new file mode 100644 index 00000000..41585505 --- /dev/null +++ b/data/sisu/conf/nginx/sites-available/sisu_search_srv @@ -0,0 +1,84 @@ +# You may add here your +# server { +# ... +# } +# statements for each of your virtual hosts to this file + +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# http://wiki.nginx.org/Pitfalls +# http://wiki.nginx.org/QuickStart +# http://wiki.nginx.org/Configuration +# +# Generally, you will want to move this file somewhere, and start with a clean +# file but keep this around for reference. Or just disable in sites-enabled. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + root /srv/www; + #root /usr/share/nginx/html; + index index.html toc.html; + + #cat /usr/share/doc/fcgiwrap/examples/nginx.conf + # Include this file on your nginx.conf to support debian cgi-bin scripts using + # fcgiwrap + location /cgi/ { + # Disable gzip (it makes scripts feel slower since they have to complete + # before getting gzipped) + gzip off; + + # Set the root to /srv (inside this location this means that we are + # giving access to the files under /srv/cgi) + root /srv; + + # Fastcgi socket + fastcgi_pass unix:/var/run/fcgiwrap.socket; + + # Fastcgi parameters, include the standard ones + include /etc/nginx/fastcgi_params; + + # Adjust non standard parameters (SCRIPT_FILENAME) + fastcgi_param SCRIPT_FILENAME /srv$fastcgi_script_name; + #fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name; + } + + # Make site accessible from http://localhost/ + server_name localhost; + + #location / { + # # First attempt to serve request as file, then + # # as directory, then fall back to displaying a 404. + # try_files $uri $uri/ =404; + # # Uncomment to enable naxsi on this location + # # include /etc/nginx/naxsi.rules + #} + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + #error_page 500 502 503 504 /50x.html; + #location = /50x.html { + # root /usr/share/nginx/html; + #} +} + +# another virtual host using mix of IP-, name-, and port-based configuration +# +#server { +# listen 8000; +# listen somename:8080; +# server_name somename alias another.alias; +# root html; +# index index.html index.htm; +# +# location / { +# try_files $uri $uri/ =404; +# } +#} -- cgit v1.2.3