Back to index

plone3  3.1.7
_base.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 class IBaseObject(Interface):
00004     """ The most basic Archetypes-based implementation
00005     """
00006 
00007     def getId():
00008         """Get the object id
00009         """
00010 
00011     def setId(value):
00012         """Set the object id
00013         """
00014 
00015     def Type():
00016         """Dublin Core element - Object type
00017 
00018         this method is redefined in ExtensibleMetadata but we need this
00019         at the object level (i.e. with or without metadata) to interact
00020         with the uid catalog
00021         """
00022 
00023     def getField(key, wrapped=False):
00024         """Get a field by id
00025         """
00026 
00027     def getWrappedField(key):
00028         """Get a field by id which is explicitly wrapped
00029         """
00030 
00031     def getDefault(field):
00032         """Get default value for a field by id
00033         """
00034 
00035     def isBinary(key):
00036         """Check if an element is binary
00037         """
00038 
00039     def isTransformable(name):
00040         """Returns wether a field is transformable
00041         """
00042 
00043     def widget(field_name, mode="view", field=None, **kwargs):
00044         """Returns the rendered widget
00045         """
00046 
00047     def getContentType(key):
00048         """Content type for a field by key
00049         """
00050 
00051     def setContentType(value):
00052         """Sets the content type of the primary field
00053         """
00054 
00055     def getPrimaryField():
00056         """The primary field is some object that responds to
00057         PUT/manage_FTPget events.
00058         """
00059 
00060     def get_portal_metadata(field):
00061         """Returns the portal_metadata for a field
00062         """
00063 
00064     def Vocabulary(key):
00065         """Vocabulary for a field by key
00066         """
00067 
00068     def setDefaults():
00069         """Set default values for the fields
00070         """
00071 
00072     def update(**kwargs):
00073         """Update all fields and reindexObject
00074         """
00075 
00076     def edit(**kwargs):
00077         """Alias for update(**kwargs*)
00078         """
00079 
00080     def validate_field(name, value, errors):
00081         """Write a method: validate_foo(new_value) -> "error" or None
00082 
00083         If there is a validate method defined for a given field invoke it by name
00084         name -- the name to register errors under
00085         value -- the proposed new value
00086         errors -- dict to record errors in
00087         """
00088 
00089     def pre_validate(REQUEST, errors):
00090         """Pre-validation hook
00091         """
00092 
00093     def post_validate(REQUEST, errors):
00094         """Post-validation hook
00095         """
00096 
00097     def validate(REQUEST, errors):
00098         """Validate fields
00099         """
00100 
00101     def SearchableText():
00102         """Full indexable text
00103         """
00104 
00105     def getCharset():
00106         """ Return site default charset, or utf-8
00107         """
00108 
00109     def get_size():
00110         """Used for FTP and apparently the ZMI now too
00111         """
00112 
00113     def processForm(data=1, metadata=0, REQUEST=None, values=None):
00114         """Process the schema looking for data in the form
00115         """
00116 
00117     def Schemata():
00118         """Returns the Schemata for the Object
00119         """
00120 
00121     def Schema():
00122         """Returns the full schema for the object.  NOTE: This method is
00123         usually added dynamically by ClassGen.
00124         """
00125 
00126     def addSubObjects(objects, REQUEST=None):
00127         """Add a dictionary of objects to the session
00128         """
00129 
00130     def getSubObject(name, REQUEST, RESPONSE=None):
00131         """Get a dictionary of objects from the session
00132         """
00133 
00134 class IBaseContent(IBaseObject):
00135     """Contentish base interface marker
00136 
00137     BaseContent is subclassing the following classes, too:
00138 
00139     Products.Archetypes.Referenceable.Referenceable
00140     Products.Archetypes.CatalogMultiplex.CatalogMultiplex
00141     Products.CMFCore.PortalContent.PortalContent
00142     OFS.History.Historicall
00143     """
00144 
00145 
00146 class IBaseFolder(IBaseObject):
00147     """Folderish base interface marker
00148 
00149     BaseFolder is subclassing the following classes, too:
00150 
00151     Products.CMFDefault.SkinnedFolder.SkinnedFolder
00152     OFS.Folder.Folder
00153     """
00154 
00155     def listFolderContents(contentFilter=None, suppressHiddenFiles=0):
00156         """
00157         Optionally you can suppress 'hidden' files, or files that begin with '.'
00158         """
00159 
00160     def folderlistingFolderContents(contentFilter=None, suppressHiddenFiles=0 ):
00161         """
00162         Calls listFolderContents in protected only by ACI so that folder_listing
00163         can work without the List folder contents permission, as in CMFDefault
00164         """
00165 
00166 class IBaseUnit(Interface):
00167     """
00168     """
00169 
00170     def update(data, instance, **kw):
00171         """
00172         """
00173 
00174     def transform(instance, mt):
00175         """Takes a mimetype so object.foo.transform('text/plain') should return
00176         a plain text version of the raw content
00177 
00178         return None if no data or if data is untranformable to desired output
00179         mime type
00180         """
00181 
00182     def isBinary():
00183         """return true if this contains a binary value, else false"""
00184 
00185     def get_size():
00186         """
00187         """
00188 
00189     def getRaw(encoding=None, instance=None):
00190         """Return encoded raw value
00191         """
00192 
00193     def portalEncoding(instance):
00194         """Return the default portal encoding, using an external python script
00195         (look the archetypes skin directory for the default implementation)
00196         """
00197 
00198     def getContentType():
00199         """Return the imimetype object for this BU
00200         """
00201 
00202     def setContentType(instance, value):
00203         """
00204         """
00205 
00206     def content_type():
00207         """
00208         """
00209 
00210     def getFilename():
00211         """
00212         """
00213 
00214     def setFilename(filename):
00215         """
00216         """
00217 
00218     def index_html(REQUEST, RESPONSE):
00219         """download method
00220         """