feat: enable EnableRemoteLinkPicker WOPI flag for Collabora Online

Set EnableRemoteLinkPicker: true in CheckFileInfo response so
Collabora Online exposes its "Smart Picker" UI for link
insertion. Clicking it sends a UI_PickLink postMessage to the WOPI
host, which is expected to reply with Action_InsertLink carrying the
URL of the selected file. Follows the same pattern as the existing
EnableInsertRemoteImage / EnableInsertRemoteFile flags.

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
This commit is contained in:
Pedro Pinto Silva
2026-04-17 13:50:11 +02:00
committed by Michael Barz
parent efb73c8a79
commit e9c6e3f17a
4 changed files with 8 additions and 0 deletions

View File

@@ -1278,6 +1278,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse,
fileinfo.KeyEnableOwnerTermination: true, // only for collabora
fileinfo.KeyEnableInsertRemoteImage: true,
fileinfo.KeyEnableInsertRemoteFile: true,
fileinfo.KeyEnableRemoteLinkPicker: true,
fileinfo.KeySupportsExtendedLockLength: true,
fileinfo.KeySupportsGetLock: true,
fileinfo.KeySupportsLocks: true,

View File

@@ -1802,6 +1802,7 @@ var _ = Describe("FileConnector", func() {
PostMessageOrigin: "https://cloud.opencloud.test",
EnableInsertRemoteImage: true,
EnableInsertRemoteFile: true,
EnableRemoteLinkPicker: true,
IsAnonymousUser: true,
}
@@ -1995,6 +1996,7 @@ var _ = Describe("FileConnector", func() {
PostMessageOrigin: "https://cloud.opencloud.test",
EnableInsertRemoteImage: true,
EnableInsertRemoteFile: true,
EnableRemoteLinkPicker: true,
IsAdminUser: true,
UserExtraInfo: &fileinfo.UserExtraInfo{
Mail: "shaft@example.com",

View File

@@ -46,6 +46,8 @@ type Collabora struct {
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.
@@ -124,6 +126,8 @@ func (cinfo *Collabora) SetProperties(props map[string]any) {
cinfo.EnableInsertRemoteImage = value.(bool)
case KeyEnableInsertRemoteFile:
cinfo.EnableInsertRemoteFile = value.(bool)
case KeyEnableRemoteLinkPicker:
cinfo.EnableRemoteLinkPicker = value.(bool)
case KeyDisableInsertLocalImage:
cinfo.DisableInsertLocalImage = value.(bool)
case KeyHidePrintOption:

View File

@@ -104,6 +104,7 @@ const (
KeyEnableInsertRemoteImage = "EnableInsertRemoteImage"
KeyEnableInsertRemoteFile = "EnableInsertRemoteFile"
KeyEnableRemoteLinkPicker = "EnableRemoteLinkPicker"
KeyDisableInsertLocalImage = "DisableInsertLocalImage"
KeyHidePrintOption = "HidePrintOption"
KeyHideSaveOption = "HideSaveOption"