from AccessControl.SecurityInfo import ClassSecurityInfo from Products.Five import BrowserView from zope.component import getUtility from Products.iva.interfaces import IStatistics, IUserManager class WebtopFileDownloader(BrowserView): def __call__(self): REQUEST = self.context.request RESPONSE = REQUEST.RESPONSE if self.context.hasPermissionToView(REQUEST): getUtility(IStatistics)._viewedObject(REQUEST, self.context.getRelativeURL(self.context)) #if self.has_realname(): RESPONSE.setHeader('Content-Disposition','attachment; filename='+self.context.get_realname_or_id()) RESPONSE.setHeader('Connection', 'close') RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Expires', '-1') #RESPONSE.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate') RESPONSE.setHeader('Cache-Control', 'must-revalidate') return self.context.__class__.__bases__[1].index_html(self.context,REQUEST,RESPONSE) return class WebtopLinkViewer(BrowserView): def __call__(self): REQUEST = self.context.request getUtility(IStatistics)._viewedObject(REQUEST, self.context.getRelativeURL(self.context)) return REQUEST.RESPONSE.redirect(self.context.get_url()) class PortfolioViewer(BrowserView): def __call__(self): REQUEST = self.context.request url = self.context.absolute_url() if 'subgroups' in url: return REQUEST.RESPONSE.redirect(url+'/wt_index_html.html') return REQUEST.RESPONSE.redirect(url+'/portfolio_index.html')