Back to index

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

List of all members.

Public Member Functions

def __init__
def id
def SearchableText
def edit
def index_html
def Format
def setFormat
def PUT

Public Attributes

 precondition

Static Public Attributes

 effective_date = expiration_dateNone
 icon = PortalContent.icon
tuple manage_options
tuple security = ClassSecurityInfo()

Private Member Functions

def _isNotEmpty
def _edit
def _setOldCacheHeaders

Static Private Attributes

tuple __implements__

Detailed Description

A Portal-managed Image.

Definition at line 78 of file Image.py.


Constructor & Destructor Documentation

def CMFDefault.Image.Image.__init__ (   self,
  id,
  title = '',
  file = '',
  content_type = '',
  precondition = '',
  subject = (),
  description = '',
  contributors = (),
  effective_date = None,
  expiration_date = None,
  format = None,
  language = 'en-US',
  rights = '' 
)

Definition at line 111 of file Image.py.

00111 
00112                 ):
00113         OFS.Image.File.__init__( self, id, title, file
00114                                , content_type, precondition )
00115         self._setId(id)
00116         delattr(self, '__name__')
00117 
00118         # If no file format has been passed in, rely on what OFS.Image.File
00119         # detected.
00120         if format is None:
00121             format = self.content_type
00122 
00123         DefaultDublinCoreImpl.__init__( self, title, subject, description
00124                                , contributors, effective_date, expiration_date
00125                                , format, language, rights )

Here is the call graph for this function:


Member Function Documentation

def CMFDefault.Image.Image._edit (   self,
  precondition = '',
  file = '' 
) [private]
Update image. 

Definition at line 159 of file Image.py.

00159 
00160     def _edit(self, precondition='', file=''):
00161         """ Update image. """
00162         if precondition: self.precondition = precondition
00163         elif self.precondition: del self.precondition
00164 
00165         if self._isNotEmpty(file):
00166             self.manage_upload(file)

Here is the caller graph for this function:

def CMFDefault.Image.Image._isNotEmpty (   self,
  file 
) [private]
Do various checks on 'file' to try to determine non emptiness. 

Definition at line 141 of file Image.py.

00141 
00142     def _isNotEmpty(self, file):
00143         """ Do various checks on 'file' to try to determine non emptiness. """
00144         if not file:
00145             return 0                    # Catches None, Missing.Value, ''
00146         elif file and (type(file) is type('')):
00147             return 1
00148         elif getattr(file, 'filename', None):
00149             return 1
00150         elif not hasattr(file, 'read'):
00151             return 0
00152         else:
00153             file.seek(0,2)              # 0 bytes back from end of file
00154             t = file.tell()             # Report the location
00155             file.seek(0)                # and return pointer back to 0
00156             if t: return 1
00157             else: return 0

Definition at line 203 of file Image.py.

00203 
00204     def _setOldCacheHeaders(self):
00205         # return False to disable this simple caching behaviour
00206         return _OldCacheHeaders(self)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFDefault.Image.Image.edit (   self,
  precondition = '',
  file = '' 
)
Update and reindex. 

Definition at line 168 of file Image.py.

00168 
00169     def edit(self, precondition='', file=''):
00170         """ Update and reindex. """
00171         self._edit( precondition, file )
00172         self.reindexObject()

Here is the call graph for this function:

Here is the caller graph for this function:

Dublin Core element - resource format 

Definition at line 208 of file Image.py.

00208 
00209     def Format(self):
00210         """ Dublin Core element - resource format """
00211         return self.content_type

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFDefault.Image.Image.id (   self)

Definition at line 129 of file Image.py.

00129 
00130     def id(self):
00131         return self.__name__

Here is the caller graph for this function:

def CMFDefault.Image.Image.index_html (   self,
  REQUEST,
  RESPONSE 
)
Display the image, with or without standard_html_[header|footer],
as appropriate.

Definition at line 174 of file Image.py.

00174 
00175     def index_html(self, REQUEST, RESPONSE):
00176         """
00177         Display the image, with or without standard_html_[header|footer],
00178         as appropriate.
00179         """
00180         view = _ViewEmulator().__of__(self)
00181 
00182         # If we have a conditional get, set status 304 and return
00183         # no content
00184         if _checkConditionalGET(view, extra_context={}):
00185             return ''
00186 
00187         # old-style If-Modified-Since header handling.
00188         if self._setOldCacheHeaders():
00189             # Make sure the CachingPolicyManager gets a go as well
00190             _setCacheHeaders(view, extra_context={})
00191             return ''
00192 
00193         rendered = OFS.Image.Image.index_html(self, REQUEST, RESPONSE)
00194 
00195         if self.ZCacheable_getManager() is None:
00196             # not none cache manager already taken care of
00197             _setCacheHeaders(view, extra_context={})
00198         else:
00199             self.ZCacheable_set(None)
00200 
00201         return rendered

Here is the call graph for this function:

def CMFDefault.Image.Image.PUT (   self,
  REQUEST,
  RESPONSE 
)
Handle HTTP (and presumably FTP?) PUT requests 

Definition at line 218 of file Image.py.

00218 
00219     def PUT(self, REQUEST, RESPONSE):
00220         """ Handle HTTP (and presumably FTP?) PUT requests """
00221         OFS.Image.Image.PUT( self, REQUEST, RESPONSE )
00222         self.reindexObject()
00223 
00224 InitializeClass(Image)

Here is the call graph for this function:

    SeachableText is used for full text seraches of a portal.
    It should return a concatanation of all useful text.

Definition at line 133 of file Image.py.

00133 
00134     def SearchableText(self):
00135         """
00136             SeachableText is used for full text seraches of a portal.
00137             It should return a concatanation of all useful text.
00138         """
00139         return "%s %s" % (self.title, self.description)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFDefault.Image.Image.setFormat (   self,
  format 
)
Dublin Core element - resource format 

Definition at line 213 of file Image.py.

00213 
00214     def setFormat(self, format):
00215         """ Dublin Core element - resource format """
00216         self.manage_changeProperties(content_type=format)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tuple CMFDefault.Image.Image.__implements__ [static, private]
Initial value:
( PortalContent.__implements__
                     , DefaultDublinCoreImpl.__implements__
                     )

Definition at line 84 of file Image.py.

CMFDefault.Image.Image.effective_date = expiration_dateNone [static]

Definition at line 88 of file Image.py.

CMFDefault.Image.Image.icon = PortalContent.icon [static]

Definition at line 89 of file Image.py.

Initial value:
( PortalContent.manage_options
                     + Cacheable.manage_options
                     )

Definition at line 91 of file Image.py.

Definition at line 161 of file Image.py.

tuple CMFDefault.Image.Image.security = ClassSecurityInfo() [static]

Definition at line 95 of file Image.py.


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