Skip to Content.
Sympa Menu

devel - Re: [sympa-dev] categorisation / code design

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Olivier Salaun - CRU <address@concealed>
  • To: Mark Valiukas <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-dev] categorisation / code design
  • Date: Fri, 20 Feb 2004 09:11:06 +0100

Mark Valiukas wrote:
What user interface do you imagine to allow moderators to choose a category ?
[...]
email-based: a whole lot of ugly mailto links for "distribute this, but stick it in such-and-such category". [...]
Then you'll have to extend the number of arguments for the DISTRIBUTE mail command.
[...]
another approach would be to make the author explicitely tell what category the message in related to ; maybe it is too constraining for authors.
We have enough trouble convincing some people that they need to log in to read their messages when they're off-campus -
getting them to include a "category code" in the subject line is a battle that we could not win.
Ok.

Dealing with list config parameter, we'd suggest a parameter organized as a paragraph for each category :
category
name linux
keywords red hat,linux,debian
description About Linux operating system

This parameter would be defined as follows in the %List::pinfo hash (title_id entries are incorrect) :
        'category' => {'format' => {'name' => {'format' => '\w+'
                                                                     'length' =>15,
                                                                     'occurrence' => '1',
                                                                     'title_id' => 58,
                                                                     'order' => 1
                                                                     },
                                                   'keywords' => {'format' => '[^,]+', # Everything BUT a ','
                                                                            'occurrence' => '1-n', # May have multiple keywords for one category
                                                                            'split_char' => ',',
                                                                            'title_id' => 59,
                                                                            'order' =>2
                                                                           },
                                                    'title' => {'format' => '.+',
                                                                    'length' => 35,
                                                                    'title_id' => 60,
                                                                    'order' => 3
                                                                   }
                                            },
                     'occurrence' => '0-n', # May define multiple categories for one list
                     'title_id' => 57,
                     'group' => 'data_source' # Defines in which admin web page this parameter will appear
                },
Once you've added this to the %List::pinfo hash, Sympa will be able to load, edit and save this parameter. You'll access it in the code as follows :
my $list = new List 'blabla';
foreach my $category (@{$list->{'admin'}{'category'}) {
    my $keywords = join ',', @{$category->{'keywords'}};
    &do_log('notice', 'Category %s : keywords=%s ; title=%s', $category->{'name'}, $keywords, $category->{'title'};
}

-- 
Olivier Salaun
Comite Reseau des Universites



Archive powered by MHonArc 2.6.19+.

Top of Page