source: cows_wps/trunk/cows_wps/controllers/status.py @ 7531

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows_wps/trunk/cows_wps/controllers/status.py@7531
Revision 7531, 1.7 KB checked in by astephen, 10 years ago (diff)

added authorised roles to check user can access this resource.

Line 
1import os
2import glob
3import logging
4
5from cows.exceptions import *
6from cows.pylons.ows_controller import render_ows_exception
7
8from cows_wps.controllers import *
9from cows_wps import utils
10from cows_wps.model.managers import requestManager
11from cows_wps.process_handler.context.process_context import ProcessContext
12from cows_wps.renderer import xml_renderer
13
14from cows_wps.utils.parse_wps_config import wps_config_dict
15#from cows_wps.utils.role_handler import RoleHandler
16
17from cows_wps.model.managers import requestManager
18
19log = logging.getLogger(__name__)
20
21#                responseXML = xml_renderer.wrapExecuteResponse(context, identifier, self.validVersions[0], input_dict, requestId)
22
23
24class StatusController(BaseController):
25
26    def index(self, requestId):
27        try:
28            request = requestManager.getRequest(requestId)
29        except ValueError:
30            requestManager._logRequests()
31            log.exception("Exception occurred in status controller:")
32           
33            response.content_type = 'text/xml'
34            response.status = 400
35            return render_ows_exception(InvalidParameterValue('Request %s not found' % requestId))
36           
37#        return str(dir(request.job))
38        processDir = request.job.process_dir
39        context = ProcessContext(processDir).open()
40        #!FIXME: Remove hard-coded version
41
42     
43#        rh = RoleHandler()
44
45        responseXML = xml_renderer.wrapExecuteResponse(context, context.config['identifier'], '0.4.0', context.inputs, 
46                      requestId,
47                      authorisedRoles="0")
48
49        response.content_type = 'text/xml'
50       
51        context.close()
52        return responseXML
53
Note: See TracBrowser for help on using the repository browser.