specify_cli 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.rspec +1 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +117 -0
- data/LICENSE.txt +21 -0
- data/README.rdoc +43 -0
- data/Rakefile +15 -0
- data/bin/specify_cli +248 -0
- data/lib/specify.rb +45 -0
- data/lib/specify/branch_parser.rb +85 -0
- data/lib/specify/cli.rb +11 -0
- data/lib/specify/cli/database_setup.rb +46 -0
- data/lib/specify/cli/stubs.rb +63 -0
- data/lib/specify/cli/viewset.rb +21 -0
- data/lib/specify/configuration.rb +12 -0
- data/lib/specify/configuration/config.rb +120 -0
- data/lib/specify/configuration/db_config.rb +162 -0
- data/lib/specify/configuration/host_config.rb +37 -0
- data/lib/specify/database.rb +140 -0
- data/lib/specify/models.rb +43 -0
- data/lib/specify/models/accession.rb +33 -0
- data/lib/specify/models/agent.rb +138 -0
- data/lib/specify/models/app_resource_data.rb +32 -0
- data/lib/specify/models/app_resource_dir.rb +43 -0
- data/lib/specify/models/auto_numbering_scheme.rb +94 -0
- data/lib/specify/models/collecting_event.rb +38 -0
- data/lib/specify/models/collection.rb +67 -0
- data/lib/specify/models/collection_object.rb +127 -0
- data/lib/specify/models/createable.rb +21 -0
- data/lib/specify/models/determination.rb +63 -0
- data/lib/specify/models/discipline.rb +61 -0
- data/lib/specify/models/division.rb +26 -0
- data/lib/specify/models/geography.rb +5 -0
- data/lib/specify/models/geography/administrative_division.rb +32 -0
- data/lib/specify/models/geography/geographic_name.rb +66 -0
- data/lib/specify/models/geography/geography.rb +23 -0
- data/lib/specify/models/institution.rb +13 -0
- data/lib/specify/models/locality.rb +50 -0
- data/lib/specify/models/preparation.rb +53 -0
- data/lib/specify/models/preparation_type.rb +30 -0
- data/lib/specify/models/record_set.rb +55 -0
- data/lib/specify/models/record_set_item.rb +29 -0
- data/lib/specify/models/taxonomy.rb +6 -0
- data/lib/specify/models/taxonomy/common_name.rb +14 -0
- data/lib/specify/models/taxonomy/rank.rb +31 -0
- data/lib/specify/models/taxonomy/taxon.rb +54 -0
- data/lib/specify/models/taxonomy/taxonomy.rb +21 -0
- data/lib/specify/models/tree_queryable.rb +55 -0
- data/lib/specify/models/updateable.rb +20 -0
- data/lib/specify/models/user.rb +104 -0
- data/lib/specify/models/view_set_object.rb +32 -0
- data/lib/specify/number_format.rb +60 -0
- data/lib/specify/services.rb +18 -0
- data/lib/specify/services/service.rb +51 -0
- data/lib/specify/services/stub_generator.rb +291 -0
- data/lib/specify/services/view_loader.rb +177 -0
- data/lib/specify/session.rb +77 -0
- data/lib/specify/user_type.rb +61 -0
- data/lib/specify/version.rb +19 -0
- data/man/specify_cli-database.1 +60 -0
- data/man/specify_cli-database.1.html +137 -0
- data/man/specify_cli-database.1.ronn +53 -0
- data/man/specify_cli-repository.1 +55 -0
- data/man/specify_cli-repository.1.html +128 -0
- data/man/specify_cli-repository.1.ronn +42 -0
- data/man/specify_cli-stubs.1 +177 -0
- data/man/specify_cli-stubs.1.html +239 -0
- data/man/specify_cli-stubs.1.ronn +147 -0
- data/man/specify_cli-viewset.1 +92 -0
- data/man/specify_cli-viewset.1.html +154 -0
- data/man/specify_cli-viewset.1.ronn +72 -0
- data/man/specify_cli.1 +213 -0
- data/man/specify_cli.1.html +252 -0
- data/man/specify_cli.1.ronn +157 -0
- data/spec/branch_parser_spec.rb +94 -0
- data/spec/cli/stubs_spec.rb +44 -0
- data/spec/configuration/config_spec.rb +269 -0
- data/spec/configuration/db_config_spec.rb +299 -0
- data/spec/configuration/host_config_spec.rb +64 -0
- data/spec/database_spec.rb +83 -0
- data/spec/examples.txt +217 -0
- data/spec/helpers.rb +15 -0
- data/spec/models/app_resource_data_spec.rb +38 -0
- data/spec/models/app_resource_dir_spec.rb +8 -0
- data/spec/models/auto_numbering_scheme_spec.rb +78 -0
- data/spec/models/collection_object_spec.rb +92 -0
- data/spec/models/collection_spec.rb +32 -0
- data/spec/models/discipline_spec.rb +31 -0
- data/spec/models/record_set_spec.rb +18 -0
- data/spec/models/user_spec.rb +182 -0
- data/spec/models/view_set_object_spec.rb +70 -0
- data/spec/number_format_spec.rb +43 -0
- data/spec/services/stub_generator_spec.rb +635 -0
- data/spec/services/view_loader_spec.rb +436 -0
- data/spec/session_spec.rb +105 -0
- data/spec/spec_helper.rb +116 -0
- data/spec/support/db.yml +12 -0
- data/spec/support/stub.yaml +17 -0
- data/spec/support/stub_locality.yaml +19 -0
- data/spec/support/viewsets/paleo.views.xml +30 -0
- data/spec/support/viewsets/paleo.xml +30 -0
- data/spec/user_type_spec.rb +79 -0
- data/specify_cli.gemspec +27 -0
- data/specify_cli.rdoc +1 -0
- metadata +246 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
specify_cli-database(1) -- A command line interface for Specify
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`specify_cli` [<global options>] `database` <name>
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
The database configuration file (default: *~/.specify\_dbs.rc.yaml*) has a
|
11
|
+
`hosts` section which contains settings for Specify databases by grouped by
|
12
|
+
*hostname*.
|
13
|
+
|
14
|
+
Use the `database` command to add information for a specific database using this command.
|
15
|
+
|
16
|
+
Use the specify\_cli global option `--host` to provide the host information and
|
17
|
+
pass the *name* of the database to configure as an argument.
|
18
|
+
|
19
|
+
The command will look up the *host* and *database* in the database configuration
|
20
|
+
file and ask for necessary information to configure either. The command will
|
21
|
+
not overwrite existing configurations. If you need to change information, edit
|
22
|
+
the file.
|
23
|
+
|
24
|
+
Information required to configure a *host* is the port number.
|
25
|
+
|
26
|
+
Information required to configure a *database* is the MySQL/MariaDB user name
|
27
|
+
and password. The user will be the typically be the Specify *master user* (or
|
28
|
+
any user with equivalent permissions on the database) Leave the password blank
|
29
|
+
to be prompted when working with commands that read the file (**specify_cli-stubs(1)**, **specify_cli-viewset(1)**). Apart from the
|
30
|
+
MySQL/MariaDB user, `specify_cli` the command will also ask for a *specify user*
|
31
|
+
name. Every command (except the configuration commands
|
32
|
+
**specify_cli-database(1)** and **specify_cli-repository(1)**) will start a
|
33
|
+
session in Specify where the Specify user will be logged in to the collection.
|
34
|
+
Any records created or modified during this session will be marked as created by
|
35
|
+
or modified by the *specify user*.
|
36
|
+
|
37
|
+
## OPTIONS
|
38
|
+
|
39
|
+
None.
|
40
|
+
|
41
|
+
## EXAMPLES
|
42
|
+
|
43
|
+
Configure a database `Specify` on the host `specify.example.org`:
|
44
|
+
|
45
|
+
$ specify_cli --host=specify.example.org database Specify
|
46
|
+
|
47
|
+
Configure a database `SpecifyTest` on localhost:
|
48
|
+
|
49
|
+
$ specify_cli database SpecifyTest
|
50
|
+
|
51
|
+
## SPECIFY_CLI
|
52
|
+
|
53
|
+
Part of the specify_cli(1) suite
|
@@ -0,0 +1,55 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "SPECIFY_CLI\-REPOSITORY" "1" "August 2018" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBspecify_cli\-repository\fR \- A command line interface for Specify
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBspecify_cli\fR [\fIglobal options\fR] \fBrepository\fR \fIpath\fR \fBspecify_cli\fR [\fIglobal options\fR] \fBrepository\fR \fB\-\-c\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
The database configuration file (default: \fI~/\.specify_dbs\.rc\.yaml\fR) has a \fBdir_names\fR section which contains mappings of paths for directories containing Specify resource files to hostnames\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
The \fBspecify_cli\-viewset(1)\fR command can automatically resolve targets (host, database, collection, level) based on branch names in a Git repository\. To allow working with multiple databases on different hosts, a repository needs to be mapped to a host name\. This is done by mapping the full path name of the directory to a hostname\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
The repository command will map the directory \fIpath\fR passed as an argument to the host provided using the \fB\-H\fR or \fB\-\-host\fR global option\.
|
20
|
+
.
|
21
|
+
.SH "OPTIONS"
|
22
|
+
.
|
23
|
+
.TP
|
24
|
+
\fB\-c\fR, \fB\-\-current\fR
|
25
|
+
Map the path of the current working directory\.
|
26
|
+
.
|
27
|
+
.SH "EXAMPLES"
|
28
|
+
Map the directory \fB~/specify_forms/invertpaleo\fR to the host \fBspecify\.example\.org\fR:
|
29
|
+
.
|
30
|
+
.IP "" 4
|
31
|
+
.
|
32
|
+
.nf
|
33
|
+
|
34
|
+
specify_cli \-H specify\.example\.org repository\en
|
35
|
+
~/specify_forms/invertpaleo
|
36
|
+
.
|
37
|
+
.fi
|
38
|
+
.
|
39
|
+
.IP "" 0
|
40
|
+
.
|
41
|
+
.P
|
42
|
+
Map the current directory to localhost:
|
43
|
+
.
|
44
|
+
.IP "" 4
|
45
|
+
.
|
46
|
+
.nf
|
47
|
+
|
48
|
+
specify_cli repository \-\-current
|
49
|
+
.
|
50
|
+
.fi
|
51
|
+
.
|
52
|
+
.IP "" 0
|
53
|
+
.
|
54
|
+
.SH "SPECIFY_CLI"
|
55
|
+
Part of the specify_cli(1) suite
|
@@ -0,0 +1,128 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>specify_cli-repository(1) - A command line interface for Specify</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#OPTIONS">OPTIONS</a>
|
60
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
61
|
+
<a href="#SPECIFY_CLI">SPECIFY_CLI</a>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<ol class='man-decor man-head man head'>
|
65
|
+
<li class='tl'>specify_cli-repository(1)</li>
|
66
|
+
<li class='tc'></li>
|
67
|
+
<li class='tr'>specify_cli-repository(1)</li>
|
68
|
+
</ol>
|
69
|
+
|
70
|
+
<h2 id="NAME">NAME</h2>
|
71
|
+
<p class="man-name">
|
72
|
+
<code>specify_cli-repository</code> - <span class="man-whatis">A command line interface for Specify</span>
|
73
|
+
</p>
|
74
|
+
|
75
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
76
|
+
|
77
|
+
<p><code>specify_cli</code> [<var>global options</var>] <code>repository</code> <var>path</var>
|
78
|
+
<code>specify_cli</code> [<var>global options</var>] <code>repository</code> <code>--c</code></p>
|
79
|
+
|
80
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
81
|
+
|
82
|
+
<p>The database configuration file (default: <em>~/.specify_dbs.rc.yaml</em>) has a
|
83
|
+
<code>dir_names</code> section which contains mappings of paths for directories containing
|
84
|
+
Specify resource files to hostnames.</p>
|
85
|
+
|
86
|
+
<p>The <strong><span class="man-ref">specify_cli-viewset<span class="s">(1)</span></span></strong> command can automatically resolve targets
|
87
|
+
(host, database, collection, level) based on branch names in a Git repository.
|
88
|
+
To allow working with multiple databases on different hosts, a repository needs
|
89
|
+
to be mapped to a host name. This is done by mapping the full path name of the directory to a hostname.</p>
|
90
|
+
|
91
|
+
<p>The repository command will map the directory <em>path</em> passed as an argument to
|
92
|
+
the host provided using the <code>-H</code> or <code>--host</code> global option.</p>
|
93
|
+
|
94
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
95
|
+
|
96
|
+
<dl>
|
97
|
+
<dt><code>-c</code>, <code>--current</code></dt><dd> Map the path of the current working directory.</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
|
101
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
102
|
+
|
103
|
+
<p>Map the directory <code>~/specify_forms/invertpaleo</code> to the host
|
104
|
+
<code>specify.example.org</code>:</p>
|
105
|
+
|
106
|
+
<pre><code>specify_cli -H specify.example.org repository\n
|
107
|
+
~/specify_forms/invertpaleo
|
108
|
+
</code></pre>
|
109
|
+
|
110
|
+
<p>Map the current directory to localhost:</p>
|
111
|
+
|
112
|
+
<pre><code>specify_cli repository --current
|
113
|
+
</code></pre>
|
114
|
+
|
115
|
+
<h2 id="SPECIFY_CLI">SPECIFY_CLI</h2>
|
116
|
+
|
117
|
+
<p>Part of the <span class="man-ref">specify_cli<span class="s">(1)</span></span> suite</p>
|
118
|
+
|
119
|
+
|
120
|
+
<ol class='man-decor man-foot man foot'>
|
121
|
+
<li class='tl'></li>
|
122
|
+
<li class='tc'>August 2018</li>
|
123
|
+
<li class='tr'>specify_cli-repository(1)</li>
|
124
|
+
</ol>
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</body>
|
128
|
+
</html>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
specify_cli-repository(1) -- A command line interface for Specify
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`specify_cli` [<global options>] `repository` <path>
|
7
|
+
`specify_cli` [<global options>] `repository` `--c`
|
8
|
+
|
9
|
+
## DESCRIPTION
|
10
|
+
|
11
|
+
The database configuration file (default: *~/.specify\_dbs.rc.yaml*) has a
|
12
|
+
`dir_names` section which contains mappings of paths for directories containing
|
13
|
+
Specify resource files to hostnames.
|
14
|
+
|
15
|
+
The **specify_cli-viewset(1)** command can automatically resolve targets
|
16
|
+
(host, database, collection, level) based on branch names in a Git repository.
|
17
|
+
To allow working with multiple databases on different hosts, a repository needs
|
18
|
+
to be mapped to a host name. This is done by mapping the full path name of the directory to a hostname.
|
19
|
+
|
20
|
+
The repository command will map the directory *path* passed as an argument to
|
21
|
+
the host provided using the `-H` or `--host` global option.
|
22
|
+
|
23
|
+
## OPTIONS
|
24
|
+
|
25
|
+
* `-c`, `--current`:
|
26
|
+
Map the path of the current working directory.
|
27
|
+
|
28
|
+
## EXAMPLES
|
29
|
+
|
30
|
+
Map the directory `~/specify_forms/invertpaleo` to the host
|
31
|
+
`specify.example.org`:
|
32
|
+
|
33
|
+
specify_cli -H specify.example.org repository\n
|
34
|
+
~/specify_forms/invertpaleo
|
35
|
+
|
36
|
+
Map the current directory to localhost:
|
37
|
+
|
38
|
+
specify_cli repository --current
|
39
|
+
|
40
|
+
## SPECIFY_CLI
|
41
|
+
|
42
|
+
Part of the specify_cli(1) suite
|
@@ -0,0 +1,177 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "SPECIFY_CLI\-STUBSY" "1" "August 2018" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBspecify_cli\-stubsy\fR \- A command line interface for Specify
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBspecify_cli\fR [\fIglobal options\fR] \fBstubs\fR [\fIoptions\fR] \fIcollection\fR \fIcount\fR \fBspecify_cli\fR \fBstubs\fR \fB\-\-file\fR \fIcount\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
The stubs command creates stub records in a collection, so that catalog numbers can be printed to labels e\.g\. prior to mass digitizaton\. The command currently only works for collection objects, and will currently only work for collections using the numeric catalog numbering scheme\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
Generated catalog numbers are printed to stdout\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
The number of stub records created is specified with the \fIcount\fR argument\. The target collection is provided as the \fIcollection\fR argument\. \fIHost\fR and \fIdatabase\fR are provided using the global options \fB\-\-host\fR and \fB\-\-database\fR respectively\. The command will generate a record set with all generated collection objects\. The record set will be owned by either the \fISpecify user\fR (as provided via the global option \fB\-\-specify_user\fR or in the database configuration file), or the \fISpecify user\fR provided with the \fB\-\-cataloger\fR option\. If no dataset name is provided using the \fB\-\-dataset\fR option, the default name will be \fBstub record set <TIMESTAMP>\fR\.
|
20
|
+
.
|
21
|
+
.P
|
22
|
+
Records can be created with the following basic information (provided using command options \- see below): cataloger, accession, geography/locality, taxon, preparation\.
|
23
|
+
.
|
24
|
+
.P
|
25
|
+
Only existing accessions and preparation types can be assigned at present\. Unknown items will raise an error\.
|
26
|
+
.
|
27
|
+
.P
|
28
|
+
If geographic information is provided, but no locality name, the default locality name will be \fBnot cataloged, see label\fR\. This can be changed using the \fB\-\-locality\fR option\. Geographic information should be passed in the format \fBGeographic Rank: Name; Geographic Subrank: Name; locality: name\fR where \fIlocality\fR is optional (if not given, the default locality name will be used)\. Only geographic names/ranks and locality names that exist in the database will can be used (unknown item will raise an error)\.
|
29
|
+
.
|
30
|
+
.P
|
31
|
+
Taxon information is assigned as a determination\. Only one determination can be given to a stub records using the command\. Taxon information is provided in the format \fBTaxon Rank: Name; Taxon Subrank: Name\fR\. Only taxonomic names that exist in the database will be accepted\. Unknown items will raise an error\.
|
32
|
+
.
|
33
|
+
.P
|
34
|
+
Alternatively to using the options, a YAML file with all required information can be passed with the \fB\-\-file option\fR\. In that case, the \fIdatabase\fR and \fIcollection\fR arguments can be ommitted\.
|
35
|
+
.
|
36
|
+
.SH "FILES"
|
37
|
+
YAML files with stub record information provided using the \fB\-\-file\fR option should have the general structure:
|
38
|
+
.
|
39
|
+
.IP "" 4
|
40
|
+
.
|
41
|
+
.nf
|
42
|
+
|
43
|
+
\-\-\-
|
44
|
+
:stub_generator:
|
45
|
+
:host: <hostname>
|
46
|
+
:database: <database name>
|
47
|
+
:collection: <collection name>
|
48
|
+
:config: <database configuration file>
|
49
|
+
dataset_name: <record set name>
|
50
|
+
accession: <accession number>
|
51
|
+
cataloger: <specify user name>
|
52
|
+
collecting_data:
|
53
|
+
<1st rank>: <name>
|
54
|
+
<2nd rank>: <name>
|
55
|
+
<3rd rank>: <name>
|
56
|
+
:locality: <name>
|
57
|
+
default_locality_name: <name>
|
58
|
+
determination:
|
59
|
+
<rank>: <name>
|
60
|
+
preparation:
|
61
|
+
:type: <preparation type>
|
62
|
+
:count: <preparation count>
|
63
|
+
.
|
64
|
+
.fi
|
65
|
+
.
|
66
|
+
.IP "" 0
|
67
|
+
.
|
68
|
+
.P
|
69
|
+
Items prefixed with \fB:\fR in the YAML will be deserialized as Ruby symbols and need to be prefixed with \fB:\fR in your file\. Leave any unnecessary items out\. The first section \fB:stub_generator\fR contains connection information\. When \fB:config\fR is left out, \fIstubs\fR will use the config file provided with the global option \fB\-\-db_config\fR or the default file \fB~/\.specify_dbs\.rc\.yaml\fR if none provided\. Likewise, \fB:host\fR, and \fB:database\fR can be provided using the global options \fB\-\-host\fR and \fB\-\-database\fR respectively\.
|
70
|
+
.
|
71
|
+
.P
|
72
|
+
If you provide the \fB:locality\fR under \fBcollecting data:\fR, this will have precedence over the \fBdefault_locality_name\fR, so the latter is redundant\.
|
73
|
+
.
|
74
|
+
.SH "OPTIONS"
|
75
|
+
.
|
76
|
+
.IP "\(bu" 4
|
77
|
+
\fB\-f\fR, \fB\-\-file\fR \fIfile\fR: Load stub record information from a YAML file\.
|
78
|
+
.
|
79
|
+
.IP "\(bu" 4
|
80
|
+
\fB\-c\fR, \fB\-\-cataloger\fR \fIname\fR: Specify user appearing as cataloger and owner of the record set\.
|
81
|
+
.
|
82
|
+
.IP "\(bu" 4
|
83
|
+
\fB\-d\fR, \fB\-\-dataset\fR \fIname\fR: Name of the datas set (record set) generated\.
|
84
|
+
.
|
85
|
+
.IP "\(bu" 4
|
86
|
+
\fB\-a\fR, \fB\-\-accession\fR \fIaccession_number\fR Accession number for the accession to which the stub records belong\.
|
87
|
+
.
|
88
|
+
.IP "\(bu" 4
|
89
|
+
\fB\-g\fR, \fB\-\-geography\fR \fIgeography\fR Geographic and locality information for the stub records\. Format of \fIgeography\fR: \fB\'Rank1: Name; Rank2: Name; locality: name\'\fR
|
90
|
+
.
|
91
|
+
.IP "\(bu" 4
|
92
|
+
\fB\-l\fR, \fB\-\-locality\fR \fIname\fR: Default locality name if geographic information has no locality\.
|
93
|
+
.
|
94
|
+
.IP "\(bu" 4
|
95
|
+
\fB\-t\fR, \fB\-\-taxon\fR \fItaxon\fR: Taxon to which stub records are determined\. Format of \fItaxon\fR: \fB\'Rank1: Name; Rank2: Name; locality: name\'\fR
|
96
|
+
.
|
97
|
+
.IP "\(bu" 4
|
98
|
+
\fB\-p\fR, \fB\-\-preptype\fR \fIname\fR: Preparation type for the stub records, if they have preparations\.
|
99
|
+
.
|
100
|
+
.IP "\(bu" 4
|
101
|
+
\fB\-n\fR, \fB\-\-prepcount\fR \fInumber\fR: Number of preparation items (requires \-\-preptype to be set)\.
|
102
|
+
.
|
103
|
+
.IP "" 0
|
104
|
+
.
|
105
|
+
.SH "EXAMPLES"
|
106
|
+
Create 10 blank stub records in the collection \fBTriloites\fR in the database \fBSpecify\fR on localhost:
|
107
|
+
.
|
108
|
+
.IP "" 4
|
109
|
+
.
|
110
|
+
.nf
|
111
|
+
|
112
|
+
$ specify_cli \-D Specify stubs Trilobites 10
|
113
|
+
.
|
114
|
+
.fi
|
115
|
+
.
|
116
|
+
.IP "" 0
|
117
|
+
.
|
118
|
+
.P
|
119
|
+
Create 10 stub records determined to \fBAsaphidae\fR in the collection \fBTriloites\fR in the database\fBSpecify\fR on localhost:
|
120
|
+
.
|
121
|
+
.IP "" 4
|
122
|
+
.
|
123
|
+
.nf
|
124
|
+
|
125
|
+
$ specify_cli \-D Specify stubs\en
|
126
|
+
\-\-taxon=\'Class: Trilobita; Order: Asaphida; Family: Asaphidae\'\en
|
127
|
+
Trilobites 10
|
128
|
+
.
|
129
|
+
.fi
|
130
|
+
.
|
131
|
+
.IP "" 0
|
132
|
+
.
|
133
|
+
.P
|
134
|
+
Create 10 stub records for herbarium sheets in the collection \fBOrchids\fR in the database \fBSpecify\fR on localhost, determined to taxon \fBOrchidaceae\fR:
|
135
|
+
.
|
136
|
+
.IP "" 4
|
137
|
+
.
|
138
|
+
.nf
|
139
|
+
|
140
|
+
$ specify_cli \-D Specify stubs \-\-taxon=\'Family: Orchidaceae\'\en
|
141
|
+
\-\-preptype=Sheet \-\-perpcount=1 Orchids 10
|
142
|
+
.
|
143
|
+
.fi
|
144
|
+
.
|
145
|
+
.IP "" 0
|
146
|
+
.
|
147
|
+
.P
|
148
|
+
Create 10 stub records for herbarium sheets in the collection \fBOrchids\fR in the database \fBSpecify\fR on localhost, determined to taxon \fBOrchidaceae\fR, collected in \fBDowntown Lawrence\fR:
|
149
|
+
.
|
150
|
+
.IP "" 4
|
151
|
+
.
|
152
|
+
.nf
|
153
|
+
|
154
|
+
$ specify_cli \-D Specify stubs \-\-taxon=\'Family: Orchidaceae\'\en
|
155
|
+
\-\-geography=\'Country: United States, State: Kansas,\en
|
156
|
+
County: Douglas County; locality: Downtown Lawrence\'
|
157
|
+
\-\-preptype=Sheet \-\-perpcount=1 Orchids 10
|
158
|
+
.
|
159
|
+
.fi
|
160
|
+
.
|
161
|
+
.IP "" 0
|
162
|
+
.
|
163
|
+
.P
|
164
|
+
Create 10 stub records from a YAML file \fBstub_details\.yaml\fR:
|
165
|
+
.
|
166
|
+
.IP "" 4
|
167
|
+
.
|
168
|
+
.nf
|
169
|
+
|
170
|
+
$ specify_cli stubs \-\-file=stub_details\.yaml 10
|
171
|
+
.
|
172
|
+
.fi
|
173
|
+
.
|
174
|
+
.IP "" 0
|
175
|
+
.
|
176
|
+
.SH "SPECIFY_CLI"
|
177
|
+
Part of the specify_cli(1) suite
|