Back to index

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

List of all members.

Public Member Functions

def __init__
def __of__

Static Public Attributes

string meta_type = 'Filesystem Z SQL Method'
tuple manage_options
tuple security = ClassSecurityInfo()
 manage = None
tuple manage_customise = Globals.DTMLFile('custzsql', _dtmldir)

Private Member Functions

def _createZODBClone
def _readFile

Detailed Description

FSZSQLMethods act like Z SQL Methods but are not directly
modifiable from the management interface.

Definition at line 35 of file FSZSQLMethod.py.


Constructor & Destructor Documentation

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

Definition at line 60 of file FSZSQLMethod.py.

00060 
00061     def __init__(self, id, filepath, fullname=None, properties=None):
00062         FSObject.__init__(self, id, filepath, fullname, properties)


Member Function Documentation

def CMFCore.FSZSQLMethod.FSZSQLMethod.__of__ (   self,
  parent 
)

Definition at line 138 of file FSZSQLMethod.py.

00138 
00139         def __of__(self, parent):
00140             try:
00141                 self = ImplicitAcquisitionWrapper(self, parent)
00142                 self._updateFromFS()
00143                 return self
00144             except:
00145                 logger.exception("Error during __of__")
00146                 raise
00147 
00148 Globals.InitializeClass(FSZSQLMethod)
00149 
00150 registerFileExtension('zsql', FSZSQLMethod)
00151 registerMetaType('Z SQL Method', FSZSQLMethod)

Here is the call graph for this function:

Create a ZODB (editable) equivalent of this object.

Definition at line 63 of file FSZSQLMethod.py.

00063 
00064     def _createZODBClone(self):
00065         """Create a ZODB (editable) equivalent of this object."""
00066         # I guess it's bad to 'reach inside' ourselves like this,
00067         # but Z SQL Methods don't have accessor methdods ;-)
00068         s = SQL(self.id,
00069                 self.title,
00070                 self.connection_id,
00071                 self.arguments_src,
00072                 self.src)
00073         s.manage_advanced(self.max_rows_,
00074                           self.max_cache_,
00075                           self.cache_time_,
00076                           self.class_name_,
00077                           self.class_file_,
00078                           connection_hook=self.connection_hook,
00079                           direct=self.allow_simple_one_argument_traversal)
00080         return s

Here is the call graph for this function:

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

Definition at line 81 of file FSZSQLMethod.py.

00081 
00082     def _readFile(self, reparse):
00083         """Read the data from the filesystem.
00084         """
00085         file = open(self._filepath, 'r') # not 'rb', as this is a text file!
00086         try:
00087             data = file.read()
00088         finally:
00089             file.close()
00090 
00091         # parse parameters
00092         parameters={}
00093         start = data.find('<dtml-comment>')
00094         end   = data.find('</dtml-comment>')
00095         if start==-1 or end==-1 or start>end:
00096             raise ValueError,'Could not find parameter block'
00097         block = data[start+14:end]
00098 
00099         for line in block.split('\n'):
00100             pair = line.split(':',1)
00101             if len(pair)!=2:
00102                 continue
00103             parameters[pair[0].strip().lower()]=pair[1].strip()
00104 
00105         # check for required parameters
00106         try:
00107             connection_id =   ( parameters.get('connection id', '') or
00108                                 parameters['connection_id'] )
00109         except KeyError,e:
00110             raise ValueError("The '%s' parameter is required "
00111                              "but was not supplied" % e)
00112 
00113         # Optional parameters
00114         title =           parameters.get('title','')
00115         arguments =       parameters.get('arguments','')
00116         max_rows =        parameters.get('max_rows',1000)
00117         max_cache =       parameters.get('max_cache',100)
00118         cache_time =      parameters.get('cache_time',0)
00119         class_name =      parameters.get('class_name','')
00120         class_file =      parameters.get('class_file','')
00121         connection_hook = parameters.get('connection_hook',None)
00122         direct = parameters.get('allow_simple_one_argument_traversal', None)
00123 
00124         self.manage_edit(title, connection_id, arguments, template=data)
00125 
00126         self.manage_advanced(max_rows,
00127                              max_cache,
00128                              cache_time,
00129                              class_name,
00130                              class_file,
00131                              connection_hook=connection_hook,
00132                              direct=direct)
00133 
00134         # do we need to do anything on reparse?
00135 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 55 of file FSZSQLMethod.py.

tuple CMFCore.FSZSQLMethod.FSZSQLMethod.manage_customise = Globals.DTMLFile('custzsql', _dtmldir) [static]

Definition at line 58 of file FSZSQLMethod.py.

Initial value:
({'label':'Customize', 'action':'manage_customise'},
                      {'label':'Test', 'action':'manage_testForm',
                       'help':('ZSQLMethods','Z-SQL-Method_Test.stx')},
                     )

Definition at line 42 of file FSZSQLMethod.py.

string CMFCore.FSZSQLMethod.FSZSQLMethod.meta_type = 'Filesystem Z SQL Method' [static]

Definition at line 40 of file FSZSQLMethod.py.

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

Definition at line 47 of file FSZSQLMethod.py.


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