Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.controlpanel.maintenance.MaintenanceControlPanel Class Reference
Inheritance diagram for plone.app.controlpanel.maintenance.MaintenanceControlPanel:
Inheritance graph
[legend]
Collaboration diagram for plone.app.controlpanel.maintenance.MaintenanceControlPanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def handle_edit_action
def handle_shutdown_action
def handle_restart_action
def available
def isRestartable
def isDevelopmentMode
def coreVersions
def processTime
def dbSize
def setUpWidgets
def is_fieldsets

Public Attributes

 status
 adapters
 widgets

Static Public Attributes

tuple template = ZopeTwoPageTemplateFile('maintenance.pt')
tuple form_fields = form.FormFields(IMaintenanceSchema)
tuple label = _(u'Maintenance')
tuple description = _(u"Zope server and site maintenance options.")
tuple form_name = _(u'Zope Database Packing')

Detailed Description

A simple form to pack the databases.

Definition at line 58 of file maintenance.py.


Member Function Documentation

Definition at line 114 of file maintenance.py.

00114 
00115     def available(self):
00116         root = aq_inner(self.context).getPhysicalRoot()
00117         sm = getSecurityManager()
00118         return sm.checkPermission(view_management_screens, root)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 128 of file maintenance.py.

00128 
00129     def coreVersions(self):
00130         mt = getToolByName(self.context, 'portal_migration')
00131         versions = mt.coreVersions()
00132         versions['Instance'] = versions['Plone Instance']
00133         return versions

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 139 of file maintenance.py.

00139 
00140     def dbSize(self):
00141         context = aq_inner(self.context)
00142         cpanel = context.unrestrictedTraverse('/Control_Panel')
00143         return cpanel.db_size()

Here is the call graph for this function:

Definition at line 70 of file maintenance.py.

00070 
00071     def handle_edit_action(self, action, data):
00072         CheckAuthenticator(self.request)
00073         if not self.available():
00074             self.status = _(u'text_not_allowed_manage_server',
00075                             default=u'You are not allowed to manage the Zope server.')
00076             return
00077         form.applyChanges(self.context, self.form_fields, data, self.adapters)
00078         value = data.get('days', None)
00079         # skip the actual pack method in tests
00080         if value is not None and isinstance(value, int) and value >= 0:
00081             context = aq_inner(self.context)
00082             cpanel = context.unrestrictedTraverse('/Control_Panel')
00083             cpanel.manage_pack(days=value, REQUEST=None)
00084         self.status = _(u'Packed the database.')

Here is the call graph for this function:

Definition at line 98 of file maintenance.py.

00098 
00099     def handle_restart_action(self, action, data):
00100         CheckAuthenticator(self.request)
00101         if not self.available():
00102             self.status = _(u'text_not_allowed_manage_server',
00103                             default=u'You are not allowed to manage the Zope server.')
00104             return
00105         context = aq_inner(self.context)
00106         cpanel = context.unrestrictedTraverse('/Control_Panel')
00107         url = self.request.get('URL')
00108         result = cpanel.manage_restart(url)
00109         return """<html>
00110         <head><meta HTTP-EQUIV=REFRESH CONTENT="10; URL=%s">
00111         </head>
00112         <body>Zope is restarting</body></html>
00113         """ % escape(url, 1)

Here is the call graph for this function:

Definition at line 86 of file maintenance.py.

00086 
00087     def handle_shutdown_action(self, action, data):
00088         CheckAuthenticator(self.request)
00089         if not self.available():
00090             self.status = _(u'text_not_allowed_manage_server',
00091                             default=u'You are not allowed to manage the Zope server.')
00092             return
00093         context = aq_inner(self.context)
00094         cpanel = context.unrestrictedTraverse('/Control_Panel')
00095         result = cpanel.manage_shutdown()
00096         return result

Here is the call graph for this function:

Definition at line 36 of file form.py.

00036 
00037     def is_fieldsets(self):
00038         # We need to be able to test for non-fieldsets in templates.
00039         return IFormFieldsets.providedBy(self.form_fields)
00040 

Here is the caller graph for this function:

Definition at line 124 of file maintenance.py.

00124 
00125     def isDevelopmentMode(self):
00126         qi = getToolByName(self.context, 'portal_quickinstaller')
00127         return qi.isDevelopmentMode()

Here is the call graph for this function:

Definition at line 119 of file maintenance.py.

00119 
00120     def isRestartable(self):
00121         if os.environ.has_key('ZMANAGED'):
00122             return True
00123         return False

Definition at line 134 of file maintenance.py.

00134 
00135     def processTime(self):
00136         context = aq_inner(self.context)
00137         cpanel = context.unrestrictedTraverse('/Control_Panel')
00138         return cpanel.process_time()

Here is the call graph for this function:

def plone.fieldsets.form.FieldsetsEditForm.setUpWidgets (   self,
  ignore_request = False 
) [inherited]

Definition at line 13 of file form.py.

00013 
00014     def setUpWidgets(self, ignore_request=False):
00015         # First part is copied from zope.formlib.form.EditForm licensed under
00016         # the ZPL 2.1
00017         self.adapters = {}
00018         # In order to support fieldsets, we need to setup the widgets on all
00019         # the fieldsets as well.
00020         if self.is_fieldsets():
00021             self.widgets = None
00022             for fieldset in self.form_fields.fieldsets:
00023                 fieldset.widgets = form.setUpEditWidgets(
00024                     fieldset, self.prefix, self.context, self.request,
00025                     adapters=self.adapters, ignore_request=ignore_request
00026                     )
00027                 if self.widgets is None:
00028                     self.widgets = fieldset.widgets
00029                 else:
00030                     self.widgets += fieldset.widgets
00031         else:
00032             self.widgets = form.setUpEditWidgets(
00033                 self.form_fields, self.prefix, self.context, self.request,
00034                 adapters=self.adapters, ignore_request=ignore_request
00035                 )


Member Data Documentation

Definition at line 16 of file form.py.

tuple plone.app.controlpanel.maintenance.MaintenanceControlPanel.description = _(u"Zope server and site maintenance options.") [static]

Definition at line 66 of file maintenance.py.

Definition at line 64 of file maintenance.py.

tuple plone.app.controlpanel.maintenance.MaintenanceControlPanel.form_name = _(u'Zope Database Packing') [static]

Definition at line 67 of file maintenance.py.

Definition at line 65 of file maintenance.py.

Definition at line 73 of file maintenance.py.

tuple plone.app.controlpanel.maintenance.MaintenanceControlPanel.template = ZopeTwoPageTemplateFile('maintenance.pt') [static]

Definition at line 63 of file maintenance.py.

Definition at line 20 of file form.py.


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