From d41a95421c18b10bb7e100ccd1d4f3e56743b032 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 19 Oct 2007 02:25:55 +0100 Subject: mostly adjustment to image paths (for local and remote operations) --- .../sisu_manual/sisu_content_directories.ssi | 84 ++++++++++++++++++++++ lib/sisu/v0/cgi_pgsql.rb | 4 +- lib/sisu/v0/cgi_sqlite.rb | 4 +- lib/sisu/v0/conf.rb | 12 ++++ lib/sisu/v0/defaults.rb | 2 +- lib/sisu/v0/sysenv.rb | 18 ++--- 6 files changed, 111 insertions(+), 13 deletions(-) diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_content_directories.ssi b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_content_directories.ssi index 217eade6..343af720 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_content_directories.ssi +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_content_directories.ssi @@ -53,8 +53,92 @@ The output directory root can be set in the sisurc.yml file. Under the root, sub The last part of a directory path, representing the sub-directory in which a document set resides, is the directory name that will be used for the output directory. This has implications for the organisation of document collections as it could make sense to place documents of a particular subject, or type within a directory identifying them. This grouping as suggested could be by subject (sales_law, english_literature); or just as conveniently by some other classification (X University). The mapping means it is also possible to place in the same output directory documents that are for organisational purposes kept separately, for example documents on a given subject of two different institutions may be kept in two different directories of the same name, under a directory named after each institution, and these would be output to the same output directory. Skins could be associated with each institution on a directory basis and resulting documents will take on the appropriate different appearance. +3~ General Directories + +code{ + +./subject_name/ + +% files stored at this level e.g. sisu_manual.sst + +./subject_name/_sisu + +% configuration file e.g. sisurc.yml + +./subject_name/_sisu/skin + +% skins in various skin directories doc, dir, site, yml + +./subject_name/_sisu/css + +./subject_name/_sisu/image + +% images for documents contained in this directory + +./subject_name/_sisu/mm + +}code + +3~ Remote Directories + +code{ + +./subject_name/ + +% containing sub_directories named after the generated files from which they are made + +./subject_name/src + +% contains shared source files text and binary e.g. sisu_manual.sst and sisu_manual.sst.zip + +./subject_name/_sisu + +% configuration file e.g. sisurc.yml + +./subject_name/_sisu/skin + +% skins in various skin directories doc, dir, site, yml + +./subject_name/_sisu/css + +./subject_name/_sisu/image + +% images for documents contained in this directory + +./subject_name/_sisu/mm + +}code + +3~ Sisupod + +code{ + +./sisupod/ + +% files stored at this level e.g. sisu_manual.sst + +./sisupod/_sisu + +% configuration file e.g. sisurc.yml + +./sisupod/_sisu/skin + +% skins in various skin directories doc, dir, site, yml + +./sisupod/_sisu/css + +./sisupod/_sisu/image + +% images for documents contained in this directory + +./sisupod/_sisu/mm + +}code + 2~ Organising Content + + % .SH "SKINS \- document, directory and site skins" diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index 796c49c8..b5012fdd 100644 --- a/lib/sisu/v0/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -63,7 +63,7 @@ module SiSU_CGI_pgsql @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) @sys=SiSU_Env::System_call.new - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) @db=SiSU_Env::Info_db.new #p @db.port_psql @@ -130,7 +130,7 @@ module SiSU_CGI_pgsql require 'fcgi' require 'dbi' @version='sisu_pgsql' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @hosturl_db="#{@env.url.webserv_base_cgi}" @hosturl_files="#{@env.url.webserv_files_from_db}" @port="#{@db.port_psql}" diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb index 27c20163..ef62cd35 100644 --- a/lib/sisu/v0/cgi_sqlite.rb +++ b/lib/sisu/v0/cgi_sqlite.rb @@ -62,7 +62,7 @@ module SiSU_CGI_sqlite def initialize(opt,webserv) @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) end def sqlite @@ -128,7 +128,7 @@ module SiSU_CGI_sqlite require 'fcgi' require 'dbi' @version='sisu_sqlite' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @hosturl_db="#{@env.url.webserv_base_cgi}" @hosturl_files="#{@env.url.webserv_files_from_db}" WOK_SQL diff --git a/lib/sisu/v0/conf.rb b/lib/sisu/v0/conf.rb index 92632e79..eb054906 100644 --- a/lib/sisu/v0/conf.rb +++ b/lib/sisu/v0/conf.rb @@ -62,6 +62,8 @@ module SiSU_Initialize include SiSU_relaxng require "#{SiSU_lib}/css" include SiSU_Style + #require "#{SiSU_lib}/remote" + #include SiSU_Remote class Source def initialize(opt) @opt=opt @@ -73,6 +75,9 @@ module SiSU_Initialize SiSU_Config.new(@opt).cp_local_images SiSU_Config.new(@opt).cp_external_images SiSU_Config.new(@opt).cp_webserver_images #if @opt.mod.inspect =~/--init(?:ialize)?=site/ + #if @opt.cmd =~/R/ + # SiSU_Config.new(@opt).cp_remote_dirs + #end end end class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier @@ -115,6 +120,13 @@ module SiSU_Initialize SiSU_Env::Create_site.new(@opt.cmd).cp_webserver_images SiSU_Env::Create_system_link.new.images end + #def cp_remote_dirs + # if @opt.cmd =~/R/ + # tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images to remote server','') + # tell.colorize unless @opt.cmd =~/q/ + # SiSU_Remote::Put.new(@opt).rsync_base + # end + #end def css tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','') tell.colorize unless @opt.cmd =~/q/ diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb index e75ba2e3..5701e571 100644 --- a/lib/sisu/v0/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -200,7 +200,7 @@ module SiSU_Viz 'www.jus.uio.no/sisu' end def url_path_image_base #used for html image display - '../_sisu/image_local' + '../_sisu/image' end def url_path_image #used for html image display '../_sisu/image' diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 3f92e9b7..5d7dc7d8 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -2378,14 +2378,14 @@ WOK and @@flag_remote==true \ and @opt.cmd !~/U/ puts "begin scp_base_all: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).scp System_call.new("#{local}/_sisu/image/",remote).scp - System_call.new("#{local}/_sisu/image_local/",remote).scp System_call.new("#{local}/#{@env.path.style}/",remote).scp elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "scp_base_all: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2394,21 +2394,23 @@ WOK def rsync_base #base site ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu" image_sys="#{@env.path.webserv}/_sisu/image_sys" + images="#{@env.path.webserv}/_sisu/image" self.remote_host_base.each do |remote_conn| remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." - remote_sys="#{remote_conn[:name]}/_sisu" + remote_conf="#{remote_conn[:name]}/_sisu" if defined? @rc['permission_set']['remote_base_site'] \ and @rc['permission_set']['remote_base_site'] \ and @@flag_remote==true \ and @opt.cmd !~/U/ #puts "begin rsync_base: #{local} -> #{remote}" - System_call.new("#{image_sys}","#{remote_sys}").rsync + System_call.new("#{image_sys}","#{remote_conf}").rsync + System_call.new("#{images}","#{remote_conf}").rsync System_call.new("#{ldest}","#{remote}").rsync elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base: #{local} -> #{remote}" - puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" + puts "#{local}/_sisu/image -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2423,14 +2425,14 @@ WOK and @@flag_remote==true \ and @opt.cmd !~/U/ puts "begin rsync_base_sync: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).rsync('--delete-after') System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after') - System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after') System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after') elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base_sync: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end -- cgit v1.2.3