document

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: 32 Imported by: 6

Documentation

Index

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.

func FilterLastVersion added in v1.59.0

func FilterLastVersion(docs []doc.Document) (filtered []doc.Document)

FilterLastVersion returns the latest version of each document by removing all previous versions. If a document is not versioned, it is returned as-is.

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

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

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 (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.

func (*Handler) Update

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

Update updates an existing document using the format described in NewDocumentModel() encoded as JSON in the request.

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

func (s Store) Add(ctx domain.RequestContext, d doc.Document) (err error)

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

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

Delete removes the specified document. Remove document pages, revisions, attachments, updates the search subsystem.

func (Store) DeleteBySpace added in v1.71.0

func (s Store) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)

DeleteBySpace removes all documents for given space. Remove document pages, revisions, attachments, updates the search subsystem.

func (Store) Get added in v1.71.0

func (s Store) Get(ctx domain.RequestContext, id string) (document doc.Document, err error)

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

func (s Store) GetVersions(ctx domain.RequestContext, groupID string) (v []doc.Version, err error)

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

func (s Store) Update(ctx domain.RequestContext, document doc.Document) (err error)

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

func (s Store) UpdateGroup(ctx domain.RequestContext, d doc.Document) (err error)

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.

Jump to

Keyboard shortcuts

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