In order to make content files available to clients, users must publish these files. Typically, users will publish a repository which will make the content in the repository available.
When publishing a repository, your plugin needs to mimic the layout of both data and metadata. In the simplest case for content types that don’t have metadata, only the content unit data itself needs to be published.
In most cases, both metadata and content unit data are required to make a usable publication. It’s important to understand what the required metadata is for your content type.
Publication context manager is highly encouraged. On
context exit, the complete attribute is set True provided that an exception has not been raised.
In the event an exception has been raised, the publication is deleted.
One of the ways to perform publishing:
ContentArtifactobjects which should be published
- For each of them create and save instance of
PublishedArtifactwhich refers to
Publicationto which this artifact belongs.
- Generate and write to a disk repository metadata
- For each of the metadata objects create and save instance of
PublishedMetadatawhich refers to a corresponding file and
Publicationto which this metadata belongs.
ProgressBarto report progress of some steps if needed.