Commit f4910674 authored by Michel Pelletier's avatar Michel Pelletier

parent 63649a97
......@@ -85,6 +85,32 @@
def manage_addExternalMethod(self, id, title, module, function):
"""
Add an external method to an ObjectManager.
In addition to the standard object-creation arguments,
'id' and title, the following arguments are defined:
function -- The name of the python function. This can be a
an ordinary Python function, or a bound method.
module -- The name of the file containing the function
definition.
The module normally resides in the 'Extensions'
directory, however, the file name may have a prefix of
'product.', indicating that it should be found in a product
directory.
For example, if the module is: 'ACMEWidgets.foo', then an
attempt will first be made to use the file
'lib/python/Products/ACMEWidgets/Extensions/foo.py'. If this
failes, then the file 'Extensions/ACMEWidgets.foo.py' will be
used.
"""
class ExternalMethod:
"""
......
......@@ -83,6 +83,15 @@
#
##############################################################################
def manage_addMailHost(self, id, title='', smtp_host=None,
localhost='localhost', smtp_port=25,
timeout=1.0):
"""
Add a mailhost object to an ObjectManager.
"""
class MailHost:
"""
......
......@@ -83,6 +83,16 @@
#
##############################################################################
def manage_addFile(self,id,file='',title='',precondition='', content_type=''):
"""
Add a new File object.
Creates a new File object 'id' with the contents of 'file'
"""
class File:
"""
A File is a Zope object that contains file content. A File object
......
......@@ -83,6 +83,17 @@
#
##############################################################################
def manage_addImage(self, id, file, title='', precondition='', content_type=''):
"""
Add a new Image object.
Creates a new Image object 'id' with the contents of 'file'.
"""
class Image:
"""
A Image is a Zope object that contains image content. A Image
......
......@@ -197,8 +197,7 @@ class ObjectManagerItem:
If an object is not found then the 'default' argument will be
returned.
Permission -- XXX
Permission -- Python only
"""
def restrictedTraverse(self, path, default=None):
......@@ -210,7 +209,7 @@ class ObjectManagerItem:
If an object is not found then the 'default' argument will be
returned.
Permission -- XXX
Permission -- Python only
"""
......
......@@ -98,7 +98,7 @@ class PropertyManager:
Return the value of the property 'id'. If the property is not
found the optional second argument or None is returned.
Permission -- XXX None XXX
Permission -- Access contents information
"""
def getPropertyType(self, id):
......@@ -106,7 +106,7 @@ class PropertyManager:
Get the type of property 'id'. Returns None if no such
property exists.
Permission -- XXX None XXX
Permission -- Access contents information
"""
def hasProperty(self, id):
......@@ -143,13 +143,15 @@ class PropertyManager:
Returns a tuple of mappings, giving meta-data for properties.
The meta-data includes 'id', 'type', and 'mode'.
Permission -- XXX None XXX
Permission -- Access contents information
"""
def propdict(self):
"""
Returns the properties as a mapping from property id to
property value.
## Removed for now at brian's request
##
## def propdict(self):
## """
## Returns the properties as a mapping from property id to
## property value.
Permission -- XXX None XXX
"""
## Permission --
## """
......@@ -102,7 +102,7 @@ class PropertySheet:
there is no default namespace for a given property sheet
(especially property sheets added in ZClass definitions).
Permission -- XXX
Permission -- Python only
"""
......@@ -112,7 +112,7 @@ class PropertySheet:
Get the property 'id', returning the optional second
argument or None if no such property is found.
Permission -- XXX
Permission -- Python only
"""
......@@ -122,7 +122,7 @@ class PropertySheet:
Get the type of property 'id'. Returns None if no such
property exists.
Permission -- XXX
Permission -- Python only
"""
......@@ -168,7 +168,7 @@ class PropertySheet:
Returns a tuple of mappings, giving meta-data for properties.
Perimssion -- XXX
Perimssion -- Python only
"""
......@@ -177,7 +177,7 @@ class PropertySheet:
Returns a mapping containing property meta-data.
Permission -- XXX
Permission -- Python only
"""
......@@ -188,12 +188,37 @@ class PropertySheet:
Property Types
XXX
'boolean' -- 1 or 0.
'date' -- A 'DateTime' value, for example '12/31/1999 15:42:52 PST'.
'float' -- A decimal number, for example '12.4'.
'int' -- An integer number, for example, '12'.
'lines' -- A list of strings, one per line.
'long' -- A long integer, for example '12232322322323232323423'.
'string' -- A string of characters, for example 'This is a string'.
'text' -- A multi-line string, for example a paragraph.
'tokens' -- A list of strings separated by white space, for example
'one two three'.
'selection' -- A string selected by a pop-up menu.
'multiple selection' -- A list of strings selected by a selection list.
This method will use the passed in 'type' to try to convert
the 'value' argument to the named type. If the given 'value'
cannot be converted, a ValueError will be raised.
The value given for 'selection' and 'multiple selection'
properites must be a variable name. The variable must also be
a sequence.
*If the given 'type' is not recognized, the 'value' and 'type'
given are simply stored blindly by the object. This seems like
bad behavior - it should probably raise an exception instead.*
......
......@@ -110,7 +110,7 @@ class PropertySheets:
Return a sequence of all of the PropertySheet objects for
in the collection.
Permission - XXX
Permission - Python only
"""
......@@ -120,7 +120,7 @@ class PropertySheets:
Return a sequence containing an '(id, object)' tuple for
each PropertySheet object in the collection.
Permission - XXX
Permission - Python only
"""
......@@ -130,15 +130,7 @@ class PropertySheets:
Return the PropertySheet identified by 'name', or the value
given in 'default' if the named PropertySheet is not found.
Permission - XXX
Permission - Python only
"""
......@@ -118,12 +118,9 @@ class Vocabulary:
"""
def manage_addVocabulary(self, id, title, globbing=None, REQUEST=None):
"""
Add a Vocabulary object to an ObjectManager.
"""
......@@ -188,3 +188,14 @@ class ZCatalog:
"""
Search the catalog, the same way as 'searchResults'.
"""
def manage_addZCatalog(self, id, title, vocab_id=None):
"""
Add a ZCatalog object.
'vocab_id' is the name of a Vocabulary object this catalog should
use. A value of None will cause the Catalog to create its own
private vocabulary.
"""
......@@ -83,6 +83,24 @@
#
##############################################################################
def manage_addZSQLMethod(self, id, title,
connection_id, arguments, template):
"""
Add an SQL Method to an ObjectManager.
The 'connection_id' argument is the id of a database connection
that resides in the current folder or in a folder above the
current folder. The database should understand SQL.
The 'arguments' argument is a string containing an arguments
specification, as would be given in the SQL method cration form.
The 'template' argument is a string containing the source for the
SQL Template.
"""
class ZSQLMethod:
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment