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/atom_editor/atomeditorcontroller.py

    r5128 r5158  
    2121    REMOVE_ASSOCIATIONS = 4 
    2222 
     23    def __before__(self): 
     24        ''' 
     25        Before anything is done, ensure the atom editor is enabled 
     26        ''' 
     27        if not g.atomEditorEnabled: 
     28            logging.info("Editor not enabled - cannot edit atoms - redirecting to default") 
     29            return h.redirect_to(h.url_for('default')) 
     30         
     31 
    2332    def _setup(self, uri=None, loadAtom=True): 
    2433        '''  
     
    2837        Default is True.  
    2938        ''' 
    30         # check the editor is enabled first 
    31         if not g.atomEditorEnabled: 
    32             logging.info("Editor not enabled - cannot edit atoms - redirect to 'view' mode") 
    33             return h.redirect_to(h.url_for('discovery')) 
    3439 
    3540        logging.info("Setting up AtomEditorController") 
     
    137142 
    138143 
    139     def _handleError(self, e, template='atom_editor/error'): 
     144    def _handleError(self, e, template='error'): 
    140145        ''' 
    141146        Handle exceptions thrown; if debug mode on, display full stack trace 
Note: See TracChangeset for help on using the changeset viewer.