Running framework code on document open event

Oxygen general issues.
peterls
Posts: 16
Joined: Fri Mar 20, 2015 2:29 pm

Running framework code on document open event

Post by peterls »

I've got a custom framework that defines several operations users can invoke from menus or through hotkeys. For example an operation could be to contact an external web service and insert an XML fragment in the current document based on the response.

What I need now is to invoke one of those operations automatically whenever a new document (that is associated with that framework) is opened. Is there a way to do this?

I know I could do it easily via a plugin but I don't want to duplicate my code if it was possible.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: Running framework code on document open event

Post by mihaela »

Hi,

The only way to invoke the operation when the document is opened is to create a plugin (as you already said).
A custom action can be also invoked through CSS, by using the oxy_action() function, but this action should be associated with a button form control.You cannot invoke it on document open.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply