Open file in Author Mode

Post here questions and problems related to oXygen frameworks/document types.
odaata
Posts: 26
Location: Utrecht, Netherlands

Open file in Author Mode

Tue Jan 21, 2014 5:05 pm

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: 654

Re: Open file in Author Mode

Tue Jan 21, 2014 6:06 pm

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
Location: Utrecht, Netherlands

Re: Open file in Author Mode

Tue Jan 21, 2014 6:22 pm

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

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

Who is online

Users browsing this forum: No registered users and 0 guests