You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

OdysseusScript

OdysseusScript is a language that allows to run (sequences of) queries in different query languages like Continuous Query Language (CQL) or Procedural Query Language (PQL) and to configure the system (Details see Odysseus Script). One aspect is the use of constants in variables. For example, the constant varible ${now} is always available with explicit definition with #DEFINE.

Additing own constant variables

Odysseus allows to implement additional constant variables. For this, the developer has to implement the interface IReplacementProvider from the bundle de.uniol.inf.is.odysseus.script.parser. The implementation has to be provided as a service, then. The interface is as follows:

public interface IReplacementProvider {
	public Collection<String> getReplacementKeys();
	public String getReplacementValue( String replacementKey );	
}

The method getReplacementKeys() has to return a collection of keys which the provider has to offer. This will be called before a OdysseusScript-File is executed (so the list of available keys can change during run-time, if needed). The second method getReplacementValue() finally has to return the value for the given key. It is expected that since the provider provides the key, a value non-null is retured. If the second method return null, OdysseusScript uses an empty string (""). The method is called each time the key is used inside one OdysseusScript file.

  • No labels