Page 1 of 1

Document creation API?

Posted: Fri Aug 09, 2013 11:19 am
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

Re: Document creation API?

Posted: Fri Aug 09, 2013 12:55 pm
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

Re: Document creation API?

Posted: Fri Aug 09, 2013 6:50 pm
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

Re: Document creation API?

Posted: Mon Aug 12, 2013 12:46 pm
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