vendor/pimcore/data-importer/src/PimcoreDataImporterBundle.php line 35

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\DataImporterBundle;
  15. use League\FlysystemBundle\FlysystemBundle;
  16. use Pimcore\Bundle\AdminBundle\PimcoreAdminBundle;
  17. use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle;
  18. use Pimcore\Bundle\DataImporterBundle\DependencyInjection\CompilerPass\CleanupStrategyConfigurationFactoryPass;
  19. use Pimcore\Bundle\DataImporterBundle\DependencyInjection\CompilerPass\InterpreterConfigurationFactoryPass;
  20. use Pimcore\Bundle\DataImporterBundle\DependencyInjection\CompilerPass\LoaderConfigurationFactoryPass;
  21. use Pimcore\Bundle\DataImporterBundle\DependencyInjection\CompilerPass\MappingConfigurationFactoryPass;
  22. use Pimcore\Bundle\DataImporterBundle\DependencyInjection\CompilerPass\ResolverConfigurationFactoryPass;
  23. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  24. use Pimcore\Extension\Bundle\Installer\InstallerInterface;
  25. use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
  26. use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait;
  27. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  28. use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
  29. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  30. use Symfony\Component\DependencyInjection\ContainerBuilder;
  31. class PimcoreDataImporterBundle extends AbstractPimcoreBundle implements DependentBundleInterfacePimcoreBundleAdminClassicInterface
  32. {
  33.     use BundleAdminClassicTrait;
  34.     use PackageVersionTrait;
  35.     const LOGGER_COMPONENT_PREFIX 'DATA-IMPORTER ';
  36.     protected function getComposerPackageName(): string
  37.     {
  38.         return 'pimcore/data-importer';
  39.     }
  40.     /**
  41.      * @return string[]
  42.      */
  43.     public function getCssPaths(): array
  44.     {
  45.         return [
  46.             '/bundles/pimcoredataimporter/css/icons.css'
  47.         ];
  48.     }
  49.     /**
  50.      * @return string[]
  51.      */
  52.     public function getJsPaths(): array
  53.     {
  54.         return [
  55.             '/bundles/pimcoredataimporter/js/pimcore/helper/ext_extensions.js',
  56.             '/bundles/pimcoredataimporter/js/pimcore/helper/abstractOptionType.js',
  57.             '/bundles/pimcoredataimporter/js/pimcore/adapter/dataImporterDataObject.js',
  58.             '/bundles/pimcoredataimporter/js/pimcore/configuration/configEvents.js',
  59.             '/bundles/pimcoredataimporter/js/pimcore/configuration/configItemDataObject.js',
  60.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/loader/sftp.js',
  61.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/loader/http.js',
  62.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/loader/asset.js',
  63.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/loader/upload.js',
  64.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/loader/push.js',
  65.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/interpreter/csv.js',
  66.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/interpreter/json.js',
  67.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/interpreter/xlsx.js',
  68.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/interpreter/xml.js',
  69.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/cleanup/unpublish.js',
  70.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/cleanup/delete.js',
  71.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/importSettings.js',
  72.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/importPreview.js',
  73.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/load/id.js',
  74.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/load/path.js',
  75.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/load/attribute.js',
  76.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/load/notLoad.js',
  77.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/location/staticPath.js',
  78.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/location/findParent.js',
  79.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/location/findOrCreateFolder.js',
  80.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/location/noChange.js',
  81.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/location/doNotCreate.js',
  82.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/publish/alwaysPublish.js',
  83.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/publish/attributeBased.js',
  84.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/publish/noChangePublishNew.js',
  85.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/resolver/publish/noChangeUnpublishNew.js',
  86.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/mappingConfiguration.js',
  87.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/mappingConfigurationItem.js',
  88.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/transformationResultHandler.js',
  89.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/datatarget/direct.js',
  90.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/datatarget/manyToManyRelation.js',
  91.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/datatarget/classificationstore.js',
  92.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/datatarget/classificationstoreBatch.js',
  93.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/tools/classificationStoreKeySearchWindow.js',
  94.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/abstractOperator.js',
  95.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/trim.js',
  96.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/numeric.js',
  97.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asArray.js',
  98.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asCountries.js',
  99.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asGeopoint.js',
  100.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asGeobounds.js',
  101.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asGeopolygon.js',
  102.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asGeopolyline.js',
  103.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/asColor.js',
  104.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/explode.js',
  105.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/combine.js',
  106.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/htmlDecode.js',
  107.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/quantityValue.js',
  108.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/quantityValueArray.js',
  109.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/inputQuantityValue.js',
  110.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/inputQuantityValueArray.js',
  111.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/boolean.js',
  112.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/date.js',
  113.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/importAsset.js',
  114.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/loadAsset.js',
  115.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/gallery.js',
  116.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/imageAdvanced.js',
  117.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/loadDataObject.js',
  118.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/reduceArrayKeyValuePairs.js',
  119.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/flattenArray.js',
  120.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/staticText.js',
  121.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/conditionalConversion.js',
  122.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/mapping/operator/stringReplace.js',
  123.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/execution.js',
  124.             '/bundles/pimcoredataimporter/js/pimcore/configuration/components/logTab.js',
  125.         ];
  126.     }
  127.     public function build(ContainerBuilder $container): void
  128.     {
  129.         $container
  130.             ->addCompilerPass(new MappingConfigurationFactoryPass())
  131.             ->addCompilerPass(new ResolverConfigurationFactoryPass())
  132.             ->addCompilerPass(new LoaderConfigurationFactoryPass())
  133.             ->addCompilerPass(new InterpreterConfigurationFactoryPass())
  134.             ->addCompilerPass(new CleanupStrategyConfigurationFactoryPass())
  135.         ;
  136.     }
  137.     public static function registerDependentBundles(BundleCollection $collection): void
  138.     {
  139.         $collection->addBundle(PimcoreDataHubBundle::class, 20);
  140.         $collection->addBundle(new FlysystemBundle());
  141.         $collection->addBundle(new PimcoreAdminBundle(), 60);
  142.         if (\Pimcore\Version::getMajorVersion() >= 11) {
  143.             $collection->addBundle(
  144.                 \Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle::class,
  145.                 10
  146.             );
  147.         }
  148.     }
  149.     public function getInstaller(): ?InstallerInterface
  150.     {
  151.         return $this->container->get(Installer::class);
  152.     }
  153. }