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

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

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