Package Products :: Package ZenUtils :: Package extdirect :: Package zope :: Module router |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenUtils.extdirect.zope.router

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2009, 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  from Products.ZenUtils.extdirect.router import DirectRouter
    14
    15 -class ZopeDirectRouter(DirectRouter):
    16 -    def __init__(self, context, request=None):
    17          self.context = context
    18          self.request = request
    19
    20 -    def __call__(self):
    21          body = self.request.get('BODY')
    22          self.request.response.setHeader('Content-Type', 'application/json')
    23          self.request.response.enableHTTPCompression(self.request)
    24          return super(ZopeDirectRouter, self).__call__(body)
    25