specify_cli 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +17 -0
  5. data/Gemfile.lock +117 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.rdoc +43 -0
  8. data/Rakefile +15 -0
  9. data/bin/specify_cli +248 -0
  10. data/lib/specify.rb +45 -0
  11. data/lib/specify/branch_parser.rb +85 -0
  12. data/lib/specify/cli.rb +11 -0
  13. data/lib/specify/cli/database_setup.rb +46 -0
  14. data/lib/specify/cli/stubs.rb +63 -0
  15. data/lib/specify/cli/viewset.rb +21 -0
  16. data/lib/specify/configuration.rb +12 -0
  17. data/lib/specify/configuration/config.rb +120 -0
  18. data/lib/specify/configuration/db_config.rb +162 -0
  19. data/lib/specify/configuration/host_config.rb +37 -0
  20. data/lib/specify/database.rb +140 -0
  21. data/lib/specify/models.rb +43 -0
  22. data/lib/specify/models/accession.rb +33 -0
  23. data/lib/specify/models/agent.rb +138 -0
  24. data/lib/specify/models/app_resource_data.rb +32 -0
  25. data/lib/specify/models/app_resource_dir.rb +43 -0
  26. data/lib/specify/models/auto_numbering_scheme.rb +94 -0
  27. data/lib/specify/models/collecting_event.rb +38 -0
  28. data/lib/specify/models/collection.rb +67 -0
  29. data/lib/specify/models/collection_object.rb +127 -0
  30. data/lib/specify/models/createable.rb +21 -0
  31. data/lib/specify/models/determination.rb +63 -0
  32. data/lib/specify/models/discipline.rb +61 -0
  33. data/lib/specify/models/division.rb +26 -0
  34. data/lib/specify/models/geography.rb +5 -0
  35. data/lib/specify/models/geography/administrative_division.rb +32 -0
  36. data/lib/specify/models/geography/geographic_name.rb +66 -0
  37. data/lib/specify/models/geography/geography.rb +23 -0
  38. data/lib/specify/models/institution.rb +13 -0
  39. data/lib/specify/models/locality.rb +50 -0
  40. data/lib/specify/models/preparation.rb +53 -0
  41. data/lib/specify/models/preparation_type.rb +30 -0
  42. data/lib/specify/models/record_set.rb +55 -0
  43. data/lib/specify/models/record_set_item.rb +29 -0
  44. data/lib/specify/models/taxonomy.rb +6 -0
  45. data/lib/specify/models/taxonomy/common_name.rb +14 -0
  46. data/lib/specify/models/taxonomy/rank.rb +31 -0
  47. data/lib/specify/models/taxonomy/taxon.rb +54 -0
  48. data/lib/specify/models/taxonomy/taxonomy.rb +21 -0
  49. data/lib/specify/models/tree_queryable.rb +55 -0
  50. data/lib/specify/models/updateable.rb +20 -0
  51. data/lib/specify/models/user.rb +104 -0
  52. data/lib/specify/models/view_set_object.rb +32 -0
  53. data/lib/specify/number_format.rb +60 -0
  54. data/lib/specify/services.rb +18 -0
  55. data/lib/specify/services/service.rb +51 -0
  56. data/lib/specify/services/stub_generator.rb +291 -0
  57. data/lib/specify/services/view_loader.rb +177 -0
  58. data/lib/specify/session.rb +77 -0
  59. data/lib/specify/user_type.rb +61 -0
  60. data/lib/specify/version.rb +19 -0
  61. data/man/specify_cli-database.1 +60 -0
  62. data/man/specify_cli-database.1.html +137 -0
  63. data/man/specify_cli-database.1.ronn +53 -0
  64. data/man/specify_cli-repository.1 +55 -0
  65. data/man/specify_cli-repository.1.html +128 -0
  66. data/man/specify_cli-repository.1.ronn +42 -0
  67. data/man/specify_cli-stubs.1 +177 -0
  68. data/man/specify_cli-stubs.1.html +239 -0
  69. data/man/specify_cli-stubs.1.ronn +147 -0
  70. data/man/specify_cli-viewset.1 +92 -0
  71. data/man/specify_cli-viewset.1.html +154 -0
  72. data/man/specify_cli-viewset.1.ronn +72 -0
  73. data/man/specify_cli.1 +213 -0
  74. data/man/specify_cli.1.html +252 -0
  75. data/man/specify_cli.1.ronn +157 -0
  76. data/spec/branch_parser_spec.rb +94 -0
  77. data/spec/cli/stubs_spec.rb +44 -0
  78. data/spec/configuration/config_spec.rb +269 -0
  79. data/spec/configuration/db_config_spec.rb +299 -0
  80. data/spec/configuration/host_config_spec.rb +64 -0
  81. data/spec/database_spec.rb +83 -0
  82. data/spec/examples.txt +217 -0
  83. data/spec/helpers.rb +15 -0
  84. data/spec/models/app_resource_data_spec.rb +38 -0
  85. data/spec/models/app_resource_dir_spec.rb +8 -0
  86. data/spec/models/auto_numbering_scheme_spec.rb +78 -0
  87. data/spec/models/collection_object_spec.rb +92 -0
  88. data/spec/models/collection_spec.rb +32 -0
  89. data/spec/models/discipline_spec.rb +31 -0
  90. data/spec/models/record_set_spec.rb +18 -0
  91. data/spec/models/user_spec.rb +182 -0
  92. data/spec/models/view_set_object_spec.rb +70 -0
  93. data/spec/number_format_spec.rb +43 -0
  94. data/spec/services/stub_generator_spec.rb +635 -0
  95. data/spec/services/view_loader_spec.rb +436 -0
  96. data/spec/session_spec.rb +105 -0
  97. data/spec/spec_helper.rb +116 -0
  98. data/spec/support/db.yml +12 -0
  99. data/spec/support/stub.yaml +17 -0
  100. data/spec/support/stub_locality.yaml +19 -0
  101. data/spec/support/viewsets/paleo.views.xml +30 -0
  102. data/spec/support/viewsets/paleo.xml +30 -0
  103. data/spec/user_type_spec.rb +79 -0
  104. data/specify_cli.gemspec +27 -0
  105. data/specify_cli.rdoc +1 -0
  106. metadata +246 -0
@@ -0,0 +1,239 @@
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-stubsy(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="#FILES">FILES</a>
60
+ <a href="#OPTIONS">OPTIONS</a>
61
+ <a href="#EXAMPLES">EXAMPLES</a>
62
+ <a href="#SPECIFY_CLI">SPECIFY_CLI</a>
63
+ </div>
64
+
65
+ <ol class='man-decor man-head man head'>
66
+ <li class='tl'>specify_cli-stubsy(1)</li>
67
+ <li class='tc'></li>
68
+ <li class='tr'>specify_cli-stubsy(1)</li>
69
+ </ol>
70
+
71
+ <h2 id="NAME">NAME</h2>
72
+ <p class="man-name">
73
+ <code>specify_cli-stubsy</code> - <span class="man-whatis">A command line interface for Specify</span>
74
+ </p>
75
+
76
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
77
+
78
+ <p><code>specify_cli</code> [<var>global options</var>] <code>stubs</code> [<var>options</var>] <var>collection</var> <var>count</var>
79
+ <code>specify_cli</code> <code>stubs</code> <code>--file</code> <var>count</var></p>
80
+
81
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
82
+
83
+ <p>The stubs command creates stub records in a collection, so that catalog
84
+ numbers can be printed to labels e.g. prior to mass digitizaton. The command
85
+ currently only works for collection objects, and will currently only work for
86
+ collections using the numeric catalog numbering scheme.</p>
87
+
88
+ <p>Generated catalog numbers are printed to stdout.</p>
89
+
90
+ <p>The number of stub records created is specified with the <em>count</em> argument.
91
+ The target collection is provided as the <em>collection</em> argument. <em>Host</em> and
92
+ <em>database</em> are provided using the global options <code>--host</code> and <code>--database</code>
93
+ respectively.
94
+ The command will generate a record set with all generated collection objects.
95
+ The record set will be owned by either the <em>Specify user</em> (as provided via the
96
+ global option <code>--specify_user</code> or in the database configuration file), or the
97
+ <em>Specify user</em> provided with the <code>--cataloger</code> option. If no dataset name is
98
+ provided using the <code>--dataset</code> option, the default name will be <code>stub record set
99
+ &lt;TIMESTAMP></code>.</p>
100
+
101
+ <p>Records can be created with the following basic information (provided using
102
+ command options - see below): cataloger, accession, geography/locality, taxon,
103
+ preparation.</p>
104
+
105
+ <p>Only existing accessions and preparation types can be assigned at present.
106
+ Unknown items will raise an error.</p>
107
+
108
+ <p>If geographic information is provided, but no locality name, the
109
+ default locality name will be <code>not cataloged, see label</code>. This can be changed
110
+ using the <code>--locality</code> option. Geographic information should be passed in the
111
+ format <code>Geographic Rank: Name; Geographic Subrank: Name; locality: name</code> where
112
+ <em>locality</em> is optional (if not given, the default locality name will be used).
113
+ Only geographic names/ranks and locality names that exist in the database will
114
+ can be used (unknown item will raise an error).</p>
115
+
116
+ <p>Taxon information is assigned as a determination. Only one determination can
117
+ be given to a stub records using the command. Taxon information is provided
118
+ in the format <code>Taxon Rank: Name; Taxon Subrank: Name</code>. Only taxonomic names that exist in the database will be accepted. Unknown items will raise an error.</p>
119
+
120
+ <p>Alternatively to using the options, a YAML file with all required information
121
+ can be passed with the <code>--file option</code>. In that case, the <em>database</em> and
122
+ <em>collection</em> arguments can be ommitted.</p>
123
+
124
+ <h2 id="FILES">FILES</h2>
125
+
126
+ <p>YAML files with stub record information provided using the <code>--file</code> option
127
+ should have the general structure:</p>
128
+
129
+ <pre><code>---
130
+ :stub_generator:
131
+ :host: &lt;hostname>
132
+ :database: &lt;database name>
133
+ :collection: &lt;collection name>
134
+ :config: &lt;database configuration file>
135
+ dataset_name: &lt;record set name>
136
+ accession: &lt;accession number>
137
+ cataloger: &lt;specify user name>
138
+ collecting_data:
139
+ &lt;1st rank>: &lt;name>
140
+ &lt;2nd rank>: &lt;name>
141
+ &lt;3rd rank>: &lt;name>
142
+ :locality: &lt;name>
143
+ default_locality_name: &lt;name>
144
+ determination:
145
+ &lt;rank>: &lt;name>
146
+ preparation:
147
+ :type: &lt;preparation type>
148
+ :count: &lt;preparation count>
149
+ </code></pre>
150
+
151
+ <p>Items prefixed with <code>:</code> in the YAML will be deserialized as Ruby symbols and
152
+ need to be prefixed with <code>:</code> in your file. Leave any unnecessary items out.
153
+ The first section <code>:stub_generator</code> contains connection information. When
154
+ <code>:config</code> is left out, <em>stubs</em> will use the config file provided with the global
155
+ option <code>--db_config</code> or the default file <code>~/.specify_dbs.rc.yaml</code> if none
156
+ provided. Likewise, <code>:host</code>, and <code>:database</code> can be provided using the global
157
+ options <code>--host</code> and <code>--database</code> respectively.</p>
158
+
159
+ <p>If you provide the <code>:locality</code> under <code>collecting data:</code>, this will have
160
+ precedence over the <code>default_locality_name</code>, so the latter is redundant.</p>
161
+
162
+ <h2 id="OPTIONS">OPTIONS</h2>
163
+
164
+ <ul>
165
+ <li><code>-f</code>, <code>--file</code> <var>file</var>:
166
+ Load stub record information from a YAML file.</li>
167
+ <li><code>-c</code>, <code>--cataloger</code> <var>name</var>:
168
+ Specify user appearing as cataloger and owner of the record set.</li>
169
+ <li><code>-d</code>, <code>--dataset</code> <var>name</var>:
170
+ Name of the datas set (record set) generated.</li>
171
+ <li><code>-a</code>, <code>--accession</code> <var>accession_number</var>
172
+ Accession number for the accession to which the stub records belong.</li>
173
+ <li><code>-g</code>, <code>--geography</code> <var>geography</var>
174
+ Geographic and locality information for the stub records. Format of
175
+ <var>geography</var>: <code>'Rank1: Name; Rank2: Name; locality: name'</code></li>
176
+ <li><code>-l</code>, <code>--locality</code> <var>name</var>:
177
+ Default locality name if geographic information has no locality.</li>
178
+ <li><code>-t</code>, <code>--taxon</code> <var>taxon</var>:
179
+ Taxon to which stub records are determined. Format of <var>taxon</var>:
180
+ <code>'Rank1: Name; Rank2: Name; locality: name'</code></li>
181
+ <li><code>-p</code>, <code>--preptype</code> <var>name</var>:
182
+ Preparation type for the stub records, if they have preparations.</li>
183
+ <li><code>-n</code>, <code>--prepcount</code> <var>number</var>:
184
+ Number of preparation items (requires --preptype to be set).</li>
185
+ </ul>
186
+
187
+
188
+ <h2 id="EXAMPLES">EXAMPLES</h2>
189
+
190
+ <p>Create 10 blank stub records in the collection <code>Triloites</code> in the database
191
+ <code>Specify</code> on localhost:</p>
192
+
193
+ <pre><code>$ specify_cli -D Specify stubs Trilobites 10
194
+ </code></pre>
195
+
196
+ <p>Create 10 stub records determined to <code>Asaphidae</code> in the collection <code>Triloites</code>
197
+ in the database<code>Specify</code> on localhost:</p>
198
+
199
+ <pre><code>$ specify_cli -D Specify stubs\n
200
+ --taxon='Class: Trilobita; Order: Asaphida; Family: Asaphidae'\n
201
+ Trilobites 10
202
+ </code></pre>
203
+
204
+ <p>Create 10 stub records for herbarium sheets in the collection <code>Orchids</code> in the
205
+ database <code>Specify</code> on localhost, determined to taxon <code>Orchidaceae</code>:</p>
206
+
207
+ <pre><code>$ specify_cli -D Specify stubs --taxon='Family: Orchidaceae'\n
208
+ --preptype=Sheet --perpcount=1 Orchids 10
209
+ </code></pre>
210
+
211
+ <p>Create 10 stub records for herbarium sheets in the collection <code>Orchids</code> in the
212
+ database <code>Specify</code> on localhost, determined to taxon <code>Orchidaceae</code>, collected
213
+ in <code>Downtown Lawrence</code>:</p>
214
+
215
+ <pre><code>$ specify_cli -D Specify stubs --taxon='Family: Orchidaceae'\n
216
+ --geography='Country: United States, State: Kansas,\n
217
+ County: Douglas County; locality: Downtown Lawrence'
218
+ --preptype=Sheet --perpcount=1 Orchids 10
219
+ </code></pre>
220
+
221
+ <p>Create 10 stub records from a YAML file <code>stub_details.yaml</code>:</p>
222
+
223
+ <pre><code>$ specify_cli stubs --file=stub_details.yaml 10
224
+ </code></pre>
225
+
226
+ <h2 id="SPECIFY_CLI">SPECIFY_CLI</h2>
227
+
228
+ <p>Part of the <span class="man-ref">specify_cli<span class="s">(1)</span></span> suite</p>
229
+
230
+
231
+ <ol class='man-decor man-foot man foot'>
232
+ <li class='tl'></li>
233
+ <li class='tc'>August 2018</li>
234
+ <li class='tr'>specify_cli-stubsy(1)</li>
235
+ </ol>
236
+
237
+ </div>
238
+ </body>
239
+ </html>
@@ -0,0 +1,147 @@
1
+ specify_cli-stubsy(1) -- A command line interface for Specify
2
+ ===============================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `specify_cli` [<global options>] `stubs` [<options>] <collection> <count>
7
+ `specify_cli` `stubs` `--file` <count>
8
+
9
+ ## DESCRIPTION
10
+
11
+ The stubs command creates stub records in a collection, so that catalog
12
+ numbers can be printed to labels e.g. prior to mass digitizaton. The command
13
+ currently only works for collection objects, and will currently only work for
14
+ collections using the numeric catalog numbering scheme.
15
+
16
+ Generated catalog numbers are printed to stdout.
17
+
18
+ The number of stub records created is specified with the *count* argument.
19
+ The target collection is provided as the *collection* argument. *Host* and
20
+ *database* are provided using the global options `--host` and `--database`
21
+ respectively.
22
+ The command will generate a record set with all generated collection objects.
23
+ The record set will be owned by either the *Specify user* (as provided via the
24
+ global option `--specify_user` or in the database configuration file), or the
25
+ *Specify user* provided with the `--cataloger` option. If no dataset name is
26
+ provided using the `--dataset` option, the default name will be `stub record set
27
+ <TIMESTAMP>`.
28
+
29
+ Records can be created with the following basic information (provided using
30
+ command options - see below): cataloger, accession, geography/locality, taxon,
31
+ preparation.
32
+
33
+ Only existing accessions and preparation types can be assigned at present.
34
+ Unknown items will raise an error.
35
+
36
+ If geographic information is provided, but no locality name, the
37
+ default locality name will be `not cataloged, see label`. This can be changed
38
+ using the `--locality` option. Geographic information should be passed in the
39
+ format `Geographic Rank: Name; Geographic Subrank: Name; locality: name` where
40
+ *locality* is optional (if not given, the default locality name will be used).
41
+ Only geographic names/ranks and locality names that exist in the database will
42
+ can be used (unknown item will raise an error).
43
+
44
+ Taxon information is assigned as a determination. Only one determination can
45
+ be given to a stub records using the command. Taxon information is provided
46
+ in the format `Taxon Rank: Name; Taxon Subrank: Name`. Only taxonomic names that exist in the database will be accepted. Unknown items will raise an error.
47
+
48
+ Alternatively to using the options, a YAML file with all required information
49
+ can be passed with the `--file option`. In that case, the *database* and
50
+ *collection* arguments can be ommitted.
51
+
52
+ ## FILES
53
+
54
+ YAML files with stub record information provided using the `--file` option
55
+ should have the general structure:
56
+
57
+ ---
58
+ :stub_generator:
59
+ :host: <hostname>
60
+ :database: <database name>
61
+ :collection: <collection name>
62
+ :config: <database configuration file>
63
+ dataset_name: <record set name>
64
+ accession: <accession number>
65
+ cataloger: <specify user name>
66
+ collecting_data:
67
+ <1st rank>: <name>
68
+ <2nd rank>: <name>
69
+ <3rd rank>: <name>
70
+ :locality: <name>
71
+ default_locality_name: <name>
72
+ determination:
73
+ <rank>: <name>
74
+ preparation:
75
+ :type: <preparation type>
76
+ :count: <preparation count>
77
+
78
+ Items prefixed with `:` in the YAML will be deserialized as Ruby symbols and
79
+ need to be prefixed with `:` in your file. Leave any unnecessary items out.
80
+ The first section `:stub_generator` contains connection information. When
81
+ `:config` is left out, *stubs* will use the config file provided with the global
82
+ option `--db_config` or the default file `~/.specify_dbs.rc.yaml` if none
83
+ provided. Likewise, `:host`, and `:database` can be provided using the global
84
+ options `--host` and `--database` respectively.
85
+
86
+ If you provide the `:locality` under `collecting data:`, this will have
87
+ precedence over the `default_locality_name`, so the latter is redundant.
88
+
89
+ ## OPTIONS
90
+
91
+ * `-f`, `--file` <file>:
92
+ Load stub record information from a YAML file.
93
+ * `-c`, `--cataloger` <name>:
94
+ Specify user appearing as cataloger and owner of the record set.
95
+ * `-d`, `--dataset` <name>:
96
+ Name of the datas set (record set) generated.
97
+ * `-a`, `--accession` <accession_number>
98
+ Accession number for the accession to which the stub records belong.
99
+ * `-g`, `--geography` <geography>
100
+ Geographic and locality information for the stub records. Format of
101
+ <geography>: `'Rank1: Name; Rank2: Name; locality: name'`
102
+ * `-l`, `--locality` <name>:
103
+ Default locality name if geographic information has no locality.
104
+ * `-t`, `--taxon` <taxon>:
105
+ Taxon to which stub records are determined. Format of <taxon>:
106
+ `'Rank1: Name; Rank2: Name; locality: name'`
107
+ * `-p`, `--preptype` <name>:
108
+ Preparation type for the stub records, if they have preparations.
109
+ * `-n`, `--prepcount` <number>:
110
+ Number of preparation items (requires --preptype to be set).
111
+
112
+ ## EXAMPLES
113
+
114
+ Create 10 blank stub records in the collection `Triloites` in the database
115
+ `Specify` on localhost:
116
+
117
+ $ specify_cli -D Specify stubs Trilobites 10
118
+
119
+ Create 10 stub records determined to `Asaphidae` in the collection `Triloites`
120
+ in the database`Specify` on localhost:
121
+
122
+ $ specify_cli -D Specify stubs\n
123
+ --taxon='Class: Trilobita; Order: Asaphida; Family: Asaphidae'\n
124
+ Trilobites 10
125
+
126
+ Create 10 stub records for herbarium sheets in the collection `Orchids` in the
127
+ database `Specify` on localhost, determined to taxon `Orchidaceae`:
128
+
129
+ $ specify_cli -D Specify stubs --taxon='Family: Orchidaceae'\n
130
+ --preptype=Sheet --perpcount=1 Orchids 10
131
+
132
+ Create 10 stub records for herbarium sheets in the collection `Orchids` in the
133
+ database `Specify` on localhost, determined to taxon `Orchidaceae`, collected
134
+ in `Downtown Lawrence`:
135
+
136
+ $ specify_cli -D Specify stubs --taxon='Family: Orchidaceae'\n
137
+ --geography='Country: United States, State: Kansas,\n
138
+ County: Douglas County; locality: Downtown Lawrence'
139
+ --preptype=Sheet --perpcount=1 Orchids 10
140
+
141
+ Create 10 stub records from a YAML file `stub_details.yaml`:
142
+
143
+ $ specify_cli stubs --file=stub_details.yaml 10
144
+
145
+ ## SPECIFY_CLI
146
+
147
+ Part of the specify_cli(1) suite
@@ -0,0 +1,92 @@
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] \fBviewset\fR [\fIoptions\fR] \fIcollection\fR \fIfile\fR \fBspecify_cli\fR \fBviewset\fR \fB\-\-branch=\fR\fIname\fR \fIfile\fR \fBspecify_cli\fR \fBviewset\fR \fB\-b\fR \fIfile\fR
11
+ .
12
+ .SH "DESCRIPTION"
13
+ The viewset command uploads a view definition file (\fI\.views\.xml\fR) to the database\. Viewsets can be uploaded to either of the following levels: \fIdiscipline\fR, \fIcollection\fR, \fIuser type\fR, or \fIuser\fR\.
14
+ .
15
+ .P
16
+ Use the \fB`\-c\fR or \fB\-d\fR switches to upload to collection or discipline level respectively\.
17
+ .
18
+ .P
19
+ To upload for a specific user type in a collection, use the \fB\-\-user_type\fR option and provide the user type name (\fImanager\fR, \fIfullaccess\fR, \fIlimitedaccess\fR, or \fIguest\fR)\.
20
+ .
21
+ .P
22
+ To upload for a specific user level, use the \fB\-\-user\fR option and provide the Specify user name\.
23
+ .
24
+ .P
25
+ The \fIcollection\fR argument is required unless the \fB\-b\fR or \fB\-B\fR options are used (the collection is needed to register a login session)\.
26
+ .
27
+ .P
28
+ Provide information about the host, database, MySQL/MariaDB user and Specify user with the global options\.
29
+ .
30
+ .P
31
+ The \fB\-\-branch\fR option allows to provide a Git branch name, from which all necessary information about the target (host, database, collection, level) can be parsed\. This requires that the directory containing the \fI\.views\.xml\fR file is mapped to a host, and that the branch name follows the naming convention \fBrepository_name/database_name/collection_name/level\fR\.
32
+ .
33
+ .P
34
+ If your present working directory is mapped to a host and contains a Git repository and the current branch conforms to the naming convention, use the \fB\-b\fR switch to use the current branch instead of specifying the branch name with \fB\-\-branch\fR\.
35
+ .
36
+ .SH "FILES"
37
+ The command requires a \fI\.views\.xml\fR as an argument\.
38
+ .
39
+ .SH "OPTIONS"
40
+ .
41
+ .TP
42
+ \fB\-b\fR
43
+ Use current branch to resolve target\.
44
+ .
45
+ .TP
46
+ \fB\-B\fR, \fB\-\-branch\fR \fIname\fR
47
+ Resolve target from branch name\.
48
+ .
49
+ .TP
50
+ \fB\-c\fR
51
+ Upload to collection level\.
52
+ .
53
+ .TP
54
+ \fB\-d\fR
55
+ Upload to discipline level\.
56
+ .
57
+ .TP
58
+ \fB\-t\fR, \fB\-\-user_type\fR \fIname\fR
59
+ Upload to specific user type [name] in the collection\.
60
+ .
61
+ .TP
62
+ \fB\-u\fR, \fB\-\-user\fR \fIname\fR
63
+ Upload to specify user \fIname\fR in the collection\.
64
+ .
65
+ .SH "EXAMPLES"
66
+ Upload \fBinvertpaleo\.views\.xml\fR to discipline level for collection \fBTrilobites\fR in the database \fBSpecify\fR on localhost:
67
+ .
68
+ .IP "" 4
69
+ .
70
+ .nf
71
+
72
+ $ specify_cli \-D Specify viewset \-d Trilobites invertpaleo\.views\.xml
73
+ .
74
+ .fi
75
+ .
76
+ .IP "" 0
77
+ .
78
+ .P
79
+ Upload \fBinvertpaleo\.views\.xml\fR auto\-resolving target from current Git branch:
80
+ .
81
+ .IP "" 4
82
+ .
83
+ .nf
84
+
85
+ $ specify_cli viewset \-b invertpaleo\.views\.xml
86
+ .
87
+ .fi
88
+ .
89
+ .IP "" 0
90
+ .
91
+ .SH "SPECIFY_CLI"
92
+ Part of the specify_cli(1) suite