From 118ea61dc79bf9b1c45bbf81b31361a749e32fdd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 11 Aug 2021 03:06:47 -0400 Subject: spine search and configuration related --- src/doc_reform/meta/conf_make_meta_structs.d | 3 ++- src/doc_reform/meta/conf_make_meta_yaml.d | 21 +++++++++++++++------ src/doc_reform/meta/metadoc.d | 14 ++++++++++++-- src/doc_reform/meta/metadoc_harvests_authors.d | 4 ++-- src/doc_reform/meta/metadoc_harvests_topics.d | 4 ++-- src/doc_reform/meta/metadoc_show_config.d | 4 ++-- 6 files changed, 35 insertions(+), 15 deletions(-) (limited to 'src/doc_reform/meta') diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index f0d30b3..2863f0d 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -213,7 +213,8 @@ struct ConfCompositeSiteLocal { string w_srv_cgi_user; string w_srv_cgi_action; string w_srv_cgi_bin_url; - string w_srv_db_sqlite; + string w_srv_db_sqlite_filename; + string w_srv_db_sqlite_path; // string w_srv_db_pg; string w_srv_db_pg_table; string w_srv_db_pg_user; diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index 0940f49..3780553 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -350,7 +350,7 @@ template contentYAMLtoSpineStruct() { ) { _struct_composite.conf.w_srv_cgi_search_script = _yaml["webserv"]["cgi_search_script"].get!string; } else { - _struct_composite.conf.w_srv_cgi_search_script = "spine-search"; + _struct_composite.conf.w_srv_cgi_search_script = "spine_search"; } if (_opt_action.cgi_sqlite_search_filename_d.length > 0) { _struct_composite.conf.w_srv_cgi_search_script_raw_fn_d = _opt_action.cgi_sqlite_search_filename_d; @@ -412,12 +412,21 @@ 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 = _opt_action.sqlite_filename; - } else if ("db_sqlite" in _yaml["webserv"] - && _yaml["webserv"]["db_sqlite"].type.string - && _yaml["webserv"]["db_sqlite"].tag.match(rgx.yaml_tag_is_str) + _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqlite_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) ) { - _struct_composite.conf.w_srv_db_sqlite = _yaml["webserv"]["db_sqlite"].get!string; + _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; + } 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) + ) { + _struct_composite.conf.w_srv_db_sqlite_path = _yaml["webserv"]["db_sqlite_path"].get!string; } else { // set default ? } } diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 1113183..525b32b 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -184,13 +184,23 @@ template spineAbstraction() { struct SQLite_ { @safe string filename() { string _fn = ""; + string _pth = ""; if (_opt_action.sqlite_filename.length > 0) { _fn = _opt_action.sqlite_filename; - } else if (_make_and_meta_struct.conf.w_srv_db_sqlite.length > 0) { - _fn = _make_and_meta_struct.conf.w_srv_db_sqlite; + } 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; } return _fn; } + @safe string path() { + string _pth = ""; + if (_opt_action.sqlite_path.length > 0) { + _pth = _opt_action.sqlite_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; + } + return _pth; + } @safe string cgi_filename() { string _fn = ""; if (_opt_action.cgi_sqlite_search_filename.length > 0) { diff --git a/src/doc_reform/meta/metadoc_harvests_authors.d b/src/doc_reform/meta/metadoc_harvests_authors.d index 6e68766..182b1cd 100644 --- a/src/doc_reform/meta/metadoc_harvests_authors.d +++ b/src/doc_reform/meta/metadoc_harvests_authors.d @@ -89,10 +89,10 @@ template spineMetaDocHarvestsAuthors() { ┃", _make_and_meta_struct.conf.w_srv_cgi_action, - (_make_and_meta_struct.conf.w_srv_db_sqlite.empty) + (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) ? "" : "\n ", ); } else { diff --git a/src/doc_reform/meta/metadoc_harvests_topics.d b/src/doc_reform/meta/metadoc_harvests_topics.d index 5ac01c9..5848723 100644 --- a/src/doc_reform/meta/metadoc_harvests_topics.d +++ b/src/doc_reform/meta/metadoc_harvests_topics.d @@ -89,10 +89,10 @@ template spineMetaDocHarvestsTopics() { ┃", _make_and_meta_struct.conf.w_srv_cgi_action, - (_make_and_meta_struct.conf.w_srv_db_sqlite.empty) + (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) ? "" : "\n ", ); } else { diff --git a/src/doc_reform/meta/metadoc_show_config.d b/src/doc_reform/meta/metadoc_show_config.d index 759f88b..20e796f 100644 --- a/src/doc_reform/meta/metadoc_show_config.d +++ b/src/doc_reform/meta/metadoc_show_config.d @@ -107,7 +107,7 @@ template spineShowSiteConfig() { // "- webserv cgi file links:", // config.conf.w_srv_cgi_file_links, "- webserv sqlite db:", - config.conf.w_srv_db_sqlite, + config.conf.w_srv_db_sqlite_filename, "- output path:", config.conf.output_path, "- processing concordance max:", @@ -201,7 +201,7 @@ template spineShowConfig() { // "- webserv cgi file links:", // doc_matters.conf_make_meta.conf.w_srv_cgi_file_links, "- webserv sqlite db:", - doc_matters.conf_make_meta.conf.w_srv_db_sqlite, + doc_matters.conf_make_meta.conf.w_srv_db_sqlite_filename, "- output path:", doc_matters.conf_make_meta.conf.output_path, "- processing concordance max:", -- cgit v1.2.3