* get the data when requested from a panorama * Special checks are performed to ensure, that the report is really part of the shared panorama * If-None-Match and eTags are being handled * * @param int $reportIds * @return DataResponse|NotFoundResponse * @throws Exception */
(int $reportId)
| 116 | * @throws Exception |
| 117 | */ |
| 118 | #[NoAdminRequired] |
| 119 | public function readPanorama(int $reportId) { |
| 120 | $reportMetadata = $this->ReportService->read($reportId); |
| 121 | if (empty($reportMetadata)) $reportMetadata = $this->ShareService->getSharedPanoramaReport($reportId); |
| 122 | |
| 123 | if (!empty($reportMetadata)) { |
| 124 | $reportMetadata['cacheKey'] = $this->getRequestCacheKey(); |
| 125 | |
| 126 | // internal storage reports are validated directly against version |
| 127 | if ((int)$reportMetadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) { |
| 128 | $response = $this->evaluateIfNoneMatch($reportMetadata); |
| 129 | if ($response instanceof DataResponse) { |
| 130 | return $response; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | // external datasource caching is evaluated by datasource specific logic |
| 135 | return $this->returnDataWithCacheableHeader($reportMetadata, null); |
| 136 | } else { |
| 137 | return new NotFoundResponse(); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | private function returnDataWithCacheableHeader($reportMetadata, $filteroptions) { |
| 142 | $result = $this->getData($reportMetadata); |
nothing calls this directly
no test coverage detected