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.     /**
  62.      * @return string[]
  63.      */
  64.     public function getCssPaths()
  65.     {
  66.         return [
  67.             '/bundles/pimcoreportalengine/css/admin.css'
  68.         ];
  69.     }
  70.     /**
  71.      * @return string[]
  72.      */
  73.     public function getEditmodeCssPaths()
  74.     {
  75.         return [
  76.             '/bundles/pimcoreportalengine/css/editmode.css'
  77.         ];
  78.     }
  79.     /**
  80.      * @return string[]
  81.      */
  82.     public function getEditmodeJsPaths()
  83.     {
  84.         return [
  85.             '/bundles/pimcoreportalengine/js/editmode.js'
  86.         ];
  87.     }
  88.     /**
  89.      * @param BundleCollection $collection
  90.      */
  91.     public static function registerDependentBundles(BundleCollection $collection)
  92.     {
  93.         $collection->addBundle(new WebpackEncoreBundle());
  94.         $collection->addBundle(new FrontendPermissionToolkitBundle());
  95.         $collection->addBundle(new PimcoreStatisticsExplorerBundle());
  96.         $collection->addBundle(new PimcoreEnterpriseSubscriptionToolsBundle());
  97. //        $collection->addBundle(new PimcoreOpenIdConnectBundle());
  98.         $collection->addBundle(new FlysystemBundle());
  99.     }
  100.     /**
  101.      * @return Installer
  102.      */
  103.     public function getInstaller()
  104.     {
  105.         return $this->container->get(Installer::class);
  106.     }
  107.     /**
  108.      * @param ContainerBuilder $container
  109.      */
  110.     public function build(ContainerBuilder $container)
  111.     {
  112.         $container
  113.             ->addCompilerPass(new SearchIndexFieldDefinitionPass())
  114.             ->addCompilerPass(new RestApiFieldDefinitionPass())
  115.             ->addCompilerPass(new PreConditionPass())
  116.             ->addCompilerPass(new DownloadFormatPass())
  117.             ->addCompilerPass(new DataPoolPass())
  118.             ->addCompilerPass(new DownloadProviderPass())
  119.             ->addCompilerPass(new DownloadGeneratorPass())
  120.             ->addCompilerPass(new BatchTaskProcessNotificationActionPass())
  121.             ->addCompilerPass(new DirectEditCompilerPass());
  122.     }
  123.     public function getBundleLicenseId(): string
  124.     {
  125.         return 'PPE';
  126.     }
  127.     /**
  128.      * {@inheritdoc}
  129.      */
  130.     protected function getComposerPackageName(): string
  131.     {
  132.         return 'pimcore/portal-engine';
  133.     }
  134. }