interfaces.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 28 Apr 2010 12:15:52 +0200
brancholdstable
changeset 5424 8ecbcbff9777
parent 5421 8167de96c523
child 5556 9ab2b4c74baf
permissions -rw-r--r--
replace logilab-common by CubicWeb in disclaimer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     1
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5309
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
5309
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    18
"""
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    19
Standard interfaces.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
5309
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    21
.. note::
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    22
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    23
  The `implements` selector matches not only entity classes but also
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    24
  their interfaces. Writing __select__ = implements('IGeocodable') is
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
    25
  a perfectly fine thing to do.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    27
__docformat__ = "restructuredtext en"
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    28
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
from logilab.common.interface import Interface
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
class IEmailable(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
    """interface for emailable entities"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    33
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    34
    def get_email(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    35
        """return email address"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
    @classmethod
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    38
    def allowed_massmail_keys(cls):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    39
        """returns a set of allowed email substitution keys
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    40
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
        The default is to return the entity's attribute list but an
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    42
        entity class might override this method to allow extra keys.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
        For instance, the Person class might want to return a `companyname`
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    44
        key.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    45
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    46
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    47
    def as_email_context(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
        """returns the dictionary as used by the sendmail controller to
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    49
        build email bodies.
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    50
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    51
        NOTE: the dictionary keys should match the list returned by the
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
        `allowed_massmail_keys` method.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    53
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    54
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    55
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    56
class IWorkflowable(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    57
    """interface for entities dealing with a specific workflow"""
2920
64322aa83a1d start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2747
diff changeset
    58
    # XXX to be completed, see cw.entities.wfobjs.WorkflowableMixIn
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    59
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    60
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    61
    def state(self):
2920
64322aa83a1d start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2747
diff changeset
    62
        """return current state name"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    63
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    64
    def change_state(self, stateeid, trcomment=None, trcommentformat=None):
2920
64322aa83a1d start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2747
diff changeset
    65
        """change the entity's state to the state of the given name in entity's
64322aa83a1d start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2747
diff changeset
    66
        workflow
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    67
        """
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    68
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    69
    def latest_trinfo(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    70
        """return the latest transition information for this entity
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    71
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    72
2920
64322aa83a1d start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2747
diff changeset
    73
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    74
class IProgress(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    75
    """something that has a cost, a state and a progression
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    76
4023
eae23c40627a drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3635
diff changeset
    77
    Take a look at cubicweb.mixins.ProgressMixIn for some
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    78
    default implementations
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    79
    """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    80
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    82
    def cost(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    83
        """the total cost"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    84
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    86
    def done(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    87
        """what is already done"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    89
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
    def todo(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
        """what remains to be done"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    92
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93
    def progress_info(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
        """returns a dictionary describing progress/estimated cost of the
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
        version.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    96
4936
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
    97
        - mandatory keys are (''estimated', 'done', 'todo')
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
    98
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
    99
        - optional keys are ('notestimated', 'notestimatedcorrected',
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
   100
          'estimatedcorrected')
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
   101
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
   102
        'noestimated' and 'notestimatedcorrected' should default to 0
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
   103
        'estimatedcorrected' should default to 'estimated'
a4b772a0d801 Fixed some of the documentation warnings when building the book with sphinx.
Adrien Chauve <adrien.chauve@logilab.fr>
parents: 4252
diff changeset
   104
        """
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   106
    def finished(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   107
        """returns True if status is finished"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   108
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
    def in_progress(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   110
        """returns True if status is not finished"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   111
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   112
    def progress(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   113
        """returns the % progress of the task item"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   114
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   115
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   116
class IMileStone(IProgress):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   117
    """represents an ITask's item"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   118
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   119
    parent_type = None # specify main task's type
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   120
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   121
    def get_main_task(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   122
        """returns the main ITask entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   123
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   124
    def initial_prevision_date(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   125
        """returns the initial expected end of the milestone"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   126
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
    def eta_date(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   128
        """returns expected date of completion based on what remains
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   129
        to be done
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   130
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   131
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   132
    def completion_date(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   133
        """returns date on which the subtask has been completed"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   134
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   135
    def contractors(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   136
        """returns the list of persons supposed to work on this task"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   137
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   138
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   139
class ITree(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   140
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   141
    def parent(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   142
        """returns the parent entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   143
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   144
    def children(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   145
        """returns the item's children"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   146
2747
4f9ffcd8d5a2 cleanup docstring, add actually used method to the ITree interface
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2135
diff changeset
   147
    def children_rql(self):
4f9ffcd8d5a2 cleanup docstring, add actually used method to the ITree interface
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2135
diff changeset
   148
        """XXX returns RQL to get children"""
4f9ffcd8d5a2 cleanup docstring, add actually used method to the ITree interface
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2135
diff changeset
   149
3635
a56759c3c99f do not override __iter__ on entities
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2920
diff changeset
   150
    def iterchildren(self):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   151
        """iterates over the item's children"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   152
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   153
    def is_leaf(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   154
        """returns true if this node as no child"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   155
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   156
    def is_root(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   157
        """returns true if this node has no parent"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   158
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   159
    def root(self):
2747
4f9ffcd8d5a2 cleanup docstring, add actually used method to the ITree interface
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2135
diff changeset
   160
        """returns the root object"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   161
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   162
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   163
## web specific interfaces ####################################################
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   164
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   165
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   166
class IPrevNext(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   167
    """interface for entities which can be linked to a previous and/or next
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   168
    entity
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   169
    """
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   170
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   171
    def next_entity(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   172
        """return the 'next' entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   173
    def previous_entity(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   174
        """return the 'previous' entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   175
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   176
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   177
class IBreadCrumbs(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   178
    """interface for entities which can be "located" on some path"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   179
5309
e8567135a927 [doc/book] fix docstrings, add notes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 4936
diff changeset
   180
    # XXX fix recurs !
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   181
    def breadcrumbs(self, view, recurs=False):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   182
        """return a list containing some:
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   183
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   184
        * tuple (url, label)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   185
        * entity
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   186
        * simple label string
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   187
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   188
        defining path from a root to the current view
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   189
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   190
        the main view is given as argument so breadcrumbs may vary according
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   191
        to displayed view (may be None). When recursing on a parent entity,
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   192
        the `recurs` argument should be set to True.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   193
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   194
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   195
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   196
class IDownloadable(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   197
    """interface for downloadable entities"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   198
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   199
    def download_url(self): # XXX not really part of this interface
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   200
        """return an url to download entity's content"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   201
    def download_content_type(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   202
        """return MIME type of the downloadable content"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   203
    def download_encoding(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   204
        """return encoding of the downloadable content"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   205
    def download_file_name(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   206
        """return file name of the downloadable content"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   207
    def download_data(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   208
        """return actual data of the downloadable content"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   209
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   210
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   211
class IEmbedable(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   212
    """interface for embedable entities"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   213
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   214
    def embeded_url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   215
        """embed action interface"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   216
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   217
class ICalendarable(Interface):
767
b094cf8535b4 cleanup
sylvain.thenault@logilab.fr
parents: 626
diff changeset
   218
    """interface for items that do have a begin date 'start' and an end date 'stop'
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   219
    """
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   220
2135
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   221
    @property
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   222
    def start(self):
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   223
        """return start date"""
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   224
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   225
    @property
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   226
    def stop(self):
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   227
        """return stop state"""
55fc8b488907 [interfaces] describe more explicitly what should be implemente in the ICalendarable interface
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
   228
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   229
class ICalendarViews(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   230
    """calendar views interface"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   231
    def matching_dates(self, begin, end):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   232
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   233
        :param begin: day considered as begin of the range (`DateTime`)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   234
        :param end: day considered as end of the range (`DateTime`)
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   235
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   236
        :return:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   237
          a list of dates (`DateTime`) in the range [`begin`, `end`] on which
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   238
          this entity apply
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   239
        """
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   240
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   241
class ITimetableViews(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   242
    """timetable views interface"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   243
    def timetable_date(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   244
        """XXX explain
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   245
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   246
        :return: date (`DateTime`)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   247
        """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   248
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   249
class IGeocodable(Interface):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   250
    """interface required by geocoding views such as gmap-view"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   251
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   252
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   253
    def latitude(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   254
        """returns the latitude of the entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   255
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   256
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   257
    def longitude(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   258
        """returns the longitude of the entity"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   259
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   260
    def marker_icon(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   261
        """returns the icon that should be used as the marker
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   262
        (returns None for default)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   263
        """
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   264
125
979dbe0cade3 views with rss feed
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 0
diff changeset
   265
class IFeed(Interface):
979dbe0cade3 views with rss feed
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 0
diff changeset
   266
    """interface for entities with rss flux"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   267
125
979dbe0cade3 views with rss feed
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 0
diff changeset
   268
    def rss_feed_url(self):
979dbe0cade3 views with rss feed
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 0
diff changeset
   269
        """return an url which layout sub-entities item
979dbe0cade3 views with rss feed
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 0
diff changeset
   270
        """
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   271
990
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   272
class ISiocItem(Interface):
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   273
    """interface for entities (which are item
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   274
    in sioc specification) with sioc views"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   275
993
c1ce4c3a7c8f removing useless method for interfaces ISiocItem and ISiocContainer.
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 990
diff changeset
   276
    def isioc_content(self):
990
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   277
        """return content entity"""
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   278
993
c1ce4c3a7c8f removing useless method for interfaces ISiocItem and ISiocContainer.
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 990
diff changeset
   279
    def isioc_container(self):
1199
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   280
        """return container entity"""
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   281
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   282
    def isioc_type(self):
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   283
        """return container type (post, BlogPost, MailMessage)"""
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   284
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   285
    def isioc_replies(self):
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   286
        """return replies items"""
1199
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   287
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   288
    def isioc_topics(self):
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   289
        """return topics items"""
1553
3f91ef2397d0 delete-trailing-whitespaces
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
   290
990
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   291
class ISiocContainer(Interface):
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   292
    """interface for entities (which are container
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   293
    in sioc specification) with sioc views"""
5f1ff5b6907a ISiocItem is an interface that is implemented by 'post' entities (in sioc specification) i.e blogentry, mail ...
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 626
diff changeset
   294
993
c1ce4c3a7c8f removing useless method for interfaces ISiocItem and ISiocContainer.
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 990
diff changeset
   295
    def isioc_type(self):
1199
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   296
        """return container type (forum, Weblog, MailingList)"""
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   297
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   298
    def isioc_items(self):
7fa66717175b fixing isioc_type comment
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 994
diff changeset
   299
        """return contained items"""