Skip to content

Commit 819b424

Browse files
committed
DATAMONGO-1153 - Fix documentation build.
Movend jconsole.png to the images folder. Extracted MongoDB-specific auditing documentation into separate file for inclusion after the general auditing docs.
1 parent 5d0328b commit 819b424

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

src/main/asciidoc/index.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include::reference/introduction.adoc[]
2626
include::reference/mongodb.adoc[]
2727
include::reference/mongo-repositories.adoc[]
2828
include::{spring-data-commons-docs}/auditing.adoc[]
29+
include::reference/mongo-auditing.adoc[]
2930
include::reference/mapping.adoc[]
3031
include::reference/cross-store.adoc[]
3132
include::reference/logging.adoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[[mongo.auditing]]
2+
== General auditing configuration
3+
4+
Activating auditing functionality is just a matter of adding the Spring Data Mongo `auditing` namespace element to your configuration:
5+
6+
.Activating auditing using XML configuration
7+
====
8+
[source,xml]
9+
----
10+
<mongo:auditing mapping-context-ref="customMappingContext" auditor-aware-ref="yourAuditorAwareImpl"/>
11+
----
12+
====
13+
14+
Since Spring Data MongoDB 1.4 auditing can be enabled by annotating a configuration class with the `@EnableMongoAuditing` annotation.
15+
16+
.Activating auditing using JavaConfig
17+
====
18+
[source,java]
19+
----
20+
@Configuration
21+
@EnableMongoAuditing
22+
class Config {
23+
24+
@Bean
25+
public AuditorAware<AuditableUser> myAuditorProvider() {
26+
return new AuditorAwareImpl();
27+
}
28+
}
29+
----
30+
====
31+
32+
If you expose a bean of type `AuditorAware` to the `ApplicationContext`, the auditing infrastructure will pick it up automatically and use it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableJpaAuditing`.
33+

src/main/asciidoc/reference/mongodb.adoc

+1-34
Original file line numberDiff line numberDiff line change
@@ -415,39 +415,6 @@ If you need to configure additional options on the `com.mongodb.Mongo` instance
415415
</bean>
416416
----
417417

418-
[[mongo.auditing]]
419-
== General auditing configuration
420-
421-
Activating auditing functionality is just a matter of adding the Spring Data Mongo `auditing` namespace element to your configuration:
422-
423-
.Activating auditing using XML configuration
424-
====
425-
[source,xml]
426-
----
427-
<mongo:auditing mapping-context-ref="customMappingContext" auditor-aware-ref="yourAuditorAwareImpl"/>
428-
----
429-
====
430-
431-
Since Spring Data MongoDB 1.4 auditing can be enabled by annotating a configuration class with the `@EnableMongoAuditing` annotation.
432-
433-
.Activating auditing using JavaConfig
434-
====
435-
[source,java]
436-
----
437-
@Configuration
438-
@EnableMongoAuditing
439-
class Config {
440-
441-
@Bean
442-
public AuditorAware<AuditableUser> myAuditorProvider() {
443-
return new AuditorAwareImpl();
444-
}
445-
}
446-
----
447-
====
448-
449-
If you expose a bean of type `AuditorAware` to the `ApplicationContext`, the auditing infrastructure will pick it up automatically and use it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableJpaAuditing`.
450-
451418
[[mongo-template]]
452419
== Introduction to MongoTemplate
453420

@@ -1538,7 +1505,7 @@ Note that the aggregation operations not listed here are currently not supported
15381505
[[mongo.aggregation.projection]]
15391506
=== Projection Expressions
15401507

1541-
Projection expressions are used to define the fields that are the outcome of a particular aggregation step. Projection expressions can be defined via the `project` method of the `Aggregate` class either by passing a list of `String`s or an aggregation framework `Fields` object. The projection can be extended with additional fields through a fluent API via the `and(String)` method and aliased via the `as(String)` method.
1508+
Projection expressions are used to define the fields that are the outcome of a particular aggregation step. Projection expressions can be defined via the `project` method of the `Aggregate` class either by passing a list of `String`s or an aggregation framework `Fields` object. The projection can be extended with additional fields through a fluent API via the `and(String)` method and aliased via the `as(String)` method.
15421509
Note that one can also define fields with aliases via the static factory method `Fields.field` of the aggregation framework that can then be used to construct a new `Fields` instance.
15431510

15441511
.Projection expression examples

0 commit comments

Comments
 (0)