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  # Copyright (C) Zenoss, Inc. 2009, 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  from Products.ZenUtils.extdirect.router import DirectRouter
    12
    13 -class ZopeDirectRouter(DirectRouter):
    14 -    def __init__(self, context, request=None):
    15          self.context = context
    16          self.request = request
    17
    18 -    def __call__(self):
    19          body = self.request.get('BODY')
    20          self.request.response.setHeader('Content-Type', 'application/json')
    21          self.request.response.enableHTTPCompression(self.request)
    22          return super(ZopeDirectRouter, self).__call__(body)
    23