Eclipse Sirius Web is a framework to easily create and deploy studios to the web.
This repository, SiriusWebConnectors
, contains connectors allowing to bind Sirius Web
to external data sources:
-
org.obeonetwork.siriusweb.db.connector.mysql
contains Java services designed to be used along with AQL inside Sirius Web Studio Definition; -
org.obeonetwork.siriusweb.db.connector.influxdb
contains Java services designed to be used along with AQL inside Sirius Web Studio Definition.
The MySQL connector for Sirius Web is compatible with MySQL 8.x. It relies on the Java SQL standard library.
In the chapter below, we assume you already have followed the Sirius Web page showing how to build and start a Sirius Web server, and how to generate a Github Access Token.
If you want to add the MySQL connector to your Sirius Web application, please follow these steps:
In the Maven pom.xml file of your application, please add the SiriusWebConnectors repository and the MySQL connector dependency:
...
<repositories>
...
<repository>
<id>github-sirius-web-connectors</id>
<url>https://maven.pkg.github.com/ObeoNetwork/SiriusWebConnectors</url>
</repository>
...
</repositories>
...
<dependencies>
...
<dependency>
<groupId>org.obeonetwork</groupId>
<artifactId>sirius-web-db-connector-mysql</artifactId>
<version>0.9.2</version>
</dependency>
...
<dependencies>
...
Please check the last version of the dependency here.
Edit your $HOME/.m2/settings.xml
to tell Maven to use your Github token when accessing the SiriusWebConnectors repository:
...
<servers>
...
<server>
<id>github-sirius-web-connectors</id>
<username>$GITHUB_USERNAME</username>
<password>$GITHUB_ACCESS_TOKEN</password>
</server>
...
</servers>
...
Your application should already contains a IJavaServicesProvider implementation.
You just have to add MySQLServices as a service class of your IJavaServiceProvider
:
import org.eclipse.sirius.components.emf.view.IJavaServiceProvider;
import org.eclipse.sirius.ext.emf.edit.EditingDomainServices;
import org.obeonetwork.siriusweb.db.connector.mysql.MySQLServices;
import org.springframework.stereotype.Service;
...
@Service
public class YourServicesProvider implements IJavaServiceProvider {
@Override
public List<Class<?>> getServiceClasses(View view) {
return List.of(EditingDomainServices.class, MySQLServices.class);
}
}
When you start your Sirius Web application, the following variables must have been added to your environment variables:
DB_CONNECTOR_MYSQL_URL=YOUR_MYSQL_DB_IP_ADDRESS
DB_CONNECTOR_MYSQL_USER=YOUR_MYSQL_USER_NAME
DB_CONNECTOR_MYSQL_PASSWORD=YOUR_MYSQL_PASSWORD
For example:
DB_CONNECTOR_MYSQL_URL=localhost
DB_CONNECTOR_MYSQL_USER=root
DB_CONNECTOR_MYSQL_PASSWORD=mySuperPassword
The MySQL Java services class only supports a subset of the MySQL language. For each service it also only supports some of the options of the MySQL equivalent statement/optimization/clause.
AQL service | MySQL equivalent | Note |
---|---|---|
from('table_references') |
FROM table_references |
|
fullJoin('join_clause') |
FULL JOIN join_clause |
|
groupBy('groupBy_expression') |
GROUP BY groupBy_expression |
|
innerJoin('join_clause') |
INNER JOIN join_clause |
|
join('join_clause') |
JOIN join_clause |
|
leftJoin('join_clause') |
LEFT JOIN join_clause |
|
on('on_expression') |
ON on_expression |
Works only with after the call of |
rightJoin('join_clause') |
RIGHT JOIN join_clause |
|
sqlSelect('select_expression') |
SELECT select_expression |
|
where('where_condition') |
WHERE where_condition |
|
mySQL('dB_name') |
N/A |
Service used to initialize a query. Must be call on an object and with the name of the database on which the query will be executed. |
fetch() |
N/A |
Service used to execute the query. Returns a list of |
The InfluxDB connector for Sirius Web is compatible with InfluxDB 2.x. It relies on the influxdb-client-java library.
In the chapter below, we assume you already have followed the Sirius Web page showing how to build and start a Sirius Web server, and how to generate a Github Access Token.
If you want to add the InfluxDB connector to your Sirius Web application, please follow these steps:
In the Maven pom.xml file of your application, please add the SiriusWebConnectors repository and the InfluxDB connector dependency:
...
<repositories>
...
<repository>
<id>github-sirius-web-connectors</id>
<url>https://maven.pkg.github.com/ObeoNetwork/SiriusWebConnectors</url>
</repository>
...
</repositories>
...
<dependencies>
...
<dependency>
<groupId>org.obeonetwork</groupId>
<artifactId>sirius-web-db-connector-influxdb</artifactId>
<version>0.9.1</version>
</dependency>
...
<dependencies>
...
Please check the last version of the dependency here.
Edit your $HOME/.m2/settings.xml
to tell Maven to use your Github token when accessing the SiriusWebConnectors repository:
...
<servers>
...
<server>
<id>github-sirius-web-connectors</id>
<username>$GITHUB_USERNAME</username>
<password>$GITHUB_ACCESS_TOKEN</password>
</server>
...
</servers>
...
Your application should already contains a IJavaServicesProvider implementation.
You just have to add InfluxDBServices as a service class of your IJavaServiceProvider
:
import org.eclipse.sirius.components.emf.view.IJavaServiceProvider;
import org.eclipse.sirius.ext.emf.edit.EditingDomainServices;
import org.obeonetwork.siriusweb.db.connector.influxdb.InfluxDBServices;
import org.springframework.stereotype.Service;
...
@Service
public class YourServicesProvider implements IJavaServiceProvider {
@Override
public List<Class<?>> getServiceClasses(View view) {
return List.of(EditingDomainServices.class, InfluxDBServices.class);
}
}
When you start your Sirius Web application, the following variables must have been added to your environment variables:
DB_CONNECTOR_INFLUXDB_URL=YOUR_INFLUX_DB_SERVER_ADDRESS
DB_CONNECTOR_INFLUXDB_ORG=YOUR_INFLUX_DB_ORGANISATION
DB_CONNECTOR_INFLUXDB_TOKEN=YOUR_INFLUX_DB_TOKEN
For example:
DB_CONNECTOR_INFLUXDB_URL=http://localhost:8086
DB_CONNECTOR_INFLUXDB_ORG=obeo
DB_CONNECTOR_INFLUXDB_TOKEN=F0BQRD-McfOqWIJFqGxJ3QwEGCJpnlxwIRPlhX-c2sJQHqjOaQqgImslF1ug_nw4gDqlqBwBIVj9ZgKL28NpPc==
AQL service | InfluxDB equivalent | Note |
---|---|---|
aggregateWindow('parameters') |
aggregateWindow(parameters) |
|
cumulativeSum() |
||
derivative('parameters') |
derivative(parameters) |
|
keep('parameters') |
keep(parameters) |
|
fill('parameters') |
fill(parameters) |
|
fluxFilter('parameters') |
filter(parameters) |
|
fluxFirst() |
first() |
|
fluxLast() |
last() |
|
group('parameters') |
group(parameters) |
|
group() |
group() |
Merge all tables into a single table |
histogram('parameters') |
histogram(parameters) |
|
increase() |
increase() |
|
limit('parameters') |
limit(parameters) |
|
map('parameters') |
map(parameters) |
|
median() |
median() |
|
movingAverage('parameters') |
movingAverage(parameters) |
|
pivot('parameters') |
pivot(parameters) |
|
quantile('parameters') |
quantile(parameters) |
|
range('parameters') |
range(parameters) |
|
sort('parameters') |
sort(parameters) |
|
timedMovingAverage('parameters') |
timedMovingAverage(parameters) |
|
bucket('bucket_name') |
N/A |
Service used to initialize a query. Must be call on an object and with the name of the bucket on which the query will be executed. |
yield('field') |
Service used to execute the query. Returns a list of |