Skip to content

Commit 28b6260

Browse files
Migrate documentation to Antora.
Closes: #526
1 parent 3e22ff0 commit 28b6260

27 files changed

+246
-110
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ target/
88
*.ipr
99
*.iws
1010
/.idea/
11+
node_modules
12+
node
13+
package.json
14+
package-lock.json

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ Building the documentation builds also the project without running tests.
139139

140140
[source,bash]
141141
----
142-
$ ./mvnw clean install -Pdistribute
142+
$ ./mvnw clean install -Pantora
143143
----
144144

145-
The generated documentation is available from `target/site/reference/html/index.html`.
145+
The generated documentation is available from `target/antora/site/data-keyvalue/index.html`.
146146

147147
== Examples
148148

pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,35 @@
8282
</plugins>
8383
</build>
8484

85+
<profiles>
86+
<profile>
87+
<!-- placeholder for no profile -->
88+
<id>none</id>
89+
</profile>
90+
<profile>
91+
<id>antora-process-resources</id>
92+
<build>
93+
<resources>
94+
<resource>
95+
<directory>src/main/antora/resources/antora-resources</directory>
96+
<filtering>true</filtering>
97+
</resource>
98+
</resources>
99+
</build>
100+
</profile>
101+
<profile>
102+
<id>antora</id>
103+
<build>
104+
<plugins>
105+
<plugin>
106+
<groupId>io.spring.maven.antora</groupId>
107+
<artifactId>antora-maven-plugin</artifactId>
108+
</plugin>
109+
</plugins>
110+
</build>
111+
</profile>
112+
</profiles>
113+
85114
<repositories>
86115
<repository>
87116
<id>spring-snapshot</id>

src/main/antora/antora-playbook.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PACKAGES [email protected] @antora/atlas-extension:1.0.0-alpha.1 @antora/[email protected] @springio/[email protected] @asciidoctor/[email protected] @opendevise/[email protected]
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
- require: '@springio/antora-extensions/root-component-extension'
8+
root_component_name: 'data-redis'
9+
site:
10+
title: Spring Data KeyValue
11+
url: https://docs.spring.io/spring-data-keyvalue/reference/
12+
content:
13+
sources:
14+
- url: ./../../..
15+
branches: HEAD
16+
start_path: src/main/antora
17+
worktrees: true
18+
- url: https://github.com/spring-projects/spring-data-commons
19+
# Refname matching:
20+
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
21+
branches: [ main, 3.2.x ]
22+
start_path: src/main/antora
23+
asciidoc:
24+
attributes:
25+
page-pagination: ''
26+
hide-uri-scheme: '@'
27+
tabs-sync-option: '@'
28+
chomp: 'all'
29+
extensions:
30+
- '@asciidoctor/tabs'
31+
- '@springio/asciidoctor-extensions'
32+
sourcemap: true
33+
urls:
34+
latest_version_segment: ''
35+
runtime:
36+
log:
37+
failure_level: warn
38+
format: pretty
39+
ui:
40+
bundle:
41+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
42+
snapshot: true

src/main/antora/antora.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: data-keyvalue
2+
version: true
3+
title: Spring Data KeyValue
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
- run:
9+
command: ./mvnw validate process-resources -Pantora-process-resources
10+
local: true
11+
scan:
12+
dir: target/classes/

src/main/antora/modules/ROOT/nav.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* xref:index.adoc[]
2+
* xref:keyvalue.adoc[]
3+
** xref:keyvalue/template.adoc[]
4+
5+
* xref:repositories.adoc[]
6+
** xref:repositories/core-concepts.adoc[]
7+
** xref:repositories/definition.adoc[]
8+
** xref:repositories/create-instances.adoc[]
9+
** xref:keyvalue/repository/map-repositories.adoc[]
10+
** xref:repositories/query-keywords-reference.adoc[]
11+
** xref:repositories/query-return-types-reference.adoc[]
12+
13+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include::{commons}@data-commons::page$upgrade.adoc[]
2+
3+
Once you’ve decided to upgrade your application, you can find detailed information regarding specific features in the rest of the document.
4+
5+
Spring Data's documentation is specific to that version, so any information that you find in here will contain the most up-to-date changes that are in that version.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[[spring-data-key-value-reference-guide]]
2+
= Spring Data Key-Value
3+
:revnumber: {version}
4+
:revdate: {localdate}
5+
:feature-scroll: true
6+
7+
Spring Data KeyValue provides connectivity and repository support for the in memory map structures.
8+
It eases development of applications with a consistent programming model that need to access key based storage and servers as foundation for custom adapters._
9+
10+
[horizontal]
11+
xref:keyvalue.adoc[Key/Value Storage] :: Support for built in key-value structures
12+
xref:repositories.adoc[Repositories] :: KeyValue Repositories
13+
https://github.com/spring-projects/spring-data-commons/wiki[Wiki] :: What's New, Upgrade Notes, Supported Versions, additional cross-version information.
14+
15+
Oliver Gierke; Thomas Darimont; Christoph Strobl; Jay Bryant; Mark Paluch
16+
17+
(C) 2008-{copyright-year} VMware, Inc.
18+
19+
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[[key-value]]
2+
= KeyValue
3+
4+
Spring Data KeyValue provides easy configuration and access to `Map` like structures that associate values with unique keys.
5+
It offers both low-level and high-level abstractions for interacting with the underlying data structure, freeing the user from infrastructural concerns.
6+
7+
The key-value abstraction within Spring Data Key Value requires an `Adapter` that shields the native store implementation, freeing up `KeyValueTemplate` to work on top of any key-value pair-like structure.
8+
Keys are distributed across <<key-value.keyspaces,Keyspaces>>.
9+
Unless otherwise specified, the class name is used as the default keyspace for an entity.
10+
The following interface definition shows the `KeyValueOperations` interface, which is the heart of Spring Data Key-Value:
11+
12+
====
13+
[source, java]
14+
----
15+
interface KeyValueOperations {
16+
17+
<T> T insert(T objectToInsert); <1>
18+
19+
void update(Object objectToUpdate); <2>
20+
21+
void delete(Class<?> type); <3>
22+
23+
<T> T findById(Object id, Class<T> type); <4>
24+
25+
<T> Iterable<T> findAllOf(Class<T> type); <5>
26+
27+
<T> Iterable<T> find(KeyValueQuery<?> query, Class<T> type); <6>
28+
29+
//... more functionality omitted.
30+
31+
}
32+
----
33+
<1> Inserts the given entity and assigns an ID (if required).
34+
<2> Updates the given entity.
35+
<3> Removes all entities of the matching type.
36+
<4> Returns the entity of the given type with its matching ID.
37+
<5> Returns all entities of the matching type.
38+
<6> Returns a `List` of all entities of the given type that match the criteria of the query.
39+
====
40+
41+
[[key-value.keyspaces]]
42+
== Keyspaces
43+
44+
Keyspaces define the part of the data structure in which the entity should be kept.
45+
This concept is similar to collections in MongoDB and Elasticsearch, cores in Solr, and tables in JPA.
46+
By default, the keyspace of an entity is extracted from its type, but you can also store entities of different types within one keyspace.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[key-value.repositories.map]]
2+
= Map Repositories
3+
4+
Map repositories reside on top of the `KeyValueTemplate`.
5+
Using the default `SpelQueryCreator` allows deriving query and sort expressions from the given method name, as the following example shows:
6+
7+
[source, java]
8+
----
9+
@Configuration
10+
@EnableMapRepositories
11+
class KeyValueConfig {
12+
13+
}
14+
15+
interface PersonRepository implements CrudRepository<Person, String> {
16+
List<Person> findByLastname(String lastname);
17+
}
18+
----

0 commit comments

Comments
 (0)