Publish
Publish controls the online/offline status of records. It generalizes publishing using 3 main modules:
Status
: to flag a record be online/offlineSchedule
: to schedule records to be online/offline automaticallyVersion
: to allow a record to have more than one copies and chain them together
Usage
Inject modules to the resource model.
Implement primary slug interfaces for passing the values of primary keys between events
Create publisher and configure Publish view for model, and remember to display Status and Schedule fields in Editing
Implement the publish interfaces if there is a need to publish content to storage(filesystem, AWS S3, ...)
Modules
Status
Status
module stores the status of the record.
The initial status is draft, after publishing it becomes online, and after unpublishing it becomes offline.
Schedule
Schedule
module schedules records to be online/offline automatically with the publisher job.
If a record has ScheduledStartAt
set, and the current time is larger than this value, the record will be published and the ActualStartAt
will be set to the actual published time, the ScheduledStartAt
will be cleared.
If a record has ScheduledEndAt
set, and the current time is larger than this value, the record will be unpublished and the ActualEndAt
will be set to the actual unpublished time, the ScheduledEndAt
will be cleared.
Version
Version
module allows one record to have multiple copies, with Schedule, you can even schedule different prices of a product for a whole year.
The Version
will be the primary key. By default, the Version
value will be YYYY-MM-DD-vSeq
, e.g. 2006-01-02-v01
. And you can rename a version on interface, which will modify the value of VersionName
.
List
List
module publishes list page of resource.