Package Products :: Package ZenWidgets |
[hide private]
[frames] | no frames]

# Source Code for Package Products.ZenWidgets

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  """__init__
    12
    13  Initializer for ZenTableManager
    14
    15  $Id: __init__.py,v 1.3 2004/04/04 23:56:49 edahl Exp $"""
    16
    17  __version__ = 0.5
    18  __revision__ = "$Revision: 1.3 $"[11:-2]
    19
    20
    21  from Products.Five.browser import BrowserView
    22  from ZenTableManager import ZenTableManager
    23  from ZenTableManager import manage_addZenTableManager
    24
    25  try:
    26      from Products.CMFCore.DirectoryView import registerDirectory
    27      registerDirectory('skins', globals())
    28  except ImportError: pass
    29
    30  from ZenossPortlets.ZenossPortlets import register_default_portlets
    31
    32 -def update_portlets(app):
    33      """
    34      Reread in portlet source on startup. If this is the initial load, and
    35      objects don't exist yet, don't do anything.
    36      """
    37      if hasattr(app, 'zport') and hasattr(app.zport, 'ZenPortletManager'):
    38          register_default_portlets(app.zport.ZenPortletManager)
    39          for pack in app.zport.dmd.ZenPackManager.packs():
    40              for portlet in getattr(pack, 'register_portlets', lambda *x:())():
    41                  app.zport.ZenPortletManager.register_extjsPortlet(**portlet)
    42
    43 -def initialize(registrar):
    44      registrar.registerClass(
    45          ZenTableManager,
    46          permission="Add ZenTableManager",
    47          constructors = (manage_addZenTableManager,),
    48          icon = "ZenTableManager_icon.gif"
    49      )
    50
    51 -def registerPortlets(event):
    52      """
    53      Handler for IZopeApplicationOpenedEvent which registers portlets.
    54      """
    55      update_portlets(event.app)
    56
    57  # Enable gzip compression of static files
    58  import FileGzipper
    59  if 0:
    60      FileGzipper = None                  # pyflakes
    61
    62 -class ExtJSShortcut(BrowserView):
    63 -    def __getitem__(self, name):
    64          return self.context.unrestrictedTraverse('++resource++extjs')[name]
    65