aboutsummaryrefslogtreecommitdiffhomepage
path: root/org
diff options
context:
space:
mode:
Diffstat (limited to 'org')
-rw-r--r--org/config_nix.org59
-rw-r--r--org/meta_conf_make_meta.org14
-rw-r--r--org/out_cgi_search_sqlite.org4
-rw-r--r--org/out_sqlite.org16
-rw-r--r--org/output_hub.org4
-rw-r--r--org/spine.org18
6 files changed, 79 insertions, 36 deletions
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=<<project_path_local_doc>>
export SpinePOD=$SpineDOC/markup/pod
export SpineOUTversioned=<<project_path_local_out>>
export SpineOUT=<<project_path_local_out_static>>
+export SpineDBpath=<<project_path_sqlite>>
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="<<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
@@ -326,7 +327,44 @@ $SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<<spine_search_db>>" --
,*** 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_cgi>>" --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_cgi>>" --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>>"
+ cgi_action: "https://sisudoc.org/spine_search"
+ db_sqlite_filename: "<<spine_search_db>>"
+ db_sqlite_path: "/var/www/sqlite"
,#+END_SRC
,*** make search form
@@ -896,6 +934,7 @@ export SpineDOC=<<project_path_local_doc>>
export SpinePOD=$SpineDOC/markup/pod
#export SpineOUTversioned=<<project_path_local_out>>
export SpineOUT=<<project_path_local_out_static>>
+export SpineDBpath=<<project_path_sqlite>>
export SpineCgiBIN=<<project_path_cgi_bin>>
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="<<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
@@ -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="<<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_cgi>>" --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_cgi>>" --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=<<nixpkgs_path_local>>
/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;
}