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

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

Fixed to async argument handler working.

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
15from 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        # Now work out which authorisedRoles are associated with this Process ID
43        # and this set of arguments
44        rh = RoleHandler()
45        authorisedRoles = rh.getRoleNumberFromProcessIDAndArgs(context.config['identifier'], context.inputs)     
46
47        responseXML = xml_renderer.wrapExecuteResponse(context, context.config['identifier'], '0.4.0', context.inputs, 
48                      requestId,
49                      authorisedRoles = authorisedRoles)
50
51        response.content_type = 'text/xml'
52       
53        context.close()
54        return responseXML
55
Note: See TracBrowser for help on using the repository browser.