2.14.5. Aliases

When a module is defined, the module name will be used in an argument of the JavaScript self-executing function:


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

The corresponding module foo code is:

(function(foo) {
})(foo)

Aliases allow changing this name and provide a different name for arguments. Aliasing is done thanks to the as XML tag:

Module alias

Other modules that depends on aliasing will refer to it by the module alias defined in gatein-resources.xml.


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

The code of the corresponding foo module is:

(function(Foo) {
})(Foo)

Dependency alias

The same as tag can be used in the depends tags by providing a local alias:


<module>
  <name>foo</name>
  ...
</module>
<module>
  <name>bar</name>
  ...
  <depends>
    <module>foo</module>
    <as>Foo</as>
  </depends>
</module>
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus