Skip to content

JS API / container for apps to embed viewers/editors #13414

Closed

Description

@PVince81

Currently every file viewer / file editor app is registering a FileAction and then doing whatever they want to try and embed themselves into the current view.
Also, back button support, URL and breadcrumb need to be managed by the app itself.

A new API / container need to be developed in the files app that allows apps to register viewer/editor handlers. The API will automatically support this:

  1. getViewerContainer() will return the container that the viewer must use to embed itself
  2. event APIs to communicate between the viewer and the files app (open event, close event, etc)
  3. back button handling
  4. URL handling:
  • modify URL to point to the file upon file opening
  • if the URL was opened directly in the browser, automatically open the matching editor
    5) this must also work in public preview mode (files_sharing public link)

@DeepDiver1975 @tomneedham @LukasReschke

Activity

  1. self-assigned this
    on Jan 16, 2015
  2. added this to the backlog milestone on Jan 16, 2015
  3. michaelstingl commented on Jan 19, 2015

    @michaelstingl

    00002190

  4. SergioBertolinSG commented on Jan 30, 2015

    @SergioBertolinSG
    Contributor

    The problem with going back using the browser remains in 8.0.0.4, I think users will find it really annoying.
    Entering a folder, previewing a pdf or a text file and going back distorts web UI.

  5. PVince81 commented on Jan 30, 2015

    @PVince81
    ContributorAuthor

    I can try and look into this for 8.1

  6. modified the milestones: , backlog on Jan 30, 2015
  7. PVince81 commented on Feb 4, 2015

    @PVince81
    ContributorAuthor

    One important part is that the viewer implementations should not compute download URLs by themselves. They need to use the ones given by the API/container because the viewer cannot predict in which view it is. This would also make it possible to view files in the trashbin.

    The container could also inject an instance of JS Files API (#13905) so the viewer/app can access any file operation if needed (including download/upload)

  8. tomneedham commented on Feb 4, 2015

    @tomneedham
    Contributor

    @PVince81 Yes. Hard part is handling the additional stuff that the text editor needs. If this will truly handle 'editors' there needs to be some consideration into the saving part.

  9. PVince81 commented on Feb 4, 2015

    @PVince81
    ContributorAuthor

    I thought about it. If I remember well the additional part is about checking if the file was changed on the server ? Basically some kind of conflict detection ?
    This should be doable over WebDAV too, just like the sync client does.
    If the viewer knows the etag of the file before saving, it could call api.saveFile(path, contents, {etag: oldEtag}); and the WebDAV call might fail with "409 conflict" if the file was changed.

  10. tomneedham commented on Feb 4, 2015

    @tomneedham
    Contributor

    Essentially yes. The only other bit is some fixes on the encoding, but this might be handled by core now, considering this was written for OC3: https://github.com/owncloud/files_texteditor/blob/master/ajax/savefile.php#L47

  11. PVince81 commented on Feb 5, 2015

    @PVince81
    ContributorAuthor

    I see. Either it could be done in pure JS (if that is even possible), or the text editor would still have to use its own endpoint, but that one needs to be made flexible to be able to load files from the trashbin as well.

  12. 31 remaining items

  13. ghost removed this from the milestone on Feb 23, 2016
  14. modified the milestones: , on Jun 14, 2016
  15. PVince81 commented on Jan 27, 2017

    @PVince81
    ContributorAuthor

    Moving to backlog for now, no time for this

  16. modified the milestones: backlog, 10.0 on Jan 27, 2017
  17. removed their assignment
    on Nov 13, 2017
  18. PVince81 commented on Dec 13, 2017

    @PVince81
    ContributorAuthor

    By extension, also to provide a diff view, see #4056

  19. PVince81 commented on Aug 10, 2018

    @PVince81
    ContributorAuthor

    this will be reconsidered with Phoenix owncloud/web#215

  20. locked as resolved and limited conversation to collaborators on Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions