Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
CMFDefault.DiscussionTool.DiscussionTool Class Reference
Inheritance diagram for CMFDefault.DiscussionTool.DiscussionTool:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.DiscussionTool.DiscussionTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def overrideDiscussionFor
def getDiscussionFor
def isDiscussionAllowedFor

Static Public Attributes

string id = 'portal_discussion'
string meta_type = 'Default Discussion Tool'
tuple security = ClassSecurityInfo()
tuple manage_options
tuple manage_overview = DTMLFile( 'explainDiscussionTool', _dtmldir )

Private Member Functions

def _createDiscussionFor

Static Private Attributes

tuple __implements__ = (z2IDiscussionTool, )

Detailed Description

Links content to discussions.

Definition at line 45 of file DiscussionTool.py.


Member Function Documentation

def CMFDefault.DiscussionTool.DiscussionTool._createDiscussionFor (   self,
  content 
) [private]
Create DiscussionItemContainer for content, if allowed.

Definition at line 122 of file DiscussionTool.py.

00122 
00123     def _createDiscussionFor( self, content ):
00124         """ Create DiscussionItemContainer for content, if allowed.
00125         """
00126         if not self.isDiscussionAllowedFor( content ):
00127             raise DiscussionNotAllowed
00128 
00129         content.talkback = DiscussionItemContainer()
00130         return content.talkback
00131 
00132 InitializeClass( DiscussionTool )
00133 registerToolInterface('portal_discussion', IDiscussionTool)

Here is the call graph for this function:

Here is the caller graph for this function:

Get DiscussionItemContainer for content, create it if necessary.

Definition at line 92 of file DiscussionTool.py.

00092 
00093     def getDiscussionFor(self, content):
00094         """ Get DiscussionItemContainer for content, create it if necessary.
00095         """
00096         if not self.isDiscussionAllowedFor( content ):
00097             raise DiscussionNotAllowed
00098 
00099         if not IDiscussionResponse.providedBy(content) and \
00100                 not z2IDiscussionResponse.isImplementedBy(content) and \
00101                 getattr( aq_base(content), 'talkback', None ) is None:
00102             # Discussion Items use the DiscussionItemContainer object of the
00103             # related content item, so only create one for other content items
00104             self._createDiscussionFor(content)
00105 
00106         return content.talkback # Return wrapped talkback

Here is the call graph for this function:

Get boolean indicating whether discussion is allowed for content.

Definition at line 108 of file DiscussionTool.py.

00108 
00109     def isDiscussionAllowedFor( self, content ):
00110         """ Get boolean indicating whether discussion is allowed for content.
00111         """
00112         if hasattr( aq_base(content), 'allow_discussion' ):
00113             return bool(content.allow_discussion)
00114         typeInfo = content.getTypeInfo()
00115         if typeInfo:
00116             return bool( typeInfo.allowDiscussion() )
00117         return False

Here is the caller graph for this function:

def CMFDefault.DiscussionTool.DiscussionTool.overrideDiscussionFor (   self,
  content,
  allowDiscussion 
)
Override discussability for the given object or clear the setting.

Definition at line 74 of file DiscussionTool.py.

00074 
00075     def overrideDiscussionFor(self, content, allowDiscussion):
00076         """ Override discussability for the given object or clear the setting.
00077         """
00078         if not _checkPermission(ModifyPortalContent, content):
00079             raise AccessControl_Unauthorized
00080 
00081         if allowDiscussion is None or allowDiscussion == 'None':
00082             disc_flag = getattr(aq_base(content), 'allow_discussion', _marker)
00083             if disc_flag is not _marker:
00084                 try:
00085                     del content.allow_discussion
00086                 except AttributeError:
00087                     # https://bugs.launchpad.net/zope-cmf/+bug/162532
00088                     pass
00089         else:
00090             content.allow_discussion = bool(allowDiscussion)

Here is the call graph for this function:


Member Data Documentation

tuple CMFDefault.DiscussionTool.DiscussionTool.__implements__ = (z2IDiscussionTool, ) [static, private]

Definition at line 51 of file DiscussionTool.py.

string CMFDefault.DiscussionTool.DiscussionTool.id = 'portal_discussion' [static]

Definition at line 53 of file DiscussionTool.py.

Initial value:
( ({'label': 'Overview',
                         'action': 'manage_overview'},)
                     + SimpleItem.manage_options
                     )

Definition at line 58 of file DiscussionTool.py.

tuple CMFDefault.DiscussionTool.DiscussionTool.manage_overview = DTMLFile( 'explainDiscussionTool', _dtmldir ) [static]

Definition at line 67 of file DiscussionTool.py.

string CMFDefault.DiscussionTool.DiscussionTool.meta_type = 'Default Discussion Tool' [static]

Definition at line 54 of file DiscussionTool.py.

tuple CMFDefault.DiscussionTool.DiscussionTool.security = ClassSecurityInfo() [static]

Definition at line 56 of file DiscussionTool.py.


The documentation for this class was generated from the following file: