Example #1
0
 def index_html(self, REQUEST=None):
     ''' Actually call through to roundup to handle the request.
     '''
     try:
         client = self.zr.roundup_opendb()
         # fake the path that roundup should use
         client.path = self.path
         # and call roundup to do something
         client.main()
         return ''
     except client.NotFound:
         raise 'NotFound', REQUEST.URL
         pass
     except:
         import traceback
         traceback.print_exc()
         # all other exceptions in roundup are valid
         raise
Example #2
0
 def index_html(self, REQUEST=None):
     ''' Actually call through to roundup to handle the request.
     '''
     try:
         client = self.zr.roundup_opendb()
         # fake the path that roundup should use
         client.path = self.path
         # and call roundup to do something 
         client.main()
         return ''
     except client.NotFound:
         raise 'NotFound', REQUEST.URL
         pass
     except:
         import traceback
         traceback.print_exc()
         # all other exceptions in roundup are valid
         raise
Example #3
0
    def index_html(self):
        '''Alias index_html to roundup's index
        '''
        # Redirect misdirected requests -- bugs 558867 , 565992
        # PATH_INFO, as defined by the CGI spec, has the *real* request path
        orig_path = self.REQUEST.environ['PATH_INFO']
        if orig_path[-1] != '/':
            url = urlparse.urlparse(self.absolute_url())
            url = list(url)  # make mutable
            url[2] = url[2] + '/'  # patch
            url = urlparse.urlunparse(url)  # reassemble
            RESPONSE = self.REQUEST.RESPONSE
            RESPONSE.setStatus("MovedPermanently")  # 301
            RESPONSE.setHeader("Location", url)
            return RESPONSE

        client = self.roundup_opendb()
        # fake the path that roundup should use
        client.split_path = ['index']
        return client.main()
Example #4
0
    def index_html(self):
        '''Alias index_html to roundup's index
        '''
        # Redirect misdirected requests -- bugs 558867 , 565992
        # PATH_INFO, as defined by the CGI spec, has the *real* request path
        orig_path = self.REQUEST.environ['PATH_INFO']
        if orig_path[-1] != '/' : 
            url = urlparse.urlparse( self.absolute_url() )
            url = list( url ) # make mutable
            url[2] = url[2]+'/' # patch
            url = urlparse.urlunparse( url ) # reassemble
            RESPONSE = self.REQUEST.RESPONSE
            RESPONSE.setStatus( "MovedPermanently" ) # 301
            RESPONSE.setHeader( "Location" , url )
            return RESPONSE

        client = self.roundup_opendb()
        # fake the path that roundup should use
        client.split_path = ['index']
        return client.main()