Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Introduction
# OSLC PROMCODE server

[![CI](https://github.com/oslc/promcode-lyo-server/actions/workflows/maven.yml/badge.svg)](https://github.com/oslc/promcode-lyo-server/actions/workflows/maven.yml)
[![Docker](https://github.com/oslc/promcode-lyo-server/actions/workflows/docker.yml/badge.svg)](https://github.com/oslc/promcode-lyo-server/actions/workflows/docker.yml)

This is a sample OSLC PROMCODE server, that is based on the [OASIS OSLC PROMCODE Specification 1.0](https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/os/promcode-spec.html#).

# Running the OSLC PROMCODE server
## Running the OSLC PROMCODE server

Follow the 3 sections below to:

Expand All @@ -14,13 +14,13 @@ Follow the 3 sections below to:
1. [Navigate the OSLC server](#navigate-to-oslc-server)
1. [Populate the OSLC server](#populate-the-oslc-server)

## Setup persistent store
### Setup persistent store

You will set up an RDF data store to store the OSLC PROMCODE resources.

We will utilize the Apache Jena Fuseki that is an open source RDF server. You can select either Docker Compose, Docker version, or Java version.

### Docker Compose (Recommended)
#### Docker Compose (Recommended)
The easiest way to run both the PROMCODE server and Fuseki together:

1. Make sure you have Docker and Docker Compose installed
Expand All @@ -42,7 +42,7 @@ To view logs:
docker-compose logs -f
```

### Pre-built Docker Images
#### Pre-built Docker Images

Pre-built Docker images are available from GitHub Container Registry for both x86_64 (amd64) and ARM64 architectures:

Expand All @@ -56,26 +56,29 @@ docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:0.1.0

> **Note:** Images are automatically rebuilt weekly to ensure the latest security updates from base images.

### Docker version
#### Docker version

1. Download docker version of fuseki server from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-docker/4.2.0/
2. `docker-compose build --build-arg JENA_VERSION=3.16.0`
3. `docker-compose run --rm --service-ports fuseki --update --mem /dataset`
### Java version

#### Java version

1. Download jar file from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/
2. For the latest Java version, run the following command
- `java -cp jena-fuseki-server-4.2.0.jar org.apache.jena.fuseki.main.cmds.FusekiMainCmd --update --mem /dataset`
3. For Java 1.8 , run the following command
- `java -cp jena-fuseki-server-3.16.0.jar org.apache.jena.fuseki.main.cmds.FusekiMainCmd --update --mem /dataset`


## Run the OSLC Server
### Run the OSLC Server
There are multiple options to run the OSLC Server.
Below are the simplest options if you don't want to use anything except JDK and a Maven installation. Prerequisites:

- JDK 11
- Maven 3

### Using built-in servers directly
#### Using built-in servers directly

Follow these steps to start the server:

Expand All @@ -86,7 +89,7 @@ mvn clean jetty:run-war

Now proceed to the steps listed in the next section _Navigating OSLC servers_.

### Running on Tomcat via Maven
#### Running on Tomcat via Maven

Follow these steps to start the server:

Expand All @@ -95,7 +98,7 @@ cd promcode-lyo-server
mvn clean cargo:run
```

### Using Docker Compose
#### Using Docker Compose

If you prefer to use Docker, you can run both the PROMCODE server and Fuseki using Docker Compose:

Expand All @@ -110,15 +113,15 @@ This will:
- Create a Docker network for service communication
- Persist Fuseki data in a Docker volume

## Navigate to OSLC server
### Navigate to OSLC server

The OSLC server is available at the following URL:

- http://localhost:8080/promcode-server/

From that point, you can navigate through the Service Provider Catalog, or using the built-in Swagger Editor.

## Populate the OSLC server
### Populate the OSLC server

THe server contains no data at startup.
You can add resources to the server by performing resource operations on their creation factories.
Expand Down Expand Up @@ -157,7 +160,7 @@ http://localhost:8080/oslc/service1/artifacts/create
```


# Modifying the OSLC PROMCODE server with Lyo Designer
## Modifying the OSLC PROMCODE server with Lyo Designer

This server is modelled and generated using [Lyo Designer](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/lyo-designer.html).

Expand All @@ -167,11 +170,11 @@ It is recommended you get familiar with the LyoDesigner tool before you perform

To open the relevant projects for the OSLC PROMCODE server, you need to follow the steps below.

## Install Lyo Designer
### Install Lyo Designer

The first step is to [install Lyo Designer](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/install-lyo-designer).

## Import the PROMCODE domain model
### Import the PROMCODE domain model

The PROMCODE domain model is already modelled and made available to be used by any PROMCODE server installation.

Expand All @@ -180,17 +183,17 @@ The PROMCODE domain model is already modelled and made available to be used by a

This project contains the PROMCODE model, and all other OSLC Domain Specifications.

## Import the PROMCODE OSLC Server model
### Import the PROMCODE OSLC Server model
In LyoDesigner, import the Modelling project under the "promcode-lyo-server-model" folder.

This model depends on the PROMCODE domain model, imported in the previous step. It is important the domain model is imported first.

This models a simple PROMCODE server, which can be used as a basis for your own extensions and modifications.

## Import the PROMCODE OSLC Server
### Import the PROMCODE OSLC Server
1. In LyoDesigner, import the Maven project under the "promcode-lyo-server" folder.

This maven project is generated from the server model imported above.

# References
## References
- [OASIS OSLC PROMCODE Specification 1.0](https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/os/promcode-spec.html#)
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
// End of user code

/**
* Generated by Lyo Designer 7.0.0.202608291004
* Generated by Lyo Designer 7.0.0.202608291004+dev
*/

@OpenAPIDefinition(info = @Info(title = "PROMCODE Server", version = "1.0.0"), servers = @Server(url = "/promcode-server/oslc/"))
Expand Down

This file was deleted.

Loading