SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Bootstrap Contribution

fileContribution

If your Plugin Project contains Prolog code which should be automatically loaded you can add a fileContribution extension to your plugin.xml.

<extension
  point="org.cs3.prolog.connector.bootstrapContribution">
  <fileContribution
     id="my.plugin.pl.fileContribution"
     path="pl/load.pl"
     key="">
     <dependency
        contribution="org.cs3.pdt.common.fileContribution">
     </dependency>
  </fileContribution>
</extension>
  • id: this can be any unique id
  • path: the path to the file which should be consulted (typically a load file)
  • key (optional): if the key is empty or not defined the prolog code is consulted to every Prolog process. If there is a key, it's only consulted to processes whose subscription contains this key. (see subscriptions)
  • dependency contribution (optional): here you can specify the id of the contribution whose Prolog code must be consulted before consulting the Prolog code of this contribution.

fileSearchPathContribution

If you want to add a path to the Prolog file search path (file_search_path/2) you can do this with a fileSearchPathContribution.

<extension
   point="org.cs3.prolog.connector.bootstrapContribution">
   <fileSearchPathContribution
      id="my.plugin.pl.fileSearchPathContribution"
      alias="my_plugin_pl"
      path="prolog_code/"
      key="">
   </fileSearchPathContribution>
</extension>

This XML code creates the following file search path entry in every process whose subscription contains the key “myplugin.key”:

file_search_path(my_plugin_pl, '$path to plugin$/prolog_code/').
  • id: this can be any unique id
  • alias: the alias which is used for the file_search_path/2 predicate
  • path: path to the folder which contains the Prolog code
  • key (optional): if the key is empty or not defined the file search path entry is added to every Prolog process. If there is a key, it's only added to processes whose subscription contains this key. (see subscriptions)

Example from Prolog console plugin

This is how the bootstrap contribution entry in the Prolog console plugin looks like:

bootstrap contribution entry in the Prolog console plugin

research/pdt/connector/bootstrap_contribution.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019