[Zope-CVS] CVS: Products/QueueCatalog - QueueCatalog.py:1.2 __init__.py:1.2 Delegation.dtml:NONE Statistics.dtml:NONE add.pt:NONE
Jens Vagelpohl
jens@zope.com
Tue, 6 Aug 2002 12:56:04 -0400
Update of /cvs-repository/Products/QueueCatalog
In directory cvs.zope.org:/tmp/cvs-serv17740
Modified Files:
QueueCatalog.py __init__.py
Removed Files:
Delegation.dtml Statistics.dtml add.pt
Log Message:
- changed package structure to conform to the current standards
- updated and expanded ZMI screens
- changed some names so they are more obvious
=== Products/QueueCatalog/QueueCatalog.py 1.1 => 1.2 ===
from CatalogEventQueue import CatalogEventQueue, EVENT_TYPES, ADDED_EVENTS
from CatalogEventQueue import ADDED, CHANGED, CHANGED_ADDED, REMOVED
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Globals import HTMLFile
+from Globals import DTMLFile
from Acquisition import Implicit
StringType = type('')
@@ -208,22 +208,26 @@
# out the PageTemplateFiles in some brittle way to make them do
# the right thing. :(
- manage_Delegation = HTMLFile('Delegation', globals())
+ manage_editForm = DTMLFile('dtml/edit', globals())
def manage_getLocation(self):
return self._location or ''
- def manage_setDelegation(self, location, RESPONSE=None):
- "Change the catalog delegated to"
- self.setLocation(location or None)
- if RESPONSE is not None:
- RESPONSE.redirect('manage_Delegation')
+ def manage_edit(self, title='', location='', REQUEST=None):
+ """ Edit the instance """
+ self.title = title
+ self.setLocation(location or None)
- return location
+ if REQUEST is not None:
+ msg = 'Properties changed'
+ return self.manage_editForm( self
+ , REQUEST
+ , manage_tabs_message=msg
+ )
- manage_Statistics = HTMLFile('Statistics', globals())
+ manage_queue = DTMLFile('dtml/queue', globals())
def manage_size(self):
size = 0
@@ -232,14 +236,18 @@
return size
- def manage_process(self, RESPONSE):
+ def manage_process(self, REQUEST):
"Web UI to manually process queues"
-
# make sure we have necessary perm
self.getZCatalog('catalog_object')
self.getZCatalog('uncatalog_object')
self.process()
- RESPONSE.redirect('manage_Statistics')
+
+ msg = 'Queue processed'
+ return self.manage_queue( self
+ , REQUEST
+ , manage_tabs_message=msg
+ )
# Provide Zope 2 offerings
@@ -250,11 +258,11 @@
__allow_access_to_unprotected_subobjects__ = 0
manage_options=(
(
- {'label': 'Delegation', 'action': 'manage_Delegation',
- 'help':('QueueCatalog','QueueCatalog-Delegation.stx')},
+ {'label': 'Configure', 'action': 'manage_editForm',
+ 'help':('QueueCatalog','QueueCatalog-Configure.stx')},
- {'label': 'Statistics', 'action': 'manage_Statistics',
- 'help':('QueueCatalog','QueueCatalog-Statistics.stx')},
+ {'label': 'Queue', 'action': 'manage_queue',
+ 'help':('QueueCatalog','QueueCatalog-Queue.stx')},
)
+SimpleItem.manage_options
)
@@ -268,8 +276,8 @@
security.declareProtected(
'View management screens',
- 'manage_Delegation', 'manage_setDelegation',
- 'manage_Statistics', 'manage_getLocation',
+ 'manage_editForm', 'manage_edit',
+ 'manage_queue', 'manage_getLocation',
'manage_size'
)
=== Products/QueueCatalog/__init__.py 1.1 => 1.2 ===
# Placeholder for Zope Product data
misc_ = {}
+from Globals import DTMLFile
from QueueCatalog import QueueCatalog
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-manage_addQueueCatalogForm = PageTemplateFile(
- 'add.pt', globals(), __name__='manage_addQueueCatalogForm')
+manage_addQueueCatalogForm = DTMLFile('dtml/add', globals())
-
-def manage_addQueueCatalog(self, id, REQUEST=None):
+def manage_addQueueCatalog(self, id, title='', location=None, REQUEST=None):
"Add a Catalog Queue"
ob = QueueCatalog()
ob.id = id
+ ob.manage_edit(title, location)
self._setObject(id, ob)
- if REQUEST is not None:
+ if REQUEST is not None:
try:
u = self.DestinationURL()
except AttributeError:
@@ -46,7 +45,8 @@
QueueCatalog,
permission='Add ZCatalogs',
constructors=(manage_addQueueCatalogForm, manage_addQueueCatalog, ),
- icon='QueueCatalog.gif',
+ icon='www/QueueCatalog.gif',
)
- #context.registerHelp()
- #context.registerHelpTitle('Zope Help')
+
+ context.registerHelp()
+ context.registerHelpTitle('Zope Help')
=== Removed File Products/QueueCatalog/Delegation.dtml ===
=== Removed File Products/QueueCatalog/Statistics.dtml ===
=== Removed File Products/QueueCatalog/add.pt ===