Document creation API?

Oxygen general issues.
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Document creation API?

Post by yann1806 »

Hello there,

new to Oxygen - I want to develop a plugin with a button that will create a document based on the provided XSD (skipping the wizard, I want to create the document type I need in only one button).

I can't find the right API to create a document... thanks for pointing me toward what I'm missing!

Yann
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Document creation API?

Post by alex_jitianu »

Hello,

You need an Workspace Access plugin:
http://oxygenxml.com/doc/ug-editor/#con ... lugin.html

Amongst other things, such a plugin can contribute actions to the toolbar. The API that can do that:
ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.addToolbarComponentsCustomizer(ToolbarComponentsCustomizer)

Once you've put a button on the toolbar this button should either create a new untitled editor or maybe create a file on disk and open it in an editor:
ro.sync.exml.workspace.api.Workspace.createNewEditor(String, String, String)
ro.sync.exml.workspace.api.Workspace.open(URL)

There is a sample Workspace Access plugin available at:
http://oxygenxml.com/oxygen_sdk.html#Developer_Plugins

Best regards,
Alex
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Re: Document creation API?

Post by yann1806 »

Hi Alex,

thanks for the reply. I'm wondering if there is an API call that does the same as the wizard (Create XML file / use XSD template), or if we have to create by hand the file content that the wizard would produce, and then create the new editor with this file?

Thanks

Yannick
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Document creation API?

Post by alex_jitianu »

Hi Yannick,

There is no API to invoke the New dialog wizard so you'll have to do as you said. You can have a template that also contains the schema association (you could also have a catalog to resolve the schema) and either create a new editor over that content or save the content on disk and open that location in an editor.

Best regards,
Alex
Post Reply