1 # Developing a ODLUX application
6 * Yarn: 1.12.3 or higher
7 * Lerna: 3.10.7 or higher
9 You can install these globally or let it be installed by maven due "mvn clean install"
14 ## Dev-Environment Installation
16 * install NodeJS LTS https://nodejs.org/en/ or via packetmanager
17 * sudo npm install -g yarn
18 * sudo yarn global add lerna
19 * get framework from repository: git clone https://gerrit.onap.org/r/ccsdk/features
20 * in features/sdnr/wt/odlux you find a structure like this:
28 * go to features/sdnr/wt/odlux/apps and create your app:
30 mvn archetype:generate -DarchetypeGroupId=org.onap.ccsdk.features.sdnr.wt \
31 -DarchetypeArtifactId=odlux-app-archetype \
33 -DartifactId=<artifactId> \
35 -DappName=<applicationName>
38 * your start folder for your web application is src/
39 * in src2/main/java are located the Java files and in src2/main/resources/ is the blueprint located
40 * with ```yarn start``` you can run your application due runtime in your application folder
41 * by default this will run on http://localhost:3100/index.html
42 * if you have added new dependencies you have to run ```lerna bootstrap``` in odlux/
43 * build your app for development version you can use ```yarn run build``` or ```yarn run build:dev```
44 * build for karaf with ```mvn clean install```
47 ## Including app into karaf environment
49 * copy maven repository files to karaf repository e.g.: ```cp ~/.m2/repository/path/of/groupId/artifactId $KARAF_HOME/system/path/of/groupId/```
50 * check if odlux-core is started in karaf console: ```feature:list | grep odlux```
51 * if not install: ```sdnr-wt-odlux-core-feature```
52 * start your app in karaf console: ```bundle:install -s mvn:<groupId>/<artifactId>/<version>```
54 ## Including into ONAP sdnc docker container
56 * add maven module to odlux/pom.xml
57 * add dependency to odlux/apps/app-feature/pom.xml and odlux/apps/app-installer/pom.xml
59 * this will automatically package your app into the packaged zip file of the installer
63 ### Default menu positions
65 * from 0 for top to 999 for bottom.
84 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
85 <reference id="loadersvc" availability="mandatory" activation="eager" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader"/>
86 <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle">
87 <property name="loader" ref="loadersvc"/>
88 <property name="bundleName" value="demoApp"/>
89 <property name="index" value="999"/>
93 * bundleName defines the applicationName => default javascript file: <applicationName>.js
94 * index defines the menu position.
96 ### MyOdluxBundle.java
98 * is just for getting access to the resources of its bundle (implemented because of OSGi access restrictions)
103 <?xml version="1.0" encoding="UTF-8"?>
104 <project xmlns="http://maven.apache.org/POM/4.0.0"
105 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
106 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
109 <groupId>org.onap.ccsdk.parent</groupId>
110 <artifactId>odlparent</artifactId>
111 <version>1.2.1-SNAPSHOT</version>
114 <modelVersion>4.0.0</modelVersion>
115 <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
116 <artifactId>sdnr-wt-odlux-app-demoApp</artifactId>
117 <version>0.4.1-SNAPSHOT</version>
118 <packaging>bundle</packaging>
119 <name>sdnr-wt-odlux-app-demoApp</name>
122 <name>Apache License, Version 2.0</name>
123 <url>http://www.apache.org/licenses/LICENSE-2.0</url>
128 <groupId>${project.groupId}</groupId>
129 <artifactId>sdnr-wt-odlux-core-model</artifactId>
130 <version>${project.version}</version>
133 <groupId>${project.groupId}</groupId>
134 <artifactId>sdnr-wt-odlux-core-provider</artifactId>
135 <version>${project.version}</version>
139 <groupId>junit</groupId>
140 <artifactId>junit</artifactId>
145 <sourceDirectory>src2/main/java</sourceDirectory>
148 <artifactId>maven-clean-plugin</artifactId>
152 <directory>dist</directory>
153 <followSymlinks>false</followSymlinks>
156 <directory>node</directory>
157 <followSymlinks>false</followSymlinks>
160 <directory>node_modules</directory>
161 <followSymlinks>false</followSymlinks>
164 <directory>../node_modules</directory>
165 <followSymlinks>false</followSymlinks>
171 <groupId>org.codehaus.mojo</groupId>
172 <artifactId>build-helper-maven-plugin</artifactId>
175 <id>add-test-source</id>
176 <phase>generate-test-sources</phase>
178 <goal>add-test-source</goal>
182 <source>src2/test/java</source>
189 <groupId>com.github.eirslett</groupId>
190 <artifactId>frontend-maven-plugin</artifactId>
191 <version>1.8-SNAPSHOT</version>
194 <id>install node and yarn</id>
196 <goal>install-node-and-yarn</goal>
198 <!-- optional: default phase is "generate-resources" -->
199 <phase>initialize</phase>
201 <nodeVersion>v8.10.0</nodeVersion>
202 <yarnVersion>v1.12.3</yarnVersion>
211 <arguments>run build</arguments>
217 <groupId>org.apache.maven.plugins</groupId>
218 <artifactId>maven-jar-plugin</artifactId>
221 <groupId>org.apache.felix</groupId>
222 <artifactId>maven-bundle-plugin</artifactId>
223 <extensions>true</extensions>
226 <Import-Package>org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.*</Import-Package>
227 <Private-Package></Private-Package>
234 <directory>dist</directory>
235 <targetPath>odlux</targetPath>
238 <directory>src2/main/resources</directory>
241 <directory>src2/test/resources</directory>
247 <id>highstreet repo</id>
248 <url>https://cloud-highstreet-technologies.com/mvn/</url>
250 <enabled>true</enabled>
251 <updatePolicy>always</updatePolicy>
254 </pluginRepositories>
259 * a 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.