aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/cgi_sql_common.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-05-15 23:29:27 -0400
committerRalph Amissah <ralph@amissah.com>2011-05-15 23:29:32 -0400
commita09e2e639175b83e82e3087c1e8c49acdc2f8662 (patch)
tree4e3983891e7b90f3686b8e717f0a448cce594068 /lib/sisu/v3/cgi_sql_common.rb
parentv3: sysenv, output_path & place_file, modified, (affects many libraries) (diff)
v3: cgi sample search form, differ depending on output directory structure
Diffstat (limited to 'lib/sisu/v3/cgi_sql_common.rb')
-rw-r--r--lib/sisu/v3/cgi_sql_common.rb74
1 files changed, 40 insertions, 34 deletions
diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb
index 1174be6e..0f56f77f 100644
--- a/lib/sisu/v3/cgi_sql_common.rb
+++ b/lib/sisu/v3/cgi_sql_common.rb
@@ -58,8 +58,9 @@
=end
module SiSU_CGI_sql
class SiSU_CGI_common
- def initialize(webserv,cmd,image_src,dir)
- @webserv,@cmd,@image_src,@env=webserv,cmd,image_src,dir
+ def initialize(webserv,opt,image_src,dir)
+ @webserv,@opt,@image_src,@env=webserv,opt,image_src,dir
+ @cmd=opt.cmd
end
def about
<<-'WOK_SQL'
@@ -829,45 +830,50 @@ module SiSU_CGI_sql
end
@hostpath="#{@hosturl_files}/#{@stub}"
@ln='en'
- def output_dir_structure
- def by_language_code?
- true
- end
- def by_filetype?
- false
- end
- def by_filename?
- false
- end
- self
+ WOK_SQL
+ end
+ def dir_structure
+ case @opt.dir_structure_by
+ when /language/
+ <<-'WOK_SQL'
+ def path_manifest(fn,ln=nil)
+ "#{@hostpath}/#{ln}/manifest/#{fn}.manifest.html"
end
+ def path_html_seg(fn,ln=nil)
+ "#{@hostpath}/#{ln}/html/#{fn}"
+ end
+ def path_html_doc(fn,ln=nil)
+ "#{@hostpath}/#{ln}/html/#{fn}.html"
+ end
+ WOK_SQL
+ when /filetype/
+ <<-'WOK_SQL'
def path_manifest(fn,ln=nil)
- if output_dir_structure.by_language_code?
- manifest_at="#{@hostpath}/#{ln}/manifest/#{fn}.manifest.html"
- elsif output_dir_structure.by_filetype?
- manifest_at="#{@hostpath}/manifest/#{fn}.manifest.html"
- elsif output_dir_structure.by_filename?
- manifest_at="#{@hostpath}/#{fn}/manifest.html"
- end
+ "#{@hostpath}/manifest/#{fn}.manifest.html"
end
def path_html_seg(fn,ln=nil)
- if output_dir_structure.by_language_code?
- html_at="#{@hostpath}/#{ln}/html/#{fn}"
- elsif output_dir_structure.by_filetype?
- html_at="#{@hostpath}/html/#{fn}"
- elsif output_dir_structure.by_filename?
- html_at="#{@hostpath}/#{fn}"
- end
+ "#{@hostpath}/html/#{fn}"
end
def path_html_doc(fn,ln=nil)
- if output_dir_structure.by_language_code?
- html_at="#{@hostpath}/#{ln}/html/#{fn}.html"
- elsif output_dir_structure.by_filetype?
- html_at="#{@hostpath}/html/#{fn}.html"
- elsif output_dir_structure.by_filename?
- html_at="#{@hostpath}/#{fn}/doc.html"
- end
+ "#{@hostpath}/html/#{fn}.html"
+ end
+ WOK_SQL
+ else
+ <<-'WOK_SQL'
+ def path_manifest(fn,ln=nil)
+ "#{@hostpath}/#{fn}/manifest.html"
+ end
+ def path_html_seg(fn,ln=nil)
+ "#{@hostpath}/#{fn}"
end
+ def path_html_doc(fn,ln=nil)
+ "#{@hostpath}/#{fn}/doc.html"
+ end
+ WOK_SQL
+ end
+ end
+ def main3
+ <<-'WOK_SQL'
#% text_objects_body
s_contents.each do |c| #% text body
location=c['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1]