Ignore:
Timestamp:
15/06/06 07:36:39 (13 years ago)
Author:
lawrence
Message:

More tiny fixes and tidier error handling in browse ...

Location:
TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse/DIF.py

    r1182 r1185  
    3333        self.binding=ServiceBinding(n=self.abbreviation, 
    3434                    entryID=self.entryID,serviceFile=serviceFile) 
    35         print self.entryID,self.binding.url 
     35         
    3636        #Note that entity.constraints.html is about access control on the metadata, 
    3737        #and so we don't populate this here ... 
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse/Utilities.py

    r1175 r1185  
    7878    result={} 
    7979    for item in cgiFieldStorage: 
    80         result[item]=cgiFieldStorage[item].value 
     80            result[item]=cgiFieldStorage[item].value 
    8181    return result 
    8282## 
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse/browseCGI.py

    r1182 r1185  
    121121                self.env=os.environ 
    122122                self.path=self.env.get('PATH_INFO','/') 
    123                 self.FieldStorage=getURLdict(cgi.FieldStorage()) 
    124                 self.config=config 
     123                try: # some apache problems result in nasty errors ... 
     124                    self.FieldStorage=getURLdict(cgi.FieldStorage()) 
     125                except Exception,e: 
     126                    self.FieldStorage={'Error':self.error('Error in url <br/>%s<br/> This is probably a known error :-)'%e)} 
     127                self.config=config 
    125128                self.response=Response() 
    126129                self.request=Request(self.env) 
     
    159162                #URI was self consistent using the request object. 
    160163                 
     164                if 'Error' in self.FieldStorage: 
     165                    content,name=self.FieldStorage['Error'],'URL Error' 
     166                    self.response.cookie=self.session.makeCookie(ndgSec=self.ndgSec) 
     167                     
    161168                if 'select' in self.FieldStorage: 
    162169                    n=self.FieldStorage['name'] 
     
    177184                    self.searchType=self.FieldStorage['search'] 
    178185                    content,name=self.__search() 
     186                elif 'Error' in self.FieldStorage: 
     187                    pass 
    179188                else:  
    180189                    content,name=self.error('No URI or search string. Begin browsing via search box or pass a specific URI argument.'),'No URI' 
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse/renderDiscoverySet.py

    r1175 r1185  
    108108        if state.offset+state.stride-1<state.hits: 
    109109            next1=state.offset+state.stride 
    110             nextNum=min(next1+state.stride,state.hits)-next1 
     110            nextNum=min(next1+state.stride,state.hits)+1-next1 
    111111            s1='Next %s'%nextNum 
    112112            nexturl='%s&start=%s&howmany=%s'%(selector.baseURL,next1,nextNum) 
Note: See TracChangeset for help on using the changeset viewer.