community: github.com/documize/community/domain/page Index | Files

package page

import "github.com/documize/community/domain/page"

Index

Package Files

endpoint.go page.go store.go

type Handler Uses

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 Uses

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

Add inserts new section into document.

func (*Handler) ChangePageLevel Uses

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

ChangePageLevel handles page indent/outdent changes.

func (*Handler) ChangePageSequence Uses

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

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

func (*Handler) Copy Uses

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

Copy copies page to either same or different document.

func (*Handler) Delete Uses

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

Delete a page.

func (*Handler) DeletePages Uses

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

DeletePages batch deletes pages.

func (*Handler) FetchPages Uses

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 Uses

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

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

func (*Handler) GetDocumentRevisions Uses

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

GetDocumentRevisions returns all changes for a document.

func (*Handler) GetMeta Uses

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

GetMeta gets page meta data for specified document page.

func (*Handler) GetPage Uses

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

GetPage gets specified page for document.

func (*Handler) GetPages Uses

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

GetPages gets all pages for document.

func (*Handler) GetRevisions Uses

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

GetRevisions returns all changes for a given page.

func (*Handler) LevelizeDocument Uses

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

LevelizeDocument generates level and sequence numbers for all document sections

func (*Handler) Rollback Uses

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

Rollback rolls back to a specific page revision.

func (*Handler) Update Uses

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 Uses

type Store struct {
    store.Context
    store.OrganizationStorer
}

Store provides data access to organization (tenant) information.

func (Store) Add Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

GetPageRevision returns the revisionID page revision record.

func (Store) GetPageRevisions Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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.

Package page imports 28 packages (graph) and is imported by 2 packages. Updated 2019-09-20. Refresh now. Tools for package owners.