Skip to content

Commit 1b3d9f3

Browse files
committed
Migrate documentation to Antora.
Closes #1815
1 parent 6f5efea commit 1b3d9f3

37 files changed

+316
-105
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ target/
77

88
*.iml
99
.idea
10+
11+
build/
12+
node_modules
13+
node
14+
package.json
15+
package-lock.json

README.adoc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
image:https://spring.io/badges/spring-data-couchbase/ga.svg[Spring Data Couchbase,link=https://projects.spring.io/spring-data-couchbase#quick-start] image:https://spring.io/badges/spring-data-couchbase/snapshot.svg[Spring Data Couchbase,link=https://projects.spring.io/spring-data-couchbase#quick-start]
2-
31
= Spring Data Couchbase image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-couchbase%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-couchbase/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]]
42

53
The primary goal of the https://www.springsource.org/spring-data[Spring Data] project is to make it easier to build
@@ -32,16 +30,15 @@ This project is lead and maintained by Couchbase, Inc.
3230

3331
== Version compatibility
3432

35-
`Spring-Data Couchbase 3.0.x` is the Spring Data connector for the `Couchbase Java SDK 2.x` generation.
33+
`Spring-Data Couchbase` is the Spring Data connector for the `Couchbase Java SDK 2.x` generation.
3634

37-
Both the SDK and this Spring Data community project are major version changes with lots of differences from their
38-
respective previous versions.
35+
Both the SDK and this Spring Data community project are major version changes with lots of differences from their respective previous versions.
3936

4037
Notably, this version is compatible with `Couchbase Server 4.0`, bringing support for the `N1QL` query language.
4138

4239
== Code of Conduct
4340

44-
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct]. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].
41+
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].By participating, you are expected to uphold this code of conduct.Please report unacceptable behavior to [email protected].
4542

4643
== Getting Started
4744

@@ -144,14 +141,16 @@ You can also chat with the community on https://gitter.im/spring-projects/spring
144141

145142
== Reporting Issues
146143

147-
Spring Data uses JIRA as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
144+
Spring Data uses GitHub as issue tracking system to record bugs and feature requests.
145+
If you want to raise an issue, please follow the recommendations below:
148146

149147
* Before you log a bug, please search the
150148
https://github.com/spring-projects/spring-data-couchbase/issues[issue tracker] to see if someone has already reported the problem.
151-
* If the issue doesn’t already exist, https://github.com/spring-projects/spring-data-couchbase/issues/new[create a new issue].
149+
* If the issue does not already exist, https://github.com/spring-projects/spring-data-couchbase/issues/new[create a new issue].
152150
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.
153-
* If you need to paste code, or include a stack trace use JIRA `{code}…{code}` escapes before and after your text.
154-
* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.
151+
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
152+
* If possible try to create a test-case or project that replicates the issue.
153+
Attach a link to your code or a compressed file containing your code.
155154

156155
== Building from Source
157156

@@ -173,10 +172,10 @@ Building the documentation builds also the project without running tests.
173172

174173
[source,bash]
175174
----
176-
$ ./mvnw clean install -Pdistribute
175+
$ ./mvnw clean install -Pantora
177176
----
178177

179-
The generated documentation is available from `target/site/reference/html/index.html`.
178+
The generated documentation is available from `target/antora/site/index.html`.
180179

181180
=== Building and staging reference documentation for review
182181

pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,31 @@
319319
</plugins>
320320
</build>
321321

322+
<profiles>
323+
<profile>
324+
<id>antora-process-resources</id>
325+
<build>
326+
<resources>
327+
<resource>
328+
<directory>src/main/antora/resources/antora-resources</directory>
329+
<filtering>true</filtering>
330+
</resource>
331+
</resources>
332+
</build>
333+
</profile>
334+
<profile>
335+
<id>antora</id>
336+
<build>
337+
<plugins>
338+
<plugin>
339+
<groupId>io.spring.maven.antora</groupId>
340+
<artifactId>antora-maven-plugin</artifactId>
341+
</plugin>
342+
</plugins>
343+
</build>
344+
</profile>
345+
</profiles>
346+
322347
<repositories>
323348
<repository>
324349
<id>spring-snapshot</id>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# FIXME: enable when pushed to spring-projects
17+
# if: github.repository_owner == 'spring-projects'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs-build
23+
fetch-depth: 1
24+
- name: Dispatch (partial build)
25+
if: github.ref_type == 'branch'
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29+
- name: Dispatch (full build)
30+
if: github.ref_type == 'tag'
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

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-couchbase'
9+
site:
10+
title: Spring Data Couchbase
11+
url: https://docs.spring.io/spring-data-couchbase/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-couchbase
2+
version: true
3+
title: Spring Data Couchbase
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
- run:
9+
command: ./mvnw validate process-resources -am -Pantora-process-resources
10+
local: true
11+
scan:
12+
dir: target/classes/

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
* xref:index.adoc[Overview]
2+
** xref:commons/upgrade.adoc[]
3+
** xref:commons/migrating.adoc[]
4+
5+
* xref:couchbase.adoc[]
6+
** xref:couchbase/configuration.adoc[]
7+
** xref:couchbase/entity.adoc[]
8+
** xref:couchbase/autokeygeneration.adoc[]
9+
** xref:couchbase/template.adoc[]
10+
** xref:couchbase/transactions.adoc[]
11+
** xref:couchbase/collections.adoc[]
12+
** xref:couchbase/fieldlevelencryption.adoc[]
13+
** xref:couchbase/ansijoins.adoc[]
14+
** xref:couchbase/caching.adoc[]
15+
16+
* xref:repositories.adoc[]
17+
** xref:repositories/core-concepts.adoc[]
18+
** xref:repositories/definition.adoc[]
19+
** xref:couchbase/repository.adoc[]
20+
** xref:couchbase/reactiverepository.adoc[]
21+
** xref:repositories/create-instances.adoc[]
22+
** xref:repositories/query-methods-details.adoc[]
23+
** xref:repositories/projections.adoc[]
24+
** xref:repositories/custom-implementations.adoc[]
25+
** xref:repositories/core-domain-events.adoc[]
26+
** xref:repositories/core-extensions.adoc[]
27+
** xref:repositories/null-handling.adoc[]
28+
** xref:repositories/query-keywords-reference.adoc[]
29+
** xref:repositories/query-return-types-reference.adoc[]
30+
31+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]

src/main/asciidoc/migrating.adoc renamed to src/main/antora/modules/ROOT/pages/commons/migrating.adoc

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,48 @@ Since the main objective was to migrate from the Java SDK 2 to 3, configuration
1212

1313
IMPORTANT: XML Configuration support has been dropped, so only java/annotation based configuration is supported.
1414

15-
Your configuration still has to extend the `AbstractCouchbaseConfiguration`, but since RBAC (role-based access control) is now mandatory, different properties need to be overridden in order to be configured: `getConnectionString`, `getUserName`, `getPassword` and `getBucketName`. If you want to use a non-default scope optionally you can override the `getScopeName` method. Note that if you want to use certificate based authentication or you need to customize the password authentication, the `authenticator` method can be overridden to perform this task.
15+
Your configuration still has to extend the `AbstractCouchbaseConfiguration`, but since RBAC (role-based access control) is now mandatory, different properties need to be overridden in order to be configured: `getConnectionString`, `getUserName`, `getPassword` and `getBucketName`.If you want to use a non-default scope optionally you can override the `getScopeName` method.Note that if you want to use certificate based authentication or you need to customize the password authentication, the `authenticator` method can be overridden to perform this task.
1616

1717
The new SDK still has an environment that is used to configure it, so you can override the `configureEnvironment` method and supply custom configuration if needed.
1818

19-
For more information, see <<couchbase.configuration>>.
19+
For more information, see xref:couchbase/configuration.adoc[Installation & Configuration].
2020

21+
[[spring-boot-version-compatibility]]
2122
=== Spring Boot Version Compatibility
2223

23-
Spring Boot 2.3.x or higher depends on Spring Data Couchbase 4.x. Earlier versions of Couchbase are not available because SDK 2 and 3 cannot live on the same classpath.
24+
Spring Boot 2.3.x or higher depends on Spring Data Couchbase 4.x.Earlier versions of Couchbase are not available because SDK 2 and 3 cannot live on the same classpath.
2425

2526
[[couchbase.migrating.entities]]
2627

2728

29+
[[entities]]
2830
== Entities
2931
How to deal with entities has not changed, although since the SDK now does not ship annotations anymore only Spring-Data related annotations are supported.
3032

3133
Specifically:
3234

33-
- `com.couchbase.client.java.repository.annotation.Id` became `import org.springframework.data.annotation.Id`
34-
- `com.couchbase.client.java.repository.annotation.Field` became `import org.springframework.data.couchbase.core.mapping.Field`
35+
- `com.couchbase.client.java.repository.annotation.Id` became `import org.springframework.data.annotation.Id`
36+
- `com.couchbase.client.java.repository.annotation.Field` became `import org.springframework.data.couchbase.core.mapping.Field`
3537

3638
The `org.springframework.data.couchbase.core.mapping.Document` annotation stayed the same.
3739

38-
For more information, see <<couchbase.entity>>.
40+
For more information, see xref:couchbase/entity.adoc[Modeling Entities].
3941

4042

4143
[[couchbase.migrating.indexes]]
4244
== Automatic Index Management
4345

44-
Automatic Index Management has been redesigned to allow more flexible indexing. New annotations have been introduced and old ones like `@ViewIndexed`, `@N1qlSecondaryIndexed` and `@N1qlPrimaryIndexed` were removed.
46+
Automatic Index Management has been redesigned to allow more flexible indexing.
47+
New annotations have been introduced and old ones like `@ViewIndexed`, `@N1qlSecondaryIndexed` and `@N1qlPrimaryIndexed` were removed.
4548

46-
For more information, see <<couchbase.repository.indexing>>.
49+
For more information, see xref:couchbase/repository.adoc#couchbase.repository.indexing[Automatic Index Management].
4750

4851
[[couchbase.migrating.template]]
4952
== Template and ReactiveTemplate
5053

5154
Since the Couchbase SDK 3 removes support for `RxJava` and instead adds support for `Reactor`, both the `couchbaseTemplate` as well as the `reactiveCouchbaseTemplate` can be directly accessed from the `AbstractCouchbaseConfiguration`.
5255

53-
The template has been completely overhauled so that it now uses a fluent API to configure instead of many method overloads. This has the advantage that in the future we are able to extend the functionality without having to introduce more and more overloads that make it complicated to navigate.
56+
The template has been completely overhauled so that it now uses a fluent API to configure instead of many method overloads.This has the advantage that in the future we are able to extend the functionality without having to introduce more and more overloads that make it complicated to navigate.
5457

5558
The following table describes the method names in 3.x and compares them to their 4.x equivalents:
5659

@@ -113,14 +116,14 @@ In addition, the following methods have been added which were not available in 3
113116

114117
We tried to unify and align the APIs more closely to the underlying SDK semantics so they are easier to correlate and navigate.
115118

116-
For more information, see <<couchbase.template>>.
119+
For more information, see xref:couchbase/template.adoc[Template & direct operations].
117120

118121
[[couchbase.migrating.repository]]
119122
== Repositories & Queries
120123

121-
- `org.springframework.data.couchbase.core.query.Query` became `org.springframework.data.couchbase.repository.Query`
122-
- `org.springframework.data.couchbase.repository.ReactiveCouchbaseSortingRepository` has been removed. Consider extending `ReactiveSortingRepository` or `ReactiveCouchbaseRepository`
123-
- `org.springframework.data.couchbase.repository.CouchbasePagingAndSortingRepository` has been removed. Consider extending `PagingAndSortingRepository` or `CouchbaseRepository`
124+
- `org.springframework.data.couchbase.core.query.Query` became `org.springframework.data.couchbase.repository.Query`
125+
- `org.springframework.data.couchbase.repository.ReactiveCouchbaseSortingRepository` has been removed.Consider extending `ReactiveSortingRepository` or `ReactiveCouchbaseRepository`
126+
- `org.springframework.data.couchbase.repository.CouchbasePagingAndSortingRepository` has been removed.Consider extending `PagingAndSortingRepository` or `CouchbaseRepository`
124127

125128

126129
IMPORTANT: Support for views has been removed and N1QL queries are now the first-class citizens for all custom repository methods as well as the built-in ones by default.
@@ -151,9 +154,10 @@ public class MyService {
151154
----
152155
====
153156

154-
See <<couchbase.repository>> for more information.
157+
See xref:couchbase/repository.adoc[Couchbase repositories] for more information.
155158

156159

160+
[[full-text-search-fts]]
157161
== Full Text Search (FTS)
158162

159163
The FTS API has been simplified and now can be accessed via the `Cluster` class:
@@ -193,4 +197,4 @@ public class MyService {
193197
----
194198
====
195199

196-
See link:https://docs.couchbase.com/java-sdk/current/howtos/full-text-searching-with-sdk.html[the FTS Documentation] for more information.
200+
See link:https://docs.couchbase.com/java-sdk/current/howtos/full-text-searching-with-sdk.html[the FTS Documentation] for more information.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include::{commons}@data-commons::page$upgrade.adoc[]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[couchbase.core]]
2+
= Couchbase Support
3+
:page-section-summary-toc: 1
4+
5+
Spring Data support for Couchbase contains a wide range of features:
6+
7+
* Spring configuration support with xref:couchbase/configuration.adoc[Java-based `@Configuration` classes].
8+
* The xref:couchbase/template.adoc[`CouchbaseTemplate` and `ReactiveCouchbaseTemplate`] helper classes that provide object mapping between Couchbase collections and POJOs.
9+
* xref:couchbase/template.adoc#exception-translation[Exception translation] into Spring's portable {spring-data-commons-docs-url}data-access.html#dao-exceptions[Data Access Exception Hierarchy].
10+
* Feature rich object mapping integrated with _Spring's_ {spring-data-commons-docs-url}core.html#core-convert[Conversion Service].
11+
* Annotation-based mapping metadata that is extensible to support other metadata formats.
12+
* Automatic implementation of xref:repositories.adoc[imperative and reactive `Repository` interfaces] including support for xref:repositories/custom-implementations.adoc[custom query methods].
13+
14+
For most data-oriented tasks, you can use the `[Reactive]CouchbaseTemplate` or the `Repository` support, both of which use the rich object-mapping functionality.
15+
Spring Data Couchbase uses consistent naming conventions on objects in various APIs to those found in the Couchbase Java SDK so that they are familiar and so that you can map your existing knowledge onto the Spring APIs.

0 commit comments

Comments
 (0)