Exemplo n.º 1
0
    /**
     * {@inheritdoc}
     */
    public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new DelegatingLoaderCloningCompilerPass());
        $routingResourcesProvider = new ExtensionPoint('modera_routing.routing_resources');
        $docs = <<<TEXT
This extension points make it possible for bundles to dynamically contribute routing resources so Symfony can detect them,
this way when a new bundle is added then you don't need to update root routing.yml file every time.
This how a sample contribution could look like:

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class RoutingResourcesProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            '@ModeraBackendLanguagesBundle/Resources/config/routing.yml'
        );
    }
}
TEXT;
        $routingResourcesProvider->setDetailedDescription($docs);
        $routingResourcesProvider->setDescription('Allows to dynamically add routing files.');
        $container->addCompilerPass($routingResourcesProvider->createCompilerPass());
    }
 public function build(ContainerBuilder $container)
 {
     // FIXME ain't good, it must be done rather in RendererProvidersConfigurator
     $container->addCompilerPass(new CompositeContributorsProviderCompilerPass('sli.extjsintegration.expander_renderers_provider', 'sli.extjsintegration.renderers_provider'));
     $valueConverterProviders = new ExtensionPoint('sli.extjsintegration.complex_field_value_converters');
     $valueConverterProviders->setDescription('Allows to contribute custom value converters');
     $container->addCompilerPass($valueConverterProviders->createCompilerPass());
 }
Exemplo n.º 3
0
 public function build(ContainerBuilder $container)
 {
     $permissionsProviders = new ExtensionPoint('modera_security.permissions');
     $permissionsProviders->setDescription('Allows to contribute new permissions that later can be installed by modera:security:install-permissions command.');
     $container->addCompilerPass($permissionsProviders->createCompilerPass());
     $permissionCategoriesProviders = new ExtensionPoint('modera_security.permission_categories');
     $permissionCategoriesProviders->setDescription('Allows to contribute new permission categories.');
     $container->addCompilerPass($permissionCategoriesProviders->createCompilerPass());
 }
Exemplo n.º 4
0
    /**
     * {@inheritdoc}
     */
    public function build(ContainerBuilder $container)
    {
        // also see \Modera\ServerCrudBundle\ExceptionHandling\EnvAwareExceptionHandler
        $exceptionHandlersProvider = new ExtensionPoint('modera_server_crud.exception_handling.handlers');
        $exceptionHandlersProvider->setDescription('Allows to add additional exception handlers that will be used by AbstractCrudController.');
        $exceptionHandlersProviderDescription = <<<TEXT
You will need to use this extension point if you need to apply some custom handling to server-side exceptions. For more
details please see \\Modera\\ServerCrudBundle\\ExceptionHandling\\EnvAwareExceptionHandler and
\\Modera\\ServerCrudBundle\\ExceptionHandling\\ExceptionHandlerInterface.
TEXT;
        $exceptionHandlersProvider->setDetailedDescription($exceptionHandlersProviderDescription);
        $container->addCompilerPass($exceptionHandlersProvider->createCompilerPass());
        // see \Modera\ServerCrudBundle\Controller\AbstractCrudController::interceptAction
        // CAP stands for "Controller Action Interceptor"
        $caiProviders = new ExtensionPoint('modera_server_crud.intercepting.cai');
        $caiProviders->setDescription('Allows to contribute Controller Action Interceptors used by AbstractCrudController.');
        $caiProvidersDescription = <<<TEXT
Allow to add Controller Action Interceptors, for more details please see
\\Modera\\ServerCrudBundle\\Intercepting\\ControllerActionsInterceptorInterface.
TEXT;
        $caiProviders->setDetailedDescription($caiProvidersDescription);
        $container->addCompilerPass($caiProviders->createCompilerPass());
    }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function build(ContainerBuilder $container)
 {
     $configEntriesProvider = new ExtensionPoint('modera_config.config_entries');
     $configEntriesProvider->setDescription('Allow to contribute new configuration properties. See ConfigurationEntryInterface.');
     $container->addCompilerPass($configEntriesProvider->createCompilerPass());
 }
 /**
  * {@inheritdoc}
  */
 public function build(ContainerBuilder $container)
 {
     $gatewaysProvider = new ExtensionPoint('modera_file_uploader.uploading.gateways');
     $gatewaysProvider->setDescription('Allows to contribute new uploader gateways.');
     $container->addCompilerPass($gatewaysProvider->createCompilerPass());
 }
 public function build(ContainerBuilder $container)
 {
     $sectionsProvider = new ExtensionPoint('modera_backend_tools_settings.contributions.sections');
     $sectionsProvider->setDescription('Use this extension point to provide sections to Backend/Tools/Settings section.');
     $container->addCompilerPass($sectionsProvider->createCompilerPass());
 }
 public function build(ContainerBuilder $container)
 {
     $clientDiServiceDefinitionsProvider = new ExtensionPoint('modera_mjr_security_integration.client_di_service_defs');
     $clientDiServiceDefinitionsProvider->setDescription('Allows to contribute client-side DI container service definitions that will be configured only after user has successfully authenticated.');
     $container->addCompilerPass($clientDiServiceDefinitionsProvider->createCompilerPass());
 }
 /**
  * {@inheritdoc}
  */
 public function build(ContainerBuilder $container)
 {
     $dashboardProvider = new ExtensionPoint('modera_backend_dashboard.dashboard');
     $dashboardProvider->setDescription('Allows to contribute new dashboard panels to Backend/Dashboard section.');
     $container->addCompilerPass($dashboardProvider->createCompilerPass());
 }
Exemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 public function build(ContainerBuilder $container)
 {
     $sectionsProvider = new ExtensionPoint('modera_backend_tools.sections');
     $sectionsProvider->setDescription('Allows to add new sections to Backend/Tools section.');
     $container->addCompilerPass($sectionsProvider->createCompilerPass());
 }
 /**
  * {@inheritdoc}
  */
 public function build(ContainerBuilder $container)
 {
     $filtersProvider = new ExtensionPoint('modera_backend_translations_tool.filters');
     $filtersProvider->setDescription('Allows to add a new server-side filter (all/new/obsolete filters are implemented using this extension point).');
     $container->addCompilerPass($filtersProvider->createCompilerPass());
 }
    /**
     * {@inheritdoc}
     */
    public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new ConfigProviderAliasingCompilerPass());
        $configMergersProvider = new ExtensionPoint('modera_mjr_integration.config.config_mergers');
        $configMergersProvider->setDescription('Lets to contribute implementations of ConfigMergerInterface that will be used to prepare runtime-config.');
        $configMergersProviderDescription = <<<TEXT
You will need to use this extension point when you need to contribute some additional data to so called 'runtime-config'
(a config which is exposed to MJR when it is loaded). This is how a typical contribution could look like:

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;
use Modera\\MjrIntegrationBundle\\Config\\CallbackConfigMerger;

class ConfigMergersProvider implements ContributorInterface
{
    private \$items;

    public function __construct()
    {
        \$this->items = array(
            new CallbackConfigMerger(function(array \$currentConfig)  {
                return array_merge(\$currentConfig, array(
                    'php_version' => phpversion()
                ));
            })
        );
    }

    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return \$this->items;
    }
}
TEXT;
        $configMergersProvider->setDetailedDescription($configMergersProviderDescription);
        $container->addCompilerPass($configMergersProvider->createCompilerPass());
        $menuItemsProvider = new ExtensionPoint('modera_mjr_integration.menu.menu_items');
        $menuItemsProvider->setDescription('Allows to contribute sections that will be displayed in backend menu.');
        $menuItemsDescription = <<<TEXT
This extension point allows you to contribute new menu items to backend section. When you contribute a new section you
also have an option to define a namespace/path mapping that will be used to configure extjs class loader. Typical
menu item contribution could look like this:

use Modera\\MjrIntegrationBundle\\Menu\\MenuItem;
use Modera\\MjrIntegrationBundle\\Menu\\MenuItemInterface;
use Modera\\MjrIntegrationBundle\\Model\\FontAwesome;
use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class MenuItemsProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            new MenuItem('Dashboard', 'Modera.backend.dashboard.runtime.Section', 'dashboard', [
                MenuItemInterface::META_NAMESPACE => 'Modera.backend.dashboard',
                MenuItemInterface::META_NAMESPACE_PATH => '/bundles/moderabackenddashboard/js'
            ], FontAwesome::resolve('dashboard')),
        );
    }
}
TEXT;
        $menuItemsProvider->setDetailedDescription($menuItemsDescription);
        $container->addCompilerPass($menuItemsProvider->createCompilerPass());
        $serviceDefinitionsProvider = new ExtensionPoint('modera_mjr_integration.csdi.service_definitions');
        $serviceDefinitionsProvider->setDescription('Allows to contribute client side dependency injection container services.');
        $serviceDefinitionsProviderDescription = <<<TEXT
This extension point can be used when you need to expose services to client-side dependency injection container.
It is important to mention that services contributed using this extension point will be exposed to client-side
event before user is authenticated yet. If you need to expose services only when user has authenticated, then use
"modera_mjr_security_integration.client_di_service_defs" extension-point instead. A typical contribution could look like
this:

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class ClientDiServiceDefinitionsProvider implements ContributorInterface
{
    // override
    public function getItems()
    {
        return array(
            'modera_backend_dashboard.user_dashboard_settings_window_contributor' => array(
                'className' => 'Modera.backend.dashboard.runtime.UserDashboardSettingsWindowContributor',
                'args' => ['@application'],
                'tags' => ['shared_activities_provider']
            )
        );
    }
}
TEXT;
        $serviceDefinitionsProvider->setDetailedDescription($serviceDefinitionsProviderDescription);
        $container->addCompilerPass($serviceDefinitionsProvider->createCompilerPass());
        $sectionsProvider = new ExtensionPoint('modera_mjr_integration.sections');
        $sectionsProvider->setDescription('Contributes section which will be possible to activate in backend.');
        $sectionProviderDescription = <<<TEXT
Allows to contribute new sections ( implementations of MJR's MF.runtime.Section ). You will want to use this extension-point
when you need a place where you can play with your activities but don't want to contribute a separate menu-item. Optionally
you can configure extjs-class loader. This is how contribution could look like:

use Modera\\MjrIntegrationBundle\\Sections\\Section;
use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class SectionsProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            new Section('tools.modules', 'Modera.backend.module.toolscontribution.runtime.Section', array(
                Section::META_NAMESPACE => 'Modera.backend.module',
                Section::META_NAMESPACE_PATH => '/bundles/moderabackendmodule/js'
            ))
        );
    }
}
TEXT;
        $sectionsProvider->setDetailedDescription($sectionProviderDescription);
        $container->addCompilerPass($sectionsProvider->createCompilerPass());
        $cssResourcesProvider = new ExtensionPoint('modera_mjr_integration.css_resources');
        $cssResourcesProvider->setDescription('CSS files to include in a page where the runtime will be bootstrapped.');
        $cssResourcesProviderDescription = <<<TEXT
This extension point allow to contribute CSS resources that must be included to backend page when it is loaded. You
will need to use this extension point when you want to add some styling rules to you backend extjs components. This
is how a typical contribution could look like:

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class CssResourcesProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            '/bundles/moderabackendmodule/css/styles.css'
        );
    }
}
TEXT;
        $cssResourcesProvider->setDetailedDescription($cssResourcesProviderDescription);
        $container->addCompilerPass($cssResourcesProvider->createCompilerPass());
        $classLoaderMappingsProvider = new ExtensionPoint('modera_mjr_integration.class_loader_mappings');
        $classLoaderMappingsProvider->setDescription('Allows to add backend extjs class loader mappings. ');
        $classLoaderMappingsProviderDescription = <<<TEXT
You will want to use this extension-point when you need to teach backend extjs class loader where from to load
class which belong to a certain namespace. This is how contribution could look like:

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class ClassLoaderMappingsProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            'Modera.backend.configutils' => '/bundles/moderabackendconfigutils/js'
        );
    }
}
TEXT;
        $classLoaderMappingsProvider->setDetailedDescription($classLoaderMappingsProviderDescription);
        $container->addCompilerPass($classLoaderMappingsProvider->createCompilerPass());
        $jsResourcesProvider = new ExtensionPoint('modera_mjr_integration.js_resources');
        $jsResourcesProvider->setDescription('Allows to contribute JS resources that will be used in Backend.');
        $jsResourcesProviderDescription = <<<TEXT
You can use this extension-point when you need to contribute javascript files to be loaded when a backend page
is loaded. This is how a typical contribution will look like:'

use Sli\\ExpanderBundle\\Ext\\ContributorInterface;

class JsResourcesProvider implements ContributorInterface
{
    /**
     * @inheritDoc
     */
    public function getItems()
    {
        return array(
            '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js'
        );
    }
}
TEXT;
        $jsResourcesProvider->setDetailedDescription($jsResourcesProviderDescription);
        $container->addCompilerPass($jsResourcesProvider->createCompilerPass());
        // allows to contribute menu items by defining them in config file
        $container->addCompilerPass(new MenuItemContributorCompilerPass());
        $bootstrappingClassLoaderMappingsProvider = new ExtensionPoint('modera_mjr_integration.bootstrapping_class_loader_mappings');
        $bootstrappingClassLoaderMappingsProvider->setDescription('Allows to contribute ExtJs classname:path mappings that will be configured before runtime is initialized.');
        $container->addCompilerPass($bootstrappingClassLoaderMappingsProvider->createCompilerPass());
    }