ALERT: Updated info will be maintained on this topic at https://docs.onap.org/en/elalto/submodules/portal.git/docs/tutorials/index.html
The ONAP Portal SDK provides a sample web app to build and deploy to a Tomcat instance. The SDK App can be used standalone (i.e., command line) or within the Eclipse IDE. This page offers a quick-start guide for this webapp development.
Table of Contents |
---|
Browsing the SDK
Release trees are archived in this Git release repository and available for browsing:
https://gerrit.onap.org/r/#/admin/projects/portal/sdk
Downloading the SDK
Below is the link to SDK Sample App in gerrit repo. You can download the below sample app to bring up a simple demo webapp that brings many out of box features to integrate with ONAP Portal.
Prerequisites
- Java version 1.8
- Maven version 3.
- These instructions do not require any entries in a local Maven configuration file, which is stored below your home directory in file .m2/settings.xml. However, some people have reported problems caused by entries in their configuration files.
- Tomcat version 8
- MariaDB Server version 10.1.11-MariaDB, which includes Galera cluster support.
- Maven will automatically download required jar and pom files from the ONAP nexus repositories.
...
- Create a new directory and download the ONAP SDK Sample App project within that new location; e.g C:\dev\ONAP_SDK
- In the newly created directory, first run maven on the "clean" goal (mvn clean). You should see no warnings, and eventually a build success message. This validates that you have maven working.
- Build the deployable WAR file using the "package" goal (mvn package). You will see some warnings about missing pom files, which can be ignored.
Eclipse Project setup
This section offers instructions for a clean/new install of the ONAP SDK in the Eclipse development environment.
...
Note 1: If Maven dependencies are not appearing in the classpath/libraries, there could be a need to update the maven project (Right click on the project → Maven Update)
Database setup
The application requires MariaDB (MySQL-compatible) database with a predefined set of tables; see the Prerequisites section above for the software versions needed. Note that many ONAP Portal SDK team members reuse existing databases for development and test, but this option is not available to developers outside the ONAP Portal team.
...
ECOMP SDK File Name | Purpose |
---|---|
EcompSdkDDLMySql.sql | Creates all tables required by the SDK web application. Use this when creating a new database. |
EcompSdkDDL_(verNNNN)_Add.sql | Adds tables required by the SDK web application for the specified release; e.g., 1610. Use this when upgrading from a previous release. |
EcompSdkDMLMySql.sql | Populates tables with all data required by the SDK web application. Use this when creating a new database. |
EcompSdkDML_(verNNNN)_Add.sql | Adds and modifies data rows used by the SDK web application for the specified release; e.g., 1610. Use this when upgrading from a previous release. |
EcompSdkTestDML.sql | Adds data rows that may help for testing the SDK web application. Partner applications should modify this to suit testing needs. |
cleanup_EcompSdk.sql | Removes tables and keys created in the original Fusion script (previous releases) that are no longer used. Alters some columns to reduce their sizes. Use this to clean up very old versions of the database. |
Eclipse Project/Tomcat configuration/startup
- Edit the WEB-INF/conf/system.properties file with the database information. Make sure all the entries point to your local environment and a working accessible database.
db.connectionURL = jdbc:mysql://<mysql-host>:<port>/<db-name>
db.userName = mysql-user
db.password = password
- Edit the the log4j.properties file (WEB-INF/conf/log4j.properties file) and update the property "log4j.appender.logfile.File" to reflect the local environment;
- Add a Tomcat Server instance
- Click on Add / Remove on Tomcat instance you have added and add the project to it.
- Right click on the tomcat and start.
- As with most Eclipse based web applications, it is always a good idea to clean your project from all places. ( Project → Clean, Tomcat → Clean, Clean Tomcat working directory etc.)
- Once your application is up and running, if you have made suitable entries in the FN_USER table as discussed above in "Database Setup", you can open a browser with the URL: http://<host>:<port>/<context>/login_external.htm url and use the credentials stored in that table to login. This is helpful for development, but must NEVER be used in production.
Project Customization
The SDK-App distribution should be customized with the appropriate application name in these locations:
- File pom.xml: groupId, artifactId
- File src/main/resources/logback.xml: componentName
- File src/main/webapp/WEB-INF/web.xml: display-name
- File src/main/webapp/WEB-INF/conf/system.properties: app_display_name
OnBoarding SDK App to Portal
Follow below steps:
- Pre-Onboarding - provide required fields as shown in the below screen on Portal Onboarding UI.
- Post-Onboarding - Edit the portal.properties based on your deployed environment.
- ecomp_redirect_url
- ecomp_rest_url
- UEB values