| 1 | <?php |
||
| 2 | namespace EWW\Dpf\Services\ElasticSearch; |
||
| 3 | |||
| 4 | /* |
||
| 5 | * This file is part of the TYPO3 CMS project. |
||
| 6 | * |
||
| 7 | * It is free software; you can redistribute it and/or modify it under |
||
| 8 | * the terms of the GNU General Public License, either version 2 |
||
| 9 | * of the License, or any later version. |
||
| 10 | * |
||
| 11 | * For the full copyright and license information, please read the |
||
| 12 | * LICENSE.txt file that was distributed with this source code. |
||
| 13 | * |
||
| 14 | * The TYPO3 project - inspiring people to share! |
||
| 15 | */ |
||
| 16 | |||
| 17 | use EWW\Dpf\Helper\XSLTransformator; |
||
| 18 | use TYPO3\CMS\Core\Core\Environment; |
||
| 19 | |||
| 20 | class ElasticsearchMapper |
||
| 21 | { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * [$documentRepository description] |
||
| 25 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
||
| 26 | * @TYPO3\CMS\Extbase\Annotation\Inject |
||
| 27 | */ |
||
| 28 | protected $documentRepository = null; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * clientConfigurationManager |
||
| 32 | * |
||
| 33 | * @var \EWW\Dpf\Configuration\ClientConfigurationManager |
||
| 34 | * @TYPO3\CMS\Extbase\Annotation\Inject |
||
| 35 | */ |
||
| 36 | protected $clientConfigurationManager; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * clientRepository |
||
| 40 | * |
||
| 41 | * @var \EWW\Dpf\Domain\Repository\ClientRepository |
||
| 42 | * @TYPO3\CMS\Extbase\Annotation\Inject |
||
| 43 | */ |
||
| 44 | protected $clientRepository = null; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * document2json |
||
| 48 | * @param Document $document [description] |
||
|
0 ignored issues
–
show
|
|||
| 49 | * @return json Elasticsearch json format |
||
|
0 ignored issues
–
show
The type
EWW\Dpf\Services\ElasticSearch\json was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 50 | */ |
||
| 51 | public function getElasticsearchJson($document) |
||
| 52 | { |
||
| 53 | /** @var \EWW\Dpf\Domain\Model\Client $client */ |
||
| 54 | $client = $this->clientRepository->findAll()->current(); |
||
| 55 | |||
| 56 | /** @var \EWW\Dpf\Domain\Model\TransformationFile $xsltTransformationFile */ |
||
| 57 | $xsltTransformationFile = $client->getElasticSearchTransformation()->current(); |
||
| 58 | |||
| 59 | if ($xsltTransformationFile) { |
||
|
0 ignored issues
–
show
|
|||
| 60 | $xsltDoc = Environment::getPublicPath() . '/fileadmin' . |
||
| 61 | $xsltTransformationFile->getFile()->getOriginalResource()->getIdentifier(); |
||
| 62 | } else { |
||
| 63 | throw new \Exception("Missing XSLT file for ElasticSearch json mapping."); |
||
| 64 | } |
||
| 65 | |||
| 66 | // xslt |
||
| 67 | $xsl = new \DOMDocument; |
||
| 68 | $xsl->load($xsltDoc); |
||
| 69 | |||
| 70 | $XSLTransformator = new XSLTransformator(); |
||
| 71 | $transformedXml = $XSLTransformator->getTransformedOutputXML($document); |
||
| 72 | |||
| 73 | $xml = new \DOMDocument; |
||
| 74 | $xml->loadXML($transformedXml); |
||
| 75 | |||
| 76 | // xslt processing |
||
| 77 | $proc = new \XSLTProcessor; |
||
| 78 | $proc->importStyleSheet($xsl); // XSL Document importieren |
||
| 79 | |||
| 80 | $json = $proc->transformToXML($xml); |
||
| 81 | |||
| 82 | return $json; |
||
|
0 ignored issues
–
show
|
|||
| 83 | } |
||
| 84 | |||
| 85 | } |
||
| 86 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths