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

# Source Code for Package Products.ZenWidgets

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 or (at your
     8  # option) any later version as published by the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  """__init__
    15
    16  Initializer for ZenTableManager
    17
    18  $Id: __init__.py,v 1.3 2004/04/04 23:56:49 edahl Exp $"""
    19
    20  __version__ = 0.5
    21  __revision__ = "$Revision: 1.3 $"[11:-2]
    22
    23
    24  from Products.Five.browser import BrowserView
    25  from ZenTableManager import ZenTableManager
    26  from ZenTableManager import manage_addZenTableManager
    27
    28  try:
    29      from Products.CMFCore.DirectoryView import registerDirectory
    30      registerDirectory('skins', globals())
    31  except ImportError: pass
    32
    33  from ZenossPortlets.ZenossPortlets import register_default_portlets
    34
    35 -def update_portlets(app):
    36      """
    37      Reread in portlet source on startup. If this is the initial load, and
    38      objects don't exist yet, don't do anything.
    39      """
    40      if hasattr(app, 'zport') and hasattr(app.zport, 'ZenPortletManager'):
    41          register_default_portlets(app.zport.ZenPortletManager)
    42          for pack in app.zport.dmd.ZenPackManager.packs():
    43              for portlet in getattr(pack, 'register_portlets', lambda *x:())():
    44                  app.zport.ZenPortletManager.register_extjsPortlet(**portlet)
    45
    46 -def initialize(registrar):
    47      registrar.registerClass(
    48          ZenTableManager,
    49          permission="Add ZenTableManager",
    50          constructors = (manage_addZenTableManager,),
    51          icon = "ZenTableManager_icon.gif"
    52      )
    53      update_portlets(registrar._ProductContext__app)
    54
    55  # Enable gzip compression of static files
    56  import FileGzipper
    57  if 0:
    58      FileGzipper = None                  # pyflakes
    59
    60 -class ExtJSShortcut(BrowserView):
    61 -    def __getitem__(self, name):
    62          return self.context.unrestrictedTraverse('++resource++extjs')[name]
    63