Display a requested page from an html report

@param  string $requestId The request id of the cached report
@param  string $page      The page number to display

@return JsonResponse      JsonResponse with the
495050
public function getPageAction($requestId, $page) {
        $response = $this->loadPage($requestId, $page);
        $response['toolbar'] = $this->container->get('mesd.jasper.reportviewer.linkhelper')->generateToolbarLinks(
            $requestId, $response['page'], $response['totalPages']);

        return new JsonResponse($response);
    }
854115
public function getPage($pageId)
    {
        if (!empty($this->pages[$pageId])) {
            return $this->pages[$pageId];
        } else {
            throw new HTML_QuickForm2_NotFoundException(
                "Unknown page '{$pageId}'"
            );
        }
    }
119580
public function page(string $id, Request $request, SalesChannelContext $context): Response
    {
        if (!$id) {
            throw new MissingRequestParameterException('Parameter id missing');
        }

        $page = $this->load($id, $request, $context);

        return $this->renderStorefront('@Storefront/page/content/detail.html.twig', ['cmsPage' => $page]);
    }
888360
public function index($page = null)
    {
        $url = sprintf('buckets/%d/webhooks.json', $this->bucket);

        $webhooks = $this->client->get($url, [
            'query' => [
                'page' => $page,
            ]
        ]);

        return $this->indexResponse($webhooks, Webhook::class)->map(function ($webhook) {
            $webhook->inContext($this->bucket);
            return $webhook;
        });
    }
1298724
protected function getRequest(array $requestArguments = [], $pageId = 0, $languageId = 0)
    {
        $searchRequest = GeneralUtility::makeInstance(SearchRequest::class,
            /** @scrutinizer ignore-type */ $requestArguments,
            /** @scrutinizer ignore-type */ $pageId,
            /** @scrutinizer ignore-type */ $languageId,
            /** @scrutinizer ignore-type */ $this->typoScriptConfiguration);
        return $searchRequest;
    }
700306
public function deletePage($page_id)
    {
        try {
            return json_decode($this->getClient()->delete('content/' . $page_id)->getBody(), true);
        } catch (BadResponseException $e) {
            throw $this->handleError($e);
        }
    }
1346545
public function deleteAction(Request $request, Page $page)
    {
        if ($page->isLocked()) {
            throw $this->createNotFoundException(sprintf('Page "%s" is locked.', $page->getId()));
        }

        $form = $this->createDeleteForm($page->getId());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $channel = $this->getSelectedChannel();

            $dm = $this->getDocumentManager();

            $dm->remove($page);
            $dm->flush();

            $this->get('integrated_page.services.route_cache')->clear();

            $this->get('braincrafted_bootstrap.flash')->success('Page deleted');

            return $this->redirect($this->generateUrl('integrated_page_page_index', ['channel' => $channel->getId()]));
        }

        return [
            'page' => $page,
            'form' => $form->createView(),
        ];
    }
64867
public function dump($requestId, $request, $response)
    {
        if (empty($requestId)) {
            throw new \InvalidArgumentException('The request ID cannot be empty.');
        }

        $dir = $this->rootDir . '/' . substr($requestId, 0, 2) . '/' . substr($requestId, 2, 1);

        $this->ensureDirectoryExists($dir);

        $this->saveFile($dir . '/' . $requestId . '_req.data', $request);
        $this->saveFile($dir . '/' . $requestId . '_resp.data', $response);
    }
837968
public function get($page, $pageSize, $websiteId = null, $storeId = null)
    {
        $this
            ->initCollection()
            ->filterMixedParam($websiteId, 'website_id')
            ->filterMixedParam($storeId, 'store_id')
            ->joinAddress('billing')
            ->joinAddress('shipping')
            ->joinSubscriptionStatus()
            ->setPage($page, $pageSize);

        return $this->customersResponseFactory->create()
            ->setCurrentPage($this->customerCollection->getCurPage())
            ->setLastPage($this->customerCollection->getLastPageNumber())
            ->setPageSize($this->customerCollection->getPageSize())
            ->setTotalCount($this->customerCollection->getSize())
            ->setCustomers($this->handleCustomers());
    }
1319635
public function getCmsResponse(
        Site $site,
        Page $page,
        $revisionId = null
    ) {
        $pageRenderer = $this->getPageRenderer();

        $response = new \Rcm\Http\Response();
        $layoutView = $this->layout();
        $viewModel = new ViewModel();

        return $pageRenderer->renderZf2ByName(
            $response,
            $layoutView,
            $viewModel,
            $site,
            $page->getName(),
            $page->getPageType(),
            $revisionId
        );
    }
969728
public function cachePoints($metricId, $num = 1000, $page = 1)
    {
        // If cache already exists return it
        if ($this->cached != null) {
            return $this->cached;
        }

        $this->cached = $this->client->call(
            'GET',
            "metrics/$metricId/points",
            [
                'query' => [
                    'per_page' => $num,
                    'current_page' => $page,
                ],
            ]
        );

        return $this->cached;
    }
67492
public function indexAction(Request $request, $page = null)
    {
        $em = $this->getDoctrine()->getManager();

        $category = null;
        $category_slug = $request->get('category', null);
        $category = $em->getRepository('AmulenClassificationBundle:Category')->findOneBySlug($category_slug);

        /* seo metadata */
        $seoPage = $this->container->get('sonata.seo.page');
        $baseTitle = $seoPage->getTitle();
        $title = "Productos - " . $baseTitle;
        $seoPage->setTitle($title);

        /* @var SettingsService $settingSrv */
        $settingSrv = $this->get('amulen.shop.settings');
        $isAvailable = $settingSrv->shopIsAvailable();

        /* pagination */
        $pageNumber = $request->get('page') ? $request->get('page') : 1;
        $products = $this->getDoctrine()->getRepository("AmulenShopBundle:Product")->findEnabledByPageAndCategory($category_slug);

        /* Filter */
        $formFilter = $this->createForm($this->get("amulen.shop.form.filter.shop"), null, array(
            'action' => $this->generateUrl('product'),
            'method' => 'GET',
        ));
        $formFilter->handleRequest($request);
        if ($formFilter->isValid()) {
            $productService = $this->get("amulen.shop.product");
            $products = $productService->addFilterConditions($formFilter, $products, $request->get('search'));
        }

        $pagination = $this->get('knp_paginator')->paginate($products, $pageNumber, 4);

        return array(
            'shop_is_available' => $isAvailable,
            'pagination' => $pagination,
            'category' => $category,
            'page' => $page,
            'formFilter' => $formFilter->createView(),
            'search' => $request->get('search'),
            'priceSort' => $request->get('priceSort')
        );
    }
724817
private function dispatchRequest(int $requestId): int
    {
        $request = new Request(
            $this->requests[$requestId]['params'],
            $this->requests[$requestId]['stdin']
        );

        try {
            $response = $this->kernel->handleRequest($request);
        } finally {
            $request->cleanUploadedFiles();
        }

        if ($response instanceof ResponseInterface) {
            $this->sendResponse($requestId, $response);
        } elseif ($response instanceof HttpFoundationResponse) {
            $this->sendHttpFoundationResponse($requestId, $response);
        } else {
            throw new \LogicException('Kernel must return a PSR-7 or HttpFoundation response message');
        }

        $this->endRequest($requestId);

        // This method exists on PSR-7 and Symfony responses
        return $response->getStatusCode();
    }
1343484
private function writeResponse(int $requestId, string $headerData, $stream): void
    {
        $data = $headerData;
        $eof  = false;
        $maxSize = 65535;
        fseek($stream, 0, SEEK_SET);

        do {
            $dataLength = strlen($data);

            if ($dataLength < $maxSize && !$eof && !($eof = feof($stream))) {
                $readLength  = $maxSize - $dataLength;
                $data       .= fread($stream, $readLength);
                $dataLength  = strlen($data);
            }

            $writeSize = min($dataLength, $maxSize);
            $writeData = substr($data, 0, $writeSize);
            $data      = substr($data, $writeSize);

            $this->writeRecord($requestId, DaemonInterface::FCGI_STDOUT, $writeData);
        } while ($writeSize === $maxSize);

        $this->writeRecord($requestId, DaemonInterface::FCGI_STDOUT);
    }
1242825
public function handleRequest(Request $request, Page &$page)
    {
        $data = $request->request->get("vfou_cmsbundle_page");
        $page->setData(["mode"=>$data['mode'], "limit"=>$data['limit'] == "" ? 99 : $data['limit'] ]);
    }
289077
public function get($page, $pageSize, $storeId)
    {
        $this
            ->initStores($storeId);

        if (!array_key_exists(0, $this->storeIds)) {
            throw new WebApiException(__('Store ID must contain 0'));
        }

        $this
            ->initCollection()
            ->joinData()
            ->setOrder()
            ->setPage($page, $pageSize);

        return $this->categoriesApiResponseFactory->create()->setCurrentPage($this->categoryCollection->getCurPage())
            ->setLastPage($this->categoryCollection->getLastPageNumber())
            ->setPageSize($this->categoryCollection->getPageSize())
            ->setTotalCount($this->categoryCollection->getSize())
            ->setCategories($this->handleCategories());
    }
276726
public function show(Request $request, $id)
    {
        $this->validate($request, [
            'id' => 'uuid'
        ]);

        try{
            $did = $request->user()->dids()->where('id', $id)->with(['tags', 'client'])->firstOrFail();
            $results = fractal()->item($did, new DidTransformer());
            return response()->json($results);
        }catch (\Exception $e){
            return response()->json([ 'error' => 404, 'message' => 'Not found' ], 404);
        }

    }