Skip to main content
Jump to: navigation, search

Difference between revisions of "BaSyx / Download / Components Setup"

m (Changes db entries to fit test cases)
m (Adds a remark that the components project depends on basyx.sdk)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  
= How to run the BaSyx Components=
+
=How to install BaSyx Components=
The Components package requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
+
The Components package depends on [[BaSyx_/_Download_/_Java_Setup#Starting_development | basyx.sdk]] and additionally requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
  
Choose the following credentials:
+
During installation of the SQL backend, choose the following credentials:
  
 
'''user''': postgres
 
'''user''': postgres
Line 9: Line 9:
 
'''password''': admin
 
'''password''': admin
  
 +
Note: In order to change these default connection settings for the postgreSQL database, the connection data has to be updated in the properties files for the SQL tests
 +
in the components project.
  
To setup the database for the test cases use the following commands:
+
To setup the database for the test cases, open up a console and use the following commands:
  
 
{| class="wikitable" style="text-align: left;"
 
{| class="wikitable" style="text-align: left;"
Line 18: Line 20:
 
Create configuration directory:
 
Create configuration directory:
  
initdb -D "*PATH*" -U *USER*
+
initdb -D "<db-path>" -U <username>
  
default user: postgres
+
Where <db-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with
  
Start database:
+
pg_ctl -D "<db-path>" start
  
pg_ctl -D "*PATH*" start
+
|-
 +
|}
  
Connect command line to running instance:
+
Save the following commands to an arbitrary text file. Next, import the database through psql -U postgres -f "<your-file>".
 
+
psql -U *USER*
+
 
+
Create and fill database:
+
  
 +
{| class="wikitable" style="text-align: left;"
 +
|-
 +
|
 
CREATE DATABASE "basyx-map";
 
CREATE DATABASE "basyx-map";
 
\c basyx-map
 
 
CREATE SCHEMA elements;
 
  
 
CREATE DATABASE "basyx-directory";
 
CREATE DATABASE "basyx-directory";
 
\c basyx-directory
 
 
CREATE SCHEMA directory;
 
 
CREATE TABLE directory.directory ( "ElementRef" varchar(999999), "ElementID" varchar(999999) primary key );
 
 
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES (
 
'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-19', '{content.aas1}' );
 
 
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES (
 
'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-18', '{content.aas2}' );
 
 
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-17', 'content.aas3' );
 
 
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-16', 'content.aas4' );
 
 
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-15', 'content.aas5' );
 
  
 
|-
 
|-
 
|}
 
|}
 +
 +
Finally, you can install the basyx.components project using maven. See the instructions for the [[BaSyx_/_Download_/_Java_Setup#Starting_development | Java SDK]] on how to do that.

Latest revision as of 11:10, 10 March 2020

How to install BaSyx Components

The Components package depends on basyx.sdk and additionally requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by postgreSQL.

During installation of the SQL backend, choose the following credentials:

user: postgres

password: admin

Note: In order to change these default connection settings for the postgreSQL database, the connection data has to be updated in the properties files for the SQL tests in the components project.

To setup the database for the test cases, open up a console and use the following commands:

Create configuration directory:

initdb -D "<db-path>" -U <username>

Where <db-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with

pg_ctl -D "<db-path>" start

Save the following commands to an arbitrary text file. Next, import the database through psql -U postgres -f "<your-file>".

CREATE DATABASE "basyx-map";

CREATE DATABASE "basyx-directory";

Finally, you can install the basyx.components project using maven. See the instructions for the Java SDK on how to do that.

Back to the top