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/retrieve.py

    r5128 r5158  
    2222    to retrieve the doc remotely.  
    2323    ''' 
     24    def __before__(self): 
     25        ''' 
     26        Before anything is done, ensure the browse mode is enabled 
     27        - unless we're retrieving associated data then we can do this regardless 
     28        of the mode of operation 
     29        ''' 
     30        if not g.browseEnabled and not g.atomEditorEnabled:# request.path_info.startswith('/viewAssociatedData'): 
     31            logging.info("Browse mode not enabled - redirect to default") 
     32            return h.redirect_to(h.url_for('default')) 
     33 
     34 
     35    def home(self): 
     36        ''' 
     37        Display the browse home page 
     38        ''' 
     39        logging.debug("Displaying browse home page") 
     40        c.title = "Browse" 
     41         
     42        c.doc = "Use the search box above to find data centre metadata records"  
     43        return render('genshi', 'browse/home') 
     44 
    2445     
    2546    def __setup(self, uri): 
Note: See TracChangeset for help on using the changeset viewer.