source: TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/view.py @ 5233

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/view.py@5233
Revision 5233, 1.5 KB checked in by cbyrom, 11 years ago (diff)

Add delete functionality to front tier of oai editor. Include
message to confirm the data has been completed, as a pop up, when
the operation is done. Update tests and simplify model + dal layer.

  • Property svn:executable set to *
Line 
1'''
2 Class representing pylons controller for the viewing of provider info by users to
3 update/create new Provider Info
4 
5 @author: C Byrom, Tessella Apr 2009
6'''
7import logging, urllib
8from oai_info_editor.lib.base import *
9from oai_info_editor.controllers.master import MasterController
10import oai_info_editor.lib.constants as const
11
12class ViewController(MasterController):
13
14    def viewProviderInfo(self, providerName):
15        '''
16        View the provider info associated with the input name
17        @param providerName: name of provider whose info should be displayed
18        '''
19        self._setUpController(providerName = providerName)
20        logging.info("Setting up page to display info for provider, '%s'" %providerName)
21
22        if not c.providerInfos:
23            raise ValueError("Unrecognised provider name, '%s'" %providerName)
24       
25        c.title = const.VIEW_PAGE_TITLE %providerName
26        if providerName == const.ALL_PROVIDER_IDS:
27            c.title = const.VIEW_ALL_DATA_TITLE
28                   
29        if c.user.isAdmin:
30            c.createLink = h.url_for('createProviderInfo')
31            # NB, these links are provider dependent and we can display several
32            # provider's data in a page - so finish constructing the links in the
33            # templates
34            c.editLink = h.url_for('editProviderInfo', providerName = '')
35            c.deleteLink = h.url_for('deleteProviderInfo', providerName = '')
36       
37        return self._renderTemplate('genshi', 'view_provider_infos')
38
Note: See TracBrowser for help on using the repository browser.