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

# Source Code for Module Products.ZenWidgets.ZenossPortlets.ZenossPortlets

     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  import os
    12  from Products.ZenModel.ZenossSecurity import *
    13
    14 -def _portletpath(*args):
    15      """
    16      Shortcut, since these all live in the same directory. Portlet needs a path
    17      relative to $ZENHOME.
    18      """
    19      return os.path.join('Products','ZenWidgets','ZenossPortlets', *args)
    20
    21  portlets = [
    22      {
    23       'sourcepath':  _portletpath('HeartbeatsPortlet.js'),
    24       'id':          'HeartbeatsPortlet',
    25       'title': 'Daemon Processes Down',
    26       'permission':  ZEN_MANAGE_DMD
    27      },
    28      {
    29       'sourcepath':  _portletpath('GoogleMapsPortlet.js'),
    30       'id':          'GoogleMapsPortlet',
    31       'title': 'Google Maps',
    32       'permission':  ZEN_VIEW
    33      },
    34      {
    35       'sourcepath':  _portletpath('SiteWindowPortlet.js'),
    36       'id':          'SiteWindowPortlet',
    37       'title': 'Site Window',
    38       'permission':  ZEN_VIEW
    39      },
    40      {
    41       'sourcepath':  _portletpath('DeviceIssuesPortlet.js'),
    42       'id':          'DeviceIssuesPortlet',
    43       'title': 'Device Issues',
    44       'permission':  ZEN_COMMON
    45      },
    46      {
    47       'sourcepath':  _portletpath('TopLevelOrgsPortlet.js'),
    48       'id':          'TopLevelOrgsPortlet',
    49       'title': 'Top Level Organizers',
    50       'permission':  ZEN_VIEW
    51      },
    52      {
    53       'sourcepath':  _portletpath('WatchListPortlet.js'),
    54       'id':          'WatchListPortlet',
    55       'title': 'Watch List',
    56       'permission':  ZEN_COMMON
    57      },
    58      {
    59       'sourcepath':  _portletpath('productionStatePortlet.js'),
    60       'id':          'ProdStatePortlet',
    61       'title': 'Production States',
    62       'permission':  ZEN_COMMON
    63      },
    64      {
    65       'sourcepath':  _portletpath('userMessagesPortlet.js'),
    66       'id':          'UserMsgsPortlet',
    67       'title': 'Messages',
    68       'permission':  ZEN_COMMON
    69      },
    70  ]
    71
    72 -def register_default_portlets(portletmanager):
    73      for portlet in portlets:
    74          portletmanager.register_portlet(**portlet)
    75