Back to index

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

List of all members.

Public Member Functions

def manage_addPortalFolder
def Title
def Description
def Type
def setTitle
def setDescription
def edit
def allowedContentTypes
def contentItems
def contentIds
def contentValues
def listFolderContents
def listDAVObjects
def encodeFolderFilter
def decodeFolderFilter
def content_type
def indexObject
def unindexObject
def reindexObject
def reindexObjectSecurity
def PUT_factory
def invokeFactory
def checkIdAvailable
def MKCOL_handler
def manage_addFolder

Public Attributes

 description
 id
 title

Static Public Attributes

string portal_type = 'Folder'
tuple security = ClassSecurityInfo()
tuple manage_options
string description = ''

Static Private Attributes

tuple __implements__

Detailed Description

Implements portal content management, but not UI details.

Definition at line 480 of file PortalFolder.py.


Member Function Documentation

    List type info objects for types which can be added in
    this folder.

Definition at line 124 of file PortalFolder.py.

00124 
00125     def allowedContentTypes( self ):
00126         """
00127             List type info objects for types which can be added in
00128             this folder.
00129         """
00130         result = []
00131         portal_types = getToolByName(self, 'portal_types')
00132         myType = portal_types.getTypeInfo(self)
00133 
00134         if myType is not None:
00135             for contentType in portal_types.listTypeInfo(self):
00136                 if myType.allowType( contentType.getId() ):
00137                     result.append( contentType )
00138         else:
00139             result = portal_types.listTypeInfo()
00140 
00141         return filter( lambda typ, container=self:
00142                           typ.isConstructionAllowed( container )
00143                      , result )

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.checkIdAvailable (   self,
  id 
) [inherited]

Definition at line 318 of file PortalFolder.py.

00318 
00319     def checkIdAvailable(self, id):
00320         try:
00321             self._checkId(id)
00322         except BadRequest:
00323             return False
00324         else:
00325             return True

Here is the call graph for this function:

    WebDAV needs this to do the Right Thing (TM).

Definition at line 260 of file PortalFolder.py.

00260 
00261     def content_type( self ):
00262         """
00263             WebDAV needs this to do the Right Thing (TM).
00264         """
00265         return None

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.contentIds (   self,
  filter = None 
) [inherited]

Definition at line 192 of file PortalFolder.py.

00192 
00193     def contentIds(self, filter=None):
00194         # List IDs of contentish and folderish sub-objects.
00195         # (method is without docstring to disable publishing)
00196         #
00197         return [ item[0] for item in self.contentItems(filter) ]

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.contentItems (   self,
  filter = None 
) [inherited]

Definition at line 184 of file PortalFolder.py.

00184 
00185     def contentItems(self, filter=None):
00186         # List contentish and folderish sub-objects and their IDs.
00187         # (method is without docstring to disable publishing)
00188         #
00189         ids = self.objectIds()
00190         return self._filteredItems(ids, filter)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.contentValues (   self,
  filter = None 
) [inherited]

Definition at line 199 of file PortalFolder.py.

00199 
00200     def contentValues(self, filter=None):
00201         # List contentish and folderish sub-objects.
00202         # (method is without docstring to disable publishing)
00203         #
00204         return [ item[1] for item in self.contentItems(filter) ]

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.decodeFolderFilter (   self,
  encoded 
) [inherited]
    Parse cookie string for using variables in dtml.

Definition at line 251 of file PortalFolder.py.

00251 
00252     def decodeFolderFilter(self, encoded):
00253         """
00254             Parse cookie string for using variables in dtml.
00255         """
00256         filter = {}
00257         if encoded:
00258             filter.update(marshal.loads(base64.decodestring(encoded)))
00259         return filter

Dublin Core Description element - resource summary.

Definition at line 87 of file PortalFolder.py.

00087 
00088     def Description(self):
00089         """ Dublin Core Description element - resource summary.
00090         """
00091         return self.description

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.edit (   self,
  title = '',
  description = '' 
) [inherited]
Edit the folder title (and possibly other attributes later)

Definition at line 115 of file PortalFolder.py.

00115 
00116     def edit(self, title='', description=''):
00117         """
00118         Edit the folder title (and possibly other attributes later)
00119         """
00120         self.setTitle( title )
00121         self.setDescription( description )
00122         self.reindexObject()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.encodeFolderFilter (   self,
  REQUEST 
) [inherited]
    Parse cookie string for using variables in dtml.

Definition at line 238 of file PortalFolder.py.

00238 
00239     def encodeFolderFilter(self, REQUEST):
00240         """
00241             Parse cookie string for using variables in dtml.
00242         """
00243         filter = {}
00244         for key, value in REQUEST.items():
00245             if key[:10] == 'filter_by_':
00246                 filter[key[10:]] = value
00247         encoded = base64.encodestring( marshal.dumps(filter) ).strip()
00248         encoded = ''.join( encoded.split('\n') )
00249         return encoded

Here is the call graph for this function:

Definition at line 269 of file PortalFolder.py.

00269 
00270     def indexObject(self):
00271         pass

def CMFCore.PortalFolder.PortalFolderBase.invokeFactory (   self,
  type_name,
  id,
  RESPONSE = None,
  args,
  kw 
) [inherited]
Invokes the portal_types tool.

Definition at line 305 of file PortalFolder.py.

00305 
00306     def invokeFactory(self, type_name, id, RESPONSE=None, *args, **kw):
00307         """ Invokes the portal_types tool.
00308         """
00309         pt = getToolByName(self, 'portal_types')
00310         myType = pt.getTypeInfo(self)
00311 
00312         if myType is not None:
00313             if not myType.allowType( type_name ):
00314                 raise ValueError('Disallowed subobject type: %s' % type_name)
00315 
00316         return pt.constructContent(type_name, self, id, RESPONSE, *args, **kw)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 225 of file PortalFolder.py.

00225 
00226     def listDAVObjects(self):
00227         # List sub-objects for PROPFIND requests.
00228         # (method is without docstring to disable publishing)
00229         #
00230         if _checkPermission(ManagePortal, self):
00231             return self.objectValues()
00232         else:
00233             return self.listFolderContents()

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.listFolderContents (   self,
  contentFilter = None 
) [inherited]
List viewable contentish and folderish sub-objects.

Definition at line 206 of file PortalFolder.py.

00206 
00207     def listFolderContents(self, contentFilter=None):
00208         """ List viewable contentish and folderish sub-objects.
00209         """
00210         l = []
00211         for id, obj in self.contentItems(contentFilter):
00212             # validate() can either raise Unauthorized or return 0 to
00213             # mean unauthorized.
00214             try:
00215                 if getSecurityManager().validate(self, self, id, obj):
00216                     l.append(obj)
00217             except zExceptions_Unauthorized:  # Catch *all* Unauths!
00218                 pass
00219         return l

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.manage_addFolder (   self,
  id,
  title = '',
  REQUEST = None 
) [inherited]
Add a new folder-like object with id *id*.

IF present, use the parent object's 'mkdir' alias; otherwise, just add
a PortalFolder.

Definition at line 453 of file PortalFolder.py.

00453 
00454                         ):
00455         """ Add a new folder-like object with id *id*.
00456 
00457         IF present, use the parent object's 'mkdir' alias; otherwise, just add
00458         a PortalFolder.
00459         """
00460         ti = self.getTypeInfo()
00461         method_id = ti and ti.queryMethodID('mkdir', context=self)
00462         if method_id:
00463             # call it
00464             getattr(self, method_id)(id=id)
00465         else:
00466             self.invokeFactory( type_name='Folder', id=id )
00467 
00468         ob = self._getOb( id )
00469         ob.setTitle( title )
00470         try:
00471             ob.reindexObject()
00472         except AttributeError:
00473             pass
00474 
00475         if REQUEST is not None:
00476             return self.manage_main(self, REQUEST, update_menu=1)
00477 
00478 InitializeClass(PortalFolderBase)
00479 

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolder.manage_addPortalFolder (   self,
  id,
  title = '',
  REQUEST = None 
)
Add a new PortalFolder object with id *id*.

Definition at line 495 of file PortalFolder.py.

00495 
00496     def manage_addPortalFolder(self, id, title='', REQUEST=None):
00497         """Add a new PortalFolder object with id *id*.
00498         """
00499         ob = PortalFolder(id, title)
00500         self._setObject(id, ob)
00501         if REQUEST is not None:
00502             return self.folder_contents( # XXX: ick!
00503                 self, REQUEST, portal_status_message="Folder added")
00504 
00505 InitializeClass(PortalFolder)

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.MKCOL_handler (   self,
  id,
  REQUEST = None,
  RESPONSE = None 
) [inherited]
    Handle WebDAV MKCOL.

Definition at line 326 of file PortalFolder.py.

00326 
00327     def MKCOL_handler(self,id,REQUEST=None,RESPONSE=None):
00328         """
00329             Handle WebDAV MKCOL.
00330         """
00331         self.manage_addFolder( id=id, title='' )

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.PUT_factory (   self,
  name,
  typ,
  body 
) [inherited]
Factory for PUT requests to objects which do not yet exist.

Used by NullResource.PUT.

Returns -- Bare and empty object of the appropriate type (or None, if
we don't know what to do)

Definition at line 281 of file PortalFolder.py.

00281 
00282     def PUT_factory( self, name, typ, body ):
00283         """ Factory for PUT requests to objects which do not yet exist.
00284 
00285         Used by NullResource.PUT.
00286 
00287         Returns -- Bare and empty object of the appropriate type (or None, if
00288         we don't know what to do)
00289         """
00290         registry = getToolByName(self, 'content_type_registry', None)
00291         if registry is None:
00292             return None
00293 
00294         typeObjectName = registry.findTypeName( name, typ, body )
00295         if typeObjectName is None:
00296             return None
00297 
00298         self.invokeFactory( typeObjectName, name )
00299 
00300         # invokeFactory does too much, so the object has to be removed again
00301         obj = aq_base( self._getOb( name ) )
00302         self._delObject( name )
00303         return obj

Here is the call graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.reindexObject (   self,
  idxs = [] 
) [inherited]

Definition at line 275 of file PortalFolder.py.

00275 
00276     def reindexObject(self, idxs=[]):
00277         pass

Here is the caller graph for this function:

Definition at line 278 of file PortalFolder.py.

00278 
00279     def reindexObjectSecurity(self):
00280         pass

def CMFCore.PortalFolder.PortalFolderBase.setDescription (   self,
  description 
) [inherited]
Set Dublin Core Description element - resource summary.

Definition at line 106 of file PortalFolder.py.

00106 
00107     def setDescription(self, description):
00108         """ Set Dublin Core Description element - resource summary.
00109         """
00110         self.description = description

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.setTitle (   self,
  title 
) [inherited]
Set Dublin Core Title element - resource name.

Definition at line 100 of file PortalFolder.py.

00100 
00101     def setTitle(self, title):
00102         """ Set Dublin Core Title element - resource name.
00103         """
00104         self.title = title

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.Title (   self) [inherited]
Dublin Core Title element - resource name.

Definition at line 81 of file PortalFolder.py.

00081 
00082     def Title(self):
00083         """ Dublin Core Title element - resource name.
00084         """
00085         return self.title

Here is the caller graph for this function:

def CMFCore.PortalFolder.PortalFolderBase.Type (   self) [inherited]
Dublin Core Type element - resource type.

Definition at line 93 of file PortalFolder.py.

00093 
00094     def Type(self):
00095         """ Dublin Core Type element - resource type.
00096         """
00097         ti = self.getTypeInfo()
00098         return ti is not None and ti.Title() or 'Unknown'

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 272 of file PortalFolder.py.

00272 
00273     def unindexObject(self):
00274         pass


Member Data Documentation

Initial value:
(PortalFolderBase.__implements__,
                      OrderSupport.__implements__)

Reimplemented from CMFCore.PortalFolder.PortalFolderBase.

Definition at line 485 of file PortalFolder.py.

string CMFCore.PortalFolder.PortalFolderBase.description = '' [static, inherited]

Definition at line 63 of file PortalFolder.py.

Definition at line 75 of file PortalFolder.py.

Definition at line 73 of file PortalFolder.py.

Initial value:
( OrderSupport.manage_options +
                       PortalFolderBase.manage_options[1:] )

Reimplemented from CMFCore.PortalFolder.PortalFolderBase.

Definition at line 491 of file PortalFolder.py.

Definition at line 487 of file PortalFolder.py.

tuple CMFCore.PortalFolder.PortalFolder.security = ClassSecurityInfo() [static]

Reimplemented from CMFCore.PortalFolder.PortalFolderBase.

Definition at line 489 of file PortalFolder.py.

Definition at line 74 of file PortalFolder.py.


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