Back to index

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

List of all members.

Public Member Functions

def __browser_default__
def index_html
def manage_beforeDelete
def manage_delObjects
def view
def folderlistingFolderContents
def availableLanguages

Public Attributes

 removal_inprogress

Static Public Attributes

tuple security = ClassSecurityInfo()
string meta_type = 'Plone Site'
 manage_renameObject = OrderedContainer.manage_renameObject
 moveObject = OrderedContainer.moveObject
 moveObjectsByDelta = OrderedContainer.moveObjectsByDelta
int has_order_support = 0
tuple index_html = ComputedAttribute(index_html, 1)
tuple management_page_charset = ComputedAttribute(_management_page_charset, 1)

Private Member Functions

def _management_page_charset

Static Private Attributes

 __implements__ = DublinCore.DefaultDublinCoreImpl.__implements__+\
string _default_sort_key = 'id'

Detailed Description

Make PloneSite subclass CMFSite and add some methods.
This will be useful for adding more things later on.

Definition at line 30 of file Portal.py.


Member Function Documentation

def CMFPlone.Portal.PloneSite.__browser_default__ (   self,
  request 
)
Set default so we can return whatever we want instead
of index_html 

Definition at line 54 of file Portal.py.

00054 
00055     def __browser_default__(self, request):
00056         """ Set default so we can return whatever we want instead
00057         of index_html """
00058         return getToolByName(self, 'plone_utils').browserDefault(self)

Here is the call graph for this function:

Returns default_charset for management screens 

Definition at line 96 of file Portal.py.

00096 
00097     def _management_page_charset(self):
00098         """ Returns default_charset for management screens """
00099         properties = getToolByName(self, 'portal_properties', None)
00100         # Let's be a bit careful here because we don't want to break the ZMI
00101         # just because people screw up their Plone sites (however thoroughly).
00102         if properties is not None:
00103             site_properties = getattr(properties, 'site_properties', None)
00104             if site_properties is not None:
00105                 getProperty = getattr(site_properties, 'getProperty', None)
00106                 if getProperty is not None:
00107                     return getProperty('default_charset', 'utf-8')
00108         return 'utf-8'

Here is the call graph for this function:

Definition at line 130 of file Portal.py.

00130 
00131     def availableLanguages(self):
00132         util = queryUtility(IMetadataLanguageAvailability)
00133         languages = util.getLanguageListing()
00134         languages.sort(lambda x,y:cmp(x[1], y[1]))
00135         # Put language neutral at the top.
00136         languages.insert(0,(u'',_(u'Language neutral (site default)')))
00137         return languages
00138 
00139 Globals.InitializeClass(PloneSite)
def CMFPlone.Portal.PloneSite.folderlistingFolderContents (   self,
  contentFilter = None 
)
Calls listFolderContents in protected only by ACI so that
folder_listing can work without the List folder contents permission,
as in CMFDefault.

This is copied from Archetypes Basefolder and is needed by the
reference browser.

Definition at line 119 of file Portal.py.

00119 
00120     def folderlistingFolderContents(self, contentFilter=None):
00121         """Calls listFolderContents in protected only by ACI so that
00122         folder_listing can work without the List folder contents permission,
00123         as in CMFDefault.
00124 
00125         This is copied from Archetypes Basefolder and is needed by the
00126         reference browser.
00127         """
00128         return self.listFolderContents(contentFilter)

Here is the call graph for this function:

Acquire if not present. 

Definition at line 59 of file Portal.py.

00059 
00060     def index_html(self):
00061         """ Acquire if not present. """
00062         request = getattr(self, 'REQUEST', None)
00063         if request and request.has_key('REQUEST_METHOD'):
00064             if request.maybe_webdav_client:
00065                 method = request['REQUEST_METHOD']
00066                 if method in ('PUT',):
00067                     # Very likely a WebDAV client trying to create something
00068                     return ReplaceableWrapper(NullResource(self, 'index_html'))
00069                 elif method in ('GET', 'HEAD', 'POST'):
00070                     # Do nothing, let it go and acquire.
00071                     pass
00072                 else:
00073                     raise AttributeError, 'index_html'
00074         # Acquire from skin.
00075         _target = self.__getattr__('index_html')
00076         return ReplaceableWrapper(aq_base(_target).__of__(self))

Here is the call graph for this function:

def CMFPlone.Portal.PloneSite.manage_beforeDelete (   self,
  container,
  item 
)
Should send out an Event before Site is being deleted 

Definition at line 79 of file Portal.py.

00079 
00080     def manage_beforeDelete(self, container, item):
00081         """ Should send out an Event before Site is being deleted """
00082         self.removal_inprogress=1
00083         PloneSite.inheritedAttribute('manage_beforeDelete')(self, container, item)

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

Definition at line 85 of file Portal.py.

00085 
00086     def manage_delObjects(self, ids=[], REQUEST=None):
00087         """We need to enforce security."""
00088         if isinstance(ids, basestring):
00089             ids = [ids]
00090         for id in ids:
00091             item = self._getOb(id)
00092             if not _checkPermission(permissions.DeleteObjects, item):
00093                 raise Unauthorized, (
00094                     "Do not have permissions to remove this object")
00095         return CMFSite.manage_delObjects(self, ids, REQUEST=REQUEST)

Here is the call graph for this function:

Here is the caller graph for this function:

Ensure that we get a plain view of the object, via a delegation to
__call__(), which is defined in BrowserDefaultMixin

Definition at line 111 of file Portal.py.

00111 
00112     def view(self):
00113         """ Ensure that we get a plain view of the object, via a delegation to
00114         __call__(), which is defined in BrowserDefaultMixin
00115         """
00116         return self()

Here is the caller graph for this function:


Member Data Documentation

CMFPlone.Portal.PloneSite.__implements__ = DublinCore.DefaultDublinCoreImpl.__implements__+\ [static, private]

Definition at line 40 of file Portal.py.

string CMFPlone.Portal.PloneSite._default_sort_key = 'id' [static, private]

Definition at line 52 of file Portal.py.

Definition at line 51 of file Portal.py.

tuple CMFPlone.Portal.PloneSite.index_html = ComputedAttribute(index_html, 1) [static]

Definition at line 77 of file Portal.py.

CMFPlone.Portal.PloneSite.manage_renameObject = OrderedContainer.manage_renameObject [static]

Definition at line 44 of file Portal.py.

Definition at line 109 of file Portal.py.

string CMFPlone.Portal.PloneSite.meta_type = 'Plone Site' [static]

Definition at line 36 of file Portal.py.

CMFPlone.Portal.PloneSite.moveObject = OrderedContainer.moveObject [static]

Definition at line 46 of file Portal.py.

CMFPlone.Portal.PloneSite.moveObjectsByDelta = OrderedContainer.moveObjectsByDelta [static]

Definition at line 47 of file Portal.py.

Definition at line 81 of file Portal.py.

tuple CMFPlone.Portal.PloneSite.security = ClassSecurityInfo() [static]

Definition at line 35 of file Portal.py.


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