| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * (c) Kitodo. Key to digital objects e.V. <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * This file is part of the Kitodo and TYPO3 projects. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @license GNU General Public License version 3 or later. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * For the full copyright and license information, please read the | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * LICENSE.txt file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | namespace Kitodo\Dlf\Controller; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use Kitodo\Dlf\Common\IiifManifest; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use TYPO3\CMS\Core\Utility\GeneralUtility; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use TYPO3\CMS\Core\Utility\MathUtility; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use TYPO3\CMS\Core\Database\Connection; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use Ubl\Iiif\Presentation\Common\Model\Resources\ManifestInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use Ubl\Iiif\Presentation\Common\Vocabulary\Motivation; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | class PageViewController extends AbstractController | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |      * Holds the controls to add to the map | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |     protected $controls = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |      * Holds the current images' URLs and MIME types | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     protected $images = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |      * Holds the current fulltexts' URLs | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |     protected $fulltexts = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |      * Holds the current AnnotationLists / AnnotationPages | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |     protected $annotationContainers = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |      * The main method of the plugin | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |      * @return void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     public function mainAction() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |         $requestData = GeneralUtility::_GPmerged('tx_dlf'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |         unset($requestData['__referrer'], $requestData['__trustedProperties']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |         $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         // Load current document. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |         $this->loadDocument($requestData); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |         if ( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |             $this->doc === null | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |             || $this->doc->numPages < 1 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |         ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |             // Quit without doing anything if required variables are not set. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |         } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |             if (!empty($requestData['logicalPage'])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |                 $requestData['page'] = $this->doc->getPhysicalPage($requestData['logicalPage']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |                 // The logical page parameter should not appear again | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |                 unset($requestData['logicalPage']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |             // Set default values if not set. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |             // $requestData['page'] may be integer or string (physical structure @ID) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |             if ((int) $requestData['page'] > 0 || empty($requestData['page'])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |                 $requestData['page'] = MathUtility::forceIntegerInRange((int) $requestData['page'], 1, $this->doc->numPages, 1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |                 $requestData['page'] = array_search($requestData['page'], $this->doc->physicalStructure); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |             $requestData['double'] = MathUtility::forceIntegerInRange($requestData['double'], 0, 1, 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |         // Get image data. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |         $this->images[0] = $this->getImage($requestData['page']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |         $this->fulltexts[0] = $this->getFulltext($requestData['page']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |         $this->annotationContainers[0] = $this->getAnnotationContainers($requestData['page']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |         if ($requestData['double'] && $requestData['page'] < $this->doc->numPages) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |             $this->images[1] = $this->getImage($requestData['page'] + 1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |             $this->fulltexts[1] = $this->getFulltext($requestData['page'] + 1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |             $this->annotationContainers[1] = $this->getAnnotationContainers($requestData['page'] + 1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |         // Get the controls for the map. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |         $this->controls = explode(',', $this->settings['features']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |         $this->view->assign('forceAbsoluteUrl', $this->settings['forceAbsoluteUrl']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |         $this->addViewerJS(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         $this->view->assign('images', $this->images); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |         $this->view->assign('docId', $requestData['id']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |         $this->view->assign('page', $requestData['page']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |      * Get fulltext URL and MIME type | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |      * @param int $page: Page number | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |      * @return array URL and MIME type of fulltext file | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |     protected function getFulltext($page) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |         $fulltext = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |         // Get fulltext link. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |         $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->extConf['fileGrpFulltext']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |         while ($fileGrpFulltext = array_shift($fileGrpsFulltext)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |             if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpFulltext])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |                 $fulltext['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpFulltext]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |                 if ($this->settings['useInternalProxy']) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |                     // Configure @action URL for form. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |                     $uri = $this->uriBuilder->reset() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |                         ->setTargetPageUid($GLOBALS['TSFE']->id) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |                         ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |                         ->setArguments(['eID' => 'tx_dlf_pageview_proxy', 'url' => urlencode($fulltext['url'])]) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |                         ->build(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |                     $fulltext['url'] = $uri; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |                 } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |                 $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpFulltext]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |                 break; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |                 $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |         if (empty($fulltext)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |             $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->settings['fileGrpFulltext'] . '"'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |         return $fulltext; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |      * Adds Viewer javascript | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |      * @return void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |     protected function addViewerJS() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |         // Viewer configuration. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |         $viewerConfiguration = '<script> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |             $(document).ready(function() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |                 if (dlfUtils.exists(dlfViewer)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |                     tx_dlf_viewer = new dlfViewer({ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |                         controls: ["' . implode('", "', $this->controls) . '"], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |                         div: "' . $this->settings['elementId'] . '", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |                         images: ' . json_encode($this->images) . ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |                         fulltexts: ' . json_encode($this->fulltexts) . ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |                         annotationContainers: ' . json_encode($this->annotationContainers) . ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |                         useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |                     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |                 } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |             }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |         </script>'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |         $this->view->assign('viewerConfiguration', $viewerConfiguration); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |      * Get all AnnotationPages / AnnotationLists that contain text Annotations with motivation "painting" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |      * @param int $page: Page number | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |      * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |      *               some information about the canvas. | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 187 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 188 |  |  |     protected function getAnnotationContainers($page) | 
            
                                                                        
                            
            
                                    
            
            
                | 189 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 190 |  |  |         if ($this->doc instanceof IiifManifest) { | 
            
                                                                        
                            
            
                                    
            
            
                | 191 |  |  |             $canvasId = $this->doc->physicalStructure[$page]; | 
            
                                                                        
                            
            
                                    
            
            
                | 192 |  |  |             $iiif = $this->doc->getIiif(); | 
            
                                                                        
                            
            
                                    
            
            
                | 193 |  |  |             if ($iiif instanceof ManifestInterface) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 194 |  |  |                 $canvas = $iiif->getContainedResourceById($canvasId); | 
            
                                                                        
                            
            
                                    
            
            
                | 195 |  |  |                 /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ | 
            
                                                                        
                            
            
                                    
            
            
                | 196 |  |  |                 if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { | 
            
                                                                        
                            
            
                                    
            
            
                | 197 |  |  |                     $annotationContainers = []; | 
            
                                                                        
                            
            
                                    
            
            
                | 198 |  |  |                     /* | 
            
                                                                        
                            
            
                                    
            
            
                | 199 |  |  |                      *  TODO Analyzing the annotations on the server side requires loading the annotation lists / pages | 
            
                                                                        
                            
            
                                    
            
            
                | 200 |  |  |                      *  just to determine wether they contain text annotations for painting. This will take time and lead to a bad user experience. | 
            
                                                                        
                            
            
                                    
            
            
                | 201 |  |  |                      *  It would be better to link every annotation and analyze the data on the client side. | 
            
                                                                        
                            
            
                                    
            
            
                | 202 |  |  |                      * | 
            
                                                                        
                            
            
                                    
            
            
                | 203 |  |  |                      *  On the other hand, server connections are potentially better than client connections. Downloading annotation lists | 
            
                                                                        
                            
            
                                    
            
            
                | 204 |  |  |                      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 205 |  |  |                     foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { | 
            
                                                                        
                            
            
                                    
            
            
                | 206 |  |  |                         if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { | 
            
                                                                        
                            
            
                                    
            
            
                | 207 |  |  |                             foreach ($textAnnotations as $annotation) { | 
            
                                                                        
                            
            
                                    
            
            
                | 208 |  |  |                                 if ( | 
            
                                                                        
                            
            
                                    
            
            
                | 209 |  |  |                                     $annotation->getBody()->getFormat() == 'text/plain' | 
            
                                                                        
                            
            
                                    
            
            
                | 210 |  |  |                                     && $annotation->getBody()->getChars() != null | 
            
                                                                        
                            
            
                                    
            
            
                | 211 |  |  |                                 ) { | 
            
                                                                        
                            
            
                                    
            
            
                | 212 |  |  |                                     $annotationListData = []; | 
            
                                                                        
                            
            
                                    
            
            
                | 213 |  |  |                                     $annotationListData['uri'] = $annotationContainer->getId(); | 
            
                                                                        
                            
            
                                    
            
            
                | 214 |  |  |                                     $annotationListData['label'] = $annotationContainer->getLabelForDisplay(); | 
            
                                                                        
                            
            
                                    
            
            
                | 215 |  |  |                                     $annotationContainers[] = $annotationListData; | 
            
                                                                        
                            
            
                                    
            
            
                | 216 |  |  |                                     break; | 
            
                                                                        
                            
            
                                    
            
            
                | 217 |  |  |                                 } | 
            
                                                                        
                            
            
                                    
            
            
                | 218 |  |  |                             } | 
            
                                                                        
                            
            
                                    
            
            
                | 219 |  |  |                         } | 
            
                                                                        
                            
            
                                    
            
            
                | 220 |  |  |                     } | 
            
                                                                        
                            
            
                                    
            
            
                | 221 |  |  |                     $result = [ | 
            
                                                                        
                            
            
                                    
            
            
                | 222 |  |  |                         'canvas' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 223 |  |  |                             'id' => $canvas->getId(), | 
            
                                                                        
                            
            
                                    
            
            
                | 224 |  |  |                             'width' => $canvas->getWidth(), | 
            
                                                                        
                            
            
                                    
            
            
                | 225 |  |  |                             'height' => $canvas->getHeight(), | 
            
                                                                        
                            
            
                                    
            
            
                | 226 |  |  |                         ], | 
            
                                                                        
                            
            
                                    
            
            
                | 227 |  |  |                         'annotationContainers' => $annotationContainers | 
            
                                                                        
                            
            
                                    
            
            
                | 228 |  |  |                     ]; | 
            
                                                                        
                            
            
                                    
            
            
                | 229 |  |  |                     return $result; | 
            
                                                                        
                            
            
                                    
            
            
                | 230 |  |  |                 } | 
            
                                                                        
                            
            
                                    
            
            
                | 231 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 232 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 233 |  |  |         return []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 235 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 236 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 237 |  |  |      * Get image's URL and MIME type | 
            
                                                                                                            
                            
            
                                    
            
            
                | 238 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 239 |  |  |      * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 240 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 241 |  |  |      * @param int $page: Page number | 
            
                                                                                                            
                            
            
                                    
            
            
                | 242 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 243 |  |  |      * @return array URL and MIME type of image file | 
            
                                                                                                            
                            
            
                                    
            
            
                | 244 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 245 |  |  |     protected function getImage($page) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 246 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 247 |  |  |         $image = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 248 |  |  |         // Get @USE value of METS fileGrp. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 249 |  |  |         $fileGrpsImages = GeneralUtility::trimExplode(',', $this->extConf['fileGrpImages']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 250 |  |  |         while ($fileGrpImages = array_pop($fileGrpsImages)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 251 |  |  |             // Get image link. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 252 |  |  |             if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 253 |  |  |                 $image['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 254 |  |  |                 if ($this->settings['useInternalProxy']) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 255 |  |  |                     // Configure @action URL for form. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 256 |  |  |                     $uri = $this->uriBuilder->reset() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 257 |  |  |                         ->setTargetPageUid($GLOBALS['TSFE']->id) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 258 |  |  |                         ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 259 |  |  |                         ->setArguments(['eID' => 'tx_dlf_pageview_proxy', 'url' => urlencode($image['url'])]) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 260 |  |  |                         ->build(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 261 |  |  |                     $image['url'] = $uri; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 262 |  |  |                 } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 263 |  |  |                 $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 264 |  |  |                 break; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 265 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 266 |  |  |                 $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 267 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 268 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 269 |  |  |         if (empty($image)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 270 |  |  |             $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->settings['fileGrpImages'] . '"'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 271 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 272 |  |  |         return $image; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 273 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 274 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 275 |  |  |  | 
            
                        
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.