source: trunk/doc/src/docbook/admindoc/plugin_installation.xml @ 3246

Last change on this file since 3246 was 3246, checked in by Martin Svensson, 15 years ago

The output files of docbook will be sorted into subdirectories and figures now has a relative uri

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC
3    "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
4    "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd">
5<!--
6  $Id: plugin_installation.xml 3246 2007-04-16 14:12:23Z martin $
7
8  Copyright (C) Authors contributing to this file.
9
10  This file is part of BASE - BioArray Software Environment.
11  Available at http://base.thep.lu.se/
12
13  BASE is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License
15  as published by the Free Software Foundation; either version 2
16  of the License, or (at your option) any later version.
17
18  BASE is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  GNU General Public License for more details.
22
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 59 Temple Place - Suite 330,
26  Boston, MA  02111-1307, USA.
27-->
28
29<chapter id="plugin_installation">
30  <?dbhtml dir="plugin_installation"?>
31  <title id="plugin_installation.title">Installing plugins</title>
32
33 
34 
35  <para>
36    Then, to install the plugin log in a an administrator and go to the
37    <menuchoice>
38      <guimenu>Administrate</guimenu>
39      <guisubmenu>Plugins</guisubmenu>
40      <guimenuitem>Definitions</guimenuitem>
41    </menuchoice>
42    page. Click the
43    <guibutton>New</guibutton>
44    button and enter the class name and the path to the JAR file in the form that opens in the
45    popup window.
46  </para>
47
48  <screenshot>
49    <mediaobject>
50      <imageobject>
51        <imagedata align="right" fileref="figures/install_plugin.png" format="PNG"/>
52      </imageobject>
53      <textobject>
54        <phrase>How to install a plugin</phrase>
55      </textobject>
56    </mediaobject>
57  </screenshot>
58
59  <para>
60    When you click save, the Base class loader will load the specified JAR file and class and
61    check that it implements the
62    <interfacename>Plugin</interfacename>
63    interface. Then, it creates an instance of that class, calls
64    <methodname>Plugin.getAbout()</methodname>
65    and
66    <methodname>Plugin.getMainType()</methodname>
67    . If it is an
68    <interfacename>InteractivePlugin</interfacename>
69    it will also call
70    <methodname>InteractivePlugin.getGuiContexts()</methodname>
71    . This information is stored in the database.
72  </para>
73
74  <para>
75    The installation will do one more thing. It will check which other interfaces the plugin
76    implements and check against the list of registered
77    <classname>PluginType</classname>
78    s. The
79    <classname>PluginType</classname>
80    system has not really been put into use yet. The core defines the
81    <interfacename>AutoDetectingImporter</interfacename>
82    which can be used for all import plugins that supports automatic detection of file formats.
83    Read more about this in the
84    <xref linkend="plugin_developer.import"/>
85    chapter.
86  </para>
87
88  <para>
89    Now the administrator may continue by creating a new configuration for the plugin (assuming
90    that is an
91    <interfacename>InteractivePlugin</interfacename>
92    ). When the administrator starts the configuration sequence the following will happen:
93  </para>
94
95  <itemizedlist>
96    <listitem>
97      <simpara>The core creates a new instance of the plugin.</simpara>
98    </listitem>
99    <listitem>
100      <simpara>
101        Call the
102        <methodname>Plugin.init</methodname>
103        () method.
104      </simpara>
105    </listitem>
106    <listitem>
107      <simpara>
108        Call the
109        <methodname>InteractivePlugin.getRequestInformation()</methodname>
110        method, with
111        <varname>command</varname>
112        <literal>=</literal>
113        <constant>Request.COMMAND_CONFIGURE_PLUGIN</constant>
114        and a null
115        <classname>GuiContext</classname>
116        .
117      </simpara>
118    </listitem>
119    <listitem>
120      <simpara>Display the list of parameters and let the user enter values.</simpara>
121    </listitem>
122    <listitem>
123      <simpara>
124        Call
125        <methodname>InteractivePlugin.configure()</methodname>
126        .
127      </simpara>
128    </listitem>
129    <listitem>
130      <simpara>
131        If the plugin wants more parameters the above two steps are repeated but with the
132        command returned in the response. Note! Be careful so you don't create infinite
133        loops.
134      </simpara>
135    </listitem>
136    <listitem>
137      <simpara>
138        If the plugin reports that it is done,
139        <methodsynopsis>
140          <methodname>done</methodname>
141          <void/>
142        </methodsynopsis>
143        <methodname>Plugin.done()</methodname>
144        is called and the plugin instance is discarded.
145      </simpara>
146    </listitem>
147  </itemizedlist>
148
149  <para>
150    The steps for creating a new job follows the same procedure except that the first command is
151    <classname>Request.</classname>
152    <constant>COMMAND_CONFIGURE_JOB</constant>
153    and the
154    <classname>GuiContext</classname>
155    isn't null.
156  </para>
157
158</chapter>
Note: See TracBrowser for help on using the repository browser.