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.FSSTXMethod.FSSTXMethod Class Reference
Inheritance diagram for CMFCore.FSSTXMethod.FSSTXMethod:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.FSSTXMethod.FSSTXMethod:
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 STX Method'
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_DTML_template = DTML_HTML(_DEFAULT_TEMPLATE_DTML)
tuple _default_ZPT_template

Detailed Description

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

Definition at line 80 of file FSSTXMethod.py.


Class Documentation

class CMFCore::FSSTXMethod::FSSTXMethod::func_code

Definition at line 129 of file FSSTXMethod.py.


Member Function Documentation

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

Definition at line 153 of file FSSTXMethod.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 100 of file FSSTXMethod.py.

00100 
00101     def _createZODBClone(self):
00102         """
00103             Create a ZODB (editable) equivalent of this object.
00104         """
00105         if _STX_TEMPLATE == 'DTML':
00106             target = DTMLDocument(_CUSTOMIZED_TEMPLATE_DTML,
00107                                   __name__=self.getId())
00108         elif _STX_TEMPLATE == 'ZPT':
00109             target = ZopePageTemplate(self.getId(), _CUSTOMIZED_TEMPLATE_ZPT)
00110 
00111         target._setProperty('stx', self.raw, 'text')
00112         return target

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

Definition at line 113 of file FSSTXMethod.py.

00113 
00114     def _readFile(self, reparse):
00115         """Read the data from the filesystem.
00116         """
00117         file = open(self._filepath, 'r') # not 'rb', as this is a text file!
00118         try:
00119             data = file.read()
00120         finally:
00121             file.close()
00122         self.raw = data
00123 
00124         if reparse:
00125             self.cook()

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 174 of file FSSTXMethod.py.

00174 
00175     def _render(self, REQUEST={}, RESPONSE=None, **kw):
00176         """ Find the appropriate rendering template and use it to render us.
00177         """
00178         if _STX_TEMPLATE == 'DTML':
00179             default_template = self._default_DTML_template
00180         elif _STX_TEMPLATE == 'ZPT':
00181             default_template = self._default_ZPT_template
00182         else:
00183             raise TypeError('Invalid STX template: %s' % _STX_TEMPLATE)
00184 
00185         template = getattr(self, 'stxmethod_view', default_template)
00186 
00187         if getattr(template, 'isDocTemp', 0):
00188             #posargs = (self, REQUEST, RESPONSE)
00189             posargs = (self, REQUEST)
00190         else:
00191             posargs = ()
00192 
00193         kwargs = {'cooked': self.cook()}
00194         return template(*posargs, **kwargs)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file FSSTXMethod.py.

00144 
00145     def cook(self):
00146         if not hasattr(self, '_v_cooked'):
00147             self._v_cooked = STX_HTML(self.raw, level=1, header=0)
00148         return self._v_cooked

Here is the caller graph for this function:

Fetch our source for rendering in the ZMI.

Definition at line 208 of file FSSTXMethod.py.

00208 
00209     def document_src( self ):
00210         """ Fetch our source for rendering in the ZMI.
00211         """
00212         return self.raw
00213 
00214 InitializeClass(FSSTXMethod)
00215 
00216 registerFileExtension('stx', FSSTXMethod)
00217 registerMetaType('STX Method', FSSTXMethod)
Fetch our source for delivery via FTP.

Definition at line 196 of file FSSTXMethod.py.

00196 
00197     def manage_FTPget(self):
00198         """ Fetch our source for delivery via FTP.
00199         """
00200         return self.raw

Here is the caller graph for this function:

Definition at line 170 of file FSSTXMethod.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 202 of file FSSTXMethod.py.

00202 
00203     def PrincipiaSearchSource(self):
00204         """ Fetch our source for indexing in a catalog.
00205         """
00206         return self.raw


Member Data Documentation

Definition at line 149 of file FSSTXMethod.py.

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

Definition at line 150 of file FSSTXMethod.py.

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

Definition at line 84 of file FSSTXMethod.py.

Definition at line 146 of file FSSTXMethod.py.

Definition at line 142 of file FSSTXMethod.py.

Definition at line 138 of file FSSTXMethod.py.

Definition at line 137 of file FSSTXMethod.py.

Definition at line 140 of file FSSTXMethod.py.

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

Definition at line 95 of file FSSTXMethod.py.

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

Definition at line 86 of file FSSTXMethod.py.

string CMFCore.FSSTXMethod.FSSTXMethod.meta_type = 'Filesystem STX Method' [static]

Definition at line 83 of file FSSTXMethod.py.

Definition at line 121 of file FSSTXMethod.py.

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

Definition at line 91 of file FSSTXMethod.py.


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