Wednesday 22 February 2017

HANA XS: All About Java Script Libraries.

HANA Server side libraries are special type of Java Script program that can be imported and called in JavaScript program to perform simple and repetitive tasks.
Basic points about Server side libraries.

  1. The libraries exist in the context of package, which is referenced when you import a package.
  2. The libraries are imported by using function import of XS Java Script API.
    Syntax: import(path,library).
  3. The Import operation generates a hierarchy of objects below $ that resembles the libraries location in the repository.
    for example- if library name is Test located at path new/testpackage having function sum(),minus()
    Then it will generate following object.
    $new.testpackage.Test
    Additional properties for newly generated libraries object.
    $new.testpackage.Test.sum()
    $new.testpackage.Test.minus()
  4. Do not import the referenced libraries if it is already defined in the package.
    For example:
    Pre-defined libraries which gets included when create a project.
  5. How to write Custom Server side libraries.





2 comments: