Message-ID: <915699760.3308.1485852669760.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3307_1445890431.1485852669760" ------=_Part_3307_1445890431.1485852669760 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Set up the configuration

Set up the configuration

=20 =20

PlatformUI Co= nfiguration files

JavaScript modu= les in yui.yml

Each component of the PlatformUI application is written as a YUI module. The YUI module system comes with a dependen= cy system which is used in the PlatformUI application. For instance, the Pl= atformUI application has a module called ez-templatebasedview = which provides a base view class to ease the usage of a template. This modu= le is a dependency of most of the views in the application and has itself s= ome dependencies, like for instance the view module from YUI. Those depende= ncies are expressed in the yui.yml configuration and this conf= iguration is meant to be extended / overridden in others bundles. For insta= nce:

Excerpt of yui.yml
=20
system:
    default:
        yui:
            modules:               =20
                ez-templatebasedview:
                    requires: ['ez-texthelper', 'ez-view', 'handlebars', 't=
emplate']
                    path: %ez_platformui.public_dir%/js/views/ez-templateba=
sedview.js
                ez-loginformview:
                    requires: ['ez-templatebasedview', 'node-style', 'login=
formview-ez-template']
                    path: %ez_platformui.public_dir%/js/views/ez-loginformv=
iew.js
=20

This configuration defines two modules ez-templatebas= edview and ez-loginformview:

 

Note that the order of module definitions is not important, ez-log= informview can be defined before the ez-templatebaseview module even if the latter is a dependency of the former.

Most of the PlatformUI application views use a Handlebars template to ge= nerate the HTML markup. In the application the templates are also handled a= s YUI modules but those modules are special because they are dynamically ge= nerated from the regular template files on the disk. For this to work, the = YUI module corresponding to a template must have the type flag= set to template. To complete the example above, the template = module loginforview-ez-template should be defined in the follo= wing way:

=20
loginformview-ez-template:
    type: 'template'
    path: %ez_platformui.public_dir%/templates/loginform.hbt
=20

CSS files in css.y= ml

The CSS files used by the application are also listed in css.yml, but in the case of CSS files, it's much simpler as this file just li= sts the CSS files to load, example:

Excerpt of css.yml
=20
system:
    default:
        css:
            files:
                - '@eZPlatformUIBundle/Resources/public/css/views/field.css=
'
                - '@eZPlatformUIBundle/Resources/public/css/views/fields/vi=
ew/relation.css'
=20

Injecting the extension custom configuration files

To be able to extend the PlatformUI application configuration, the exten= sion bundle has to set up its own configuration handling. For this, you onl= y have to tweak the extension class generated in the bundle in the first step to load the= extension bundle's yui.yml and css.yml and to pr= ocess their respective content with PlatformUI's configuration. The default= empty yui.yml and css.yml also have to be create= d so that eZ Platform is still usable.

If you want to get more details on this operation, you can read the How to expose SiteAccess aware configuration for your bundle= cookbook page.

After this, you just have to make sure the bundle has a Resources/= public directory to install the assets with the following command:

=20
$ app/console assets:install --symlink
=20
Results and next step:

The resulting code can be seen in the 2_configuration tag on GitHub (the intere= sting part is the EzSystemsExtendingPlatformU= IConferenceExtension class), this step result can also be= viewed as a diff between tags 1_bundle and 2_configu= ration.

After these two first steps, PlatformUI should remain perfectly usable a= nd unchanged. The next step is then to tweak the PlatformUI Application routing = to start implementing the new feature.

------=_Part_3307_1445890431.1485852669760--