Tricia Help
Last edited Nov 8, 2011
Tags: no tags assigned  

Class Plugin

in package de.infoasset.platform.services

Declaration
public abstract class Plugin
extends AbstractPlugin
Hierarchy
java.lang.Object
  extendsde.infoasset.platform.util.AbstractInitializable
      extendsde.infoasset.platform.services.AbstractPlugin
          extendsde.infoasset.platform.services.Plugin
All Implemented Interfaces
  • de.infoasset.imf.blackbox.Configurable
  • de.infoasset.imf.blackbox.Initializable
  • de.infoasset.imf.blackbox.PostInitializable
Known Direct Subclasses
See ModularityDoc before reading this article.

Plugins

Tricia is built in a modular way, and can be extended by the means of plugins.

Technically speaking, a Tricia plugin is an Eclipse project. By a convention, the name of the plugin folder should be equals the name of the Eclipse plugin.

A plugin uses and extends functionality from other plugins. Plugins form a depends relationship, which is expressed through the Eclipse project dependency. The following picture shows the dependency graph of some existing Tricia core plugins.

The basic Tricia plugin is called tricia and defines the basic infrastructure used by all plugins.

Code and Style Plugins

There are two different kinds of plugins: code plugins and style plugins. As the name implies, code plugins define behavior, whereas style plugins merely define look and feel.

The following class diagram shows the Java classes, which realize the plugin concept.

For each code plugin, there is a specific subclass of Plugin, which defines all extensions specified by the plugin (see Extension). This class has to be implemented as a singleton.

Plugin Structure

All Tricia plugins are organized the same way. This enables the use of conventions, also known as convention over configuration. This document gives a list of these conventions.

The following conventions apply to both style and code plugins:

  • There is an Eclipse project description for all Tricia plugins, so plugins can be easily imported into the Eclipse IDE. The Eclipse project name is the same as the folder name.
  • Templates (see Template) are at /templates. At the next level, there are themes (see ThemesDoc).
The following conventions apply to code plugins:
  • The Java code files start at /src/classes.
  • Java code is in the package de.infoasset.%PLUGIN_NAME%.*
  • The main plugin singleton is defined in a class de.infoasset.%PLUGIN_NAME%.%PLUGIN_NAME_IN_CAMEL_CASE%Plugin.java . The file plugin as shown in the dependency graph above has a singleton class specified in de.infoasset.file.FilePlugin
  • External libraries are at /lib. If available, there should be the source could too, and it should be linked in the Eclipse project.
  • All Handler of a project are in the package de.infoasset.%PLUGIN_NAME%.handler
  • All Assets of a project are in the package de.infoasset.%PLUGIN_NAME%.assets
  • The configuration files are in the folder /config (see RunTriciaDoc).

Creating a new Plugin

There exist two Ant targets in the build.xml of the core plugin for creating new plugins from a template:
  • clone emptyPlugin creates a new code plugin,
  • clone emptyStyle creates a new style plugin.

Further Reading

Plugins have impact on the following topics:

Inner Class Summary

static class Plugin.ExtensionAndName

Field Summary

protected List
defaultThemeNames

Constructor Summary

Plugin()

Field Detail

defaultThemeNames

protected List defaultThemeNames

Constructor Detail

Plugin

public Plugin()

Method Detail

getExtensions

public List getExtensions(Class clazz)

getExtensionsAndNames

public List getExtensionsAndNames(Class clazz)

getExistingConfigFile

public File getExistingConfigFile(String name)

getName

public String getName()

getPluginName

public static String getPluginName(Class clazz)

getInstance

public static Plugin getInstance(Class clazz)

initPluginAfterInitData

public void initPluginAfterInitData()

getI18Status

public PluginI18Status getI18Status()

toString

public String toString()

0 Comments