Documentation ¶
Index ¶
- func BuildExport(ctx domain.RequestContext, s store.Store, spec exportSpec) (html string, err error)
- func CopyDocument(ctx domain.RequestContext, s store.Store, documentID string) (newDocumentID string, err error)
- func FilterCategoryProtected(docs []doc.Document, cats []category.Category, members []category.Member, ...) (filtered []doc.Document)
- func FilterLastVersion(docs []doc.Document) (filtered []doc.Document)
- type BulkDocumentData
- type Handler
- func (h *Handler) BySpace(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DocumentLinks(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Duplicate(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Export(w http.ResponseWriter, r *http.Request)
- func (h *Handler) FetchDocumentData(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SearchDocuments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Update(w http.ResponseWriter, r *http.Request)
- type Store
- func (s Store) Add(ctx domain.RequestContext, d doc.Document) (err error)
- func (s Store) ChangeDocumentSpace(ctx domain.RequestContext, document, space string) (err error)
- func (s Store) Delete(ctx domain.RequestContext, documentID string) (rows int64, err error)
- func (s Store) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Store) Get(ctx domain.RequestContext, id string) (document doc.Document, err error)
- func (s Store) GetBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
- func (s Store) GetVersions(ctx domain.RequestContext, groupID string) (v []doc.Version, err error)
- func (s Store) MoveActivity(ctx domain.RequestContext, documentID, oldSpaceID, newSpaceID string) (err error)
- func (s Store) MoveDocumentSpace(ctx domain.RequestContext, id, move string) (err error)
- func (s Store) PublicDocuments(ctx domain.RequestContext, orgID string) (documents []doc.SitemapDocument, err error)
- func (s Store) TemplatesBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
- func (s Store) Update(ctx domain.RequestContext, document doc.Document) (err error)
- func (s Store) UpdateGroup(ctx domain.RequestContext, d doc.Document) (err error)
- func (s Store) UpdateRevised(ctx domain.RequestContext, docID string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildExport ¶ added in v1.68.0
func BuildExport(ctx domain.RequestContext, s store.Store, spec exportSpec) (html string, err error)
BuildExport generates self-enclosed HTML for content specified.
func CopyDocument ¶ added in v1.59.0
func CopyDocument(ctx domain.RequestContext, s store.Store, documentID string) (newDocumentID string, err error)
CopyDocument clones an existing document
func FilterCategoryProtected ¶ added in v1.59.0
func FilterCategoryProtected(docs []doc.Document, cats []category.Category, members []category.Member, viewDrafts bool) (filtered []doc.Document)
FilterCategoryProtected removes documents that cannot be seen by user due to document cateogory viewing permissions.
Types ¶
type BulkDocumentData ¶ added in v1.56.0
type BulkDocumentData struct { Document doc.Document `json:"document"` Permissions pm.Record `json:"permissions"` Roles pm.DocumentRecord `json:"roles"` Spaces []space.Space `json:"folders"` Links []link.Link `json:"links"` Versions []doc.Version `json:"versions"` Attachments []attachment.Attachment `json:"attachments"` }
BulkDocumentData represents all data associated for a single document. Used by FetchDocumentData() bulk data load call.
type Handler ¶
Handler contains the runtime information such as logging and database.
func (*Handler) BySpace ¶
func (h *Handler) BySpace(w http.ResponseWriter, r *http.Request)
BySpace is an endpoint that returns the documents for given space.
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
Delete is an endpoint that deletes a document specified by documentID.
func (*Handler) DocumentLinks ¶
func (h *Handler) DocumentLinks(w http.ResponseWriter, r *http.Request)
DocumentLinks is an endpoint returning the links for a document.
func (*Handler) Duplicate ¶
func (h *Handler) Duplicate(w http.ResponseWriter, r *http.Request)
Duplicate makes a copy of a document. Name of new document is required.
func (*Handler) Export ¶ added in v1.68.0
func (h *Handler) Export(w http.ResponseWriter, r *http.Request)
Export returns content as self-enclosed HTML file.
func (*Handler) FetchDocumentData ¶ added in v1.54.0
func (h *Handler) FetchDocumentData(w http.ResponseWriter, r *http.Request)
FetchDocumentData returns all document data in single API call.
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
Get is an endpoint that returns the document-level information for a given documentID.
func (*Handler) SearchDocuments ¶
func (h *Handler) SearchDocuments(w http.ResponseWriter, r *http.Request)
SearchDocuments endpoint takes a list of keywords and returns a list of document references matching those keywords.
type Store ¶ added in v1.71.0
type Store struct { store.Context store.DocumentStorer }
Store provides data access to space category information.
func (Store) Add ¶ added in v1.71.0
Add inserts the given document record into the document table and audits that it has been done.
func (Store) ChangeDocumentSpace ¶ added in v1.71.0
func (s Store) ChangeDocumentSpace(ctx domain.RequestContext, document, space string) (err error)
ChangeDocumentSpace assigns the specified space to the document.
func (Store) Delete ¶ added in v1.71.0
Delete removes the specified document. Remove document pages, revisions, attachments, updates the search subsystem.
func (Store) DeleteBySpace ¶ added in v1.71.0
DeleteBySpace removes all documents for given space. Remove document pages, revisions, attachments, updates the search subsystem.
func (Store) Get ¶ added in v1.71.0
Get fetches the document record with the given id fromt the document table and audits that it has been got.
func (Store) GetBySpace ¶ added in v1.71.0
func (s Store) GetBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
GetBySpace returns a slice containing the documents for a given space.
No attempt is made to hide documents that are protected by category permissions hence caller must filter as required.
All versions of a document are returned, hence caller must decide what to do with them.
func (Store) GetVersions ¶ added in v1.71.0
GetVersions returns a slice containing the documents for a given space.
No attempt is made to hide documents that are protected by category permissions hence caller must filter as required.
All versions of a document are returned, hence caller must decide what to do with them.
func (Store) MoveActivity ¶ added in v1.71.0
func (s Store) MoveActivity(ctx domain.RequestContext, documentID, oldSpaceID, newSpaceID string) (err error)
MoveActivity changes the space for all document activity records.
func (Store) MoveDocumentSpace ¶ added in v1.71.0
func (s Store) MoveDocumentSpace(ctx domain.RequestContext, id, move string) (err error)
MoveDocumentSpace changes the space for client's organization's documents which have space "id", to "move".
func (Store) PublicDocuments ¶ added in v1.71.0
func (s Store) PublicDocuments(ctx domain.RequestContext, orgID string) (documents []doc.SitemapDocument, err error)
PublicDocuments returns a slice of SitemapDocument records linking to documents in public spaces. These documents can then be seen by search crawlers.
func (Store) TemplatesBySpace ¶ added in v1.71.0
func (s Store) TemplatesBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
TemplatesBySpace returns a slice containing the documents available as templates for given space.
func (Store) Update ¶ added in v1.71.0
Update changes the given document record to the new values, updates search information and audits the action.
func (Store) UpdateGroup ¶ added in v1.71.0
UpdateGroup applies same values to all documents with the same group ID.
func (Store) UpdateRevised ¶
func (s Store) UpdateRevised(ctx domain.RequestContext, docID string) (err error)
UpdateRevised sets document revision date to UTC now.