Back to index

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

List of all members.

Public Member Functions

def __init__
def read_raw
def __call__
def getCacheNamespaceKeys
def setCacheNamespaceKeys
def validate

Public Attributes

 raw

Static Public Attributes

string meta_type = 'Filesystem DTML Method'
tuple manage_options
tuple security = ClassSecurityInfo()
tuple manage_main = Globals.DTMLFile('custdtml', _dtmldir)
 index_html = None
 The following is mainly taken from OFS/DTMLMethod.py ###.
 func_code = DTMLMethod.func_code
string default_content_type = 'text/html'
 manage_FTPget = DTMLMethod.manage_FTPget.im_func
 PrincipiaSearchSource = DTMLMethod.PrincipiaSearchSource.im_func
 document_src = DTMLMethod.document_src.im_func
 manage_haveProxy = DTMLMethod.manage_haveProxy.im_func

Private Member Functions

def _createZODBClone
def _readFile

Private Attributes

 _reading
 _cache_namespace_keys

Static Private Attributes

 _owner = None
tuple _proxy_roles = ()
tuple _cache_namespace_keys = ()
int _reading = 0

Detailed Description

FSDTMLMethods act like DTML methods but are not directly
modifiable from the management interface.

Definition at line 39 of file FSDTMLMethod.py.


Constructor & Destructor Documentation

def CMFCore.FSDTMLMethod.FSDTMLMethod.__init__ (   self,
  id,
  filepath,
  fullname = None,
  properties = None 
)

Definition at line 64 of file FSDTMLMethod.py.

00064 
00065     def __init__(self, id, filepath, fullname=None, properties=None):
00066         FSObject.__init__(self, id, filepath, fullname, properties)
00067         # Normally called via HTML.__init__ but we don't need the rest that
00068         # happens there.
00069         self.initvars(None, {})


Member Function Documentation

def CMFCore.FSDTMLMethod.FSDTMLMethod.__call__ (   self,
  client = None,
  REQUEST = {},
  RESPONSE = None,
  kw 
)
Render the document given a client object, REQUEST mapping,
Response, and key word arguments.

Definition at line 107 of file FSDTMLMethod.py.

00107 
00108     def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
00109         """Render the document given a client object, REQUEST mapping,
00110         Response, and key word arguments."""
00111 
00112         self._updateFromFS()
00113 
00114         kw['document_id']   =self.getId()
00115         kw['document_title']=self.title
00116 
00117         if client is not None:
00118             if _checkConditionalGET(self, kw):
00119                 return ''
00120 
00121         if not self._cache_namespace_keys:
00122             data = self.ZCacheable_get(default=_marker)
00123             if data is not _marker:
00124                 # Return cached results.
00125                 return data
00126 
00127         __traceback_info__ = self._filepath
00128         security=getSecurityManager()
00129         security.addContext(self)
00130         try:
00131             r = Globals.HTML.__call__(self, client, REQUEST, **kw)
00132 
00133             if client is None:
00134                 # Called as subtemplate, so don't need error propagation!
00135                 if RESPONSE is None: result = r
00136                 else: result = decapitate(r, RESPONSE)
00137                 if not self._cache_namespace_keys:
00138                     self.ZCacheable_set(result)
00139                 return result
00140 
00141             if not isinstance(r, basestring) or RESPONSE is None:
00142                 if not self._cache_namespace_keys:
00143                     self.ZCacheable_set(r)
00144                 return r
00145 
00146         finally: security.removeContext(self)
00147 
00148         have_key=RESPONSE.headers.has_key
00149         if not (have_key('content-type') or have_key('Content-Type')):
00150             if self.__dict__.has_key('content_type'):
00151                 c=self.content_type
00152             else:
00153                 c, e=guess_content_type(self.getId(), r)
00154             RESPONSE.setHeader('Content-Type', c)
00155         if RESPONSE is not None:
00156             # caching policy manager hook
00157             _setCacheHeaders(self, {})
00158         result = decapitate(r, RESPONSE)
00159         if not self._cache_namespace_keys:
00160             self.ZCacheable_set(result)
00161         return result

Here is the caller graph for this function:

Create a ZODB (editable) equivalent of this object.

Definition at line 70 of file FSDTMLMethod.py.

00070 
00071     def _createZODBClone(self):
00072         """Create a ZODB (editable) equivalent of this object."""
00073         return DTMLMethod(self.read(), __name__=self.getId())

Here is the caller graph for this function:

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

Definition at line 74 of file FSDTMLMethod.py.

00074 
00075     def _readFile(self, reparse):
00076         """Read the data from the filesystem.
00077         """
00078         file = open(self._filepath, 'r') # not 'rb', as this is a text file!
00079         try:
00080             data = file.read()
00081         finally:
00082             file.close()
00083         self.raw = data
00084 
00085         if reparse:
00086             self._reading = 1  # Avoid infinite recursion
00087             try:
00088                 self.cook()
00089             finally:
00090                 self._reading = 0

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the cacheNamespaceKeys.

Definition at line 162 of file FSDTMLMethod.py.

00162 
00163     def getCacheNamespaceKeys(self):
00164         '''
00165         Returns the cacheNamespaceKeys.
00166         '''
00167         return self._cache_namespace_keys

Definition at line 93 of file FSDTMLMethod.py.

00093 
00094     def read_raw(self):
00095         if not self._reading:
00096             self._updateFromFS()
00097         return Globals.HTML.read_raw(self)

Here is the call graph for this function:

def CMFCore.FSDTMLMethod.FSDTMLMethod.setCacheNamespaceKeys (   self,
  keys,
  REQUEST = None 
)
Sets the list of names that should be looked up in the
namespace to provide a cache key.

Definition at line 168 of file FSDTMLMethod.py.

00168 
00169     def setCacheNamespaceKeys(self, keys, REQUEST=None):
00170         '''
00171         Sets the list of names that should be looked up in the
00172         namespace to provide a cache key.
00173         '''
00174         ks = []
00175         for key in keys:
00176             key = str(key).strip()
00177             if key:
00178                 ks.append(key)
00179         self._cache_namespace_keys = tuple(ks)
00180         if REQUEST is not None:
00181             return self.ZCacheable_manage(self, REQUEST)

Here is the call graph for this function:

def CMFCore.FSDTMLMethod.FSDTMLMethod.validate (   self,
  inst,
  parent,
  name,
  value,
  md = None 
)

Definition at line 183 of file FSDTMLMethod.py.

00183 
00184     def validate(self, inst, parent, name, value, md=None):
00185         return getSecurityManager().validate(inst, parent, name, value)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 48 of file FSDTMLMethod.py.

Definition at line 178 of file FSDTMLMethod.py.

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

Definition at line 46 of file FSDTMLMethod.py.

tuple CMFCore.FSDTMLMethod.FSDTMLMethod._proxy_roles = () [static, private]

Definition at line 47 of file FSDTMLMethod.py.

int CMFCore.FSDTMLMethod.FSDTMLMethod._reading = 0 [static, private]

Definition at line 49 of file FSDTMLMethod.py.

Definition at line 85 of file FSDTMLMethod.py.

Definition at line 105 of file FSDTMLMethod.py.

CMFCore.FSDTMLMethod.FSDTMLMethod.document_src = DTMLMethod.document_src.im_func [static]

Definition at line 193 of file FSDTMLMethod.py.

CMFCore.FSDTMLMethod.FSDTMLMethod.func_code = DTMLMethod.func_code [static]

Definition at line 103 of file FSDTMLMethod.py.

The following is mainly taken from OFS/DTMLMethod.py ###.

Definition at line 100 of file FSDTMLMethod.py.

CMFCore.FSDTMLMethod.FSDTMLMethod.manage_FTPget = DTMLMethod.manage_FTPget.im_func [static]

Definition at line 187 of file FSDTMLMethod.py.

CMFCore.FSDTMLMethod.FSDTMLMethod.manage_haveProxy = DTMLMethod.manage_haveProxy.im_func [static]

Definition at line 196 of file FSDTMLMethod.py.

tuple CMFCore.FSDTMLMethod.FSDTMLMethod.manage_main = Globals.DTMLFile('custdtml', _dtmldir) [static]

Definition at line 62 of file FSDTMLMethod.py.

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

Definition at line 51 of file FSDTMLMethod.py.

string CMFCore.FSDTMLMethod.FSDTMLMethod.meta_type = 'Filesystem DTML Method' [static]

Definition at line 45 of file FSDTMLMethod.py.

CMFCore.FSDTMLMethod.FSDTMLMethod.PrincipiaSearchSource = DTMLMethod.PrincipiaSearchSource.im_func [static]

Definition at line 190 of file FSDTMLMethod.py.

Definition at line 82 of file FSDTMLMethod.py.

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

Definition at line 58 of file FSDTMLMethod.py.


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