[CMF-checkins] CVS: CMF - Document.py:1.21
Jeffrey Shell
jeffrey@digicool.com
Fri, 1 Jun 2001 11:38:55 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault
In directory korak.digicool.com:/home/jeffrey/InstanceHomes/cmf-dev/CMF/CMFDefault
Modified Files:
Document.py
Log Message:
- CMF Document exposes two new accessor methods for getting at the
"cooked" and editable body, 'CookedBody()', and 'EditableBody()'.
Using the 'cooked_text' and 'text' instance attributes should be
considered deprecated.
--- Updated File Document.py in package CMF --
--- Document.py 2001/06/01 15:07:38 1.20
+++ Document.py 2001/06/01 15:38:25 1.21
@@ -316,10 +316,28 @@
return 1
+ ### Content accessor methods
security.declareProtected(CMFCorePermissions.View, 'SearchableText')
def SearchableText(self):
""" Used by the catalog for basic full text indexing """
return "%s %s %s" % (self.title, self.description, self.text)
+
+ security.declareProtected(CMFCorePermissions.View, 'CookedBody')
+ def CookedBody(self):
+ """\
+ The prepared basic rendering of an object. For Documents, this
+ means pre-rendered structured text, or what was between the
+ <BODY> tags of HTML.
+ """
+ return self.cooked_text
+
+ security.declareProtected(CMFCorePermissions.View, 'EditableBody')
+ def EditableBody(self):
+ """\
+ The editable body of text. This is the raw structured text, or
+ in the case of HTML, what was between the <BODY> tags.
+ """
+ return self.text
security.declareProtected(CMFCorePermissions.View, 'Description')
def Description(self):