Skip to main content

Module page

Module page 

Source
Expand description

Page — the tenant-scoped cms_page row every page shares, whatever its type: tree position (path, depth, parent_id), slug and url_path, PageStatus lifecycle, SEO fields and the page_type_id that selects its PageTypeHandler. Type-specific fields live in the handler’s extension table.

Structs§

ArchivePlan
A planned archive / unarchive of a selection and (optionally) its subtree. Pure read output — the caller applies to_flip inside its own transaction, then purges changed_urls.
Page
The abstract page record. Each row points at a cms_page_type registry row via page_type_id; per-type extension data lives in a separate table authored by user code (multi-table inheritance).
ScheduleSweepResult
Outcome of one run_schedule_sweep tick.

Enums§

PageStatus
Lifecycle state of a page. Stored as a short string column so it survives migrations cleanly and is grep-able in the DB.

Functions§

alias_hybrid
Merge an alias row with its source into the page the site actually serves.
apply_sweep_effects
went_live_effects for every page a sweep published, and the search removal for every page it took down.
plan_archive
Plan an archive (archive = true) or unarchive of the already-loaded selected rows.
record_sweep_publishes
What a manual publish records that the sweep skipped (#945): a “Published” page-log entry and the subscriber emails, for every page the sweep took live. Emails use mailer (a mailer and its From:), else the process-wide one (crate::task_queue::default_mailer); without either only the log is written.
run_schedule_sweep
Flip the status of any page whose go_live_at has passed (draft or scheduled → published) and any page whose expire_at has passed (published → expired — a terminal 404 takedown, no longer conflated with the serve-able archived state). Idempotent — running it twice in a row produces zero changes on the second call.
run_schedule_sweep_and_purge
run_schedule_sweep + a frontend-cache purge of every page whose visibility flipped this tick. A scheduled page going live (or an expired one going away) must evict its previously-cached 404/draft/live entry; the bare sweep can’t, since it has no cache context. The purge routes through crate::task_queue::purge_urls, so it’s queued + retried when a task sink is installed, inline otherwise.
run_schedule_sweep_with_mailer
Sweep with a mailer attached — adds a pre-publish reminder pass. Every page with status = scheduled and go_live_at in (now, now + 1h] that hasn’t already received the reminder gets a notification to subscribers + the flag set so future ticks within the same window don’t duplicate.
went_live_effects
What must happen once a page has gone live, whichever path put it there: the search index learns about it and the host’s after-publish hooks run. An editor’s save, a bulk publish, a workflow finish and the schedule sweep each did their own subset — the sweep did neither, so a scheduled page never reached an external search index.