From 819b424142b48e7f475fdeea360efbe06c28f259 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 29 Jan 2015 14:03:13 +0100 Subject: [PATCH] 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. --- .../{reference => images}/jconsole.png | Bin src/main/asciidoc/index.adoc | 1 + .../asciidoc/reference/mongo-auditing.adoc | 33 +++++++++++++++++ src/main/asciidoc/reference/mongodb.adoc | 35 +----------------- 4 files changed, 35 insertions(+), 34 deletions(-) rename src/main/asciidoc/{reference => images}/jconsole.png (100%) create mode 100644 src/main/asciidoc/reference/mongo-auditing.adoc diff --git a/src/main/asciidoc/reference/jconsole.png b/src/main/asciidoc/images/jconsole.png similarity index 100% rename from src/main/asciidoc/reference/jconsole.png rename to src/main/asciidoc/images/jconsole.png diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 7f04d440a..c94ad0dba 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -26,6 +26,7 @@ include::reference/introduction.adoc[] include::reference/mongodb.adoc[] include::reference/mongo-repositories.adoc[] include::{spring-data-commons-docs}/auditing.adoc[] +include::reference/mongo-auditing.adoc[] include::reference/mapping.adoc[] include::reference/cross-store.adoc[] include::reference/logging.adoc[] diff --git a/src/main/asciidoc/reference/mongo-auditing.adoc b/src/main/asciidoc/reference/mongo-auditing.adoc new file mode 100644 index 000000000..c8d01ceaf --- /dev/null +++ b/src/main/asciidoc/reference/mongo-auditing.adoc @@ -0,0 +1,33 @@ +[[mongo.auditing]] +== General auditing configuration + +Activating auditing functionality is just a matter of adding the Spring Data Mongo `auditing` namespace element to your configuration: + +.Activating auditing using XML configuration +==== +[source,xml] +---- + +---- +==== + +Since Spring Data MongoDB 1.4 auditing can be enabled by annotating a configuration class with the `@EnableMongoAuditing` annotation. + +.Activating auditing using JavaConfig +==== +[source,java] +---- +@Configuration +@EnableMongoAuditing +class Config { + + @Bean + public AuditorAware myAuditorProvider() { + return new AuditorAwareImpl(); + } +} +---- +==== + +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`. + diff --git a/src/main/asciidoc/reference/mongodb.adoc b/src/main/asciidoc/reference/mongodb.adoc index c462eb256..a6bf76b01 100644 --- a/src/main/asciidoc/reference/mongodb.adoc +++ b/src/main/asciidoc/reference/mongodb.adoc @@ -415,39 +415,6 @@ If you need to configure additional options on the `com.mongodb.Mongo` instance ---- -[[mongo.auditing]] -== General auditing configuration - -Activating auditing functionality is just a matter of adding the Spring Data Mongo `auditing` namespace element to your configuration: - -.Activating auditing using XML configuration -==== -[source,xml] ----- - ----- -==== - -Since Spring Data MongoDB 1.4 auditing can be enabled by annotating a configuration class with the `@EnableMongoAuditing` annotation. - -.Activating auditing using JavaConfig -==== -[source,java] ----- -@Configuration -@EnableMongoAuditing -class Config { - - @Bean - public AuditorAware myAuditorProvider() { - return new AuditorAwareImpl(); - } -} ----- -==== - -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`. - [[mongo-template]] == Introduction to MongoTemplate @@ -1538,7 +1505,7 @@ Note that the aggregation operations not listed here are currently not supported [[mongo.aggregation.projection]] === Projection Expressions -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. +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. 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. .Projection expression examples