!!! Extension Points

A plugin consists of an XML file and a collection of class files (compiled source code).
The XML file specifies, which points in the source code are extended by the classes. 
Also, new points in code can be defined that are extensible. 
We call these points within the code {{ExtensionPoints}}, and we call the classes extending these points {{Extensions}}. 
The structure of the XML file is described in more detail in [plugin.xml|Meaning of pluginxml].

For each {{ExtensionPoint}} there exists an interface, that have to be implemented by the class extending the {{ExtensionPoint}}. 
Then, the {{PluginManager}} provides an array of instances, that define this {{ExtensionPoint}}. 
The array is sorted according to the priority of the extensions. 
The priority is defined in the XML file as well as the name and the description of the extension.

In addition, it is possible to define further attributes for an {{ExtensionPoint}}. 
These attributes have to be included in the XML file of the implementing extensions.

!! Working with Scope

There are only a few Extension Points with a Scope.

! Scope for Types

For the class [Type|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/core/kdom/Type.html] scope defines the father type.

%%prettify {{{
<extension plugin-id="KnowWEExtensionPoints" point-id="Type"
		id="HeaderType">
		<parameter id="class" value="de.knowwe.jspwiki.types.HeaderType" />
		<parameter id="name" value="HeaderType" />
		<parameter id="description" value="Represents a HeaderType in KDOM" />
		<parameter id="version" value="0.2" />
		<parameter id="priority" value="2.1" />
		<parameter id="scope" value="root" />
	</extension>
}}}
/%

%%tags
howto
%