Author: jmorliaguet
Date: Fri Apr 21 16:53:17 2006
New Revision: 2926

Added:
   CPSSkins4Five/trunk/themesfolder.py   (contents, props changed)
Modified:
   CPSSkins4Five/trunk/CPSSkinsSiteInstaller.py
   CPSSkins4Five/trunk/info.pt
   CPSSkins4Five/trunk/views.py
Log:

- added a info view

- the theme management folder is registered as a local utility



Modified: CPSSkins4Five/trunk/CPSSkinsSiteInstaller.py
==============================================================================
--- CPSSkins4Five/trunk/CPSSkinsSiteInstaller.py        (original)
+++ CPSSkins4Five/trunk/CPSSkinsSiteInstaller.py        Fri Apr 21 16:53:17 2006
@@ -28,16 +28,11 @@
 # zope3
 from zope.app.component.hooks import setSite
 
-from cpsskins.thememanager import ThemeManagementFolder
-
-def donothing(object):
-    pass
-
-ThemeManagementFolder.manage_fixupOwnershipAfterAdd = donothing
-
+from cpsskins.thememanager import IThemeManagementFolder
 
 # CPSSkins4Five
 from Products.CPSSkins4Five.site import CPSSkinsSite
+from Products.CPSSkins4Five.themesfolder import ThemesFolder
 
 manage_addInstaller = Globals.DTMLFile('zmi/addCPSSkinsSiteForm', globals())
 
@@ -46,6 +41,8 @@
 
 Globals.InitializeClass(Installer)
 
+from OFS.Folder import Folder
+
 def manage_addCPSSkinsSite(dispatcher, id, REQUEST=None):
     """CPSSkins Site installer"""
 
@@ -61,11 +58,10 @@
 
     sm = site.getSiteManager()
 
-    tmutil = ThemeManagementFolder()
-    site._setObject('themes', tmutil)
+    tmutil = ThemesFolder()
 
-    # TODO
-    # register folder as a local utility
+    # register the themes folder as a local utility
+    sm.registerUtility(IThemeManagementFolder, tmutil)
 
     if REQUEST is not None:
         url = dispatcher.DestinationURL()

Modified: CPSSkins4Five/trunk/info.pt
==============================================================================
--- CPSSkins4Five/trunk/info.pt (original)
+++ CPSSkins4Five/trunk/info.pt Fri Apr 21 16:53:17 2006
@@ -1,3 +1,22 @@
+<html>
+<head>
+  <title>Site information</title>
+
+  <style type="text/css">
+  body {
+    font: 11px Verdana, Arial, sans-serif;
+  }
+  h1 {
+    font-size: 1.5em;
+  }
+  h2 {
+    font-size: 1.3em;
+    border-bottom: 1px solid gray;
+  }
+  </style>
+</head>
+
+<body>
 
 <h1>Site info</h1>
 
@@ -6,3 +25,33 @@
 
 <h2>Theme management folder</h2>
 <tal:block content="view/getThemeManagementFolder" />
+
+<h2>Id registry</h2>
+<tal:block content="view/getIdRegistry" />
+
+<h2>Image cache</h2>
+<tal:block content="view/getImageCache" />
+
+<h2>Relation storage</h2>
+<tal:block content="view/getRelationStorage" />
+
+<h2>Display storage</h2>
+<tal:block content="view/getDisplayStorage" />
+
+<h2>Format storage</h2>
+<tal:block content="view/getFormatStorage" />
+
+<h2>Display storage</h2>
+<tal:block content="view/getDisplayStorage" />
+
+<h2>Portlet storage</h2>
+<tal:block content="view/getPortletStorage" />
+
+<h2>Snapshot storage</h2>
+<tal:block content="view/getSnapshotStorage" />
+
+<h2>Settings</h2>
+<tal:block content="view/getSettings" />
+
+</body>
+</html>

Added: CPSSkins4Five/trunk/themesfolder.py
==============================================================================
--- (empty file)
+++ CPSSkins4Five/trunk/themesfolder.py Fri Apr 21 16:53:17 2006
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2006 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+from OFS.SimpleItem import SimpleItem
+
+from cpsskins.thememanager import ThemeManagementFolder
+
+class ThemesFolder(ThemeManagementFolder, SimpleItem):
+    """Theme management folder for Zope2"""

Modified: CPSSkins4Five/trunk/views.py
==============================================================================
--- CPSSkins4Five/trunk/views.py        (original)
+++ CPSSkins4Five/trunk/views.py        Fri Apr 21 16:53:17 2006
@@ -34,4 +34,29 @@
         return getSiteManager(self.context)
 
     def getThemeManagementFolder(self):
-        return 
getSiteManager(self.context).queryUtility(IThemeManagementFolder)
+        return self.getSiteManager().queryUtility(IThemeManagementFolder)
+
+    def getIdRegistry(self):
+        return self.getThemeManagementFolder().getIdRegistry()
+
+    def getImageCache(self):
+        return self.getThemeManagementFolder().getImageCache()
+
+    def getRelationStorage(self):
+        return self.getThemeManagementFolder().getRelationStorage()
+
+    def getDisplayStorage(self):
+        return self.getThemeManagementFolder().getDisplayStorage()
+
+    def getFormatStorage(self):
+        return self.getThemeManagementFolder().getFormatStorage()
+
+    def getPortletStorage(self):
+        return self.getThemeManagementFolder().getPortletStorage()
+
+    def getSnapshotStorage(self):
+        return self.getThemeManagementFolder().getSnapshotStorage()
+
+    def getSettings(self):
+        return self.getThemeManagementFolder().getSettings()
+
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to