Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Triquetrum/CapeCode

< Triquetrum
Revision as of 17:00, 31 January 2017 by Unnamed Poltroon (Talk) (Created page with "== CapeCode == '''This intro to be corrected/extended by Christoper or someone else with real knowledge on CapeCode.''' ''[https://chess.eecs.berkeley.edu/capecode/ CapeCode]...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

CapeCode

This intro to be corrected/extended by Christoper or someone else with real knowledge on CapeCode.

CapeCode is a project of the UC Berkeley CHESS group, who are also the originators of Ptolemy II. CapeCode is related to the domain of IoT, implementing assemblies of accessors to interact with connected devices in a well-defined way, reusing formal concepts from Ptolemy II's actor system.

Supporting CapeCode actors in Triquetrum's editor

As in other cases where we want to extend Triquetrum with extra actors, adding CapeCode actors consists of 2 main actions :

  • providing the actor implementations in a way that is accessible by the editor and execution runtime
  • defining editor palette contributions for them

The CapeCode actors that we consider here are JSAccessor actors, whose concrete behaviour is implemented in JavaScript. Adding CapeCode actors in a Triquetrum installation then requires at least the following :

  • having the JSAccessor implementation (+dependencies) in the Triquetrum platform and being able to locate and load the JavaScript files that define the actor implementations. This is tricky business, especially when we want to remain compatible with native (non-OSGi) Ptolemy II approaches to load files from its class path.
  • being able to read actor library definitions from CapeCode hosts and files and to add them to the editor palette. Ideally this should work without needing to restart the editor for each change in the CapeCode configuration.

In the text below we'll describe an approach to support CapeCode contributions to the editor palette.

Loading palette contributions via OSGi services

The traditional approach to define the graphical editor's palette is via extensions in the plugin.xml files of one or more palette configuration bundles.

This fits well with standard Eclipse practices but has some disadvantages as well, such as :

  • Palette contents must be known & defined upfront,
  • by someone able to develop Eclipse plugins,
  • that must be built and then installed in the (RCP) application,
  • which even requires a restart to activate the changes/additions.

But this approach does not fit the requirements for CapeCode where actor library configurations are managed in JSON files, hosted on remote locations. We don't want to replicate such configurations in plugin.xml files, nor having to go through complete development/build/install cycles to add or maintain CapeCode libraries.

Back to the top