1 # Developing a ODLUX application
5 ODLUX bundle contains the Browser based Grapical User Interface for SDN-R.
6 ODLUX is available as OSGi bundle that is running in Opendaylight Karaf environment, using the configured jetty server of Opendaylight.
7 Since ONAP Frankfurt a second WEB Server setup "sdncweb" is available, that extracts the JavaScrip files.
11 Actual version in framework pom.xml in the frontend-maven-plugin definition.
16 You can install these globally or let it be installed by maven due "mvn clean install"
21 ## Dev-Environment Installation
23 * install NodeJS LTS https://nodejs.org/en/ or via packetmanager
24 * sudo npm install -g yarn
25 * sudo yarn global add lerna
26 * get framework from repository: git clone https://gerrit.onap.org/r/ccsdk/features
27 * in features/sdnr/wt/odlux you find a structure like this:
35 * go to features/sdnr/wt/odlux/apps and create your app:
37 mvn archetype:generate -DarchetypeGroupId=org.onap.ccsdk.features.sdnr.wt \
38 -DarchetypeArtifactId=odlux-app-archetype \
40 -DartifactId=<artifactId> \
42 -DappName=<applicationName>
45 * your start folder for your web application is src/
46 * in src2/main/java are located the Java files and in src2/main/resources/ is the blueprint located
47 * with ```yarn start``` you can run your application due runtime in your application folder
48 * by default this will run on http://localhost:3100/index.html
49 * if you have added new dependencies you have to run ```lerna bootstrap``` in odlux/
50 * build your app for development version you can use ```yarn run build``` or ```yarn run build:dev```
51 * build for karaf with ```mvn clean install```
54 ## Including app into karaf environment
56 * copy maven repository files to karaf repository e.g.: ```cp ~/.m2/repository/path/of/groupId/artifactId $KARAF_HOME/system/path/of/groupId/```
57 * check if odlux-core is started in karaf console: ```feature:list | grep odlux```
58 * if not install: ```sdnr-wt-odlux-core-feature```
59 * start your app in karaf console: ```bundle:install -s mvn:<groupId>/<artifactId>/<version>```
61 ## Including into ONAP sdnc docker container
63 * add maven module to odlux/pom.xml
64 * add dependency to odlux/apps/app-feature/pom.xml and odlux/apps/app-installer/pom.xml
66 * this will automatically package your app into the packaged zip file of the installer
70 ### Default menu positions
72 * from 0 for top to 999 for bottom.
91 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
92 <reference id="loadersvc" availability="mandatory" activation="eager" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader"/>
93 <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle">
94 <property name="loader" ref="loadersvc"/>
95 <property name="bundleName" value="demoApp"/>
96 <property name="index" value="999"/>
100 * bundleName defines the applicationName => default javascript file: <applicationName>.js
101 * index defines the menu position.
103 ### MyOdluxBundle.java
105 * is just for getting access to the resources of its bundle (implemented because of OSGi access restrictions)
109 * The pom.xml in the framework subdirectory is the reference for ODLUX creation. [framework pom](framework/pom.xml)
110 * The node and yarn versions are specified
111 * A specific variant of "frontend-maven-plugin" is used to create the environment to compile to javascript. This modified frontend-maven-plugin installs node, yarn and (optionally lerna) to compile the typescript sources to javascript. These will be build into the dist folder.