[Libreoffice-bugs] [Bug 99744] Add "Save as" to cloud version

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed May 31 08:17:50 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=99744

--- Comment #3 from Pranav Kant <pranavk at collabora.co.uk> ---
(In reply to Aditya Dewan from comment #2)
> If we wish to implement this feature, the series of events would be a bit
> similar to that of the save feature, as implemented currently.
> 
> As per my understanding, this is what was happening when a save request was
> sent:
> 
> - on a save request
>     DocumentBroker::sendUnoSave
>     -
>     DocumentBroker::forwardtotochild, sent to lokit
>     -
>     *very less idea what happens here, any guidance would be helpful here*

You mean what happens inside LO core when save is dispatched to it ? Basically,
the call ends up in doc_saveAs method in desktop/source/lib/init.cxx and it
eventually saves the document (and notify optionally).

>     -
>     ClientSession::handleKitToClientMessage, we get response of uno command
>     -
>     check members and call DocumentBroker::savetostorage
> 

Yeah, that's correct.

> - on a saveas request
>     request recieved from click/shortuct press
>     DocumentBroker -> send uno saveas request
>         we write request
>         and forward to kit
>     -
>     call function to save jailed file to the new specified location 
>         we write a new method for this that will save the jailed file to a
> new location and now documentbroker's uri.
>     -
>     then, we need to make a new DocumentBroker, for the current session.
>     -
>     remove current session from previous docbroker and attach it to the new
> one.
>     -
>     call save function from the new document broker.
>     (would that be it?)
> 
> 
> *some code was already written regarding handling messages related to Saveas
> from the lokit to the clientsession.(clientsession.cpp, l.no. - 573), but
> all it does is creates the uri corresponding to the new path, sends the
> file(why?), removes the client session, and signals the docbroker to exit.

The current saveas implementation is only used for HTTP POST conversion API.
See wsd/reference.txt for "Document conversion". Since, the post request is
atomic, it just downloads the file after which DocumentBroker is not needed, so
we remove it.

Surely, you need to do some modifications here to preclude the document broker
to exit in this case.

> The last part makes this confusing though,lets say 3 users a, b, c have
> opened the same document, now if 'a' saves it as some other file, then we
> need not shift 'b' and 'c'.(or do we?)

No, we shouldn't shift 'b' and 'c'. Only 'a' should be shifted.

Please note that, this is 'Save as' to "cloud" versions, so it also needs to be
stored back to the cloud storage via WOPI. You need to create new document in
the cloud storage when user hits the 'save as' button.

In loleaflet, there is a saveAs method in Toolbar.js which is unused right now.
But it seems there were efforts made in the past to 'Save as' while 'Taking
ownership' at the same time, hence the TakeOwnership flag there. It would be
great to experiment a bit with it to see if it works out of the box, or needs
some tweaking. Personally, I'd take a top-down approach here and start with the
WOPI storage, create a dialog box there that asks me the location of the file
etc. to save as, document format and then sends appropriate commands back to
loolwsd.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170531/e15d567a/attachment.html>


More information about the Libreoffice-bugs mailing list