Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

Browsing the SDK

Release trees are archived in this Git release repository and available for browsing:

...

  1. Configure the server to ignore case on table names by setting the MySQL/MariaDB system variable called lower_case_table_names to value 1. Example line in the MySQL configuration file my.cnf within the [mysqld] section:
    lower_case_table_names = 1
  2. Create a database user, for example 'ecomp_sdk_user':

    1. mysql> create user 'ecomp_sdk_user'@'localhost' identified by 'ecomp_sdk_pass';
  3. Create a database, for example 'ecomp_sdk':
    1. mysql> create database 'ecomp_sdk';
  4. Grant access to the newly created database.  For example, if the database is created with the name of ‘ecomp_sdk’, login as root to your MySQL instance and grant full privileges on the database you created.  Depending on your distribution, the command will look something like this:

    1. mysql> grant all on ecomp_sdk.* to ‘ecomp_sdk_user’@'localhost';

  5. Populate the database by first running the DDL and then DML scripts provided in folder db-scripts. There are 6 scripts included that can be used for SDK; only one DDL and one DML file is necessary at one time. Please see the table below to see which scripts your instance needs.  You will need to revise the scripts to use the database name you chose above; all scripts use the database name "ecomp_sdk".  For example:

    1. mysql> source EcompSdkDDLMySql.sql;
    2. mysql> source EcompSdkDMLMySql.sql
ECOMP SDK File NamePurpose
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

  1. 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

  2. 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; 
  3. Add a Tomcat Server instance
  4. Click on Add / Remove on Tomcat instance you have added and add the project to it.
  5. Right click on the tomcat and start.
  6. 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.)
  7. 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:

  1. File pom.xml: groupId, artifactId
  2. File src/main/resources/logback.xml: componentName
  3. File src/main/webapp/WEB-INF/web.xml: display-name
  4. File src/main/webapp/WEB-INF/conf/system.properties: app_display_name