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

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

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2011, 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.Five.browser import BrowserView
    12  from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
    13
    14 -class ExtDirectJsView(BrowserView):
    15      template = ViewPageTemplateFile('extdirect.js.pt')
    16
    17 -    def __call__(self, *args, **kwargs):
    18          self.request.response.enableHTTPCompression(REQUEST=self.request)
    19          self.request.response.setHeader('Content-Type', 'text/javascript')
    20          return self.template()
    21
    22 -class JsonApiJsView(BrowserView):
    23      template = ViewPageTemplateFile('jsonapi.js.pt')
    24
    25 -    def __call__(self, *args, **kwargs):
    26          self.request.response.enableHTTPCompression(REQUEST=self.request)
    27          self.request.response.setHeader('Content-Type', 'text/javascript')
    28          return self.template()
    29