Versions Compared

Key

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

NEW (29.01.2024): We will change some dependency handling! For development with eclipse you must install the m2e PDE Integration into the Eclipse IDE.

After the installation it can be used in the PDE Target Editor.

06.02.2024: Due to a bug in Eclipse, you will need to use the latest eclipse version (2024-03): https://www.eclipse.org/downloads/packages/release/2024-03/


Nearly everything in Odysseus is designed to be replaced or extended. Here are the typical ones:

  • Language extensions
    • Create a new language (not only for queries, could be a DSL for anything)
    • Create a new Odysseus Script Commands (#....)
    • Create a new Logical/PQL Operator
  • Processing function extensions
    • Create new datatypes
    • Create new stream object types
      • Data Handler
    • Create a new wrapper
      • Transport handler
      • Protocol handler
    • Create new functions for expressions and predicates
    • Create new aggregation functions
    • Create new operators
  • Create new schedulers and scheduling strategies
  • Create new meta data

Table of Contents

Some OSGi/Eclipse basics

  • Bundles
    • Aka plugin: An eclipse project
    • Each bundle has its own class loader
    • MANIFEST.MF: meta data for that bundle (name, version, imports, exports…)
    • In Odysseus: a module that encapsulates functions
  • Fragment
    • A special bundle that will not exist allone but together with a host bundle
    • Same class loader as host bundle
    • Used to extend host bundle
    • We do not use this anymore, better approach is declarative services
  • Declarative Services
    • OSGi way of dependency injection
    • Defined by so called components
    • Can provide functions by interfaces or use (bind/unbind) implementations by interfaces à examples later
  • Feature: a feature is a collection of bundles
    • Define a set of bundles, that belong together and builds some functionality (e.g. each wrapper has its own feature)
    • An update site provides features
    • A bundle can be part of many features
  • Update-site:
    • A collection of features that can be installed in Odysseus
    • On the same way, as in Eclipse („Install new software“)
    • Via command on ther server
    • Via Odysseus-Script
  • Product:
    • A product is a runnable software (with an application)
    • Can be defined by bundles or features
    • We only use features to define products


OSGi Life Cycle

  • Each bundle has a life cycle
  • Installed: A bundle (with correct Metadata is installed)
  • Resolved: All dependencies (MANIFEST) are found
  • Uninstalled: removed from runtime
  • Active: a bundle is activated
    • E.g. call of bundle activator
    • Remark: there is no need to start a bundle, if the bundle should only provide classes (as a library)
  • Eclipse tries to resolve dependencies lazy, if this cannot be done, the bundle stays installed --> bundle cannot be used


Image Added

OSGi debugging

TODO: Check commands with apache felix console

  • When an application (product) gets started with –console (as in Odysseus always), there is a console available
  • ss shows all currently available bundles and their current life cycle state
  • Sometimes, there are problems because dependencies are missing (INSTALLED)
  • Typical problem: The dependency defined in the MANIFEST.MF was not added to any feature
  • diag <id> shows the missing dependencies
  • Again: Resolved is no “problem” ;-)

Image Added

  • ls: shows all currently installed (declarative) services
  • Unsatisfied: Some dependencies cannot be found
  • Use comp <id> to determine missing dependencies

Image Added


Setting up Setting up

This section describes how to set up Eclipse and Odysseus for developments.development.

New:

1. Prerequisites

You will need the following tools:

  • Java 17 OpenJDK
  • Eclipse for RCP and RAP Developers (Important! Do not use a standard eclipse version!
  • GIT client (you can use git from command line or with a tool of your choice)

2. Checkout Source Code

Remark: Under windows it is best to use a folder, that is not inside the user home path (because of long file names). A good option would be a base folder git somewhere on the root level.

There are different ways to create new functionality with Odysseus. The first way should be used if you want to add something new to Odysseus (e.g. a new wrapper) but do not want to change the common code base. This should be the preferred way of development with Odysseus:

Option 1: Extending Odysseus with New Plugins

Odysseus has a very large code base. To allow a lightweight start, we provide a template project in our Bitbucket server. You should clone or fork this project and use it to add new plugins to this template. The template can be found here: https://

...

git.swl.informatik.uni-oldenburg.de/projects/ODY/repos/odysseusrepotemplate/browse . When using git you should use the following command to clone Odysseus. The template contains some standard products and the target platform as a submodule. The "--recurse-submodules" flag clones this submodule when cloning the repository. Alternatively, you can clone the submodule individually.

Code Block

2. Checkout Source Code

Source code is public available via git (from a Bitbucket server):

Code Block
languagebash
git clone --recurse-submodules https://git.swl.offisinformatik.uni-oldenburg.de/scm/ody/odysseusrepotemplate.git newRepo
cd newRepo
cd odysseus_dev
git checkout master

Remark: because you are not allowed to push updates to the template repository you should change your repository URL to your git location and rename your folder to your new repository name.

Code Block
languagebash
// in your newRepo Folder!
git

3. Setup Eclipse

We recommend to use a dedicated Eclipse workspace for Odysseus, because a full import of Odysseus may have more than 300 Projects.The most simply way is as follows. If you are firstly starting Eclipse, choose the folder where you checked out the source code as the workspace location.

...

 remote set-url origin <new url>

ODT

There is also a first approach for an eclipse plugin that could make processing easier. For this, install the Odysseus Development Tools from the following update site

Code Block
https://odysseus.informatik.uni-oldenburg.de/download/odt/

and uncheck "Group items by category".

Image Added

After installation and restart there is a new menu option Odysseus where you can create an initial project:

Image Added

Image Added

Option 2: Extending an Existing Odysseus Plugin/Extending Odysseus Core

You want to extend an existing plugin from Odysseus or extend the core system? Then, instead of cloning the empty template from Option 1, clone the repository of the plugin you want to develop on. If the plugin is hosted in our Bitbucket, you can probably find it in one of the projects in this list: https://git.swl.informatik.uni-oldenburg.de/projects . Look for example at the Odysseus, the Odysseus Incubation and Odysseus Wrapper projects. When you have found the repository you want to use, check it out and don't forget to clone the submodule to get the target platform definition and the standard products:

Code Block
languagebash
git clone --recurse-submodules <your repo URL>
cd <repo>
cd odysseus_dev
git checkout master

Remark: There could be some updates in odysseus_dev that is not already reflected in each module. So it is always a good idea to update the odysseus_dev submodule to the newest version.

If you missed the --recurse-submodules, you can also use:

Code Block
git clone <your repo URL>
cd <repo>
git submodule init
git submodule update
cd odysseus_dev
git checkout master
cd ..

3. Setup Eclipse

After Eclipse started, you have to import all bundles (these are the parts of odysseus Odysseus and are equal to an Eclipse project). Use "File -> Import -> Existing Projects into Workspace" to import them into Eclipse as follows:

Image RemovedImage Added

Image RemovedImage Added


After clicking "Next", select all needed projects.

Image Added

Now there are many project already opened:

Most of them are from odysseus_dev.

Image Added


The source code ("trunk") folder has the following subfolders:

  • application: this folder contains all applications that use Odysseus or provide any data like generators.
  • client: contains all bundles that run on the client and don't have any dependencies to the server directly. It mainly offers the GUI.
  • common: this holds common stuff und and utilities that are needed on both server and client. Common does not have any dependencies to other folders like server, client...
  • monolithic: this folder contains bundles that will only work in a monolithic system where server and client are the same product
  • resource: possibly some resources for the bundle, but probably empty. The resources are part of the target platform and are downloaded automatically by Eclipse when settings the target platform.
  • server: this is the server part of Odysseus and contains Odysseus main functionalities. Except of common, it does not have any dependencies to other folders. It does not have any GUI or client functionalities.
  • test: contains stuff for testing and benchmarking
    tooling: contains primarily tools for the build controlling (Jenkins)

Furthermore, each main folder has different subfolders. Each subfolder normally contains a certain functionality or a dedicated extension (aka plugin for Odysseus). The main functionality of Odysseus is called "core". So, if you want to have a minimal set of bundles for developing, you will need to import the following folders: "common" and the "core"-subfolder within "server".

In the follwing screenshot some bundles are selected.

Image Removed

We recommend to create working sets like here to group certain bundles:

Image Removed

Image Removed

4. Target Platform

Since Odysseus has some dependencies to other external features like Eclipse GEF or the Equinox framework, it is necessary to use the target-platform definition.


4. Target Platform

You now see a lot of compiler error. This is because the target platform is not set.

The target platform This definition is provided via the "target-platform.target" file and can be found in the bundle/ project called "de.uniol.inf.is.odysseus.common.feature". Open this file and click "Set as target platofrm targetplatform.

Image Added

Choose the correct Targetplatform for you work.

Remark: It works best, when you first open the file (double click) and wait some time (until the platform is resolved).

Image Added

Click "Set as Active Target Platform" to use this as your target platform. Notice, the target platform is valid for your whole workspace (therefore we recommend to use a dedicated workspace for Odysseus development).

You can use CRTL-SHIFT-R to search for the target platform

Image Removed

Image Removed

. Important: Do not click, if "Resolving..." is still active!

Image Added

After that, the project will be compiled and there should not be any errors anymore.

Image Added

If there are still errors, you should try to update the odysseus_dev folder (sometimes there are errors with the sites, that dliver target platform contents)

5. First Run - Available Products

Now , you should be able to run Odysseus. There are some predefined product-definitions to run Odysseus (depending . Depending on the bundles/folders you checked out before )they can differ, but the standard submodule should contain three products:

  • Odysseus Server .product - (located in de.uniol.inf.is.odysseus.server.starterproduct) - This is just a server-based instance of Odysseus (without any GUI) which can be used e.g. via a webservice REST.
  • Odysseus Studio 2 (Client) .product - (located in de.uniol.inf.is.odysseus.client.starterproduct) - This is only the client part (GUI), which tries to connect to a an Odysseus Server instance via webservice.
  • Odysseus Studio 2 (Monolithic).product - (located in de.uniol.inf.is.odysseus.monolithic.featureproduct ) - This combines server and client into a single product and adds some additional bundles that only work in such a monolithic combination.

For the your first timerun, the easiest way is to start the "Odysseus Studio 2 (Monolithic).product"" (de.uniol.inf.is.odysseus.studio.product.monolithic). Open this file and go to the tab "Overview". Click "Synchronize" under "Testing" and afterwards click "Launch an Eclipse application" to run Odysseus (you can alternatively run it in debug mode if you want). When Odysseus Studio (the GUI) comes up, you have to insert some credentials. A default user is "System" and his the password is "manager", the tenant can be left empty. Now Odysseus should be up and running.

In some cases there is a message like:

Code Block
!MESSAGE Could not find bundle: unknown
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: unknown
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Starting application: 2420

This is due changes in the console for a new RCP version and can typically be ignored.

Image Added

6. Additional Information

Features

Since Odysseus is an OSGi based application, it is devided divided into several bundles (the bunch of projects you checked out and imported before). To keep the overview of all bundles, they are combined to features. Each feature reflects a special functionality of Odysseus. thusThus, we have a core.feature that encapsulate encapsulates all minimal needed bundles or the studio.feature that contains all bundles for the RCP aka GUI (i.e., GUI) of Odysseus (what we call Odysseus Studio). The combination of several features is called a "product" - which should be runnable. The section above, for example, lists four three products that combine different sets of features.

The core feature is necessary , because it contains all fundamental functions for Odysseus.

Here's a list of Odysseus Features: Features. See Adding features to products how to add a new Feature to an existing product.

...

Odysseus comes with the Simple Logging Facade for Java (SLF4J). To use logging, add the de.uniol.inf.is.odysseus.slf4j bundle. In this bundle you can find the log4jlog4j2.properties xml to configure the logging behaviourbehavior (or use one of the given).