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 (fileName: string) → boolean inner
Return true
if file can be opened on application. For actual opening, application what handle depp links should be installed
Arguments:
fileName
: string
# canGetPermanentURI (fileNameopt: string) → 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 - returnstrue
if authorization support permalinks - if
fileName
is passed - returnstrue
if authorization support permalinks and file type support opening in app
Arguments:
fileName
: string
# getPermanentURI (instanceInfo: object, fileNameopt: string) → string inner
Synchronously return permanent WebDav URI (http.....) for specified document
- in case
canGetPermanentURI
returnstrue
for this file name - returns URI - otherwise - returns empty string ''
# getSchemaByFileName (fileName: string) → string inner
Return URI schema name for specified file, or '' if schema not known for file extension
Arguments:
fileName
: string
# getURI (instanceInfo: object, fileNameopt: string, forceAuthTokenopt: boolean, readOnlyopt: boolean) → 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
: objectInstance information
fileName
: stringName of file in store (usually origName || fName)
forceAuthToken
= false: booleanForce 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: booleanAdd /ro/ part into URL - UnityBase server handle such URI as readOnly request
# isEntitySupportWebDav (entityCode: string) → boolean inner
Returns true in case WebDav is enabled and entity supports WebDaw
Arguments:
entityCode
: string
# isWebDavEnabled () → boolean inner
Returns true
in case WebDav is enabled on server-side
# openInApp (instanceInfo: object, fileNameopt: string, optionsopt: object) → 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