One can override the following variables :
LOG_LEVEL : The log level, from 0 to 5.
LOG_NONE = 0 => No log output LOG_CRITICAL = 1 => Critical problems (data consistency, module integrity, ...) LOG_ERROR = 2 => Error (runtime exceptions, ...) LOG_WARNING = 3 => Warning (non-blocking exceptions, ...) LOG_NOTICE = 4 => Notices (Special conditions, ...) LOG_DEBUG = 5 => Debug (Debugging information)
LOG_PROCESSOR : A dictionnary holding, for each key, the data processor.
FormatStack(stack) => string
Return a 'loggable' version of the stack trace
Log.FormatStack
Log(level, *args, **kw) => Pretty-prints data on the console with additional information. Use a STACK_OFFSET paramter to lower the stack depth
Log.Log
LogException () => None
Print an exception information on the console
Log.LogException
LogFile : writes data to the LOG_OUTPUT file.
Log.LogFile
LogzLog : writes data though Zope's logging facility
Log.LogzLog
ZAttachmentAttribute product
ZAbstractAttachment => abstract class that must be derived to handle attachments of a particular type. When deriving, ensure to call the __init__ method so that class will be instanciated properly. Then you must register your derived class using ZAttachmentRegistry facility.
CODING INFORMATION : If you create additional methods or properties in ZAbstractAttachment that must be derived for the class to work, put them in the __must_derive__ tuple so that they will be checked at class registration. This will ensure better coding quality.
Please note that ZAbstractAttachment-dervied objects are instanciated every time a file is uploaded. So you're guaranteed that the indexed file won't change during the class's lifetime.
You can store additional files inside a ZAA with the addRelatedFile() method. If you want to get it back, use getRelatedFile() with the file's identifier.
ZAbstractAttachment.ZAbstractAttachment
Methods: (SearchableText, __init__, addRelatedFile, callConverter, clearRelatedFiles, deleteAttachmentFile, getAttachmentFileDir, getContent, getContentType, getConverterPath, getEncoding, getIcon, getIndexableValue, getPreview, getRelatedFile, getSmallIcon, getSmallPreview, hasConverter, indexAttachment, isIndexed, listIndexableValues, stripBody, textToHTML, writeAttachmentFile)
- method SearchableText () SearchableText(self,) => ZCatalog support
ZAbstractAttachment.ZAbstractAttachment.SearchableText
- method clearRelatedFiles () clearRelatedFiles(self,) => quite explicit :-)
ZAbstractAttachment.ZAbstractAttachment.clearRelatedFiles
ZAbstractAttachment.ZAbstractAttachment.deleteAttachmentFile
- method getContent () getContent(self,) => return file content as a string
ZAbstractAttachment.ZAbstractAttachment.getContent
- method getContentType () getContentType(self,) => return content type for this file type.
ZAbstractAttachment.ZAbstractAttachment.getContentType
- method getConverterPath () getConverterPath(self,) => Return converter path or raise
ZAbstractAttachment.ZAbstractAttachment.getConverterPath
- method getIcon () getIcon(self,) => return a suitable icon for that type.
ZAbstractAttachment.ZAbstractAttachment.getIcon
ZAbstractAttachment.ZAbstractAttachment.getIndexableValue
ZAbstractAttachment.ZAbstractAttachment.getPreview
- method getSmallIcon () getSmallIcon(self,) => return a suitable icon for that type.
ZAbstractAttachment.ZAbstractAttachment.getSmallIcon
- method hasConverter () hasConverter(self) => None if the current class has no converter defined
ZAbstractAttachment.ZAbstractAttachment.hasConverter
ZAbstractAttachment.ZAbstractAttachment.indexAttachment
- method isIndexed () isIndexed(self,) => Return true if the attach. is indexed
ZAbstractAttachment.ZAbstractAttachment.isIndexed
ZAbstractAttachment.ZAbstractAttachment.listIndexableValues
- method stripBody (text) stripBody(self, text) => string
Strip a
ZAbstractAttachment.ZAbstractAttachment.stripBody
ZAbstractAttachment.ZAbstractAttachment.textToHTML
ZAttachmentAttribute product
Coding information : Permissions are set dynamically. That is, class is instanciated with access_permission and change_permission arguments, allowing a class to set its own permissions to content-accessing methods and to content-changing methods. Usually, it would be "Access Content Information" and "Change XXXs" permissions, but your mileage may vary.
If you create a new method for ZAttachmentAttribute class, don't forget to map it in the __init__ file with declareProtected and declarePublic methods.
ZAttachmentAttribute is a (base) class that can be used to store attachment information WARNING : SUBCLASSING THIS CLASS may break our security policy !
ZAttachmentAttribute.ZAttachmentAttribute
Methods: (SearchableText, __bobo_traverse__, __init__, delete, getCharset, getContentType, getFile, getFilename, getIcon, getIndexableValue, getPreview, getSize, getSmallIcon, getSmallPreview, index_html, isEmpty, isIndexed, isPreviewAvailable, listIndexableValues, manage_afterAdd, manage_afterClone, manage_beforeDelete, preview, related_content, returnContent, setTitle, title_and_id, title_or_id, updateCache, upload, uploadAttachment)
- method SearchableText () SearchableText(self,) => ZCatalog support
ZAttachmentAttribute.ZAttachmentAttribute.SearchableText
ZAttachmentAttribute.ZAttachmentAttribute.__init__
- method delete (REQUEST = {}) delete(self, REQUEST = {}) => delete the file
ZAttachmentAttribute.ZAttachmentAttribute.delete
- method getCharset () Return site default charset, or utf-8
ZAttachmentAttribute.ZAttachmentAttribute.getCharset
- method getContentType () getContentType(self,) => this is explicit ! ;-)
ZAttachmentAttribute.ZAttachmentAttribute.getContentType
- method getFile (**kw) getFile(self, **kw) => return file content
ZAttachmentAttribute.ZAttachmentAttribute.getFile
- method getFilename () getFilename(self,) => return filename
ZAttachmentAttribute.ZAttachmentAttribute.getFilename
- method getIcon () getIcon(self,) => return the underlying file class icon
ZAttachmentAttribute.ZAttachmentAttribute.getIcon
ZAttachmentAttribute.ZAttachmentAttribute.getIndexableValue
- method getPreview () Alias / Same as preview()
ZAttachmentAttribute.ZAttachmentAttribute.getPreview
- method getSize () getSize(self,) => return 1 if file is empty
ZAttachmentAttribute.ZAttachmentAttribute.getSize
- method getSmallIcon () getSmallIcon(self,) => return the underlying file class icon
ZAttachmentAttribute.ZAttachmentAttribute.getSmallIcon
- method isEmpty () isEmpty(self,) => return 1 if file is empty
ZAttachmentAttribute.ZAttachmentAttribute.isEmpty
- method isIndexed () return 1 if the attach. is indexed properly
ZAttachmentAttribute.ZAttachmentAttribute.isIndexed
- method isPreviewAvailable () Return true if it possible to preview this attachment as HTML
ZAttachmentAttribute.ZAttachmentAttribute.isPreviewAvailable
ZAttachmentAttribute.ZAttachmentAttribute.listIndexableValues
- method manage_afterAdd (item, container)
ZAttachmentAttribute.ZAttachmentAttribute.manage_afterAdd
- method manage_afterClone (item)
ZAttachmentAttribute.ZAttachmentAttribute.manage_afterClone
- method preview () Return an HTML rendering of the document
ZAttachmentAttribute.ZAttachmentAttribute.preview
ZAttachmentAttribute.ZAttachmentAttribute.returnContent
- method setTitle (title) setTitle(self, title)
ZAttachmentAttribute.ZAttachmentAttribute.setTitle
ZAttachmentAttribute.ZAttachmentAttribute.title_and_id
- method title_or_id () Utility that returns the title if it is not blank and the id
otherwise.
ZAttachmentAttribute.ZAttachmentAttribute.title_or_id
- method updateCache ()
ZAttachmentAttribute.ZAttachmentAttribute.updateCache
ZAttachmentAttribute.ZAttachmentAttribute.uploadAttachment
ZAttachmentAttribute product
ZAttachmentRegistry : this class handles ZAbstractAttachment-derived classes
ZAttachmentRegistry.ZAttachmentRegistry
Methods: (__init__, getAttachmentClass, registerClass)
- method __init__ ()
ZAttachmentRegistry.ZAttachmentRegistry.__init__
ZAttachmentRegistry.ZAttachmentRegistry.registerClass
ZAttachmentAttribute product
ZDummyAttachment -> This class simulates an empty attachment so that ValueErrors won't be called whenever ZAttachmentAttribute's __underlyingFile__ will be None...
ZDummyAttachment.ZDummyAttachment
Methods: (convertPreview, indexAttachment, isPreviewAvailable)
- method convertPreview () No preview
ZDummyAttachment.ZDummyAttachment.convertPreview
ZDummyAttachment.ZDummyAttachment.indexAttachment
- method isPreviewAvailable () No preview for dummy attachements
ZDummyAttachment.ZDummyAttachment.isPreviewAvailable
ZAttachmentAttribute
ZAttachmentAttribute product
Created by Doc-Tool V0.9.1 on Thu Feb 24 17:35:11 2005