Back to index

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

List of all members.

Classes

class  func_code

Public Member Functions

def cook
def __call__
def modified
def manage_FTPget
def PrincipiaSearchSource
def document_src

Public Attributes

 raw

Static Public Attributes

string meta_type = 'Filesystem ReST Method'
int report_level = 1
string input_encoding = 'ascii'
string output_encoding = 'utf8'
tuple manage_options
tuple security = ClassSecurityInfo()
tuple manage_main = DTMLFile('custstx', _dtmldir)
tuple func_defaults__roles__ = ()
tuple func_defaults = ()
 index_html = None
string default_content_type = 'text/html'

Private Member Functions

def _createZODBClone
def _readFile
def _render

Private Attributes

 _v_cooked

Static Private Attributes

 _owner = None
tuple _default_template

Detailed Description

A chunk of StructuredText, rendered as a skin method of a CMF site.

Definition at line 68 of file FSReSTMethod.py.


Class Documentation

class CMFCore::FSReSTMethod::FSReSTMethod::func_code

Definition at line 115 of file FSReSTMethod.py.


Member Function Documentation

def CMFCore.FSReSTMethod.FSReSTMethod.__call__ (   self,
  REQUEST = {},
  RESPONSE = None,
  kw 
)
Return our rendered StructuredText.

Definition at line 153 of file FSReSTMethod.py.

00153 
00154     def __call__( self, REQUEST={}, RESPONSE=None, **kw ):
00155         """ Return our rendered StructuredText.
00156         """
00157         self._updateFromFS()
00158 
00159         if RESPONSE is not None:
00160             RESPONSE.setHeader( 'Content-Type', 'text/html' )
00161 
00162         view = _ViewEmulator(self.getId()).__of__(self)
00163         if _checkConditionalGET(view, extra_context={}):
00164             return ''
00165 
00166         _setCacheHeaders(view, extra_context={})
00167 
00168         return self._render(REQUEST, RESPONSE, **kw)

Here is the caller graph for this function:

    Create a ZODB (editable) equivalent of this object.

Definition at line 91 of file FSReSTMethod.py.

00091 
00092     def _createZODBClone(self):
00093         """
00094             Create a ZODB (editable) equivalent of this object.
00095         """
00096         target = ZopePageTemplate(self.getId(), _CUSTOMIZED_TEMPLATE_ZPT)
00097         target._setProperty('rest', self.raw, 'text')
00098         return target

def CMFCore.FSReSTMethod.FSReSTMethod._readFile (   self,
  reparse 
) [private]
Read the data from the filesystem.

Definition at line 99 of file FSReSTMethod.py.

00099 
00100     def _readFile(self, reparse):
00101         """Read the data from the filesystem.
00102         """
00103         file = open(self._filepath, 'r') # not 'rb', as this is a text file!
00104         try:
00105             data = file.read()
00106         finally:
00107             file.close()
00108         self.raw = data
00109 
00110         if reparse:
00111             self.cook()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.FSReSTMethod.FSReSTMethod._render (   self,
  REQUEST = {},
  RESPONSE = None,
  kw 
) [private]
Find the appropriate rendering template and use it to render us.

Definition at line 174 of file FSReSTMethod.py.

00174 
00175     def _render(self, REQUEST={}, RESPONSE=None, **kw):
00176         """ Find the appropriate rendering template and use it to render us.
00177         """
00178         template = getattr(self, 'restmethod_view', self._default_template)
00179 
00180         if getattr(template, 'isDocTemp', 0):
00181             #posargs = (self, REQUEST, RESPONSE)
00182             posargs = (self, REQUEST)
00183         else:
00184             posargs = ()
00185 
00186         kwargs = {'cooked': self.cook()}
00187         return template(*posargs, **kwargs)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 130 of file FSReSTMethod.py.

00130 
00131     def cook(self):
00132         if not hasattr(self, '_v_cooked'):
00133             settings = {
00134                 'halt_level': 6,
00135                 'report_level' : self.report_level,
00136                 'input_encoding': self.input_encoding,
00137                 'output_encoding': self.output_encoding,
00138                 'initial_header_level' : 1,
00139                 'stylesheet' : None,
00140                 'stylesheet_path' : None,
00141                 'pub.settings.warning_stream' :  Warnings(),
00142                 'file_insertion_enabled' : 0,
00143                 'raw_enabled' : 0,
00144                 }
00145 
00146             parts = publish_parts(self.raw, writer=Writer(),
00147                                 settings_overrides=settings)
00148             self._v_cooked = parts['html_body']
00149         return self._v_cooked

Here is the caller graph for this function:

Fetch our source for rendering in the ZMI.

Definition at line 201 of file FSReSTMethod.py.

00201 
00202     def document_src( self ):
00203         """ Fetch our source for rendering in the ZMI.
00204         """
00205         return self.raw
00206 
00207 InitializeClass(FSReSTMethod)
00208 
00209 registerFileExtension('rst', FSReSTMethod)
00210 registerMetaType('ReST Method', FSReSTMethod)
Fetch our source for delivery via FTP.

Definition at line 189 of file FSReSTMethod.py.

00189 
00190     def manage_FTPget(self):
00191         """ Fetch our source for delivery via FTP.
00192         """
00193         return self.raw

Here is the caller graph for this function:

Definition at line 170 of file FSReSTMethod.py.

00170 
00171     def modified(self):
00172         return self.getModTime()

Here is the call graph for this function:

Here is the caller graph for this function:

Fetch our source for indexing in a catalog.

Definition at line 195 of file FSReSTMethod.py.

00195 
00196     def PrincipiaSearchSource(self):
00197         """ Fetch our source for indexing in a catalog.
00198         """
00199         return self.raw


Member Data Documentation

Initial value:
ZopePageTemplate('restmethod_view',
                                         _DEFAULT_TEMPLATE_ZPT, 'text/html')

Definition at line 150 of file FSReSTMethod.py.

CMFCore.FSReSTMethod.FSReSTMethod._owner = None [static, private]

Definition at line 72 of file FSReSTMethod.py.

Definition at line 147 of file FSReSTMethod.py.

Definition at line 128 of file FSReSTMethod.py.

Definition at line 124 of file FSReSTMethod.py.

Definition at line 123 of file FSReSTMethod.py.

Definition at line 126 of file FSReSTMethod.py.

Definition at line 74 of file FSReSTMethod.py.

tuple CMFCore.FSReSTMethod.FSReSTMethod.manage_main = DTMLFile('custstx', _dtmldir) [static]

Definition at line 86 of file FSReSTMethod.py.

Initial value:
({'label' : 'Customize','action' : 'manage_main'},
                    {'label' : 'View','action' : '',
                     'help' : ('OFSP' ,'DTML-DocumentOrMethod_View.stx')},
                   )

Definition at line 77 of file FSReSTMethod.py.

string CMFCore.FSReSTMethod.FSReSTMethod.meta_type = 'Filesystem ReST Method' [static]

Definition at line 71 of file FSReSTMethod.py.

Definition at line 75 of file FSReSTMethod.py.

Definition at line 107 of file FSReSTMethod.py.

Definition at line 73 of file FSReSTMethod.py.

tuple CMFCore.FSReSTMethod.FSReSTMethod.security = ClassSecurityInfo() [static]

Definition at line 82 of file FSReSTMethod.py.


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