JBoss Community Archive (Read Only)

GateIn Portal 3.8

GMD Load Groups

Until now we focused on the logical definition of modules, i.e as a self-executing function and an XML descriptor. When those modules loaded by the browser, GateIn serves them as web resource. By default a module will be served as a single resource, however this can be an issue in the production system and the load group feature allows to decouple the logical module and the JavaScript resource serving:

The load-group XML tag can be used to group modules together in the same web resources. When a module of a load-group is requested, the web resource containing the modules of the load group is loaded, for instance if we have the foo and bar modules grouped by foobar :

<module>
  <name>foo</name>
  <load-group>foobar</load-group>
  ...
</module>
<module>
  <name>bar</name>
  <load-group>foobar</load-group>
  ...
</module>

When the foo is loaded the AMD loader will load the foobar group instead of only foo, consequently the bar module is also available now. If there is any request for bar module, no more request is made as it is already loaded.

Note: Don't use group name that follow by dash and 2 character, for example: forbar-as. This may cause unexpected parsing group name on the server (on gatein 3.5.0.Final)

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 13:20:44 UTC, last content change 2014-04-15 06:42:19 UTC.