Commit 5db07830 authored by Martijn Pieters's avatar Martijn Pieters

Use the requestmethod decorator generator (better documentation)

parent 217651d6
...@@ -30,7 +30,7 @@ from Product import ProductFolder ...@@ -30,7 +30,7 @@ from Product import ProductFolder
from version_txt import version_txt from version_txt import version_txt
from cStringIO import StringIO from cStringIO import StringIO
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl.requestmethod import postonly from AccessControl.requestmethod import requestmethod
from zExceptions import Redirect from zExceptions import Redirect
from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from cgi import escape from cgi import escape
...@@ -389,7 +389,7 @@ class ApplicationManager(Folder,CacheManager): ...@@ -389,7 +389,7 @@ class ApplicationManager(Folder,CacheManager):
if os.environ.has_key('ZMANAGED'): if os.environ.has_key('ZMANAGED'):
manage_restartable=1 manage_restartable=1
@postonly @requestmethod('POST')
def manage_restart(self, URL1, REQUEST=None): def manage_restart(self, URL1, REQUEST=None):
"""Shut down the application""" """Shut down the application"""
try: try:
...@@ -405,7 +405,7 @@ class ApplicationManager(Folder,CacheManager): ...@@ -405,7 +405,7 @@ class ApplicationManager(Folder,CacheManager):
<body>Zope is restarting</body></html> <body>Zope is restarting</body></html>
""" % escape(URL1, 1) """ % escape(URL1, 1)
@postonly @requestmethod('POST')
def manage_shutdown(self, REQUEST=None): def manage_shutdown(self, REQUEST=None):
"""Shut down the application""" """Shut down the application"""
try: try:
...@@ -421,7 +421,7 @@ class ApplicationManager(Folder,CacheManager): ...@@ -421,7 +421,7 @@ class ApplicationManager(Folder,CacheManager):
<body>Zope is shutting down</body></html> <body>Zope is shutting down</body></html>
""" """
@postonly @requestmethod('POST')
def manage_pack(self, days=0, REQUEST=None): def manage_pack(self, days=0, REQUEST=None):
"""Pack the database""" """Pack the database"""
...@@ -476,7 +476,7 @@ class ApplicationManager(Folder,CacheManager): ...@@ -476,7 +476,7 @@ class ApplicationManager(Folder,CacheManager):
r.append({'id': v}) r.append({'id': v})
return r return r
@postonly @requestmethod('POST')
def manage_saveVersions(self, versions, REQUEST=None): def manage_saveVersions(self, versions, REQUEST=None):
"Commit some versions" "Commit some versions"
db=self._p_jar.db() db=self._p_jar.db()
...@@ -485,7 +485,7 @@ class ApplicationManager(Folder,CacheManager): ...@@ -485,7 +485,7 @@ class ApplicationManager(Folder,CacheManager):
if REQUEST is not None: if REQUEST is not None:
REQUEST['RESPONSE'].redirect(REQUEST['URL1']+'/manage_main') REQUEST['RESPONSE'].redirect(REQUEST['URL1']+'/manage_main')
@postonly @requestmethod('POST')
def manage_discardVersions(self, versions, REQUEST=None): def manage_discardVersions(self, versions, REQUEST=None):
"Discard some versions" "Discard some versions"
db=self._p_jar.db() db=self._p_jar.db()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment