querying a server from oxygen as a plugin

Oxygen general issues.
ttasovac
Posts: 82
Joined: Fri Dec 19, 2003 6:02 pm

querying a server from oxygen as a plugin

Post by ttasovac »

hi,

i would like to have a plugin for oxygen developed. my requirements are pretty simple, but i wonder whether what i need could be accomplished in oxygen, or whether one would have to go for eclipse...

if we have:

Code: Select all

<w lemma="" ana="">word</w>

i'd like my plugin to make it possible to:

a) query a web server with the content of w element, i.e. "word" when the user places the caret in the placeholder for the value of the lemma attribute
b) display an autocomplete panel for lemma="" based on the response from the server
c) allow the user to select a value from the autocomplete panel and write it as the value of the given lemma attribute

(there are some additional conditions to be met and a similar kind of autocomplete should be possible for the ana attribute, but that should be trivial, if the above three points can be taken care of)

so, can one do this as an oxygen plugin? it seems oxygen can only react to a text selection... but i am not sure. could one do it in eclipse? how would one go about it?

any general tips and advice would be greatly appreciated.

all best,
toma
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: querying a server from oxygen as a plugin

Post by Radu »

Hi Toma,

I assume you are only interested in doing this for the Text page.

If you want to show these additional values on caret move, there is no means to accomplish this using the standalone Oxygen application. You could probably do this on Eclipse by adding your own plugin which listens for the opened XML editors, tries to find the StyledText from the Oxygen editor and register a caret listener to it (which by the way was added to the StyledText in the latest Eclipse 3.5).

If you want to search and show the custom attribute values on request when "Ctrl-Space" gets called in the attribute value (which is the way in which Oxygen content completion works) this can be done through the Oxygen Author SDK API:
http://www.oxygenxml.com/developer.html ... horing_SDK
In order to do this you usually have to define an external document type association for your XML file types in the Document Type Association preferences page. The document type association contains association rules for your XML documents, document templates, XML catalogs + in the "Extensions" tab you can contribute with a Content completion handler which implements the SchemaManagerFilter class. This class contains a method called:

Code: Select all

 List<CIValue> filterAttributeValues(List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context);
which can be used to propose additional attribute values in a certain context.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ttasovac
Posts: 82
Joined: Fri Dec 19, 2003 6:02 pm

Re: querying a server from oxygen as a plugin

Post by ttasovac »

Thanks, Radu, I will be looking into this.

All best,
Toma
Post Reply