Ignore:
Timestamp:
01/04/09 17:08:10 (11 years ago)
Author:
cbyrom
Message:

Add new home page for the browse service + implement usage of the
before methods on controllers to check if MILK is set up to
allow the various services before the controller methods are invoked.
Also add a top level default controller to redirect user to the correct
home page depending on the mode of operation + improve styles,
remove unused controller and move error template to more general top
level - for re-use across the MILK stack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/discovery.py

    r5136 r5158  
    1717 
    1818class DiscoveryController(BaseController): 
    19     ''' Provides the pylons controller for NDG discovery ''' 
    20      
     19    '''  
     20    Provides the pylons controller for NDG discovery  
     21    ''' 
     22 
    2123    def __setup(self): 
    2224        ''' Common setup for controller methods ''' 
     
    3234         
    3335        # parse the query string and hand off to a discovery engine 
    34         if self.inputs=={} or 'ClearForm' in self.inputs:  
    35             return self.__advancedPrompt() 
     36        if self.inputs=={} or 'ClearForm' in self.inputs: 
     37            if g.discoveryEnabled: 
     38                return self.__advancedPrompt() 
     39            else: 
     40                logging.info("Discovery mode not enabled - redirect to default") 
     41                return h.redirect_to(h.url_for('default')) 
    3642        
    3743        # see if this is a discovery search or a more complicated search 
     
    4248        continuations={'start':1,'howmany':10} 
    4349        for i in continuations: 
    44             if i not in self.inputs: self.inputs[i]=continuations[i] 
    45              
     50            if i not in self.inputs:  
     51                self.inputs[i]=continuations[i] 
    4652             
    4753        # the simplest query we might get is a text search, in which case 
Note: See TracChangeset for help on using the changeset viewer.