Package: oarepo-runtime
OARepo runtimeThe base ofinvenio oarepoclient and a set of classes/functions that help with code-generated features:Custom fieldsProvides support for custom fields identification and iteration andinvenio oarepo cf initinitialization tool for customfields.ExpansionsProvides expandable field implementation and service mixin for referenced record (in case you do not want to use relations).FacetsAn implementation of nested labeled facet.i18nValidator for language codes.RelationsReplacement of Invenio relations. Fixes the following issues:Invenio relations can occur only on specific paths and for each pattern, different class must be used
(Relation, ListRelation, NestedListRelation)PID Cache is isolated per request, not set directly on fieldAllows to map keys - A key from related object can be renamed/remapped to a different key/pathProvides classes to reference parts of the same record# article, id 12metadata:title:blahwith mapping referenced article would look like (mapping:{key: 'metadata.title', target: 'title'}):# dataset:metadata:articles:-id:12@v:1title:blahWith Invenio PID relation, it would be:# dataset:metadata:articles:-id:12"@v":1metadata:title:blahValidationThis module provides a marshmallow validator for date strings.ConfigProvides interface and definitions for loading
preconfigured permission sets to service config.ICU sort and suggestionsTo use ICU sort and suggestion custom fields, provide the following configuration
tooarepo-model-builder(or put this stuff to your custom superclasses).record:imports:-import:invenio_records_resources.records.api.Recordalias:InvenioRecord-import:oarepo_runtime.records.SystemFieldDumperExt-import:oarepo_runtime.records.icu.ICUSortField-import:oarepo_runtime.records.icu.ICUSuggestFieldextra-code:|-2# extra custom fields for testing ICU sorting and suggestingsort = ICUSortField(source_field="metadata.title")suggest = ICUSuggestField(source_field="metadata.title")search-options:base-classes:-I18nSearchOptionsimports:-import:oarepo_runtime.services.icu.I18nSearchOptions-import:oarepo_runtime.services.icu.ICUSuggestParser-import:oarepo_runtime.services.icu.ICUSortOptionssort-options-field:extra_sort_optionsextra-code:|-2suggest_parser_cls = ICUSuggestParser("records2")sort_options = ICUSortOptions("records2")record-dumper:extensions:-SystemFieldDumperExt()Runinvenio oarepo cf initto initialize custom fields,invenio oarepo index reindexif you already have data
inside the repository and from this moment on,/records?sort=titleand/records?suggest=abcshould workCommand-line utilsinvenio oarepo versionPrints a json with versions of all installed packages. Format:{"package_name":"package_version","package_name2":"package_version2",...}invenio oarepo checkChecks the repository if it has access to all infrastructure components
and that they have been initialized correctly.Call asinvenio oarepo check -orinvenio oarepo check <output-file>.
Will print/write to file a json with the following format:{
  "db": "ok|connection_error|not_initialized|migration_pending",
  "opensearch": "ok|connection_error|index_missing:<index_name>",
  "files": "ok|db_connection_error|default_location_missing|bucket_does_not_exist:<bucket_name>|db_error",
  "mq": "ok|connection_error|mq_error",
  "cache": "ok|connection_error|cache_error|cache_exception", 
  "configuration": {
     // contains the configuration from the flask app
     "key": "value",
     "key2": "value2",
     ...
  }
}