Chapter 37. Aliases

It is possible to define an alias for each module declared in the gatein-resources.xml file. The alias is added to the module declaration using the <as> element:

<module>
  <name>foo</name>
  <as>Foo</as>
  ...
</module>
<module>
  <name>bar</name>
  ...
  <depends>
    <module>foo</module>
  </depends>
</module>
The alias can then be used instead of the module's name in the argument of the respective self-executing JavaScript function:

(function(Foo) {
})(Foo)
Similarly, the <as> element can also be used inside the <depends> element to define a local alias for the dependency:

<module>
  <name>foo</name>
  ...
</module>
<module>
  <name>bar</name>  
  ...
  <depends>
    <module>foo</module>
    <as>Foo</as>
  </depends>
</module>