Action
datastore_search(original_action, context, data_dict)
¶
This chains the datastore_search action provided by the vds extension so that we can provide an "include_urls" parameter to users which, if included on a search of the specimen collection, adds a "permanentUrl" key and value to each record dict in the result.
Source code in ckanext/nhm/logic/action.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
get_permanent_url(context, data_dict)
¶
Retrieve the permanent URL of a specimen from the specimen collection using the field and value to filter the results (i.e. field must equal value for the record to match). A URL is returned only if exactly one record is matched by the field and value combination. If more than 1 record is matched or if 0 records are matched then an error is returned.
Params:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
string
|
the name of the field you would like to filter the records on |
required |
value
|
string
|
the value of the field to filter by |
required |
include_version
|
boolean **Results:**
|
whether to include the version in the permanent URL (default: false) |
required |
Returns:
| Type | Description |
|---|---|
string
|
the full URL of the specimen |
Source code in ckanext/nhm/logic/action.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
object_rdf(context, data_dict)
¶
Get record RDF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
|
required | |
data_dict
|
|
required |
Source code in ckanext/nhm/logic/action.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
show_extension_versions(context, data_dict)
¶
Find all the installed extension packages and return their names and versions.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
a dict of extension package name -> version |
Source code in ckanext/nhm/logic/action.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |