Skip to content

Developer Setup Instructions Eclipse OpenIoT v0.6.1

Nikos Kefalakis edited this page Dec 17, 2015 · 12 revisions

Table of Contents

INTERGRATION ENVIORMENT SETUP

Source code location

Documentation

Development Platform

Eclipse Integrated Development Environment (IDE) – Latest Version

Java SDK 1.7+ - Latest Version

JBOSS AS 7.1.1 (Please use only this version)

Maven 3.1 (Or Latest)

Environmental Path

  • The following variables needs to be set for successful running of maven, JBOSS and java
    • JAVA_HOME
    • MAVEN_HOME
  • The following path needs to be set
    • Java bin directory
    • Maven bin directory
The following is a useful link on how to setup maven.

http://www.mkyong.com/maven/how-to-install-maven-in-windows/

ECLIPSE Install Guide FOR openiot code

This document aims to provide a step-by-step instruction to deploy the OpenIoT components form scratch.

OpenIoT Modules in GitHub

  • UI Folder
    • ui.requestCommons
    • ui.requestDefinition
    • ui.requestPresentation
    • ide/ide.core
    • ui.schemaeditor
    • modules
      • Scheduler
        • scheduler.core
        • scheduler.client
      • SDUM
        • sdum.core
        • sdum.client
      • LSM-Lite
        • lsm-server
        • lsm-client
      • x-gsn
      • security
        • security-management
        • security-client
        • security-server
      • CUPUS
    • Under utils
      • utils.commons

Pre-requisites

  1. Install maven
Download maven from http://maven.apache.org/
  1. Set the path to the maven bin directory
  2. Ensure you can run the mvn –version command from terminal or command prompt
  1. Install Eclipse Juno (or latest version). The following eclipse plugins needs to be installed to get a working environment without any errors. If you use a different version of eclipse, please update the following tools with corresponding version.
  1. Maven 2 Eclipse plugin – This is required to run maven commands from Eclipse and also import POM files into Eclipse as a eclipse-maven project.
http://download.eclipse.org/technology/m2e/releases
  1. Install JBOSS Maven Support and JBOSS Web and Java EE Development tools – http://download.jboss.org/jbosstools/updates/stable/juno
For JBOSS Web and Java EE Development Tools, only install
  • Context and Dependency Injection Tools
  • Forge Tools
  • JBOSS JAX-RS Rools
  • JBOSS Tools Java Standard Tools
  • JBoss Tools JSF
  • JBoss Tools RichFaces
  • JBoss Tools Visual Page Editor
  • JBoss WebService Tools
  • JBossAS Tools
    1. JIBX Eclipse plugin 1.1.6a from
http://jibx.sourceforge.net/eclipse/
  1. Web Tools Platform 3.4.2
http://download.eclipse.org/webtools/repository/juno/

All these plugins can be installed from eclipse “install new software” option from under Help menu.

Note: If you use a more recent version of eclipse, please replace the URl with corresponding version specific plugins.

Note: When using Eclipse Kepler, as much as possible, install the above plugins from the Eclipse Marketplace by searching for plugins by name.

  1. Download JBoss 7.1.
    1. Unzip JBOSS to a directory in your hard drive.
  2. In Eclipse, under Windows->Show View->Other, search for servers.
    1. In the server window, right click and select new.
    2. If you have all the above plugin and tools installed, you will see an option for JBOSS 7.1 under the server options
    3. Select the location of JBOSS (the location on your drive previously unzipped).
    4. Start the JBOSS server from eclipse (a small play icon in the server window) to test and ensure JBOSS is starting and running successfully.

Download OpenIoT source code

Download the OpenIoT sources from github using your favorite git client (https://github.com/OpenIotOrg/openiot) or if using bash using the command

git clone https://github.com/OpenIotOrg/openiot.git

Configuring JBoss

See https://github.com/OpenIotOrg/openiot/wiki/JBossWithSSL

Installing Local Virtuoso Instance

Please follow the link below for detailed instructions for installing Virtuoso.

Note: for Linux installations, Virtuoso requires a 64 bit machine.

https://github.com/OpenIotOrg/openiot/wiki/InstallingVirtuosoOpensource7Ubuntu

Eclipse Workspace and Project setup

  1. Start eclipse and create a new workspace.
  2. Import the following projects into eclipse using the file->import->maven project option.
    1. scheduler.core
    2. sdum.core
    3. security.server
    4. security.management
    5. security.client
    6. ui.requestCommons
    7. ui.requestDefinition
    8. ui.requestPresentation
    9. ui.schemaeditor
    10. utils.commons
    11. lsm.server
    12. lsm.client
    13. x-gsn
Note: If maven complains about a JIXB plugin go ahead and import the project. This error is temporary and we will fix it later.
  1. Each project should import successfully, download all the POM dependencies.
  2. The above projects are dependent on the utils.commons, ui.requestCommons, lsm-client and security-client.
    1. Other project might pop up a missing dependency error. Don’t worry yet.
    2. Right click on the utils.commons project and choose run as-> maven build … (choose the one with three dots)
    3. In the new window, for goals enter the word “install”
    4. This will compile the project, generate the jar and install it in the maven repository.
    5. Repeat the same steps for the ui.requestCommons, security-client and lsm-client projects.
  3. Right Click on the other projects and run maven->update project
  4. Now all errors should be resolved and only x-gsn will indicate an error. Ignore this as the error is due to incompatibility to eclipse maven plugin with some x-gsn configurations.
  5. Copy the openiot.properties and the security.ini file from the utils.common/src/main/resources/properties to the jboss folder standalone/configuration
Sample openiot.properties and security.ini files that work with a local installation of OpenIoT including LSM and Virtuoso is provided for reference.

openiot.properties https://github.com/OpenIotOrg/openiot/blob/develop/utils/utils.commons/src/main/resources/properties/openiot.properties

security-config.ini https://github.com/OpenIotOrg/openiot/blob/develop/utils/utils.commons/src/main/resources/security-config.ini

More documentation on how to assign roles to users is available at https://github.com/OpenIotOrg/openiot/wiki/Security-Use-Console

  1. Assign the newly created user the above roles allowing this user to access all the services
  2. Logout

Sensor Schema Editor

The schema editor interface can be access from http://localhost:8080/ui.schemaeditor

  1. Login with CAS
Follow the instructions in the wiki below to generate sensor descriptions

https://github.com/OpenIotOrg/openiot/wiki/Virtual-Sensor-RDF-Schema-Editor-Use

xGSN

The first component setup was xGSN. This was to ensure that there was sensor data available to be used later on by the request application

Wiki reference

LSM configuration properties

Update the X-GSN application.conf file under modules/x-gsn/src/main/resources as below

Note: The graph information in the application.conf must be identical to the graph information in the openiot.properties file.

https://github.com/OpenIotOrg/openiot/blob/develop/modules/x-gsn/src/main/resources/application.conf

Creating virtual sensor metadata file

To generate the metadata file, use the sensor schema editor which can be accessed from localhost:8080/ui.schemaeditor if the JBOSS is deployed to localhost. Please replace localhost with the public IP or host name if JBOSS depending on your installation.

Follow the instructions in the wiki below to generate sensor descriptions

https://github.com/OpenIotOrg/openiot/wiki/Virtual-Sensor-RDF-Schema-Editor-Use

The schema editor will register the sensor with LSM and provide the user with a metadata file which has to be place in the following directory along with the virtual sensor XML file /modules/x-gsn/virtual-sensors/

Creating virtual sensor XML file

There are many sample XML files in the xGSN folder under the LSM directory. Below is a sample XML file that connects to a CSV wrapper to read data from a CSV file.

https://github.com/OpenIotOrg/openiot/blob/develop/modules/x-gsn/virtual-sensors/LSM/opensense_1.xml

Running xGSN from Command Prompt

To run xGSN from command prompt (windows), and shell (linux) the following command is executed

gsn-start.bat

gsn-start.sh

Scheduler Core/Client

The scheduler core is the core service that will be deployed on JBOSS. The scheduler service can be tested by opening the following URL

http://localhost:8080/scheduler.core/rest/services

The scheduler client is a java application with Swing UI to test the services of the scheduler.core service.





sDUM

The SDUM core is the core service that will be deployed on JBOSS. The SDUM service can be tested by opening the following URL

http://localhost:8080/sdum.core/rest/services

The sdum client is a java application with Swing UI to test the services of the sdum.core service.

Request Definition

The request definition interface can be access from http://localhost:8080/ui.requestDefinition

  1. Login with CAS
  2. Compose a new service
  3. Validate the design
  4. Save the design
Please refer to the OpenIoT Wiki for more detailed procedures. Please explore both user and develop sections.

Request Presentation

The request definition interface can be access from http://localhost:8080/ui.requestPresentation

  1. Login with CAS
  2. Load your application
  3. Click on current application-force dashboard refresh
  4. Data should become available in the selected output format
Please refer to the OpenIoT Wiki for more detailed procedures. Please explore both user and develop sections.
Clone this wiki locally