create new file with assigned url?

Post here questions and problems related to oXygen frameworks/document types.
Patrik
Posts: 216
Location: Hamburg/Germany

create new file with assigned url?

Thu Jun 08, 2017 5:02 pm

My requirement for a specific AuthorOperation is that i want to ensure that a specific file is opened in oXygen editor. (I will access it through the URIResolver.)

Currently, when the file is not existing I create the content, write it to disk and then open it.

Even better would be if I could create a new document with a specific URL assigned to it. This way there is no side-effect until the user saves the file.
I found a method to create a new file (Workspace.createNewEditor()) but I could not find a way to set a specific URL without explicitly saving it to disk!?

Thanks and regards,
Patrik
Radu
Posts: 5088

Re: create new file with assigned url?

Fri Jun 09, 2017 10:29 am

Hi Patrik,

Sorry but we do not have such an API. I added an internal issue for this.
What you could do would be to create the file on disk, open it in Oxygen, mark the opened editor as modified (WSEditor.setModified(true)) and then remove if from disk.
This will probably not work that well when Oxygen 19.1 will be released because Oxygen 19.1 will detect the underlining file does not exist anymore and will show a dialog asking you what to do about it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Patrik
Posts: 216
Location: Hamburg/Germany

Re: create new file with assigned url?

Fri Jun 09, 2017 10:32 am

Thanks. It's not that urgent anyway since the current behavior is good enough...

Regards,
Patrik

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest