Skip to content

Commit

Permalink
Add maven central links
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Turrell-Croft committed Jul 13, 2023
1 parent 60ed567 commit 870786a
Showing 1 changed file with 44 additions and 40 deletions.
84 changes: 44 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

xAPI Java helps you to create applications that send or receive xAPI [Statements](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#statements) or [Documents](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#10-documents).

There are two projects in this [Monorepo](https://en.wikipedia.org/wiki/Monorepo), xAPI Client and xAPI Model.
There are two projects in this [Monorepo](https://en.wikipedia.org/wiki/Monorepo), xAPI Client and xAPI Model.

Both the xAPI Client and xAPI Model use a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface). Objects are [immutable](https://en.wikipedia.org/wiki/Immutable_object).
Both the xAPI Client and xAPI Model use a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface). Objects are [immutable](https://en.wikipedia.org/wiki/Immutable_object).

[CheckStyle](https://checkstyle.sourceforge.io) is used to enforce the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Sonar performs automatic pull request reviews. [CodeQL](https://codeql.github.com) scans for vulnerabilities. The number of bugs, code smells and vulnerabilities in the codebase can be viewed in SonarCloud. The code coverage and code duplication percentages can also be viewed in SonarCloud. Over three-hundred unit tests ensure conformance with the xAPI specification.

Expand Down Expand Up @@ -36,16 +36,18 @@ To use the xAPI Java Client include the appropriate XML in the `dependencies` se
</project>
```

xAPI Java Client is available in the [Maven Central Repository](https://central.sonatype.com/artifact/dev.learning.xapi/xapi-client/).

### Configuration

The xAPI Java Client has a Spring AutoConfiguration bean which picks up the following properties:

| Property | Description |
| ----------------------------- | ------------------------------------------------------------------ |
| xapi.client.baseUrl | The base url of the LRS endpoint |
| xapi.client.username | Username for basic authorization header |
| xapi.client.password | Password for basic authorization header |
| xapi.client.authorization | Authorization header (has precedence over the username and password properties) |
| Property | Description |
| ------------------------- | ------------------------------------------------------------------------------- |
| xapi.client.baseUrl | The base url of the LRS endpoint |
| xapi.client.username | Username for basic authorization header |
| xapi.client.password | Password for basic authorization header |
| xapi.client.authorization | Authorization header (has precedence over the username and password properties) |

Properties can be set using any [external configuration](https://docs.spring.io/spring-boot/docs/3.0.6/reference/htmlsingle/#features.external-config.files) method supported by Spring Boot.

Expand All @@ -55,7 +57,7 @@ If you need more specific customization (eg. your LRS needs specific headers, or

The xAPI Java Client uses the Spring WebClient. Spring WebClient has default memory limit of 256KB for buffering data. If this limit is exceeded then a DataBufferLimitException will be thrown.

The default memory limit of 256KB for buffering data could be exceeded if the LRS returns a large number of Statements or if the Statements contain attachments.
The default memory limit of 256KB for buffering data could be exceeded if the LRS returns a large number of Statements or if the Statements contain attachments.

It is possible to set the memory limit for buffering data with the `spring.codec.max-in-memory-size` property.

Expand All @@ -75,7 +77,7 @@ Example:

```java
var response = client.getStatement(r -> r.id("4df42866-40e7-45b6-bf7c-8d5fccbdccd6")).block();

Statement statement = response.getBody();
```

Expand All @@ -85,7 +87,7 @@ Example:

```java
var response = client.getStatement(r -> r.id("4df42866-40e7-45b6-bf7c-8d5fccbdccd6").attachments(true).block();

Statement statement = response.getBody();
```

Expand Down Expand Up @@ -177,8 +179,8 @@ client.postStatement(

.activityObject(o -> o.id("https://example.com/activity/simplestatement")
.definition(d -> d.addName(Locale.ENGLISH, "Simple Statement"))),
keyPair.getPrivate()))

keyPair.getPrivate()))
.block();
```

Expand Down Expand Up @@ -284,7 +286,7 @@ client.deleteState(r -> r.activityId("https://example.com/activity/1")

### Samples

The samples folder in this repository contains [sample applications](samples) that use the xAPI client.
The samples folder in this repository contains [sample applications](samples) that use the xAPI client.

## xAPI Model Spring Boot Starter

Expand All @@ -306,37 +308,37 @@ To use the xAPI Model Spring Boot Starter include the appropriate XML in the `de
</dependency>
```

### Configuration
xAPI Model Spring Boot Starter is available in the [Maven Central Repository](https://central.sonatype.com/artifact/dev.learning.xapi/xapi-model-spring-boot-starter/).

The xAPI Model Spring Boot Starter has a Spring AutoConfiguration bean which picks up the following properties:

| Property | Description |
| ----------------------------------------- | -------------------------------------------------------------------------- |
| xapi.model.validateJson | Fail on trailing JSON tokens |
| xapi.model.validateProperties | Fail on unknown JSON properties |
| xapi.model.validateNullValues | Fail on null JSON properties |
| xapi.model.validateLiterals | Fail on number and boolean JSON properties defined as string |
| xapi.model.validateObjectType | Fail on invalid JSON objectType property |
| xapi.model.validateLocale | Fail on invalid Locale strings |
| xapi.model.validateTimestamp | Fail on negative zero timezone offsets |
| xapi.model.validateActivityDefinition | Fail on invalid xAPI ActivityDefinition (missing properties) |
| xapi.model.validateActor | Fail on invalid xAPI Actor (missing or multiple identifiers) |
| xapi.model.validateAuthority | Fail on invalid xAPI Authority object |
| xapi.model.validateUriScheme | Fail on invalid xAPI URI property (missing scheme) |
| xapi.model.validateMbox | Fail on invalid xAPI mbox property (invalid email or missing prefix) |
| xapi.model.validateLocaleNotUndetermined | Fail on invalid xAPI locale property (locale is undetermined) |
| xapi.model.validateScaledScore | Fail on invalid xAPI scaledScore property (out of -1 - 1 range) |
| xapi.model.validateScore | Fail on invalid xAPI Score (raw score is out of min/max range) |
| xapi.model.validateStatementPlatform | Fail on invalid xAPI context.platform (if present object must be Activity) |
| xapi.model.validateStatementRevision | Fail on invalid xAPI context.revision (if present object must be Activity) |
| xapi.model.validateStatementListIds | Fail on invalid xAPI statement List (conflicting statement ids) |
| xapi.model.validateStatementVerb | Fail on invalid xAPI voided statement (object must be StatemnetReference) |
| xapi.model.validateUuidVariant | Fail on invalid xAPI UUID property (must be UUID variant 4) |
### Configuration

The xAPI Model Spring Boot Starter has a Spring AutoConfiguration bean which picks up the following properties:

| Property | Description |
| ---------------------------------------- | -------------------------------------------------------------------------- |
| xapi.model.validateJson | Fail on trailing JSON tokens |
| xapi.model.validateProperties | Fail on unknown JSON properties |
| xapi.model.validateNullValues | Fail on null JSON properties |
| xapi.model.validateLiterals | Fail on number and boolean JSON properties defined as string |
| xapi.model.validateObjectType | Fail on invalid JSON objectType property |
| xapi.model.validateLocale | Fail on invalid Locale strings |
| xapi.model.validateTimestamp | Fail on negative zero timezone offsets |
| xapi.model.validateActivityDefinition | Fail on invalid xAPI ActivityDefinition (missing properties) |
| xapi.model.validateActor | Fail on invalid xAPI Actor (missing or multiple identifiers) |
| xapi.model.validateAuthority | Fail on invalid xAPI Authority object |
| xapi.model.validateUriScheme | Fail on invalid xAPI URI property (missing scheme) |
| xapi.model.validateMbox | Fail on invalid xAPI mbox property (invalid email or missing prefix) |
| xapi.model.validateLocaleNotUndetermined | Fail on invalid xAPI locale property (locale is undetermined) |
| xapi.model.validateScaledScore | Fail on invalid xAPI scaledScore property (out of -1 - 1 range) |
| xapi.model.validateScore | Fail on invalid xAPI Score (raw score is out of min/max range) |
| xapi.model.validateStatementPlatform | Fail on invalid xAPI context.platform (if present object must be Activity) |
| xapi.model.validateStatementRevision | Fail on invalid xAPI context.revision (if present object must be Activity) |
| xapi.model.validateStatementListIds | Fail on invalid xAPI statement List (conflicting statement ids) |
| xapi.model.validateStatementVerb | Fail on invalid xAPI voided statement (object must be StatemnetReference) |
| xapi.model.validateUuidVariant | Fail on invalid xAPI UUID property (must be UUID variant 4) |

The default value is **TRUE** for all of the above properties.


## xAPI Java Model

The xAPI model can be used by clients that send xAPI data or by servers that receive xAPI data.
Expand All @@ -361,6 +363,8 @@ To use the xAPI Model include the appropriate XML in the `dependencies` section
</project>
```

xAPI Model is available in the [Maven Central Repository](https://central.sonatype.com/artifact/dev.learning.xapi/xapi-model/).

### Creating a statement

Example:
Expand Down

0 comments on commit 870786a

Please sign in to comment.