page

package
v3.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2019 License: AGPL-3.0 Imports: 28 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *store.Store
	Indexer indexer.Indexer
}

Handler contains the runtime information such as logging and database.

func (*Handler) Add

func (h *Handler) Add(w http.ResponseWriter, r *http.Request)

Add inserts new section into document.

func (*Handler) ChangePageLevel

func (h *Handler) ChangePageLevel(w http.ResponseWriter, r *http.Request)

ChangePageLevel handles page indent/outdent changes.

func (*Handler) ChangePageSequence

func (h *Handler) ChangePageSequence(w http.ResponseWriter, r *http.Request)

ChangePageSequence will swap page sequence for a given number of pages.

func (*Handler) Copy

func (h *Handler) Copy(w http.ResponseWriter, r *http.Request)

Copy copies page to either same or different document.

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

Delete a page.

func (*Handler) DeletePages

func (h *Handler) DeletePages(w http.ResponseWriter, r *http.Request)

DeletePages batch deletes pages.

func (*Handler) FetchPages added in v1.56.0

func (h *Handler) FetchPages(w http.ResponseWriter, r *http.Request)

FetchPages returns all page data for given document: page, meta data, pending changes.

func (*Handler) GetDiff

func (h *Handler) GetDiff(w http.ResponseWriter, r *http.Request)

GetDiff returns HTML diff between two revisions of a given page.

func (*Handler) GetDocumentRevisions

func (h *Handler) GetDocumentRevisions(w http.ResponseWriter, r *http.Request)

GetDocumentRevisions returns all changes for a document.

func (*Handler) GetMeta

func (h *Handler) GetMeta(w http.ResponseWriter, r *http.Request)

GetMeta gets page meta data for specified document page.

func (*Handler) GetPage

func (h *Handler) GetPage(w http.ResponseWriter, r *http.Request)

GetPage gets specified page for document.

func (*Handler) GetPages

func (h *Handler) GetPages(w http.ResponseWriter, r *http.Request)

GetPages gets all pages for document.

func (*Handler) GetRevisions

func (h *Handler) GetRevisions(w http.ResponseWriter, r *http.Request)

GetRevisions returns all changes for a given page.

func (*Handler) LevelizeDocument added in v1.56.0

func (h *Handler) LevelizeDocument(ctx domain.RequestContext, documentID string)

LevelizeDocument generates level and sequence numbers for all document sections

func (*Handler) Rollback

func (h *Handler) Rollback(w http.ResponseWriter, r *http.Request)

Rollback rolls back to a specific page revision.

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update will persist changed page and note the fact that this is a new revision. If the page is the first in a document then the corresponding document title will also be changed. Draft documents do not get revision entry.

type Store added in v1.71.0

type Store struct {
	store.Context
	store.OrganizationStorer
}

Store provides data access to organization (tenant) information.

func (Store) Add added in v1.71.0

func (s Store) Add(ctx domain.RequestContext, model page.NewPage) (err error)

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 (Store) Delete added in v1.71.0

func (s Store) Delete(ctx domain.RequestContext, documentID, pageID string) (rows int64, err error)

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 (Store) DeletePageRevisions added in v1.71.0

func (s Store) DeletePageRevisions(ctx domain.RequestContext, pageID string) (rows int64, err error)

DeletePageRevisions deletes all of the page revision records for a given pageID.

func (Store) Get added in v1.71.0

func (s Store) Get(ctx domain.RequestContext, pageID string) (p page.Page, err error)

Get returns the pageID page record from the page table.

func (Store) GetDocumentPageMeta added in v1.71.0

func (s Store) GetDocumentPageMeta(ctx domain.RequestContext, documentID string, externalSourceOnly bool) (meta []page.Meta, err error)

GetDocumentPageMeta returns the meta information associated with a document.

func (Store) GetDocumentRevisions added in v1.71.0

func (s Store) 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 (Store) GetNextPageSequence added in v1.71.0

func (s Store) 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 (Store) GetPageMeta added in v1.71.0

func (s Store) GetPageMeta(ctx domain.RequestContext, pageID string) (meta page.Meta, err error)

GetPageMeta returns the meta information associated with the page.

func (Store) GetPageRevision added in v1.71.0

func (s Store) GetPageRevision(ctx domain.RequestContext, revisionID string) (revision page.Revision, err error)

GetPageRevision returns the revisionID page revision record.

func (Store) GetPageRevisions added in v1.71.0

func (s Store) 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 (Store) GetPages added in v1.71.0

func (s Store) GetPages(ctx domain.RequestContext, documentID string) (p []page.Page, err error)

GetPages returns a slice containing all published page records for a given documentID, in presentation sequence.

func (Store) GetPagesWithoutContent added in v1.71.0

func (s Store) 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 (Store) GetUnpublishedPages added in v1.71.0

func (s Store) 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 (Store) Update added in v1.71.0

func (s Store) 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 (Store) UpdateLevel added in v1.71.0

func (s Store) 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 (Store) UpdateLevelSequence added in v1.71.0

func (s Store) UpdateLevelSequence(ctx domain.RequestContext, documentID, pageID string, level int, sequence float64) (err error)

UpdateLevelSequence changes page level and sequence numbers.

func (Store) UpdateMeta added in v1.71.0

func (s Store) UpdateMeta(ctx domain.RequestContext, meta page.Meta, updateUserID bool) (err error)

UpdateMeta persists meta information associated with a document page.

func (Store) UpdateSequence added in v1.71.0

func (s Store) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL