Breadcrumb
- Sabre Red 360 Software Development Kit Help
- Sabre Red 360 Developer Toolkit
- Web Modules
- Development Cycle
- Create Web Module Structure
Create Web Module Structure
Web module id
The id of web module must start with the Bundle-Symbolic-Name (non-alphanumeric characters replaced with hyphens), then contain the character -
and desired web module name, e.g: com-sabre-redapp-example-my-web-module
Adding web module to Red App
To create Red App with web module create basic Red App (refer to other parts of this document for information about setting up dev environment and generating red app template.
-
create
web-src
directory in there -
cd
into it -
run
ngv init
follow the wizard. Web module template will be created.ImportantThe web module id must match the pattern: Bundle-Symbolic-Name-My_Web_Module_Name (non-alphanumeric characters replaced with hyphens) -
Add web extension information into
plugin.xml
file, ex.
<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="com.sabre.edge.dynamo.web.module"> <modules> <module id="<web-module-id as set during ngv init>"/> </modules> </extension> </plugin>
Building and deploying
To compile web module run ngv build
command inside web-src/module-id/
. build
directory will be created, with prod
subdirectory in it.
To run web module in SR360 copy everything from prod
directory into web
directory, located on the same level as web-src
, ex.
->META-INF ->... ->web-src ->my-red-app-web-module ->build -> prod ->... ->web
concierge.conf.js
Concierge.conf.js file can make webmodule deployments easier. Create concierge.conf.js within webmodule directory:
->META-INF ->... ->web-src ->my-red-app-web-module ->concierge.conf.js ->web
Body of concierge.conf.js should like in presented below example. Provide path where compiled webmodule should be deployed under dist-copy
directive.
module.exports = { metadata: { 'dist-copy' : { 'prod': '../../web/my-red-app-web-module' } } }
Since now building webmodule with command ngv build
will deploy compiled webmodule into declared path.