Page 1 of 1
A bit lost...
Posted: Thu Dec 05, 2013 10:15 am
by RogerT
I would like to add a callback in the Author View so that when the user modifies an element's content, a Java process is launched to update/check some external DB.
Is this possible?
I ask since Plugin Developer Guide says "For extending the Author
mode of the XML editor panel, see Author Developer Guide for the custom Author actions API." and that I did not see in the Author Developer Guide how to set a callback when an element content is modified.
Re: A bit lost...
Posted: Thu Dec 05, 2013 11:06 am
by Radu
Hi Roger,
I will assume you are using the standalone version of Oxygen (and not the Eclipse plugin version).
This can be done using the API:
Code: Select all
ro.sync.ecss.extensions.api.AuthorDocumentController.addAuthorListener(AuthorListener)
This kind of listener will be called whenever the user edits the document and you could use it to see in which node a modification was made and to possibly start that Java process.
You can add the listener in two ways:
1) If you have a custom framework/document type with a custom
ro.sync.ecss.extensions.api.ExtensionsBundle implementation, you overwrite the method
ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorExtensionStateListener() and when the extension state listener is activated, you add your document listener.
The Author SDK documentation would be useful for this:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK
2) Using our Plugins SDK:
http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins
you can create a Workspace Access plugin type (the Plugins SDK contains a sample for it). In your custom plugin implementation you can add a listener to see when an XML document is opened. When the document is opened in the visual Author editing mode you can use the API in
ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPage to reach the AuthorDocumentController and add the listener to it.
Regards,
Radu
Re: A bit lost...
Posted: Thu Dec 05, 2013 11:24 pm
by RogerT
Thank you Radu, most useful to clear up things quickly.