Open file in Author Mode

Post here questions and problems related to oXygen frameworks/document types.
odaata
Posts: 26
Joined: Wed Apr 10, 2013 12:34 pm
Location: Utrecht, Netherlands

Open file in Author Mode

Post by odaata »

One more (hopefully) quick question... I'm trying to open a file in Author mode from Java. I see that the open() function on AuthorWorkspaceAccess is deprecated, which led me to Workspace.open(). This allows me to pass in a second parameter (besides the URL to the file) called imposedPage, which has the description: The imposed page for opening the URL. Does this allow me to specify that it should be opened in Author mode? If so, what string should I pass in there and is there a constant somewhere that I can use instead? If not, how would you suggest opening an XML file in Author mode? Here is the code I'm firing from inside an overriden doOperation() method.

Code: Select all

PluginWorkspaceProvider.getPluginWorkspace().open(sourceURL, "author");
Thanks!
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Open file in Author Mode

Post by alex_jitianu »

Hi,

The value for the imposedPage parameter is one of the constants from the ro.sync.exml.editor.EditorPageConstants interface. If you want to open the editor in the author mode then the right value is EditorPageConstants.PAGE_AUTHOR. Thank you for pointing it out. I'll also update the documentation.

Best regards,
Alex
odaata
Posts: 26
Joined: Wed Apr 10, 2013 12:34 pm
Location: Utrecht, Netherlands

Re: Open file in Author Mode

Post by odaata »

Wonderful! That's exactly what I was looking for! Thank you!
Post Reply