wfexs_backend.pushers.b2share_export
#
Module Contents#
Classes#
Data#
API#
- wfexs_backend.pushers.b2share_export.INTROSPECT_VALIDATOR_MAPPER: Mapping[str, Type[jsonschema.validators._Validator]] = None#
- class wfexs_backend.pushers.b2share_export.B2SHAREPublisher(refdir: pathlib.Path, setup_block: SecurityContextConfig | None = None, default_licences: Sequence[LicenceDescription] = [], default_orcids: Sequence[ResolvedORCID] = [], default_preferred_id: str | None = None)#
Bases:
wfexs_backend.pushers.abstract_token_sandboxed_export.AbstractTokenSandboxedExportPlugin
See https://eudat.eu/services/userdoc/b2share-http-rest-api
Initialization
- PLUGIN_NAME: ClassVar[SymbolicName] = 'cast(...)'#
- _get_community_schema(community_id: str) → Tuple[str, Mapping[str, Any], str, str | None] | None#
It fetches the community schema
- _get_entries_schema(community_id: str) → Tuple[str, Mapping[str, Any], str]#
It fetches the community schema
- _validate_community_schema(community_id: str, community_specific_metadata: Mapping[str, Any]) → str | None#
- _create_draft_record(metadata: Mapping[str, Any] | None = None, community_specific_metadata: Mapping[str, Any] | None = None, base_id: str | None = None, do_validate: bool = False, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) → Mapping[str, Any]#
- INTERNAL_ID_PAT: Final[re.Pattern[str]] = 'compile(...)'#
- book_pid(preferred_id: str | None = None, initially_required_metadata: Mapping[str, Any] | None = None, initially_required_community_specific_metadata: Mapping[str, Any] | None = None, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) → DraftEntry | None#
It returns the publisher internal draft id, the public DOI / link, and the draft record representation
- property _customized_book_pid_error_string: str#
This method can be overridden to provide more context
- discard_booked_pid(pid_or_draft: str | DraftEntry) → bool#
- get_file_bucket_prefix(draft_entry: wfexs_backend.pushers.DraftEntry) → str#
This is an accessory method which is used to build upload paths
- upload_file_to_draft(draft_entry: wfexs_backend.pushers.DraftEntry, filename: str | IO[bytes], remote_filename: str | None, content_size: int | None = None) → Mapping[str, Any]#
It takes as input the draft record representation, a local filename and optionally the remote filename to use
- static __update_meta(draft_record_metadata: Mapping[str, Any], metadata: Mapping[str, Any]) → MutableMapping[str, Any]#
Generator of JSON Patch operations
- classmethod __PatchOps(draft_record_metadata: Mapping[str, Any], metadata: Mapping[str, Any], prefix: str = '/') → Sequence[Mapping[str, Any]]#
Generator of JSON Patch operations
- update_record_metadata(draft_entry: wfexs_backend.pushers.DraftEntry, metadata: Mapping[str, Any] | None = None, community_specific_metadata: Mapping[str, Any] | None = None, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = [], do_validate: bool = False) → Mapping[str, Any]#
This method updates the (draft or not) record metadata, both the general one, and the specific of the community. This one could not make sense for some providers.
- publish_draft_record(draft_entry: wfexs_backend.pushers.DraftEntry) → Mapping[str, Any]#
This method publishes a draft record