diff --git a/README.md b/README.md index 3947a25..8638621 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 @@ -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: @@ -56,11 +56,14 @@ 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` @@ -68,14 +71,14 @@ docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:0.1.0 - `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: @@ -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: @@ -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: @@ -110,7 +113,7 @@ 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: @@ -118,7 +121,7 @@ The OSLC server is available at the following URL: 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. @@ -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). @@ -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. @@ -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#) diff --git a/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/Application.java b/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/Application.java index 51d1a1d..d48c233 100644 --- a/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/Application.java +++ b/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/Application.java @@ -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/")) diff --git a/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/LyoGeneratedAppConfig.java b/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/LyoGeneratedAppConfig.java deleted file mode 100644 index b8ffb5f..0000000 --- a/promcode-lyo-server/src/main/java/org/oasis/oslc/promcode/server/servlet/LyoGeneratedAppConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -// Start of user code Copyright -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Distribution License 1.0 which is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * SPDX-License-Identifier: BSD-3-Simple - * - * This file is generated by Lyo Designer (https://www.eclipse.org/lyo/) - */ -// End of user code - -package org.oasis.oslc.promcode.server.servlet; - -import java.util.Set; - -public record LyoGeneratedAppConfig(String baseUrl, String servletPath, Set corsFriends) { -}