Back to index

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

List of all members.

Public Member Functions

def __init__
def __call__
def index_html
def manage_addPloneFolder
def manage_delObjects
def __browser_default__
def contentValues
def listFolderContents
def folderlistingFolderContents
def invokeFactory

Public Attributes

 id
 title

Static Public Attributes

tuple security = ClassSecurityInfo()
 manage_options = Folder.manage_options+\
 view = __call__
tuple index_html = ComputedAttribute(index_html, 1)
 manage_addFolder = manage_addPloneFolder
 manage_renameObject = PortalFolderBase.manage_renameObject

Static Private Attributes

 __implements__ = DefaultDublinCoreImpl.__implements__+\
tuple __ac_permissions__

Detailed Description

Implements basic Plone folder functionality except ordering support.

Definition at line 205 of file PloneFolder.py.


Constructor & Destructor Documentation

def CMFPlone.PloneFolder.BasePloneFolder.__init__ (   self,
  id,
  title = '' 
)

Definition at line 229 of file PloneFolder.py.

00229 
00230     def __init__(self, id, title=''):
00231         DefaultDublinCoreImpl.__init__(self)
00232         self.id = id
00233         self.title = title


Member Function Documentation

Set default so we can return whatever we want instead
of index_html.

Definition at line 297 of file PloneFolder.py.

00297 
00298     def __browser_default__(self, request):
00299         """Set default so we can return whatever we want instead
00300         of index_html."""
00301         return getToolByName(self, 'plone_utils').browserDefault(self)

Here is the call graph for this function:

Invokes the default view.

Definition at line 234 of file PloneFolder.py.

00234 
00235     def __call__(self):
00236         """Invokes the default view."""
00237         ti = self.getTypeInfo()
00238         method_id = ti and ti.queryMethodId('(Default)', context=self)
00239         if method_id:
00240             method = getattr(self, method_id)
00241             # XXX view is not defined!
00242             if getattr(aq_base(view), 'isDocTemp', 0):
00243                 return method(self, self.REQUEST, self.REQUEST['RESPONSE'])
00244             else:
00245                 return method()
00246         else:
00247             raise NotFound( 'Cannot find default view for "%s"' %
00248                             '/'.join( self.getPhysicalPath() ) )

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.PloneFolder.BasePloneFolder.contentValues (   self,
  filter = None,
  sort_on = None,
  reverse = 0 
)
Able to sort on field.

Definition at line 303 of file PloneFolder.py.

00303 
00304     def contentValues(self, filter=None, sort_on=None, reverse=0):
00305         """Able to sort on field."""
00306         values = PortalFolderBase.contentValues(self, filter=filter)
00307         if sort_on is not None:
00308             values.sort(lambda x, y,
00309                         sort_on=sort_on: safe_cmp(getattr(x,sort_on),
00310                                                   getattr(y,sort_on)))
00311         if reverse:
00312             values.reverse()
00313 
00314         return values

Here is the call graph for this function:

def CMFPlone.PloneFolder.BasePloneFolder.folderlistingFolderContents (   self,
  contentFilter = None,
  suppressHiddenFiles = 0 
)
Calls listFolderContents in protected only by ACI so that
folder_listing can work without the List folder contents permission,
as in CMFDefault.

Definition at line 330 of file PloneFolder.py.

00330 
00331                                     suppressHiddenFiles=0):
00332         """Calls listFolderContents in protected only by ACI so that
00333         folder_listing can work without the List folder contents permission,
00334         as in CMFDefault.
00335         """
00336         return self.listFolderContents(contentFilter, suppressHiddenFiles)

Here is the call graph for this function:

Here is the caller graph for this function:

Acquire if not present.

Definition at line 252 of file PloneFolder.py.

00252 
00253     def index_html(self):
00254         """Acquire if not present."""
00255         request = getattr(self, 'REQUEST', None)
00256         if request and request.has_key('REQUEST_METHOD'):
00257             if request.maybe_webdav_client:
00258                 method = request['REQUEST_METHOD']
00259                 if method in ('PUT',):
00260                     # Very likely a WebDAV client trying to create something
00261                     return ReplaceableWrapper(NullResource(self, 'index_html'))
00262                 elif method in ('GET', 'HEAD', 'POST'):
00263                     # Do nothing, let it go and acquire.
00264                     pass
00265                 else:
00266                     raise AttributeError, 'index_html'
00267         # Acquire from parent
00268         _target = aq_parent(aq_inner(self)).aq_acquire('index_html')
00269         return ReplaceableWrapper(aq_base(_target).__of__(self))

def CMFPlone.PloneFolder.BasePloneFolder.invokeFactory (   self,
  type_name,
  id,
  RESPONSE = None,
  args,
  kw 
)
Invokes the portal_types tool.

Definition at line 340 of file PloneFolder.py.

00340 
00341     def invokeFactory(self, type_name, id, RESPONSE=None, *args, **kw):
00342         """Invokes the portal_types tool."""
00343         pt = getToolByName(self, 'portal_types')
00344         myType = pt.getTypeInfo(self)
00345         if myType is not None:
00346             if not myType.allowType(type_name):
00347                 raise ValueError, 'Disallowed subobject type: %s' % type_name
00348         args = (type_name, self, id, RESPONSE) + args
00349         new_id = pt.constructContent(*args, **kw)
00350         if new_id is None or new_id == '':
00351             new_id = id
00352         return new_id
00353 
00354 InitializeClass(BasePloneFolder)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.PloneFolder.BasePloneFolder.listFolderContents (   self,
  contentFilter = None,
  suppressHiddenFiles = 0 
)
Optionally you can suppress "hidden" files, or files that
begin with .

Definition at line 317 of file PloneFolder.py.

00317 
00318                            suppressHiddenFiles=0):
00319         """Optionally you can suppress "hidden" files, or files that
00320         begin with .
00321         """
00322         contents = PortalFolderBase.listFolderContents(self,
00323                                                   contentFilter=contentFilter)
00324         if suppressHiddenFiles:
00325             contents = [obj for obj in contents if obj.getId()[:1]!='.']
00326         return contents

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.PloneFolder.BasePloneFolder.manage_addPloneFolder (   self,
  id,
  title = '',
  REQUEST = None 
)
Adds a new PloneFolder.

Definition at line 273 of file PloneFolder.py.

00273 
00274     def manage_addPloneFolder(self, id, title='', REQUEST=None):
00275         """Adds a new PloneFolder."""
00276         ob = PloneFolder(id, title)
00277         self._setObject(id, ob)
00278         if REQUEST is not None:
00279             # TODO HARDCODED FIXME!
00280             return self.folder_contents(self, REQUEST)

Here is the call graph for this function:

def CMFPlone.PloneFolder.BasePloneFolder.manage_delObjects (   self,
  ids = [],
  REQUEST = None 
)
We need to enforce security.

Definition at line 285 of file PloneFolder.py.

00285 
00286     def manage_delObjects(self, ids=[], REQUEST=None):
00287         """We need to enforce security."""
00288         mt = getToolByName(self, 'portal_membership')
00289         if type(ids) is StringType:
00290             ids = [ids]
00291         for id in ids:
00292             item = self._getOb(id)
00293             if not mt.checkPermission(Permissions.delete_objects, item):
00294                 raise Unauthorized, (
00295                     "Do not have permissions to remove this object")
00296         return PortalFolderBase.manage_delObjects(self, ids, REQUEST=REQUEST)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
(
        ('Modify portal content',
         ('manage_cutObjects', 'manage_pasteObjects',
          'manage_renameForm', 'manage_renameObject',
          'manage_renameObjects',)),
        )

Definition at line 220 of file PloneFolder.py.

CMFPlone.PloneFolder.BasePloneFolder.__implements__ = DefaultDublinCoreImpl.__implements__+\ [static, private]

Reimplemented in CMFPlone.PloneFolder.PloneFolder.

Definition at line 211 of file PloneFolder.py.

Definition at line 231 of file PloneFolder.py.

tuple CMFPlone.PloneFolder.BasePloneFolder.index_html = ComputedAttribute(index_html, 1) [static]

Definition at line 270 of file PloneFolder.py.

Definition at line 281 of file PloneFolder.py.

CMFPlone.PloneFolder.BasePloneFolder.manage_options = Folder.manage_options+\ [static]

Definition at line 216 of file PloneFolder.py.

CMFPlone.PloneFolder.BasePloneFolder.manage_renameObject = PortalFolderBase.manage_renameObject [static]

Reimplemented in CMFPlone.PloneFolder.PloneFolder.

Definition at line 282 of file PloneFolder.py.

tuple CMFPlone.PloneFolder.BasePloneFolder.security = ClassSecurityInfo() [static]

Reimplemented in CMFPlone.PloneFolder.PloneFolder.

Definition at line 209 of file PloneFolder.py.

Definition at line 232 of file PloneFolder.py.

Definition at line 250 of file PloneFolder.py.


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