public function __construct($url, $arguments, $accept) { parent::__construct($url, $arguments, $accept); $this->fileURL = $this->getRequestArgument("url", "TO_BE_SET", "string"); //$this->fileURL = $this->getRequestArgument("file", $this->fileURL, "string"); $this->apiversion = $this->getRequestArgument("version", 1, "integer"); $maxCount = $this->apiConfig["query"]["queryLimit"] <= 0 ? PHP_INT_MAX : $this->apiConfig["query"]["queryLimit"]; $defaultCount = $this->apiConfig["query"]["queryDefault"]; $requestCount = $this->getRequestArgument("count", $defaultCount, "integer"); $this->count = $requestCount > $maxCount ? $maxCount : $requestCount; $this->download(); // download file if it is not local if (!($this->apiversion == 1)) { $this->response->setStatus(400); $this->errorMessage = "Version must be 1! "; } else { if (!is_null($this->localFile)) { // if the file is local or could be downloaded add a job // do something? $this->liveQuery(); } else { $this->response->setStatus(400); $this->errorMessage = "File could not be downloaded ! "; } } }
public function __construct($url, $arguments, $accept) { parent::__construct($url, $arguments, $accept); $this->guid = $this->getIDfromURL(); $this->file_id = $this->getIDfromGUID($this->guid); $this->collection = $this->getRequestArgument("collection", $this->apiConfig["databaseconstants"]["defaultCollection"], "string"); $this->deleteJob(); // add a job to the smafe job table }
public function __construct($url, $arguments, $accept) { parent::__construct($url, $arguments, $accept); $this->queryParameterId = $this->getIDfromURL(); // if the query is a track query the query parameter is a guid $this->queryFileGUID = $this->queryParameterId; $maxCount = $this->apiConfig["query"]["queryLimit"] <= 0 ? PHP_INT_MAX : $this->apiConfig["query"]["queryLimit"]; $defaultCount = $this->apiConfig["query"]["queryDefault"]; $requestCount = $this->getRequestArgument("count", $defaultCount, "integer"); $this->count = $requestCount > $maxCount ? $maxCount : $requestCount; $this->collection = $this->getRequestArgument("collection", $this->apiConfig["databaseconstants"]["defaultCollection"], "string"); $this->external_keys = $this->getRequestArgument("external_keys", $this->apiConfig["query"]["externalKeys"], "boolean"); $this->distance_values = $this->getRequestArgument("distance_values", $this->apiConfig["query"]["distanceValues"], "boolean"); }
public function __construct($url, $arguments, $accept) { parent::__construct($url, $arguments, $accept); $this->fileURL = $this->getRequestArgument("url", null, "string"); $this->fileURL = $this->getRequestArgument("file", $this->fileURL, "string"); $this->external_key = $this->getRequestArgument("external_key", null, "string"); $this->collection = $this->getRequestArgument("collection", $this->apiConfig["databaseconstants"]["defaultCollection"], "string"); $this->download(); // download file if it is not local if (!is_null($this->localFile)) { // if the file is local or could be downloaded add a job $this->addJob(); // add a job to the smafe job table } else { $this->response->setStatus(400); $msg = "File could not be downloaded: {$this->fileURL} ! "; $this->errorMessage = $msg; } }