11
11
class agWebservicesActions extends agActions
13
public function executeIndex(sfWebRequest $request)
15
$this->setTemplate('index');
19
* List action - web interface which lists data from available datapoints.
20
* Sets the template to render the listSuccess.php which decides
21
* the subpage to be correctly rendered
22
* @param sfWebRequest $request
24
public function executeList(sfWebRequest $request)
26
$this->type = $request->getParameter('datapoint');
27
$method = 'get'.ucfirst($this->type);
28
$this->results = agWebservicesHelper::$method(array());
32
* Get action - Grabs data from database if a valid token is passed.
33
* It uses a parameter to specify which datapoint is
34
* going to be returned.
35
* Route pattern: /webservices/:datapoint.:sf_format/:token
36
* - token: allows or blocks a request (checks valid web service client)
37
* - datapoint: which datapoint will be reached
38
* - sf_format - dictates whether a json or a xml will be created
39
* - url_param - a query string that contains allowed parameters to filter data
41
* @param sfWebRequest $request
43
public function executeGet(sfWebRequest $request)
45
$parameters = $request->getParameter('url_param');
46
$this->getRoute()->getObjects();
47
$this->type = $request->getParameter('datapoint');
48
$method = 'get'.ucfirst($this->type);
49
parse_str($request->getParameter('url_param'), $filters);
50
$this->results = agWebservicesHelper::$method($filters);
54
* Post action - Inserts data into the data from a valid JSON. Yet to be done.
55
* @param sfWebRequest $request
57
public function executePost(sfWebRequest $request)
59
// Not implemented yet
13
public function executeIndex(sfWebRequest $request)
15
$this->setTemplate('index');
19
* List action - web interface which lists data from available datapoints.
20
* Sets the template to render the listSuccess.php which decides
21
* the subpage to be correctly rendered
22
* @param sfWebRequest $request
24
public function executeList(sfWebRequest $request)
26
$this->type = $request->getParameter('datapoint');
27
$method = 'get'.ucfirst($this->type);
28
$this->results = agWebservicesHelper::$method();
32
* Get action - Grabs data from database if a valid token is passed.
33
* It uses a parameter to specify which datapoint is
34
* going to be returned.
35
* Route pattern: /webservices/get/:token/:datapoint.:format
36
* - token: allows or blocks a request (checks valid web service client)
37
* - datapoint: which datapoint will be reached
38
* - format - dictates whether a json or a xml will be created
40
* @param sfWebRequest $request
42
public function executeGet(sfWebRequest $request)
44
$this->getRoute()->getObjects();
45
$this->type = $request->getParameter('datapoint');
46
$method = 'get'.ucfirst($this->type);
47
$this->results = agWebservicesHelper::$method();
63
51
public function executeGetevent(sfWebRequest $request)
65
$this->getRoute()->getObjects();
66
$this->type = $request->getParameter('datapoint');
67
$method = 'get'.ucfirst($this->type);
68
$this->results = agWebservicesHelper::$method($request->getParameter('event'));
53
$this->getRoute()->getObjects();
54
$this->type = $request->getParameter('datapoint');
55
$method = 'get'.ucfirst($this->type);
56
$this->results = agWebservicesHelper::$method($request->getParameter('event'));
b'\\ No newline at end of file'