Skip to content

Commit

Permalink
Merge pull request #109 from rwth-acis/updateWiki
Browse files Browse the repository at this point in the history
update wiki
  • Loading branch information
beka-zhvania authored Mar 6, 2023
2 parents bfaf948 + ecb29cd commit 8219c9c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 74 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ docker compose up
```
This will build and run containers for WebOCD service and arangodb, which is required for the service to run properly.

You can adjust the database container default password by modifying docker-compose.yml. Keep in mind to also change the config files [config_test.properties](ocd/arangoDB/config_test.properties) and [standard_config.properties](ocd/arangoDB/standard_config.properties) so that WebOCD tests as well as the service can use the database.
You can adjust the database container default password by modifying docker-compose.yml. Keep in mind to also change the config file [config.properties](ocd/arangoDB/config.properties), so that WebOCD tests as well as the service can use the database.
9 changes: 5 additions & 4 deletions docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ The OCD Service is publicly accessible via this [link](http://webocd.dbis.rwth-a
Along with the service we provide a web client which also has its own [project](https://github.com/rwth-acis/OCD-Web-Client). The client can only be used with a valid Learning Layers account. We recommend to use the service along with the web client.


We additionally provide a brief [Integration Tutorial](/integration/) that shows you the usage of the most important requests so that you can get started with the OCD Service more quickly.
We additionally provide a brief [Integration Tutorial](/REST-OCD-Services/pages/wiki/integration/) that shows you the usage of the most important requests so that you can get started with the OCD Service more quickly. A more detailed usage examples of WebOCD Service, using the WebOCD webclient can be found here [link](/REST-OCD-Services/pages/tutorials/login).

## The OCD Service
The service is developed using the Eclipse IDE, so we recommend you to stick to that tool for any work on this project.
The service is developed using the IntelliJ IDEA, so we recommend you to stick to that tool for any work on this project.

Please refer to the following pages in order to obtain more information about the OCD Service.

Expand All @@ -41,9 +41,10 @@ Please refer to the following pages in order to obtain more information about th
+ [User Management and Authentication](/REST-OCD-Services/pages/wiki/user-management-and-authentication)
+ [Deploying the OCD Service](/REST-OCD-Services/pages/wiki/service-deployment)
+ [Database Configuration](/REST-OCD-Services/pages/wiki/database-configuration)
+ [Tutorials using WebOCD Service and Webclient](/REST-OCD-Services/pages/tutorials/login)

### Important
The OCD Service is largely based on the commercial **yFiles** library. You will only be able to run it yourself if you have access to the archive _y.jar_. The Chair i5 of RWTH Aachen University has a license for that library. If you are affiliated with that institute, please contact somebody to obtain the library. Also, keep in mind that the archive mentioned above must under no circumstances be publicly deployed or otherwise made publicly available. Please refer to [Deploying the OCD Service](/REST-OCD-Services/pages/wiki/service-deployment) for more information.
The WebOCD Service uses **ArangoDB** database, which has to be separately installed on the machine where the service runs. Alternatively, docker can be used to build the WebOCD Service together with the database. To build and run WebOCD Service with Docker, refer to [link](/REST-OCD-Services/pages/wiki/running#docker).

The service also currently requires **Java JDK 14** to be built and most likely also to run it. However, there also exists an older version for JDK 8 (tag [1.0.0](https://github.com/rwth-acis/REST-OCD-Services/tree/1.0.0)) which is still functional in case you need it.
The service also currently requires **Java JDK 17** to be built and most likely also to run it. However, there also exists an older version for JDK 8 (tag [1.0.0](https://github.com/rwth-acis/REST-OCD-Services/tree/1.0.0)) which is still functional in case you need it.

50 changes: 9 additions & 41 deletions docs/pages/wiki/build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,27 @@ title: Build Process
---

# Introduction
The OCD Service is built via Gradle. We recommend a version similar to 6.8, yet others may also work. The project has mostly been developed with the Eclipse IDE using the gradle buildship plugin (most eclipse IDEs already include this), yet IDEs like IntelliJ are actively used as well. Finally note that you will likely need Java version 14 for the build to work without problems.

There also exists an older version using Apache Ant which is described at the bottom. Here, there are two build files, _build.xml_, and _ocd_build.xml_. Please do only use the _ocd_build.xml_. Note that Eclipse might illustrate errors for the build file because apparently it is not able to resolve the external target dependencies to the second build file correctly. This should not cause an issue. It is highly recommended that you build the project with Eclipse (To use Java 8 for the older version you may have to go with the Eclipse IDE for Java EE Developers variant) as this is the environment used during development and therefore the best tested one.
The OCD Service is built via Gradle. We recommend a version similar to 7.3, yet newer versions may also work. The project has mostly been developed with the IntelliJ IDEA. You can import the project into IntelliJ as a Gradle project. Finally note that you will likely need Java version 17 for the build to work without problems.

# Executing the Build Process

## First Build
When you are going to run the build process the very first time, you will need two manually obtain two libraries:
+ _y.jar_ forms part of the commercial yFiles library by yWorks which is not publicly available. Therefore you will have to add it manually to the project. The Chair i5 of RWTH Aachen University has a license for the library, so please contact somebody to obtain access. This will obviously only be possible if you are somehow affiliated with the Chair.
+ _ysvg.jar_ is an SVG writer for yFiles Graph2D objects that makes it possible to add useful features to generated SVG diagrams. The library is used for the visualization of graphs and covers.
Both libraries then have to be placed into the _yFiles_ folder.

Now, you just have to import the project as a gradle project via eclipse or simply open in via IntelliJ. After the first build, eclipse might still give you errors saying the yFiles jars are missing. To fix this, simply refresh the gradle project via the option you get from right clicking the folder.
When you are going to run the build process the very first time, you just have to import the project as a gradle project IntelliJ and execute the gradle *build* task. Make sure to adapt the database configuration _ocd/arangoDB/config.properties_ to fit your running ArangoDB instance.

After the build, you can then either start the _start_network.bat_ or _start_network.sh_ files in the bin folder to get the service running, see [Running the OCD Service](/REST-OCD-Services/pages/wiki/running) for more information.

## General Build
There are numerous targets which can be run. This summarizes the most important ones:
There are numerous gradle tasks which can be executed. This summarizes the most important ones:
+ _jar_: Generates the service jar in the _service_ and a copy in the _rest\_ocd\_services/export/jars_ directory. This archive is required for running the service.
+ _test_: Runs all jUnit tests . The test reports are stored in _rest\_ocd\_services/export/test_reports_.
+ _yguard_: Generates an obfuscated service jar in the _rest\_ocd\_services/export/obfuscated_ directory. This is required for public service deployment. Please refer to [Deploying the OCD Service](/REST-OCD-Services/pages/wiki/service-deployment) for more information. A log file of the obfuscation process is stored under _ocd/yGuard/log.xml_.
+ _build_: The target you'll likely be running most of the time. This executes the build process and generates a jar as well as the executables.
+ _startscripts:_ Generates startscripts into the bin folder that are used to start the service.
+ _generateAgents_: Generates the user and service agents as specified in _build.gradle_. The users will be loaded when the service (or more precisely the underlying LAS2peer node) is launched.
+ _clean_: Clean up files generated from the build. This should be executed before rebuilding.

# Potential Issues

Currently, the build might fail if a version of Java not equal to 14 (or 8 for the older version of the service) is used, even with eclipse in compliance mode for that version, and running the service with a version other than this one is also likely to cause errors.

## Linux Users
The system was mainly tested on Windows so far. For Linux, there is still a small issue with the old Ant Build. In case you receive an exception that the database (_db_) could not be created, please do manually remove the directory _db_ from the _ocd_ directory before the build.


# Executing the Old Ant Build Process

## First Build
When you are going to run the build process the very first time, please make sure to run the target _get_deps_ in order to obtain all dependencies.

Due to the yFiles library being commercial, there are three dependencies which will be missing and must be added manually to the _lib_ folder:
+ _y.jar_ forms part of the commercial yFiles library by yWorks which is not publicly available. Therefore you will have to add it manually to the project. The Chair i5 of RWTH Aachen University has a license for the library, so please contact somebody to obtain access. This will obviously only be possible if you are somehow affiliated with the Chair.
+ _yguard.jar_ is a free obfuscation tool by yWorks which is only required for public deployment of the service. Anybody can download it from this [link](https://www.yworks.com/downloads#yGuard). Refer to [Deploying the OCD Service](/REST-OCD-Services/pages/wiki/service-deployment) for more information. You can probably do without it.
+ _ysvg.jar_ is an SVG writer for yFiles Graph2D objects that makes it possible to add useful features to generated SVG diagrams. The library is used for the visualization of graphs and covers.

## Linux Users
Please make sure that the program _ocd/lfr/LfrBenchmarkLinux_ is executable (via `chmod +x <filename>`).
# Potential Issues
Currently, the build might fail if a version of Java not equal to 17 is used.

## General Build
There are numerous targets which can be run. This summarizes the most important ones:
+ _jar_: Generates the service jar in the _service_ and a copy in the _export/jars_ directory. This archive is required for running the service.
+ _generate_configs_: Generates the user and service agents as specified in _etc/ant_configuration_. The users will be loaded when the service (or more precisely the underlying LAS2peer node) is launched.
+ _junit_: Runs all jUnit tests (except _src/test/i5/las2peer/services/ocd/DatabaseInitializer.java_, take look at the target _setup_database_ for more information). The test reports are stored in _export/test_reports_.
+ _startscripts:_ Generates startscripts into the bin folder that are used to start the service.
+ _obfuscate_: Generates an obfuscated service jar in the _export/obfuscated_ directory. This is required for public service deployment. Please refer to [Deploying the OCD Service](/REST-OCD-Services/pages/wiki/service-deployment) for more information. A log file of the obfuscation process is stored under _ocd/yGuard/log.xml_.
+ _setup_database_: This is intended for automatically populating the database for presentation or debugging purposes. It is not required in any way to actually make the database work. The database is set up by running _src/test/i5/las2peer/services/ocd/DatabaseInitializer.java_ as a jUnit test. You can adapt the code in any way that suits your needs.
+ _all_: Runs all of the above except _setup_database_.
Running WebOCD Service might cause *AgentAccessDeniedException* if the *build* task was performed multiple times without having performed the *clean* task inbetween. If this occurs, simply do the *clean* task followed by the *build* task and the issue should be solved.

## Building with IntelliJ
For IntelliJ, you can follow the above guide as well. For correct indexing in the IDE you however need to add the lib folder as a library via right click. You might also want to double check that build.xml isn't selected as an ant build file instead of ocd_build.xml
11 changes: 4 additions & 7 deletions docs/pages/wiki/database-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ layout: page
title: Database Configurations
---

# JPA and persistence.xml
The service makes use of the Java Persistence API (JPA) specification to simplify database access. The JPA implementation that is being used is EclipseLink. If you want to use the service with another database or change some aspects of the database configuration you must adapt the following files accordingly.
+ _rest\_ocd\_services/src/main/java/META-INF/persistence.xml_: This database configuration is used for the actual execution of the service through the service jar (e.g. when running _bin/start_network.bat_)
+ _rest\_ocd\_services/src/main/java/META-INF/testing/persistence.xml_: This database configuration is used during jUnit testing.
# ArangoDB
The service makes use of ArangoDB database. A database instance should be running before executing the build process. Otherwise, the database related tests will fail.
Database instance details that WebOCD Service uses can be configured by changing the _ocd/arangoDB/config.properties_ file.

The file locations are different in the old ant build:
+ _ocd/eclipselink/persistence.xml_ for the execution
+ _src/META-INF/persistence.xml_ for testing
If the database is not available on the machine where WebOCD Service should run, it is possible to use Docker, without installing/running the database first. For this refer to [Running the OCD Service](/REST-OCD-Services/pages/wiki/running#docker).
8 changes: 5 additions & 3 deletions docs/pages/wiki/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ title: Integration
---

# Introduction
This tutorial will give you a brief explanation about how to handle the OCD Service. It explains a few basic requests for e.g. uploading a graph, retrieving the saved graphs, creating a cover from a graph, ...
This tutorial will give you a brief explanation about how to handle the OCD Service. It explains a few basic requests for e.g. uploading a graph, retrieving the saved graphs, creating a cover from a graph etc.

However this is only a fraction of what the service actually allows. Other functionalities include for instance the execution of metrics to determine the quality of the calculated covers or the computation of benchmark graphs and covers for the generation of standardized testing data.
However, this is only a fraction of what the service actually allows. Other functionalities include for instance the execution of metrics to determine the quality of the calculated covers or the computation of benchmark graphs and covers for the generation of standardized testing data.
At the bottom, an overview of all possible requests is given. For a more detailed description of the requests you should refer to the OCD Service's source code.

All responses other than actual graph and cover data (which has the specified output format), as well as JSON visualization data are sent in XML format.

For more detailed information about using WebOCD Service, refer to the [tutorials](/REST-OCD-Services/pages/tutorials/login), which explains usage of WebOCD Service with the [WebClient](https://github.com/rwth-acis/OCD-Web-Client)

# Graphs

## List Available Graphs
Expand Down Expand Up @@ -115,7 +117,7 @@ After that, make a post request to run the algorithm with the following paramete
+ _name_: Email_Cover
+ _algorithm_: _SPEAKER_LISTENER_LABEL_PROPAGATION_ALGORITHM_
+ _body_: `<?xml version="1.0" encoding="UTF-16"?>`
`<Parameters><Parameter><Name>memorySize</Name><Value>100</Value></Parameter><Parameter><Name>probabilityThreshold</Name><Value>0.15</Value></Parameter></Parameters>`
`<Parameters><Parameter><Name>memorySize</Name><Value>100</Value></Parameter><Parameter><Name>probabilityThreshold</Name><Value>0.15</Value></Parameter></Parameters>`
+ _contentWeighting_: false
+ _componentNodeCountFilter_: 0

Expand Down
Loading

0 comments on commit 8219c9c

Please sign in to comment.