Skip to content

Commit defbb4a

Browse files
committed
docs: fix typos and styling for the Lyo project setup 101
Signed-off-by: Andrew Berezovskyi <andrew@berezovskyi.me>
1 parent a399cd3 commit defbb4a

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

docs-new/eclipse_lyo/setup-an-oslc-provider-consumer-application.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ equally valid for any other development environment.
77

88
## An alternative to the manual steps below
99

10-
An alternative to the instructions on this page is to instead use [Lyo Designer](./lyo-designer.md) to quickly generate the project, including a very basic code skeleton. The generated project will also include the neccessary setup for OpenApi/Swagger support, TRS, etc.
10+
An alternative to the instructions on this page is to instead use [Lyo Designer](./lyo-designer.md) to quickly generate the project, including a very basic code skeleton. The generated project will also include the necessary setup for OpenApi/Swagger support, TRS, etc.
1111

12-
1. Make sure your environment is setup for Lyo development as instructed on [Eclipse Setup for Lyo-based Development](./eclipse-setup-for-lyo-based-development.md)
13-
1. install [Lyo Designer](./install-lyo-designer.md)
12+
1. Make sure your environment is set up for Lyo development as instructed on [Eclipse Setup for Lyo-based Development](./eclipse-setup-for-lyo-based-development.md)
13+
1. Install [Lyo Designer](./install-lyo-designer.md)
1414
1. Follow the [Create a Modelling Project](./toolchain-modelling-workshop.md#create-modelling-project) instructions (*Only this particular section*) to create the Eclipse project.
1515
1. Follow the [Adapter Interface](./toolchain-modelling-workshop.md#adaptor-interface-view) instructions (*Only this particular section*) to create a single Adaptor Interface in the model. You do not need to create any additional elements, such as a Service Provider Catalog, Service Provider, etc. Just make sure you set the generation settings as expected.
1616
1. Follow the [Generate Lyo Java code](./toolchain-modelling-workshop.md#generate-oslc4j-java-code) instructions (*Only this particular section*) to generate your basic project setup.
@@ -34,7 +34,7 @@ As a complement when following the instructions below, you can find sample proje
3434

3535
Creating the project consists of these steps:
3636

37-
1. [Setup Eclipse](#set-up-eclipse)
37+
1. [Set up Eclipse](#set-up-eclipse)
3838
1. [Decide if you want to adopt JAX-RS 1.0 or 2.0?](#decide-jaxrs)
3939
1. [Create a Maven project](#create-maven-project)
4040
1. [Customise the project POM file](#customize-project-pom-file)
@@ -45,14 +45,14 @@ Creating the project consists of these steps:
4545

4646
## Set up Eclipse
4747

48-
Make sure your environment is setup for Lyo development as instructed on [Eclipse Setup for Lyo-based Development](./eclipse-setup-for-lyo-based-development.md)
48+
Make sure your environment is set up for Lyo development as instructed on [Eclipse Setup for Lyo-based Development](./eclipse-setup-for-lyo-based-development.md)
4949

5050
## Create a Maven project
5151

52-
To create a Maven project from an archetype via Eclipse
52+
To create a Maven project from an archetype via Eclipse:
5353

54-
1. select *File -> New -> Other*
55-
1. then select *Maven Project* under *Maven* group.
54+
1. Select *File -> New -> Other*
55+
1. Then select *Maven Project* under *Maven* group.
5656
1. Leave the *Create a simple project* checkbox unchecked.
5757
1. Uncheck the *Use default Workspace location* option and point it to the project root
5858
1. Press *Next*
@@ -63,7 +63,7 @@ Next, select the `maven-archetype-webapp` archetype:
6363

6464
![](./images/CreateMavenAdaptorProject_Step2.png)
6565

66-
Next, Fill in the **Group Id**, **Artefact Id**, and the **Package Base**.
66+
Next, fill in the **Group Id**, **Artefact Id**, and the **Package Base**.
6767

6868
* The **Package Base** value (`com.sample.adaptor` on this page) will be used as a base package for your server code.
6969

@@ -77,7 +77,7 @@ You should now have the project in Eclipse and the following folder structure:
7777

7878
We now need to modify the project *pom.xml* file.
7979

80-
### Setup general POM properties
80+
### Set up general POM properties
8181

8282
We will also use properties to define a common version for Lyo packages:
8383

@@ -93,7 +93,7 @@ We will also use properties to define a common version for Lyo packages:
9393

9494
### (Optional) Add Lyo repositories
9595

96-
Lyo release artifacts are on Maven central since 4.0.0 - no action needed from your side.
96+
Lyo release artefacts are on Maven central since 4.0.0 - no action needed from your side.
9797

9898
If you wish to use the latest development snapshots, you will need the following entry:
9999

@@ -151,7 +151,7 @@ Lyo depends on JAX-RS APIs and your application needs to add implementations of
151151

152152
#### For Lyo 5.x
153153

154-
For Lyo release 5.0.0 and above, you will need to choose a JAX-RS 2.0 implementation. If you are using Jersey, you should use version 2.35. *Note that starting with Jersey 2.26, HK2 is not bundled with the core artifacts (see the [Jersey migration guide](https://eclipse-ee4j.github.io/jersey.github.io/documentation/2.35/user-guide.html#mig-2.26)).*
154+
For Lyo release 5.0.0 and above, you will need to choose a JAX-RS 2.0 implementation. If you are using Jersey, you should use version 2.35. *Note that starting with Jersey 2.26, HK2 is not bundled with the core artefacts (see the [Jersey migration guide](https://eclipse-ee4j.github.io/jersey.github.io/documentation/2.35/user-guide.html#mig-2.26)).*
155155
```xml
156156
<dependency>
157157
<groupId>org.glassfish.jersey.core</groupId>
@@ -215,7 +215,7 @@ If your server needs to support OAuth, include the following:
215215
</dependency>
216216
```
217217

218-
To support OAuth, you will need to add the following JAX-RS Providers to your Application (the `javax.ws.rs.core.Application` subclass)
218+
To support OAuth, you will need to add the following JAX-RS Providers to your Application (the `javax.ws.rs.core.Application` subclass):
219219
```java
220220
RESOURCE_CLASSES.add(Class.forName("org.eclipse.lyo.server.oauth.webapp.services.ConsumersService"));
221221
RESOURCE_CLASSES.add(Class.forName("org.eclipse.lyo.server.oauth.webapp.services.OAuthService"));
@@ -316,7 +316,7 @@ Modify the parameters in `/src/main/webapp/WEB-INF/web.xml` according to the tem
316316

317317
With OSLC being based on REST, an OSLC Server can relatively easily be documented using [OpenApi/Swagger](https://swagger.io/).
318318

319-
The instructions below are based on [Swagger Core JAX RS Project Setup 1.5.X](https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X), compiled for a typical Lyo project. The instructions are also partially base on
319+
The instructions below are based on [Swagger Core JAX RS Project Setup 1.5.X](https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X), compiled for a typical Lyo project. The instructions are also partially based on
320320
[Co-hosting Swagger UI with your Jersey REST API using Maven dependencies](https://medium.com/shark-bytes/co-hosting-swagger-ui-with-your-jersey-rest-api-using-maven-dependencies-44d88ae85bf8). The instructions provide the minimal settings necessary for a Lyo project.
321321

322322
### Add OpenApi/Swagger Maven dependencies
@@ -449,7 +449,7 @@ The OpenApi documentation can be achieved with as little as adding `@Api` to eac
449449
450450
#### `@Api`
451451
452-
1. For each REST service (ie. OSLC Service), simply add the `@Api` annotation.
452+
1. For each REST service (i.e. OSLC Service), simply add the `@Api` annotation.
453453
1. (*OPTIONAL*) add the *value* and *description* details. The *value* is used to group the REST methods into common categories, helping in the structuring of the methods in the documentation. You can give it the same value as that of the @Path annotation, collecting all REST methods for the same service together.
454454
455455
```java
@@ -466,7 +466,7 @@ For each REST method, add the `@ApiOperation` Swagger annotation.
466466
In [OpenApi](https://swagger.io/docs/specification/paths-and-operations/), an operation is considered unique based on the combination of its path and HTTP method. This means you cannot define multiple C.R.U.D. methods for the same path and method—even if they differ by parameters such as `Accept` or `Content-Type`.
467467
468468
!!! example
469-
If your OSLC Service defines separate Java methods to handle HTML and RDF/XML content types for the same path and HTTP method, OpenApi will only recognize one of these methods and ignore the other.
469+
If your OSLC Service defines separate Java methods to handle HTML and RDF/XML content types for the same path and HTTP method, OpenApi will only recognise one of these methods and ignore the other.
470470
471471
**Workaround:** Annotate ALL methods that are identified as unique with the complete list of media types in the *produces* property of the `@ApiOperation` annotation. This way, the generated documentation correctly indicates the existence of all methods.
472472
@@ -484,7 +484,7 @@ For each REST method, add the `@ApiOperation` Swagger annotation.
484484
For each Java class that models an OSLC-resource (`@OslcName` annotation), add an `@ApiModel` annotation that refers to the Shape of the resource, since a Shape is a more accurate description of the object, than the one automatically generated by Swagger.
485485
486486
```java
487-
@ApiModel(description = "The model below is only a object structure as derived by swagger. For a more accurate RDF Description, refer to the Requirement Resource Shape.")
487+
@ApiModel(description = "The model below is only an object structure as derived by swagger. For a more accurate RDF Description, refer to the Requirement Resource Shape.")
488488
@OslcNamespace(Oslc_rmDomainConstants.REQUIREMENT_NAMESPACE)
489489
@OslcName(Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME)
490490
@OslcResourceShape(title = "Requirement Resource Shape", describes = Oslc_rmDomainConstants.REQUIREMENT_TYPE)
@@ -525,9 +525,9 @@ Add a dependency for the TRS Server library:
525525
</dependency>
526526
527527
528-
### Setup the TRS JAX-RS Provider to your Application
528+
### Set up the TRS JAX-RS Provider to your Application
529529
530-
The *TRS Server* library already contains a `TrackedResourceSetService` class that can handle the REST calls for TRS Base and ChangeLog. For this service to work, you will only need to provide a binding to a singleton of a class that implements the `PagedTrs` class.
530+
The *TRS Server* library already contains a `TrackedResourceSetService` class that can handle the REST calls for TRS Base and ChangeLog. For this service to work, you will only need to provide a binding to a singleton of a class that implements the `PagedTrs` class.
531531
532532
Register the TRS JAX-RS Provider `TrackedResourceSetService` in your Application (the `javax.ws.rs.core.Application` subclass).
533533
@@ -545,7 +545,7 @@ public class Application extends javax.ws.rs.core.Application {
545545
...
546546
```
547547
548-
Provide the necessary binding definition for the `PagedTrs` class.
548+
Provide the necessary binding definition for the `PagedTrs` class.
549549
550550
```java
551551
import java.util.Collections;
@@ -566,8 +566,8 @@ public class Application extends javax.ws.rs.core.Application {
566566
}
567567
```
568568
569-
Define the `InmemPagedTrsSingleton` singleton class. You will need to complete the code example below, with
570-
* the code that populates `uris` with the intial set of resources to be managed by `InmemPagedTrs`.
569+
Define the `InmemPagedTrsSingleton` singleton class. You will need to complete the code example below, with:
570+
* the code that populates `uris` with the initial set of resources to be managed by `InmemPagedTrs`;
571571
* the desired `basePageLimit` and `changelogPageLimit` parameters.
572572
573573
```java
@@ -606,7 +606,7 @@ public class InmemPagedTrsSingleton implements Factory<PagedTrs> {
606606
607607
ArrayList<URI> uris = new ArrayList<URI>();
608608
609-
//TODO: populate uris with the intial set of resources to be managed by the InmemPagedTrs instance
609+
//TODO: populate uris with the initial set of resources to be managed by the InmemPagedTrs instance
610610
....
611611
// not thread-safe
612612
inmemPagedTrs = new InmemPagedTrs(<basePageLimit>, <changelogPageLimit>,

0 commit comments

Comments
 (0)