Server: Allow "Direct Editing" Link Without Public Sharing

Created on 15 Nov 2018  路  15Comments  路  Source: nextcloud/server

(Original issue: https://github.com/nextcloud/richdocuments/issues/312)

Steps to reproduce

  1. Copy "File Link" in the sidebar.
  2. Open the copied URL.

Expected behaviour

The file will be presented in editing view (at least optionally).

Actual behaviour

The file will be shown in the files list, with its sidebar opened.

In case of a public share link, this already works - opening this link will optionally ask for a password and then open the file in the Richdocuments online readonly or editor view.

Server configuration detail

Operating system: Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64

Webserver: Apache/2.4.25 (Debian) (apache2handler)

Database: mysql 10.1.26

PHP version:

7.0.30-0+deb9u1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, apc, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, imap, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, Phar, posix, readline, recode, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 13.0.7 - 13.0.7.2

Updated from an older Nextcloud/ownCloud or fresh install: installed 13.0.2

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps

Enabled:
 - activity: 2.6.1
 - apporder: 0.5.0
 - bookmarks: 0.12.2
 - calendar: 1.6.1
 - circles: 0.14.3
 - comments: 1.3.0
 - contacts: 2.1.5
 - dav: 1.4.7
 - external: 3.0.4
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_pdfviewer: 1.2.1
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - files_videoplayer: 1.2.0
 - firstrunwizard: 2.2.1
 - gallery: 18.0.0
 - issuetemplate: 0.4.0
 - ldapcontacts: 1.1.4
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - mail: 0.8.3
 - nextcloud_announcements: 1.2.0
 - notes: 2.4.2
 - notifications: 2.1.2
 - oauth2: 1.1.1
 - password_policy: 1.3.0
 - polls: 0.8.3
 - provisioning_api: 1.3.0
 - richdocuments: 3.0.5
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - socialsharing_email: 1.0.4
 - spreed: 3.2.6
 - survey_client: 1.1.0
 - systemtags: 1.3.0
 - tasks: 0.9.7
 - theming: 1.4.5
 - twofactor_backupcodes: 1.2.3
 - updatenotification: 1.3.0
 - user_ldap: 1.3.1
 - workflowengine: 1.3.0
Disabled:
 - admin_audit
 - encryption
 - files_external
 - user_external

Configuration (config/config.php)

{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "nextcloud.ohrner-it.com"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "https:\/\/nextcloud.ohrner-it.com",
    "htaccess.RewriteBase": "\/",
    "dbtype": "mysql",
    "version": "13.0.7.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "php",
    "mail_smtpauthtype": "LOGIN",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "app.mail.accounts.default": {
        "email": "%USERID%@ohrner-it.com",
        "imapHost": "luggage.ohrner.net",
        "imapPort": 993,
        "imapUser": "%USERID%",
        "imapSslMode": "ssl",
        "smtpHost": "luggage.ohrner.net",
        "smtpPort": 465,
        "smtpUser": "%USERID%",
        "smtpSslMode": "ssl"
    },
    "auth.bruteforce.protection.enabled": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "updater.release.channel": "production"
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/70.0.3538.77 Chrome/70.0.3538.77 Safari/537.36

Operating system: Debian 9.6

1. to develop enhancement files

All 15 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/12469 ([Feature] Allow Direct Editing for Regular (not public) Direct File Links), https://github.com/nextcloud/server/issues/2983 (Can't open documents from public shares using Collabora online), https://github.com/nextcloud/server/issues/11169 (Allow multiple share links), https://github.com/nextcloud/server/issues/9434 (Public Sharing), and https://github.com/nextcloud/server/issues/8266 (NC13, Cannot edit Files with Collabora in shared folders).

12469 was just closed as a "duplicate" of this issue:

@juliushaertl juliushaertl referenced this issue 23 minutes ago
Closed
[Feature] Collabora: Allow Direct Editing for Regular (not public) Direct File Links #12469

It's definitely related to this issue here, but I'm not sure if it's actually a duplicate, i.e. if the feature requested in #12469 will automatically work once this feature request here has been implemented.

So to make sure the desired feature from #12469 does not get lost, I'll quote it here for reference:

Steps to reproduce
Open an ODT/ODS document shown in the files list in a new tab.

Expected behaviour
The file opens in edit view, as if I had just clicked it to open in the same tab.

Actual behaviour
The file is offered for download.

Could you please also consider tagging this as "1. to develop" and milestone "Nextcloud 17"? (just like #14593)

Please use GitHub Reactions if possible.

Hi @rullzer @skjnldsv , what about this issue ? Could it be tagged to a milestone again ?

Hey @mhow2 !
Not a priority right now, so no milestone
This does not mean we don't want this feature, but it is simply not on our roadmap for the near future. If somebody wants to implement this feature nevertheless we are happy to assist and help out.

So this is actually step 2/3 of what I described in https://github.com/nextcloud/server/issues/16067#issuecomment-606757072 Let's close #16067 then since this one fits the remaining tasks better:

As a general comment on the approach in #16067, I think it is only half way to how it should actually behave. The ideal solution would look like the following.

  • [x] Opening the file (with middle mouse button click) will open it in a new tab) this is what the existing pr already does -> #20185
  • [ ] Opening the file in the same tab, should update the current url with &openfile=fileId, so that after a reload of the page you also end up with the editor open. e.g. index.php/apps/files/?dir=/Documents&fileid=3&editfile=11
  • [ ] When closing an editor (ending the file action) the url changes back to the file list, e.g. index.php/apps/files/?dir=/Documents&fileid=3

The first part is already done with #20185 so if you copy the link of a file row you already have a direct link to open collabora or any other file ;)

cc @azul

I'll take a look at the url change today.

@juliushaertl I'm a bit unsure how to best approach this.

The files app itself updates the url when navigating to another directory. This happens by triggering an changeDirectory event in the actionHandler which triggers _onDirectoryChanged which then in turn uses OC.Util.History in _changeUrl to update the url.

So I think the url update should be handled in the Viewer apps actionHandler. However the Viewer app uses vue.js a lot more than the files app. My understanding is that the vue.js approach to url updates and history is using a router.

I'll start by adding the url update in the traditional way to the open function in the viewer app. Please let me know if i should use routes instead.

:arrow_up: This is a first take making use of OC.Util.History. It still lacks a handler for onpopstate.

@juliushaertl : Thx very much for sharing the &openfile=fileId syntax!

I have been looking for this feature for a while. Knowing this syntax, I can at least cook my own URLs that I can share with team members, so that they can directly edit the document.

Any update on this? Is this implemented now?

@microfx, in current master if you open a file in the viewer it will change the url to one that will also open the file in the viewer. It contains the openfile=1234 part mentioned above. You can use that to create links to that file.

I also opened a pull request to the text app to make linking to local files easier. The second comment has a screen recording, illustrating how it works. I'd be happy about feedback there.

@juliushaertl : Thx very much for sharing the &openfile=fileId syntax!

I have been looking for this feature for a while. Knowing this syntax, I can at least cook my own URLs that I can share with team members, so that they can directly edit the document.

Hi ! This feature would be very useful indeed, but I can't have this "hack" to work (NC 19 and 18), does the URL must end like this : apps/files/?dir=/Directory&fileid=[fileID]&openfile=[fileID] ?

Was this page helpful?
0 / 5 - 0 ratings