NAME

        Biomoby::Article


SYNOPSIS

        this class should not be instancied.


DESCRIPTION

        It's an interface for primary and secondary article in biomoby.


AUTHORS

 Sebastien.Carrere@toulouse.inra.fr 
 Sebastien.Letort@toulouse.inra.fr


METHODS

Function _Init

        Title      :    _Init
        Usage      :    $article_son->SUPER::_Init( $name, $type, $descr );
        Prerequiste:    none
        Function   :    Initialize name, type and descr attributes.
        Returns    :    the changed object
        Args       :    $name,  the name of the article
                        $type,  the type of the article, must belong to allowed value defined by Enum object
                        $descr, the description of the article
        Error      :    none
        Globals    :    none

Function CheckType

        Title      :    CheckType
        Usage      :    $article->CheckType()
        Prerequiste:    The class must have declared a list of allowed value
        Function   :    check that the type attribute is in alloawed_value
        Returns    :    1 if succed, 0 otherwise
        Args       :    none
        Error      :    none
        Globals    :    none

Function ToString

        Title      :    ToString
        Usage      :    $article->ToString
        Prerequiste:    none
        Function   :    return the object as a string, for debug purpose
        Returns    :    a string containing all attributes
        Args       :    none
        Error      :    none
        Globals    :    none

Procedure SetCmd

        Title      :    SetCmd
        Usage      :    $art->SetCmd( $cmd )
        Prerequiste:    none
        Procedure  :    set the cmd attribute _format in the mobyle xml
        Args       :    $cmd,   the command that represent the article
        Error      :    none
        Globals    :    none

Procedure SetFilename

        Title      :    SetFilename
        Usage      :    $art->SetFilename( $filename )
        Prerequiste:    none
        Procedure  :    set the filename attribute
        Args       :    $filename,      the name of the file
        Error      :    none
        Globals    :    none
        Note       :    I'd like paramsfile and filenames to be mutually exclusive


NAME

        Biomoby::ArticlesCollection


SYNOPSIS

        my $collec = New Biomoby::ArticlesCollection();
        $collec->Add( New Biomoby::PrimArticle( @params1 ) );
        $collec->Add( New Biomoby::PrimArticle( @params2 ) );
        my @a_ids = $collec->GetIds();
        my $o_article = $collec->GetById(2);
        my $o_article = $collec->GetByName( 'lolo' );
        print $collect->ToString();


DESCRIPTION

        This class managed a group of articles.
        It provides method to add article, to retrieve one by its name or its id.

Function New

        Title      :    New
        Usage      :    New Biomoby::ArticlesCollection( $class_name );
        Prerequiste:    Nowaday the only obligation for the class is to provide :
                                - attribut 'name'
                                - method 'ToString'
                        Maybe later we'll check that $class_name belong to @Article::INC
        Function   :    constructor of a collection of articles,
                        if a class name is passed, the collection will be homogene
        Returns    :    an object Biomoby::ArticlesCollection
        Args       :    $class_name,    the name of a class that inherite from Article
        Error      :    none
        Globals    :    none
        Note       :    Nowaday the only obligation for the class is to provide :
                                - attribut 'name'
                                - method 'ToString'

Procedure Add

        Title      :    Add
        Usage      :    $collec->Add( $o_article );
        Prerequiste:    $o_article must be an $self->{class} object
        Procedure  :    Add an article into the collection, give it an id
        Args       :    $o_article,     an object belonging to $self->{class} class
        Error      :    none
        Globals    :    none

Function GetById

        Title      :    GetById
        Usage      :    $o_article = $collec->GetById( $id )
        Prerequiste:    none
        Function   :    accessor to an identified article
        Returns    :    an object Biomoby::Article
        Args       :    $id,    the id of the article (given by GetIds)
        Error      :    none
        Globals    :    none

Function GetByName

        Title      :    GetByName
        Usage      :    $o_article = $collec->GetByName( $name )
        Prerequiste:    none
        Function   :    accessor to an identified article
        Returns    :    an object Biomoby::Article
        Args       :    $name,  the name of the article
        Error      :    none
        Globals    :    none

Function GetIds

        Title      :    GetIds
        Usage      :    my @a_ids = $collec->GetIds();
        Prerequiste:    none
        Function   :    accessor to the ids of articles
        Returns    :    an array of ids
        Args       :    none
        Error      :    none
        Globals    :    none

Function ToString

        Title      :    ToString
        Usage      :    $string = $collec->ToString();
        Prerequiste:    none
        Function   :    transform the object into a string
        Returns    :    a string
        Args       :    none
        Error      :    none
        Globals    :    none

Function GetFilenames

        Title      :    GetFilenames
        Usage      :    @a_filenames = $collec->GetFilenames();
        Prerequiste:    none
        Function   :    give a list of filenames involved into this collection
        Returns    :    an array of string
        Args       :    none
        Error      :    none
        Globals    :    none