Documentation ¶
Index ¶
- type Scope
- func (s Scope) Add(ctx domain.RequestContext, model page.NewPage) (err error)
- func (s Scope) Delete(ctx domain.RequestContext, documentID, pageID string) (rows int64, err error)
- func (s Scope) DeletePageRevisions(ctx domain.RequestContext, pageID string) (rows int64, err error)
- func (s Scope) Get(ctx domain.RequestContext, pageID string) (p page.Page, err error)
- func (s Scope) GetDocumentPageMeta(ctx domain.RequestContext, documentID string, externalSourceOnly bool) (meta []page.Meta, err error)
- func (s Scope) GetDocumentRevisions(ctx domain.RequestContext, documentID string) (revisions []page.Revision, err error)
- func (s Scope) GetNextPageSequence(ctx domain.RequestContext, documentID string) (maxSeq float64, err error)
- func (s Scope) GetPageMeta(ctx domain.RequestContext, pageID string) (meta page.Meta, err error)
- func (s Scope) GetPageRevision(ctx domain.RequestContext, revisionID string) (revision page.Revision, err error)
- func (s Scope) GetPageRevisions(ctx domain.RequestContext, pageID string) (revisions []page.Revision, err error)
- func (s Scope) GetPages(ctx domain.RequestContext, documentID string) (p []page.Page, err error)
- func (s Scope) GetPagesWithoutContent(ctx domain.RequestContext, documentID string) (pages []page.Page, err error)
- func (s Scope) GetUnpublishedPages(ctx domain.RequestContext, documentID string) (p []page.Page, err error)
- func (s Scope) Update(ctx domain.RequestContext, page page.Page, refID, userID string, ...) (err error)
- func (s Scope) UpdateLevel(ctx domain.RequestContext, documentID, pageID string, level int) (err error)
- func (s Scope) UpdateLevelSequence(ctx domain.RequestContext, documentID, pageID string, level int, ...) (err error)
- func (s Scope) UpdateMeta(ctx domain.RequestContext, meta page.Meta, updateUserID bool) (err error)
- func (s Scope) UpdateSequence(ctx domain.RequestContext, documentID, pageID string, sequence float64) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
Scope provides data access to MySQL.
func (Scope) Add ¶
Add inserts the given page into the page table, adds that page to the queue of pages to index and audits that the page has been added.
func (Scope) Delete ¶
Delete deletes the pageID page in the document. It then propagates that change into the search table, adds a delete the page revisions history, and audits that the page has been removed.
func (Scope) DeletePageRevisions ¶
func (s Scope) DeletePageRevisions(ctx domain.RequestContext, pageID string) (rows int64, err error)
DeletePageRevisions deletes all of the page revision records for a given pageID.
func (Scope) GetDocumentPageMeta ¶
func (s Scope) GetDocumentPageMeta(ctx domain.RequestContext, documentID string, externalSourceOnly bool) (meta []page.Meta, err error)
GetDocumentPageMeta returns the meta information associated with a document.
func (Scope) GetDocumentRevisions ¶
func (s Scope) GetDocumentRevisions(ctx domain.RequestContext, documentID string) (revisions []page.Revision, err error)
GetDocumentRevisions returns a slice of page revision records for a given document, in the order they were created. Then audits that the get-page-revisions action has occurred.
func (Scope) GetNextPageSequence ¶
func (s Scope) GetNextPageSequence(ctx domain.RequestContext, documentID string) (maxSeq float64, err error)
GetNextPageSequence returns the next sequence numbner to use for a page in given document.
func (Scope) GetPageMeta ¶
GetPageMeta returns the meta information associated with the page.
func (Scope) GetPageRevision ¶
func (s Scope) GetPageRevision(ctx domain.RequestContext, revisionID string) (revision page.Revision, err error)
GetPageRevision returns the revisionID page revision record.
func (Scope) GetPageRevisions ¶
func (s Scope) GetPageRevisions(ctx domain.RequestContext, pageID string) (revisions []page.Revision, err error)
GetPageRevisions returns a slice of page revision records for a given pageID, in the order they were created. Then audits that the get-page-revisions action has occurred.
func (Scope) GetPages ¶
GetPages returns a slice containing all published page records for a given documentID, in presentation sequence.
func (Scope) GetPagesWithoutContent ¶
func (s Scope) GetPagesWithoutContent(ctx domain.RequestContext, documentID string) (pages []page.Page, err error)
GetPagesWithoutContent returns a slice containing all the page records for a given documentID, in presentation sequence, but without the body field (which holds the HTML content).
func (Scope) GetUnpublishedPages ¶ added in v1.56.0
func (s Scope) GetUnpublishedPages(ctx domain.RequestContext, documentID string) (p []page.Page, err error)
GetUnpublishedPages returns a slice containing all published page records for a given documentID, in presentation sequence.
func (Scope) Update ¶
func (s Scope) Update(ctx domain.RequestContext, page page.Page, refID, userID string, skipRevision bool) (err error)
Update saves changes to the database and handles recording of revisions. Not all updates result in a revision being recorded hence the parameter.
func (Scope) UpdateLevel ¶
func (s Scope) UpdateLevel(ctx domain.RequestContext, documentID, pageID string, level int) (err error)
UpdateLevel changes the heading level of the pageID page in the document. It then propagates that change into the search table and audits that it has occurred.
func (Scope) UpdateLevelSequence ¶ added in v1.56.0
func (s Scope) UpdateLevelSequence(ctx domain.RequestContext, documentID, pageID string, level int, sequence float64) (err error)
UpdateLevelSequence changes page level and sequence numbers.
func (Scope) UpdateMeta ¶
UpdateMeta persists meta information associated with a document page.
func (Scope) UpdateSequence ¶
func (s Scope) UpdateSequence(ctx domain.RequestContext, documentID, pageID string, sequence float64) (err error)
UpdateSequence changes the presentation sequence of the pageID page in the document. It then propagates that change into the search table and audits that it has occurred.