* get the data when requested from internal page * If-None-Match and eTags are being handled * * @param int $reportId * @param $filteroptions * @param $dataoptions * @param $chartoptions * @param $tableoptions * @return DataResponse|NotFoundResponse * @throws Exception */
(int $reportId, $filteroptions, $dataoptions, $chartoptions, $tableoptions)
| 81 | * @throws Exception |
| 82 | */ |
| 83 | #[NoAdminRequired] |
| 84 | public function read(int $reportId, $filteroptions, $dataoptions, $chartoptions, $tableoptions) { |
| 85 | $reportMetadata = $this->ReportService->read($reportId); |
| 86 | if (empty($reportMetadata)) $reportMetadata = $this->ShareService->getSharedReport($reportId); |
| 87 | |
| 88 | if (!empty($reportMetadata)) { |
| 89 | $reportMetadata = $this->evaluateCanFilter($reportMetadata, $filteroptions, $dataoptions, $chartoptions, $tableoptions); |
| 90 | if ($filteroptions === null) { |
| 91 | $reportMetadata['cacheKey'] = $this->getDatasourceCacheKey( |
| 92 | $reportMetadata, |
| 93 | $this->getRequestCacheKey() |
| 94 | ); |
| 95 | } |
| 96 | |
| 97 | // internal storage reports are validated directly against version |
| 98 | if ((int)$reportMetadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) { |
| 99 | $response = $this->evaluateIfNoneMatch($reportMetadata); |
| 100 | if ($response instanceof DataResponse && $filteroptions === null) { |
| 101 | return $response; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // external datasource caching is evaluated by datasource specific logic |
| 106 | return $this->returnDataWithCacheableHeader($reportMetadata, $filteroptions); |
| 107 | } else { |
| 108 | return new NotFoundResponse(); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * get the data when requested from a panorama |
no test coverage detected