Page 1 of 1

Open file in Author Mode

Posted: Tue Jan 21, 2014 5:05 pm
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!

Re: Open file in Author Mode

Posted: Tue Jan 21, 2014 6:06 pm
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

Re: Open file in Author Mode

Posted: Tue Jan 21, 2014 6:22 pm
by odaata
Wonderful! That's exactly what I was looking for! Thank you!