Writing a LanguageScriptProvider UNO Component from scratch

From Apache OpenOffice Wiki
Jump to: navigation, search



To provide support for a new scripting language a new LanguageScriptProvider for that language needs to be created. The new LanguageScriptProvider, an UNO component, must be written in a language from which there is an existing UNO bridge. Details about UNO bridges can be found at UNO C++ Bridges.

The LanguageScriptProvider is an UNO component that provides the environment to execute a macro for a specific language. For example when Apache OpenOffice encounters a Scripting Framework URI (see Scripting Framework URI Specification) the ScriptingFramework finds the appropriate LanguageScriptProvider to execute the script. A LanguageScriptProvider has the following responsibilities:

  • It must support the com.sun.star.script.provider.LanguageScriptProvider service.
  • It is responsible for creating the environment necessary to run a script.
  • It is responsible for implementing the com.sun.star.script.browse.BrowseNode service to allow macros to be organized and browsed.
  • Given a script URI it is responsible for returning a command like object that implements the com.sun.star.script.provider.XScript interface that can execute the macro indicated by the URI.
  • The name of the any LanguageScriptProvider service must be of the form "com.sun.star.script.provider.ScriptProviderFor[Language]", where Language is the language name as it appears in a script URI.
Documentation note.png The name of the LanguageScriptProvider MUST be as above otherwise it will not operate correctly.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages