vendor/pimcore/portal-engine/src/PimcorePortalEngineBundle.php line 48

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under following license:
  6.  * - Pimcore Commercial License (PCL)
  7.  *
  8.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  9.  *  @license    http://www.pimcore.org/license     PCL
  10.  */
  11. namespace Pimcore\Bundle\PortalEngineBundle;
  12. use FrontendPermissionToolkitBundle\FrontendPermissionToolkitBundle;
  13. use League\FlysystemBundle\FlysystemBundle;
  14. use Pimcore\Bundle\AdminBundle\PimcoreAdminBundle;
  15. use Pimcore\Bundle\ElasticsearchClientBundle\PimcoreElasticsearchClientBundle;
  16. use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\Bundle\EnterpriseBundleInterface;
  17. use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\PimcoreEnterpriseSubscriptionToolsBundle;
  18. use Pimcore\Bundle\OpenIdConnectBundle\PimcoreOpenIdConnectBundle;
  19. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\BatchTaskProcessNotificationActionPass;
  20. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DataPoolPass;
  21. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DirectEditCompilerPass;
  22. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadFormatPass;
  23. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadGeneratorPass;
  24. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadProviderPass;
  25. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\ElasticsearchClientPass;
  26. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\PreConditionPass;
  27. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\RestApiFieldDefinitionPass;
  28. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\SearchIndexFieldDefinitionPass;
  29. use Pimcore\Bundle\StatisticsExplorerBundle\PimcoreStatisticsExplorerBundle;
  30. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  31. use Pimcore\Extension\Bundle\Installer\InstallerInterface;
  32. use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
  33. use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait;
  34. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  35. use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
  36. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  37. use Symfony\Component\DependencyInjection\ContainerBuilder;
  38. use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;
  39. /**
  40.  * Class PimcorePortalEngineBundle
  41.  *
  42.  * @package Pimcore\Bundle\PortalEngineBundle
  43.  */
  44. class PimcorePortalEngineBundle extends AbstractPimcoreBundle implements DependentBundleInterfaceEnterpriseBundleInterfacePimcoreBundleAdminClassicInterface
  45. {
  46.     use BundleAdminClassicTrait;
  47.     use PackageVersionTrait;
  48.     /**
  49.      * @var array
  50.      */
  51.     protected static $config;
  52.     /**
  53.      * @return array|\Pimcore\Routing\RouteReferenceInterface[]|string[]
  54.      */
  55.     public function getJsPaths(): array
  56.     {
  57.         return [
  58.             '/bundles/pimcoreportalengine/js/pimcore/startup.js',
  59.             '/bundles/pimcoreportalengine/js/pimcore/collections/tree.js',
  60.             '/bundles/pimcoreportalengine/js/pimcore/collections/list.js',
  61.             '/bundles/pimcoreportalengine/js/pimcore/collections/openTreeStorage.js',
  62.             '/bundles/pimcoreportalengine/js/pimcore/wizard/helpers.js',
  63.             '/bundles/pimcoreportalengine/js/pimcore/wizard/wizard.js',
  64.             '/bundles/pimcoreportalengine/js/pimcore/wizard/data-pool/asset.js',
  65.             '/bundles/pimcoreportalengine/js/pimcore/wizard/data-pool/data-object.js',
  66.             '/bundles/pimcoreportalengine/js/pimcore/index/index-management.js',
  67.             '/bundles/pimcoreportalengine/js/pimcore/index/helpers.js'
  68.         ];
  69.     }
  70.     /**
  71.      * @return string[]
  72.      */
  73.     public function getCssPaths(): array
  74.     {
  75.         return [
  76.             '/bundles/pimcoreportalengine/css/admin.css'
  77.         ];
  78.     }
  79.     /**
  80.      * @return string[]
  81.      */
  82.     public function getEditmodeCssPaths(): array
  83.     {
  84.         return [
  85.             '/bundles/pimcoreportalengine/css/editmode.css'
  86.         ];
  87.     }
  88.     /**
  89.      * @return string[]
  90.      */
  91.     public function getEditmodeJsPaths(): array
  92.     {
  93.         return [
  94.             '/bundles/pimcoreportalengine/js/editmode.js'
  95.         ];
  96.     }
  97.     /**
  98.      * @param BundleCollection $collection
  99.      */
  100.     public static function registerDependentBundles(BundleCollection $collection): void
  101.     {
  102.         $collection->addBundle(new WebpackEncoreBundle());
  103.         $collection->addBundle(new FrontendPermissionToolkitBundle());
  104.         $collection->addBundle(new PimcoreStatisticsExplorerBundle());
  105.         $collection->addBundle(new PimcoreEnterpriseSubscriptionToolsBundle());
  106. //        $collection->addBundle(new PimcoreOpenIdConnectBundle());
  107.         $collection->addBundle(new FlysystemBundle());
  108.         $collection->addBundle(new PimcoreElasticsearchClientBundle());
  109.         $collection->addBundle(new PimcoreAdminBundle(), 60);
  110.     }
  111.     /**
  112.      * @return Installer
  113.      */
  114.     public function getInstaller(): InstallerInterface
  115.     {
  116.         return $this->container->get(Installer::class);
  117.     }
  118.     /**
  119.      * @param ContainerBuilder $container
  120.      */
  121.     public function build(ContainerBuilder $container)
  122.     {
  123.         $container
  124.             ->addCompilerPass(new SearchIndexFieldDefinitionPass())
  125.             ->addCompilerPass(new RestApiFieldDefinitionPass())
  126.             ->addCompilerPass(new PreConditionPass())
  127.             ->addCompilerPass(new DownloadFormatPass())
  128.             ->addCompilerPass(new DataPoolPass())
  129.             ->addCompilerPass(new DownloadProviderPass())
  130.             ->addCompilerPass(new DownloadGeneratorPass())
  131.             ->addCompilerPass(new BatchTaskProcessNotificationActionPass())
  132.             ->addCompilerPass(new ElasticsearchClientPass())
  133.             ->addCompilerPass(new DirectEditCompilerPass());
  134.     }
  135.     public function getBundleLicenseId(): string
  136.     {
  137.         return 'PPE';
  138.     }
  139.     /**
  140.      * {@inheritdoc}
  141.      */
  142.     protected function getComposerPackageName(): string
  143.     {
  144.         return 'pimcore/portal-engine';
  145.     }
  146. }