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

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\EnterpriseSubscriptionToolsBundle\Bundle\EnterpriseBundleInterface;
  15. use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\PimcoreEnterpriseSubscriptionToolsBundle;
  16. use Pimcore\Bundle\OpenIdConnectBundle\PimcoreOpenIdConnectBundle;
  17. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\BatchTaskProcessNotificationActionPass;
  18. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DataPoolPass;
  19. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DirectEditCompilerPass;
  20. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadFormatPass;
  21. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadGeneratorPass;
  22. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\DownloadProviderPass;
  23. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\PreConditionPass;
  24. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\RestApiFieldDefinitionPass;
  25. use Pimcore\Bundle\PortalEngineBundle\DependencyInjection\Compiler\SearchIndexFieldDefinitionPass;
  26. use Pimcore\Bundle\StatisticsExplorerBundle\PimcoreStatisticsExplorerBundle;
  27. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  28. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  29. use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
  30. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  31. use Symfony\Component\DependencyInjection\ContainerBuilder;
  32. use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;
  33. /**
  34.  * Class PimcorePortalEngineBundle
  35.  *
  36.  * @package Pimcore\Bundle\PortalEngineBundle
  37.  */
  38. class PimcorePortalEngineBundle extends AbstractPimcoreBundle implements DependentBundleInterfaceEnterpriseBundleInterface
  39. {
  40.     use PackageVersionTrait;
  41.     /**
  42.      * @var array
  43.      */
  44.     protected static $config;
  45.     /**
  46.      * @return array|\Pimcore\Routing\RouteReferenceInterface[]|string[]
  47.      */
  48.     public function getJsPaths()
  49.     {
  50.         return [
  51.             '/bundles/pimcoreportalengine/js/pimcore/startup.js',
  52.             '/bundles/pimcoreportalengine/js/pimcore/collections/tree.js',
  53.             '/bundles/pimcoreportalengine/js/pimcore/collections/list.js',
  54.             '/bundles/pimcoreportalengine/js/pimcore/collections/openTreeStorage.js',
  55.             '/bundles/pimcoreportalengine/js/pimcore/wizard/helpers.js',
  56.             '/bundles/pimcoreportalengine/js/pimcore/wizard/wizard.js',
  57.             '/bundles/pimcoreportalengine/js/pimcore/wizard/data-pool/asset.js',
  58.             '/bundles/pimcoreportalengine/js/pimcore/wizard/data-pool/data-object.js'
  59.         ];
  60.     }
  61.     public function getCssPaths()
  62.     {
  63.         return [
  64.             '/bundles/pimcoreportalengine/css/admin.css'
  65.         ];
  66.     }
  67.     public function getEditmodeCssPaths()
  68.     {
  69.         return [
  70.             '/bundles/pimcoreportalengine/css/editmode.css'
  71.         ];
  72.     }
  73.     public function getEditmodeJsPaths()
  74.     {
  75.         return [
  76.             '/bundles/pimcoreportalengine/js/editmode.js'
  77.         ];
  78.     }
  79.     /**
  80.      * @param BundleCollection $collection
  81.      */
  82.     public static function registerDependentBundles(BundleCollection $collection)
  83.     {
  84.         $collection->addBundle(new WebpackEncoreBundle());
  85.         $collection->addBundle(new FrontendPermissionToolkitBundle());
  86.         $collection->addBundle(new PimcoreStatisticsExplorerBundle());
  87.         $collection->addBundle(new PimcoreEnterpriseSubscriptionToolsBundle());
  88. //        $collection->addBundle(new PimcoreOpenIdConnectBundle());
  89.         $collection->addBundle(new FlysystemBundle());
  90.     }
  91.     /**
  92.      * @return Installer
  93.      */
  94.     public function getInstaller()
  95.     {
  96.         return $this->container->get(Installer::class);
  97.     }
  98.     /**
  99.      * @param ContainerBuilder $container
  100.      */
  101.     public function build(ContainerBuilder $container)
  102.     {
  103.         $container
  104.             ->addCompilerPass(new SearchIndexFieldDefinitionPass())
  105.             ->addCompilerPass(new RestApiFieldDefinitionPass())
  106.             ->addCompilerPass(new PreConditionPass())
  107.             ->addCompilerPass(new DownloadFormatPass())
  108.             ->addCompilerPass(new DataPoolPass())
  109.             ->addCompilerPass(new DownloadProviderPass())
  110.             ->addCompilerPass(new DownloadGeneratorPass())
  111.             ->addCompilerPass(new BatchTaskProcessNotificationActionPass())
  112.             ->addCompilerPass(new DirectEditCompilerPass());
  113.     }
  114.     public function getBundleLicenseId(): string
  115.     {
  116.         return 'PPE';
  117.     }
  118.     /**
  119.      * {@inheritdoc}
  120.      */
  121.     protected function getComposerPackageName(): string
  122.     {
  123.         return 'pimcore/portal-engine';
  124.     }
  125. }