aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/db_import.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/db_import.rb')
-rw-r--r--lib/sisu/v3dv/db_import.rb58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/sisu/v3dv/db_import.rb b/lib/sisu/v3dv/db_import.rb
index a78a0656..2659f4c1 100644
--- a/lib/sisu/v3dv/db_import.rb
+++ b/lib/sisu/v3dv/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
@@ -237,8 +237,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::Load_metadata.new(@conn,@@id_t,@md,@file)
tuple=t.tuple
tuple
end
@@ -267,7 +267,7 @@ module SiSU_DB_import
@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
+ @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_minus
special_character_escape(@col[:body])
@col[:plaintext]=@col[:body].dup
@col[:plaintext]=strip_markup(@col[:plaintext])
@@ -278,7 +278,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::Load_documents.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
case @col[:lev]
when /1/; @col[:lv1]+=1
@@ -301,7 +301,7 @@ module SiSU_DB_import
@env=SiSU_Env::Info_env.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
+ @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus
special_character_escape(@col[:body])
@col[:plaintext]=@col[:body].dup
@col[:plaintext]=strip_markup(@col[:plaintext])
@@ -309,7 +309,7 @@ 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]
- t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file)
+ t=SiSU_DbTuple::Load_documents.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
elsif data.is=='heading' and data.ln==5
@@ -328,7 +328,7 @@ module SiSU_DB_import
@env=SiSU_Env::Info_env.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
+ @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus
special_character_escape(@col[:body])
@col[:plaintext]=@col[:body].dup
@col[:plaintext]=strip_markup(@col[:plaintext])
@@ -336,7 +336,7 @@ 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]
- t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file)
+ t=SiSU_DbTuple::Load_documents.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
elsif data.is=='heading' and data.ln==6
@@ -355,7 +355,7 @@ module SiSU_DB_import
@env=SiSU_Env::Info_env.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
+ @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus
special_character_escape(@col[:body])
@col[:plaintext]=@col[:body].dup
@col[:plaintext]=strip_markup(@col[:plaintext])
@@ -363,7 +363,7 @@ 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]
- t=SiSU_DB_tuple::Load_documents.new(@conn,@col,@opt,@file)
+ t=SiSU_DbTuple::Load_documents.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
else #% regular text
@@ -379,7 +379,7 @@ module SiSU_DB_import
@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::Column_size.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)}")
@@ -390,27 +390,27 @@ module SiSU_DB_import
@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
+ SiSU_FormatShared::CSS_Format.new(@md,data).html_table
elsif data.is=='code'
- SiSU_Format_Shared::CSS_Format.new(@md,data).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[: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::Load_documents.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@en,@en_ast,@en_pls=[],[],[]
@col[:en_a]=@col[:en_z]=nil
@@ -425,9 +425,9 @@ module SiSU_DB_import
end
@id_n+=1
special_character_escape(txt)
- body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt)
+ body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt)
strip_markup(txt)
- if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1)
+ if txt.size > (SiSU_DbColumns::Column_size.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 +448,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::Load_endnotes.new(@conn,en,@opt,@file)
@tuple_array << t.tuple
end
end
@@ -464,9 +464,9 @@ module SiSU_DB_import
end
@id_n+=1
special_character_escape(txt)
- body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt)
+ body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt)
strip_markup(txt)
- if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1)
+ if txt.size > (SiSU_DbColumns::Column_size.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 +487,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::Load_endnotes.new(@conn,en,@opt,@file)
@tuple_array << t.tuple
end
end
@@ -503,9 +503,9 @@ module SiSU_DB_import
end
@id_n+=1
special_character_escape(txt)
- body=SiSU_Format_Shared::CSS_Format.new(@md,data).endnote(nr,txt)
+ body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt)
strip_markup(txt)
- if txt.size > (SiSU_DB_columns::Column_size.new.endnote_clean - 1)
+ if txt.size > (SiSU_DbColumns::Column_size.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 +526,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::Load_endnotes.new(@conn,en,@opt,@file)
@tuple_array << t.tuple
end
end
@@ -654,7 +654,7 @@ module SiSU_DB_import
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::Load_urls.new(@conn,f,u,@@id_t,@opt,@file)
tuple=t.tuple
rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
ensure