Skip to content

Commit c0274c8

Browse files
committed
Bundle Javadoc with Antora documentation site.
Closes #1507
1 parent 0db8473 commit c0274c8

File tree

9 files changed

+33
-19
lines changed

9 files changed

+33
-19
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ work
1818
build/
1919
node_modules
2020
node
21-
package.json
2221
package-lock.json
2322
.mvn/.gradle-enterprise
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"dependencies": {
3+
"antora": "3.2.0-alpha.6",
4+
"@antora/atlas-extension": "1.0.0-alpha.2",
5+
"@antora/collector-extension": "1.0.0-alpha.7",
6+
"@asciidoctor/tabs": "1.0.0-beta.6",
7+
"@springio/antora-extensions": "1.13.0",
8+
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
9+
}
10+
}

spring-data-cassandra-distribution/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</plugin>
4848

4949
<plugin>
50-
<groupId>io.spring.maven.antora</groupId>
50+
<groupId>org.antora</groupId>
5151
<artifactId>antora-maven-plugin</artifactId>
5252
</plugin>
5353
</plugins>

src/main/antora/antora-playbook.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# The purpose of this Antora playbook is to build the docs in the current branch.
44
antora:
55
extensions:
6-
- '@antora/collector-extension'
7-
- require: '@springio/antora-extensions/root-component-extension'
6+
- require: '@springio/antora-extensions'
87
root_component_name: 'data-cassandra'
98
site:
109
title: Spring Data Cassandra
@@ -22,13 +21,12 @@ content:
2221
start_path: src/main/antora
2322
asciidoc:
2423
attributes:
25-
page-pagination: ''
2624
hide-uri-scheme: '@'
2725
tabs-sync-option: '@'
28-
chomp: 'all'
2926
extensions:
3027
- '@asciidoctor/tabs'
3128
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/javadoc-extension'
3230
sourcemap: true
3331
urls:
3432
latest_version_segment: ''
@@ -38,5 +36,5 @@ runtime:
3836
format: pretty
3937
ui:
4038
bundle:
41-
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
39+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
4240
snapshot: true

src/main/antora/antora.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ ext:
1010
local: true
1111
scan:
1212
dir: spring-data-cassandra-distribution/target/classes/
13+
- run:
14+
command: ./mvnw package -Pdistribute
15+
local: true
16+
scan:
17+
dir: target/antora

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@
4343
** xref:kotlin/extensions.adoc[]
4444
** xref:kotlin/coroutines.adoc[]
4545
46-
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
46+
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]
47+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank]

src/main/antora/modules/ROOT/pages/cassandra/cql-template.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
[[cassandra.cql-template]]
22
= CQL Template API
33

4-
The `CqlTemplate` class (and its reactive variant `ReactiveCqlTemplate`) is the central class in the core CQL package.
4+
The javadoc:org.springframework.data.cassandra.core.cql.CqlTemplate[] class (and its reactive variant javadoc:org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate[]) is the central class in the core CQL package.
55
It handles the creation and release of resources.
66
It performs the basic tasks of the core CQL workflow, such as statement creation and execution, and leaves application code to provide CQL and extract results.
77
The `CqlTemplate` class executes CQL queries and update statements, performs iteration over `ResultSet` instances and extraction of returned parameter values.
88
It also catches CQL exceptions and translates them to the generic, more informative, exception hierarchy defined in the `org.springframework.dao` package.
99

1010
When you use the `CqlTemplate` for your code, you need only implement callback interfaces, which have a clearly defined contract.
11-
Given a `Connection`, the `PreparedStatementCreator` callback interface creates a xref:cassandra/prepared-statements.adoc#cassandra.template.prepared-statements.cql[prepared statement] with the provided CQL and any necessary parameter arguments.
12-
The `RowCallbackHandler` interface extracts values from each row of a `ResultSet`.
11+
Given a `CqlSession`, the javadoc:org.springframework.data.cassandra.core.cql.PreparedStatementCreator[] callback interface creates a xref:cassandra/prepared-statements.adoc#cassandra.template.prepared-statements.cql[prepared statement] with the provided CQL and any necessary parameter arguments.
12+
The javadoc:org.springframework.data.cassandra.core.cql.RowCallbackHandler[] interface extracts values from each row of a `ResultSet`.
1313

14-
The `CqlTemplate` can be used within a DAO implementation through direct instantiation with a `SessionFactory` reference or be configured in the Spring container and given to DAOs as a bean reference. `CqlTemplate` is a foundational building block for xref:cassandra/template.adoc[`CassandraTemplate`].
14+
The javadoc:org.springframework.data.cassandra.core.cql.CqlTemplate[] can be used within a DAO implementation through direct instantiation with a javadoc:org.springframework.data.cassandra.SessionFactory[] reference or be configured in the Spring container and given to DAOs as a bean reference. `CqlTemplate` is a foundational building block for xref:cassandra/template.adoc[`CassandraTemplate`].
1515

1616
All CQL issued by this class is logged at the `DEBUG` level under the category corresponding to the fully-qualified class name of the template instance (typically `CqlTemplate`, but it may be different if you use a custom subclass of the `CqlTemplate` class).
1717

18-
You can control fetch size, consistency level, and retry policy defaults by configuring these parameters on the CQL API instances: `CqlTemplate`, `AsyncCqlTemplate`, and `ReactiveCqlTemplate`.
18+
You can control fetch size, consistency level, and retry policy defaults by configuring these parameters on the CQL API instances:
19+
javadoc:org.springframework.data.cassandra.core.cql.CqlTemplate[], javadoc:org.springframework.data.cassandra.core.cql.AsyncCqlTemplate[], and javadoc:org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate[].
1920
Defaults apply if the particular query option is not set.
2021

2122
NOTE: `CqlTemplate` comes in different execution model flavors.
@@ -28,7 +29,7 @@ You can use `AsyncCqlTemplate` for asynchronous execution and synchronization wi
2829

2930
This section provides some examples of the `CqlTemplate` class in action.
3031
These examples are not an exhaustive list of all functionality exposed by the `CqlTemplate`.
31-
See the https://docs.spring.io/spring-data/cassandra/docs/{version}/api/[Javadoc] for that.
32+
See the javadoc:org.springframework.data.cassandra.core.cql.CqlTemplate[Javadoc] for that.
3233

3334
[[cassandra.cql-template.examples.query]]
3435
=== Querying (SELECT) with `CqlTemplate`

src/main/antora/modules/ROOT/pages/cassandra/events.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
The Cassandra mapping framework has several built-in `org.springframework.context.ApplicationEvent` events that your application can respond to by registering special beans in the `ApplicationContext`.
55
Being based on Spring's application context event infrastructure lets other products, such as Spring Integration, easily receive these events as they are a well known eventing mechanism in Spring-based applications.
66

7-
To intercept an object before it goes into the database, you can register a subclass of `org.springframework.data.cassandra.core.mapping.event.AbstractCassandraEventListener` that overrides the `onBeforeSave(…)` method.
7+
To intercept an object before it goes into the database, you can register a subclass of javadoc:org.springframework.data.cassandra.core.mapping.event.AbstractCassandraEventListener[] that overrides the `onBeforeSave(…)` method.
88
When the event is dispatched, your listener is called and passed the domain object (which is a Java entity).
99
Entity lifecycle events can be costly and you may notice a change in the performance profile when loading large result sets.
10-
You can disable lifecycle events on the link:https://docs.spring.io/spring-data/cassandra/docs/{version}/api/org/springframework/data/cassandra/core/CassandraTemplate.html#setEntityLifecycleEventsEnabled(boolean)[Template API].
10+
You can disable lifecycle events on the javadoc:org.springframework.data.cassandra.core.CassandraTemplate#setEntityLifecycleEventsEnabled(boolean)[Template API].
1111
The following example uses the `onBeforeSave` method:
1212

1313
====
@@ -19,7 +19,7 @@ include::example$mapping/BeforeSaveListener.java[tags=class]
1919

2020
Declaring these beans in your Spring `ApplicationContext` will cause them to be invoked whenever the event is dispatched.
2121

22-
The `AbstractCassandraEventListener` has the following callback methods:
22+
The javadoc:org.springframework.data.cassandra.core.mapping.event.AbstractCassandraEventListener[] has the following callback methods:
2323

2424
* `onBeforeSave`: Called in `CassandraTemplate.insert(…)` and `.update(…)` operations before inserting or updating a row in the database but after creating the `Statement`.
2525
* `onAfterSave`: Called in `CassandraTemplate…insert(…)` and `.update(…)` operations after inserting or updating a row in the database.

src/main/antora/modules/ROOT/pages/cassandra/getting-started.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ include::example$ReactiveCassandraApplication.java[tags=file]
9797

9898
Even in this simple example, there are a few notable things to point out:
9999

100-
* You can create an instance of `CassandraTemplate` (or `ReactiveCassandraTemplate` for reactive usage) with a Cassandra `CqlSession`.
100+
* You can create an instance of javadoc:org.springframework.data.cassandra.core.CassandraTemplate[] (or javadoc:org.springframework.data.cassandra.core.ReactiveCassandraTemplate[] for reactive usage) with a Cassandra `CqlSession`.
101101
* You must annotate your POJO as a Cassandra `@Table` entity and also annotate the `@PrimaryKey`.
102102
Optionally, you can override these mapping names to match your Cassandra database table and column names.
103-
* You can either use raw CQL or the DataStax `QueryBuilder` API to construct your queries.
103+
* You can either use raw CQL or the Driver `QueryBuilder` API to construct your queries.

0 commit comments

Comments
 (0)