Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface to the Geocortex Essentials Document Store. Allows full create, read, update, delete operations on documents that persist between sessions. Not supported on versions of Essentials before 4.5. Check the supported member after the Site is initialized.

Hierarchy

  • DocumentStore

Index

Properties

Protected _guestLink

_guestLink: string

Protected _initializeAttemptThenable

_initializeAttemptThenable: Thenable<void>

Protected _initializeDeferred

_initializeDeferred: Deferred

Protected _rootUrl

_rootUrl: string

Protected _site

_site: Site

isInitialized

isInitialized: boolean

Whether or not the document store is successfully initialized.

policyMonikers

policyMonikers: Moniker[]

The monikers that represent the document store policy. This will only be available once the Document Store is initialized.

self

self: Moniker[]

The monikers returned by the document store self endpoint. This will be available once the Document Store is initialized.

supported

supported: boolean

Indicates whether the Document Store is supported on this version of Essentials. This can only be true once the Document Store is initialized.

userFilter

userFilter: Filter

A filter for searching documents owned by the current user.

userMonikers

userMonikers: Moniker[]

The monikers that represent the current user. This will be available once the Document Store is initialized.

Static matchesFilterFields

matchesFilterFields: string[]

These fields can be filtered using the 'matches' filter type as they are full text fields

Methods

Protected _processDocument

  • _processDocument(doc: Document): Document
  • Process the Core Document so that dates are Date objects (and anything else to keep the Document consistent).

    Parameters

    • doc: Document

      The Core Document to process.

    Returns Document

    The same Document.

Protected _processSelf

  • _processSelf(result: SelfResult): void
  • Process the Self Result on initialization, so we can setup the policy and user if avilable.

    Parameters

    • result: SelfResult

      The Self Result to process.

    Returns void

Protected _verifyDocId

  • _verifyDocId(id: string): void
  • Verify that the Document ID is valid, throwing an exception if it isn't.

    Parameters

    • id: string

      The Document ID.

    Returns void

Protected _verifySupported

  • _verifySupported(): void
  • Verify that the Document Store is supported, throwing an exception if it isn't.

    Returns void

add

  • Add a Document to the Document Store.

    Parameters

    Returns Thenable<Document>

    A utilities.Thenable of the Document that was added to the store, after it was processed.

addFromForm

  • Add a Document to the Document Store from the given form.

    Parameters

    • form: HTMLFormElement

    Returns Thenable<Document>

    A utilities.Thenable of the Document that was added to the store, after it was processed.

addFromFormData

  • Add a Document to the Document Store from the given form data.

    Parameters

    • formData: FormData

      The form data specifying the Document fields.

    Returns Thenable<Document>

    A utilities.Thenable of the Document that was added to the store, after it was processed.

canCreate

  • canCreate(): boolean
  • Whether or not the current user can create content.

    Returns boolean

deleteById

  • Delete the Document from the Document Store with the given ID.

    Parameters

    • id: string

      The ID of the Document to delete.

    Returns Thenable<Document>

    A utilities.Thenable of the Document that was deleted.

getById

  • getById(id: string, includeContent?: boolean, format?: string): Thenable<Document>
  • Get the Document from the Document Store with the given ID.

    Parameters

    • id: string

      The ID of the Document to get.

    • Optional includeContent: boolean

      Whether or not to retrieve the document content.

    • Optional format: string

      The format of the document content.

    Returns Thenable<Document>

    A utilities.Thenable of the Document with the given ID.

getContentUrl

  • getContentUrl(docOrId: string | Document): string
  • Get the URL raw content can be found at for the Document, or for the given Document ID assuming that document exists. If the mime-type of the Document is an image this can be used as the src of an img tag.

    Parameters

    Returns string

    A URL.

getRootUrl

  • getRootUrl(): string
  • Get the root url.

    Returns string

hasPolicyGrant

  • hasPolicyGrant(predicate?: function): boolean
  • Whether or not the document store has a policy matching the predicate.

    Parameters

    • Optional predicate: function

      The predicate to match against some policy grant.

        • (grant: Grant, index?: number): boolean
        • Parameters

          • grant: Grant
          • Optional index: number

          Returns boolean

    Returns boolean

    Whether or not the policy grant exists.

initialize

  • Initialize the Document Store.

    Parameters

    • site: Site

      the Site to initialize with.

    Returns Thenable<void>

isOwner

  • Tries to verify whether or not the document is owned by the current user. If the document does not contain sufficient meta data, this will return true.

    Parameters

    • doc: Document

      The document to check ownership of.

    Returns boolean

    Whether or not the current user owns the document.

isPublic

  • Tries to verify whether or not the document has been updated to be shared publicly. If the document does not contain sufficient meta data, this will return false.

    Parameters

    • doc: Document

      The document to check whether it has been shared publicly.

    Returns boolean

    Whether or not the document has been shared publicly.

isReadOnly

  • Verifies whether or not the document is read only for the current user. If the document does not contain the access property, this returns false.

    Parameters

    • doc: Document

      The document to check read only status for.

    Returns boolean

    Whether or not the document is read only for the current user.

onInitializeAttempt

  • A thenable for a document store initialization attempt. This is different from onInitialized() in that it will reject for a single attempt failure. This call may itself trigger an attempt.

    Returns Thenable<void>

onInitialized

  • A thenable for when the document store is initialized. This will resolve when/if the document store initializes or rejects if the document store can not be supported. While being offline prevents the document store from initializing this will remain pending.

    Returns Thenable<void>

perform

  • perform(batchRequest: BatchRequest, usePost?: boolean): Thenable<BatchRequest>
  • Perform a request to the document store.

    Parameters

    • batchRequest: BatchRequest
    • Optional usePost: boolean

      Whether or not to use POST for the request.

    Returns Thenable<BatchRequest>

    A utilities.Thenable of the batch request response.

query

  • Search the Document Store and get all matching Documents. Only Documents the user has permission to access will be returned.

    Parameters

    Returns Thenable<ResultSet<Document>>

    A utilities.Thenable of the search result containing the documents.

setGuestLink

  • setGuestLink(guestLink: string): void
  • Sets the guest link used on requests to the document store.

    Parameters

    • guestLink: string

      The guest link.

    Returns void

updateById

  • Update the Document in the Document Store with the given ID to have the given values. Only values present in the values object are updated.

    Parameters

    • id: string

      The ID of the Document to update.

    • values: Document

      The values to update.

    Returns Thenable<Document>

    A utilities.Thenable of the Document with its updated values.

Static Protected _processError

  • _processError(result: any): any
  • Process the ajax result and throw the Error if it is an error.

    Parameters

    • result: any

    Returns any

Static Protected _processReadDocumentResponse

  • _processReadDocumentResponse(result: ReadDocumentResult, format: string): Document
  • Process the Read Document Result so we can extract and attach the document content.

    Parameters

    • result: ReadDocumentResult

      The Read Document Result to process.

    • format: string

      The format that the content is in.

    Returns Document

    The resulting Document.