SDA SE Wiki

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

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:pdt:connector:bootstrap_contribution [2012/11/11 15:00]
andreas.becker
research:pdt:connector:bootstrap_contribution [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== 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.
 +<Code lang-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>​
 +</​Code>​
 +
 +  * **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 [[..:​contribute:​cookbook:​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 ([[http://​www.swi-prolog.org/​pldoc/​doc_for?​object=file_search_path/​2|file_search_path/​2]]) you can do this with a fileSearchPathContribution.
 +
 +<Code lang-xml>​
 +<​extension
 +   ​point="​org.cs3.prolog.connector.bootstrapContribution">​
 +   <​fileSearchPathContribution
 +      id="​my.plugin.pl.fileSearchPathContribution"​
 +      alias="​my_plugin_pl"​
 +      path="​prolog_code/"​
 +      key="">​
 +   </​fileSearchPathContribution>​
 +</​extension>​
 +</​Code>​
 +
 +This XML code creates the following file search path entry in every process whose [[..:​contribute:​cookbook:​subscriptions|subscription]] contains the key "​myplugin.key":​
 +
 +<Code lang-prolog>​file_search_path(my_plugin_pl,​ '$path to plugin$/​prolog_code/'​).</​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 [[..:​contribute:​cookbook:​subscriptions]])
 +
 +===== Example from Prolog console plugin =====
 +
 +This is how the bootstrap contribution entry in the Prolog console plugin looks like:
 +
 +{{:​research:​pdt:​contribute:​cookbook:​bootstrap_contribution.png|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