oarepo_config.ark
oarepo_config.ark
Configuration for ARK persistent identifiers (oarepo-ark).
configure_ark(*, default_shoulder: str, shoulders: dict[str, str] | None = None, naan: str = '99999', handlers: dict[str, type | str] | None = None, default_handler: type | str | None = None, public_resolver: str | None = None, support: dict[str, str] | None = None, show_in_sidebar: bool = True) -> None
Give every record published as public an ARK (Archival Resource Key).
Requires the optional oarepo-ark package. If this function is not
called, the package is installed but inert: no ARKs are minted and the
/ark:... resolver answers 404.
Must be called after configure_ui, because it
appends the ARK box to the detail page sidebar that configure_ui sets; calling it
earlier raises an error (unless show_in_sidebar is False).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default_shoulder
|
str
|
The shoulder used for all models, e.g. |
required |
shoulders
|
dict[str, str] | None
|
Per-model shoulder overrides, keyed by the model's
service id (the model name, or its |
None
|
naan
|
str
|
Your NAAN from https://arks.org/. Defaults to the test NAAN
|
'99999'
|
handlers
|
dict[str, type | str] | None
|
Per-model handler class (or its import string), keyed by the model's service id. |
None
|
default_handler
|
type | str | None
|
Handler class (or its import string) of all other
models. Defaults to oarepo-ark's |
None
|
public_resolver
|
str | None
|
Resolver used in citable ARK URLs. Defaults to
|
None
|
support
|
dict[str, str] | None
|
The |
None
|
show_in_sidebar
|
bool
|
Add the |
True
|
Invenio configuration variables set:
ARK_NAAN,ARK_DEFAULT_SHOULDER,ARK_SHOULDERS,ARK_HANDLERS- from the arguments above.ARK_DEFAULT_HANDLER,ARK_PUBLIC_RESOLVER,ARK_SUPPORT- only if the corresponding argument is given.APP_RDM_DETAIL_SIDE_BAR_TEMPLATES- thearkbox is added ifshow_in_sidebarisTrue.
Example
Source code in oarepo_config/ark.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 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 | |