WebDav utils. Expect @ub-e/webdav-model to be in domain - it inject uiSettings.webdav into appInfo based on customSettings.webdav server side config. Otherwise, isWebDavEnabled returns false

  
      const adminuiVue = require('@unitybase/adminui-vue')
if (
  adminuiVue.webDav.isEntitySupportWebDav(this.entityName) &&
  adminuiVue.webDav.canBeOpenedInApp(this.fileName)
) {
  adminuiVue.webDav.openInApp({
    entity: this.entityName,
    attribute: this.attributeName,
    ID: this.fileId
  }, this.fileName)
}
  

Methods

# canBeOpenedInApp (fileNamestring) → boolean inner

Return true if file can be opened on application. For actual opening, application what handle depp links should be installed

Arguments:

# canGetPermanentURI (fileNameoptstring) → boolean inner

Return true if permanent (without auth token) WebDav URI can be generated (only in case Kerberos is used for authentication).

  • if fileName is empty - returns true if authorization support permalinks
  • if fileName is passed - returns true if authorization support permalinks and file type support opening in app

Arguments:

# getPermanentURI (instanceInfoobject, fileNameoptstring) → string inner

Synchronously return permanent WebDav URI (http.....) for specified document

  • in case canGetPermanentURI returns true for this file name - returns URI
  • otherwise - returns empty string ''

Arguments:
  • instanceInfo: object
    • entitystring

      Code of entity to retrieve from

    • attributestring

      Code of document type attribute for specified entity

    • IDstring

      Instance ID

    Instance information

  • fileName: string

    Name of file in store (usually origName || fName)

# getSchemaByFileName (fileNamestring) → string inner

Return URI schema name for specified file, or '' if schema not known for file extension

Arguments:

# getURI (instanceInfoobject, fileNameoptstring, forceAuthTokenoptboolean, readOnlyoptboolean) → Promise.<{uri: string, withAuthToken: boolean}> inner

Return WebDav URI (http.....) for specified document. If user authorised using Negotiate (domain) authentication - generate a permanent link, otherwise link contains auth token and valid until current user session is active.

Arguments:
  • instanceInfo: object
    • entitystring

      Code of entity to retrieve from

    • attributestring

      Code of document type attribute for specified entity

    • IDstring

      Instance ID

    Instance information

  • fileName: string

    Name of file in store (usually origName || fName)

  • forceAuthToken = false: boolean

    Force adding an Authorization token into URI path for non-Kerberos authorization. Recommended way is to use Kerberos (domain) authorization and create semantic URL without AuthToken. By default, if user authorised using Kerberos - semantically correct URL without token is generated and application (Office) will authorise request using Kerberos

  • readOnly = true: boolean

    Add /ro/ part into URL - UnityBase server handle such URI as readOnly request

# isEntitySupportWebDav (entityCodestring) → boolean inner

Returns true in case WebDav is enabled and entity supports WebDaw

Arguments:

# isWebDavEnabled () → boolean inner

Returns true in case WebDav is enabled on server-side

# openInApp (instanceInfoobject, fileNameoptstring, optionsoptobject) → Promise.<boolean> inner

Open specified blobItem in desktop application, associated with file extension by redirecting browser to office URI.

If user authorised using Negotiate (domain) authentication - permanent is user, otherwise link contains auth token and valid until current user session is active.

Return:

Return true if permanent link is used

Arguments:
  • instanceInfo: object
    • entitystring

      Code of entity to retrieve from

    • attributestring

      Code of document type attribute for specified entity

    • IDstring

      Instance ID

    Instance information

  • fileName: string

    Name of file in store (usually origName || fName)

  • options = {}: object
    • forEditboolean

      Force app to open file in edit mode