From abe7e7688d045982a28cfb22b8f6269269dd6cf5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 5 Oct 2021 12:55:42 -0400 Subject: sqlite related internal naming --- .envrc-local_ | 44 +++++++++++++++++-- org/config_nix.org | 59 +++++++++++++++++++++++--- org/meta_conf_make_meta.org | 14 +++--- org/out_cgi_search_sqlite.org | 4 +- org/out_sqlite.org | 16 +++---- org/output_hub.org | 4 +- org/spine.org | 18 +++----- src/doc_reform/io_out/cgi_sqlite_search_form.d | 4 +- src/doc_reform/io_out/hub.d | 4 +- src/doc_reform/io_out/sqlite.d | 16 +++---- src/doc_reform/meta/conf_make_meta_yaml.d | 14 +++--- src/doc_reform/meta/metadoc.d | 8 ++-- src/doc_reform/spine.d | 10 +---- sundry/spine_search_cgi/.envrc-local_ | 9 ++-- 14 files changed, 152 insertions(+), 72 deletions(-) diff --git a/.envrc-local_ b/.envrc-local_ index 318d7a7..8d9f54b 100644 --- a/.envrc-local_ +++ b/.envrc-local_ @@ -13,6 +13,7 @@ export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-marku export SpinePOD=$SpineDOC/markup/pod export SpineOUTversioned=/srv/www/spine/$SpineVER export SpineOUT=/srv/www/spine +export SpineDBpath=/var/www/sqlite echo '-*- mode: org -*- @@ -173,8 +174,8 @@ $SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --outp *** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) #+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="spine.search.db" --output="$SpineOUT/" -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUT/" +$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" #+END_SRC *** populate sqlite db @@ -186,7 +187,44 @@ $SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --outp *** generate html (linked to search form), sql output, curate COMPOSITE #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --output="$SpineOUT" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* +#+END_SRC + +*** generate html (linked to search form), sql output, curate COMPOSITE with resource configuration + +if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site + +#+BEGIN_SRC sh +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* +#+END_SRC + +#+BEGIN_SRC yaml +# sample resource configuration file ( $SpinePOD/.rc/config_local_site ) +output: + path: "/srv/www/spine" +default: + language: "en" + papersize: "a4" + text_wrap: "80" + digest: "sha256" +webserv: + http: "http" + domain: "localhost" + data_http: "http" + data_domain: "localhost" + data_root_url: "https://sisudoc.org" + data_root_path: "/srv/www/spine" + images_root_part: "image" + cgi_title: "≅ SiSU Spine search" + cgi_http: "https" + cgi_domain: "sisudoc.org" + cgi_bin_url: "http://sisudoc.org/cgi-bin" + cgi_bin_part: "cgi-bin" + cgi_bin_path: "/var/www/cgi/cgi-bin" + cgi_search_script: "spine_search" + cgi_action: "https://sisudoc.org/spine_search" + db_sqlite_filename: "spine.search.db" + db_sqlite_path: "/var/www/sqlite" #+END_SRC *** make search form diff --git a/org/config_nix.org b/org/config_nix.org index ab01b55..cbd5ba6 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -153,6 +153,7 @@ export SpineDOC=<> export SpinePOD=$SpineDOC/markup/pod export SpineOUTversioned=<> export SpineOUT=<> +export SpineDBpath=<> echo '-*- mode: org -*- @@ -313,8 +314,8 @@ $SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --outp ,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) ,#+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="<>" --output="$SpineOUT/" -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUT/" +$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" ,#+END_SRC ,*** populate sqlite db @@ -326,7 +327,44 @@ $SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" -- ,*** generate html (linked to search form), sql output, curate COMPOSITE ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --output="$SpineOUT" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* +,#+END_SRC + +,*** generate html (linked to search form), sql output, curate COMPOSITE with resource configuration + +if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site + +,#+BEGIN_SRC sh +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* +,#+END_SRC + +,#+BEGIN_SRC yaml +# sample resource configuration file ( $SpinePOD/.rc/config_local_site ) +output: + path: "/srv/www/spine" +default: + language: "en" + papersize: "a4" + text_wrap: "80" + digest: "sha256" +webserv: + http: "http" + domain: "localhost" + data_http: "http" + data_domain: "localhost" + data_root_url: "https://sisudoc.org" + data_root_path: "/srv/www/spine" + images_root_part: "image" + cgi_title: "≅ SiSU Spine search" + cgi_http: "https" + cgi_domain: "sisudoc.org" + cgi_bin_url: "http://sisudoc.org/cgi-bin" + cgi_bin_part: "cgi-bin" + cgi_bin_path: "/var/www/cgi/cgi-bin" + cgi_search_script: "<>" + cgi_action: "https://sisudoc.org/spine_search" + db_sqlite_filename: "<>" + db_sqlite_path: "/var/www/sqlite" ,#+END_SRC ,*** make search form @@ -896,6 +934,7 @@ export SpineDOC=<> export SpinePOD=$SpineDOC/markup/pod #export SpineOUTversioned=<> export SpineOUT=<> +export SpineDBpath=<> export SpineCgiBIN=<> echo '-*- mode: org -*- @@ -974,7 +1013,7 @@ $SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-file ,*** generate sql output ,#+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUT $SpinePOD/* +SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" ,#+END_SRC ,*** generate curate @@ -987,13 +1026,15 @@ $SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUT $Spine ,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) ,#+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUT" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" ,#+END_SRC ,*** generate html (linked to search form), sql output, curate ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --output=$SpineOUT $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* +#if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* ,#+END_SRC ,*** make search form @@ -1272,6 +1313,12 @@ nixpkgs=<> /var/www #+END_SRC + +#+NAME: project_path_sqlite +#+BEGIN_SRC nix +/var/www/sqlite +#+END_SRC + #+NAME: nixpkgs_url #+BEGIN_SRC nix github:nixos/nixpkgs diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index 1bd2d7a..cdb7571 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -769,13 +769,15 @@ if ("webserv" in _yaml : _struct_composite.conf.w_srv_host ~ _struct_composite.conf.w_srv_cgi_bin_subpath; } - if (_opt_action.cgi_sqlite_search_filename.length > 0) { - _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; + if (_opt_action.cgi_url_action.length > 0) { + _struct_composite.conf.w_srv_cgi_action = _opt_action.cgi_url_action; } else if ("cgi_action" in _yaml["webserv"] && _yaml["webserv"]["cgi_action"].type.string && _yaml["webserv"]["cgi_action"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_cgi_action = _yaml["webserv"]["cgi_action"].get!string; + } else if (_opt_action.cgi_sqlite_search_filename.length > 0) { // WORKON + _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; } else { // action is composite, build } // if ("cgi_file_links" in _yaml["webserv"] @@ -784,8 +786,8 @@ if ("webserv" in _yaml // ) { // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string; // } - if (_opt_action.sqlite_filename.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqliteDB_filename; } else if ("db_sqlite_filename" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_filename"].type.string && _yaml["webserv"]["db_sqlite_filename"].tag.match(rgx.yaml_tag_is_str) @@ -793,8 +795,8 @@ if ("webserv" in _yaml _struct_composite.conf.w_srv_db_sqlite_filename = _yaml["webserv"]["db_sqlite_filename"].get!string; } else { // set default ? } - if (_opt_action.sqlite_path.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqliteDB_path; } else if ("db_sqlite_path" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_path"].type.string && _yaml["webserv"]["db_sqlite_path"].tag.match(rgx.yaml_tag_is_str) diff --git a/org/out_cgi_search_sqlite.org b/org/out_cgi_search_sqlite.org index 6709e8b..6b41da8 100644 --- a/org/out_cgi_search_sqlite.org +++ b/org/out_cgi_search_sqlite.org @@ -79,9 +79,9 @@ template CGIsearchSQLite() { std.file, std.format; import doc_reform.io_out; - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? make_and_meta_struct.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? make_and_meta_struct.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/org/out_sqlite.org b/org/out_sqlite.org index b01bb1f..1cb9b40 100644 --- a/org/out_sqlite.org +++ b/org/out_sqlite.org @@ -326,13 +326,13 @@ template SQLiteTablesCreate() { } if (opt_action.sqlite_db_create) { string _db_statement; - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.output_dir_set.length > 0) - ? opt_action.output_dir_set + string db_path = (opt_action.sqliteDB_path.length > 0) + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; @@ -365,13 +365,13 @@ template SQLiteDbDrop() { void SQLiteDbDrop(O,C)(O opt_action, C config) { writeln("db drop"); if ((opt_action.sqlite_db_drop)) { - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.sqlite_db_path.length > 0) // - ? opt_action.sqlite_db_path + string db_path = (opt_action.sqliteDB_path.length > 0) // + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; diff --git a/org/output_hub.org b/org/output_hub.org index d66956a..2ac9f85 100644 --- a/org/output_hub.org +++ b/org/output_hub.org @@ -268,9 +268,9 @@ if ((opt_action.sqlite_db_create)) { #+BEGIN_SRC d if ((opt_action.cgi_search_form_codegen)) { if ((opt_action.verbose)) { - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? config.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? config.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/org/spine.org b/org/spine.org index d9db466..805524d 100644 --- a/org/spine.org +++ b/org/spine.org @@ -642,12 +642,6 @@ struct OptActions { @trusted bool source_or_pod() { return (opts["pod"] || opts["source"]) ? true : false; } - @trusted string sqlite_db_path() { - return settings["sqlite-db-path"]; - } - @trusted string sqlite_db_filename() { - return settings["sqlite-db-filename"]; - } @trusted bool sqlite_discrete() { return opts["sqlite-discrete"]; } @@ -720,10 +714,10 @@ struct OptActions { @trusted string output_dir_set() { return settings["output"]; } - @trusted string sqlite_filename() { + @trusted string sqliteDB_filename() { return settings["sqlite-db-filename"]; } - @trusted string sqlite_path() { + @trusted string sqliteDB_path() { return settings["sqlite-db-path"]; } @trusted string cgi_bin_root() { @@ -1652,8 +1646,8 @@ struct DocumentMatters { @safe string filename() { string _fn = ""; string _pth = ""; - if (_opt_action.sqlite_filename.length > 0) { - _fn = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _fn = _opt_action.sqliteDB_filename; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.length > 0) { _fn = _make_and_meta_struct.conf.w_srv_db_sqlite_filename; } @@ -1661,8 +1655,8 @@ struct DocumentMatters { } @safe string path() { string _pth = ""; - if (_opt_action.sqlite_path.length > 0) { - _pth = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _pth = _opt_action.sqliteDB_path; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_path.length > 0) { _pth = _make_and_meta_struct.conf.w_srv_db_sqlite_path; } diff --git a/src/doc_reform/io_out/cgi_sqlite_search_form.d b/src/doc_reform/io_out/cgi_sqlite_search_form.d index 585ea50..092e882 100644 --- a/src/doc_reform/io_out/cgi_sqlite_search_form.d +++ b/src/doc_reform/io_out/cgi_sqlite_search_form.d @@ -55,9 +55,9 @@ template CGIsearchSQLite() { std.file, std.format; import doc_reform.io_out; - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? make_and_meta_struct.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? make_and_meta_struct.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index a644b66..fc6dd98 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -189,9 +189,9 @@ template outputHubOp() { } if ((opt_action.cgi_search_form_codegen)) { if ((opt_action.verbose)) { - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? config.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? config.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index b66aa13..cb7b065 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -1548,13 +1548,13 @@ template SQLiteTablesCreate() { } if (opt_action.sqlite_db_create) { string _db_statement; - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.output_dir_set.length > 0) - ? opt_action.output_dir_set + string db_path = (opt_action.sqliteDB_path.length > 0) + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; @@ -1581,13 +1581,13 @@ template SQLiteDbDrop() { void SQLiteDbDrop(O,C)(O opt_action, C config) { writeln("db drop"); if ((opt_action.sqlite_db_drop)) { - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.sqlite_db_path.length > 0) // - ? opt_action.sqlite_db_path + string db_path = (opt_action.sqliteDB_path.length > 0) // + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index 6afec40..6d4a2b1 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -395,13 +395,15 @@ template contentYAMLtoSpineStruct() { : _struct_composite.conf.w_srv_host ~ _struct_composite.conf.w_srv_cgi_bin_subpath; } - if (_opt_action.cgi_sqlite_search_filename.length > 0) { - _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; + if (_opt_action.cgi_url_action.length > 0) { + _struct_composite.conf.w_srv_cgi_action = _opt_action.cgi_url_action; } else if ("cgi_action" in _yaml["webserv"] && _yaml["webserv"]["cgi_action"].type.string && _yaml["webserv"]["cgi_action"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_cgi_action = _yaml["webserv"]["cgi_action"].get!string; + } else if (_opt_action.cgi_sqlite_search_filename.length > 0) { // WORKON + _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; } else { // action is composite, build } // if ("cgi_file_links" in _yaml["webserv"] @@ -410,8 +412,8 @@ template contentYAMLtoSpineStruct() { // ) { // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string; // } - if (_opt_action.sqlite_filename.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqliteDB_filename; } else if ("db_sqlite_filename" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_filename"].type.string && _yaml["webserv"]["db_sqlite_filename"].tag.match(rgx.yaml_tag_is_str) @@ -419,8 +421,8 @@ template contentYAMLtoSpineStruct() { _struct_composite.conf.w_srv_db_sqlite_filename = _yaml["webserv"]["db_sqlite_filename"].get!string; } else { // set default ? } - if (_opt_action.sqlite_path.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqliteDB_path; } else if ("db_sqlite_path" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_path"].type.string && _yaml["webserv"]["db_sqlite_path"].tag.match(rgx.yaml_tag_is_str) diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 6f4a2a4..fdec126 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -185,8 +185,8 @@ template spineAbstraction() { @safe string filename() { string _fn = ""; string _pth = ""; - if (_opt_action.sqlite_filename.length > 0) { - _fn = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _fn = _opt_action.sqliteDB_filename; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.length > 0) { _fn = _make_and_meta_struct.conf.w_srv_db_sqlite_filename; } @@ -194,8 +194,8 @@ template spineAbstraction() { } @safe string path() { string _pth = ""; - if (_opt_action.sqlite_path.length > 0) { - _pth = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _pth = _opt_action.sqliteDB_path; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_path.length > 0) { _pth = _make_and_meta_struct.conf.w_srv_db_sqlite_path; } diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 502ad15..006ea1b 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -385,12 +385,6 @@ string program_name = "spine"; @trusted bool source_or_pod() { return (opts["pod"] || opts["source"]) ? true : false; } - @trusted string sqlite_db_path() { - return settings["sqlite-db-path"]; - } - @trusted string sqlite_db_filename() { - return settings["sqlite-db-filename"]; - } @trusted bool sqlite_discrete() { return opts["sqlite-discrete"]; } @@ -463,10 +457,10 @@ string program_name = "spine"; @trusted string output_dir_set() { return settings["output"]; } - @trusted string sqlite_filename() { + @trusted string sqliteDB_filename() { return settings["sqlite-db-filename"]; } - @trusted string sqlite_path() { + @trusted string sqliteDB_path() { return settings["sqlite-db-path"]; } @trusted string cgi_bin_root() { diff --git a/sundry/spine_search_cgi/.envrc-local_ b/sundry/spine_search_cgi/.envrc-local_ index e79a418..440b597 100644 --- a/sundry/spine_search_cgi/.envrc-local_ +++ b/sundry/spine_search_cgi/.envrc-local_ @@ -13,6 +13,7 @@ export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-marku export SpinePOD=$SpineDOC/markup/pod #export SpineOUTversioned=/srv/www/spine/$SpineVER export SpineOUT=/srv/www/spine +export SpineDBpath=/var/www/sqlite export SpineCgiBIN=/var/www/cgi/cgi-bin echo '-*- mode: org -*- @@ -91,7 +92,7 @@ $SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-file *** generate sql output #+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUT $SpinePOD/* +SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" #+END_SRC *** generate curate @@ -104,13 +105,15 @@ $SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUT $Spine *** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) #+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUT" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" #+END_SRC *** generate html (linked to search form), sql output, curate #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --output=$SpineOUT $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* +#if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* #+END_SRC *** make search form -- cgit v1.2.3