Difference between revisions of "plugins"

From GeneWeb
Jump to navigation Jump to search
m (màj)
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:GeneWeb plugins}}
 
{{DISPLAYTITLE:GeneWeb plugins}}
{{languages|manual}}
+
{{languages|plugins}}
__NOTOC__
+
{{toc right}}
== Plugins ==
+
GeneWeb offers a '''plugin mechanism''' since its version 7.1 that allows functional extensions without impacting the core operation of the system.
GeneWeb version 7.1 offers a plugin mechanism allowing functional extensions without impacting the core operation of the system.
 
  
Developers should explore existing plugins to infer the overall mechanism, but it should be noted that such development requires a good understanding of both the OCaml language and GeneWeb itself.
+
Plugins are loaded by [[gwd|{{c|gwd}}]] at launch time through the parameter {{c|-plugins}} (or {{c|-unsafe_plugins}}) pointing to the location of the plugins.
Developers will find plugins in the {{c|plugins}} folder of the GitHub repository.
+
<!-- can there be several plugins locations?? to be verified -->
In the plugins folder, each plugin is in a sub_folder names {{c|pl_name_plugin}}.
 
The command {{c|make distrib}} will compile those plugins and install then in a {{c|distribution/plugin}} folder.
 
Ressources (templates, images, lexicon entries) associated with each plugin are located in an {{c|assets}} sub folder.
 
  
Plugins are loaded by {{c|gwd}} at launch time through the parameter {{c|-plugins}} (or {{c|-unsafe_plugins}}) pointing to the location of the plugins.
+
In addition, the [[configuration|{{c|.gwf}} parameters file]] must specify all the plugins to activate at launch through a single line where {{c|plugin#}} is the name of the desired plugin:
<!-- can there be several plugins locations?? to be verified -->
+
plugins=plugin1,plugin2,plugin3
  
In addition, the user must specify in his {{c|.gwf}} parameter file those plugins he wants activated through a line such as:
+
== Geneweb plugins ==
plugins=pl1,pl2,pl3
+
=== api ===
where {{c|pli}} is the name of the desired plugin.
+
{}
 +
=== base64
 +
{}
  
==Existing plugins==
+
=== carrousel (WIP) ===
===Carrousel===
+
Implements a carrousel display function for multiple images associated with a person. Provides the functions to upload and manage these images.
  
===Cgl===
+
=== cgl ===
 
The {{c|cgl}} plugin is an example of plugin whose function is limited to a post processing of the data produced by GeneWeb, removing in this data stream all occurrences of {{c|href}}.
 
The {{c|cgl}} plugin is an example of plugin whose function is limited to a post processing of the data produced by GeneWeb, removing in this data stream all occurrences of {{c|href}}.
 
This plugin supersedes the {{c|1=cgl=on}} command one can add to the URL to ask for suppression of href links.
 
This plugin supersedes the {{c|1=cgl=on}} command one can add to the URL to ask for suppression of href links.
  
===Export===
+
=== easy_format ===
 +
{…}
 +
 
 +
=== export ===
 +
Exports to {{c|.GED}} or {{c|.gw}} format the content of a base.
 +
Invoqued through a {{c|1=m=EXPORT}} command with the following parameters:
 +
*{{c|1=output=GED/GW}} select export format
 +
*{{c|1=spouses=on/off}}
 +
*{{c|1=parents=on/off}}
 +
*{{c|1=children=on/off}}
 +
*{{c|1=notes=/nn/nnn}}
 +
*{{c|1=sources=on/off}}
 +
*{{c|1=isolated=on/off}}
 +
*{{c|1=pictures=on/off}}
 +
*{{c|1=isolated=on/off}}
 +
 
 +
{…}
 +
 
 +
=== forum ===
 +
Isolate in a plugin the forum functions.
 +
 
 +
=== gen ===
 +
{…}
 +
 
 +
=== gwxjg ===
 +
{…}
 +
 
 +
=== jingoo ===
 +
{…}
  
===Fanchart===
+
=== no_index ===
 +
Implements the {{c|1=opt=no_index}} parameter in the URL. Replaces non stable instances of {{c|1=i=index}} by their stable values {{c|1=p=first_name;n=surname;oc=occ}}.
  
===Forum===
+
=== piqi ===
 +
{…}
  
===No index===
+
=== sedlex ===
 +
{…}
  
===V7===
+
=== v7 ===
 
The v7 plugin regroups in a single place the traditional V7 behavior of GeneWeb (over time a V8 plugin may offer a new set of templates).
 
The v7 plugin regroups in a single place the traditional V7 behavior of GeneWeb (over time a V8 plugin may offer a new set of templates).
 
All GUI related informations that were located in the {{c|hd}} repository folder are now located in {{c|plugins/v7/assets}}.
 
All GUI related informations that were located in the {{c|hd}} repository folder are now located in {{c|plugins/v7/assets}}.
  
 
Several {{c|.ml}} files (cousins, date, descend, interp, perso, place, some, sosa, srcfile, templ) implement slight (or significant) variations from the core GeneWeb behavior.
 
Several {{c|.ml}} files (cousins, date, descend, interp, perso, place, some, sosa, srcfile, templ) implement slight (or significant) variations from the core GeneWeb behavior.
 +
The following new commands are implemented in this plugin:
 +
*{{c|1=m=A;t=FC}} displays ancestry of a person in fan-chart format.
 +
*{{c|1=m=C;v1=x;v2=y}} computes number of “cousins” x levels up and y level down and draws a table of existing kinships.
 +
*{{c|1=m=D}} prints descendants lists or tables using v7 template interpretor.
 +
*{{c|1=m=DOC}} operates as {{c|1=m=SRC}} with additional {{c|.html}} and {{c|.pdf}} formats. Allows files to be stored in sub-folders
 +
*{{c|1=m=L}} prints a list of persons (used with the {{c|1=m=PS}} command below).
 +
*{{c|1=m=P}} prints the list of persons with a given first_name, with additional options.
 +
*{{c|1=m=PS}} prints the list of surnames associated with a place for a given set of events (birth, baptism, marriage, death, burial).
  
===V7 images===
+
=== v7_im ===
 +
Isolates in a plugin the image manipulations functions.
  
===Welcome===
+
{…}
 +
 
 +
=== welcome (WIP) ===
 +
This plugin inverts the order of the two data entry lines for the search of the welcome page, and proposes some additional behaviors during this search.
 +
 
 +
=== xhtml ===
 +
{…}
 +
 
 +
=== xmlm ===
 +
{…}
 +
 
 +
 
 +
== Development of plugins ==
 +
Developers should explore existing plugins to infer the overall mechanism, but it should be noted that such development requires a good understanding of both the OCaml language and GeneWeb itself.
 +
 
 +
Developers will find plugins in the {{c|plugins}} folder of the GitHub repository.
 +
In the plugins folder, each plugin is in a subfolder named {{c|pl_name_plugin}}.
 +
The command {{c|make distrib}} will compile those plugins and install then in a {{c|distribution/plugin}} folder.
  
===Xhtml===
+
Associated ressources with each plugins, such as templates, images, lexicon entries, are located in an {{c|assets}} subfolder.

Revision as of 12:36, 23 September 2021

150px-Geographylogo svg.png Language:   English • français

GeneWeb offers a plugin mechanism since its version 7.1 that allows functional extensions without impacting the core operation of the system.

Plugins are loaded by gwd at launch time through the parameter -plugins (or -unsafe_plugins) pointing to the location of the plugins.

In addition, the .gwf parameters file must specify all the plugins to activate at launch through a single line where plugin# is the name of the desired plugin:

plugins=plugin1,plugin2,plugin3

Geneweb plugins

api

{…} === base64 {…}

carrousel (WIP)

Implements a carrousel display function for multiple images associated with a person. Provides the functions to upload and manage these images.

cgl

The cgl plugin is an example of plugin whose function is limited to a post processing of the data produced by GeneWeb, removing in this data stream all occurrences of href. This plugin supersedes the cgl=on command one can add to the URL to ask for suppression of href links.

easy_format

{…}

export

Exports to .GED or .gw format the content of a base. Invoqued through a m=EXPORT command with the following parameters:

  • output=GED/GW select export format
  • spouses=on/off
  • parents=on/off
  • children=on/off
  • notes=/nn/nnn
  • sources=on/off
  • isolated=on/off
  • pictures=on/off
  • isolated=on/off

{…}

forum

Isolate in a plugin the forum functions.

gen

{…}

gwxjg

{…}

jingoo

{…}

no_index

Implements the opt=no_index parameter in the URL. Replaces non stable instances of i=index by their stable values p=first_name;n=surname;oc=occ.

piqi

{…}

sedlex

{…}

v7

The v7 plugin regroups in a single place the traditional V7 behavior of GeneWeb (over time a V8 plugin may offer a new set of templates). All GUI related informations that were located in the hd repository folder are now located in plugins/v7/assets.

Several .ml files (cousins, date, descend, interp, perso, place, some, sosa, srcfile, templ) implement slight (or significant) variations from the core GeneWeb behavior. The following new commands are implemented in this plugin:

  • m=A;t=FC displays ancestry of a person in fan-chart format.
  • m=C;v1=x;v2=y computes number of “cousins” x levels up and y level down and draws a table of existing kinships.
  • m=D prints descendants lists or tables using v7 template interpretor.
  • m=DOC operates as m=SRC with additional .html and .pdf formats. Allows files to be stored in sub-folders
  • m=L prints a list of persons (used with the m=PS command below).
  • m=P prints the list of persons with a given first_name, with additional options.
  • m=PS prints the list of surnames associated with a place for a given set of events (birth, baptism, marriage, death, burial).

v7_im

Isolates in a plugin the image manipulations functions.

{…}

welcome (WIP)

This plugin inverts the order of the two data entry lines for the search of the welcome page, and proposes some additional behaviors during this search.

xhtml

{…}

xmlm

{…}


Development of plugins

Developers should explore existing plugins to infer the overall mechanism, but it should be noted that such development requires a good understanding of both the OCaml language and GeneWeb itself.

Developers will find plugins in the plugins folder of the GitHub repository. In the plugins folder, each plugin is in a subfolder named pl_name_plugin. The command make distrib will compile those plugins and install then in a distribution/plugin folder.

Associated ressources with each plugins, such as templates, images, lexicon entries, are located in an assets subfolder.