Dissecting a HXE XSA project (folders and files)
Welcome back to my blogs of HANA XSA. With the upgrade from HANA 1 to HANA 2… and the changes from the initial architecture into the XSA architecture, we now have many different new folders, file types, and new ways to get things accomplished. In this blog, I would like to dissect and explain the different tools, file types, module types and the reason behind why we need to use them inside an XSA project. for information how to install XSA express edition and creating a basic demo, see my blog series
-
SAP WEB IDE (web tool)
-
At the project level
MTA.yaml
- MTA stands for multi target application
- YAML – Ain’t markup language
- Here is its syntax: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
This file explains the modules the project is made of, its versions, its dependencies and how they work with each other. This file is very sensitive to manual edits of spaces and indentations. Be careful if you are manipulating it with the code editor. I suggest you use the graphical mode if you need to modify it.
Avoid being a victim of the MTA.YAML code editor
-
Then, the SAPUI5 module (aka web project)
- package.json – this file has the configuration for what libraries are needed and their specific versions to be used within the project and any dependencies between the libraries used.
- xs-app.json – this file contains what the good old .xsaccess file from XSC had. It had routes, welcome file, and authentication methods amongst other things.
- Inside the resources/webapp folder we see a manifest.json and a component.json files
- manifest.json àit has metadata about the project, such as name, version, sap.app, sap.ui, and sap.ui5 library versions.
- Component.js file à this file is used to extend the base component, set routes, and initialize any app models.
-
Next in the Database module (aka dbm module)
this module contains a package.json file which is different from that of sapui5 module. The package file acts as a config entry point for the various modules. I bet you this same file will show up in the next module*** again, it has name, dependencies, scripts.
One more thing inside the DB module that is not visible by default are some hidden files:
- select the db module, and click on the View menu – then select Show hidden files
doing so, will reveal 2 files: .hdiconfig – which contains configuration about plugins used in the db module, and .hdinamespace which contains the hdi namespace that we specified when we created the module at the beginning of the project.
-
In the NodeJS module (aka server side JS module)
we will see some new folders and also files
- node_modules folder –> this folder contains all the node js modules that are needed in the project. Further, this folder can help us see when a module has been loaded or not. Next, you can see the different node js modules that were loaded, including the @sap modules.\
Should you need any additional nodejs modules in your application, do not be afraid to open the node_modules folder to make sure the package doesn’t already exist or the correct version. And, if it doesn’t, then include that module name inside the package.json file inside the dependencies section:
Remember
that rebuilding the module will install the dependencies and they will then show in the node_modules folder. Further, each node_modules child folder will contain a read me file (with instructions of how to use it), a package file (with further dependencies and other metadata for that module) and an index.js file (for its modular executoin) at least.
- package.json –> same reason as the other files, but this one belongs to the nodejs module and it is used to specify which version of the libraries used are needed to download.
- Server.js –> default file to create the entry point of the nodejs module.
Here is an example of the package file inside the nodejs module
Since I have concluded the 3 main modules on a HANA XSA project, I would like to also list out the two files that existed on HANA 1 (XS classic) but they do no longer seem to exist in HANA XSA (so forget about them) :
- .xsapp
- .xsaccess
Thank you again for reading this blog. I hope you have learned a couple things about the set up of some of the projects and specifically this project/demo. Please share your experiences.