gramps/gramps2/doc/extending-gramps/C/extending-gramps/index.html
Don Allingham 0ca0ae439e Initial revision
svn: r1140
2002-10-20 14:25:16 +00:00

345 lines
5.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Writing Extentions for gramps</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="NEXT"
TITLE="Writing Filters"
HREF="x57.html"></HEAD
><BODY
CLASS="ARTICLE"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="ARTICLE"
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
><A
NAME="AEN2">Writing Extentions for gramps</H1
><P
CLASS="COPYRIGHT"
><A
HREF="ln7.html"
>Copyright</A
> &copy; 2001 by Donald N. Allingham</P
><HR
WIDTH="75%"
ALIGN="CENTER"
COLOR="#000000"
SIZE="1"></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="t1.html#intro"
>Introduction</A
></DT
><DT
><A
HREF="x57.html"
>Writing Filters</A
></DT
><DT
><A
HREF="x83.html"
>Writing Reports</A
></DT
><DT
><A
HREF="x131.html"
>Writing Tools</A
></DT
><DT
><A
HREF="x162.html"
>Writing Import Filters</A
></DT
><DT
><A
HREF="x177.html"
>Writing Export Filters</A
></DT
></DL
></DIV
>
<DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="intro">Introduction</H1
>
<P
> <TT
CLASS="APPLICATION"
>gramps</TT
> was intended from the start to
allow the user to extend it through a plugin system. Five types of
plugins are supported - filters, reports, tools, import filters,
and export filters. In a way, an export filter can be viewed as a
special type of report, and an import filter can be viewed as a
special type of tool.
</P
>
<P
> All plugins are written in the <TT
CLASS="APPLICATION"
>python</TT
>
language.
</P
>
<DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="intro-filter">Filters</H2
>
<P
> A filter is a plugin that be used to temporarily display or hide
individuals in the <SPAN
CLASS="INTERFACE"
>People View</SPAN
>. The
filter is the simplest form of plugin, which only needs to
determine if a person meets or fails to meet its criteria. It
operates on a single person at a time.
</P
>
<P
> Filters should never alter a database.
</P
>
</DIV
>
<DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="intro-report">Reports</H2
>
<P
> A report is a plugin that generates output. The output may be in
either a interactive, graphical form, or as an output
file. Report plugins are passed a reference to the internal
database and a reference to the active person, which allows the
plugn to operate on a single person, the entire database, or
anything in between.
</P
>
<P
> Plugins that conform to the reportplugin interface appear in the
+ + + + + + + + + +<B
CLASS="GUIMENU"
>Reports</B
>+
+ + + + + + + +
menu and in the <SPAN
CLASS="INTERFACE"
>Report Selection</SPAN
> dialog
box.
</P
>
<P
> A report should never alter the database.
</P
>
</DIV
>
<DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="intro-tool">Tools</H2
>
<P
> A tool is a plugin that alters the database. It may perform
something as small changing the case of some text to something
as complex as merging redundant individuals. Tools plugins are
passed a reference to the internal database, the active person,
and a callback function. The callback function is used to notify
the main program if it needs to update the display with any
modified information.
</P
>
<P
> Plugins that conform to the tool plugin interface appear in the
+ + + + + + + + + +<B
CLASS="GUIMENU"
>Tools</B
>+
+ + + + + + + +
menu and in the <SPAN
CLASS="INTERFACE"
>Tool Selection</SPAN
> dialog
box.
</P
>
<P
> A tool is allowed (and usually expected) to alter the database.
</P
>
</DIV
>
<DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="intro-import">Import Filters</H2
>
<P
> An import filter is a plugin that adds information from another
source to the database. It is similar to a tool, but is called
differently to allow gramps to distinguish it from a tool.
</P
>
<P
> Plugins that conform to the import filter calling syntax appear
in the
+ + + + + + + + + +<B
CLASS="GUIMENU"
>File</B
>+
+ + + + + + + + + + -&gt;<B
CLASS="GUISUBMENU"
>Import</B
>+
+ + + + + + + +
menu.
</P
>
<P
> An import filter is allowed to modify the database.
</P
>
</DIV
>
<DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="intro-export">Export Filters</H2
>
<P
> An export filter is a plugin that translates the gramps database
into the format expected by another program. Since it generates
an output file, it is similar to a report generator. However,
its calling syntax is different, so that gramps knows how to
distiguish it from a report generator.
</P
>
<P
> Plugins that conform to the export filter calling syntax appear
in the
+ + + + + + + + + +<B
CLASS="GUIMENU"
>File</B
>+
+ + + + + + + + + + -&gt;<B
CLASS="GUISUBMENU"
>Export</B
>+
+ + + + + + + +
menu.
</P
>
<P
> An export filter should not alter the database.
</P
>
</DIV
>
</DIV
>
</DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x57.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Writing Filters</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>