Documentation ¶
Index ¶
- type Scope
- func (s Scope) Add(ctx domain.RequestContext, d doc.Document) (err error)
- func (s Scope) ChangeDocumentSpace(ctx domain.RequestContext, document, space string) (err error)
- func (s Scope) Delete(ctx domain.RequestContext, documentID string) (rows int64, err error)
- func (s Scope) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) DocumentMeta(ctx domain.RequestContext, id string) (meta doc.DocumentMeta, err error)
- func (s Scope) Get(ctx domain.RequestContext, id string) (document doc.Document, err error)
- func (s Scope) GetBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
- func (s Scope) GetVersions(ctx domain.RequestContext, groupID string) (v []doc.Version, err error)
- func (s Scope) MoveActivity(ctx domain.RequestContext, documentID, oldSpaceID, newSpaceID string) (err error)
- func (s Scope) MoveDocumentSpace(ctx domain.RequestContext, id, move string) (err error)
- func (s Scope) PublicDocuments(ctx domain.RequestContext, orgID string) (documents []doc.SitemapDocument, err error)
- func (s Scope) TemplatesBySpace(ctx domain.RequestContext, spaceID string) (documents []doc.Document, err error)
- func (s Scope) Update(ctx domain.RequestContext, document doc.Document) (err error)
- func (s Scope) UpdateGroup(ctx domain.RequestContext, d doc.Document) (err error)
- func (s Scope) Vote(ctx domain.RequestContext, refID, orgID, documentID, userID string, vote int) (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 document record into the document table and audits that it has been done.
func (Scope) ChangeDocumentSpace ¶
func (s Scope) ChangeDocumentSpace(ctx domain.RequestContext, document, space string) (err error)
ChangeDocumentSpace assigns the specified space to the document.
func (Scope) Delete ¶
Delete removes the specified document. Remove document pages, revisions, attachments, updates the search subsystem.
func (Scope) DeleteBySpace ¶ added in v1.54.0
DeleteBySpace removes all documents for given space. Remove document pages, revisions, attachments, updates the search subsystem.
func (Scope) DocumentMeta ¶
func (s Scope) DocumentMeta(ctx domain.RequestContext, id string) (meta doc.DocumentMeta, err error)
DocumentMeta returns the metadata for a specified document.
func (Scope) Get ¶
Get fetches the document record with the given id fromt the document table and audits that it has been got.
func (Scope) GetBySpace ¶
func (s Scope) 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 (Scope) GetVersions ¶ added in v1.59.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 (Scope) MoveActivity ¶ added in v1.61.0
func (s Scope) MoveActivity(ctx domain.RequestContext, documentID, oldSpaceID, newSpaceID string) (err error)
MoveActivity changes the space for all document activity records.
func (Scope) MoveDocumentSpace ¶
func (s Scope) 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 (Scope) PublicDocuments ¶
func (s Scope) 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 (Scope) TemplatesBySpace ¶ added in v1.52.1
func (s Scope) 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 (Scope) Update ¶
Update changes the given document record to the new values, updates search information and audits the action.
func (Scope) UpdateGroup ¶ added in v1.59.0
UpdateGroup applies same values to all documents with the same group ID.