next up previous contents index
Next: 20. List configuration parameters Up: Sympa Mailing Lists Management Software version Previous: 18. List creation, edition and removal   Contents   Index

Subsections


19. Lists Families

A list can have from three parameters to many tens of them. Some listmasters need to create a set of lists that have the same profile. In order to simplify the apprehension of these parameters, list families define a lists typology. Families provide a new level for defaults : in the past, defaults in Sympa were global and most sites using Sympa needed multiple defaults for different group of lists. Moreover families allow listmaster to delegate a part of configuration list to owners, in a controlled way according to family properties. Distribution will provide defaults families.


19.1 Family concept

A family provides a model for all of its lists. It is specified by the following characteristics :

Here is a list of operation performed on a family :


19.2 Using family

19.2.1 Definition

Families can be defined at the robot level, at the site level or on the distribution level (where default families are provided). So, you have to create a sub directory named after the family's name in a families directory :

Examples:

/home/sympa/etc/families/my_family
/home/sympa/etc/my_robot/families/my_family
In this directory you must provide these files :


19.2.1.1 config.tt2

This is a list creation template, this file is mandatory. It provides default values for parameters. This file is an almost complete list configuration, with a number of missing fields (such as owner e-mail) to be replaced by data obtained at the time of family instantiation. It is easy to create new list templates by modifying existing ones. See 17.8, page [*] and 16.1, page [*].

Example:

subject [% subject %]

status [% status %]

[% IF topic %]
topics [% topic %]

[% END %]
visibility noconceal

send privateoreditorkey

web_archive
  access public

subscribe open_notify

shared_doc
  d_edit [% shared_edit %]
  d_read [% shared_read %]

lang [% language %]

[% FOREACH o = owner %]
owner
  email [% o.email %]
  profile privileged
  [% IF o.gecos %] 
  gecos [% o.gecos %]
  [% END %]

[% END %]
[% IF moderator %]
   [% FOREACH m = moderator %]
editor
  email [% m.email %]

   [% END %]
[% END %]
 
[% IF sql %]
include_sql_query
  db_type [% sql.type %]
  host [% sql.host %]
  user [% sql.user %]
  passwd [% sql.pwd %]
  db_name [% sql.name %]
  sql_query [% sql.query %]
    
[% END %]
ttl 360


19.2.1.2 param_constraint.conf

This file is obligatory. It defines constraints on parameters. There are three kind of constraints : The parameters constraints will be checked at every list loading.

WARNING : Some parameters cannot be constrained, they are : msg_topic.keywords (see 20.4.13, page [*]),owner_include.source_parameter (see 20.1.6, page [*]), editor_include.source_parameter (see 20.1.2, page [*]). About digest parameter (see 20.4.9, page [*]) , just days can be constrained.

Example:

lang                fr,us			
archive.period      days,week,month	
visibility          conceal,noconceal	
shared_doc.d_read   public		
shared_doc.d_edit   editor

19.2.1.3 edit_list.conf

This is an optional file. It defines which parameters/files are editable by owners. See 18.4.4, page [*]. If the family does not have this file, Sympa will look for the one defined on robot level, server site level or distribution level. (This file already exists without family context)
Notes that by default parameter family_name is not writable, you should not change this edition right.

19.2.1.4 customizable files

Families provides a new level of customization for scenarios (see 13, page [*]), templates for service messages (see 16.2, page [*]) and templates for web pages (see 16.3 , page [*]). Sympa looks for these files in the following level order: list, family, robot, server site or distribution.


19.2.2 Instantiation

Instantiation permits to generate lists.You must provide an XML file that is composed of lists description, the root element is family and is only composed of list elements. List elements are described in section 18.1.2, page [*]. Each list is described by the set of values for affectation list parameters.

Here is an sample command to instantiate a family :

sympa.pl --instantiate\_family my_family --robot \samplerobot --input\_file /path/to/my\_file.xml
This means lists that belong to family my_family will be created under the robot my_robot and these lists are described in the file my_file.xml. Sympa will split this file into several xml files describing lists. Each list XML file is put in each list directory.

Example:

<?xml version="1.0" ?>
<family>
  <list>
    <listname>liste1</listname>
    <subject>a list example</subject>
    <description/>
    <status>open</status>
    <shared_edit>editor</shared_edit>
    <shared_read>private</shared_read>
    <language>fr</language>
    <owner multiple="1"> 
      <email>serge.aumont@cru.fr</email> 
      <gecos>C.R.U.</gecos>
    </owner>
    <owner multiple="1"> 
      <email>olivier.salaun@cru.fr</email>
    </owner>
    <owner_include multiple="1">
      <source>my_file</source>
    </owner_include>
    <sql> 
      <type>oracle</type>
      <host>sqlserv.admin.univ-x.fr</host>
      <user>stdutilisateur</user>
      <pwd>monsecret</pwd>
      <name>les_etudiants</name>
      <query>SELECT DISTINCT email FROM etudiant</query>
    </sql>
  </list>
  <list>
    <listname>liste2</listname>
    <subject>a list example</subject>
    <description/>
    <status>open</status>
    <shared_edit>editor</shared_edit>
    <shared_read>private</shared_read>
    <language>fr</language>
    <owner multiple="1"> 
      <email>serge.aumont@cru.fr</email> 
      <gecos>C.R.U.</gecos>
    </owner>
    <owner multiple="1"> 
      <email>olivier.salaun@cru.fr</email>
    </owner>
    <owner_include multiple="1">
      <source>my_file</source>
    </owner_include>
    <sql> 
      <type>oracle</type>
      <host>sqlserv.admin.univ-x.fr</host>
      <user>stdutilisateur</user>
      <pwd>monsecret</pwd>
      <name>les_etudiants</name>
      <query>SELECT DISTINCT email FROM etudiant</query>
    </sql>
  </list>
   ...
</family>

Each instantiation describes lists. Compared to the previous instantiation, there are three cases :

After list creation or modification, parameters constraints are checked :

diagram

In case of modification (see diagram), allowed customizations can be preserved :

Notes :

19.2.3 Modification

To modify a family, you have to edit family files manually. The modification will be effective while the next instanciation.
WARNING: The family modification must be done just before an instantiation. If it is not, alive lists wouldn't respect new family properties and they would be set in status error_config immediately.

19.2.4 Closure

Closes every list (installed under the indicated robot) of this family : lists status are set to family_closed, aliases are removed and subscribers are removed from DB. (a dump is created in the list directory to allow restoration of the list).

Here is a sample command to close a family :

 sympa.pl --close_family my_family --robot \samplerobot

19.2.5 Adding one list

Adds a list to the family without instantiate all the family. The list is created as if it was created during an instantiation, under the indicated robot. The XML file describes the list and the root element is <list>. List elements are described in section 18.3, page [*].

Here is a sample command to add a list to a family :

 sympa.pl --add\_list my\_family --robot \samplerobot  --input\_file /path/to/my\_file.xml

19.2.6 Removing one list

Closes the list installed under the indicated robot : the list status is set to family_closed, aliases are removed and subscribers are removed from DB. (a dump is created in the list directory to allow restoring the list).

Here is a sample command to close a list family (same as an orphan list) :

 sympa.pl --close_list my_list@\samplerobot


19.2.7 Modifying one list

Modifies a family list without instantiating the whole family. The list (installed under the indicated robot) is modified as if it was modified during an instantiation. The XML file describes the list and the root element is <list>. List elements are described in section 18.3, page [*].

Here is a sample command to modify a list to a family :

 sympa.pl --modify\_list my\_family --robot \samplerobot --input\_file /path/to/my\_file.xml


19.2.8 List parameters edition in a family context

According to file edit_list.conf, edition rights are controlled. See 18.4.4, page [*]. But in a family context, constraints parameters are added to edition right as it is summarized in this array :

array

Note : In order to preserve list customization for instantiation, every modified parameter (via the Web interface) is noted in the config_changes file.


next up previous contents index
Next: 20. List configuration parameters Up: Sympa Mailing Lists Management Software version Previous: 18. List creation, edition and removal   Contents   Index
root 2006-04-12