src/Controller/Framework/DocTreeController.php
/**
     * Retrieve a CFPackage from the given document identifier, then use exportAction to export it.
     *
     * @Route("/retrievedocument/{id}", name="doctree_retrieve_document", methods={"GET"})
     * @Route("/retrievedocument/url", name="doctree_retrieve_document_by_url", methods={"GET"}, defaults={"id"=null})
     *
     * @throws \Exception
     */
Retrieve a CFPackage from the given document identifier, then use exportAction to export it.

@throws \Exception
Retrieve a CFPackage from the given document identifier then use exportAction to export it . @throws \ Exception
public function retrieveDocumentAction(Request $request, ?LsDoc $lsDoc = null): Response
    {
        if ($id = $request->query->get('id')) {
            return $this->respondWithDocumentById($request, $id);
        }
        if (null !== $lsDoc && $identifier = $request->query->get('identifier')) {
            return $this->respondWithDocumentByIdentifier($request, $identifier, $lsDoc);
        }
        if ($url = $request->query->get('url')) {
            return $this->exportExternalDocument($url, $lsDoc);
        }
        return new Response('Document not found.', Response::HTTP_NOT_FOUND);
    }
public function retrieveDocumentAction ( Request $ request , ? LsDoc $ lsDoc = null ) : Response { if ( $ id = $ request -> query -> get ( 'id' ) ) { return $ this -> respondWithDocumentById ( $ request , $ id ) ; } if ( null !== $ lsDoc && $ identifier = $ request -> query -> get ( 'identifier' ) ) { return $ this -> respondWithDocumentByIdentifier ( $ request , $ identifier , $ lsDoc ) ; } if ( $ url = $ request -> query -> get ( 'url' ) ) { return $ this -> exportExternalDocument ( $ url , $ lsDoc ) ; } return new Response ( 'Document not found.' , Response :: HTTP_NOT_FOUND ) ; }
Retrieve a CFPackage from the given document identifier, then use exportAction to export it.
Retrieve a CFPackage from the given document identifier then use exportAction to export it .
// $request could contain an id... // in this case it has to be a document on this OpenSALT instantiation // or an identifier... // first see if it's referencing a document on this OpenSALT instantiation // or a url... // try to load the url, noting that we should save a record of it in externalDocs if found