Initial QSfera import
This commit is contained in:
@@ -0,0 +1,180 @@
|
||||
package fileinfo
|
||||
|
||||
// UserExtraInfo contains additional user info shared across collaborative
|
||||
// editing views, such as the user's avatar image and email.
|
||||
// https://sdk.collaboraonline.com/docs/advanced_integration.html#userextrainfo
|
||||
type UserExtraInfo struct {
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
Mail string `json:"mail,omitempty"`
|
||||
}
|
||||
|
||||
// Collabora fileInfo properties
|
||||
//
|
||||
// Collabora WOPI check file info specification:
|
||||
// https://sdk.collaboraonline.com/docs/advanced_integration.html
|
||||
type Collabora struct {
|
||||
//
|
||||
// Response properties
|
||||
//
|
||||
|
||||
// Copied from MS WOPI
|
||||
BaseFileName string `json:"BaseFileName,omitempty"`
|
||||
// Copied from MS WOPI
|
||||
DisablePrint bool `json:"DisablePrint"`
|
||||
// Copied from MS WOPI
|
||||
OwnerID string `json:"OwnerId,omitempty"`
|
||||
// A string for the domain the host page sends/receives PostMessages from, we only listen to messages from this domain.
|
||||
PostMessageOrigin string `json:"PostMessageOrigin,omitempty"`
|
||||
// copied from MS WOPI
|
||||
Size int64 `json:"Size"`
|
||||
// The ID of file (like the wopi/files/ID) can be a non-existing file. In that case, the file will be created from a template when the template (eg. an OTT file) is specified as TemplateSource in the CheckFileInfo response. The TemplateSource is supposed to be an URL like https://somewhere/accessible/file.ott that is accessible by the Online. For the actual saving of the content, normal PutFile mechanism will be used.
|
||||
TemplateSource string `json:"TemplateSource,omitempty"`
|
||||
// copied from MS WOPI
|
||||
UserCanWrite bool `json:"UserCanWrite"`
|
||||
// copied from MS WOPI
|
||||
UserCanNotWriteRelative bool `json:"UserCanNotWriteRelative"`
|
||||
// copied from MS WOPI
|
||||
UserID string `json:"UserId,omitempty"`
|
||||
// copied from MS WOPI
|
||||
UserFriendlyName string `json:"UserFriendlyName,omitempty"`
|
||||
|
||||
//
|
||||
// Extended response properties
|
||||
//
|
||||
|
||||
// If set to true, this will enable the insertion of images chosen from the WOPI storage. A UI_InsertGraphic postMessage will be send to the WOPI host to request the UI to select the file.
|
||||
EnableInsertRemoteImage bool `json:"EnableInsertRemoteImage,omitempty"`
|
||||
// If set to true, this will enable the insertion of remote files chosen from the WOPI storage. A UI_InsertFile postMessage will be sent to the WOPI host to request the UI to select the file. This enables multimedia insertion and document comparison features.
|
||||
EnableInsertRemoteFile bool `json:"EnableInsertRemoteFile,omitempty"`
|
||||
// If set to true, this will enable picking a link to a remote file from the WOPI storage. A UI_PickLink postMessage will be sent to the WOPI host to request the UI to select the file. The host is expected to reply with an Action_InsertLink message carrying the file URL.
|
||||
EnableRemoteLinkPicker bool `json:"EnableRemoteLinkPicker,omitempty"`
|
||||
// If set to true, this will disable the insertion of image chosen from the local device. If EnableInsertRemoteImage is not set to true, then inserting images files is not possible.
|
||||
DisableInsertLocalImage bool `json:"DisableInsertLocalImage,omitempty"`
|
||||
// If set to true, hides the print option from the file menu bar in the UI.
|
||||
HidePrintOption bool `json:"HidePrintOption,omitempty"`
|
||||
// If set to true, hides the save button from the toolbar and file menubar in the UI.
|
||||
HideSaveOption bool `json:"HideSaveOption,omitempty"`
|
||||
// Hides Download as option in the file menubar.
|
||||
HideExportOption bool `json:"HideExportOption,omitempty"`
|
||||
// Disables export functionality in backend. If set to true, HideExportOption is assumed to be true
|
||||
DisableExport bool `json:"DisableExport,omitempty"`
|
||||
// Disables copying from the document in libreoffice online backend. Pasting into the document would still be possible. However, it is still possible to do an “internal” cut/copy/paste.
|
||||
DisableCopy bool `json:"DisableCopy,omitempty"`
|
||||
// Disables displaying of the explanation text on the overlay when the document becomes inactive or killed. With this, the JS integration must provide the user with appropriate message when it gets Session_Closed or User_Idle postMessages.
|
||||
DisableInactiveMessages bool `json:"DisableInactiveMessages,omitempty"`
|
||||
// Indicate that the integration wants to handle the downloading of pdf for printing or svg for slideshows or exported document, because it cannot rely on browser’s support for downloading.
|
||||
DownloadAsPostMessage bool `json:"DownloadAsPostMessage,omitempty"`
|
||||
// Similar to download as, doctype extensions can be provided for save-as. In this case the new file is loaded in the integration instead of downloaded.
|
||||
SaveAsPostmessage bool `json:"SaveAsPostmessage,omitempty"`
|
||||
// If set to true, it allows the document owner (the one with OwnerId =UserId) to send a closedocument message (see protocol.txt)
|
||||
EnableOwnerTermination bool `json:"EnableOwnerTermination,omitempty"`
|
||||
// If set to true, the user has administrator rights in the integration. Some functionality of Collabora Online, such as update check and server audit are supposed to be shown to administrators only.
|
||||
IsAdminUser bool `json:"IsAdminUser"`
|
||||
// If set to true, some functionality of Collabora which is supposed to be shown to authenticated users only is hidden
|
||||
IsAnonymousUser bool `json:"IsAnonymousUser,omitempty"`
|
||||
|
||||
// JSON object that contains additional info about the user, namely the avatar image.
|
||||
// Shared among all views in collaborative editing sessions.
|
||||
UserExtraInfo *UserExtraInfo `json:"UserExtraInfo,omitempty"`
|
||||
// JSON object that contains additional info about the user, but unlike the UserExtraInfo it is not shared among the views in collaborative editing sessions.
|
||||
//UserPrivateInfo -> requires definition, currently not used
|
||||
|
||||
// If set to a non-empty string, is used for rendering a watermark-like text on each tile of the document.
|
||||
WatermarkText string `json:"WatermarkText,omitempty"`
|
||||
|
||||
//
|
||||
// Undocumented (from source code)
|
||||
//
|
||||
|
||||
EnableShare bool `json:"EnableShare,omitempty"`
|
||||
// If set to "true", user list on the status bar will be hidden
|
||||
// If set to "mobile" | "tablet" | "desktop", will be hidden on a specified device
|
||||
// (may be joint, delimited by commas eg. "mobile,tablet")
|
||||
HideUserList string `json:"HideUserList,omitempty"`
|
||||
SupportsLocks bool `json:"SupportsLocks"`
|
||||
SupportsRename bool `json:"SupportsRename"`
|
||||
UserCanRename bool `json:"UserCanRename"`
|
||||
BreadcrumbDocName string `json:"BreadcrumbDocName,omitempty"`
|
||||
}
|
||||
|
||||
// SetProperties will set the file properties for the Collabora implementation.
|
||||
func (cinfo *Collabora) SetProperties(props map[string]any) {
|
||||
for key, value := range props {
|
||||
switch key {
|
||||
case KeyBaseFileName:
|
||||
cinfo.BaseFileName = value.(string)
|
||||
case KeyDisablePrint:
|
||||
cinfo.DisablePrint = value.(bool)
|
||||
case KeyOwnerID:
|
||||
cinfo.OwnerID = value.(string)
|
||||
case KeyPostMessageOrigin:
|
||||
cinfo.PostMessageOrigin = value.(string)
|
||||
case KeySize:
|
||||
cinfo.Size = value.(int64)
|
||||
case KeyTemplateSource:
|
||||
cinfo.TemplateSource = value.(string)
|
||||
case KeyUserCanWrite:
|
||||
cinfo.UserCanWrite = value.(bool)
|
||||
case KeyUserCanNotWriteRelative:
|
||||
cinfo.UserCanNotWriteRelative = value.(bool)
|
||||
case KeyUserID:
|
||||
cinfo.UserID = value.(string)
|
||||
case KeyUserFriendlyName:
|
||||
cinfo.UserFriendlyName = value.(string)
|
||||
|
||||
case KeyEnableInsertRemoteImage:
|
||||
cinfo.EnableInsertRemoteImage = value.(bool)
|
||||
case KeyEnableInsertRemoteFile:
|
||||
cinfo.EnableInsertRemoteFile = value.(bool)
|
||||
case KeyEnableRemoteLinkPicker:
|
||||
cinfo.EnableRemoteLinkPicker = value.(bool)
|
||||
case KeyDisableInsertLocalImage:
|
||||
cinfo.DisableInsertLocalImage = value.(bool)
|
||||
case KeyHidePrintOption:
|
||||
cinfo.HidePrintOption = value.(bool)
|
||||
case KeyHideSaveOption:
|
||||
cinfo.HideSaveOption = value.(bool)
|
||||
case KeyHideExportOption:
|
||||
cinfo.HideExportOption = value.(bool)
|
||||
case KeyDisableExport:
|
||||
cinfo.DisableExport = value.(bool)
|
||||
case KeyDisableCopy:
|
||||
cinfo.DisableCopy = value.(bool)
|
||||
case KeyDisableInactiveMessages:
|
||||
cinfo.DisableInactiveMessages = value.(bool)
|
||||
case KeyDownloadAsPostMessage:
|
||||
cinfo.DownloadAsPostMessage = value.(bool)
|
||||
case KeySaveAsPostmessage:
|
||||
cinfo.SaveAsPostmessage = value.(bool)
|
||||
case KeyEnableOwnerTermination:
|
||||
cinfo.EnableOwnerTermination = value.(bool)
|
||||
case KeyUserExtraInfo:
|
||||
cinfo.UserExtraInfo = value.(*UserExtraInfo)
|
||||
//UserPrivateInfo -> requires definition, currently not used
|
||||
case KeyWatermarkText:
|
||||
cinfo.WatermarkText = value.(string)
|
||||
case KeyIsAdminUser:
|
||||
cinfo.IsAdminUser = value.(bool)
|
||||
case KeyIsAnonymousUser:
|
||||
cinfo.IsAnonymousUser = value.(bool)
|
||||
|
||||
case KeyEnableShare:
|
||||
cinfo.EnableShare = value.(bool)
|
||||
case KeyHideUserList:
|
||||
cinfo.HideUserList = value.(string)
|
||||
case KeySupportsLocks:
|
||||
cinfo.SupportsLocks = value.(bool)
|
||||
case KeySupportsRename:
|
||||
cinfo.SupportsRename = value.(bool)
|
||||
case KeyUserCanRename:
|
||||
cinfo.UserCanRename = value.(bool)
|
||||
case KeyBreadcrumbDocName:
|
||||
cinfo.BreadcrumbDocName = value.(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetTarget will always return "Collabora"
|
||||
func (cinfo *Collabora) GetTarget() string {
|
||||
return "Collabora"
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package fileinfo
|
||||
|
||||
// FileInfo contains the properties of the file.
|
||||
// Some properties refer to capabilities in the WOPI client, and capabilities
|
||||
// that the WOPI server has.
|
||||
//
|
||||
// Specific implementations must allow json-encoding of their relevant
|
||||
// properties because the object will be marshalled directly
|
||||
type FileInfo interface {
|
||||
// SetProperties will set the properties of this FileInfo.
|
||||
// Keys should match any valid property that the FileInfo implementation
|
||||
// has. If a key doesn't match any property, it must be ignored.
|
||||
// The values must have its matching type for the target property,
|
||||
// otherwise panics might happen.
|
||||
//
|
||||
// This method should help to reduce the friction of using different
|
||||
// implementations with different properties. You can use the same map
|
||||
// for all the implementations knowing that the relevant properties for
|
||||
// each implementation will be set.
|
||||
SetProperties(props map[string]any)
|
||||
|
||||
// GetTarget will return the target implementation (OnlyOffice, Collabora...).
|
||||
// This will help to identify the implementation we're using in an easy way.
|
||||
// Note that the returned value must be unique among all the implementations
|
||||
GetTarget() string
|
||||
}
|
||||
|
||||
// constants that can be used to refer the fileinfo properties for the
|
||||
// SetProperties method of the FileInfo interface
|
||||
const (
|
||||
KeyBaseFileName = "BaseFileName"
|
||||
KeyOwnerID = "OwnerId"
|
||||
KeySize = "Size"
|
||||
KeyUserID = "UserID"
|
||||
KeyVersion = "Version"
|
||||
|
||||
KeySupportedShareURLTypes = "SupportedShareURLTypes"
|
||||
KeySupportsCobalt = "SupportsCobalt"
|
||||
KeySupportsContainers = "SupportsContainers"
|
||||
KeySupportsDeleteFile = "SupportsDeleteFile"
|
||||
KeySupportsEcosystem = "SupportsEcosystem"
|
||||
KeySupportsExtendedLockLength = "SupportsExtendedLockLength"
|
||||
KeySupportsFolders = "SupportsFolders"
|
||||
//KeySupportsGetFileWopiSrc = "SupportsGetFileWopiSrc" // wopivalidator is complaining and the property isn't used for now -> commented
|
||||
KeySupportsGetLock = "SupportsGetLock"
|
||||
KeySupportsLocks = "SupportsLocks"
|
||||
KeySupportsRename = "SupportsRename"
|
||||
KeySupportsUpdate = "SupportsUpdate"
|
||||
KeySupportsUserInfo = "SupportsUserInfo"
|
||||
|
||||
KeyIsAnonymousUser = "IsAnonymousUser"
|
||||
KeyIsEduUser = "IsEduUser"
|
||||
KeyIsAdminUser = "IsAdminUser"
|
||||
KeyLicenseCheckForEditIsEnabled = "LicenseCheckForEditIsEnabled"
|
||||
KeyUserFriendlyName = "UserFriendlyName"
|
||||
KeyUserInfo = "UserInfo"
|
||||
|
||||
KeyReadOnly = "ReadOnly"
|
||||
KeyRestrictedWebViewOnly = "RestrictedWebViewOnly"
|
||||
KeyUserCanAttend = "UserCanAttend"
|
||||
KeyUserCanNotWriteRelative = "UserCanNotWriteRelative"
|
||||
KeyUserCanPresent = "UserCanPresent"
|
||||
KeyUserCanRename = "UserCanRename"
|
||||
KeyUserCanWrite = "UserCanWrite"
|
||||
|
||||
KeyCloseURL = "CloseURL"
|
||||
KeyDownloadURL = "DownloadURL"
|
||||
KeyFileEmbedCommandURL = "FileEmbedCommandURL"
|
||||
KeyFileSharingURL = "FileSharingURL"
|
||||
KeyFileURL = "FileURL"
|
||||
KeyFileVersionURL = "FileVersionURL"
|
||||
KeyHostEditURL = "HostEditURL"
|
||||
KeyHostEmbeddedViewURL = "HostEmbeddedViewURL"
|
||||
KeyHostViewURL = "HostViewURL"
|
||||
KeySignoutURL = "SignoutURL"
|
||||
|
||||
KeyAllowAdditionalMicrosoftServices = "AllowAdditionalMicrosoftServices"
|
||||
KeyAllowErrorReportPrompt = "AllowErrorReportPrompt"
|
||||
KeyAllowExternalMarketplace = "AllowExternalMarketplace"
|
||||
KeyClientThrottlingProtection = "ClientThrottlingProtection"
|
||||
KeyCloseButtonClosesWindow = "CloseButtonClosesWindow"
|
||||
KeyCopyPasteRestrictions = "CopyPasteRestrictions"
|
||||
KeyDisablePrint = "DisablePrint"
|
||||
KeyDisableTranslation = "DisableTranslation"
|
||||
KeyFileExtension = "FileExtension"
|
||||
KeyFileNameMaxLength = "FileNameMaxLength"
|
||||
KeyLastModifiedTime = "LastModifiedTime"
|
||||
KeyRequestedCallThrottling = "RequestedCallThrottling"
|
||||
KeySHA256 = "SHA256"
|
||||
KeySharingStatus = "SharingStatus"
|
||||
KeyTemporarilyNotWritable = "TemporarilyNotWritable"
|
||||
//KeyUniqueContentId = "UniqueContentId" // From microsoft docs: Not supported in CSPP -> commented
|
||||
|
||||
KeyBreadcrumbBrandName = "BreadcrumbBrandName"
|
||||
KeyBreadcrumbBrandURL = "BreadcrumbBrandURL"
|
||||
KeyBreadcrumbDocName = "BreadcrumbDocName"
|
||||
KeyBreadcrumbFolderName = "BreadcrumbFolderName"
|
||||
KeyBreadcrumbFolderURL = "BreadcrumbFolderUrl"
|
||||
|
||||
// Collabora (non-dupped) properties below
|
||||
|
||||
KeyPostMessageOrigin = "PostMessageOrigin"
|
||||
KeyTemplateSource = "TemplateSource"
|
||||
|
||||
KeyEnableInsertRemoteImage = "EnableInsertRemoteImage"
|
||||
KeyEnableInsertRemoteFile = "EnableInsertRemoteFile"
|
||||
KeyEnableRemoteLinkPicker = "EnableRemoteLinkPicker"
|
||||
KeyDisableInsertLocalImage = "DisableInsertLocalImage"
|
||||
KeyHidePrintOption = "HidePrintOption"
|
||||
KeyHideSaveOption = "HideSaveOption"
|
||||
KeyHideExportOption = "HideExportOption"
|
||||
KeyDisableExport = "DisableExport"
|
||||
KeyDisableCopy = "DisableCopy"
|
||||
KeyDisableInactiveMessages = "DisableInactiveMessages"
|
||||
KeyDownloadAsPostMessage = "DownloadAsPostMessage"
|
||||
KeySaveAsPostmessage = "SaveAsPostmessage"
|
||||
KeyEnableOwnerTermination = "EnableOwnerTermination"
|
||||
KeyUserExtraInfo = "UserExtraInfo"
|
||||
//KeyUserPrivateInfo -> requires definition, currently not used
|
||||
KeyWatermarkText = "WatermarkText"
|
||||
|
||||
KeyEnableShare = "EnableShare"
|
||||
KeyHideUserList = "HideUserList"
|
||||
|
||||
// OnlyOffice (non-dupped) properties below
|
||||
|
||||
KeyClosePostMessage = "ClosePostMessage"
|
||||
KeyEditModePostMessage = "EditModePostMessage"
|
||||
KeyEditNotificationPostMessage = "EditNotificationPostMessage"
|
||||
KeyFileSharingPostMessage = "FileSharingPostMessage"
|
||||
KeyFileVersionPostMessage = "FileVersionPostMessage"
|
||||
|
||||
KeyUserCanReview = "UserCanReview"
|
||||
KeySupportsReviewing = "SupportsReviewing"
|
||||
)
|
||||
@@ -0,0 +1,302 @@
|
||||
package fileinfo
|
||||
|
||||
// Microsoft fileInfo properties
|
||||
//
|
||||
// Microsoft WOPI check file info specification:
|
||||
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo
|
||||
type Microsoft struct {
|
||||
//
|
||||
// Required response properties
|
||||
//
|
||||
|
||||
// The string name of the file, including extension, without a path. Used for display in user interface (UI), and determining the extension of the file.
|
||||
BaseFileName string `json:"BaseFileName,omitempty"`
|
||||
//A string that uniquely identifies the owner of the file. In most cases, the user who uploaded or created the file should be considered the owner.
|
||||
OwnerID string `json:"OwnerId,omitempty"`
|
||||
// The size of the file in bytes, expressed as a long, a 64-bit signed integer.
|
||||
Size int64 `json:"Size"`
|
||||
// A string value uniquely identifying the user currently accessing the file.
|
||||
UserID string `json:"UserId,omitempty"`
|
||||
// The current version of the file based on the server’s file version schema, as a string. This value must change when the file changes, and version values must never repeat for a given file.
|
||||
Version string `json:"Version,omitempty"`
|
||||
|
||||
//
|
||||
// WOPI host capabilities properties
|
||||
//
|
||||
|
||||
// An array of strings containing the Share URL types supported by the host.
|
||||
SupportedShareURLTypes []string `json:"SupportedShareUrlTypes,omitempty"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: ExecuteCellStorageRequest, ExecuteCellStorageRelativeRequest
|
||||
SupportsCobalt bool `json:"SupportsCobalt"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: CheckContainerInfo, CreateChildContainer, CreateChildFile, DeleteContainer, DeleteFile, EnumerateAncestors (containers), EnumerateAncestors (files), EnumerateChildren (containers), GetEcosystem (containers), RenameContainer
|
||||
SupportsContainers bool `json:"SupportsContainers"`
|
||||
// A Boolean value that indicates that the host supports the DeleteFile operation.
|
||||
SupportsDeleteFile bool `json:"SupportsDeleteFile"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: CheckEcosystem, GetEcosystem (containers), GetEcosystem (files), GetRootContainer (ecosystem)
|
||||
SupportsEcosystem bool `json:"SupportsEcosystem"`
|
||||
// A Boolean value that indicates that the host supports lock IDs up to 1024 ASCII characters long. If not provided, WOPI clients will assume that lock IDs are limited to 256 ASCII characters.
|
||||
SupportsExtendedLockLength bool `json:"SupportsExtendedLockLength"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: CheckFolderInfo, EnumerateChildren (folders), DeleteFile
|
||||
SupportsFolders bool `json:"SupportsFolders"`
|
||||
// A Boolean value that indicates that the host supports the GetFileWopiSrc (ecosystem) operation.
|
||||
//SupportsGetFileWopiSrc bool `json:"SupportsGetFileWopiSrc"` // wopivalidator is complaining and the property isn't used for now -> commented
|
||||
// A Boolean value that indicates that the host supports the GetLock operation.
|
||||
SupportsGetLock bool `json:"SupportsGetLock"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: Lock, Unlock, RefreshLock, UnlockAndRelock operations for this file.
|
||||
SupportsLocks bool `json:"SupportsLocks"`
|
||||
// A Boolean value that indicates that the host supports the RenameFile operation.
|
||||
SupportsRename bool `json:"SupportsRename"`
|
||||
// A Boolean value that indicates that the host supports the following WOPI operations: PutFile, PutRelativeFile
|
||||
SupportsUpdate bool `json:"SupportsUpdate"` // whether "Putfile" and "PutRelativeFile" work
|
||||
// A Boolean value that indicates that the host supports the PutUserInfo operation.
|
||||
SupportsUserInfo bool `json:"SupportsUserInfo"`
|
||||
|
||||
//
|
||||
// User metadata properties
|
||||
//
|
||||
|
||||
// A Boolean value indicating whether the user is authenticated with the host or not. Hosts should always set this to true for unauthenticated users, so that clients are aware that the user is anonymous. When setting this to true, hosts can choose to omit the UserId property, but must still set the OwnerId property.
|
||||
IsAnonymousUser bool `json:"IsAnonymousUser,omitempty"`
|
||||
// A Boolean value indicating whether the user is an education user or not.
|
||||
IsEduUser bool `json:"IsEduUser,omitempty"`
|
||||
// A Boolean value indicating whether the user is a business user or not.
|
||||
LicenseCheckForEditIsEnabled bool `json:"LicenseCheckForEditIsEnabled"`
|
||||
// A string that is the name of the user, suitable for displaying in UI.
|
||||
UserFriendlyName string `json:"UserFriendlyName,omitempty"`
|
||||
// A string value containing information about the user. This string can be passed from a WOPI client to the host by means of a PutUserInfo operation. If the host has a UserInfo string for the user, they must include it in this property. See the PutUserInfo documentation for more details.
|
||||
UserInfo string `json:"UserInfo,omitempty"`
|
||||
|
||||
//
|
||||
// User permission properties
|
||||
//
|
||||
|
||||
// A Boolean value that indicates that, for this user, the file cannot be changed.
|
||||
ReadOnly bool `json:"ReadOnly"`
|
||||
// A Boolean value that indicates that the WOPI client should restrict what actions the user can perform on the file. The behavior of this property is dependent on the WOPI client.
|
||||
RestrictedWebViewOnly bool `json:"RestrictedWebViewOnly"`
|
||||
// A Boolean value that indicates that the user has permission to view a broadcast of this file.
|
||||
UserCanAttend bool `json:"UserCanAttend"`
|
||||
// A Boolean value that indicates the user does not have sufficient permission to create new files on the WOPI server. Setting this to true tells the WOPI client that calls to PutRelativeFile will fail for this user on the current file.
|
||||
UserCanNotWriteRelative bool `json:"UserCanNotWriteRelative"`
|
||||
// A Boolean value that indicates that the user has permission to broadcast this file to a set of users who have permission to broadcast or view a broadcast of the current file.
|
||||
UserCanPresent bool `json:"UserCanPresent"`
|
||||
// A Boolean value that indicates the user has permission to rename the current file.
|
||||
UserCanRename bool `json:"UserCanRename"`
|
||||
// A Boolean value that indicates that the user has permission to alter the file. Setting this to true tells the WOPI client that it can call PutFile on behalf of the user.
|
||||
UserCanWrite bool `json:"UserCanWrite"`
|
||||
|
||||
//
|
||||
// File URL properties
|
||||
//
|
||||
|
||||
// A URI to a web page that the WOPI client should navigate to when the application closes, or in the event of an unrecoverable error.
|
||||
CloseURL string `json:"CloseUrl,omitempty"`
|
||||
// A user-accessible URI to the file intended to allow the user to download a copy of the file.
|
||||
DownloadURL string `json:"DownloadUrl,omitempty"`
|
||||
// A URI to a location that allows the user to create an embeddable URI to the file.
|
||||
FileEmbedCommandURL string `json:"FileEmbedCommandUrl,omitempty"`
|
||||
// A URI to a location that allows the user to share the file.
|
||||
FileSharingURL string `json:"FileSharingUrl,omitempty"`
|
||||
// A URI to the file location that the WOPI client uses to get the file. If this is provided, the WOPI client may use this URI to get the file instead of a GetFile request. A host might set this property if it is easier or provides better performance to serve files from a different domain than the one handling standard WOPI requests. WOPI clients must not add or remove parameters from the URL; no other parameters, including the access token, should be appended to the FileUrl before it is used.
|
||||
FileURL string `json:"FileUrl,omitempty"`
|
||||
// A URI to a location that allows the user to view the version history for the file.
|
||||
FileVersionURL string `json:"FileVersionUrl,omitempty"`
|
||||
// A URI to a host page that loads the edit WOPI action.
|
||||
HostEditURL string `json:"HostEditUrl,omitempty"`
|
||||
// A URI to a web page that provides access to a viewing experience for the file that can be embedded in another HTML page. This is typically a URI to a host page that loads the embedview WOPI action.
|
||||
HostEmbeddedViewURL string `json:"HostEmbeddedViewUrl,omitempty"`
|
||||
// A URI to a host page that loads the view WOPI action. This URL is used by Office Online to navigate between view and edit mode.
|
||||
HostViewURL string `json:"HostViewUrl,omitempty"`
|
||||
// A URI that will sign the current user out of the host’s authentication system.
|
||||
SignoutURL string `json:"SignoutUrl,omitempty"`
|
||||
|
||||
//
|
||||
// Miscellaneous properties
|
||||
//
|
||||
|
||||
// A Boolean value that indicates a WOPI client may connect to Microsoft services to provide end-user functionality.
|
||||
AllowAdditionalMicrosoftServices bool `json:"AllowAdditionalMicrosoftServices"`
|
||||
// A Boolean value that indicates that in the event of an error, the WOPI client is permitted to prompt the user for permission to collect a detailed report about their specific error. The information gathered could include the user’s file and other session-specific state.
|
||||
AllowErrorReportPrompt bool `json:"AllowErrorReportPrompt,omitempty"`
|
||||
// A Boolean value that indicates a WOPI client may allow connections to external services referenced in the file (for example, a marketplace of embeddable JavaScript apps).
|
||||
AllowExternalMarketplace bool `json:"AllowExternalMarketplace"`
|
||||
// A string value offering guidance to the WOPI client as to how to differentiate client throttling behaviors between the user and documents combinations from the WOPI host.
|
||||
ClientThrottlingProtection string `json:"ClientThrottlingProtection,omitempty"`
|
||||
// A Boolean value that indicates the WOPI client should close the window or tab when the user activates any Close UI in the WOPI client.
|
||||
CloseButtonClosesWindow bool `json:"CloseButtonClosesWindow,omitempty"`
|
||||
// A string value indicating whether the WOPI client should disable Copy and Paste functionality within the application. The default is to permit all Copy and Paste functionality, i.e. the setting has no effect.
|
||||
CopyPasteRestrictions string `json:"CopyPasteRestrictions,omitempty"`
|
||||
// A Boolean value that indicates the WOPI client should disable all print functionality.
|
||||
DisablePrint bool `json:"DisablePrint"`
|
||||
// A Boolean value that indicates the WOPI client should disable all machine translation functionality.
|
||||
DisableTranslation bool `json:"DisableTranslation"`
|
||||
// A string value representing the file extension for the file. This value must begin with a .. If provided, WOPI clients will use this value as the file extension. Otherwise the extension will be parsed from the BaseFileName.
|
||||
FileExtension string `json:"FileExtension,omitempty"`
|
||||
// An integer value that indicates the maximum length for file names that the WOPI host supports, excluding the file extension. The default value is 250. Note that WOPI clients will use this default value if the property is omitted or if it is explicitly set to 0.
|
||||
FileNameMaxLength int `json:"FileNameMaxLength,omitempty"`
|
||||
// A string that represents the last time that the file was modified. This time must always be a must be a UTC time, and must be formatted in ISO 8601 round-trip format. For example, "2009-06-15T13:45:30.0000000Z".
|
||||
LastModifiedTime string `json:"LastModifiedTime,omitempty"`
|
||||
// A string value indicating whether the WOPI host is experiencing capacity problems and would like to reduce the frequency at which the WOPI clients make calls to the host
|
||||
RequestedCallThrottling string `json:"RequestedCallThrottling,omitempty"`
|
||||
// A 256 bit SHA-2-encoded [FIPS 180-2] hash of the file contents, as a Base64-encoded string. Used for caching purposes in WOPI clients.
|
||||
SHA256 string `json:"SHA256,omitempty"`
|
||||
// A string value indicating whether the current document is shared with other users. The value can change upon adding or removing permissions to other users. Clients should use this value to help decide when to enable collaboration features as a document must be Shared in order to multi-user collaboration on the document.
|
||||
SharingStatus string `json:"SharingStatus,omitempty"`
|
||||
// A Boolean value that indicates that if host is temporarily unable to process writes on a file
|
||||
TemporarilyNotWritable bool `json:"TemporarilyNotWritable,omitempty"`
|
||||
// In special cases, a host may choose to not provide a SHA256, but still have some mechanism for identifying that two different files contain the same content in the same manner as the SHA256 is used. This string value can be provided rather than a SHA256 value if and only if the host can guarantee that two different files with the same content will have the same UniqueContentId value.
|
||||
//UniqueContentId string `json:"UniqueContentId,omitempty"` // From microsoft docs: Not supported in CSPP -> commented
|
||||
|
||||
//
|
||||
// Breadcrumb properties
|
||||
//
|
||||
|
||||
// A string that indicates the brand name of the host.
|
||||
BreadcrumbBrandName string `json:"BreadcrumbBrandName,omitempty"`
|
||||
// A URI to a web page that the WOPI client should navigate to when the user clicks on UI that displays BreadcrumbBrandName.
|
||||
BreadcrumbBrandURL string `json:"BreadcrumbBrandUrl,omitempty"`
|
||||
// A string that indicates the name of the file. If this is not provided, WOPI clients may use the BaseFileName value.
|
||||
BreadcrumbDocName string `json:"BreadcrumbDocName,omitempty"`
|
||||
// A string that indicates the name of the container that contains the file.
|
||||
BreadcrumbFolderName string `json:"BreadcrumbFolderName,omitempty"`
|
||||
// A URI to a web page that the WOPI client should navigate to when the user clicks on UI that displays BreadcrumbFolderName.
|
||||
BreadcrumbFolderURL string `json:"BreadcrumbFolderUrl,omitempty"`
|
||||
}
|
||||
|
||||
// SetProperties will set the file properties for the Microsoft implementation.
|
||||
func (minfo *Microsoft) SetProperties(props map[string]any) {
|
||||
for key, value := range props {
|
||||
switch key {
|
||||
case KeyBaseFileName:
|
||||
minfo.BaseFileName = value.(string)
|
||||
case KeyOwnerID:
|
||||
minfo.OwnerID = value.(string)
|
||||
case KeySize:
|
||||
minfo.Size = value.(int64)
|
||||
case KeyUserID:
|
||||
minfo.UserID = value.(string)
|
||||
case KeyVersion:
|
||||
minfo.Version = value.(string)
|
||||
|
||||
case KeySupportedShareURLTypes:
|
||||
minfo.SupportedShareURLTypes = value.([]string)
|
||||
case KeySupportsCobalt:
|
||||
minfo.SupportsCobalt = value.(bool)
|
||||
case KeySupportsContainers:
|
||||
minfo.SupportsContainers = value.(bool)
|
||||
case KeySupportsDeleteFile:
|
||||
minfo.SupportsDeleteFile = value.(bool)
|
||||
case KeySupportsEcosystem:
|
||||
minfo.SupportsEcosystem = value.(bool)
|
||||
case KeySupportsExtendedLockLength:
|
||||
minfo.SupportsExtendedLockLength = value.(bool)
|
||||
case KeySupportsFolders:
|
||||
minfo.SupportsFolders = value.(bool)
|
||||
//SupportsGetFileWopiSrc bool `json:"SupportsGetFileWopiSrc"` // wopivalidator is complaining and the property isn't used for now -> commented
|
||||
case KeySupportsGetLock:
|
||||
minfo.SupportsGetLock = value.(bool)
|
||||
case KeySupportsLocks:
|
||||
minfo.SupportsLocks = value.(bool)
|
||||
case KeySupportsRename:
|
||||
minfo.SupportsRename = value.(bool)
|
||||
case KeySupportsUpdate:
|
||||
minfo.SupportsUpdate = value.(bool)
|
||||
case KeySupportsUserInfo:
|
||||
minfo.SupportsUserInfo = value.(bool)
|
||||
|
||||
case KeyIsAnonymousUser:
|
||||
minfo.IsAnonymousUser = value.(bool)
|
||||
case KeyIsEduUser:
|
||||
minfo.IsEduUser = value.(bool)
|
||||
case KeyLicenseCheckForEditIsEnabled:
|
||||
minfo.LicenseCheckForEditIsEnabled = value.(bool)
|
||||
case KeyUserFriendlyName:
|
||||
minfo.UserFriendlyName = value.(string)
|
||||
case KeyUserInfo:
|
||||
minfo.UserInfo = value.(string)
|
||||
|
||||
case KeyReadOnly:
|
||||
minfo.ReadOnly = value.(bool)
|
||||
case KeyRestrictedWebViewOnly:
|
||||
minfo.RestrictedWebViewOnly = value.(bool)
|
||||
case KeyUserCanAttend:
|
||||
minfo.UserCanAttend = value.(bool)
|
||||
case KeyUserCanNotWriteRelative:
|
||||
minfo.UserCanNotWriteRelative = value.(bool)
|
||||
case KeyUserCanPresent:
|
||||
minfo.UserCanPresent = value.(bool)
|
||||
case KeyUserCanRename:
|
||||
minfo.UserCanRename = value.(bool)
|
||||
case KeyUserCanWrite:
|
||||
minfo.UserCanWrite = value.(bool)
|
||||
|
||||
case KeyCloseURL:
|
||||
minfo.CloseURL = value.(string)
|
||||
case KeyDownloadURL:
|
||||
minfo.DownloadURL = value.(string)
|
||||
case KeyFileEmbedCommandURL:
|
||||
minfo.FileEmbedCommandURL = value.(string)
|
||||
case KeyFileSharingURL:
|
||||
minfo.FileSharingURL = value.(string)
|
||||
case KeyFileURL:
|
||||
minfo.FileURL = value.(string)
|
||||
case KeyFileVersionURL:
|
||||
minfo.FileVersionURL = value.(string)
|
||||
case KeyHostEditURL:
|
||||
minfo.HostEditURL = value.(string)
|
||||
case KeyHostEmbeddedViewURL:
|
||||
minfo.HostEmbeddedViewURL = value.(string)
|
||||
case KeyHostViewURL:
|
||||
minfo.HostViewURL = value.(string)
|
||||
case KeySignoutURL:
|
||||
minfo.SignoutURL = value.(string)
|
||||
|
||||
case KeyAllowAdditionalMicrosoftServices:
|
||||
minfo.AllowAdditionalMicrosoftServices = value.(bool)
|
||||
case KeyAllowErrorReportPrompt:
|
||||
minfo.AllowErrorReportPrompt = value.(bool)
|
||||
case KeyAllowExternalMarketplace:
|
||||
minfo.AllowExternalMarketplace = value.(bool)
|
||||
case KeyClientThrottlingProtection:
|
||||
minfo.ClientThrottlingProtection = value.(string)
|
||||
case KeyCloseButtonClosesWindow:
|
||||
minfo.CloseButtonClosesWindow = value.(bool)
|
||||
case KeyCopyPasteRestrictions:
|
||||
minfo.CopyPasteRestrictions = value.(string)
|
||||
case KeyDisablePrint:
|
||||
minfo.DisablePrint = value.(bool)
|
||||
case KeyDisableTranslation:
|
||||
minfo.DisableTranslation = value.(bool)
|
||||
case KeyFileExtension:
|
||||
minfo.FileExtension = value.(string)
|
||||
case KeyFileNameMaxLength:
|
||||
minfo.FileNameMaxLength = value.(int)
|
||||
case KeyLastModifiedTime:
|
||||
minfo.LastModifiedTime = value.(string)
|
||||
case KeyRequestedCallThrottling:
|
||||
minfo.RequestedCallThrottling = value.(string)
|
||||
case KeySHA256:
|
||||
minfo.SHA256 = value.(string)
|
||||
case KeySharingStatus:
|
||||
minfo.SharingStatus = value.(string)
|
||||
case KeyTemporarilyNotWritable:
|
||||
minfo.TemporarilyNotWritable = value.(bool)
|
||||
|
||||
case KeyBreadcrumbBrandName:
|
||||
minfo.BreadcrumbBrandName = value.(string)
|
||||
case KeyBreadcrumbBrandURL:
|
||||
minfo.BreadcrumbBrandURL = value.(string)
|
||||
case KeyBreadcrumbDocName:
|
||||
minfo.BreadcrumbDocName = value.(string)
|
||||
case KeyBreadcrumbFolderName:
|
||||
minfo.BreadcrumbFolderName = value.(string)
|
||||
case KeyBreadcrumbFolderURL:
|
||||
minfo.BreadcrumbFolderURL = value.(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetTarget will always return "Microsoft"
|
||||
func (minfo *Microsoft) GetTarget() string {
|
||||
return "Microsoft"
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
package fileinfo
|
||||
|
||||
// OnlyOffice fileInfo properties
|
||||
//
|
||||
// OnlyOffice WOPI check file info specification:
|
||||
// https://api.onlyoffice.com/editors/wopi/restapi/checkfileinfo
|
||||
type OnlyOffice struct {
|
||||
//
|
||||
// Required response properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
BaseFileName string `json:"BaseFileName,omitempty"`
|
||||
// copied from MS WOPI
|
||||
Version string `json:"Version,omitempty"`
|
||||
|
||||
//
|
||||
// Breadcrumb properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
BreadcrumbBrandName string `json:"BreadcrumbBrandName,omitempty"`
|
||||
// copied from MS WOPI
|
||||
BreadcrumbBrandURL string `json:"BreadcrumbBrandUrl,omitempty"`
|
||||
// copied from MS WOPI
|
||||
BreadcrumbDocName string `json:"BreadcrumbDocName,omitempty"`
|
||||
// copied from MS WOPI
|
||||
BreadcrumbFolderName string `json:"BreadcrumbFolderName,omitempty"`
|
||||
// copied from MS WOPI
|
||||
BreadcrumbFolderURL string `json:"BreadcrumbFolderUrl,omitempty"`
|
||||
|
||||
//
|
||||
// PostMessage properties
|
||||
//
|
||||
|
||||
// Specifies if the WOPI client should notify the WOPI server in case the user closes the rendering or editing client currently using this file. The host expects to receive the UI_Close PostMessage when the Close UI in the online office is activated.
|
||||
ClosePostMessage bool `json:"ClosePostMessage,omitempty"`
|
||||
// Specifies if the WOPI client should notify the WOPI server in case the user tries to edit a file. The host expects to receive the UI_Edit PostMessage when the Edit UI in the online office is activated.
|
||||
EditModePostMessage bool `json:"EditModePostMessage,omitempty"`
|
||||
// Specifies if the WOPI client should notify the WOPI server in case the user tries to edit a file. The host expects to receive the Edit_Notification PostMessage.
|
||||
EditNotificationPostMessage bool `json:"EditNotificationPostMessage,omitempty"`
|
||||
// Specifies if the WOPI client should notify the WOPI server in case the user tries to share a file. The host expects to receive the UI_Sharing PostMessage when the Share UI in the online office is activated.
|
||||
FileSharingPostMessage bool `json:"FileSharingPostMessage,omitempty"`
|
||||
// Specifies if the WOPI client will notify the WOPI server in case the user tries to navigate to the previous file version. The host expects to receive the UI_FileVersions PostMessage when the Previous Versions UI in the online office is activated.
|
||||
FileVersionPostMessage bool `json:"FileVersionPostMessage,omitempty"`
|
||||
// A domain that the WOPI client must use as the targetOrigin parameter when sending messages as described in [W3C-HTML5WEBMSG].
|
||||
// copied from collabora WOPI
|
||||
PostMessageOrigin string `json:"PostMessageOrigin,omitempty"`
|
||||
|
||||
//
|
||||
// File URL properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
CloseURL string `json:"CloseUrl,omitempty"`
|
||||
// copied from MS WOPI
|
||||
FileSharingURL string `json:"FileSharingUrl,omitempty"`
|
||||
// copied from MS WOPI
|
||||
FileVersionURL string `json:"FileVersionUrl,omitempty"`
|
||||
// copied from MS WOPI
|
||||
HostEditURL string `json:"HostEditUrl,omitempty"`
|
||||
|
||||
//
|
||||
// Miscellaneous properties
|
||||
//
|
||||
|
||||
// Specifies if the WOPI client must disable the Copy and Paste functionality within the application. By default, all Copy and Paste functionality is enabled, i.e. the setting has no effect. Possible property values:
|
||||
// BlockAll - the Copy and Paste functionality is completely disabled within the application;
|
||||
// CurrentDocumentOnly - the Copy and Paste functionality is enabled but content can only be copied and pasted within the file currently open in the application.
|
||||
// copied from MS WOPI
|
||||
CopyPasteRestrictions string `json:"CopyPasteRestrictions,omitempty"`
|
||||
// copied from MS WOPI
|
||||
DisablePrint bool `json:"DisablePrint"`
|
||||
// copied from MS WOPI
|
||||
FileExtension string `json:"FileExtension,omitempty"`
|
||||
// copied from MS WOPI
|
||||
FileNameMaxLength int `json:"FileNameMaxLength,omitempty"`
|
||||
// copied from MS WOPI
|
||||
LastModifiedTime string `json:"LastModifiedTime,omitempty"`
|
||||
// The ID of file (like the wopi/files/ID) can be a non-existing file. In that case, the file will be created from a template when the template (eg. an OTT file) is specified as TemplateSource in the CheckFileInfo response. The TemplateSource is supposed to be an URL like https://somewhere/accessible/file.ott that is accessible by the Online. For the actual saving of the content, normal PutFile mechanism will be used.
|
||||
TemplateSource string `json:"TemplateSource,omitempty"`
|
||||
|
||||
//
|
||||
// User metadata properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
IsAnonymousUser bool `json:"IsAnonymousUser,omitempty"`
|
||||
// copied from MS WOPI
|
||||
UserFriendlyName string `json:"UserFriendlyName,omitempty"`
|
||||
// copied from MS WOPI
|
||||
UserID string `json:"UserId,omitempty"`
|
||||
|
||||
//
|
||||
// User permissions properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
ReadOnly bool `json:"ReadOnly"`
|
||||
// copied from MS WOPI
|
||||
UserCanNotWriteRelative bool `json:"UserCanNotWriteRelative"`
|
||||
// copied from MS WOPI
|
||||
UserCanRename bool `json:"UserCanRename"`
|
||||
// Specifies if the user has permissions to review a file.
|
||||
UserCanReview bool `json:"UserCanReview,omitempty"`
|
||||
// copied from MS WOPI
|
||||
UserCanWrite bool `json:"UserCanWrite"`
|
||||
|
||||
//
|
||||
// Host capabilities properties
|
||||
//
|
||||
|
||||
// copied from MS WOPI
|
||||
SupportsLocks bool `json:"SupportsLocks"`
|
||||
// copied from MS WOPI
|
||||
SupportsRename bool `json:"SupportsRename"`
|
||||
// Specifies if the WOPI server supports the review permission.
|
||||
SupportsReviewing bool `json:"SupportsReviewing,omitempty"`
|
||||
// copied from MS WOPI
|
||||
SupportsUpdate bool `json:"SupportsUpdate"` // whether "Putfile" and "PutRelativeFile" work
|
||||
|
||||
//
|
||||
// Other properties
|
||||
//
|
||||
|
||||
// copied from collabora WOPI
|
||||
EnableInsertRemoteImage bool `json:"EnableInsertRemoteImage,omitempty"`
|
||||
// copied from collabora WOPI
|
||||
HidePrintOption bool `json:"HidePrintOption,omitempty"`
|
||||
}
|
||||
|
||||
// SetProperties will set the file properties for the OnlyOffice implementation.
|
||||
func (oinfo *OnlyOffice) SetProperties(props map[string]any) {
|
||||
for key, value := range props {
|
||||
switch key {
|
||||
case KeyBaseFileName:
|
||||
oinfo.BaseFileName = value.(string)
|
||||
case KeyVersion:
|
||||
oinfo.Version = value.(string)
|
||||
|
||||
case KeyBreadcrumbBrandName:
|
||||
oinfo.BreadcrumbBrandName = value.(string)
|
||||
case KeyBreadcrumbBrandURL:
|
||||
oinfo.BreadcrumbBrandURL = value.(string)
|
||||
case KeyBreadcrumbDocName:
|
||||
oinfo.BreadcrumbDocName = value.(string)
|
||||
case KeyBreadcrumbFolderName:
|
||||
oinfo.BreadcrumbFolderName = value.(string)
|
||||
case KeyBreadcrumbFolderURL:
|
||||
oinfo.BreadcrumbFolderURL = value.(string)
|
||||
|
||||
case KeyClosePostMessage:
|
||||
oinfo.ClosePostMessage = value.(bool)
|
||||
case KeyEditModePostMessage:
|
||||
oinfo.EditModePostMessage = value.(bool)
|
||||
case KeyEditNotificationPostMessage:
|
||||
oinfo.EditNotificationPostMessage = value.(bool)
|
||||
case KeyFileSharingPostMessage:
|
||||
oinfo.FileSharingPostMessage = value.(bool)
|
||||
case KeyFileVersionPostMessage:
|
||||
oinfo.FileVersionPostMessage = value.(bool)
|
||||
case KeyPostMessageOrigin:
|
||||
oinfo.PostMessageOrigin = value.(string)
|
||||
|
||||
case KeyCloseURL:
|
||||
oinfo.CloseURL = value.(string)
|
||||
case KeyFileSharingURL:
|
||||
oinfo.FileSharingURL = value.(string)
|
||||
case KeyFileVersionURL:
|
||||
oinfo.FileVersionURL = value.(string)
|
||||
case KeyHostEditURL:
|
||||
oinfo.HostEditURL = value.(string)
|
||||
|
||||
case KeyCopyPasteRestrictions:
|
||||
oinfo.CopyPasteRestrictions = value.(string)
|
||||
case KeyDisablePrint:
|
||||
oinfo.DisablePrint = value.(bool)
|
||||
case KeyFileExtension:
|
||||
oinfo.FileExtension = value.(string)
|
||||
case KeyFileNameMaxLength:
|
||||
oinfo.FileNameMaxLength = value.(int)
|
||||
case KeyLastModifiedTime:
|
||||
oinfo.LastModifiedTime = value.(string)
|
||||
case KeyTemplateSource:
|
||||
oinfo.TemplateSource = value.(string)
|
||||
case KeyIsAnonymousUser:
|
||||
oinfo.IsAnonymousUser = value.(bool)
|
||||
case KeyUserFriendlyName:
|
||||
oinfo.UserFriendlyName = value.(string)
|
||||
case KeyUserID:
|
||||
oinfo.UserID = value.(string)
|
||||
|
||||
case KeyReadOnly:
|
||||
oinfo.ReadOnly = value.(bool)
|
||||
case KeyUserCanNotWriteRelative:
|
||||
oinfo.UserCanNotWriteRelative = value.(bool)
|
||||
case KeyUserCanRename:
|
||||
oinfo.UserCanRename = value.(bool)
|
||||
case KeyUserCanReview:
|
||||
oinfo.UserCanReview = value.(bool)
|
||||
case KeyUserCanWrite:
|
||||
oinfo.UserCanWrite = value.(bool)
|
||||
|
||||
case KeySupportsLocks:
|
||||
oinfo.SupportsLocks = value.(bool)
|
||||
case KeySupportsRename:
|
||||
oinfo.SupportsRename = value.(bool)
|
||||
case KeySupportsReviewing:
|
||||
oinfo.SupportsReviewing = value.(bool)
|
||||
case KeySupportsUpdate:
|
||||
oinfo.SupportsUpdate = value.(bool)
|
||||
|
||||
case KeyEnableInsertRemoteImage:
|
||||
oinfo.EnableInsertRemoteImage = value.(bool)
|
||||
case KeyHidePrintOption:
|
||||
oinfo.HidePrintOption = value.(bool)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetTarget will always return "OnlyOffice"
|
||||
func (oinfo *OnlyOffice) GetTarget() string {
|
||||
return "OnlyOffice"
|
||||
}
|
||||
Reference in New Issue
Block a user