Click on Template file -> Create Document
This issue is unique.
- [X] I have used the search tool and did not find an issue describing my idea.
Your idea.
Userstory
As a user I want to create a document by clicking on a template file so that I can use the templates from a shared folder.
Flow
( pasting here @ibnpetr 's proposal: )
- When interacting with a DOTX file (double-clicking, selecting an item in the context menu, hidden opening, or any other logic for opening from a template), a DOCX file without content should be “created.”
- The storage (OCIS) should determine the location of the DOCX file: the current or root user folder, or any alternative folder for opening from templates.
- It is important that this file can be manipulated like a regular file (CheckFileInfo, Lock, PutFile) except for GetFile. Instead of GetFile, a link to the DOTX template should be sent in the CheckFileInfo response (TemplateSource field).
- Immediately open this file for editing. OO Docs will convert the template to DOCX and place the DOCX file in the storage using PutFile.
- Further editing will proceed as with a regular DOCX file.
Note:
- Editing a DOTX file as a template is not covered by this scheme.
- Editing from DOTX to DOTX is enabled through a setting in the configuration file.
Do I understand correctly that we create an empty DOCX file to a location writeable by the user and fill a new TemplateSource property in the GetFileInfo response with a URL to the DOTX template? onlyoffice would detect that new parameter, fetch the template and fill the DOCX file accordingly?
If so, I see no problems with this approach. We would have to store the template in the wopi session and add some code to handle the opening and creation logic. All good.
Do I understand correctly that we create an empty DOCX file to a location writeable by the user and fill a new
TemplateSourceproperty in the GetFileInfo response with a URL to the DOTX template? onlyoffice would detect that new parameter, fetch the template and fill the DOCX file accordingly?
Yes, you can either create a new empty file or copy the template file itself, which is an alternative method used by other vendors. A new file will be created from the TemplateSource file.
cc @micbar
After discussion with oC colleagues, we have a vague idea how to implement that.
We should use the app provider /app/new Action to create the new file in the personal space of the user with a server choosen name (File name and user-friendly datetime). Then we can open that via /app/open with the selected template in the wopi CheckFileInfo response.
@micbar any progress on that item?
not yet.
@ibnpetr @LuckySpecialist @igwyd I have an implementation and was hitting a roadblock.
I implemented the workflow as far as Step 3 in the top Post:
- Opening a new empty file and sending a File Download Url like
https://wopiserver/wopi/files/<fileid>/contentsin theTemplateSourceproperty.
My Observation:
OnlyOffice tries to download that file, but it doesn't send the Access Token.
Did i miss anyting?
I am using onlyoffice/4testing-documentserver:8.2.0.108
we checked the documentation and it seems that TemplateSource is used as is and nothing is added. As per MS documentation it is stated that for alternative links FileUrl is used exactly as provided. Right now not only access token is added, but also the request is not signed with keys and X-WOPI-Proof is not added as well. Collabora for example, downloads templateUri with no authorization the same as FileUrl that is used exactly as provided and then below that they have auth.authorizeURI(uriObject); with access token. Is it important for you to add some kind of authorization or the way Collabora does meets your requirements?
@alexonlyoffice Thank you. I will try to do an implementation which could work in that context.