From 6811ac91f21a434fc7d967c11e1b20f33918c6ea Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 19 Mar 2012 22:07:29 -0400 Subject: v3: 3.2 branch is main (v3dv --> v3); dev (v3dv) branch directories removed * v3dv (3.2) "merged" into v3 (previously 3.1) (& removed) * conf/sisu/v3dv --> conf/sisu/v3 * data/sisu/v3dv --> data/sisu/v3 * lib/sisu/v3dv --> lib/sisu/v3 * bin/sisu* (v3dv references changed to v3) * (--dev modifier (superfluous for the time being) runs main v3 branch) --- lib/sisu/v3/db_import.rb | 236 ++++++++++++++++++++++++++--------------------- 1 file changed, 130 insertions(+), 106 deletions(-) (limited to 'lib/sisu/v3/db_import.rb') diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index a78a0656..3bb6e210 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -57,13 +57,13 @@ sqlite =end -module SiSU_DB_import +module SiSU_DbImport require_relative 'db_columns' # db_columns.rb require_relative 'db_load_tuple' # db_load_tuple.rb require_relative 'db_sqltxt' # db_sqltxt.rb require_relative 'shared_html_lite' # shared_html_lite.rb require 'sqlite3' - class Import < SiSU_DB_text::Prepare + class Import < SiSU_DbText::Prepare include SiSU_Param include SiSU_Screen @@dl=nil @@ -72,7 +72,7 @@ module SiSU_DB_import def initialize(opt,conn,file,sql_type='pg') @opt,@conn,@file,@sql_type=opt,conn,file,sql_type @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - @env=SiSU_Env::Info_env.new(@opt.fns) + @env=SiSU_Env::InfoEnv.new(@opt.fns) @dal="#{@env.processing_path.dal}" if @opt.fns.empty? or @opt.cmd.empty?; @fnb='' else @@ -85,7 +85,7 @@ module SiSU_DB_import @col=Hash.new('') @col[:ocn]='' @counter={} - @db=SiSU_Env::Info_db.new + @db=SiSU_Env::InfoDb.new if @sql_type=='sqlite' @driver_sqlite3=(@conn.inspect.match(/^(.{10})/)[1]==@db.sqlite.conn_sqlite3.inspect.match(/^(.{10})/)[1]) \ ? true @@ -112,8 +112,9 @@ module SiSU_DB_import end @id_n =0 if @col[:lid].nil? or @col[:lid].to_s.empty? @col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0 - @db=SiSU_Env::Info_db.new - @@dl ||=SiSU_Env::Info_env.new.digest.length + @db=SiSU_Env::InfoDb.new + @pdf_fn=SiSU_Env::FileOp.new(@md).base_filename + @@dl ||=SiSU_Env::InfoEnv.new.digest.length end def marshal_load require_relative 'dal' # dal.rb @@ -167,7 +168,7 @@ module SiSU_DB_import puts "Error code: #{e.err}" puts "Error message: #{e.errstr}" puts "Error SQLSTATE: #{e.state}" - SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} @@ -178,7 +179,7 @@ module SiSU_DB_import puts "#{__FILE__}:#{__LINE__}" end rescue - SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} @@ -192,7 +193,7 @@ module SiSU_DB_import end else if file_exist - @db=SiSU_Env::Info_db.new + @db=SiSU_Env::InfoDb.new puts "\n#{@cX.grey}file #{@cX.off} #{@cX.blue}#{@opt.fns}#{@cX.off} in language code #{cX.blue}#{@opt.lng}#{cX.off} #{@cX.grey}already exists in database#{@cX.off} #{@cX.blue}#{@db.psql.db}#{@cX.off} #{@cX.brown}update instead?#{@cX.off}" end end @@ -212,7 +213,7 @@ module SiSU_DB_import src=special_character_escape(src) @tp[:sisutxt_f],@tp[:sisutxt_i]='sisutxt, ',"'#{src}', " txt=clean_searchable_text(txt_arr) - #special_character_escape(txt) + #txt=special_character_escape(txt) @tp[:fulltxt_f],@tp[:fulltxt_i]='fulltxt, ',"'#{txt}', " end #% title @@ -237,8 +238,8 @@ module SiSU_DB_import puts %{\n#{@cX.grey}Processing file number#{@cX.off}: #{@cX.green}#{@@id_t}#{@@cX.off}} if @opt.cmd =~/vVM/ end ################ CLEAR ############## - SiSU_DB_DBI::Test.new(self,@opt).verify #% import title names, filenames (tuple) - t=SiSU_DB_tuple::Load_metadata.new(@conn,@@id_t,@md,@file) + SiSU_DbDBI::Test.new(self,@opt).verify #% import title names, filenames (tuple) + t=SiSU_DbTuple::LoadMetadata.new(@conn,@@id_t,@md,@file) tuple=t.tuple tuple end @@ -260,15 +261,19 @@ module SiSU_DB_import data.obj.gsub!(/#{Mx[:gl_o]}(●)#{Mx[:gl_c]}\s*/,'\1 ') data.obj.gsub!(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,'') #check @col[:seg]=@@seg - if data.of =~/para|heading|block|group/ # regular text what of code-blocks grouped text etc. + if data.of ==:para \ + || :heading \ + || :heading_insert \ + || :block \ + || :group # regular text what of code-blocks grouped text etc. notedata=data.obj.dup - if data.is=='heading' \ - and data.ln.inspect=~/[123]/ + if data.is==:heading \ + && (data.ln.inspect=~/[123]/) @col[:lev],txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.ln,data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' @col[:lid]+=1 txt=endnotes(txt).extract_any - @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,data).lev4_minus - special_character_escape(@col[:body]) + @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_minus + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -278,7 +283,7 @@ module SiSU_DB_import end if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last end - t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file) + t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file) @tuple_array << t.tuple case @col[:lev] when /1/; @col[:lv1]+=1 @@ -286,8 +291,8 @@ module SiSU_DB_import when /3/; @col[:lv3]+=1 end @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data.is=='heading' \ - and data.ln==4 + elsif data.is==:heading \ + && data.ln==4 @@seg,txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.name,data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' @col[:seg]=@@seg @col[:lv4]+=1 @@ -298,23 +303,26 @@ module SiSU_DB_import @@hname=@col[:seg].to_s else @@hname end - @env=SiSU_Env::Info_env.new(@md.fns) + @env=SiSU_Env::InfoEnv.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any - @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @en_a,@en_z=@en[0].first,@en[0].last if @en[0] @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] - t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file) + t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file) @tuple_array << t.tuple @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data.is=='heading' and data.ln==5 + elsif data.is==:heading \ + && data.ln==5 txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' - @@seg_full=data.name if data.is=='heading' and data.ln==5 and data.name #check data.name + @@seg_full=data.name if data.is==:heading \ + && data.ln==5 \ + && data.name #check data.name @@seg ||='' #nil # watch @col[:seg]=@@seg @col[:lv5]+=1 @@ -325,23 +333,24 @@ module SiSU_DB_import @@hname=@col[:seg].to_s else @@hname end - @env=SiSU_Env::Info_env.new(@md.fns) + @env=SiSU_Env::InfoEnv.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any - @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @en_a,@en_z=@en[0].first,@en[0].last if @en[0] @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] - t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file) + t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file) @tuple_array << t.tuple @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data.is=='heading' and data.ln==6 + elsif data.is==:heading \ + && data.ln==6 txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' - @@seg_full=data.name if data.is=='heading' and data.ln==6 and data.name #check data.name + @@seg_full=data.name if data.is==:heading && data.ln==6 && data.name #check data.name @@seg ||='' #nil # watch @col[:seg]=@@seg @col[:lv6]+=1 @@ -352,20 +361,24 @@ module SiSU_DB_import @@hname=@col[:seg].to_s else @@hname end - @env=SiSU_Env::Info_env.new(@md.fns) + @env=SiSU_Env::InfoEnv.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any - @col[:body]=SiSU_Format_Shared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @en_a,@en_z=@en[0].first,@en[0].last if @en[0] @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] - t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file) + t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file) @tuple_array << t.tuple @col[:lev]=@col[:plaintext]=@col[:body]='' + elsif data.of==:structure \ + || data.of==:layout \ + || data.of==:comment + #added watch else #% regular text @col[:lid]+=1 txt='' @@ -375,11 +388,11 @@ module SiSU_DB_import @@hname=@col[:seg].to_s else @@hname end - @env=SiSU_Env::Info_env.new(@md.fns) + @env=SiSU_Env::InfoEnv.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any if @sql_type=~/pg/ \ - and txt.size > (SiSU_DB_columns::Column_size.new.document_clean - 1) #% examine pg build & remove limitation + and txt.size > (SiSU_DbColumns::ColumnSize.new.document_clean - 1) #% examine pg build & remove limitation puts "\n\nTOO LARGE (TXT - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| error.puts("\n#{@opt.fns}\nTEXT BODY\n#{@col[:body].size} object #{@col[:ocn]} -> #{@col[:body].slice(0..500)}") @@ -389,28 +402,28 @@ module SiSU_DB_import @en_a,@en_z=@en[0].first,@en[0].last if @en[0] @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] - @col[:body]=if data.is=='table' - SiSU_Format_Shared::CSS_Format.new(@md,data).html_table - elsif data.is=='code' - SiSU_Format_Shared::CSS_Format.new(@md,data).code + @col[:body]=if data.is==:table + SiSU_FormatShared::CSS_Format.new(@md,data).html_table + elsif data.is==:code + SiSU_FormatShared::CSS_Format.new(@md,data).code elsif defined? data.indent \ and defined? data.hang \ and data.indent =~/[1-9]/ \ and data.indent == data.hang - SiSU_Format_Shared::CSS_Format.new(@md,data).indent(data.indent) + SiSU_FormatShared::CSS_Format.new(@md,data).indent(data.indent) elsif defined? data.indent \ and defined? data.hang \ and data.hang =~/[0-9]/ \ and data.indent != data.hang - SiSU_Format_Shared::CSS_Format.new(@md,data).hang_indent(data.hang,data.indent) + SiSU_FormatShared::CSS_Format.new(@md,data).hang_indent(data.hang,data.indent) else - SiSU_Format_Shared::CSS_Format.new(@md,data).norm + SiSU_FormatShared::CSS_Format.new(@md,data).norm end - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) - t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file) + t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file) @tuple_array << t.tuple @en,@en_ast,@en_pls=[],[],[] @col[:en_a]=@col[:en_z]=nil @@ -424,10 +437,10 @@ module SiSU_DB_import nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) - body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) - if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1) + txt=special_character_escape(txt) + body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) + txt=strip_markup(txt) + if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") @@ -448,7 +461,7 @@ module SiSU_DB_import id_t: @@id_t, hash: digest_clean } - t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) + t=SiSU_DbTuple::LoadEndnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple end end @@ -463,10 +476,10 @@ module SiSU_DB_import nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) - body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) - if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1) + txt=special_character_escape(txt) + body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) + txt=strip_markup(txt) + if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") @@ -487,7 +500,7 @@ module SiSU_DB_import id_t: @@id_t, hash: digest_clean } - t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) + t=SiSU_DbTuple::LoadEndnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple end end @@ -502,10 +515,10 @@ module SiSU_DB_import nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) - body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) - if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1) + txt=special_character_escape(txt) + body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) + txt=strip_markup(txt) + if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") @@ -526,7 +539,7 @@ module SiSU_DB_import id_t: @@id_t, hash: digest_clean } - t=SiSU_DB_tuple::Load_endnotes.new(@conn,en,@opt,@file) + t=SiSU_DbTuple::LoadEndnotes.new(@conn,en,@opt,@file) @tuple_array << t.tuple end end @@ -535,7 +548,7 @@ module SiSU_DB_import end end end - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + rescue; SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error ensure end @tuple_array @@ -568,14 +581,14 @@ module SiSU_DB_import : nil end def clean_text(base_url=nil) - if base_url - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{\\1}) - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) + @txt=if base_url + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{\\1}). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{\\1}). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) else - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'\1') - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'\1') - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'\1') + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'\1'). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'\1'). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'\1') end @txt end @@ -598,7 +611,7 @@ module SiSU_DB_import def db_import_urls(dbi_unit,content) #% import documents OID - populate database begin @fnc=content - @env=SiSU_Env::Info_env.new(@opt.fns) + @env=SiSU_Env::InfoEnv.new(@opt.fns) base=@env.url.root out=@env.path.output f,u={},{} @@ -606,57 +619,68 @@ module SiSU_DB_import or @fnb.nil? p 'file output path error' #remove end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:plain]}")==true - f[:txt],u[:txt]='plaintext,', "'#{base}/#{@fnb}/#{@md.fn[:plain]}'," + if FileTest.file?("#{@md.file.output_path.txt.dir}/#{@md.file.base_filename.txt}")==true + f[:txt],u[:txt]='plaintext,', "'#{@md.file.output_path.txt.url}/#{@md.file.base_filename.txt}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:toc]}")==true - f[:html_toc],u[:html_toc]='html_toc,', "'#{base}/#{@fnb}/#{@md.fn[:toc]}'," + if FileTest.file?("#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_seg}")==true + f[:html_toc],u[:html_toc]='html_toc,', "'#{@md.file.output_path.html_seg.url}/#{@md.file.base_filename.html_seg}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:doc]}")==true - f[:html_doc],u[:html_doc]='html_doc,', "'#{base}/#{@fnb}/#{@md.fn[:doc]}'," + if FileTest.file?("#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_scroll}")==true + f[:html_doc],u[:html_doc]='html_doc,', "'#{@md.file.output_path.html_scroll.url}/#{@md.file.base_filename.html_scroll}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:xhtml]}")==true - f[:xhtml],u[:xhtml]='xhtml,', "'#{base}/#{@fnb}/#{@md.fn[:xhtml]}'," + if FileTest.file?("#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}")==true + f[:xhtml],u[:xhtml]='xhtml,', "'#{@md.file.output_path.xhtml.url}/#{@md.file.base_filename.xhtml}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:sax]}")==true - f[:xml_sax],u[:xml_sax]='xml_sax,', "'#{base}/#{@fnb}/#{@md.fn[:sax]}'," + if FileTest.file?("#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}")==true + f[:xml_sax],u[:xml_sax]='xml_sax,', "'#{@md.file.output_path.xml_sax.url}/#{@md.file.base_filename.xml_sax}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:dom]}")==true - f[:xml_dom],u[:xml_dom]='xml_dom,', "'#{base}/#{@fnb}/#{@md.fn[:dom]}'," + if FileTest.file?("#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}")==true + f[:xml_dom],u[:xml_dom]='xml_dom,', "'#{@md.file.output_path.xml_dom.url}/#{@md.file.base_filename.xml_dom}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:odf]}")==true - f[:odf],u[:odf]='odf,', "'#{base}/#{@fnb}/#{@md.fn[:odf]}'," + if FileTest.file?("#{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}")==true + f[:epub],u[:epub]='epub,', "'#{@md.file.output_path.epub.url}/#{@md.file.base_filename.epub}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:pdf_p]}")==true - f[:pdf_p],u[:pdf_p]='pdf_p,', "'#{base}/#{@fnb}/#{@md.fn[:pdf_p]}'," + if FileTest.file?("#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}")==true + f[:odf],u[:odf]='odf,', "'#{@md.file.output_path.odt.url}/#{@md.file.base_filename.odt}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:pdf_l]}")==true - f[:pdf_l],u[:pdf_l]='pdf_l,', "'#{base}/#{@fnb}/#{@md.fn[:pdf_l]}'," + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@pdf_fn.pdf_p_a4}")==true #\ + #or FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@pdf_fn.pdf_p_letter}")==true + f[:pdf_p],u[:pdf_p]='pdf_p,', "'#{@md.file.output_path.pdf.url}/#{@pdf_fn.pdf_p_a4}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:concordance]}")==true - f[:concordance],u[:concordance]='concordance,', "'#{base}/#{@fnb}/#{@md.fn[:concordance]}'," + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@pdf_fn.pdf_l_a4}")==true #\ + #or FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@pdf_fn.pdf_l_letter}")==true + f[:pdf_l],u[:pdf_l]='pdf_l,', "'#{@md.file.output_path.pdf.url}/#{@pdf_fn.pdf_l_a4}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.tex")==true - f[:latex_p],u[:latex_p]='latex_p,', "'#{base}/#{@fnb}/#{@opt.fns}.tex'," + if FileTest.file?("#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}")==true + f[:concordance],u[:concordance]='concordance,', "'#{@md.file.output_path.html_concordance.url}/#{@md.file.base_filename.html_concordance}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.landscape.tex")==true - f[:latex_l],u[:latex_l]='latex_l,', "'#{base}/#{@fnb}/#{@opt}.fns}.landscape.tex'," + #if FileTest.file?("#{@md.file.output_path.x.dir}/#{@md.file.base_filename.x}")==true + # f[:latex_p],u[:latex_p]='latex_p,', "'#{@md.file.output_path.x.url}/#{@md.file.base_filename.x}'," + #end + ##if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.tex")==true + ## f[:latex_p],u[:latex_p]='latex_p,', "'#{base}/#{@fnb}/#{@opt.fns}.tex'," + ##end + #if FileTest.file?("#{@md.file.output_path.x.dir}/#{@md.file.base_filename.x}")==true + # f[:latex_l],u[:latex_l]='latex_l,', "'#{@md.file.output_path.x.url}/#{@md.file.base_filename.x}'," + #end + ##if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.landscape.tex")==true + ## f[:latex_l],u[:latex_l]='latex_l,', "'#{base}/#{@fnb}/#{@opt}.fns}.landscape.tex'," + ##end + if FileTest.file?("#{@md.file.output_path.digest.dir}/#{@md.file.base_filename.digest}")==true + f[:digest],u[:digest]='digest,', "'#{@md.file.output_path.digest.url}/#{@md.file.base_filename.digest}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:digest]}")==true - f[:digest],u[:digest]='digest,', "'#{base}/#{@fnb}/#{@md.fn[:digest]}'," + if FileTest.file?("#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}")==true #revisit, was to be text, this is html + f[:manifest],u[:manifest]='manifest,', "'#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@md.fn[:manifest]}")==true #revisit, was to be text, this is html - f[:manifest],u[:manifest]='manifest,', "'#{base}/#{@fnb}/#{@md.fn[:manifest]}'," + if FileTest.file?("#{@md.file.output_path.src.dir}/#{@md.file.base_filename.src}")==true + f[:markup],u[:markup]='markup,', "'#{@md.file.output_path.src.url}/#{@md.file.base_filename.src}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.meta")==true - f[:markup],u[:markup]='markup,', "'#{base}/#{@fnb}/#{@opt.fns}.meta'," + if FileTest.file?("#{@md.file.output_path.sisupod.dir}/#{@md.file.base_filename.sisupod}")==true + f[:sisupod],u[:sisupod]='sisupod,', "'#{@md.file.output_path.sisupod.url}/#{@md.file.base_filename.sisupod}'," end - if FileTest.file?("#{out}/#{@fnb}/#{@opt.fns}.tgz")==true - f[:sisupod],u[:sisupod]='sisupod,', "'#{base}/#{@fnb}/#{@opt.fns}.tgz'," - end - t=SiSU_DB_tuple::Load_urls.new(@conn,f,u,@@id_t,@opt,@file) + t=SiSU_DbTuple::LoadUrls.new(@conn,f,u,@@id_t,@opt,@file) tuple=t.tuple - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + rescue; SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error ensure end tuple -- cgit v1.2.3