Back to index

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

List of all members.

Public Member Functions

def __init__
def createReply
def getReplyLocationAndID
def getReplyResults
def getReplies
def quotedContents

Public Attributes

 content

Static Public Attributes

tuple security = ClassSecurityInfo()

Static Private Attributes

 __implements__ = z2IOldstyleDiscussable

Detailed Description

    Adapter for PortalContent to implement "old-style" discussions.

Definition at line 43 of file DiscussionTool.py.


Constructor & Destructor Documentation

def CMFCore.DiscussionTool.OldDiscussable.__init__ (   self,
  content 
)

Definition at line 54 of file DiscussionTool.py.

00054 
00055     def __init__( self, content ):
00056         self.content = content


Member Function Documentation

def CMFCore.DiscussionTool.OldDiscussable.createReply (   self,
  title,
  text,
  REQUEST,
  RESPONSE 
)
    Create a reply in the proper place

Definition at line 58 of file DiscussionTool.py.

00058 
00059     def createReply(self, title, text, REQUEST, RESPONSE):
00060         """
00061             Create a reply in the proper place
00062         """
00063 
00064         location, id = self.getReplyLocationAndID(REQUEST)
00065         location.addDiscussionItem(id, title, title, 'structured-text',
00066                                    text, self.content)
00067 
00068         RESPONSE.redirect( self.absolute_url() + '/view' )

Here is the call graph for this function:

    Return a sequence of the DiscussionResponse objects which are
    associated with this Discussable

Definition at line 101 of file DiscussionTool.py.

00101 
00102     def getReplies(self):
00103         """
00104             Return a sequence of the DiscussionResponse objects which are
00105             associated with this Discussable
00106         """
00107         catalog = getToolByName(self.content, 'portal_catalog')
00108         results = self.getReplyResults()
00109         rids    = map(lambda x: x.data_record_id_, results)
00110         objects = map(catalog.getobject, rids)
00111         return objects

Here is the call graph for this function:

Definition at line 69 of file DiscussionTool.py.

00069 
00070     def getReplyLocationAndID(self, REQUEST):
00071         # It is not yet clear to me what the correct location for this hook is
00072 
00073         # Find the folder designated for replies, creating if missing
00074         membershiptool = getToolByName(self.content, 'portal_membership')
00075         home = membershiptool.getHomeFolder()
00076         if not hasattr(home, 'Correspondence'):
00077             home.manage_addPortalFolder('Correspondence')
00078         location = home.Correspondence
00079         location.manage_permission(View, ['Anonymous'], 1)
00080         location.manage_permission(AccessContentsInformation, ['Anonymous'], 1)
00081 
00082         # Find an unused id in location
00083         id = int(DateTime().timeTime())
00084         while hasattr(location, `id`):
00085             id = id + 1
00086 
00087         return location, `id`

Here is the call graph for this function:

Here is the caller graph for this function:

    Return the ZCatalog results that represent this object's replies.

    Often, the actual objects are not needed.  This is less expensive
    than fetching the objects.

Definition at line 89 of file DiscussionTool.py.

00089 
00090     def getReplyResults(self):
00091         """
00092             Return the ZCatalog results that represent this object's replies.
00093 
00094             Often, the actual objects are not needed.  This is less expensive
00095             than fetching the objects.
00096         """
00097         catalog = getToolByName(self.content, 'portal_catalog')
00098         return catalog.searchResults(in_reply_to=
00099                                       urllib.unquote('/'+self.absolute_url(1)))

Here is the call graph for this function:

Here is the caller graph for this function:

    Return this object's contents in a form suitable for inclusion
    as a quote in a response.

Definition at line 112 of file DiscussionTool.py.

00112 
00113     def quotedContents(self):
00114         """
00115             Return this object's contents in a form suitable for inclusion
00116             as a quote in a response.
00117         """
00118 
00119         return ""
00120 


Member Data Documentation

CMFCore.DiscussionTool.OldDiscussable.__implements__ = z2IOldstyleDiscussable [static, private]

Definition at line 50 of file DiscussionTool.py.

Definition at line 55 of file DiscussionTool.py.

tuple CMFCore.DiscussionTool.OldDiscussable.security = ClassSecurityInfo() [static]

Definition at line 52 of file DiscussionTool.py.


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