Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
PVince81 opened this issue Jan 16, 2015 · 32 comments
Closed

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

PVince81 opened this issue Jan 16, 2015 · 32 comments

Comments

@PVince81
Copy link
Contributor

PVince81 commented Jan 16, 2015

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

@michaelstingl
Copy link

00002190

@SergioBertolinSG
Copy link
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.

@PVince81
Copy link
Contributor Author

I can try and look into this for 8.1

@PVince81
Copy link
Contributor Author

PVince81 commented Feb 4, 2015

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)

@tomneedham
Copy link
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.

@PVince81
Copy link
Contributor Author

PVince81 commented Feb 4, 2015

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.

@tomneedham
Copy link
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

@PVince81
Copy link
Contributor Author

PVince81 commented Feb 5, 2015

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.

@jancborchardt
Copy link
Member

Would be good indeed. Then we can consistently place the viewers, fade the background, display file actions etc.

@PVince81
Copy link
Contributor Author

Enhancement/refactor/API change, but we're past feature freeze -> 8.2

@PVince81 PVince81 modified the milestones: 8.2-next, 8.1-current Apr 23, 2015
@oparoz
Copy link
Contributor

oparoz commented Jun 30, 2015

Yes, please! :)

@PVince81
Copy link
Contributor Author

  • Idea: viewers or app could register JS URL routes to make it work with the history API (back/forward button) instead of the anchor hackery

@oparoz
Copy link
Contributor

oparoz commented Sep 15, 2015

I guess this is now for 9.0 @PVince81 ?

@PVince81
Copy link
Contributor Author

PVince81 commented Oct 6, 2015

Yes, move to 9.0 or backlog

@DeepDiver1975
Copy link
Member

Yes, move to 9.0 or backlog

@cmonteroluque

@PVince81
Copy link
Contributor Author

PVince81 commented Oct 6, 2015

@michaelstingl can you confirm that the blue ticket part is fixed ? Last time I checked the back button was properly closing the text editor, so it should work.

We should defer this ticket here to 9.0 or backlog and also remove the blue ticket tag as its part was fixed.

@ghost
Copy link

ghost commented Oct 6, 2015

holding off for @michaelstingl's answer

@michaelstingl
Copy link

@PVince81 @cmonteroluque I can confirm: Closing text editor with browser back button keeps user in the current directory. This solves this problem described here: owncloud/files_texteditor#50 (comment) Thanks!

@PVince81
Copy link
Contributor Author

Moving to backlog for now, no time for this

@PVince81 PVince81 modified the milestones: backlog, 10.0 Jan 27, 2017
@PVince81 PVince81 removed their assignment Nov 13, 2017
@PVince81
Copy link
Contributor Author

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

@PVince81
Copy link
Contributor Author

this will be reconsidered with Phoenix owncloud/web#215

@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants