Page 1 of 1

Opening file and position caret

Posted: Tue May 31, 2011 3:51 pm
by bernd.fuhrmann
Hi!

We'd like to open a file and position the caret at some point. Additionally we'd like to force Oxygen to open the file in Text-Page, not in Author or Grid. So far we haven't found any clean way to do this.

The best way would be to do this via command line.

So far I've only managed to do something by dabbling with some files in APPData, but that's not nice and doesn't work if Oxygen is already open.

Writing a plugin didn't give any good results either: I can open a file and I can position the caret, but I couldn't find any way to select the active Page, and to open a file and position the caret without any user interaction (e.g. pressing a toolbar-button).

Thanks in advance,
Bernd Fuhrmann

Re: Opening file and position caret

Posted: Wed Jun 01, 2011 10:37 am
by Radu
Hi Bernd,

I need to know more about your use case, are you editing custom XML files or files for which Oxygen already comes with build-in support (Docbook, DITA, TEI, XHTML....)?
What is the flow you are trying to obtain?

Oxygen opens by default an XML file in the Text page. For DITA and Docbook the document types defined in the Preferences->Document Type Association page specify the Author page as the preferred page for opening XML documents. The default page mappings can be modified in the Editor / Pages Preferences page.

We do not yet have API to force opening an XML file in a certain page but we will consider this for a future version.
So far I've only managed to do something by dabbling with some files in APPData, but that's not nice and doesn't work if Oxygen is already open.
I don't quite understand. You can indeed pass the URLs you want to open as command line parameters to Oxygen (oxygen.exe or oxygen.bat). But you cannot force the initial page in which the XML will open.
Writing a plugin didn't give any good results either: I can open a file and I can position the caret, but I couldn't find any way to select the active Page, and to open a file and position the caret without any user interaction (e.g. pressing a toolbar-button).
What type of plugin did you try to implement? Did you try the Workspace Access plugin? We do not have API to change the page but there is API to open an XML file and position the caret in it without user interaction.

Regards,
Radu

Re: Opening file and position caret

Posted: Thu Aug 25, 2011 2:36 pm
by Radu
Hi,

Oxygen 13 which will be released in a couple of days will also contain API to programatically change the page in the editor to the desired page.

Regards,
Radu