You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/12/22 11:21:29 UTC
[01/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Repository: isis
Updated Branches:
refs/heads/master d231dcf05 -> dba5c836f
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_cqrs.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_cqrs.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_cqrs.adoc
index d1b4244..230ef04 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_cqrs.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_cqrs.adoc
@@ -17,9 +17,9 @@ Comparing CQRS to Apache Isis, the most obvious difference is that Apache Isis d
There are other reasons though why a separate read model might make sense, such as to precompute particular queries, or against denormalized data. In these cases Apache Isis can often provide a reasonable alternative, namely to map domain entities against RDBMS views, either materialized views or dynamic. In such cases there is still only a single physical datastore, and so transactional integrity is retained.
-Or, the CQRS architecture can be more fully implemented with Apache Isis by introducing a separate read model, synchronized using the xref:rgsvc.adoc#_rgsvc-api_PublishingService[`PublishingService`], or using xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscribers] on the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. One can then use xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view models] to surface the data in the external read datastore.
+Or, the CQRS architecture can be more fully implemented with Apache Isis by introducing a separate read model, synchronized using the xref:rgsvc.adoc#_rgsvc_api_PublishingService[`PublishingService`], or using xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscribers] on the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. One can then use xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view models] to surface the data in the external read datastore.
-With respect to commands, Apache Isis does of course support the xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] which allows each business action to be reified into a `Command`. However, names are misleading here: Apache Isis' commands are relatively passive, merely recording the intent of the user to invoke some operation. In a CQRS architecture, though, commands take a more active role, locating and acting upon the domain objects. More significantly, in CQRS each command has its own class, such as `PlaceOrderCommand`, instantiated by the client and then executed. With Apache Isis, though, the end-user merely invokes the `placeOrder(...)` action upon the domain object; the framework itself creates the `Command` as a side-effect of this.
+With respect to commands, Apache Isis does of course support the xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] which allows each business action to be reified into a `Command`. However, names are misleading here: Apache Isis' commands are relatively passive, merely recording the intent of the user to invoke some operation. In a CQRS architecture, though, commands take a more active role, locating and acting upon the domain objects. More significantly, in CQRS each command has its own class, such as `PlaceOrderCommand`, instantiated by the client and then executed. With Apache Isis, though, the end-user merely invokes the `placeOrder(...)` action upon the domain object; the framework itself creates the `Command` as a side-effect of this.
In CQRS the commands correspond to the business logic that mutates the system. Whether this logic is part of the command class (`PlaceOrderCommand`) or whether that command delegates to methods on the domain object is an implementation detail; but it certainly is common for the business logic to be wholly within the command object and for the domain object to be merely a data holder of the data within the command/write datastore.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_event-sourcing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_event-sourcing.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_event-sourcing.adoc
index 1d392ae..dc40dc6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_event-sourcing.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_principles_apache-isis-vs_event-sourcing.adoc
@@ -14,6 +14,6 @@ Although it might seem counter-intuitive to be able store persistent state in th
When combined with CQRS we see a command that triggers a business operation, and an event that results from it. So, a `PlaceOrderCommand` command can result in an `OrderPlacedEvent` event. A subscriber to this event might then generate a further command to act upon some other system (eg to dispatch the system). Note that the event might be dispatched and consumed in-process or alternatively this might occur out-of-process. If the latter, then the subscriber will operate within a separate transaction, meaning the usual eventual consistency concerns and also compensating actions if a rollback is required. CQRS/event sourcing advocates point out - correctly that this is just how things are in the "real world" too.
-In Apache Isis every business action (and indeed, property and collection) emits domain events through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] , and can optionally also be published through the xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`]. The former are dispatched and consumed in-process and within the same transaction, and for this reason the xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscribers] can also veto the events. The latter are intended for out-of-process consumption; the (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] and http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] modules provide implementations for dispatching either through a RDBMS database table, or directly through to an link:http://camel.apache.org[ActiveMQ] message queue (eg wired up to link:http://camel.apache.org[Apache Camel] event bus).
+In Apache Isis every business action (and indeed, property and collection) emits domain events through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] , and can optionally also be published through the xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`]. The former are dispatched and consumed in-process and within the same transaction, and for this reason the xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscribers] can also veto the events. The latter are intended for out-of-process consumption; the (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] and http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] modules provide implementations for dispatching either through a RDBMS database table, or directly through to an link:http://camel.apache.org[ActiveMQ] message queue (eg wired up to link:http://camel.apache.org[Apache Camel] event bus).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_crud.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_crud.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_crud.adoc
index 98a2f83..5912c09 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_crud.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_crud.adoc
@@ -9,21 +9,21 @@ NOTE: TODO
## Instantiating and Persisting Objects
-NOTE: TODO - using ``DomainObjectContainer``'s support for xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[creation] and xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[persistence]
+NOTE: TODO - using ``DomainObjectContainer``'s support for xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[creation] and xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[persistence]
## Finding Objects
-NOTE: TODO - using xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_generic-repository-api[`DomainObjectContainer`]
+NOTE: TODO - using xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_generic-repository-api[`DomainObjectContainer`]
### Using DataNucleus type-safe queries
-NOTE: TODO - as described xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport_type-safe-jdoql-queries[here]
+NOTE: TODO - as described xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport_type-safe-jdoql-queries[here]
## Deleting Objects
-NOTE: TODO using ``DomainObjectContainer``'s support for xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[persistence]
+NOTE: TODO using ``DomainObjectContainer``'s support for xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[persistence]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_domain-services.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_domain-services.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_domain-services.adoc
index a3f2e36..eb70bdc 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_domain-services.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_how-tos_domain-services.adoc
@@ -23,7 +23,7 @@ image::{_imagesdir}how-tos/domain-services/hexagonal-architecture-addons.png[wid
The (non-ASF) link:http://isisaddons.org[Isis Addons] are a good source of domain services, providing SPI implementations of the common cross-cutting concerns, and also a number of APIs for domain objects to invoke (eg tags, excel, settings). Of course, you can also write your own domain services as well, for example to interface with some external CMS system, say.
-The Apache Isis framework also provides numerous in-built domain services. These are catalogued in the reference guide, see xref:rgsvc.adoc#_rgsvc-api[here] and xref:rgsvc.adoc#_rgsvc-spi[here].
+The Apache Isis framework also provides numerous in-built domain services. These are catalogued in the reference guide, see xref:rgsvc.adoc#_rgsvc_api[here] and xref:rgsvc.adoc#_rgsvc_spi[here].
@@ -233,7 +233,7 @@ public class MyService extends AbstractService {
}
----
-The framework provides a number of request-scoped services, include a scratchpad service, query results caching, and support for co-ordinating bulk actions. See xref:rgsvc.adoc#_rgsvc-api[here] and xref:rgsvc.adoc#_rgsvc-spi[here] for further details.
+The framework provides a number of request-scoped services, include a scratchpad service, query results caching, and support for co-ordinating bulk actions. See xref:rgsvc.adoc#_rgsvc_api[here] and xref:rgsvc.adoc#_rgsvc_spi[here] for further details.
@@ -284,7 +284,7 @@ isis.services = employee.Employees,\
This is quite rare, however; you will often want to use default implementations of domain services that are provided by the framework and so will not reside under this prefix.
-Examples of framework-provided services (as defined in the applib) include clock, auditing, publishing, exception handling, view model support, snapshots/mementos, and user/application settings management; see the xref:rgsvc.adoc#_rgsvc-api[here] and _rgsvc-spi[here] for further details.
+Examples of framework-provided services (as defined in the applib) include clock, auditing, publishing, exception handling, view model support, snapshots/mementos, and user/application settings management; see the xref:rgsvc.adoc#_rgsvc_api[here] and _rgsvc_spi[here] for further details.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugsec_api-for-applications.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugsec_api-for-applications.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugsec_api-for-applications.adoc
index 6b5d504..0193b38 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugsec_api-for-applications.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugsec_api-for-applications.adoc
@@ -13,7 +13,7 @@ Still, on very rare occasion you may have a need, in which case you can either u
== `DomainObjectContainer` API
-The xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`] service exposes the following API:
+The xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`] service exposes the following API:
[source,java]
----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugsec_usage-by-isis-viewers.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugsec_usage-by-isis-viewers.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugsec_usage-by-isis-viewers.adoc
index 1fb7860..13f951b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugsec_usage-by-isis-viewers.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugsec_usage-by-isis-viewers.adoc
@@ -56,7 +56,7 @@ As well as providing a sign-in screen, the Wicket viewer also provides the abili
The sign-in verification page to render is pluggable; see xref:ugvw.adoc#_ugvw_extending_custom-pages[extensions chapter] for details.
====
-User registration is only available if the xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`UserRegistrationService`] is configured; this is used by the framework to actually create new instances of the user as accessed by the corresponding (Shiro) realm.
+User registration is only available if the xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`UserRegistrationService`] is configured; this is used by the framework to actually create new instances of the user as accessed by the corresponding (Shiro) realm.
Because Shiro realms are pluggable, the Apache Isis framework does not provide default implementations of this service. However, if you are using the http://github.com/isisaddons/isis-module-security[Isis addons' security] module (non-ASF), then this module _does_ provide an implementation (that, as you might expect, creates new "user" domain entities).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugtst_aaa.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugtst_aaa.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugtst_aaa.adoc
index e75a29b..4aa46d4 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugtst_aaa.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugtst_aaa.adoc
@@ -52,7 +52,7 @@ When we talk about integration tests/specs here, we mean tests that exercise the
For most other frameworks that would require having to test the application in a very heavy weight/fragile fashion using a tool such as link:http://docs.seleniumhq.org/[Selenium], driving a web browser to navigate . In this regard though, Apache Isis has a significant trick up its sleeve. Because Apache Isis implements the naked objects pattern, it means that the UI is generated automatically from the UI. This therefore allows for other implementations of the UI.
-The xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] domain service allows a test to wrap domain objects and thus to interact with said objects "as if" through the UI:
+The xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] domain service allows a test to wrap domain objects and thus to interact with said objects "as if" through the UI:
image::{_imagesdir}testing/integ-tests.png[width="700px"]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugtst_fixture-scripts_api-and-usage.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugtst_fixture-scripts_api-and-usage.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugtst_fixture-scripts_api-and-usage.adoc
index 079e7aa..196e510 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugtst_fixture-scripts_api-and-usage.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugtst_fixture-scripts_api-and-usage.adoc
@@ -19,9 +19,9 @@ There are two ways in which you can provide a `FixtureScripts` service.
The original (pre-1.9.0) approach is to subclass subclass `FixtureScripts` domain service, with your subclass specifying which package to search for. Various other settings can also be provided, and - being a custom class - you can also add in additional actions. A common example is to provide a "one-shot" action to recreate a standard demo set of objects.
-As of 1.9.0 there is an alternative design. Instead of subclassing `FixtureScripts` you instead implement the xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] SPI. (As its name suggests), this provides a `FixtureScriptsSpecification` object that contains the same information as would otherwise have been in the `FixtureScripts` subclass.
+As of 1.9.0 there is an alternative design. Instead of subclassing `FixtureScripts` you instead implement the xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] SPI. (As its name suggests), this provides a `FixtureScriptsSpecification` object that contains the same information as would otherwise have been in the `FixtureScripts` subclass.
-The actual implementation of the `FixtureScripts` service is then provided by the framework itself, namely the xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`FixtureScriptsDefault`] domain service, annotated to be rendered on the secondary "Prototyping" menu. This uses the `FixtureScriptsSpecificationProvider` to adjust itself accordinly.
+The actual implementation of the `FixtureScripts` service is then provided by the framework itself, namely the xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`FixtureScriptsDefault`] domain service, annotated to be rendered on the secondary "Prototyping" menu. This uses the `FixtureScriptsSpecificationProvider` to adjust itself accordinly.
For example, here's the `FixtureScriptsSpecificationProvider` service that's generated by the xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype]:
@@ -236,7 +236,7 @@ public class SimpleObjectCreate extends FixtureScript { // <1>
<3> output property: the created simple object
<4> the mandatory execute(...) API
<5> the `checkParam(...)` (inherited from `FixtureScript`) will check that the "name" property has been populated (using Java's Reflection API) and throw an exception if not
-<6> wrap the injected `SimpleObjects` domain service (using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`]) to simulate interaction through the UI...
+<6> wrap the injected `SimpleObjects` domain service (using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`]) to simulate interaction through the UI...
<7> .. and actually create the object using the "create" business action of that service
<8> add the resulting object to the execution context; this makes the object available to access if run from the UI
<9> inject the domain service into the fixture script
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugtst_integ-test-support_wrapper-factory.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugtst_integ-test-support_wrapper-factory.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugtst_integ-test-support_wrapper-factory.adoc
index 695eb65..a64239c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugtst_integ-test-support_wrapper-factory.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugtst_integ-test-support_wrapper-factory.adoc
@@ -5,7 +5,7 @@
:_imagesdir: images/
-The xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] service is responsible for wrapping a domain object in a dynamic proxy, of the same type as the object being proxied. And the role of this wrapper is to simulate the UI.
+The xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] service is responsible for wrapping a domain object in a dynamic proxy, of the same type as the object being proxied. And the role of this wrapper is to simulate the UI.
[NOTE]
====
@@ -145,7 +145,7 @@ public void subscriberReceivesEvents() throws Exception {
then(evHolder[0].getIdentifier().getMemberName()).isEqualTo("completed");
}
----
-<1> inject xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] into this test
+<1> inject xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] into this test
<2> holder for subscriber to capture event to
<3> subscriber's callback, using the guava subscriber syntax
<4> invoking the domain object using the wrapper
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugvro_architecture.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugvro_architecture.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugvro_architecture.adoc
index bf496d4..4d8ef00 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugvro_architecture.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugvro_architecture.adoc
@@ -17,7 +17,7 @@ the `Content-Type` header which the client can use to know how to process the re
* `RepresentationService` +
+
-The xref:rgsvc.adoc#_rgsvc-spi_RepresentationService[`RepresentationService`] is an SPI domain service (plugin-point)
+The xref:rgsvc.adoc#_rgsvc_spi_RepresentationService[`RepresentationService`] is an SPI domain service (plugin-point)
that allows an arbitrary representation to be generated for any of the resources defined in the RO spec. +
+
Normally this SPI service need not be replaced, because the default implementation
@@ -29,7 +29,7 @@ is able to handle the request (per the chain of responsibliity pattern).
* `ContentNegotiationService` +
+
As noted above, there can be multiple implementations of the
-xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`], each one handling a particular
+xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`], each one handling a particular
HTTP `Accept` header. If the implementation does not recognize the value of the header, if can simply return `null`. +
+
The framework provides a number of implementations; an implementation that handles the
@@ -39,7 +39,7 @@ default/fallback implementation that returns the representations defined by the
* `ContentMappingService` +
+
-The xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`] is used by the implementation of
+The xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] is used by the implementation of
`ContentNegotationService` that recognizes the `x-ro-domain-type`, its role being to transform a domain object
(usually an entity) into some other form (usually a DTO), as specified by the `x-ro-domain-type` parameter. There
can be many such implementations, each handling a different target domain type.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugvro_ro-spec.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugvro_ro-spec.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugvro_ro-spec.adoc
index 735604c..95f6bb3 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugvro_ro-spec.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugvro_ro-spec.adoc
@@ -130,7 +130,7 @@ For example, the client could use an `Accept` header such as:
Accept: application/xml;x-ro-domain-type="com.mycompany.viewmodels.v2.CustomerViewModel"
----
-The server will use the xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`] to attempt to
+The server will use the xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] to attempt to
transform the domain object into the requested `x-ro-domain-type`. The whole process is discussed in more detail in
the xref:ugvro.adoc#_ugvro_architecture[architecture] chapter.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugvw_extending_custom-pages.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugvw_extending_custom-pages.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugvw_extending_custom-pages.adoc
index 18a5943..14dfcdf 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugvw_extending_custom-pages.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugvw_extending_custom-pages.adoc
@@ -20,10 +20,10 @@ Isis defines eight page types (see the `org.apache.isis.viewer.wicket.model.mode
| The initial sign-in (aka login) page
| SIGN_UP
-| The sign-up page (if xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[user registration] is enabled).
+| The sign-up page (if xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[user registration] is enabled).
| SIGN_UP_VERIFY
-| The sign-up verification page (if xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[user registration] is enabled; as accessed by link from verification email)
+| The sign-up verification page (if xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[user registration] is enabled; as accessed by link from verification email)
| PASSWORD_RESET
| The password reset page (if enabled).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugvw_features_user-registration.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugvw_features_user-registration.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugvw_features_user-registration.adoc
index 3717eb7..e651d4d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugvw_features_user-registration.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugvw_features_user-registration.adoc
@@ -17,9 +17,9 @@ In a similar way, if the user has forgotten their password then they can request
To support this the framework requires three services to be registered and configured:
-* the xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[user registration service], which provides an API to create the user account
-* the xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[email notification service], which provides an API for to send the verification emails
-* the xref:rgsvc.adoc#_rgsvc-api_EmailService[email service], that is used by the email notification service to actually send the email.
+* the xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[user registration service], which provides an API to create the user account
+* the xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[email notification service], which provides an API for to send the verification emails
+* the xref:rgsvc.adoc#_rgsvc_api_EmailService[email service], that is used by the email notification service to actually send the email.
The Apache Isis core framework provides a default implementation of both the email notification service and the email service. If your application uses the https://github.com/isisaddons/isis-module-security[Isis addons security module] (not ASF) then an implementation is provided by that module; just add to the classpath. Otherwise you will need to provide your own implementation.
@@ -68,9 +68,9 @@ image::{_imagesdir}wicket-viewer/user-registration/sign-up-after-registration.pn
There are two prerequisites:
-* register an implementation of the xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[user registration service] (eg by using the https://github.com/isisaddons/isis-module-security[Isis addons security module])
+* register an implementation of the xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[user registration service] (eg by using the https://github.com/isisaddons/isis-module-security[Isis addons security module])
-* configure the xref:rgsvc.adoc#_rgsvc-api_EmailService[email service]
+* configure the xref:rgsvc.adoc#_rgsvc_api_EmailService[email service]
The latter is required if you are using the default email notification service and email service. If you are using your own alternative implementation of the email notification service then it may be omitted (and configure your own alternative implementation as required).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/rgsvc.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc.adoc
index 5feb1fd..c1f2508 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc.adoc
@@ -9,9 +9,9 @@
[[_rgsvc]]
== Domain Services
-This guide documents Apache Isis' domain services, both those that act as an xref:rgsvc.adoc#_rgsvc-api[API]
+This guide documents Apache Isis' domain services, both those that act as an xref:rgsvc.adoc#_rgsvc_api[API]
(implemented by the framework for your domain objects to call), and those domain services that act as an
-xref:rgsvc.adoc#_rgsvc-spi[SPI] (implemented by your domain application and which are called by the framework).
+xref:rgsvc.adoc#_rgsvc_spi[SPI] (implemented by your domain application and which are called by the framework).
=== Other Guides
@@ -36,5 +36,5 @@ The reference guides are:
In addition, there is a xref:cg.adoc#_cg[Contributors' Guide] describing development practices for contributors and committers alike.
-include::_rgsvc-api.adoc[leveloffset=+1]
-include::_rgsvc-spi.adoc[leveloffset=+1]
+include::_rgsvc_api.adoc[leveloffset=+1]
+include::_rgsvc_spi.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/ugsec.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugsec.adoc b/adocs/documentation/src/main/asciidoc/guides/ugsec.adoc
index 2038eff..4a3f46a 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugsec.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugsec.adoc
@@ -58,7 +58,7 @@ In addition to Apache Isis' Shiro-based implementation of its authentication and
[NOTE]
.What about auditing?
====
-A further aspect of security is auditing: recording what data was modified by which user. Apache Isis does define two service APIs -- xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`] -- that provide hooks to track which actions (commands) are invoked, and what data was modified as a result (auditing).
+A further aspect of security is auditing: recording what data was modified by which user. Apache Isis does define two service APIs -- xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`] -- that provide hooks to track which actions (commands) are invoked, and what data was modified as a result (auditing).
Isis does not itself provide any in-built implementations of these APIs, but there are implementations within (non-ASF) link:http://www.isisaddons.org[Isis Addons], namely the http://github.com/isisaddons/isis-module-command[Isis addons' command] module and the http://github.com/isisaddons/isis-module-audit[Isis addons' auditing] module.
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/resources/templates/isis-asciidoc-templates-idea.xml
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/resources/templates/isis-asciidoc-templates-idea.xml b/adocs/documentation/src/main/asciidoc/resources/templates/isis-asciidoc-templates-idea.xml
index 5b65582..d765df1 100644
--- a/adocs/documentation/src/main/asciidoc/resources/templates/isis-asciidoc-templates-idea.xml
+++ b/adocs/documentation/src/main/asciidoc/resources/templates/isis-asciidoc-templates-idea.xml
@@ -185,7 +185,7 @@
<option name="AsciiDoc" value="true" />
</context>
</template>
- <template name="adrgss" value="xref:rgsvc.adoc#_rgsvc-spi_$ServiceType$[`$ServiceType$`]" description="x-ref to ref guide manpage for service spi" toReformat="false" toShortenFQNames="true">
+ <template name="adrgss" value="xref:rgsvc.adoc#_rgsvc_spi_$ServiceType$[`$ServiceType$`]" description="x-ref to ref guide manpage for service spi" toReformat="false" toShortenFQNames="true">
<variable name="ServiceType" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="AsciiDoc" value="true" />
[07/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_XmlSnapshotService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_XmlSnapshotService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_XmlSnapshotService.adoc
deleted file mode 100644
index e6fce99..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_XmlSnapshotService.adoc
+++ /dev/null
@@ -1,220 +0,0 @@
-[[_rgsvc-api_XmlSnapshotService]]
-= `XmlSnapshotService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `XmlSnapshotService` provides the capability to generate XML snapshots (and if required corresponding XSD schemas) based on graphs of domain objects.
-
-Typical use cases include creating mementos for business-focused auditing, such that a report could be generated as to which end-user performed a business action (perhaps for legal reasons). For one system that we know of, a digest of this snapshot of data is signed with the public encryption key so as to enforce non-repudiation.
-
-Another use case is to grab raw data such that it could be merged into a report template or communication.
-
-The service offers a basic API to create a snapshot of a single object, and an more flexible API that allows the size of the graph to be customized.
-
-The core framework provides an implementation of this service (`o.a.i.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault`).
-
-
-
-== Standard API
-
-The (basic) API of `XmlSnapshotService` is:
-
-[source]
-----
-public interface XmlSnapshotService {
- public interface Snapshot {
- Document getXmlDocument();
- Document getXsdDocument();
- String getXmlDocumentAsString();
- String getXsdDocumentAsString();
- }
- @Programmatic
- public XmlSnapshotService.Snapshot snapshotFor(Object domainObject);
- ...
-}
-----
-
-
-The most straight-forward usage of this service is simply:
-
-[source,java]
-----
-XmlSnapshot snapshot = xmlsnapshotService.snapshotFor(customer);
-Element customerAsXml = snapshot.getXmlElement();
-----
-
-This will return an XML (document) element that contains the names and values of each of the customer's value properties, along with the titles of reference properties, and also the number of items in collections.
-
-
-As well as obtaining the XML snapshot, it is also possible to obtain an XSD schema that the XML snapshot conforms to.
-
-[source]
-----
-XmlSnapshot snapshot = ...;
-Element customerAsXml = snapshot.getXmlElement();
-Element customerXsd = snapshot.getXsdElement();
-----
-
-This can be useful for some tools. For example, link:http://www.altova.com/stylevision.html[Altova Stylevision] can use the XML and XSD to transform into reports. Please note that this link does not imply endorsement (nor even a recommendation that this is a good design).
-
-
-
-
-
-== Builder API
-
-The contents of the snapshot can be adjusted by including "paths" to other references or collections. To do this, the
-builder is used. The API for this is:
-
-[source,java]
-----
-public interface XmlSnapshotService {
- ...
- public interface Builder {
- void includePath(final String path);
- void includePathAndAnnotation(String path, String annotation);
- XmlSnapshotService.Snapshot build();
- }
- @Programmatic
- public XmlSnapshotService.Builder builderFor(Object domainObject);
-}
-----
-
-We start by obtaining a builder:
-
-[source,java]
-----
-XmlSnapshot.Builder builder = xmlsnapshotService.builderFor(customer);
-----
-
-Suppose now that we want the snapshot to also include details of the customer's address, where `address` in this case is a reference property to an instance of the `Address` class. We can "walk-the-graph" by including these references within the builder.
-
-[source,java]
-----
-builder.includePath("address");
-----
-
-We could then go further and include details of every order in the customer's `orders` collection, and details of every
-product of every order:
-
-[source,java]
-----
-builder.includePath("orders/product");
-----
-
-When all paths are included, then the builder can build the snapshot:
-
-[source,java]
-----
-XmlSnapshot snapshot = builder.build();
-Element customerAsXml = snapshot.getXmlElement();
-----
-
-All of this can be strung together in a fluent API:
-
-[source,java]
-----
-Element customerAsXml = xmlsnapshotService.builderFor(customer)
- .includePath("address")
- .includePath("orders/product")
- .build()
- .getXmlElement();
-----
-
-
-As you might imagine, the resultant XML document can get quite large very quickly with only a few "include"s.
-
-
-[NOTE]
-====
-If an XSD schema is beng generated (using `snapshot.getXsdElement()` then note that for the XSD to be correct, the object being snapshotted must have non-null values for the paths that are `include()`'d. If this isn't done then the XSD will not be correct reflect for another snapshotted object that does have non-null values.
-====
-
-
-
-
-== Automatic inclusions
-
-If the domain object being snapshotted implements the `SnapshottableWithInclusions` interace, then this moves the
-responsibility for determining what is included within the snapshot from the caller to the snapshottable object itself:
-
-[source]
-----
-public interface SnapshottableWithInclusions extends Snapshottable {
- List<String> snapshotInclusions();
-}
-----
-
-If necessary, both approaches can be combined.
-
-
-[TIP]
-====
-As an alternative to using `include()`, you might consider building a view model domain object which can reference only the relevant information required for the snapshot. For example, if only the 5 most recent Orders for a Customer were required, a `CustomerAndRecentOrders` view model could hold a collection of just those 5 ``Order``s. Typically such view models would implement `SnapshottableWithInclusions`.
-
-One reason for doing this is to provide a stable API between the domain model and whatever it is that might be consuming the XML. With a view model you can refactor the domain entities but still preserve a view model such that the XML is the same.
-====
-
-
-
-== Convenience API
-
-The `XmlSnapshotService` also provides some API for simply manipulating XML:
-
-[source]
-----
-public interface XmlSnapshotService {
- ...
- @Programmatic
- public Document asDocument(String xmlStr); // <1>
- @Programmatic
- public <T> T getChildElementValue( // <2>
- Element el, String tagname, Class<T> expectedCls);
- @Programmatic
- public Element getChildElement( // <3>
- Element el, String tagname);
- @Programmatic
- public String getChildTextValue(Element el); // <4>
-}
-----
-<1> is a convenience method to convert xml string back into a W3C Document
-<2> is a convenience method to extract the value of an XML element, based on its type.
-<3> is a convenience method to walk XML document.
-<4> is a convenience method to obtain value of child text node.
-
-
-
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `XmlSnapshotService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-== Related Services
-
-The xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`] provides a mechanism for obtaining a string representations of a single domain object.
-
-The xref:rgsvc.adoc#_rgsvc-api_MementoService[`MementoService`] also provides a mechanism for generating string representations of domain objects.
-
-The xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] (`1.11.0-SNAPSHOT`) is a simple wrapper around
-standard JAXB functionality for generating both XMLs and XSDs from JAXB-annotated classes. Note that (as of
-`1.11.0-SNAPSHOT`) there is built-in support for JAXB classes (ie annotated with
-xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]) to be used as view models.
-
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi.adoc
deleted file mode 100644
index 026909d..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi.adoc
+++ /dev/null
@@ -1,299 +0,0 @@
-[[_rgsvc-spi]]
-= Domain Services SPI
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-Apache Isis includes an extensive number of domain services for your domain objects to use; these are listed in xref:rgsvc.adoc#_rgsvc-api[Reference: Domain Services (API)] chapter.
-
-There are other domain services that constitute not an API but an SPI; if present they are used by Apache Isis itself rather than by your domain objects. A good example of this is the xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`] service; if an implementation is present then Apache Isis will call that service in order to record audit log entries. If no implementation is available then Apache Isis will carry on regardless.
-
-Some domain services can be considered both API and SPI; a good example is the xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`] that is of direct use for domain objects wishing to send out emails, but is also used by the framework to support the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality supported by the xref:ugvw.adoc#[Wicket viewer]. The same is true of the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]; this can be used by domain objects to broadcast arbitrary events, but is also used by the framework to automatically emit events for xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`] etc.
-
-For these hybrid services we have categorized the service as an "API" service. This chapter therefore contains only the strictly SPI services.
-
-
-The table below lists the SPIs that are defined in the Isis applib (`o.a.i.core:isis-core-applib` module).
-
-
-.Applib SPI Services
-[cols="2,4a,1,1", options="header"]
-|===
-
-
-|SPI
-|Description
-|Implementation
-|Notes
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`o.a.i.applib.` +
-`services.audit` +
-`AuditingService3`]
-|Create an audit record for every changed property of every changed object within a transaction.
-|`AuditingService` +
-``o.ia.m.audit`` +
-``isis-module-audit``
-|related services:
-`AuditingService-` +
-`Contributions`,
-`AuditingService-` +
-`Repository`
-
-|xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`o.a.i.applib.` +
-`services.background` +
-`BackgroundCommandService`]
-|Persisted a memento of an action invocation such that it can be executed asynchronously ("in the background") eg by a scheduler.
-|`BackgroundCommandServiceJdo` +
-``o.ia.m.command`` +
-``isis-module-command``
-|related services:
-`BackgroundCommandService-` +
-`JdoContributions`,
-`BackgroundCommandService-` +
-`JdoRepository`
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_ClassDiscoveryService[`o.a.i.applib.` +
-`services.classdiscovery` +
-`ClassDiscoveryService`]
-|Mechanism to locate (from the classpath) classes with a specific annotation (eg xref:rgant.adoc#_rgant-DomainService[`@DomainService`])
-
-Subtypes of a given type (eg xref:rgcms.adoc#_rgcms_classes_super_FixtureScript[`FixtureScript`]).
-|`ClassDiscoveryService-` +
-`UsingReflections` +
-``o.a.i.core`` +
-``isis-core-applib``
-|requires `org.reflections:reflections` as Maven dependency
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_CommandService[`o.a.i.applib.` +
-`services.command.spi` +
-`CommandService`]
-|Service to act as a factory and repository (create and save) of command instances, ie representations of an action invocation. Used for command/auditing and background services.
-|`CommandServiceJdo` +
-``o.ia.m.command`` +
-``isis-module-command``
-|related services: +
-`CommandService-` ++
-`JdoContributions`,
-`CommandService-` ++
-`JdoRepository`
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`o.a.i.applib.` +
-`services.userreg` +
-`EmailNotificationService`]
-|Notify a user during xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[self-registration] of users.
-|`EmailNotificationService-` +
-`Default` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|depends on: +
-a configured `EmailService`
-
-|xref:rgsvc.adoc#_rgsvc-spi_ErrorReportingService[`o.a.i.applib.` +
-`services.error` +
-`ErrorReportingService`]
-|Record details of an error occurring in the system (eg in an external incident recording system such as JIRA), and return a more friendly (jargon-free) message to display to the end user, with optional reference (eg `XXX-1234`).
-|(none)
-|
-
-|xref:rgsvc.adoc#_rgsvc-spi_EventSerializer[`o.a.i.applib.` +
-`services.publish` +
-`EventSerializer`]
-|Creates a representation of either an action invocation or a changed object being published through the xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
-|`RestfulObjects-` +
-`SpecEventSerializer` +
-``o.ia.m.publishing`` +
-``isis-module-publishing``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`o.a.i.applib.` +
-`services.exceprecog` +
-`ExceptionRecognizer2`]
-|Convert certain exceptions (eg foreign or unique key violation in the database) into a format that can be rendered to the end-user.
-|`ExceptionRecognizer-` +
-`CompositeFor-` +
-`JdoObjectStore` +
-``o.a.i.core`` +
-``isis-core-applib``
-|Extensible using composite pattern if required
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_LocaleProvider[`o.a.i.applib.` +
-`services.i18n` +
-`LocaleProvider`]
-|Request-scoped service to return the locale of the current user, in support of i18n (ie so that the app's UI, messages and exceptions can be translated to the required locale by the xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`].
-|`LocaleProviderWicket` +
-``o.a.i.viewer`` +
-``isis-viewer-wicket-impl``
-|
-
-|xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`o.a.i.applib.` +
-`services.fixturespec` +
-`FixtureScripts-` +
-`SpecificationProvider`]
-|Provides settings for xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`FixtureScriptsDefault`] fallback domain service for executing fixture scripts.
-|
-|
-
-|xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`o.a.i.applib.` +
-`services.publish` +
-`PublishingService`]
-|Publish any action invocations and changed objects, typically for interchange with an external system in a different bounded context.
-|`PublishingService` +
-``o.ia.m.publishing`` +
-``isis-module-publishing``
-|related services:
-`PublishingService-` ++
-``Contributions``,
-`PublishingService-` ++
-``Repository``. +
-depends on: +
-`EventSerializer`
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`o.a.i.applib.` +
-`services.i18n` +
-`TranslationService`]
-|Translate an app's UI, messages and exceptions for the current user (as per the locale provided by xref:rgsvc.adoc#_rgsvc-spi_LocaleProvider[`LocalProvider`].
-|`TranslationServicePo` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|related services: `TranslationServicePoMenu` +
-depends on: +
-`TranslationsResolver`, `LocaleProvider`
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_TranslationsResolver[`o.a.i.applib.` +
-`services.i18n` +
-`TranslationsResolver`]
-|Obtain translations for a particuar phrase and locale, in support of i18n (ie so that the app's UI, messages and exceptions can be translated to the required locale by the xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`]
-|`TranslationsResolverWicket` +
-``o.a.i.viewer`` +
-``isis-viewer-wicket-impl``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_UrlEncodingService[`o.a.i.applib.` +
-`services.urlencoding` +
-`UrlEncodingService`]
-|Converts strings into a form safe for use within a URL. Used to convert view models mementos into usable URL form.
-
-|`UrlEncodingServiceUsingBaseEncoding` +
-``o.a.i.applib`` +
-``isis-core-applib``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_UserProfileService[`o.a.i.applib.` +
-`services.userprof` +
-`UserProfileService`]
-|Obtain an alternative (usually enriched/customized) name for the current user, to render in the UI.
-|
-|
-
-|xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`o.a.i.applib.` +
-`services.userreg` +
-`UserRegistrationService`]
-|Create a new user account with the configured security mechanism.
-|`SecurityModule-` +
-`AppUserRegistrationService` +
-``o.ia.m.security`` +
-``isis-module-security``
-|depends (implicitly) on: +
-a configured `EmailService`
-
-
-|===
-
-
-Key:
-
-* `o.a.i` is an abbreviation for `org.apache.isis`
-* `o.ia.m` is an abbreviation for `org.isisaddons.module`
-
-
-Where an implementation is available (on the classpath) then it is always registered automatically (that is, they are all (with one exception) annotated with xref:rgant.adoc#_rgant-DomainService[`@DomainService`]. The one exception is xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`], which must be registered explicitly in `isis.properties`; this makes the service extensible (for new exceptions to be recognized).
-
-
-
-
-There are also some "internal" SPI services whose definitions depend on the internals of the framework (rather than the applib).
-
-[WARNING]
-====
-We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
-====
-
-
-
-."Internal" SPI Services
-[cols="3,3,2,2a", options="header"]
-|===
-
-|SPI
-|Maven Module +
-Impl'n (g: a:)
-|Implementation
-|Notes
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`o.a.i.v.ro.` +
-`rendering.service.conneg.` +
-`ContentMappingService`]
-|(Attempt to) map the returned data into the representation required by the client's HTTP `Accept` header.
-|
-|No default implementation.
-
-|xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`o.a.i.v.ro.` +
-`rendering.service.conneg.` +
-`ContentNegotiationService`]
-|Encodes the algorithm that delegates to any registered xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`]s.
-|`ContentNegotiationService-` +
-`XRoDomainType` +
-``o.a.i.core`` +
-`isis-core-viewer-restfulobjects-rendering`
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-spi_RepresentationService[`o.a.i.v.ro.` +
-`rendering.service.` +
-`RepresentationService`]
-|Generates the representations, delegating to any registered xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`]s.
-|`RepresentationService-` +
-`ForRestfulObjects` +
-``o.a.i.core`` +
-`isis-core-viewer-restfulobjects-rendering`
-|
-
-
-|===
-
-Key:
-
-* `o.a.i.v.ro` is an abbreviation for `org.apache.isis.viewer.restfulobjects`
-
-
-include::_rgsvc-spi_AuditingService.adoc[leveloffset=+1]
-include::_rgsvc-spi_BackgroundCommandService.adoc[leveloffset=+1]
-include::_rgsvc-spi_ClassDiscoveryService.adoc[leveloffset=+1]
-include::_rgsvc-spi_CommandService.adoc[leveloffset=+1]
-include::_rgsvc-spi_ContentMappingService.adoc[leveloffset=+1]
-include::_rgsvc-spi_ContentNegotiationService.adoc[leveloffset=+1]
-include::_rgsvc-spi_EmailNotificationService.adoc[leveloffset=+1]
-include::_rgsvc-spi_ErrorReportingService.adoc[leveloffset=+1]
-include::_rgsvc-spi_EventSerializer.adoc[leveloffset=+1]
-include::_rgsvc-spi_ExceptionRecognizer.adoc[leveloffset=+1]
-include::_rgsvc-spi_FixtureScriptsSpecificationProvider.adoc[leveloffset=+1]
-include::_rgsvc-spi_LocaleProvider.adoc[leveloffset=+1]
-include::_rgsvc-spi_PublishingService.adoc[leveloffset=+1]
-include::_rgsvc-spi_RepresentationService.adoc[leveloffset=+1]
-include::_rgsvc-spi_TranslationService.adoc[leveloffset=+1]
-include::_rgsvc-spi_TranslationsResolver.adoc[leveloffset=+1]
-include::_rgsvc-spi_UrlEncodingService.adoc[leveloffset=+1]
-include::_rgsvc-spi_UserProfileService.adoc[leveloffset=+1]
-include::_rgsvc-spi_UserRegistrationService.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_AuditingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_AuditingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_AuditingService.adoc
deleted file mode 100644
index c8d8a62..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_AuditingService.adoc
+++ /dev/null
@@ -1,85 +0,0 @@
-[[_rgsvc-spi_AuditingService]]
-= `AuditingService3`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-The `AuditingService3` auditing service provides a simple mechanism to capture changes to data. It is called for each property that has changed on any domain object, as a set of pre- and post-values.
-
-[NOTE]
-====
-In case you are wondering what happened to `AuditingService` and `AuditingService2`, these were earlier versions of the SPI that have since been deprecated and removed.
-====
-
-
-== SPI
-
-The SPI for the service is:
-
-[source,java]
-----
-public interface AuditingService3 {
-
- @Programmatic
- public void audit(
- final UUID transactionId, String targetClassName, final Bookmark target,
- String memberIdentifier, final String propertyName,
- final String preValue, final String postValue,
- final String user, final java.sql.Timestamp timestamp);
- }
-----
-
-The framework will call this for each and every domain object property that is modified within a transaction.
-
-
-
-== Implementation
-
-The most full-featured available implementation is the (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' Audit module]. This creates an audit records for each changed property (ie every time that `AuditingService3#audit(...)` is called. The implementation is `org.isisaddons.module.audit.dom.AuditingService`.
-
-The module also provides:
-
-* `AuditingServiceMenu` service which provides actions to search for ``AuditEntry``s, underneath an 'Activity' menu on the secondary menu bar.
-
-* `AuditingServiceRepository` service to to search for persisted `AuditEntry``s. None of its actions are visible in the user interface (they are all `@Programmatic`).
-
-* `AuditingServiceContributions` which contrbutes collections to the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[ `HasTransactionId`] interface. This will therefore display all audit entries that occurred in a given transaction, in other words whenever a command, a published event or another audit entry is displayed.
-
-
-
-If you just want to debug (writing to stderr), you can instead configure `o.a.i.applib.services.audit.AuditingService3$Stderr`
-
-
-
-== Usage
-
-The typical way to indicate that an object should be audited is to annotate it with the xref:rgant.adoc#_rgant-DomainObject_auditing[`@DomainObject#auditing()`] annotation.
-
-
-
-
-== Registering the Services
-
-The (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module provides an implementation of
-this service (`AuditingService`), and also provides a number of related domain services (`AuditingServiceMenu`,
-`AuditingServiceRepository` and `AuditingServiceContributions`).
-
-Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
-then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
-
-If menu items or contributions are not required in the UI, these can be suppressed either using security or by
-implementing a xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
-
-
-
-== Related Services
-
-The auditing service works very well with the xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`]. The `CommandService` captures the _cause_ of an interaction (an action was invoked, a property was edited), while the `AuditingService3` captures the _effect_ of that interaction in terms of changed state.
-
-You may also want to configure the xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
-
-All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_BackgroundCommandService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_BackgroundCommandService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_BackgroundCommandService.adoc
deleted file mode 100644
index 45518b9..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_BackgroundCommandService.adoc
+++ /dev/null
@@ -1,131 +0,0 @@
-[[_rgsvc-spi_BackgroundCommandService]]
-= `BackgroundCommandService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `BackgroundCommandService` (SPI) service supports the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] (API) service, persisting action invocations as commands such that they can subsequently be invoked in the background.
-
-The `BackgroundService` is responsible for capturing a memento representing the action invocation, and then hands off to the xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`] `BackgroundCommandService` to actually persist it.
-
-The persisting of commands is only half the story; there needs to be a separate process to read the commands and execute them. The abstract xref:rgsvc.adoc#_rgsvc-api_BackgroundService_BackgroundCommandExecution[`BackgroundCommandExecution`] provides a mechanism to execute such commands. This can be considered an API, albeit "internal" because the implementation relies on internals of the framework.
-
-
-
-== SPI
-
-The SPI of the `BackgroundCommandService` is:
-
-[source,java]
-----
-public interface BackgroundCommandService {
- void schedule(
- ActionInvocationMemento aim, // <1>
- Command parentCommand, // <2>
- String targetClassName,
- String targetActionName,
- String targetArgs);
-
-}
-----
-<1> is a wrapper around a xref:rgsvc.adoc#_rgsvc-api_MementoService[`MementoService`]'s `Memento`, capturing the details of the action invocation to be retained (eg persisted to a database) so that it can be executed at a later time
-<2> reference to the parent `Command` requesting the action be performed as a background command. This allows information such as the initiating user to be obtained.
-
-The API of `ActionInvocationMemento` in turn is:
-
-[source,java]
-----
-public class ActionInvocationMemento {
- public String getActionId() { ... }
- public String getTargetClassName() { ... }
- public String getTargetActionName() { ... }
- public Bookmark getTarget() { ... }
- public int getNumArgs() { ... }
- public Class<?> getArgType(int num) throws ClassNotFoundException { ... }
- public <T> T getArg(int num, Class<T> type) { ... }
-
- public String asMementoString() { ... } // <1>
-}
-----
-<1> lets the `BackgroundCommandService` implementation convert the action invocation into a simple string.
-
-
-
-== "Internal" SPI
-
-The `BackgroundCommandExecution` (in isis-core) is an abstract template class for xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_AbstractIsisSessionTemplate[headless access], that defines an abstract hook method to obtain background `Command`s to be executed:
-
-[source,java]
-----
-public abstract class BackgroundCommandExecution
- extends AbstractIsisSessionTemplate {
- ...
- protected abstract List<? extends Command> findBackgroundCommandsToExecute();
- ...
-}
-----
-
-The developer is required to implement this hook method in a subclass.
-
-
-
-
-== Implementation
-
-The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation (`org.isisaddons.module.command.dom.BackgroundCommandServiceJdo`) that persists ``Command``s using the JDO/DataNucleus object store. It further provides a number of supporting services:
-
-* `org.isisaddons.module.command.dom.BackgroundCommandServiceJdoRepository` is a repository to search for persisted background ``Command``s
-
-* `org.isisaddons.module.command.dom.BackgroundCommandServiceJdoContributions` contributes actions for searching for persisted child and sibling ``Command``s.
-
-The module also provides a concrete subclass of `BackgroundCommandExecution` that knows how to query for persisted (background) `Command`s such that they can be executed by a scheduler.
-
-[TIP]
-====
-Details of setting up the Quartz scheduler to actually execute these persisted commands can be found on the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] page.
-====
-
-
-
-
-== Usage
-
-Background commands can be created either declaratively or imperatively.
-
-The declarative approach involves annotating an action using xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] with `@Action#commandExecuteIn=CommandExecuteIn.BACKGROUND`.
-
-The imperative approach involves explicitly calling the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] from within domain object's action.
-
-
-
-
-== Registering the Services
-
-The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation
-of this service (`BackgroundCommandService`), and also provides a number of related domain services
-(`BackgroundCommandServiceJdo`, `BackgroundCommandJdoRepository` and `BackgroundCommandServiceJdoContributions`). This
-module also provides service implementations of the
-xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`].
-
-Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
-then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
-
-If contributions are not required in the UI, these can be suppressed either using security or by implementing a
-xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
-
-
-
-
-
-== Related Services
-
-As discussed above, this service supports the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] , persisting `Command`s such that they can be executed in the background.
-
-There is also a tie-up with the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] and its supporting xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] domain service. The `CommandContext` service is responsible for providing a parent `Command` with which the background `Command`s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s (analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s). The `BackgroundCommandService` ensures that these background `Command`s are associated with the parent "foreground" `Command`.
-
-What that means is that the implementations of `CommandService` and `BackgroundCommandService` go together, hence both implemented in the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module.).
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ClassDiscoveryService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ClassDiscoveryService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ClassDiscoveryService.adoc
deleted file mode 100644
index 5d328aa..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ClassDiscoveryService.adoc
+++ /dev/null
@@ -1,82 +0,0 @@
-[[_rgsvc-spi_ClassDiscoveryService]]
-= `ClassDiscoveryService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `ClassDiscovery` service is used to automatically discover subclasses of any given type on the classpath. The primary use case is to support "convention-over-configuration" designs that work with a minimum of configuration.
-
-This service is used by the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] service to automatically locate any xref:rgcms.adoc#_rgcms_classes_super_FixtureScript[`FixtureScript`] implementations.
-
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface ClassDiscoveryService2 {
- @Programmatic
- <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type, String packagePrefix);
- @Deprecated
- @Programmatic
- <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type); // <1>
-}
-----
-<1> no longer used
-
-
-
-== Implementation
-
-Isis provides an implementation of this service, namely `o.a.i.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections`.
-
-[NOTE]
-====
-This implementation is also used to discover domain services annotated with xref:rgant.adoc#_rgant-DomainService[`@DomainService`]. Currently this logic uses the implementation directly, so is not pluggable. However, the entire `ServicesInstaller`
-====
-
-
-
-== Usage
-
-The usage will vary depending upon the conventions of the design. As of 1.9.0, the usage of the service has been
-centralized such that the packages to be scanned are located from the xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[`AppManifest`]'s `#getModules()` method.
-
-For example, the xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype]'s app manifest includes:
-
-[source,java]
-----
-public class DomainAppAppManifest implements AppManifest {
- @Override
- public List<Class<?>> getModules() {
- return Arrays.asList(
- DomainAppDomainModule.class, // domain (entities and repositories)
- DomainAppFixtureModule.class, // fixtures
- DomainAppAppModule.class // home page service etc
- );
- }
- ...
-}
-----
-
-where the three module classes in effect define three different package prefixes to search under (for domain services, fixture scripts and persistent entities).
-
-Other usages of the `ClassDiscoveryService` are likely to work in a similar way, requiring some sort of scope to be specified.
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `ClassDiscoveryService2` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_CommandService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_CommandService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_CommandService.adoc
deleted file mode 100644
index b62629b..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_CommandService.adoc
+++ /dev/null
@@ -1,100 +0,0 @@
-[[_rgsvc-spi_CommandService]]
-= `CommandService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `CommandService` service supports the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service such that `Command` objects (that reify the invocation of an action on a domain object into an object) can be persisted.
-
-Persistent `Command`s support several use cases:
-
-* they enable profiling of the running application (which actions are invoked then most often, what is their response time)
-* they act as a parent to any background commands that might be invoked through the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`]
-* if xref:rgsvc.adoc#_rgsvc-spi_AuditingService[auditing] is configured, they provide better audit information, since the `Command` (the 'cause' of an action) can be correlated to the audit records (the "effect" of the action) by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`]
-* if xref:rgsvc.adoc#_rgsvc-spi_PublishingService[publishing] is configured, they provide better traceability as the `Command` is also correlated with any published events, again through the unique xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`]
-* the associated xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation attribute also allows action invocations to be performed in the background. In this case the act of invoking the action on an object instead returns the `Command` to the user.
-
-
-
-The screencast below provides a run-through of the command (profiling) service, auditing service, publishing service. It also shows how commands can be run in the background either explicitly by scheduling through the background service or implicitly by way of a framework annotation.
-
-
-
-video::tqXUZkPB3EI[youtube,width="560px",height="315px"]
-
-[NOTE]
-====
-Note that this screencast shows an earlier version of the xref:ugvw.adoc#[Wicket viewer] UI (specifically, pre 1.8.0).
-====
-
-
-== SPI
-
-The `CommandService` service defines the following very simple API:
-
-[source,java]
-----
-public interface CommandService {
- @Programmatic
- Command create();
- @Programmatic
- void startTransaction(Command command, final UUID transactionId);
- @Programmatic
- void complete(Command command);
- @Programmatic
- boolean persistIfPossible(Command command);
-}
-----
-
-where `Command` is defined as defined by the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service.
-
-
-== Implementation
-
-The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation (`org.isisaddons.module.command.dom.CommandServiceJdo`) that persists ``Command``s using the JDO/DataNucleus object store. It further provides a number of supporting services:
-
-* `org.isisaddons.module.command.dom.CommandServiceJdoRepository` is a repository to search for persisted ``Command``s
-
-* `org.isisaddons.module.command.dom.CommandServiceJdoContributions` contributes actions for searching for persisted child and sibling ``Command``s.
-
-
-
-== Usage
-
-The typical way to indicate that an action should be reified into a `Command` is by annotating the action using xref:rgant.adoc#_rgant-Action_command[`@Action#command()`].
-
-
-
-
-== Registering the Services
-
-The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation
-of this service (`CommandService`), and also provides a number of related domain services
-(`CommandJdoRepository` and `CommandServiceJdoContributions`). This
-module also provides service implementations of the
-xref:rgsvc.adoc#_rgsvc-spi_CommandService[`BackgroundCommandService`].
-
-Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
-then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
-
-If contributions are not required in the UI, these can be suppressed either using security or by implementing a
-xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
-
-
-
-
-== Related Services
-
-As discussed above, this service supports the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`], providing the ability for `Command` objects to be
-persisted. This is closely related to the xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]that allows the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] to schedule commands for background/asynchronous execution.
-
-The implementations of `CommandService` and `BackgroundCommandService` are intended to go together, so that persistent parent `Command`s can be associated with their child background `Command`s.
-
-The services provided by this module combines very well with the xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`]. The `CommandService` captures the _cause_ of an interaction (an action was invoked, a property was edited), while the `AuditingService3` captures the _effect_ of that interaction in terms of changed state.
-
-You may also want to configure the xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
-
-All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentMappingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentMappingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentMappingService.adoc
deleted file mode 100644
index 1b30f39..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentMappingService.adoc
+++ /dev/null
@@ -1,107 +0,0 @@
-[[_rgsvc-spi_ContentMappingService]]
-= `ContentMappingService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `ContentMappingService` supports the (default implementation of the) xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`] allowing the xref:ugvro.adoc#[RestfulObjects viewer] to allow domain objects to be transformed into some other format as specified by the HTTP `Accept` header.
-
-See xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`] for further discussion.
-
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface ContentMappingService {
- @Programmatic
- Object map(Object object, // <1>
- List<MediaType> acceptableMediaTypes, // <2>
- RepresentationType representationType); // <3>
-
-}
-
-----
-<1> typically the input is a domain object (whose structure might change over time), and the output is a DTO (whose structure is guaranteed to be preserved over time)
-<2> as per the caller's HTTP `Accept` header
-<3> the representation type required (as per the link:http://restfulobjects.org[Restful Objects spec]).
-
-
-[WARNING]
-====
-This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
-====
-
-
-== Implementations
-
-No default implementations are provided by Apache Isis framework itself. However, the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] includes a sample implementation to convert its `ToDoItem`
-entity into (two different versions of) a `ToDoItemDto` (JAXB annotated). This uses the
-link:http://orika-mapper.github.io/orika-docs/intro.html[Orika] mapping library.
-
-The source code is:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-public class CustomContentMappingService implements ContentMappingService {
- private MapperFactory mapperFactory; // <1>
- @Programmatic
- @PostConstruct
- public void init() {
- mapperFactory = new DefaultMapperFactory.Builder().build();
- mapperFactory.registerClassMap(
- mapperFactory.classMap(ToDoItem.class, ToDoItemDto.class) // <2>
- .byDefault() // <3>
- .toClassMap());
- mapperFactory.registerClassMap(
- mapperFactory.classMap(Bookmark.class, OidDto.class) // <4>
- .field("identifier", "objectIdentifier") // <5>
- .byDefault() // all other fields are compatible // <6>
- .toClassMap());
- }
- @Programmatic
- @Override // <7>
- public Object map(
- final Object object,
- final List<MediaType> acceptableMediaTypes,
- final RepresentationType representationType) {
- if(object instanceof ToDoItem) {
- final Bookmark bookmark = bookmarkService.bookmarkFor(object);
- final ToDoItemDto dto =
- mapperFactory.getMapperFacade().map(object, ToDoItemDto.class); // <8>
- final OidDto oidDto =
- mapperFactory.getMapperFacade().map(bookmark, OidDto.class); // <9>
- dto.setOid(oidDto); // <10>
- return dto;
- }
- return null;
- }
- @javax.inject.Inject
- private BookmarkService bookmarkService;
-}
-----
-<1> registry of known mappings
-<2> how to map `ToDoItem` to `ToDoItemDto` ...
-<3> ... all properties have same name in both source and destination types
-<4> how to map `Bookmark` to `OidDto` ...
-<5> ... this property has a different name
-<6> ... all other properties have same name
-<7> the main API to implement. This implementation ignores the `acceptableMediaTypes` and `representationType`
-<8> map the domain object to the DTO
-<9> and map its oid (by way of the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]
-<10> and perform some additional manual wiring (because domain objects don't _know_ their Oids).
-
-You'll notice that the implementation doesn't actually use the `acceptableMediaTypes` and `representationType` parameters. That's because the calling `ContentNegotiationServiceXRoDomainType` will double check that the returned object is of the correct type (as defined by the `x-ro-domain-type` parameter of the HTTP `Accept` header). Since this (example) todoapp only offers a single mapping, there's therefore no need to for the mapping service to check further.
-
-
-
-== Related Services
-
-This service is a companion to the default implementation of the xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentNegotiationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentNegotiationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentNegotiationService.adoc
deleted file mode 100644
index f624c1e..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ContentNegotiationService.adoc
+++ /dev/null
@@ -1,204 +0,0 @@
-[[_rgsvc-spi_ContentNegotiationService]]
-= `ContentNegotiationService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `ContentNegotiationService` is a plug-in point for the xref:ugvro.adoc#[RestfulObjects viewer] so that it can generate representations according to HTTP `Accept` header of the request. This idea is discussed in section 34.1 of the link:http://restfulobjects.org[Restful Objects spec] v1.0.
-
-The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain Javascript library, say) expect, or at least works best with, a certain style of representation.
-
-Another use case is to support "third party" REST clients over which you have no control. In this scenario you _must not_ naively expose entities through the RO viewer, because over time those entities will inevitably evolve and change their structure. If the entities were exposed directly then those REST clients will break.
-
-Instead you need to create some sort of stable facade over your domain entities, one which you will preserve even if the domain entities change. There are three ways in which you can do this:
-
-* first is to solve the problem at the domain layer by defining a regular Apache Isis xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]. This is then surfaced over the RO viewer. +
-+
-If the underlying entities change, then care must be taken to ensure that structure of the view model nevertheless is unchanged.
-
-* a second option is to solve the problem at the persistence layer, but defining a (SQL) view in the database and then xref:ugbtb.adoc#_ugbtb_more-advanced_mapping-rdbms-views[mapping this] to a (read-only) entity. Again this is surfaced by the RO viewer. +
-+
-If the underlying tables change (as the result of a change in their corresponding domain entities) then once more the view must be refactored so that it still presents the same structure.
-
-* our third option is to solve the problem at the presentation layer, using the `ContentNegotiationService` described in this section. +
-+
-The `ContentNegotiationService` is responsible for inspecting the HTTP `Accept` header, and use this to select the correct representation to render. +
-+
-The Apache Isis framework provides a default implementation of `ContentNegotiationService` which inspects the "x-ro-domaintype" component of the HTTP `Accept` header. If present, this implementation will delegate to the companion xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`] service, if configured. +
-+
-A typical implementation of `ContentMappingService` will convert the domain object into some sort of DTO (data transfer object) as specified by the "x-ro-domaintype". If this DTO is annotated with JAXB or Jackson mappings, then the RO viewer (courtesy of the underlying link:http://resteasy.jboss.org/[RestEasy] framework) can serialize these directly +
-+
-What all that means is that, if the underlying entities change, we are required to update the mappings in the `ContentMappingService` to map to the same DTOs.
-
-This diagram illustrates the three options available:
-
-image::{_imagesdir}reference-services-spi/ContentNegotiationService/facade-choices.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/facade-choices.png"]
-
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface ContentNegotiationService {
- @Programmatic
- Response.ResponseBuilder buildResponse( // <1>
- RepresentationService.Context2 renderContext2,
- ObjectAdapter objectAdapter);
- @Programmatic
- Response.ResponseBuilder buildResponse( // <2>
- RepresentationService.Context2 renderContext2,
- ObjectAndProperty objectAndProperty);
- @Programmatic
- Response.ResponseBuilder buildResponse( // <3>
- RepresentationService.Context2 renderContext2,
- ObjectAndCollection objectAndCollection);
- @Programmatic
- Response.ResponseBuilder buildResponse( // <4>
- RepresentationService.Context2 renderContext2,
- ObjectAndAction objectAndAction);
- @Programmatic
- Response.ResponseBuilder buildResponse( // <5>
- RepresentationService.Context2 renderContext2,
- ObjectAndActionInvocation objectAndActionInvocation);
-}
-----
-<1> representation of a single object, as per section 14.4 of the RO spec, v1.0
-<2> representation of a single property of an object, as per section 16.4 of the RO spec v1.0
-<3> representation of a single collection of an object, as per section 17.5 of the RO spec v1.0
-<4> representation of a single action (prompt) of an object, as per section 18.2 of the RO spec v1.0
-<5> representation of the results of a single action invocation, as per section 19.5 of the RO spec v1.0
-
-These methods provide:
-
-* a `RepresentationService.Context2` which provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings)
-
-* an object representing the information to be rendered +
-+
-eg `ObjectAdapter`, `ObjectAndProperty`, `ObjectAndCollection` etc
-
-In all cases, returning `null` will result in the regular RO spec representation being returned.
-
-
-[WARNING]
-====
-This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
-====
-
-
-
-== Implementation
-
-`ContentNegotiationServiceAbstract` (in `o.a.i.v.ro.rendering.service.conneg`) provides a no-op implementation of the SPI, along with supporting methods:
-
-[source,java]
-----
-public abstract class ContentNegotiationServiceAbstract implements ContentNegotiationService {
- ...
- protected Object objectOf(final ObjectAdapter objectAdapter) { ... }
- protected Object returnedObjectOf(ObjectAndActionInvocation objectAndActionInvocation) { ... }
-
- protected Class<?> loadClass(String cls) { ... }
-
- protected void ensureJaxbAnnotated(Class<?> domainType) { ... }
- protected void ensureDomainObjectAssignable(
- String xRoDomainType, Class<?> domainType, Object domainObject) { ... }
-}
-----
-
-As discussed in the introduction, the framework also provides a default implementation, `o.a.i.v.ro.rendering.service.conneg.ContentNegotiationServiceXRoDomainType`. This handles content negotiation for two of the possible representations, object representations and for action result representations:
-
-* For object representations it will handle requests with HTTP `Accept` headers of the form:
-** `application/json;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=...`
-** `application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=...`
-
-* for action result representations it will similarly handle requests with HTTP `Accept` headers of the form:
-** `application/json;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=...` +
-** `application/xml;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=...`
-
-
-The value of the `x-ro-domain-type` parameter corresponds to the DTO to be mapped into by the xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`].
-
-If the DTO is annotated with JAXB, then also note that the runtime type must be annotated with the JAXB `javax.xml.bind.annotation.XmlRootElement` so that RestEasy is able to unambiguously serialize it.
-
-
-
-
-== Usage
-
-You can find an example of all these services in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]. This defines a `ToDoItemDto` class that is JAXB annotated (it is in fact generated from an XSD).
-
-The example app also includes an implementation of `ContentMappingService` that maps `todoapp.dom.module.todoitem.ToDoItem` entities to `todoapp.dto.module.todoitem.ToDoItemDto` classes.
-
-A REST client can therefore request a DTO representation of an entity by invoking
-
-[source]
-----
-http://localhost:8080/restful/objects/TODO/0
-----
-
-with an `Accept` header of:
-
-[source]
-----
-application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto
-----
-
-will result in an XML serialization of that class:
-
-image::{_imagesdir}reference-services-spi/ContentNegotiationService/accept-xml.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/accept-xml.png"]
-
-
-while similarly hitting the same URL with an `Accept` header of:
-
-[source]
-----
-application/json;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto
-----
-
-will result in the JSON serialization of that class:
-
-image::{_imagesdir}reference-services-spi/ContentNegotiationService/accept-json.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/accept-json.png"]
-
-
-
-
-[_rgsvc-spi_ContentNegotiationService_Configuration]]
-== Configuration
-
-The default `ContentNegotiationServiceXRoDomainType` implementation provides a xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] which controls whether a mapped domain object is pretty-printed (formatted, indented) or not:
-
-[source,ini]
-----
-isis.services.ContentNegotiationServiceXRoDomainType.prettyPrint=true
-----
-
-If the property is not set, then the default depends on the xref:rgcfg.adoc#_rgcfg_deployment-types[deployment type]; production mode will disable pretty printing, while prototyping mode will enable it.
-
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
-implementation of `ContentNegotiationService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-== Related Services
-
-The default implementation of `ContentNegotiationService` delegates to xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`] (if present) to convert domain entities into a stable form (eg DTO).
-
-The `ContentNegotiationService` is itself called by the (default implementation of) xref:rgsvc.adoc#_rgsvc-spi_RepresentationService[`RepresentationService`].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EmailNotificationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EmailNotificationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EmailNotificationService.adoc
deleted file mode 100644
index 1ab854b..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EmailNotificationService.adoc
+++ /dev/null
@@ -1,81 +0,0 @@
-[[_rgsvc-spi_EmailNotificationService]]
-= `EmailNotificationService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `EmailNotificationService` supports the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] (self sign-up) features of the xref:ugvw.adoc#[Wicket viewer] whereby a user can sign-up to access an application by providing a valid email address.
-
-The Wicket viewer will check whether an implementation of this service (and also the xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`UserRegistrationService`]) is available, and if so will (unless configured not to) expose a sign-up page where the user enters their email address. A verification email is sent using this service; the email includes a link back to the running application. The user then completes the registration process (choosing a user name, password and so on) and the Wicket viewer creates an account for them (using the aforementioned `UserRegistrationService`).
-
-The role of this service in all of this is to format and send out emails for the initial registration, or for password resets.
-
-The default implementation of this service uses the xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`], which must be configured in order for user registration to be enabled.
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface EmailNotificationService extends Serializable {
- @Programmatic
- boolean send(EmailRegistrationEvent ev); // <1>
- @Programmatic
- boolean send(PasswordResetEvent ev); // <2>
- @Programmatic
- boolean isConfigured(); // <3>
-}
-----
-<1> sends an email to verify an email address as part of the initial user registration
-<2> sends an email to reset a password for an already-registered user
-<3> determines whether the implementation was configured and initialized correctly
-
-If `isConfigured()` returns false then it is _not_ valid to call `send(...)` (and doing so will result in an `IllegalStateException` being thrown.
-
-
-== Implementation
-
-The framework provides a default implementation, `o.a.i.core.runtime.services.userreg.EmailNotificationServiceDefault`
-that constructs the emails to send.
-
-
-
-=== Alternative Implementations
-
-The text of these email templates is hard-coded as resources, in other words baked into the core jar files. If you need to use different text then you can of course always write and register your own implementation to be used instead of Isis' default.
-
-If you have configured an alternative email service implementation, it should process the message body as HTML.
-
-If you wish to write an alternative implementation of this service, note that (unlike most Apache Isis domain services) the implementation is also instantiated and injected by Google Guice. This is because `EmailNotificationService` is used as part of the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality and is used by Wicket pages that are accessed outside of the usual Apache Isis runtime.
-
-This implies a couple of additional constraints:
-
-* first, implementation class should also be annotated with `@com.google.inject.Singleton`
-* second, there may not be any Apache Isis session running. (If necessary, one can be created on the fly using `IsisContext.doInSession(...)`)
-
-To ensure that your alternative implementation takes the place of the default implementation, register it explicitly in `isis.properties`.
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
-implementation of `EmailNotificationService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-== Related Services
-
-As noted elsewhere, the default implementation of this service uses xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]. This service has no specific configuration properties but does require that the `EmailService` has been configured.
-
-Conversely, this service is used by (Isis' default implementation of) xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`UserRegistrationService`].
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ErrorReportingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ErrorReportingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ErrorReportingService.adoc
deleted file mode 100644
index 32573ea..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ErrorReportingService.adoc
+++ /dev/null
@@ -1,106 +0,0 @@
-[[_rgsvc-spi_ErrorReportingService]]
-= `ErrorReportingService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `ErrorReportingService` service is an optional SPI that providies the ability to record any errors/exceptions that
- might occur in the application into an external incident recording system (such as JIRA). The service also allows
- a user-friendly (jargon-free) error message to be returned and rendered to the end-user, along with an optional
- incident reference (eg a JIRA issue `XXX-1234`).
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface ErrorReportingService {
- Ticket reportError(ErrorDetails errorDetails);
-}
-----
-
-where `ErrorDetails` provided to the service is:
-
-[source,java]
-----
-public class ErrorDetails {
- public String getMainMessage() { ... } // <1>
- public boolean isRecognized() { ... } // <2>
- public boolean isAuthorizationCause() { ... } // <3>
- public List<String> getStackTraceDetailList() { // <4>
-}
-----
-<1> the main message to be displayed to the end-user. The service is responsible for translating this into the language of the end-user (it can use xref:rgsvc.adoc#_rgsvc-spi_LocaleProvider[`LocaleProvider`] if required).
-<2> whether this message has already been recognized by an xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`] service. Generally this converts potentially non-recoverable (fatal) exceptions into recoverable exceptions (warnings) as well providing an alternative mechanism for generating user-friendly error messages.
-<3> whether the cause of the exception was due to a lack of privileges. In such cases the UI restricts the information shown to the end-user, to avoid leaking potentially sensitive information
-<4> the stack trace of the exception, including the trace of any exceptions in the causal chain. These technical details are hidden from the user and only shown for non-recoverable exceptions.
-
-
-and `Ticket` (returned by the service) has the constructor:
-
-[source,java]
-----
-public class Ticket implements Serializable {
- public Ticket(
- final String reference, // <1>
- final String userMessage, // <2>
- final String details) { ... } // <3>
-}
-----
-<1> is a unique identifier that the end-user can use to track any follow-up from this error. For example, an
-implementation might automatically log an issue in a bug tracking system such as JIRA, in which case the reference would
-probably be the JIRA issue number <tt>XXX-1234</tt>.
-<2> a short, jargon-free message to display to the end-user.
-<3> is optional additional details to show. For example, these might include text on how to recover from the error, or
- workarounds, or just further details on contacting the help desk if the issue is severe and requires immediate
- attention.
-
-
-
-
-== Implementation
-
-The (non-ASF) http://github.com/isisaddons/isis-app-kitchensink[Isis addons' kitchensink] app provides an example
-implementation:
-
-[source,java]
-----
-@DomainService( nature = NatureOfService.DOMAIN )
-public class KitchensinkErrorReportingService implements ErrorReportingService {
- private int ticketNumber = 1;
- @Override
- public Ticket reportError(final ErrorDetails errorDetails) {
- return new Ticket(
- nextTicketReference(),
- "The Kitchen sink app is sorry to report that: " + errorDetails.getMainMessage(),
- "These are additional details for the end-user to read.\n"
- + "This content should be able to span many lines.\n"
- + "More detail.\n"
- + "Some suggested work-arounds.\n"
- + "Details of how to contact help desk.\n"
- + "And so on");
- }
- String nextTicketReference() {
- return "" + ticketNumber++;
- }
-}
-----
-
-which is rendered as:
-
-image::{_imagesdir}reference-services-spi/ErrorReportingService/kitchensink-example.png[width="860px",link="{_imagesdir}reference-services-spi/ErrorReportingService/kitchensink-example.png"]
-
-
-
-
-== Registering the Services
-
-There is no default implementation of this service. To register your own implementation (and assuming that an
-`AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), then just
-ensure that the implementation is on the classpath and the module containing the implementation is returned in
-`AppManifest#getModules()`.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EventSerializer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EventSerializer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EventSerializer.adoc
deleted file mode 100644
index 7ffe90f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_EventSerializer.adoc
+++ /dev/null
@@ -1,74 +0,0 @@
-[[_rgsvc-spi_EventSerializer]]
-= `EventSerializer`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `EmailSerializer` service is a supporting service intended for use by (any implementation of) xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`]. Its responsibility is to combine the `EventMetadata` and the `EventPayload` into some serialized form (such as JSON, XML or a string) that can then be published.
-
-See xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`] for further discussion.
-
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface EventSerializer {
- Object serialize( // <1>
- EventMetadata metadata, // <2>
- EventPayload payload); // <3>
-}
-----
-<1> returns an object for maximum flexibility, which is then handed off to the `PublishingService`.
-<2> standard metadata about the event, such as the user, the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`], date/time etc
-<3> for published actions, will generally be an `EventPayloadForActionInvocation` (or subclass thereof); for published objects, will generally be an `EventPayloadForObjectChanged` (or subclass thereof)
-
-It's important to make sure that the publishing service implementation is able to handle the serialized form. Strings are a good lowest common denominator, but in some cases a type-safe equivalent, such as a w3c DOM `Document` or JSON node might be passed instead.
-
-
-
-
-
-== Implementation
-
-The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an implementation (`org.isisaddons.module.publishing.dom.eventserializer.RestfulObjectsSpecEventSerializer`) that represents the event payload using the representation defined by the link:http://restfulobjects.org[Restful Objects spec] of (transient) objects, grafting on the metadata as additional JSON nodes.
-
-For example, this is the JSON generated on an action invocation:
-
-.JSON representation of a published action invocation
-image::{_imagesdir}reference-services-spi/EventSerializer/action-invocation-published-to-stderr.png[width="750px",link="{_imagesdir}reference-services-spi/EventSerializer/action-invocation-published-to-stderr.png"]
-
-while this is the object change JSON:
-
-.JSON representation of a published changed object
-image::{_imagesdir}reference-services-spi/EventSerializer/changed-object-published-to-stderr.png[width="750px",link="{_imagesdir}reference-services-spi/EventSerializer/changed-object-published-to-stderr.png"]
-
-You could if you wish change the representation by registering your own implementation of this API in `isis.properties`:
-
-
-
-
-== Registering the Services
-
-There is no default implementation of this service provided by the core Apache Isis framework.
-
-The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an
-implementation of this service (`RestfulObjectsSpecEventSerializer`) that serializes action invocations and published
-objects into a format based on the Restful Objects specification. It also (as you might imagine) provides an
-implementation of the xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
-
-Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
-then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
-
-
-
-== Related Services
-
-This service is intended (though not mandated) to be used by implementations of xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`]. The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module does use it (though the (non-ASF)
-http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] module does not).
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ExceptionRecognizer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ExceptionRecognizer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ExceptionRecognizer.adoc
deleted file mode 100644
index 200b11f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_ExceptionRecognizer.adoc
+++ /dev/null
@@ -1,119 +0,0 @@
-[[_rgsvc-spi_ExceptionRecognizer]]
-= `ExceptionRecognizer`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `ExceptionRecognizer` service provides the mechanism for both the domain programmer and also for components to be able to recognize and handle certain exceptions that may be thrown by the system. Rather than display an obscure error to the end-user, the application can instead display a user-friendly message.
-
-For example, the JDO/DataNucleus Objectstore provides a set of recognizers to recognize and handle SQL constraint exceptions such as uniqueness violations. These can then be rendered back to the user as expected errors, rather than fatal stacktraces.
-
-It is also possible to provide additional implementations, registered in `isis.properties`. Unlike other services, where any service registered in `isis.properties` replaces any default implementations, in the case of this service all implementations registered are "consulted" to see if they recognize an exception (the chain-of-responsibility pattern).
-
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface ExceptionRecognizer2 ... {
- public enum Category { // <1>
- ...
- }
- public static class Recognition { // <2>
- private Category category;
- private String reason;
- ...
- }
- @Programmatic
- public Recognition recognize2(Throwable ex); // <3>
-
- @Deprecated
- @Programmatic
- public String recognize(Throwable ex); // <4>
-
-}
-----
-<1> an enumeration of varies categories of exceptions that are recognised
-<2> represents the fact that an exception has been recognized as has been converted into a user-friendy message, and has been categorized
-<3> the main API, to attempt to recognize an exception
-<4> deprecated API which converted exceptions into strings (reasons), ie without any categorization. This is no longer called.
-
-
-The categories are:
-
-[source,java]
-----
-public interface ExceptionRecognizer2 ... {
- public enum Category {
- CONSTRAINT_VIOLATION, // <1>
- NOT_FOUND, // <2>
- CONCURRENCY, // <3>
- CLIENT_ERROR, // <4>
- SERVER_ERROR, // <5>
- OTHER // <6>
- }
- ...
-}
-
-----
-<1> a violation of some declarative constraint (eg uniqueness or referential integrity) was detected.
-<2> the object to be acted upon cannot be found (404)
-<3> a concurrency exception, in other words some other user has changed this object.
-<4> recognized, but for some other reason... 40x error
-<5> 50x error
-<6> recognized, but uncategorized (typically: a recognizer of the original `ExceptionRecognizer` API).
-
-
-In essence, if an exception is recognized then it is also categorized. This lets the viewer act accordingly. For example, if an exception is raised from the loading of an individual object, then this is passed by the registered ``ExceptionRecognizer``s. If any of these recognize the exception as representing a not-found exception, then an Apache Isis `ObjectNotFoundException` is raised. Both the viewers interprets this correctly (the xref:ugvw.adoc#[Wicket viewer] as a suitable error page, the xref:ugvro.adoc#[Restful Objects viewer] as a 404 status return code).
-
-
-If the implementation recognizes the exception then it returns a user-friendly message to be rendered (by the viewer) back to the user; otherwise it returns `null`. There is no need for the implementation to check for exception causes; the casual chain is unwrapped by Apache Isis core and each exception in the chain will also be passed through to the recognizer (from most specific to least). The recognizer implementation can therefore be as fine-grained or as coarse-grained as it wishes.
-
-
-
-
-== Implementation
-
-The framework provides two default implementations:
-
-* `o.a.i.core.metamodel.services.container.DomainObjectContainerDefault` provided by Apache Isis core is itself an `ExceptionRecognizer`, and will handle ``ConcurrencyException``s. It will also handle any application exceptions raised by the system (subclasses of `o.a.i.applib.RecoverableException`).
-
-* `o.a.i.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore` bundles up a number of more fine-grained implementations:
-** `ExceptionRecognizerForSQLIntegrityConstraintViolationUniqueOrIndexException`
-** `ExceptionRecognizerForJDOObjectNotFoundException`
-** `ExceptionRecognizerForJDODataStoreException`
-
-
-If you want to recognize and handle additional exceptions (for example to capture error messages specific to the JDBC driver you might be using), then create a fine-grained implementation of `ExceptionRecognizer2` for the particular error message (there are some convenience implementations of the interface that you can subclass from if required) and register in `isis.properties`.
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then the default
-implementations provided by the framework (`DomainObjectContainerDefault` and
-`ExceptionRecognizerCompositeForJdoObjectStore`) will be registered.
-
-In addition, you can register any further exception recognizers in `isis.properties`:
-
-[source,ini]
-----
-isis.services=...,\
- com.mycompany.myapp.MyExceptionRecognizer,\
- ...
-----
-
-[NOTE]
-====
-Prior to 1.9.0, the `ExceptionRecognizerCompositeForJdoObjectStore` also required manual registration.
-====
-
-If the JDO exception recognizers are not required (rather unlikely), then they can be disabled en-masse using the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.ExceptionRecognizerCompositeForJdoObjectStore.disable`.
-
[04/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EventBusService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EventBusService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EventBusService.adoc
new file mode 100644
index 0000000..0ae4f03
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EventBusService.adoc
@@ -0,0 +1,405 @@
+[[_rgsvc_api_EventBusService]]
+= `EventBusService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `EventBusService` allows domain objects to emit events to subscribing domain services using an in-memory event bus.
+
+The primary user of the service is the framework itself, which automatically emit events for xref:rgant.adoc#_rgant-Action_domainEvent[actions], xref:rgant.adoc#_rgant-Property_domainEvent[properties] and xref:rgant.adoc#_rgant-Collection_domainEvent[collections]. Multiple events are generated:
+
+* when an object member is to be viewed, an event is fired; subscribers can veto (meaning that the member is hidden)
+* when an object member is to be enabled, the same event instance is fired; subscribers can veto (meaning that the member is disabled, ie cannot be edited/invoked)
+* when an object member is being validated, then a new event instance is fired; subscribers can veto (meaning that the candidate values/action arguments are rejected)
+* when an object member is about to be changed, then the same event instance is fired; subscribers can perform pre-execution operations
+* when an object member has been changed, then the same event instance is fired; subscribers can perform post-execution operations
+
+If a subscriber throws an exception in the first three steps, then the interaction is vetoed. If a subscriber throws an exception in the last two steps, then the transaction is aborted. For more on this topic, see xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`], xref:rgant.adoc#_rgant-Property_domainEvent[`@Property#domainEvent()`] and xref:rgant.adoc#_rgant-Collection_domainEvent[`@Collection#domainEvent()`].
+
+It is also possible for domain objects to programmatically generate domain events. However the events are published, the primary use case is to decoupling interactions from one module/package/namespace and another.
+
+Two implementations are available, using either link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`], or alternatively using the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus]. It is also possible to plug in a custom implementation.
+
+
+
+[[_rgsvc_api_EventBusService_api-and-implementation]]
+== API & Implementation
+
+The API defined by `EventBusService` is:
+
+[source,java]
+----
+public abstract class EventBusService {
+ @Programmatic
+ public void post(Object event) { ... } // <1>
+ @Programmatic
+ public void register(final Object domainService) { ... } // <2>
+ @Programmatic
+ public void unregister(final Object domainService) { ... } // <3>
+}
+----
+<1> posts the event onto event bus
+<2> allows domain services to register themselves. This should be done in their xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] initialization method (for both singleton and xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] domain services.
+<3> exists for symmetry, but need never be called (it is in fact deliberately a no-op).
+
+Isis provides a default implementation of the service, `o.a.i.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo`.
+
+
+
+
+
+== Registering Subscribers
+
+The `register()` method should be called in the xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] lifecycle method. It is valid and probably the least confusing to readers to also "unregister" in the xref:rgant.adoc#_rgant-PreDestroy[`@PreDestroy`] lifecycle method (though as noted xref:rgsvc.adoc#_rgsvc_api_EventBusService_api-and-implementation[above], unregistering is actually a no-op).
+
+For example:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN) // <1>
+@DomainServiceLayout( menuOrder="1") // <2>
+public class MySubscribingDomainService {
+ @PostConstruct
+ public void postConstruct() {
+ eventBusService.register(this); // <3>
+ }
+ @PreDestroy
+ public void preDestroy() {
+ eventBusService.unregister(this); // <4>
+ }
+ ...
+ @javax.inject.Inject
+ EventBusService eventBusService;
+}
+----
+<1> subscribers are typically not visible in the UI, so specify a `DOMAIN` nature
+<2> It's important that subscribers register before any domain services that might emit events on the event bus service.
+For example, the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module provides a
+domain service that automatically seeds certain domain entities; these will generate
+xref:rgcms.adoc#_rgcms_classes_lifecycleevent[lifecycle events] and so any subscribers must be registered before such seed
+services. The easiest way to do this is to use the xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute.
+<3> register with the event bus service during xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`]
+ initialization
+<4> corresponding deregister when shutting down
+
+This works for both singleton (application-scoped) and also xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] domain services.
+
+
+[TIP]
+====
+The xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[`AbstractSubscriber`] class automatically performs this
+registration. As a convenience, (as of `1.11.0-SNAPSHOT`) it is also annotated with the
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute.
+====
+
+
+
+== Annotating Members
+
+As discussed in the introduction, the framework will automatically emit domain events for all of the object members (actions, properties or collections) of an object whenever that object is rendered or (more generally) interacted with.
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ @Action
+ public Customer placeOrder(Product product, @ParameterLayout(named="Quantity") int qty) { ... }
+ ...
+}
+----
+
+will propagate an instance of the default `o.a.i.applib.services.eventbus.ActionDomainEvent.Default` class. If using the Guava event bus this can be subscribed to using:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class MySubscribingDomainService
+ @Programmatic
+ @com.google.common.eventbus.Subscribe
+ public void on(ActionDomainEvent ev) { ... }
+ ...
+}
+----
+
+or if using Axonframework, the subscriber uses a different annotation:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class MySubscribingDomainService
+ @Programmatic
+ @org.axonframework.eventhandling.annotation.EventHandle
+ public void on(ActionDomainEvent ev) { ... }
+ ...
+}
+----
+
+More commonly though you will probably want to emit domain events of a specific subtype. As a slightly more interesting example, suppose in a library domain that a `LibraryMember` wants to leave the library. A letter should be sent out detailing any books that they still have out on loan:
+
+In the `LibraryMember` class, we publish the event by way of an annotation:
+
+[source,java]
+----
+public class LibraryMember {
+ @Action(domainEvent=LibraryMemberLeaveEvent.class) // <1>
+ public void leave() { ... }
+ ...
+}
+----
+<1> `LibraryMemberLeaveEvent` is a subclass of `o.a.i.applib.eventbus.ActionDomainEvent`. The topic of subclassing is discussed in more detail xref:rgsvc.adoc#_rgsvc_api_EventBusService_event-hierarchy[below].
+
+Meanwhile, in the `BookRepository` domain service, we subscribe to the event and act upon it. For example:
+
+[source,java]
+----
+public class BookRepository {
+ @Programmatic
+ @com.google.common.eventbus.Subscribe
+ public void onLibraryMemberLeaving(LibraryMemberLeaveEvent e) {
+ LibraryMember lm = e.getLibraryMember();
+ List<Book> lentBooks = findBooksOnLoanFor(lm);
+ if(!lentBooks.isEmpty()) {
+ sendLetter(lm, lentBooks);
+ }
+ }
+ ...
+}
+----
+
+This design allows the `libraryMember` module to be decoupled from the `book` module.
+
+
+
+[[_rgsvc_api_EventBusService_event-hierarchy]]
+== Event hierarchy
+
+By creating domain event subtypes we can be more semantically precise and in turn providesmore flexibility for subscribers: they can choose whether to be broadly applicable (by subscribing to a superclass) or to be tightly focussed (by subscribing to a subclass).
+
+We recommend that you define event classes at (up to) four scopes:
+
+* at the top "global" scope is the Apache Isis-defined `o.a.i.applib.event.ActionDomainEvent`
+* for the "module" scope, create a static class to represent the module itself, and creating nested classes within
+* for each "class" scope, create a nested static event class in the domain object's class for all of the domain object's actions
+* for each "action" scope, create a nested static event class for that action, inheriting from the "domain object" class.
+
+To put all that into code; at the module level we can define:
+
+[source,java]
+----
+package com.mycompany.modules.libmem;
+...
+public static class LibMemModule {
+ private LibMemModule() {}
+ public abstract static class ActionDomainEvent<S>
+ extends org.apache.isis.applib.event.ActionDomainEvent<S> {}
+ ... // <1>
+ public abstract static class PropertyDomainEvent<S,T>
+ extends org.apache.isis.applib.event.PropertyDomainEvent<S,T> {}
+ public abstract static class CollectionDomainEvent<S,E>
+ extends org.apache.isis.applib.event.CollectionDomainEvent<S,E> {}
+}
+----
+<1> similar events for properties and collections should also be defined
+
+For the class-level we can define:
+
+[source,java]
+----
+public static class LibraryMember {
+ public abstract static class ActionDomainEvent
+ extends LibMemModule.ActionDomainEvent<LibraryMember> { }
+ ... // <1>
+}
+----
+<1> similar events for properties and collections should also be defined
+
+and finally at the action level we can define:
+
+[source,java]
+----
+public class LibraryMember {
+ public static class LeaveEvent extends LibraryMember.ActionDomainEvent { }
+ @Action(domainEvent=LeaveEvent.class)
+ public void leave() { ... }
+ ...
+}
+----
+
+The subscriber can subscribe either to the general superclass (as before), or to any of the classes in the hierarchy.
+
+
+=== Variation (for contributing services)
+
+A slight variation on this is to not fix the generic parameter at the class level, ie:
+
+[source,java]
+----
+public static class LibraryMember {
+ public abstract static class ActionDomainEvent<S>
+ extends LibMemModule.ActionDomainEvent<S> { }
+ ...
+}
+----
+
+and instead parameterize down at the action level:
+
+[source,java]
+----
+public class LibraryMember {
+ public static class LeaveEvent
+ extends LibraryMember.ActionDomainEvent<LibraryMember> { } // <1>
+ }
+ @Action(domainEvent=LeaveEvent.class)
+ public void leave() { ... }
+ ...
+}
+----
+
+This then allows for other classes - in particular domain services contributing members - to also inherit from the class-level domain events.
+
+
+
+
+== Programmatic posting
+
+To programmatically post an event, simply call `#post()`.
+
+The `LibraryMember` example described above could for example be rewritten into:
+
+[source,java]
+----
+public class LibraryMember {
+ ...
+ public void leave() {
+ ...
+ eventBusService.post(new LibraryMember.LeaveEvent(...)); // <1>
+ }
+ ...
+}
+----
+<1> `LibraryMember.LeaveEvent` could be _any_ class, not just a subclass of `o.a.i.applib.event.ActionDomainEvent`.
+
+In practice we suspect there will be few cases where the programmatic approach is required rather than the declarative approach afforded by xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`] et al.
+
+
+
+== Using `WrapperFactory`
+
+An alternative way to cause events to be posted is through the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`]. This is useful when you wish to enforce a (lack-of-) trust boundary between the caller and the callee.
+
+For example, suppose that `Customer#placeOrder(...)` emits a `PlaceOrderEvent`, which is subscribed to by a `ReserveStockSubscriber`. This subscriber in turn calls `StockManagementService#reserveStock(...)`. Any business rules on `#reserveStock(...)` should be enforced.
+
+In the `ReserveStockSubscriber`, we therefore use the `WrapperFactory`:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class ReserveStockSubscriber {
+ @Programmatic
+ @Subscribe
+ public void on(Customer.PlaceOrderEvent ev) {
+ wrapperFactory.wrap(stockManagementService)
+ .reserveStock(ev.getProduct(), ev.getQuantity());
+ }
+ ...
+ @Inject
+ StockManagementService stockManagementService;
+ @Inject
+ WrapperFactory wrapperFactory;
+}
+----
+
+
+== Implementation SPI
+
+The implementation of `EventBusService` provided by Apache Isis will by default use link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`] as the underlying in-memory event bus. Alternatively the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus] can be used. Which is used is specified through configuration property (described xref:rgsvc.adoc#_rgsvc_api_EventBusService_Configuration[below]).
+
+[NOTE]
+.Guava vs Axon, which to use?
+====
+Guava actually queues up events; they are not guaranteed to be dispatched immediately. This generally is not problem, but can be for cases where the subscriber may in turn want to post its own events (using xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`]).
+
+The Axon `SimpleEventBus`-based implementation on the other hand is fully synchronous; events are dispatched as soon as they are posted. This works well in all scenarios (that we have tested).
+====
+
+
+It is also possible to use some other implementation.
+
+[source,java]
+----
+public interface EventBusImplementation {
+ void register(Object domainService);
+ void unregister(Object domainService);
+ void post(Object event);
+}
+----
+
+As is probably obvious, the `EventBusService` just delegates down to these method calls when its own similarly named methods are called.
+
+If you do provide your own implementation of this SPI, be aware that your subscribers will need to use whatever convention is required (eg different annotations) such that the events are correctly routed through to your subscribers.
+
+
+
+[[_rgsvc_api_EventBusService_Configuration]]
+== Configuration
+
+The implementation of `EventBusService` provided by Apache Isis will by default use link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`] as the underlying in-memory event bus. Alternatively the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus] can be used.
+
+To specify which, add the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.eventbus.implementation`:
+
+[source,ini]
+----
+isis.services.eventbus.implementation=guava
+----
+
+or
+
+[source,ini]
+----
+isis.services.eventbus.implementation=axon
+----
+
+If you have written your own implementation of the `EventBusServiceImplementation` SPI, then specify instead its fully-qualified class name:
+
+[source,ini]
+----
+isis.services.eventbus.implementation=com.mycompany.isis.MyEventBusServiceImplementation
+----
+
+
+
+In addition, there is one further configuration property, whether to allow "late registration":
+
+[source,ini]
+----
+isis.services.eventbus.allowLateRegistration=false
+----
+
+Late registration refers to the idea that a domain service can register itself with the `EventBusService` after events have been posted. Since domain services are set up at boot time, this almost certainly constitutes a bug in the code and so by default late registration is _not_ allowed. Setting the above property to `true` disables this check.
+
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `EventBusService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+== Related Services
+
+The `EventBusService` is intended for fine-grained publish/subscribe for object-to-object interactions within an Apache Isis domain object model. The event propagation is strictly in-memory, and there are no restrictions on the object acting as the event (it need not be serializable, for example).
+
+The xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`] meanwhile is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations (for actions annotated with xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`]) and of changed objects (for objects annotated with xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`]).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_FixtureScriptsDefault.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_FixtureScriptsDefault.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_FixtureScriptsDefault.adoc
new file mode 100644
index 0000000..166658b
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_FixtureScriptsDefault.adoc
@@ -0,0 +1,50 @@
+[[_rgsvc_api_FixtureScriptsDefault]]
+= `FixtureScriptsDefault`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `FixtureScriptsDefault` service provides the ability to execute xref:ugtst.adoc#_ugtst_fixture-scripts_api-and-usage[fixture scripts] .
+
+The service extends from the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`], and is only instantiated by the framework if there no custom implementation of `FixtureScripts` has been otherwise provided; in other words it is a fallback.
+
+If this service is instantiated (as a fallback) then it uses the xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] to obtain a `FixtureScriptsSpecification`. This configures this service, telling it which package to search for `FixtureScript` classes, how to execute those classes, and hints that influence the UI.
+
+[TIP]
+====
+We recommend using xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] rather than subclassing xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`].
+====
+
+
+
+== API & Implementation
+
+The API for the service is:
+
+[source,java]
+----
+public class FixtureScriptsDefault ... {
+ @Programmatic
+ public List<FixtureResult> runFixtureScript(
+ FixtureScript fixtureScript,
+ String parameters) { ... }
+}
+----
+
+... in other words the same as xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] superclass that it inherits from.
+
+
+== Configuration
+
+As noted in the introduction, this service is only instantiated if there is no other implementation of `FixtureScripts` available on the classpath.
+
+If an instance of `FixtureScriptsSpecificationProvider` is available on the classpath, then the service will be visible in the UI (assuming xref:rgcfg.adoc#_rgcfg_deployment-types[prototype mode]). Otherwise the service will be available only to be injected and invoked programmatically.
+
+
+
+
+== Related Services
+
+The service interacts with xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`].
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_GuiceBeanProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_GuiceBeanProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_GuiceBeanProvider.adoc
new file mode 100644
index 0000000..d0e1dd3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_GuiceBeanProvider.adoc
@@ -0,0 +1,91 @@
+[[_rgsvc_api_GuiceBeanProvider]]
+= `GuiceBeanProvider`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `GuiceBeanProvider` domain service acts as a bridge between Apache Isis' xref:ugvw.adoc#[Wicket viewer] internal bootstrapping using link:https://github.com/google/guice[Google Guice].
+
+This service operates at a very low-level, and you are unlikely to have a need for it. It is used internally by the framework, in the default implementation of the xref:rgsvc.adoc#_rgsvc_api_DeepLinkService[`DeepLinkService`].
+
+[NOTE]
+====
+Currently Apache Isis uses a combination of Guice (within the Wicket viewer only) and a home-grown dependency injection framework. In future versions we intended to refactor the framework to use CDI throughout. At that time this service is likely to become redundant because we will allow any of the internal components of Apache Isis to be injected into your domain object code.
+====
+
+
+== API & Implementation
+
+The API defined by this service is:
+
+[source,java]
+----
+public interface GuiceBeanProvider {
+ @Programmatic
+ <T> T lookup(Class<T> beanType);
+ @Programmatic
+ <T> T lookup(Class<T> beanType, final Annotation qualifier);
+}
+----
+
+The xref:ugvw.adoc#[Wicket viewer] this provides an implementation of this service.
+
+
+
+== Usage
+
+Using the xref:ugvw.adoc#[Wicket viewer] requires subclassing of `IsisWicketApplication`. In the subclass it is commonplace to override `newIsisWicketModule()`, for example:
+
+[source,java]
+----
+@Override
+protected Module newIsisWicketModule() {
+ final Module isisDefaults = super.newIsisWicketModule();
+ final Module overrides = new AbstractModule() {
+ @Override
+ protected void configure() {
+ bind(String.class).annotatedWith(Names.named("applicationName"))
+ .toInstance("ToDo App");
+ bind(String.class).annotatedWith(Names.named("applicationCss"))
+ .toInstance("css/application.css");
+ bind(String.class).annotatedWith(Names.named("applicationJs"))
+ .toInstance("scripts/application.js");
+ ...
+ }
+ };
+ return Modules.override(isisDefaults).with(overrides);
+}
+----
+
+This "module" is in fact a Guice module, and so the `GuiceBeanProvider` service can be used to lookup any of the components bound into it.
+
+For example:
+
+[source,java]
+----
+public class SomeDomainObject {
+ private String lookupApplicationName() {
+ return guiceBeanProvider.lookup(String.class, Names.named("applicationName"));
+ }
+ @Inject
+ GuiceBeanProvider guiceBeanProvider;
+}
+----
+
+should return "ToDo App".
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
+xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `GuiceBeanProvider` is
+automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_IsisJdoSupport.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_IsisJdoSupport.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_IsisJdoSupport.adoc
new file mode 100644
index 0000000..7da94c2
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_IsisJdoSupport.adoc
@@ -0,0 +1,276 @@
+[[_rgsvc_api_IsisJdoSupport]]
+= `IsisJdoSupport`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `IsisJdoSupport` service provides a number of general purpose methods for working with the JDO/DataNucleus objectstore. In general these act at a lower-level of abstraction than the APIs normally used (specifically, those of xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]), but nevertheless deal with some of the most common use cases. For service also provides access to the underlying JDO `PersistenceManager` for full control.
+
+The following sections discuss the functionality provided by the service, broken out into categories.
+
+
+
+
+[[_rgsvc_api_IsisJdoSupport_executing-sql]]
+== Executing SQL
+
+You can use the `IsisJdoSupportService` to perform arbitrary SQL SELECTs or UPDATEs:
+
+[source,java]
+----
+public interface IsisJdoSupport {
+ @Programmatic
+ List<Map<String, Object>> executeSql(String sql);
+ @Programmatic
+ Integer executeUpdate(String sql);
+ ...
+}
+----
+
+
+The `executeSql(...)` method allows arbitrary SQL `SELECT` queries to be submitted:
+
+[source,java]
+----
+List<Map<String, Object>> results = isisJdoSupport.executeSql("select * from custMgmt.customers");
+----
+
+The result set is automatically converted into a list of maps, where the map key is the column name.
+
+
+In a similar manner, the `executeUpdate(...)` allows arbitrary SQL ``UPDATE``s to be performed.
+
+[source,java]
+----
+int count = isisJdoSupport.executeUpdate("select count(*) from custMgmt.customers);
+----
+
+The returned value is the number of rows updated.
+
+[TIP]
+====
+As an alternative, consider using DataNucleus' link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[type-safe JDO query API], discussed xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport_type-safe-query-api[below].
+====
+
+
+
+
+[[_rgsvc_api_IsisJdoSupport_type-safe-jdoql-queries]]
+== Type-safe JDOQL Queries
+
+DataNucleus provides an link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[extension to JDO], so that JDOQL queries can be built up and executed using a set of type-safe classes.
+
+The types in question for type safe queries are not the domain entities, but rather are companion "Q..." query classes. These classes are generated dynamically by an link:https://www.jcp.org/en/jsr/detail?id=269[annotation processor] as a side-effect of compilation, one "Q..." class for each of the xref:rgant.adoc#_rgant-PersistenceCapable[`@PersistenceCapable`] domain entity in your application. For example, a `ToDoItem` domain entity will give rise to a `QToDoItem` query class. These "Q..." classes mirror the structure of domain entity, but expose properties that allow predicates to be built up for querying instances, as well as other functions in support of order by. group by and other clauses.
+
+[NOTE]
+====
+Most IDEs (including IntelliJ and Eclipse) enable annotation processing by default, as does Maven. The DataNucleus' link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[documentation] offers some guidance on confirming that APT is enabled.
+====
+
+The `IsisJdoSupport` service offers two methods at different levels of abstraction:
+
+[source,java]
+----
+public interface IsisJdoSupport {
+ @Programmatic
+ <T> List<T> executeQuery(final Class<T> cls, final BooleanExpression be);
+ @Programmatic
+ <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls);
+ ...
+}
+----
+
+
+The `executeQuery(...)` method supports the common case of obtaining a set of objects that meet some criteria, filtered using the provided `BooleanExpression`. To avoid memory leaks, the returned list is cloned and the underlying query closed.
+
+For example, in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] there is an implementation of `ToDoItemRepository` using type-safe queries. The following JDOQL:
+
+[source,sql]
+----
+SELECT
+FROM todoapp.dom.module.todoitem.ToDoItem
+WHERE atPath.indexOf(:atPath) == 0
+ && complete == :complete")
+----
+
+can be expressed using type-safe queries as follows:
+
+[source,java]
+----
+public List<ToDoItem> findByAtPathAndCategory(final String atPath, final Category category) {
+ final QToDoItem q = QToDoItem.candidate();
+ return isisJdoSupport.executeQuery(ToDoItem.class,
+ q.atPath.eq(atPath).and(
+ q.category.eq(category)));
+}
+----
+
+[NOTE]
+====
+You can find the full example of the JDOQL equivalent in the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_generic-repository-api[`DomainObjectContainer`]
+====
+
+
+The `newTypesafeQuery(...)` method is a lower-level API that allows a type safe query to be instantiated for most sophisticated querying, eg using group by or order by clauses. See the
+DataNucleus link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[documentation] for full details of using this.
+
+One thing to be aware of is that after the query has been executed, it should be closed, using `query.closeAll()`. If calling `query.executeList()` we also recommend cloning the resultant list first. The following utility method does both of these tasks:
+
+[source,java]
+----
+private static <T> List<T> executeListAndClose(final TypesafeQuery<T> query) {
+ final List<T> elements = query.executeList();
+ final List<T> list = Lists.newArrayList(elements);
+ query.closeAll();
+ return list;
+}
+----
+
+
+
+[[_rgsvc_api_IsisJdoSupport_fixture-support]]
+== Fixture support
+
+When writing xref:ugtst.adoc#_ugtst_integ-test-support[integration tests] you'll usually need to tear down some/all mutable transactional data before each test. One way to do that is to use the `executeUpdate(...)` method described xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport_executing-sql[above].
+
+Alternatively, the `deleteAll(...)` method will let your test delete all instances of a class without resorting to SQL:
+
+[source,java]
+----
+public interface IsisJdoSupport {
+ @Programmatic
+ void deleteAll(Class<?>... pcClasses);
+ ...
+}
+----
+
+For example:
+
+[source,java]
+----
+public class TearDownAll extends FixtureScriptAbstract {
+ @Override
+ protected void execute(final ExecutionContext ec) {
+ isisJdoSupport.deleteAll(Order.class);
+ isisJdoSupport.deleteAll(CustomerAddress.class);
+ isisJdoSupport.deleteAll(Customer.class);
+ }
+ @Inject
+ IsisJdoSupport isisJdoSupport;
+}
+----
+
+[NOTE]
+====
+It can occasionally be the case that Apache Isis' internal adapter for the domain object is
+still in memory. JDO/DataNucleus seems to bump up the version of the object prior to its deletion,
+which under normal circumstances would cause Apache Isis to throw a concurrency exception. Therefore
+to prevent this from happening (ie to _force_ the deletion of all instances), concurrency checking
+is temporarily disabled while this method is performed.
+====
+
+
+
+
+[[_rgsvc_api_IsisJdoSupport_reloading-entities]]
+== Reloading entities
+
+An http://www.datanucleus.org/products/datanucleus/jdo/orm/relationships.html[(intentional) limitation] of JDO/DataNucleus is that persisting a child entity (in a 1:n bidirectional relationship) does not cause the parent's collection to be updated.
+
+[source,java]
+----
+public interface IsisJdoSupport {
+ @Programmatic
+ <T> T refresh(T domainObject);
+ @Programmatic
+ void ensureLoaded(Collection<?> collectionOfDomainObjects);
+ ...
+}
+----
+
+
+
+The `refresh(T domainObject)` method can be used to reload the parent object (or indeed any object). Under the covers it uses the JDO `PersistenceManager#refresh(...)` API.
+
+
+For example:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class OrderContributions {
+ public Order newOrder(final Customer customer) {
+ Order order = newTransientInstance(Order.class);
+ order.setCustomer(customer);
+ container.persist(customer);
+ container.flush(); // <1>
+ isisJdoSupport.refresh(customer); // <2>
+ return order;
+ }
+ @Inject
+ DomainObjectContainer container;
+ @Inject
+ IsisJdoSupport isisJdoSupport;
+}
+----
+<1> flush to database, ensuring that the database row corresponding to the `Order` exists in its `order` table.
+<2> reload the parent (customer) from the database, so that its collection of ``Order``s is accurate.
+
+
+[NOTE]
+====
+The particular example that led to this method being added was a 1:m bidirectional relationship,
+analogous to `Customer 1<-->* Order`. Persisting the child `Order` object did not cause
+the parent ``Customer``'s collection of orders to be updated. In fact, JDO does not make any
+such guarantee to do so. Options are therefore either to maintain the collection in code, or to
+refresh the parent.
+====
+
+
+The `ensureLoaded(...)` method allows a collection of domain objects to be loaded from the database in a single hit. This can be valuable as a performance optimization to avoid multiple roundtrips to the database. Under the covers it uses the `PersistenceManager#retrieveAll(...)` API.
+
+
+
+
+
+[[_rgsvc_api_IsisJdoSupport_jdo-persistencemanager]]
+== JDO `PersistenceManager`
+
+The functionality provided by `IsisJdoSupport` focus only on the most common use cases. If you require more flexibility than this, eg for dynamically constructed queries, then you can use the service to access the underlying JDO `PersistenceManager` API:
+
+[source,java]
+----
+public interface IsisJdoSupport {
+ @Programmatic
+ PersistenceManager getJdoPersistenceManager();
+ ...
+}
+----
+
+For example:
+
+[source,java]
+----
+public List<Order> findOrders(...) {
+ javax.jdo.PersistenceManager pm = isisJdoSupport.getPersistenceManager();
+
+ // knock yourself out...
+
+ return someListOfOrders;
+}
+----
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `IsisJdoSupport` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_JaxbService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_JaxbService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_JaxbService.adoc
new file mode 100644
index 0000000..b0ccc25
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_JaxbService.adoc
@@ -0,0 +1,68 @@
+[[_rgsvc_api_JaxbService]]
+= `JaxbService` (`1.11.0-SNAPSHOT`)
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `JaxbService` (`1.11.0-SNAPSHOT`) allows instances of JAXB-annotated classes to be marshalled to XML and
+unmarshalled from XML back into domain objects.
+
+
+
+
+
+[[_rgsvc_api_JaxbService_api-and-implementation]]
+== API & Implementation
+
+The API defined by `JaxbService` is:
+
+[source,java]
+----
+public interface JaxbService {
+ @Programmatic
+ <T> T fromXml(Class<T> domainClass, String xml); // <1>
+ @Programmatic
+ public String toXml(final Object domainObject); // <2>
+ public enum IsisSchemas { // <3>
+ INCLUDE, IGNORE
+ }
+ @Programmatic
+ public Map<String, String> toXsd(final Object domainObject, final IsisSchemas isSchemas);} // <4>
+}
+----
+<1> unmarshalls the XML into an instance of the class.
+<2> marshalls the domain object into XML
+<3> whether to include or exclude the Isis schemas in the generated map of XSDs. Discussed further below.
+<4> generates a map of each of the schemas referenced; the key is the schema namespace, the value is the XML of the schema itself.
+
+With respect to the `IsisSchemas` enum: a JAXB-annotated domain object will live in its own XSD namespace and may
+reference multiple other XSD schemas. In particular, many JAXB domain objects will reference the
+xref:rgcms.adoc#_rgcms_schema[common Isis schemas] (for example the `OidDto` class that represents a reference to
+a persistent entity). The enum indicates whether these schemas should be included or excluded from the map.
+
+Isis provides a default implementation of the service, `o.a.i.schema.services.jaxb.JaxbServiceDefault`.
+
+
+
+== Usage within the framework
+
+This service is provided as a convenience for applications, but is also used internally by the framework to
+xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]-annotated
+xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view models]. The functionality to download XML and XSD schemas is also
+exposed in the UI through mixins to xref:rgcms.adoc#_rgcms_classes_roles_Dto[`Dto`] interface.
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `JaxbService` service is automatically registered and injected (it is annotated with `@DomainService`)
+so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MementoService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MementoService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MementoService.adoc
new file mode 100644
index 0000000..cd43c46
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MementoService.adoc
@@ -0,0 +1,131 @@
+[[_rgsvc_api_MementoService]]
+= `MementoService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `MementoService` was originally introduced to simplify the implementation of xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[ViewModel]s which are required by the framework to return string representation of all of their backing state, moreover which is safe for use within a URL.
+
+However, it can also be used to create a memento of arbitrary objects. Indeed, it is used internally by the core implementation of xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] to capture the state of action invocations so that they can be executed by a background process.
+
+
+
+
+== API & Implementation
+
+The API defined by `MementoService` is:
+
+[source,java]
+----
+public interface MementoService {
+ public static interface Memento {
+ @Programmatic
+ public Memento set(String name, Object value);
+ @Programmatic
+ public <T> T get(String name, Class<T> cls);
+ @Programmatic
+ public String asString();
+ public Set<String> keySet();
+ }
+ @Programmatic
+ public Memento create();
+ @Programmatic
+ public Memento parse(final String str);
+ @Programmatic
+ public boolean canSet(Object input);
+}
+----
+
+The core framework provides a default implementation of this API, namely `o.a.i.core.runtime.services.memento.MementoServiceDefault`. The string returned (from `Memento#asString()`) is a base-64 URL encoded representation of the underlying format (an XML string).
+
+[NOTE]
+====
+In fact, the `MementoServiceDefault` implementation does provide a mechanism to disable the URL encoding, but this is not part of the `MementoService` public API. Note also that the encoding method is not pluggable.
+
+However, you are of course free to write some other implementation of `MementoService`, perhaps based on `MementoServiceDefault` code if you wish.
+====
+
+The types of objects that are supported by the `MementoService` are implementation-specific, but would typically include all the usual value types as well as Apache Isis' `Bookmark` class (to represent references to arbitrary entities). Nulls can also be set.
+
+In the case of the default implementation provided by the core framework, the types supported are:
+
+* `java.lang.String`
+* `java.lang.Boolean`, `boolean`
+* `java.lang.Byte`, `byte`
+* `java.lang.Short`, `short`
+* `java.lang.Integer`, `int`
+* `java.lang.Long`, `long`
+* `java.lang.Float`, `float`
+* `java.lang.Double`, `double`
+* `java.lang.Character`, `char`
+* `java.math.BigDecimal`
+* `java.math.BigInteger`
+* `org.joda.time.LocalDate`
+* `org.apache.isis.applib.services.bookmark.Bookmark`
+
+If using another implementation, the `canSet(...)` method can be used to check if the candidate object's type is supported.
+
+
+
+== Usage
+
+As noted in the introduction, a common use case for this service is in the implementation of the xref:rgcms.adoc#_rgcms_classes_super_AbstractViewModel[`ViewModel`] interface.
+
+[TIP]
+====
+Rather than implementing `ViewModel`, it's usually easier to annotate your view models with xref:rgant.adoc#_rgant-ViewModel[`@ViewModel`] (or equivalently xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=EXTERNAL_ENTITY`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=INMEMORY_ENTITY`].
+====
+
+For example, suppose you were implementing a view model that represents an external entity in a SOAP web service. To access this service the view model needs to store (say) the hostname, port number and an id to the object.
+
+Using an injected `MementoService` the view model can roundtrip to and from this string, thus implementing the `ViewModel` API:
+
+[source,java]
+----
+public class ExternalEntity implements ViewModel {
+ private String hostname;
+ private int port;
+ private String id;
+ public String viewModelMemento() { // <1>
+ return mementoService.create()
+ .set("hostname", hostname)
+ .set("port", port)
+ .set("id", id)
+ .asString();
+ }
+ public void viewModelInit(String mementoStr) { // <2>
+ Memento memento = mementoService.parse(mementoStr);
+ hostname = memento.get("hostname", String.class);
+ port = memento.get("port", int.class);
+ id = memento.get("id", String.class);
+ ...
+ @Inject
+ MementoService mementoService;
+}
+----
+<1> part of the `ViewModel` API
+<2> part of the `ViewModel` API
+
+
+
+
+
+== Related Services
+
+The memento service is used by the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service and also xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]. These both use a memento to capture a representation of an action invocation.
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `MementoService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MetamodelService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MetamodelService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MetamodelService.adoc
new file mode 100644
index 0000000..ea6d9de
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_MetamodelService.adoc
@@ -0,0 +1,42 @@
+[[_rgsvc_api_MetamodelService]]
+= `MetamodelService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `MetaModelService` provides access (albeit currently extremely limited) to aspects of Apache Isis' internal metamodel.
+
+Currently this is limited to looking up the object type (as specified in xref:rgant.adoc#_rgant-DomainObject_objectType[`@DomainObject#objectType()`] and equivalent mechanisms, and as used in xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`Bookmark`]s and elsewhere) from an object's class, and vice versa. In the future we expect other aspects of the metamodel to also be formally surfaced through this API.
+
+
+== API & Implementation
+
+The API defined by the service is:
+
+[source,java]
+----
+public interface MetaModelService {
+ @Programmatic
+ Class<?> fromObjectType(final String objectType); // <1>
+ @Programmatic
+ String toObjectType(final Class<?> domainType); // <2>
+}
+----
+<1> reverse lookup of a domain class' object type
+<2> lookup of a domain class' object type
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `MetamodelService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_QueryResultsCache.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_QueryResultsCache.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_QueryResultsCache.adoc
new file mode 100644
index 0000000..bbbbb18
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_QueryResultsCache.adoc
@@ -0,0 +1,126 @@
+[[_rgsvc_api_QueryResultsCache]]
+= `QueryResultsCache`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The purpose of the `QueryResultsCache` is to improve response times to the user, by providing a short-term (link:../../more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html[request-scoped]) cache of the value of some (safe or idempotent) method call. This will typically be as the result of running a query, but could be any expensive operation.
+
+Caching such values is useful for code that loops "naively" through a bunch of stuff, performing an expensive operation each time. If the data is such that the same expensive operation is made many times, then the query cache is a perfect fit.
+
+
+[NOTE]
+====
+This service was inspired by similar functionality that exists in relational databases, for example Sybase's http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20023_1251/html/optimizer/X43480.htm[subquery results cache] and Oracle's http://www.dba-oracle.com/oracle11g/oracle_11g_result_cache_sql_hint.htm[result_cache] hint.
+====
+
+
+
+== API & Implementation
+
+The API defined by `QueryResultsCache` is:
+
+[source,java]
+----
+@RequestScoped
+public class QueryResultsCache {
+ public static class Key {
+ public Key(Class<?> callingClass, String methodName, Object... keys) {...}
+ public Class<?> getCallingClass() { ... }
+ public String getMethodName() { ... }
+ public Object[] getKeys() { ... }
+ }
+ public static class Value<T> {
+ public Value(T result) { ... }
+ private T result;
+ public T getResult() {
+ return result;
+ }
+ }
+ @Programmatic
+ public <T> T execute(
+ final Callable<T> callable,
+ final Class<?> callingClass, final String methodName, final Object... keys) { ... }
+ @Programmatic
+ public <T> T execute(final Callable<T> callable, final Key cacheKey) { ... }
+ @Programmatic
+ public <T> Value<T> get(
+ final Class<?> callingClass, final String methodName, final Object... keys) { ... }
+ @Programmatic
+ public <T> Value<T> get(final Key cacheKey) { ... }
+ @Programmatic
+ public <T> void put(final Key cacheKey, final T result) { ... }
+}
+----
+
+This class (`o.a.i.applib.services.queryresultscache.QueryResultsCache`) is also the implementation.
+
+
+
+
+== Usage
+
+Suppose that there's a `TaxService` that calculates tax on `Taxable` items, with respect to some `TaxType`, and for a given `LocalDate`. To calculate tax it must run a database query and then perform some additional calculations.
+
+Our original implementation is:
+
+[source,java]
+----
+@DomainService
+public class TaxService {
+ public BigDecimal calculateTax(
+ final Taxable t, final TaxType tt, final LocalDate d) {
+ // query against DB using t, tt, d
+ // further expensive calculations
+ }
+}
+----
+
+Suppose now that this service is called in a loop, for example iterating over a bunch of orders, where several of those orders are for the same taxable products, say. In this case the result of the calculation would always be the same for any given product.
+
+We can therefore refactor the method to use the query cache as follows:
+
+[source,java]
+----
+public class TaxService {
+ public BigDecimal calculateTax(
+ final Taxable t, final TaxType tt, final LocalDate d) {
+ return queryResultsCache.execute(
+ new Callable<BigDecimal>(){ // <1>
+ public BigDecimal call() throws Exception {
+ // query against DB using t, tt, d
+ // further expensive calculations
+ }
+ },
+ TaxService.class, // <2>
+ "calculateTax",
+ t, tt, d);
+ }
+}
+----
+<1> the `Callable` is the original code
+<2> the remaining parameters in essence uniquely identify the method call.
+
+This refactoring will be worthwhile provided that enough of the orders being processed reference the same taxable products. If however every order is for a different product, then no benefit will be gained from the refactoring.
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `QueryResultsCache` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+== Related Services
+
+The xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`] service is also intended for actions that are called many times, allowing arbitrary information to be shared between them. Those methods could be called from some outer loop in domain code, or by the framework itself if the action invoked has the xref:rgant.adoc#_rgant-Action_invokeOn[`@Action#invokeOn()`] annotation attribute set to `OBJECT_AND_COLLECTION` or `COLLECTION_ONLY`.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_Scratchpad.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_Scratchpad.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_Scratchpad.adoc
new file mode 100644
index 0000000..e5c2f71
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_Scratchpad.adoc
@@ -0,0 +1,128 @@
+[[_rgsvc_api_Scratchpad]]
+= `Scratchpad`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `Scratchpad` service is a link:../../more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html[request-scoped] service to allow objects to exchange information even if they do not directly call each other.
+
+
+
+
+== API & Implementation
+
+The API of `Scratchpad` service is:
+
+[source,java]
+----
+@RequestScoped
+public class Scratchpad {
+ @Programmatic
+ public Object get(Object key) { ... }
+ @Programmatic
+ public void put(Object key, Object value) { ... }
+ @Programmatic
+ public void clear() { ... }
+}
+----
+
+This class (`o.a.i.applib.services.scratchpad.Scratchpad`) is also the implementation. And, as you can see, the service is just a request-scoped wrapper around a `java.util.Map`.
+
+
+
+
+
+== Usage
+
+The most common use-case is for xref:rgant.adoc#_rgant-Action_invokeOn[bulk] actions that act upon multiple objects in a list. The (same) `Scratchpad` service is injected into each of these objects, and so they can use pass information.
+
+For example, the Isis addons example https://github.com/isisaddons/isis-app-todoapp/[todoapp] (not ASF) demonstrates how the `Scratchpad` service can be used to calculate the total cost of the selected `ToDoItem`s:
+
+
+[source,java]
+----
+@Action(
+ semantics=SemanticsOf.SAFE,
+ invokeOn=InvokeOn.COLLECTION_ONLY
+)
+public BigDecimal totalCost() {
+ BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
+ if(getCost() != null) {
+ total = total != null ? total.add(getCost()) : getCost();
+ scratchpad.put("runningTotal", total);
+ }
+ return total.setScale(2);
+}
+@Inject
+Scratchpad scratchpad;
+----
+
+A more complex example could use a xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model] to enable bulk updates to a set of objects. The view model's job is to gather track of the items to be updated:
+
+[source,java]
+----
+public class ToDoItemUpdateBulkUpdate extends AbstractViewModel {
+ private List<ToDoItem> _items = ...;
+ public ToDoItemBulkUpdate add(ToDoItem item) {
+ _items.add(item);
+ return this;
+ }
+ ... // <1>
+}
+----
+<1> not shown - the implementation of `ViewModel` for converting the list of `_items` into a string.
+
+The bulk action in the objects simply adds the selected item to the view model:
+
+[source,java]
+----
+@Action(
+ invokeOn=InvokeOn.COLLECTIONS_ONLY
+ semantics=SemanticsOf.SAFE
+)
+public ToDoItemBulkUpdate bulkUpdate() {
+ return lookupBulkUpdateViewModel().add(this);
+}
+private ToDoItemBulkUpdate lookupBulkUpdateViewModel() {
+ ToDoItemBulkUpdate bulkUpdate =
+ (ToDoItemBulkUpdate) scratchpad.get("bulkUpdateViewModel"); // <1>
+ if(bulkUpdate == null) {
+ bulkUpdate = container.injectServicesInto(new ToDoItemBulkUpdate());
+ scratchpad.put("bulkUpdateViewModel", bulkUpdate); // <2>
+ }
+ return bulkUpdate;
+}
+@Inject
+Scratchpad scratchpad;
+----
+<1> look for the `ToDoItemBulkUpdate` in the scratchpad...
+<2> ... and add one if there isn't one (ie for the first object returned).
+
+If using the xref:ugvw.adoc#[Wicket viewer], the `ToDoItemBulkUpdate` view model returned from the last action invoked will be displayed. Thereafter this view model can be used to perform a bulk update of the "enlisted" items.
+
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `Scratchpad` service is automatically registered and injected (it is annotated with `@DomainService`)
+so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+
+== Related Services
+
+The xref:rgsvc.adoc#_rgsvc_api_ActionInteractionContext[`ActionInteractionContext`] service allows xref:rgant.adoc#_rgant-Action_invokeOn[bulk actions] to co-ordinate with each other.
+
+The xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`QueryResultsCache`] is useful for caching the results of expensive method calls.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SudoService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SudoService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SudoService.adoc
new file mode 100644
index 0000000..a59d552
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SudoService.adoc
@@ -0,0 +1,69 @@
+[[_rgsvc_api_SudoService]]
+= `SudoService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `SudoService` allows the current user reported by the `DomainObjectContainer` to be temporarily changed to some
+other user. This is useful both for xref:ugtst.adoc#_ugtst_integ-test-support[integration testing] (eg if testing a workflow system whereby objects are moved from one user to another) and while running xref:ugtst.adoc#_ugtst_fixture-scripts[fixture scripts] (eg setting up objects that would normally require several users to have acted upon the objects).
+
+
+== API & Implementation
+
+The API provided by the service is:
+
+[source,java]
+----
+public interface SudoService {
+ @Programmatic
+ void sudo(String username, final Runnable runnable);
+ @Programmatic
+ <T> T sudo(String username, final Callable<T> callable);
+ @Programmatic
+ void sudo(String username, List<String> roles, final Runnable runnable);
+ @Programmatic
+ <T> T sudo(String username, List<String> roles, final Callable<T> callable);
+}
+----
+
+which will run the provided block of code (a `Runnable` or a `Callable`) in a way such that calls to
+`DomainObjectContainer#getUser()` will return the specified user (and roles, if specified)
+
+The core framework provides a default implementation of this service (`o.a.i.core.runtime.services.sudo.SudoServiceDefault`).
+
+
+
+
+== Usage
+
+A good example can be found in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] which uses the `SudoService` in a fixture script to set up `ToDoItem` objects:
+
+[source,java]
+----
+protected void execute(final ExecutionContext ec) {
+ ...
+ sudoService.sudo(getUsername(),
+ new Runnable() {
+ @Override
+ public void run() {
+ wrap(toDoItem).completed();
+ }
+ });
+ ...
+}
+----
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `SudoService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SwaggerService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SwaggerService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SwaggerService.adoc
new file mode 100644
index 0000000..724a179
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_SwaggerService.adoc
@@ -0,0 +1,71 @@
+[[_rgsvc_api_SwaggerService]]
+= `SwaggerService` (`1.11.0-SNAPSHOT`)
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `SwaggerService` (`1.11.0-SNAPSHOT`) generates link:http://swagger.io/[Swagger] spec files to describe the public and/or private RESTful APIs exposed by the xref:ugvro.adoc#[RestfulObjects viewer].
+
+These spec files can then be used with the link:http://swagger.io/swagger-ui/[Swagger UI] page to explore the REST API, or used to generate client-side stubs using the link:http://swagger.io/swagger-codegen/[Swagger codegen] tool, eg for use in a custom REST client app.
+
+[NOTE]
+====
+Not all of the REST API exposed by the xref:ugvro.adoc#[Restful Objects viewer] is included in the Swagger spec files; the emphasis is those REST resources that are used to develop custom apps: domain objects, domain object collections and action invocations. When combined with Apache Isis' own xref:ugvro.adoc#_ugvro_simplified-representations[simplified representations], these are pretty much all that is needed for this use case.
+====
+
+
+
+
+
+[[_rgsvc_api_SwaggerService_api-and-implementation]]
+== API & Implementation
+
+The API defined by `SwaggerService` is:
+
+[source,java]
+----
+public interface SwaggerService {
+ enum Visibility {
+ PUBLIC, // <1>
+ PRIVATE, // <2>
+ PRIVATE_WITH_PROTOTYPING; // <3>
+ }
+ enum Format { // <4>
+ JSON,
+ YAML
+ }
+ String generateSwaggerSpec(final Visibility visibility, final Format format);
+}
+----
+<1> Generate a Swagger spec for use by third-party clients, ie public use. This specification is restricted only to
+xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]s and to domain services with a xref:rgant.adoc#_rgant_DomainService_nature[nature] of `VIEW_REST_ONLY`.
+<2> Generate a Swagger spec for use only by internally-managed clients, ie private internal use. This specification includes domain entities and all menu domain services (as well as any view models).
+<3> Generate a Swagger spec that is the same as private case (above), but also including any xref:rgant.adoc#_rgant_Action_restrictTo[prototype] actions.
+<4> Swagger specs can be written either in JSON or YAML format.
+
+Isis provides a default implementation of the service, `o.a.i.core.metamodel.services.swagger.SwaggerServiceDefault`.
+
+
+
+== Usage within the framework
+
+This service is provided as a convenience for applications, it is not (currently) used by the framework itself.
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `SwaggerService` service is automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+
+== Related Services
+
+A `SwaggerServiceMenu` domain service provides a prototype action that enables the swagger spec to be downloaded from the Wicket viewer's UI.
+
+Apache Isis' xref:cg.adoc#_cg_isis-maven-plugin[Maven plugin] also provides a xref:cg.adoc#_cg_isis-maven-plugin_swagger[swagger goal] which allows the spec file(s) to be generated at build time. this then allows client-side stubs can then be generated in turn as part of a build pipeline.
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_WrapperFactory.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_WrapperFactory.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_WrapperFactory.adoc
new file mode 100644
index 0000000..0cb95e3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_WrapperFactory.adoc
@@ -0,0 +1,162 @@
+[[_rgsvc_api_WrapperFactory]]
+= `WrapperFactory`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+The `WrapperFactory` provides the ability to enforce business rules for programmatic interactions between domain objects. If there is a (lack-of-) trust boundary between the caller and callee -- eg if they reside in different modules -- then the wrapper factory is a useful mechanism to ensure that any business constraints defined by te callee are honoured.
+
+For example, if the calling object attempts to modify an unmodifiable property on the target object, then an exception will be thrown. Said another way: interactions are performed "as if" they are through the viewer.
+
+[NOTE]
+====
+For a discussion of the use of the `WrapperFactory` within integration tests (the primary or at least original use case for this service) can be found xref:ugtst.adoc#_ugtst_integ-test-support_wrapper-factory[here]
+====
+
+This capability goes beyond enforcing the (imperative) constraints within the `hideXxx()`, `disableXxx()` and `validateXxx()` supporting methods; it also enforces (declarative) constraints such as those represented by annotations, eg `@MaxLength` or `@Regex`.
+
+This capability is frequently used within xref:ugtst.adoc#_ugtst_integ-test-support[integration tests], but can also be used in production code. (There are analogies that can be drawn here with the way that JEE beans can interact through an EJB local interface).
+
+
+
+
+== API
+
+The API provided by the service is:
+
+[source,java]
+----
+public interface WrapperFactory {
+ @Programmatic
+ <T> T wrap(T domainObject); // <1>
+ @Programmatic
+ <T> T unwrap(T possibleWrappedDomainObject); // <2>
+ @Programmatic
+ <T> boolean isWrapper(T possibleWrappedDomainObject); // <3>
+
+ public static enum ExecutionMode { // <4>
+ EXECUTE(true,true),
+ SKIP_RULES(false, true), // <5>
+ NO_EXECUTE(true, false); // <6>
+ }
+ @Programmatic
+ <T> T wrap(T domainObject, ExecutionMode mode); // <7>
+ @Programmatic
+ <T> T wrapNoExecute(T domainObject); // <8>
+ @Programmatic
+ <T> T wrapSkipRules(T domainObject); // <9>
+ ...
+ }
+----
+<1> wraps the underlying domain object. If it is already wrapped, returns the object back unchanged.
+<2> Obtains the underlying domain object, if wrapped. If the object is not wrapped, returns back unchanged.
+<3> whether the supplied object has been wrapped.
+<4> enumerates how the wrapper interacts with the underlying domain object.
+<5> validate all business rules and then execute.
+<6> skip all business rules and then execute (including creating xref:rgant.adoc#_rgant-Action_command[command]s and firing pre- and post-execute xref:rgant.adoc#_rgant-Action_domainEvent[domain event]s).
+<7> validate all business rules (including those from xref:rgant.adoc#_rgant-Action_domainEvent[domain event]s) but do not execute.
+<8> convenience method to invoke `wrap(...)` with `ExecuteMode#NO_EXECUTE` (make this feature more discoverable)
+<9> convenience method to invoke `wrap(...)` with `ExecuteMode#SKIP_RULES` (make this feature more discoverable)
+
+
+
+The service works by returning a "wrapper" around a supplied domain object (a link:http://www.javassist.org[javassist] proxy), and it is this wrapper that ensures that the hide/disable/validate rules implies by the Apache Isis programming model are enforced. The wrapper can be interacted with as follows:
+
+* a `get...()` method for properties or collections
+* a `set...()` method for properties
+* an `addTo...()` or `removeFrom...()` method for collections
+* any action
+
+Calling any of the above methods may result in a (subclass of) `InteractionException` if the object disallows it. For example, if a property is annotated with `@Hidden` then a `HiddenException` will be thrown. Similarly if an action has a `validateXxx()` method and the supplied arguments are invalid then an `InvalidException` will be thrown.
+
+In addition, the following methods may also be called:
+
+* the xref:rgcms.adoc#_rgcms_methods_reserved_title[`title()`] and `toString()` methods
+* any xref:rgcms.adoc#_rgcms_methods_prefixes_default[`default...()`], xref:rgcms.adoc#_rgcms_methods_prefixes_choices[`choices...()`] or xref:rgcms.adoc#_rgcms_methods_prefixes_autoComplete[`autoComplete...()`] methods
+
+An exception will be thrown if any other methods are thrown.
+
+
+
+
+
+== Usage
+
+The caller will typically obtain the target object (eg from some repository) and then use the injected `WrapperFactory` to wrap it before interacting with it.
+
+For example:
+
+[source,java]
+----
+public class CustomerAgent {
+ @Action
+ public void refundOrder(final Order order) {
+ final Order wrappedOrder = wrapperFactory.wrap(order);
+ try {
+ wrappedOrder.refund();
+ } catch(InteractionException ex) { // <1>
+ container.raiseError(ex.getMessage()); // <2>
+ return;
+ }
+ }
+ ...
+ @Inject
+ WrapperFactory wrapperFactory;
+ @Inject
+ DomainObjectContainer container;
+}
+----
+<1> if any constraints on the `Order`'s `refund()` action would be violated, then ...
+<2> ... these will be trapped and raised to the user as a warning.
+
+[NOTE]
+====
+It ought to be possible to implement an xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`]s that would allow the above boilerplate to be removed. This recognizer service would recognize the `InteractionException` and convert to a suitable message.
+
+At the time of writing Apache Isis does not provide an out-of-the-box implementation of such an `ExceptionRecognizer`; but it should be simple enough to write one…
+====
+
+
+
+
+== Listener API
+
+The `WrapperFactory` also provides a listener API to allow other services to listen in on interactions.
+
+[source,java]
+----
+public interface WrapperFactory {
+ ...
+ @Programmatic
+ List<InteractionListener> getListeners(); // <1>
+ @Programmatic
+ public boolean addInteractionListener(InteractionListener listener); // <2>
+ @Programmatic
+ public boolean removeInteractionListener(InteractionListener listener); // <3>
+ @Programmatic
+ public void notifyListeners(InteractionEvent ev); // <4>
+}
+----
+<1> all ``InteractionListener``s that have been registered.
+<2> registers an `InteractionListener`, to be notified of interactions on all wrappers. The listener will be notified of interactions even on wrappers created before the listener was installed. (From an implementation perspective this is because the wrappers delegate back to the container to fire the events).
+<3> remove an `InteractionListener`, to no longer be notified of interactions on wrappers.
+<4> used by the framework itself
+
+The original intent of this API was to enable test transcripts to be captured (in a BDD-like fashion) from integration tests. No such feature has yet been implemented however. Also, the capabilities have by and large been superceded by Apache Isis' support for domain events. We may therefore deprecate this API in the future.
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `WrapperFactory` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
[09/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService.adoc
deleted file mode 100644
index f3c4fce..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService.adoc
+++ /dev/null
@@ -1,123 +0,0 @@
-[[_rgsvc-api_BackgroundService]]
-= `BackgroundService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `BackgroundService`, and the companion xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`] SPI service (used by Apache Isis itself), enable action invocations to be persisted such that they may be invoked in the background.
-
-The `BackgroundService` is responsible for capturing a memento representing the action invocation in a typesafe way, and persisting it rather than executing it directly.
-
-The default `BackgroundServiceDefault` implementation (provided by isis-core) works by using a proxy wrapper around the target so that it can capture the action to invoke and its arguments using (a private copy of) xref:rgsvc.adoc#_rgsvc-api_MementoService[`MementoService`]. The persistence delegates the persistence of the memento to an appropriate implementation of the companion `BackgroundCommandService`. One such implementation of `BackgroundCommandService` is provided by (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module.
-
-The persisting of commands is only half the story; there needs to be a separate process to read the commands and execute them. The `BackgroundCommandExecution` abstract class (discussed xref:rgsvc.adoc#_rgsvc-api_BackgroundService_BackgroundCommandExecution[below]) provides infrastructure to do this; the concrete
-implementation of this class depends on the configured `BackgroundCommandService` (in order to query for the persisted (background) ``Command``s.
-
-
-
-== API & Implementation
-
-Returns a proxy around the object which is then used to obtain the signature of the action to be invoked in the background.
-
-[source,java]
-----
-public interface BackgroundService {
- @Programmatic
- <T> T execute(final T object);
-}
-----
-
-The default implementation is provided by core (`o.a.i.core.runtime.services.background.BackgroundServiceDefault`).
-
-
-
-== Usage
-
-Using the service is very straight-forward; wrap the target domain object using `BackgroundService#execute(...)` and invoke the method on the object returned by that method.
-
-For example:
-
-[source,java]
-----
-public void submitCustomerInvoices() {
- for(Customer customer: customerRepository.findCustomersToInvoice()) {
- backgroundService.execute(customer).submitInvoice();
- }
- container.informUser("Calculating...");
-}
-----
-
-This will create a bunch of background commands executing the `submitInvoice()` action for each of the customers returned from the customer repository.
-
-The action method invoked must be part of the Apache Isis metamodel, which is to say it must be public, accept only scalar arguments, and must not be annotated with xref:rgant.adoc#_rgant-Programmatic[`@Programmatic`] or `@Ignore`. However, it may be annotated with xref:rgant.adoc#_rgant-Action_hidden[`@Action#hidden()`] or xref:rgant.adoc#_rgant-ActionLayout_hidden[`@ActionLayout#hidden()`] and it will still be invoked.
-
-In fact, when invoked by the background service, no business rules (hidden, disabled, validation) are enforced; the action method must take responsibility for performing appropriate validation and error checking.
-
-[TIP]
-====
-If you want to check business rules, you can use xref:rgant.adoc#_rgant-WrapperFactory[`@WrapperFactory#wrapNoExecute(...)`].
-====
-
-
-
-== End-user experience
-
-For the end-user, executing an action that delegates work off to the `BackgroundService` raises the problem of how does the user know the work is complete?
-
-One option is for the background jobs to take responsibility to notify the user themselves. In the above example, this would be the `submitInvoice()` method called upon each customer. One could imagine more complex designs where only the final command executed notifies the user.
-
-However, an alternative is to rely on the fact that the `BackgroundService` will automatically hint that the `Command` representing the original interaction (to `submitCustomerInvoices()` in the example above) should be persisted. This will be available if the related xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] and xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] domain services are configured, and the `CommandService` supports persistent commands. Note that (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module does indeed provide such an implementation of `CommandService` (as well as of the required `BackgroundCommandService`).
-
-Thus, the original action can run a query to obtain it corresponding `Command`, and return this to the user. The upshot is that the child ``Command``s created by the `BackgroundService` will then be associated with `Command` for the original action.
-
-We could if we wanted write the above example as follows:
-
-[source,java]
-----
-public Command submitCustomerInvoices() {
- for(Customer customer: customerRepository.findCustomersToInvoice()) {
- backgroundService.execute(customer).submitInvoice();
- }
- return commandContext.getCommand();
-}
-@Inject
-CommandContext commandContext; // <1>
-----
-<1> the injected xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] domain service.
-
-The user would be returned a domain object representing their action invocation.
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `BackgroundService` is automatically registered (it is annotated with `@DomainService`) so no
-further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-== Related Services
-
-This service is closely related to the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] and also that service's supporting xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] service.
-
-The `CommandContext` service is responsible for providing a parent `Command` with which the background ``Command``s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s. The latter is analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s.
-
-The implementations of `CommandService` and `BackgroundCommandService` go together; typically both parent `Command`s and child background `Command`s will be persisted in the same way. The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides implementations of both (see xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]).
-
-
-include::_rgsvc-api_BackgroundService_BackgroundCommandExecution.adoc[leveloffset=+1]
-include::_rgsvc-api_BackgroundService_Quartz.adoc[leveloffset=+1]
-
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_BackgroundCommandExecution.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_BackgroundCommandExecution.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_BackgroundCommandExecution.adoc
deleted file mode 100644
index 19f1df5..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_BackgroundCommandExecution.adoc
+++ /dev/null
@@ -1,25 +0,0 @@
-[[_rgsvc-api_BackgroundService_BackgroundCommandExecution]]
-= `BackgroundCommandExecution` abstract class
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `BackgroundCommandExecution` (in isis-core) is an abstract template class provided by isis-core that defines an abstract hook method to obtain background `Command`s to be executed:
-
-[source,java]
-----
-public abstract class BackgroundCommandExecution
- extends AbstractIsisSessionTemplate {
- ...
- protected abstract List<? extends Command> findBackgroundCommandsToExecute();
- ...
-}
-----
-
-The developer is required to implement this hook method in a subclass.
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_Quartz.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_Quartz.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_Quartz.adoc
deleted file mode 100644
index 6bf9c97..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BackgroundService_Quartz.adoc
+++ /dev/null
@@ -1,162 +0,0 @@
-[[_rgsvc-api_BackgroundService_Quartz]]
-= Quartz Scheduler Configuration
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The last part of the puzzle is to actually run the (appropriate implementation of) `BackgroundCommandExecution). This could be run in a batch job overnight, or run continually by, say, the http://quartz-scheduler.org[Quartz] scheduler or by http://camel.apache.org]Apache Camel]. This section looks at configuring Quartz.
-
-If using (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module, then note that this already provides a suitable concrete implementation, namely `org.isisaddons.module.command.dom.BackgroundCommandExecutionFromBackgroundCommandServiceJdo`. We therefore just need to schedule this to run as a Quartz job.
-
-
-First, we need to define a Quartz job, for example:
-
-[source,java]
-----
-import org.isisaddons.module.command.dom.BackgroundCommandExecutionFromBackgroundCommandServiceJdo;
-public class BackgroundCommandExecutionQuartzJob extends AbstractIsisQuartzJob {
- public BackgroundCommandExecutionQuartzJob() {
- super(new BackgroundCommandExecutionFromBackgroundCommandServiceJdo());
- }
-}
-----
-
-where `AbstractIsisQuartzJob` is in turn the following boilerplate:
-
-[source,java]
-----
-package domainapp.webapp.quartz;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-...
-public class AbstractIsisQuartzJob implements Job {
- public static enum ConcurrentInstancesPolicy {
- SINGLE_INSTANCE_ONLY,
- MULTIPLE_INSTANCES
- }
-
- private final AbstractIsisSessionTemplate isisRunnable;
- private final ConcurrentInstancesPolicy concurrentInstancesPolicy;
- private boolean executing;
-
- public AbstractIsisQuartzJob(AbstractIsisSessionTemplate isisRunnable) {
- this(isisRunnable, ConcurrentInstancesPolicy.SINGLE_INSTANCE_ONLY);
- }
- public AbstractIsisQuartzJob(
- AbstractIsisSessionTemplate isisRunnable,
- ConcurrentInstancesPolicy concurrentInstancesPolicy) {
- this.isisRunnable = isisRunnable;
- this.concurrentInstancesPolicy = concurrentInstancesPolicy;
- }
-
- public void execute(final JobExecutionContext context)
- throws JobExecutionException {
- final AuthenticationSession authSession = newAuthSession(context);
- try {
- if(concurrentInstancesPolicy == ConcurrentInstancesPolicy.SINGLE_INSTANCE_ONLY &&
- executing) {
- return;
- }
- executing = true;
-
- isisRunnable.execute(authSession, context);
- } finally {
- executing = false;
- }
- }
-
- AuthenticationSession newAuthSession(JobExecutionContext context) {
- String user = getKey(context, SchedulerConstants.USER_KEY);
- String rolesStr = getKey(context, SchedulerConstants.ROLES_KEY);
- String[] roles = Iterables.toArray(
- Splitter.on(",").split(rolesStr), String.class);
- return new SimpleSession(user, roles);
- }
-
- String getKey(JobExecutionContext context, String key) {
- return context.getMergedJobDataMap().getString(key);
- }
-}
-----
-
-
-This job can then be configured to run using Quartz' `quartz-config.xml` file:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<job-scheduling-data
- xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData
-http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
- version="1.8">
- <schedule>
- <job>
- <name>BackgroundCommandExecutionJob</name>
- <group>Isis</group>
- <description>
- Poll and execute any background actions persisted by the BackgroundActionServiceJdo domain service
- </description>
- <job-class>domainapp.webapp.quartz.BackgroundCommandExecutionQuartzJob</job-class>
- <job-data-map>
- <entry>
- <key>webapp.scheduler.user</key>
- <value>scheduler_user</value>
- </entry>
- <entry>
- <key>webapp.scheduler.roles</key>
- <value>admin_role</value>
- </entry>
- </job-data-map>
- </job>
- <trigger>
- <cron>
- <name>BackgroundCommandExecutionJobEveryTenSeconds</name>
- <job-name>BackgroundCommandExecutionJob</job-name>
- <job-group>Isis</job-group>
- <cron-expression>0/10 * * * * ?</cron-expression>
- </cron>
- </trigger>
- </schedule>
-</job-scheduling-data>
-----
-
-The remaining two pieces of configuration are the `quartz.properties` file:
-
-[source,ini]
-----
-org.quartz.scheduler.instanceName = SchedulerQuartzConfigXml
-org.quartz.threadPool.threadCount = 1
-org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
-org.quartz.plugin.jobInitializer.class =org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
-org.quartz.plugin.jobInitializer.fileNames = webapp/scheduler/quartz-config.xml
-org.quartz.plugin.jobInitializer.failOnFileNotFound = true
-----
-
-and the entry in `web.xml` for the Quartz servlet:
-
-[source,xml]
-----
-<servlet>
- <servlet-name>QuartzInitializer</servlet-name>
- <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
- <init-param>
- <param-name>config-file</param-name>
- <param-value>webapp/scheduler/quartz.properties</param-value>
- </init-param>
- <init-param>
- <param-name>shutdown-on-unload</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>start-scheduler-on-load</param-name>
- <param-value>true</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
-----
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BookmarkService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BookmarkService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BookmarkService.adoc
deleted file mode 100644
index a31ba85..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BookmarkService.adoc
+++ /dev/null
@@ -1,116 +0,0 @@
-[[_rgsvc-api_BookmarkService]]
-= `BookmarkService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `BookmarkService` provides the ability to obtain a serializable `o.a.i.applib.bookmarks.Bookmark` for any (persisted) domain object, and to lookup domain objects given a `Bookmark`. This can then in turn be converted to and from a string.
-
-For example, a `Customer` object with:
-
-* an object type of "custmgmt.Customer" (as per xref:rgant.adoc#_rgant-DomainObject_objectType[`DomainObject#objectType()`] or equivalent) , and
-* an id=123
-
-could correspond to a `Bookmark` with a string representation of `custmgmt.Customer|123`.
-
-[NOTE]
-====
-A `Bookmark` is little more than an API equivalent of Apache Isis' internal `Oid` (object identifier). Nevertheless, the ability to uniquely address _any_ domain object within an Apache Isis system -- to in effect provide a URN -- is immensely useful.
-
-For example, a `Bookmark` could be converted into a barcode, and then this used for automated scanning of correspondence from a customer.
-====
-
-``Bookmark``s are used by several other domain services as a means of storing areference to an arbitrary object (a polymorphic relationship). For example, the (non-ASF) http://github.com/isisaddons/isis-module-auditing[Isis addons' auditing] module's implementation of xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`] uses bookmarks to capture the object that is being audited.
-
-[TIP]
-====
-One downside of using ``Bookmark``s is that there is no way for the JDO/DataNucleus objectstore to enforce any kind of referental integrity. However, the (non-ASF) http://github.com/isisaddons/isis-module-poly[Isis addons' poly] module describes and supports a design pattern to address this requirement.
-====
-
-
-
-
-== API & Implementation
-
-The API defined by `BookmarkService` is:
-
-[source,java]
-----
-public interface BookmarkService {
- @Programmatic
- Object lookup(BookmarkHolder bookmarkHolder);
- @Programmatic
- Object lookup(Bookmark bookmark);
- @Programmatic
- <T> T lookup(Bookmark bookmark, Class<T> cls); // <1>
- @Programmatic
- Bookmark bookmarkFor(Object domainObject);
- @Programmatic
- Bookmark bookmarkFor(Class<?> cls, String identifier);
-}
-----
-<1> same as `lookup(Bookmark bookmark)`, but downcasts to the specified type.
-
-
-The core framework provides a default implementation of this API, namely `o.a.i.core.metamodel.services.bookmarks.BookmarkServiceDefault`
-
-
-== `BookmarkHolder`
-
-The `BookmarkHolder` interface is intended to be implemented by domain objects that use a `Bookmark` to reference a (single) domain object; an example might be a class such as the audit entry, mentioned above. The interface is simply:
-
-
-[source,java]
-----
-public interface BookmarkHolder {
- @Programmatic
- Bookmark bookmark();
-}
-
-----
-
-There are two services that will contribute to this interface:
-
-* `BookmarkHolderActionContributions` will provide a `lookup(...)` action
-* `BookmarkHolderAssociationContributions` provides an `object` property.
-
-Either of these can be suppressed, if required, using a vetoing subscriber. For example, to suppress the `object` property (so that only the `lookup(...)` action is ever shown for implementations of `BookmarkHolder`, define:
-
-[source,java]
-----
-@DomainObject
-public class AlwaysHideBookmarkHolderAssociationsObjectProperty {
- @Subscribe
- public void on(BookmarkHolderAssociationContributions.ObjectDomainEvent ev) {
- ev.hide();
- }
-}
-----
-
-A more sophisticated implementation could look inside the passed `ev` argument and selectively hide or not based on the contributee.
-
-
-
-
-== Usage by other services
-
-Bookmarks are used by the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's implementation of xref:rgsvc.adoc#_rgsvc-api_BackgroundCommandService[`BackgroundCommandService`], which uses a bookmark to capture the target object on which an action will be invoked subsequently.
-
-Bookmarks are also used by the (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module's implementation of xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`], and by the (non-ASF) http://github.com/isisaddons/isis-module-auditing[Isis addons' auditing] module's implementation of xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`].
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `BookmarkService` is automatically registered (it is annotated with `@DomainService`) so no further
-configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BulkInteractionContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BulkInteractionContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BulkInteractionContext.adoc
deleted file mode 100644
index 4e81093..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_BulkInteractionContext.adoc
+++ /dev/null
@@ -1,9 +0,0 @@
-[[_rgsvc-api_BulkInteractionContext]]
-= `BulkInteractionContext`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-This service is deprecated, replaced by xref:rgsvc.adoc#_rgsvc-api_ActionInvocationContext[`ActionInvocationContext`].
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ClockService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ClockService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ClockService.adoc
deleted file mode 100644
index c5e0e4f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ClockService.adoc
+++ /dev/null
@@ -1,101 +0,0 @@
-[[_rgsvc-api_ClockService]]
-= `ClockService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-Most applications deal with dates and times in one way or another. For example, if an `Order` is placed, then the `Customer` may have 30 days to pay the `Invoice`, otherwise a penalty may be levied.
-
-However, such date/time related functionality can quickly complicate automated testing: "today+30" will be a different value every time the test is run.
-
-Even disregarding testing, there may be a requirement to ensure that date/times are obtained from an NNTP server (rather than the system PC). While instantiating a `java.util.Date` to current the current time is painless enough, we would not want complex technical logic for querying an NNTP server spread around domain logic code.
-
-Therefore it's common to provide a domain service whose responsibility is to provide the current time. This service can be injected into any domain object (and can be mocked out for unit testing). Apache Isis provides such a facade through the `ClockService`.
-
-
-
-== API & Implementation
-
-The API defined by `ClockService` is:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-public class ClockService {
- @Programmatic
- public LocalDate now() { ... }
- @Programmatic
- public LocalDateTime nowAsLocalDateTime() { ... }
- @Programmatic
- public DateTime nowAsDateTime() { ... }
- @Programmatic
- public Timestamp nowAsJavaSqlTimestamp() { ... }
- @Programmatic
- public long nowAsMillis() { ... }
-}
-----
-
-This class (`o.a.i.applib.services.clock.ClockService`) is also the default implementation. The time provided by this default implementation is based on the system clock.
-
-
-
-
-== Testing Support
-
-The default `ClockService` implementation in fact simply delegates to another class defined in the API, namely the `o.a.i.applib.clock.Clock`, an abstract singleton class. It is not recommended that your code use the `Clock` directly, but you should understand how this all works:
-
-* there are two subclasses implementations `Clock`, namely `SystemClock` and `FixtureClock`.
-* the first implementation that is instantiated registers itself as the singleton.
-* if running in xref:rgcfg.adoc#_rgcfg_deployment-types[production] (server) mode, then (unless another implementation has beaten it to the punch) the framework will instantiate the ``SystemClock`. Once instantiated this cannot be replaced.
-* if running in xref:rgcfg.adoc#_rgcfg_deployment-types[prototype] mode, then the framework will instead instantiate `FixtureClock`. This _can_ be replaced if required.
-
-The `FixtureClock` will behave as the system clock, unless its is explicitly set using `FixtureClock#setDate(...)` or `FixtureClock#setTime(...)` and so forth.
-
-
-
-=== Alternative Implementations
-
-Suppose you want (as discussed in the introduction to this service) to use a clock that delegates to NNTP. For most domain services this would amount to implementing the appropriate service and registering in `isis.properties` so that it is used in preference to any implementations provided by default by the framework.
-
-In the case of the `ClockService`, though, this approach (unfortunately) will not work, because parts of Apache Isis (still) delegate to the `Clock` singleton rather than using the `ClockService` domain service.
-
-The workaround, therefore, is to implement your functionality as a subclass of `Clock`. You can write a domain service that will ensure that your implementation is used ahead of any implementations provided by the framework.
-
-For example:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class NntpClockServiceInitializer {
- @Programmatic
- @PostConstruct
- public void postConstruct(Map<String,String> properties) {
- new NntpClock(properties); // <1>
- }
- private static class NntpClock extends Clock {
- NntpClock(Map<String,String> properties) { ... } // <2>
- protected long time() { ... } // <3>
- ... NNTP stuff here ...
- }
- }
-}
-----
-<1> enough to simply instantiate the `Clock`; it will register itself as singleton
-<2> connect to NNTP service using configuration properties from `isis.properties`
-<3> call to NNTP service here
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `ClockService` is automatically registered (it is annotated with `@DomainService`) so no further
-configuration is required.
-
-If you want to use a different implementation of `Clock`, eg delegating to NNTP, then do _not_ register directly, but
-instead subclass from `o.a.i.applib.clock.Clock` singleton (as described in the section above).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_CommandContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_CommandContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_CommandContext.adoc
deleted file mode 100644
index 2bcdddb..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_CommandContext.adoc
+++ /dev/null
@@ -1,216 +0,0 @@
-[[_rgsvc-api_CommandContext]]
-= `CommandContext`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `CommandContext` service is a xref:rgant.adoc#_rgant-RequestScoped[request-scoped] service that reifies the invocation of an action on a domain object into an object itself. This reified information is encapsulated within the `Command` object.
-
-By default, the `Command` is held in-memory only; once the action invocation has completed, the `Command` object is gone. The optional
- supporting xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] enables the implementation of `Command` to be pluggable. With an appropriate implementation (eg as provided by the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`]) the `Command` may then be persisted.
-
-Persistent ``Command``s support several use cases:
-
-* they enable profiling of the running application (which actions are invoked then most often, what is their response time)
-* they act as a parent to any background commands that might be invoked through the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`]
-* if xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`] is configured, they provide better audit information, since the `Command` (the 'cause' of an action) can be correlated to the audit records (the "effect" of the action) through the unique `transactionId` GUID
-* if xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`] is configured, they provide better traceability as the `Command` is also correlated with any published events, again through the unique `transactionId` GUID
-
-Assuming that the `CommandService` supports persistent `Command`s, the associated xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation also allows action invocations to be performed in the background. In this case the act of invoking the action on an object instead returns the `Command` to the user.
-
-
-
-[[_rgsvc-api_CommandContext_screencast]]
-== Screencast
-
-
-The screencast provides a run-through of the command (profiling) service, auditing service, publishing service. It also shows how commands can be run in the background either explicitly by scheduling through the background service or implicitly by way of a framework annotation.
-
-video::tqXUZkPB3EI[youtube,width="640px",height="360px"]
-
-[NOTE]
-====
-Note that this screencast shows an earlier version of the xref:ugvw.adoc#[Wicket viewer] UI (specifically, pre 1.8.0).
-====
-
-
-
-
-== API & Implementation
-
-The `CommandContext` request-scoped service defines the following very simple API:
-
-[source,java]
-----
-@RequestScoped
-public class CommandContext {
- @Programmatic
- public Command getCommand() { ... }
-}
-----
-
-This class (`o.a.i.applib.services.CommandContext`) is also the default implementation. Under normal circumstances there shouldn't be any need to replace this implementation with another.
-
-The `Command` type referenced above is in fact an interface, defined as:
-
-[source,java]
-----
-public interface Command extends HasTransactionId {
-
- public abstract String getUser(); // <1>
- public abstract Timestamp getTimestamp(); // <2>
-
- public abstract Bookmark getTarget(); // <3>
- public abstract String getMemberIdentifier(); // <4>
- public abstract String getTargetClass(); // <5>
- public abstract String getTargetAction(); // <6>
- public String getArguments(); // <7>
- public String getMemento(); // <8>
-
- public ExecuteIn getExecuteIn(); // <9>
- public Executor getExecutor(); // <10>
- public Persistence getPersistence(); // <11>
- public boolean isPersistHint(); // <12>
-
- public abstract Timestamp getStartedAt(); // <13>
- public abstract Timestamp getCompletedAt(); // <14>
- public Command getParent(); // <15>
-
- public Bookmark getResult(); // <16>
- public String getException(); // <17>
-}
-----
-<1> `getUser()` - is the user that initiated the action.
-<2> `getTimestamp()` - the date/time at which this action was created.
-<3> `getTarget()` - bookmark of the target object (entity or service) on which this action was performed
-<4> `getMemberIdentifier()` - holds a string representation of the invoked action
-<5> `getTargetClass()` - a human-friendly description of the class of the target object
-<6> `getTargetAction()` - a human-friendly name of the action invoked on the target object
-<7> `getArguments()` - a human-friendly description of the arguments with which the action was invoked
-<8> `getMemento()` - a formal (XML or similar) specification of the action to invoke/being invoked
-<9> `getExecuteIn()` - whether this command is executed in the foreground or background
-<10> `getExecutor()` - the (current) executor of this command, either user, or background service, or other (eg redirect after post).
-<11> `getPersistence()`- the policy controlling whether this command should ultimately be persisted (either "persisted", "if hinted", or "not persisted")
-<12> `isPersistHint()` - whether that the command should be persisted, if persistence policy is "if hinted".
-<13> `getStartedAt()` - the date/time at which this action started (same as `timestamp` property for foreground commands)
-<14> `getCompletedAt()` - the date/time at which this action completed.
-<15> `getParent()` - for actions created through the `BackgroundService`, captures the parent action
-<16> `getResult()` - bookmark to object returned by action, if any
-<17> `getException()` - exception stack trace if action threw exception
-
-
-
-
-== Usage
-
-The typical way to indicate that an action should be treated as a command is to annotate it with the xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation.
-
-For example:
-
-[source,java]
-----
-public class ToDoItem ... {
- @Action(command=CommandReification.ENABLED)
- public ToDoItem completed() { ... }
-}
-----
-
-
-[TIP]
-====
-As an alternative to annotating every action with `@Action#command()`, alternatively this can be configured as the default using `isis.services.command.actions` configuration property.
-
-See xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] and xref:rgcfg.adoc#_rgcfg_configuring-core[runtime configuration] for further details.
-====
-
-
-The xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation can also be used to specify whether the command should be performed in the background, for example:
-
-[source,java]
-----
-public class ToDoItem ... {
- @Command(executeIn=ExecuteIn.BACKGROUND)
- public ToDoItem scheduleImplicitly() {
- completeSlowly(3000);
- return this;
- }
-}
-----
-
-When a background command is invoked, the user is returned the command object itself (to provide a handle to the command being invoked).
-
-This requires that an implementation of xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] that persists the commands (such as the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's `CommandService`) is configured. It also requires that a scheduler is configured to execute the background commands, see xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]).
-
-
-
-== Interacting with the services
-
-Typically the domain objects have little need to interact with the `CommandContext` and `Command` directly; what is more useful is that these are persisted in support of the various use cases identified above.
-
-One case however where a domain object might want to obtain the `Command` is to determine whether it has been invoked in the foreground, or in the background. It can do this using the `getExecutedIn()` method:
-
-Although not often needed, this then allows the domain object to access the `Command` object through the `CommandContext` service. To expand th above example:
-
-
-[source,java]
-----
-public class ToDoItem ... {
- @Action(
- command=CommandReification.ENABLED,
- commandExecuteIn=CommandExecuteIn.BACKGROUND
- )
- public ToDoItem completed() {
- ...
- Command currentCommand = commandContext.getCommand();
- ...
- }
- @Inject
- CommandContext commandContext;
-}
-----
-
-
-If run in the background, it might then notify the user (eg by email) if all work is done.
-
-This leads us onto a related point, distinguishing the current effective user vs the originating "real" user. When running in the foreground, the current user can be obtained from the `DomainObjectContainer`, using:
-
-[source,java]
-----
-String user = container.getUser().getName();
-----
-
-If running in the background, however, then the current user will be the credentials of the background process, for example as run by a Quartz scheduler job.
-
-The domain object can still obtain the original ("effective") user that caused the job to be created, using:
-
-[source,java]
-----
-String user = commandContext.getCommand().getUser();
-----
-
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `CommandContext` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-
-== Related Services
-
-As discussed above, the supporting xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] enables `Command` objects to be persisted. Other related services are the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] and xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]). For `BackgroundService` captures commands for execution in the background, while the [BackgroundCommandService] persists such commands for execution.
-
-The implementations of `CommandService` and `BackgroundCommandService` are intended to go together, so that persistent parent `Command`s can be associated with their child background `Command`s.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DeepLinkService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DeepLinkService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DeepLinkService.adoc
deleted file mode 100644
index a635b05..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DeepLinkService.adoc
+++ /dev/null
@@ -1,56 +0,0 @@
-[[_rgsvc-api_DeepLinkService]]
-= `DeepLinkService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `DeepLinkService` provides the ability to obtain a `java.net.URI` that links to a representation of any (persisted) domain entity or
-view model.
-
-A typical use case is to generate a clickable link for rendering in an email, PDF, tweet or other communication.
-
-
-
-== API & Implementation
-
-The API defined by `DeepLinkService` is:
-
-[source,java]
-----
-public interface DeepLinkService {
- URI deepLinkFor(Object domainObject); // <1>
-}
-----
-<1> Creates a URI that can be used to obtain a representation of the provided domain object in one of the Apache Isis viewers.
-
-The xref:ugvw.adoc#[Wicket viewer] this provides an implementation for accessing the representation through this viewer. (For the xref:ugvro.adoc#[RestfulObjects viewer], a URL can be constructed according to the link:http://www.restfulobjects.org[Restful Objects spec] in conjunction with a `Bookmark` obtained via the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]).
-
-
-
-== Usage within the framework
-
-The xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`EmailNotificationService`] uses this service in order to generate emails as part of xref:ugvw.adoc#_ugvw_features_user-registration[user registration].
-
-
-
-== Implementations
-
-The Wicket viewer core framework provides a default implementation of this API:
-
-* `org.apache.isis.viewer.wicket.viewer.services.DeepLinkServiceWicket`
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
-xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `DeepLinkService` is
-automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer.adoc
deleted file mode 100644
index 5b30b67..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer.adoc
+++ /dev/null
@@ -1,40 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer]]
-= `DomainObjectContainer`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `DomainObjectContainer` service provides a set of general purpose functionality for domain objects to call. Principal amongst these are a generic APIs for querying objects and creating and persisting objects. In addition, the service provides access to security context (the "current user"), allows information and warning messages to be raised, and various other miscellaneous functions.
-
-[NOTE]
-====
-Compared to other services provided by Apache Isis, the `DomainObjectContainer` provides by far the most number of methods, addressing several quite distinct responsibilities. This is a historical accident: in early versions of Apache Isis the `DomainObjectContainer` was the one and only domain service provided by the framework.
-
-In the future we may deprecate this service and break out its responsibilities into a number of small services. However, given how important this service was in days past, we are unlikely to delete it as a service even once it has been deprecated.
-====
-
-The sections below discuss the functions provided by the service, broken out into categories.
-
-
-include::_rgsvc-api_DomainObjectContainer_object-creation-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_generic-repository-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_object-persistence-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_messages-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_security-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_presentation-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_validation-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_properties-api.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer_services-api.adoc[leveloffset=+1]
-
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `DomainObjectContainer` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_generic-repository-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_generic-repository-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_generic-repository-api.adoc
deleted file mode 100644
index fb3f01f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_generic-repository-api.adoc
+++ /dev/null
@@ -1,89 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_generic-repository-api]]
-= Generic Repository API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The repository API acts as an abstraction over the JDO/DataNucleus objectstore. You can use it during prototyping to write naive queries (find all rows, then filter using the Guava `Predicate` API, or you can use it to call JDO link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/query.html#named[named queries] using JDOQL.
-
-As an alternative, you could also use link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[JDO typesafe queries] through the xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`] service.
-
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- public <T> List<T> allInstances(Class<T> ofType, long... range); // <1>
- @Programmatic
- <T> List<T> allMatches(Query<T> query); // <2>
- @Programmatic
- <T> List<T> allMatches(Class<T> ofType, Predicate<? super T> predicate, long... range); // <3>
- @Programmatic
- <T> List<T> allMatches(Class<T> ofType, String title, long... range); // <4>
- @Programmatic
- <T> List<T> allMatches(Class<T> ofType, T pattern, long... range); // <5>
- ...
-}
-----
-<1> all persisted instances of specified type. Mostly for prototyping, though can be useful to obtain all instances of domain entities if the number is known to be small. The optional varargs parameters are for paging control; more on this below.
-<2> all persistence instances matching the specified `Query`. Query itself is an Isis abstraction on top of JDO/DataNucleus' Query API. *This is the primary API used for querying*
-<3> all persistenced instances of specified type matching `Predicate`. Only really intended for prototyping because in effect constitutes a client-side WHERE clause
-<4> all persisted instances with the specified string as their title. Only very occasionally used
-<5> all persisted instances matching object (query-by-example). Only very occasionally used
-
-There are various implementations of the `Query` API, but these either duplicate functionality of the other overloads of `allMatches(...)` or they are not supported by the JDO/DataNucleus object store. The only significant implementation of `Query` to be aware of is `QueryDefault`, which identifies a named query and a set of parameter/argument tuples.
-
-For example, in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] the `ToDoItem` is annotated:
-
-[source,java]
-----
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name = "findByAtPathAndComplete", language = "JDOQL", // <1>
- value = "SELECT "
- + "FROM todoapp.dom.module.todoitem.ToDoItem "
- + "WHERE atPath.indexOf(:atPath) == 0 " // <2>
- + " && complete == :complete"), // <3>
- ...
-})
-public class ToDoItem ... {
- ...
-}
-----
-<1> name of the query
-<2> defines the `atPath` parameter
-<3> defines the `complete` parameter
-
-This JDO query definitions are used in the `ToDoItemRepositoryImplUsingJdoql` service:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-public class ToDoItemRepositoryImplUsingJdoql implements ToDoItemRepositoryImpl {
- @Programmatic
- public List<ToDoItem> findByAtPathAndCategory(final String atPath, final Category category) {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByAtPathAndCategory", // <1>
- "atPath", atPath, // <2>
- "category", category)); // <3>
- }
- ...
- @javax.inject.Inject
- DomainObjectContainer container;
-}
-----
-<1> corresponds to the "findByAtPathAndCategory" JDO named query
-<2> provide argument for the `atPath` parameter. The pattern is parameter, argument, parameter, argument, ... and so on.
-<3> provide argument for the `category` parameter. The pattern is parameter, argument, parameter, argument, ... and so on.
-
-Other JDOQL named queries (not shown) follow the exact same pattern.
-
-With respect to the other query APIs, the varargs parameters are optional, but allow for (client-side and managed) paging. The first parameter is the `start` (0-based, the second is the `count`.
-
-[TIP]
-====
-It is also possible to query using DataNucleus' type-safe query API. For more details, see xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`].
-====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_messages-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_messages-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_messages-api.adoc
deleted file mode 100644
index f3450de..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_messages-api.adoc
+++ /dev/null
@@ -1,50 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_messages-api]]
-= Messages API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `DomainObjectContainer` allows domain objects to raise information, warning or error messages. These messages can either be simple strings, or can be translated.
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- void informUser(String message); // <1>
- @Programmatic
- String informUser(TranslatableString message, Class<?> contextClass, String contextMethod); // <2>
-
- @Programmatic
- void warnUser(String message); // <3>
- @Programmatic
- String warnUser(TranslatableString message, Class<?> contextClass, String contextMethod); // <4>
-
- @Programmatic
- void raiseError(String message); // <5>
- @Programmatic
- String raiseError(TranslatableString message, Class<?> contextClass, String contextMethod); // <6>
- ...
-}
-----
-<1> display as a transient message to the user (not requiring acknowledgement). In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast that automatically disappears after a period of time.
-<2> ditto, but with translatable string, for xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[i18n support].
-<3> warn the user about a situation with the specified message. In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast that must be closed by the end-user.
-<4> ditto, but with translatable string, for i18n support.
-<5> show the user an unexpected application error. In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast (with a different colour) that must be closed by the end-user.
-<6> ditto, but with translatable string, for i18n support.
-
-
-For example:
-
-[source,java]
-----
-public Order addItem(Product product, @ParameterLayout(named="Quantity) int quantity) {
- if(productRepository.stockLevel(product) == 0) {
- container.warnUser(
- product.getDescription() + " out of stock; order fulfillment may be delayed");
- }
- ...
-}
-----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-creation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-creation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-creation-api.adoc
deleted file mode 100644
index 0e5a50f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-creation-api.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_object-creation-api]]
-= Object Creation API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The object creation APIs are used to instantiate new domain objects or view models.
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- <T> T newTransientInstance(final Class<T> ofType); // <1>
- @Programmatic
- <T> T newViewModelInstance(final Class<T> ofType, final String memento); // <2>
- @Programmatic
- <T> T mixin(); // <3>
- ...
-}
-----
-<1> create a new non-persisted domain entity. Any services will be automatically injected into the service
-<2> create a new view model, with the specified memento (as per xref:rgcms.adoc#_rgcms_classes_super_AbstractViewModel[ViewModel#viewModelMemento()]. In general it is easier to just annotate with xref:rgant.adoc#_rgant-ViewModel[`@ViewModel`] and let Apache Isis manage the memento automatically.
-<3> programmatically instantiate a mixin, as annotated with
-xref:rgant.adoc#_rgant-Mixin[`@Mixin`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature()`].
-
-For example:
-
-[source,java]
-----
-Customer cust = container.newTransientInstance(Customer.class);
-cust.setFirstName("Freddie");
-cust.setLastName("Mercury");
-container.persist(cust);
-----
-
-As an alternative to using `newTransientInstance(...)` or `mixin(...)`, you could also simply `new()` up the object.
-Doing this will not inject any domain services, but they can be injected manually using xref:rg .adoc#_rgsvc-api_DomainObjectContainer_services-api[#injectServicesInto(...)`].
-
-[NOTE]
-====
-Calling `new(...)` also this circumvents Apache Isis' xref:rgcms.adoc#_rgcms_methods_reserved_created[`created()`]
-callback, and in addition any default values for properties (either explicitly set by
-xref:rgcms.adoc#_rgcms_methods_prefixes_default[`default...()`] or defaulted implicitly according to Apache Isis'
-own conventions) will not be called either. If you don't intend to use these features, though, the net effect is code
-that has less coupling to Isis and is arguably easier to understand (has "less magic" happening).
-====
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-persistence-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-persistence-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-persistence-api.adoc
deleted file mode 100644
index 81acfcd..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_object-persistence-api.adoc
+++ /dev/null
@@ -1,62 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_object-persistence-api]]
-= Object Persistence API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-
-The persistence API is used to persist newly created objects (as per xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`#newTransientInstance(...)`], above and to delete (remove) objects that are persistent.
-
-Note that there is no API for updating existing objects; the framework (or rather, JDO/DataNucleus) performs object dirty tracking and so any objects that are modified in the course of a request will be automatically updated).
-
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- boolean isPersistent(Object domainObject); // <1>
- @Programmatic
- boolean isViewModel(Object domainObject); // <2>
-
- @Programmatic
- void persist(Object domainObject); // <3>
- @Programmatic
- void persistIfNotAlready(Object domainObject); // <4>
-
- @Programmatic
- void remove(Object persistentDomainObject); // <5>
- @Programmatic
- void removeIfNotAlready(Object domainObject); // <6>
-
- @Programmatic
- boolean flush(); // <7>
- ...
-}
-----
-<1> test whether a particular domain object is persistent or not
-<2> test whether a particular domain object is a view model or not. Note that this includes any domain objects annotated with xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=Nature.EXTERNAL_ENTITY)`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=Nature.INMEMORY_ENTITY`]
-<3> persist a transient object. Note though that this will throw an exception if the object is already persistent; this can happen if JDO/DataNucleus's link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/orm/cascading.html[persistence-by-reachability] is in effect. For this reason it is generally better to use:
-<4> persist an object but only if know to not have been persistent. But if the object is persistent, is a no-op
-<5> remove (ie DELETE) a persistent object. For similar reasons to the persistence, it is generally better to use:
-<6> remove (ie DELETE) an object only if known to be persistent. But if the object has already been deleted, then is a no-op.
-<7> flushes all pending changes to the objectstore. Explained further below.
-
-For example:
-
-[source,java]
-----
-Customer cust = container.newTransientInstance(Customer.class);
-cust.setFirstName("Freddie");
-cust.setLastName("Mercury");
-container.persistIfNotAlready(cust);
-----
-
-You should be aware that by default Apache Isis queues up calls to `#persist()` and `#remove()`. These are then executed either when the request completes (and the transaction commits), or if the queue is flushed. This can be done either implicitly by the framework, or as the result of a direct call to `#flush()`.
-
-By default the framework itself will cause `#flush()` to be called whenever a query is executed by way of `#allMatches(Query)`, as documented xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_generic-repository-api[above]. However, this behaviour can be disabled using the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.container.disableAutoFlush`.
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_presentation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_presentation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_presentation-api.adoc
deleted file mode 100644
index 8c6378f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_presentation-api.adoc
+++ /dev/null
@@ -1,46 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_presentation-api]]
-= Presentation API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-A responsibility of every domain object is to return a title. This can be done declaratively using the xref:rgant.adoc#_rgant-Title[`@Title`] annotation on property/ies, or it can be done imperatively by writing a xref:rgcms.adoc#_rgcms_methods_reserved_title[`title()`] method.
-
-It's quite common for titles to be built up of the titles of other objects. If using building up the title using `@Title` then Apache Isis will automatically use the title of the objects referenced by the annotated properties. We also need programmatic access to these titles if going the imperative route.
-
-Similarly, it often makes sense if xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_messages-api[raising messages] to use the title of an object in a message rather (than a some other property of the object), because this is how end-users will be used to identifying the object.
-
-The API defined by `DomainObjectContainer` is simply:
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- String titleOf(Object domainObject); // <1>
- ...
-}
-----
-<1> return the title of the object, as rendered in the UI by the Apache Isis viewers.
-
-
-By way of example, here's some code from the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] showing the use of the API in an message:
-
-[source,java]
-----
- public List<ToDoItem> delete() {
- final String title = container.titleOf(this); // <1>
- ...
- container.removeIfNotAlready(this);
- container.informUser(
- TranslatableString.tr(
- "Deleted {title}", "title", title), // <2>
- this.getClass(), "delete");
- ...
- }
-
-----
-<1> the title is obtained first, because we're not allowed to reference object after it's been deleted
-<2> use the title in an i18n `TranslatableString`
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_properties-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_properties-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_properties-api.adoc
deleted file mode 100644
index 45edf3d..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_properties-api.adoc
+++ /dev/null
@@ -1,54 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_properties-api]]
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-
-= Properties API
-
-The properties API allows domain objects to read the configuration properties aggregated from the various xref:rgcfg.adoc#_rgcfg_configuration-files[configuration files].
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- String getProperty(String name); // <1>
- @Programmatic
- String getProperty(String name, String defaultValue); // <2>
- @Programmatic
- List<String> getPropertyNames(); // <3>
-}
-----
-<1> Return the configuration property with the specified name; else return null.
-<2> Return the configuration property with the specified name; if it doesn't exist then return the specified default value.
-<3> Return the names of all the available properties.
-
-For example, here's a fictitious service that might wrap link:http://twitter4j.org/en/configuration.html[Twitter4J]. say:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class TweetService {
- @Programmatic
- @PostConstruct
- public void init() {
- this.oauthConsumerKey = container.getProperty("tweetservice.oauth.consumerKey");
- this.oauthConsumerSecret = container.getProperty("tweetservice.oauth.consumerSecret");
- this.oauthAccessToken = container.getProperty("tweetservice.oauth.accessToken");
- this.oauthAccessTokenSecret = container.getProperty("tweetservice.oauth.accessTokenSecret");
- }
- ...
- @Inject
- DomainObjectContainer container;
-}
-----
-
-[TIP]
-====
-If you _do_ have a domain service that needs to access properties, then note that an alternative is to define a xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] method and pass in a `Map<String,String>` of properties. The two techniques are almost identical; it's mostly a matter of taste.
-====
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_security-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_security-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_security-api.adoc
deleted file mode 100644
index 4f1e722..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_security-api.adoc
+++ /dev/null
@@ -1,48 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_security-api]]
-= Security API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The security API allows the domain object to obtain the identity of the user interacting with said object.
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- UserMemento getUser();
- ...
-}
-----
-
-where in turn (the essence of) `UserMemento` is:
-
-[source,java]
-----
-public final class UserMemento {
- public String getName() { ... }
- public boolean isCurrentUser(final String userName) { ... }
-
- public List<RoleMemento> getRoles() { ... }
- public boolean hasRole(final RoleMemento role) { ... }
- public boolean hasRole(final String roleName) { ... }
- ...
-}
-----
-
-and `RoleMemento` is simpler still:
-
-[source,java]
-----
-public final class RoleMemento {
- public String getName() { ... }
- public String getDescription() { ... }
- ...
-}
-----
-
-The roles associated with the `UserMemento` will be based on the configured xref:ugsec.adoc#[security] (typically Shiro).
-
-In addition, when using the xref:ugvw.adoc#[Wicket viewer] there will be an additional "org.apache.isis.viewer.wicket.roles.USER" role; this is used internally to restrict access to web pages without authenticating.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_services-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_services-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_services-api.adoc
deleted file mode 100644
index a5d73db..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_services-api.adoc
+++ /dev/null
@@ -1,37 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_services-api]]
-= Services API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The services API allows your domain objects to programmatically inject services into arbitrary objects, as well as to look up services by type:
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- <T> T injectServicesInto(final T domainObject); // <1>
- @Programmatic
- <T> T lookupService(Class<T> service); // <2>
- @Programmatic
- <T> Iterable<T> lookupServices(Class<T> service); // <3>
- ...
-}
-----
-<1> injects services into domain object; used extensively internally by the framework (eg to inject to other services, or to entities, or integration test instances, or fixture scripts). Service injection is done automatically if objects are created using `#newTransientInstance()`, described xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[above]
-<2> returns the first registered service that implements the specified class
-<3> returns an `Iterable` in order to iterate over all registered services that implement the specified class
-
-The primary use case is to instantiate domain objects using a regular constructor ("new is the new new") rather than using the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`#newTransientInstance()`] API, and then using the `#injectServicesInto(...)` API to set up any dependencies.
-
-For example:
-
-[source,java]
-----
-Customer cust = container.injectServicesInto( new Customer());
-cust.setFirstName("Freddie");
-cust.setLastName("Mercury");
-container.persist(cust);
-----
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_validation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_validation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_validation-api.adoc
deleted file mode 100644
index fe1b732..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_DomainObjectContainer_validation-api.adoc
+++ /dev/null
@@ -1,26 +0,0 @@
-[[_rgsvc-api_DomainObjectContainer_validation-api]]
-= Validation API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The validation API allows a domain object to programmatically validate itself or any other domain object. Specifically, this means the validating the current state of all properties, as well as any object-level validation defined by xref:rgcms.adoc#_rgcms_methods_reserved_validate[`validate()`].
-
-The API provided is:
-
-[source,java]
-----
-public interface DomainObjectContainer {
- @Programmatic
- boolean isValid(Object domainObject);
- @Programmatic
- String validate(Object domainObject);
- ...
-}
-----
-
-If an object is changed by editing its properties, then (using the xref:ugvw.adoc#[Wicket viewer] at least) Apache Isis will check that the state of the object is valid. There is currently however no equivalent guarantee for actions.
-
-The intent of this API was (originally at least) to provide a fallback whereby actions could at least be able to perform this validation programmatically (eg in their own xref:rgcms.adoc#_rgcms_methods_prefixes_validate[`validate...()`] or xref:rgcms.adoc#_rgcms_methods_prefixes_disable[`disable...()`] methods. However, this feature should be considered experimental; your mileage may vary.
\ No newline at end of file
[12/12] isis git commit: ISIS-1279: AcceptHeaderService.
Posted by da...@apache.org.
ISIS-1279: AcceptHeaderService.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/dba5c836
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/dba5c836
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/dba5c836
Branch: refs/heads/master
Commit: dba5c836f403f1bc03e495658dd1ca7e278a0508
Parents: 46825ce
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Dec 22 10:17:00 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Dec 22 10:17:00 2015 +0000
----------------------------------------------------------------------
.../src/main/asciidoc/guides/_rgsvc_api.adoc | 11 ++
.../guides/_rgsvc_api_AcceptHeaderService.adoc | 82 ++++++++++++++
.../acceptheaderservice.png | Bin 0 -> 10997 bytes
.../acceptheaderservice.pptx | Bin 0 -> 46935 bytes
.../acceptheader/AcceptHeaderService.java | 32 ++++++
.../AcceptHeaderServiceForRest.java | 106 +++++++++++++++++++
.../server/RestfulObjectsApplication.java | 6 +-
7 files changed, 236 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
index a5d40c3..248d92e 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
@@ -26,6 +26,16 @@ The table below summarizes all the APIs defined by Apache Isis. It also lists t
|Notes
+|xref:rgsvc.adoc#_rgsvc_api_AcceptHeaderService[`o.a.i.applib.` +
+`services.acceptheader` +
+`AcceptHeaderService`]
+|Request-scoped access to HTTP Accept headers.
+|`AcceptHeaderServiceDefault` +
+``o.a.i.core`` +
+``isis-viewer-restfulobjects-rendering``
+|Populated only when the domain objects are accessed using the xref:ugvro.adoc#[Restful Objects viewer].
+
+
|xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`o.a.i.applib.` +
`services.actinv` +
`ActionInvocation-` +
@@ -292,6 +302,7 @@ Key:
+include::_rgsvc_api_AcceptHeaderService.adoc[leveloffset=+1]
include::_rgsvc_api_ActionInvocationContext.adoc[leveloffset=+1]
include::_rgsvc_api_BackgroundService.adoc[leveloffset=+1]
include::_rgsvc_api_BookmarkService.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_AcceptHeaderService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_AcceptHeaderService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_AcceptHeaderService.adoc
new file mode 100644
index 0000000..ba42bdf
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_AcceptHeaderService.adoc
@@ -0,0 +1,82 @@
+[[_rgsvc_api_AcceptHeaderService]]
+= `AcceptHeaderService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `AcceptHeaderService` domain service is a xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] service that
+simply exposes the HTTP `Accept` header to the domain. Its intended use is to support multiple versions of a REST API, where the responsibility for content negotiation (determining which version of the REST API is to be used) is managed by logic in the domain objects themselves.
+
+[NOTE]
+====
+As an alternative to performing content negotiation within the domain classes, the xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`] and
+xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] SPI domain services allow the framework to perform the content negotiation responsibility.
+====
+
+== API & Implementation
+
+The API defined by the service is:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+@RequestScoped // <1>
+public interface AcceptHeaderService {
+ @Programmatic
+ List<MediaType> getAcceptableMediaTypes(); // <2>
+}
+----
+<1> is xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`], so this domain service instance is scoped to a particular request and is then destroyed
+<2> returns the list of media types found in the HTTP Accept header.
+
+
+The default implementation is provided by `o.a.i.v.ro.rendering.service.acceptheader.AcceptHeaderServiceForRest`.
+
+[NOTE]
+====
+Note that the service will only return a list when the request is initiated through the xref:ugvro.adoc#[Restful Objects viewer]. Otherwise the service will return `null`.
+====
+
+
+== Usage
+
+The intended use of this service is where there are multiple concurrent versions of a REST API, for backward
+compatibility of existing clients. The `AcceptHeaderService` allows the responsibility for content negotiation
+(determining which version of the REST API is to be used) to be performed by logic in the domain objects themselves.
+
+The diagram below illustrated this:
+
+image::{_imagesdir}reference-services-api/acceptheaderservice.png[width="700px",link="{_imagesdir}reference-services-api/acceptheaderservice.png"]
+
+The REST request is submitted to a domain service with a xref:rgant.adoc#_rgant_DomainService_nature[nature] of `VIEW_REST_ONLY` (`MyRestApi` in the diagram). This uses the `AcceptHeaderService` to obtain the values of the
+HTTP `Accept` header. Based on this it delegates to the appropriate underlying domain service (with a nature of
+`DOMAIN` so that they are not exposed in the REST API at all).
+
+[TIP]
+====
+The service does not define any conventions as to the format of the media types. The option is to use the media type's
+type/subtype, eg `application/vnd.myrestapi-v1+json`; an alternative is to use a media type parameter as a hint, eg
+`application/json;x-my-rest-api-version=1` (where `x-my-rest-api-version` is the media type parameter).
+
+The Restful Objects specification does this something similar with its own `x-ro-domain-type` media type parameter;
+this is used by the xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] to determine how to
+map domain objects to view models/DTOs.
+====
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
+implementation of `ActionInvocationContext` class is automatically registered (it is annotated with `@DomainService`)
+so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.png
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.png b/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.png
new file mode 100644
index 0000000..c8f7b14
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.pptx
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.pptx b/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.pptx
new file mode 100644
index 0000000..30f35ec
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/reference-services-api/acceptheaderservice.pptx differ
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/core/applib/src/main/java/org/apache/isis/applib/services/acceptheader/AcceptHeaderService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/acceptheader/AcceptHeaderService.java b/core/applib/src/main/java/org/apache/isis/applib/services/acceptheader/AcceptHeaderService.java
new file mode 100644
index 0000000..017604c
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/acceptheader/AcceptHeaderService.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.acceptheader;
+
+import java.util.List;
+
+import com.google.common.net.MediaType;
+
+import org.apache.isis.applib.annotation.Programmatic;
+
+public interface AcceptHeaderService {
+
+ @Programmatic
+ List<MediaType> getAcceptableMediaTypes();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/acceptheader/AcceptHeaderServiceForRest.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/acceptheader/AcceptHeaderServiceForRest.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/acceptheader/AcceptHeaderServiceForRest.java
new file mode 100644
index 0000000..25fa2a3
--- /dev/null
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/acceptheader/AcceptHeaderServiceForRest.java
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.rendering.service.acceptheader;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.annotation.Nullable;
+import javax.enterprise.context.RequestScoped;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.ext.Provider;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+import com.google.common.net.MediaType;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.acceptheader.AcceptHeaderService;
+
+@DomainService(
+ nature = NatureOfService.DOMAIN
+)
+@RequestScoped
+public class AcceptHeaderServiceForRest implements AcceptHeaderService {
+
+ private static ThreadLocal<List<MediaType>> mediaTypesByThread = new ThreadLocal<>();
+
+ /**
+ * Not API - called by RO viewer filter.
+ */
+ private static void setMediaTypes(List<MediaType> mediaTypes) {
+ mediaTypesByThread.set(mediaTypes);
+ }
+ /**
+ * Not API - called by RO viewer filter.
+ */
+ private static void removeMediaTypes() {
+ mediaTypesByThread.remove();
+ }
+
+
+ @Programmatic
+ @Override
+ public List<MediaType> getAcceptableMediaTypes() {
+ return mediaTypesByThread.get();
+ }
+
+
+ @Provider
+ public static class RequestFilter implements javax.ws.rs.container.ContainerRequestFilter
+ {
+ @Override
+ public void filter(final ContainerRequestContext requestContext) throws IOException {
+ List<javax.ws.rs.core.MediaType> acceptableMediaTypes = requestContext.getAcceptableMediaTypes();
+
+ final List<MediaType> mediaTypes =
+ Lists.newArrayList(
+ Lists.transform(acceptableMediaTypes, new Function<javax.ws.rs.core.MediaType, MediaType>() {
+ @Nullable @Override
+ public MediaType apply(
+ @Nullable
+ final javax.ws.rs.core.MediaType input) {
+ if (input == null) {
+ return null;
+ }
+ final MediaType mediaType = MediaType.create(input.getType(), input.getSubtype());
+ final SetMultimap<String, String> parameters = Multimaps.forMap(input.getParameters());
+ return mediaType.withParameters(parameters);
+ }
+ })
+ );
+ setMediaTypes(mediaTypes);
+ }
+ }
+
+ @Provider
+ public static class ResponseFilter implements javax.ws.rs.container.ContainerResponseFilter
+ {
+ @Override
+ public void filter(
+ final ContainerRequestContext requestContext, final ContainerResponseContext responseContext)
+ throws IOException {
+ removeMediaTypes();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/dba5c836/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
index d1dbcc6..ed75eee 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
@@ -18,6 +18,7 @@
*/
package org.apache.isis.viewer.restfulobjects.server;
+import org.apache.isis.viewer.restfulobjects.rendering.service.acceptheader.AcceptHeaderServiceForRest;
import org.apache.isis.viewer.restfulobjects.server.conneg.RestfulObjectsJaxbWriterForXml;
import org.apache.isis.viewer.restfulobjects.server.resources.DomainObjectResourceServerside;
import org.apache.isis.viewer.restfulobjects.server.resources.DomainServiceResourceServerside;
@@ -45,7 +46,10 @@ public class RestfulObjectsApplication extends AbstractJaxRsApplication {
addSingleton(roWriter);
addSingleton(new RestfulObjectsApplicationExceptionMapper());
addSingleton(new RuntimeExceptionMapper());
-
+
+ addSingleton(new AcceptHeaderServiceForRest.RequestFilter());
+ addSingleton(new AcceptHeaderServiceForRest.ResponseFilter());
+
// TODO: doesn't get injected
// addSingleton(new TypedReprBuilderFactoryRegistry());
[06/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_FixtureScriptsSpecificationProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_FixtureScriptsSpecificationProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_FixtureScriptsSpecificationProvider.adoc
deleted file mode 100644
index 666a7dc..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_FixtureScriptsSpecificationProvider.adoc
+++ /dev/null
@@ -1,76 +0,0 @@
-[[_rgsvc-spi_FixtureScriptsSpecificationProvider]]
-= `FixtureScriptsSpecificationProvider`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `FixtureScriptsSpecificationProvider` configures the
-xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`FixtureScriptsDefault`] domain service, providing the
-location to search for fixture scripts and other settings.
-
-The service is only used if the `FixtureScriptsDefault` service is instantiated as a fallback by the framework. If
-the application provides its own subclass of xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`]
-superclass, then this provider service is not used.
-
-[TIP]
-====
-Of the two designs, we encourage you to implement this "provider" SPI rather than subclass `FixtureScripts`. The
-primary benefit (apart from decoupling responsibilities) is that it ensures that there is always an instance of
-`FixtureScripts` available for use.
-====
-
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface FixtureScriptsSpecificationProvider {
- @Programmatic
- FixtureScriptsSpecification getSpecification();
-}
-----
-
-where `FixtureScriptsSpecification` exposes these values:
-
-[source,java]
-----
-public class FixtureScriptsSpecification {
- public String getPackagePrefix() { ... }
- public FixtureScripts.NonPersistedObjectsStrategy getNonPersistedObjectsStrategy() { ... }
- public FixtureScripts.MultipleExecutionStrategy getMultipleExecutionStrategy() { ... }
- public Class<? extends FixtureScript> getRunScriptDefaultScriptClass() { ... }
- public DropDownPolicy getRunScriptDropDownPolicy() { ... }
- public Class<? extends FixtureScript> getRecreateScriptClass() { ... }
- ...
-}
-----
-
-The class is immutable but it has a builder (obtained using `FixturescriptsSpecification.builder(...)`) for a fluent API.
-
-
-
-== Implementation
-
-The xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype] has a simple implementation of this service:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-public class DomainAppFixturesProvider implements FixtureScriptsSpecificationProvider {
- @Override
- public FixtureScriptsSpecification getSpecification() {
- return FixtureScriptsSpecification
- .builder(DomainAppFixturesProvider.class)
- .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
- .withRunScriptDefault(RecreateSimpleObjects.class)
- .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
- .withRecreate(RecreateSimpleObjects.class)
- .build();
- }
-}
-----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_LocaleProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_LocaleProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_LocaleProvider.adoc
deleted file mode 100644
index e5b66df..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_LocaleProvider.adoc
+++ /dev/null
@@ -1,70 +0,0 @@
-[[_rgsvc-spi_LocaleProvider]]
-= `LocaleProvider`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `LocaleProvider` service is one of the services that work together to implement Apache Isis' support for i18n, being used by Isis' default implementation of xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`].
-
-The role of the service itself is simply to return the `Locale` of the current user.
-
-
-[NOTE]
-====
-For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
-====
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface LocaleProvider {
- @Programmatic
- Locale getLocale();
-}
-----
-
-This is notionally request-scoped, returning the `Locale` of the current user; _not_ that of the server. (Note that the implementation is not required to actually be xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`], however).
-
-
-
-
-== Implementation
-
-Isis' xref:ugvw.adoc#[Wicket viewer] provides an implementation of this service (`LocaleProviderWicket`) which leverages Apache Wicket APIs.
-
-[NOTE]
-====
-Currently there is no equivalent implementation for the xref:ugvro.adoc#[RestfulObjects viewer].
-====
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
-xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `LocaleProvider` is
-automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-== Related Services
-
-This service works in conjunction with xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`] and xref:rgsvc.adoc#_rgsvc-spi_TranslationsResolver[`TranslationsResolver`] in order to provide i18n support.
-
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_PublishingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_PublishingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_PublishingService.adoc
deleted file mode 100644
index 97d1dc3..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_PublishingService.adoc
+++ /dev/null
@@ -1,192 +0,0 @@
-[[_rgsvc-spi_PublishingService]]
-= `PublishingService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `PublishingService` is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations and of changed objects. A typical use case is to publish onto a pub/sub bus such as link:http://activemq.apache.org/[ActiveMQ] with link:http://camel.apache.org[Camel] to keep other systems up to date.
-
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface PublishingService {
- public void publish(
- EventMetadata metadata, // <1>
- EventPayload payload); // <2>
- @Deprecated
- @Programmatic
- void setEventSerializer(EventSerializer eventSerializer); // <3>
-}
-----
-<1> standard metadata about the event, such as the user, the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`], date/time etc
-<2> for published actions, an `EventPayloadForActionInvocation` (or subclass thereof); for published objects, an `EventPayloadForObjectChanged` (or subclass thereof)
-<3> injects in the xref:rgsvc.adoc#_rgsvc-spi_EventSerializer[`EventSerializer`] service. This is deprecated because not every implementation is required to use an `EventSerializer` so its inclusion within the SPI of `PublishingService` was in retrospect a mistake.
-
-
-Typically implementations will use the injected `EventSerializer` to convert the metadata and payload into a form to be published:
-
-[source,java]
-----
-public interface EventSerializer {
- public Object serialize(EventMetadata metadata, EventPayload payload);
-}
-----
-
-The serialized form returned by `EventSerializer` must be in a form that the `PublishingService` implementation is able to handle. Strings are a good lowest common denominator, but (if custom implementations of both `EventSerializer` and `PublishingService` were in use) then it might also be some other type, for example an `org.w3c.dom.Document` or an `org.json.JSONObject` might be returned instead.
-
-
-
-== Implementation
-
-The framework provides no default implementations of this service. There are however two implementations available in
-the (non-ASF) link:http://isisaddons.org[Isis Addons].
-
-=== isis-module-publishing
-
-The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an
-implementation (`org.isisaddons.module.publishing.dom.PublishingService`) that persists each
-event as a `PublishedEvent` entity. This holds the serialized form of the event metadata and payload as translated
-into a string by the injected `EventSerializer`. The module also provides its own implementation of `EventSerializer`,
-namely `RestfulObjectsSpecEventSerializer`, which represents the event payload using the representation defined by the link:http://restfulobjects.org[Restful Objects spec] of (transient) objects, grafting on the metadata as additional
-JSON nodes.
-
-The `PublishedEvent` entity also has a `state` field taking the values either "QUEUED" or "PROCESSED". The intention
-here is that an event bus can poll this table to grab pending events and dispatch them to downstream systems. When
-``PublishedEvent``s are persisted initially they always take the value "QUEUED".
-
-=== isis-module-publishmq
-
-The (non-ASF) http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] module provides an
-implementation (`org.isisaddons.module.publismq.dom.servicespi.PublishingServiceUsingActiveMq`) that publishes each
-action invocation as an event on an link:http://activemq.apache.org[ActiveMQ] message queue. These are converted into
-a canonical XML form (the xref:rgcms.adoc#_rgcms_schema-aim[ActionInvocationMemento] schema) using the
-`ActionInvocationMementoDtoUtils` class; the idea
-being that subscribers on the ActiveMQ message queue can then query back for further information, for example using
-the xref:ugvro.adoc#[RestfulObjects viewer].
-
-[NOTE]
-====
-At the time of writing this implementation does not publish changed object events.
-====
-
-
-
-== Usage
-
-To indicate that an action invocation should be published, annotate it with the xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`] annotation.
-
-To indicate that a changed object should be published is to annotate it with the xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`] annotation.
-
-
-It is also possible to "fine-tune" the `EventPayload` using the `#publishingFactory()` attribute (for both annotations). By default the `EventPayload` that is serialized identifies the object(s) being interacted with or changed, and in the case of the action invocation provides details of the action arguments and result (if any) of that action. However, the payload does not (by default) include any information about the new state of these objects. It is therefore the responsibility of the subscriber to call back to Apache Isis to determine any information that has not been published.
-
-Although the representations (if using the Restful Object serializer and Restful Objects viewer) does include hrefs for the objects, this nevertheless requires an additional network call to obtain this information).
-
-In some circumstances, then, it may make more sense to eagerly "push" information about the change to the subscriber by including that state within the payload.
-
-To accomplish this, an implementation of a "`PayloadFactory`" must be specified in the annotation.
-
-For actions, we implement the `PublishingPayloadFactoryForAction` (in `o.a.i.applib.annotation`):
-
-[source,java]
-----
-public interface PublishingPayloadFactoryForAction {
- @Programmatic
- public EventPayload payloadFor(
- Identifier actionIdentifier,
- Object target,
- List<Object> arguments,
- Object result);
-}
-}
-----
-The `EventPayloadForActionInvocation` abstract class (in the Isis applib) should be used as the base class for the object instance returned from `payLoadFor(...)`.
-
-For objects, the interface to implement is `PublishingPayloadFactoryForObject`:
-
-[source,java]
-----
-public interface PublishingPayloadFactoryForObject {
-
- @Programmatic
- public EventPayload payloadFor(
- Object changedObject,
- PublishingChangeKind publishingChangeKind); // <1>
-}
-----
-<1> an enum taking the values `CREATE`, `UPDATE`, `DELETE`
-
-Similarly, the `EventPayloadForObjectChanged` abstract class should be used as the base class for the object returned from `payLoadFor(...)`.
-
-For example, the following will eagerly include a `ToDoItem`'s `description` property whenever it is changed:
-
-[source,java]
-----
-@DomainObject(publishingPayloadFactory=ToDoItemPayloadFactory.class)
-public class ToDoItem {
- ...
-}
-----
-
-where `ToDoItemPayloadFactory` is defined as:
-
-[source,java]
-----
-public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
- public static class ToDoItemPayload
- extends EventPayloadForObjectChanged<ToDoItem> {
- public ToDoItemPayload(ToDoItem changed) { super(changed); }
- public String getDescription() { return getChanged().getDescription(); }
- }
- @Override
- public EventPayload payloadFor(Object changedObject, PublishingChangeKind kind) {
- return new ToDoItemPayload((ToDoItem) changedObject);
- }
-}
-----
-
-
-
-
-== Registering the Services
-
-There is no default implementation of this service provided by the core Apache Isis framework.
-
-Both the (non-ASF) Isis addons' http://github.com/isisaddons/isis-module-publishing[publishing] module and the
-http://github.com/isisaddons/isis-module-publishmq[publishmq] module provide implementations of this service.
-Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
-then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
-
-The modules also provide services that contribute to the UI. If contributions are not required in the UI, these can be
-suppressed either using security or by implementing a
-xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
-
-
-
-
-
-== Related Services
-
-The `PublishingService` is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations (for actions annotated with xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`]) and of changed objects (for objects annotated with xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`].
-
-The xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] meanwhile is intended for fine-grained publish/subscribe for object-to-object interactions within an Apache Isis domain object model. The event propagation is strictly in-memory, and there are no restrictions on the object acting as the event (it need not be serializable, for example).
-
-All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
-
-
-
-
-== Design Notes
-
-The following class diagram shows how the above components fit together:
-
-image::{_imagesdir}reference-services-spi/PublishingService/yuml.me-23db58a4.png[width="800px",link="{_imagesdir}reference-services-spi/PublishingService/yuml.me-23db58a4.png"]
-
-This yuml.me diagram was generated at http://yuml.me/edit/23db58a4[yuml.me].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_RepresentationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_RepresentationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_RepresentationService.adoc
deleted file mode 100644
index 664f1e0..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_RepresentationService.adoc
+++ /dev/null
@@ -1,103 +0,0 @@
-[[_rgsvc-spi_RepresentationService]]
-= `RepresentationService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `RepresentationService` is the main plug-in point for the xref:ugvro.adoc#[RestfulObjects viewer] to generate representations.
-
-The default implementation generates representations according to the link:http://restfulobjects.org[Restful Objects spec] v1.0. However, it also delegates to the xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`] which provides a mechanism for altering representations according to the HTTP `Accept` header.
-
-The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain Javascript library, say) expect, or at least works best with, a certain style of representation.
-
-In all there are three domain services that can influence the representations generated: this service, xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`]and the xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`]. The diagram below shows how these collaborate:
-
-image::{_imagesdir}reference-services-spi/RepresentationService/service-collaborations.png[width="700px",link="{_imagesdir}reference-services-spi/RepresentationService/service-collaborations.png"]
-
-The `RepresentationServiceForRestfulObjects` is the default implementation of this service; likewise `ContentNegotiationServiceXRoDomainType` is the default implementation of the `ContentNegotiationService`. If you inspect the source code you'll see that the default implementation of this service's primary responsibility is to generate the default Restful Objects representations. Therefore, if you what you want to do is to generate a _different _representation then in many cases replacing either this service _or_ the `ContentNegotiationService` will be equivalent (you'll notice that their SPIs are very similar).
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface RepresentationService {
- @Programmatic
- Response objectRepresentation( // <1>
- Context rendererContext,
- ObjectAdapter objectAdapter);
- @Programmatic
- Response propertyDetails( // <2>
- Context rendererContext,
- ObjectAndProperty objectAndProperty,
- MemberReprMode memberReprMode);
- @Programmatic
- Response collectionDetails( // <3>
- Context rendererContext,
- ObjectAndCollection objectAndCollection,
- MemberReprMode memberReprMode);
- @Programmatic
- Response actionPrompt( // <4>
- Context rendererContext,
- ObjectAndAction objectAndAction);
- @Programmatic
- Response actionResult( // <5>
- Context rendererContext,
- ObjectAndActionInvocation objectAndActionInvocation,
- ActionResultReprRenderer.SelfLink selfLink);
- public static interface Context extends RendererContext {
- ObjectAdapterLinkTo getAdapterLinkTo();
- }
-}
-----
-<1> representation of a single object, as per section 14.4 of the RO spec, v1.0
-<2> representation of a single property of an object, as per section 16.4 of the RO spec v1.0
-<3> representation of a single collection of an object, as per section 17.5 of the RO spec v1.0
-<4> representation of a single action (prompt) of an object, as per section 18.2 of the RO spec v1.0
-<5> representation of the results of a single action invocation, as per section 19.5 of the RO spec v1.0
-
-These methods provide:
-
-* a `RendererContext` which provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings)
-
-* an object representing the information to be rendered +
-+
-eg `ObjectAdapter`, `ObjectAndProperty`, `ObjectAndCollection` etc
-
-* for members, whether the representation is in read/write mode +
-+
-ie `MemberReprMode`
-
-
-
-[WARNING]
-====
-This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
-====
-
-
-
-== Implementation
-
-As discussed in the introduction, the framework provides a default implementation, `o.a.i.v.ro.rendering.service.RepresentationServiceForRestfulObjects`. This delegates to xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`] to generate an alternative representation; but if none is provided then it falls back on generating the representations as defined in the link:http://restfulobjects.org[Restful Objects spec] v1.0.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default implementation of `RepresentationService` service is automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-
-
-
-== Related Services
-
-The default implementation delegates to xref:rgsvc.adoc#_rgsvc-spi_ContentNegotiationService[`ContentNegotiationService`], whose default implementation may delegate in turn to xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`] (if present).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationService.adoc
deleted file mode 100644
index 7227e52..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationService.adoc
+++ /dev/null
@@ -1,80 +0,0 @@
-[[_rgsvc-spi_TranslationService]]
-= `TranslationService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `TranslationService` is the cornerstone of Apache Isis' i18n support. Its role is to be able to provide translated versions of the various elements within the Apache Isis metamodel (service and object classes, properties, collections, actions, action parameters) and also to translate business rule (disable/valid) messages, and exceptions. These translations provide for both singular and plural forms.
-
-
-[NOTE]
-====
-For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
-====
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface TranslationService {
- @Programmatic
- String translate(String context, String text); // <1>
- @Programmatic
- String translate(String context, // <2>
- String singularText,
- String pluralText, int num);
-
- enum Mode { READ, WRITE;}
- @Programmatic
- Mode getMode(); // <3>
-}
-
-----
-<1> translate the text, in the locale of the "current user".
-<2> return a translation of either the singular or the plural text, dependent on the `num` parameter, in the locale of the "current user"
-<3> whether this implementation is operating in read or in write mode.
-
-If in read mode, then the translations are expected to be present.
-
-If in write mode, then the implementation is saving translation keys, and will always return the untranslated translation.
-
-
-
-
-== Implementation
-
-The Apache Isis framework provides a default implementation (`TranslationServicePo`) that uses the GNU `.pot` and `.po` files for translations. It relies on the `LocaleProvider` service (to return the `Locale` of the current user) and also the `TranslationsResolver` service (to read existing translations).
-
-The framework also provides a supporting `TranslationServicePoMenu` provides menu items under the "Prototyping" secondary menu for controlling this service and downloading `.pot` files for translation.
-
-For more details on the implementation, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[i18n support].
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `TranslationService` service (along with the supporting menu service) are automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-If the menu items are not required then these can be suppressed either using security or by implementing a xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-
-== Related Services
-
-This service works in conjunction with xref:rgsvc.adoc#_rgsvc-spi_LocaleProvider[`LocaleProvider`] and xref:rgsvc.adoc#_rgsvc-spi_TranslationsResolver[`TranslationsResolver`] in order to provide i18n support.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationsResolver.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationsResolver.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationsResolver.adoc
deleted file mode 100644
index 30dab51..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_TranslationsResolver.adoc
+++ /dev/null
@@ -1,67 +0,0 @@
-[[_rgsvc-spi_TranslationsResolver]]
-= `TranslationsResolver`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `TranslationsResolver` service is one of the services that work together to implement Apache Isis' support for i18n, being used by Isis' default implementation of xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`].
-
-The role of the service itself is locate and return translations.
-
-
-[NOTE]
-====
-For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
-====
-
-
-
-== SPI
-
-The SPI defined by this service is:
-
-[source,java]
-----
-public interface TranslationsResolver {
- @Programmatic
- List<String> readLines(final String file);
-}
-----
-
-
-== Implementation
-
-Isis' xref:ugvw.adoc#[Wicket viewer] provides an implementation of this service (`TranslationsResolverWicket`) which leverages Apache Wicket APIs. This searches for translation files in the standard `WEB-INF/` directory.
-
-[NOTE]
-====
-Currently there is no equivalent implementation for the xref:ugvro.adoc#[RestfulObjects viewer].
-====
-
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `TranslationsResolver` is
-automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-
-
-== Related Services
-
-
-This service works in conjunction with xref:rgsvc.adoc#_rgsvc-spi_LocaleProvider[`LocaleProvider`] and xref:rgsvc.adoc#_rgsvc-spi_TranslationService[`TranslationService`] in order to provide i18n support.
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UrlEncodingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UrlEncodingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UrlEncodingService.adoc
deleted file mode 100644
index 18167a7..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UrlEncodingService.adoc
+++ /dev/null
@@ -1,59 +0,0 @@
-[[_rgsvc-spi_UrlEncodingService]]
-= `UrlEncodingService` (`1.11.0-SNAPSHOT`)
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `UrlEncodingService` (`1.11.0-SNAPSHOT`) defines a consistent way to convert strings to/from a form safe for use
-within a URL. The service is used by the framework to map xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]
-mementos (derived from the state of the view model itself) into a form that can be used as a view model. When the
-framework needs to recreate the view model (for example to invoke an action on it), this URL is converted back into a
-view model memento, from which the view model can then be hydrated.
-
-Defining this functionality as an SPI has two use cases:
-
-* first, (though some browsers support longer strings), there is a limit of 2083 characters for URLs. For view model
-mementos that correspond to large strings (as might occur when serializing a JAXB
-xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]-annotated view model), the service provides a
-hook. +
-+
-For example, each memento string could be mapped to a GUID held in some cluster-aware cache.
-
-* the service provides the ability, to encrypt the string in order to avoid leakage of potentially sensitive
-state within the URL.
-
-The framework provides a default implementation of this service, `UrlEncodingServiceUsingBaseEncoding` (also in the
-applib) that uses `base-64` encoding to `UTF-8` charset.
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface UrlEncodingService {
- @Programmatic
- public String encode(final String str); // <1>
- @Programmatic
- public String decode(String str); // <2>
-}
-----
-<1> convert the string (eg view model memento) into a string safe for use within an URL
-<2> unconvert the string from its URL form into its original form URL
-
-
-
-== Implementation
-
-The framework provides a default implementation (`UrlEncodingServiceUsingBaseEncoding`) that simply converts the string
-using base-64 encoding and UTF-8 character set. As already noted, be aware that the maximum length of a URL should not
-exceed 2083 characters. For large view models, there's the possibility that this limit could be exceeded; in such
-cases register an alternative implementation of this service.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserProfileService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserProfileService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserProfileService.adoc
deleted file mode 100644
index 9d7736c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserProfileService.adoc
+++ /dev/null
@@ -1,47 +0,0 @@
-[[_rgsvc-spi_UserProfileService]]
-= `UserProfileService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `UserProfileService` provides the ability for the domain application to return supplementary metadata about the current user. This information is used (by the xref:ugvw.adoc#[Wicket viewer]) to customize the appearance of the tertiary "Me" menu bar (top right). For example, rather than display the username, instead the user's first and last name could be displayed.
-
-Another use case is to allow the user to switch context in some fashion or other. This might be to emulate a sort of "sudo"-like function, or perhaps to focus on some particular set of data.
-
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface UserProfileService {
- @Programmatic
- String userProfileName(); // <1>
-}
-----
-<1> is used (in the Wicket viewer) as the menu name of the tertiary "Me" menu bar.
-
-If the method returns `null` or throws an exception then the framework will default to using the current user name.
-
-In the future this API may be expanded; one obvious possibility is to return a profile photo or avatar URL.
-
-
-
-== Implementation
-
-There is no default implementation of this service provided by the core Apache Isis framework.
-
-An example implementation can be found in the (non-ASF)
-http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]:
-
-image::{_imagesdir}reference-services-spi/UserProfileService/todoapp.png[width="800px",link="{_imagesdir}reference-services-spi/UserProfileService/todoapp.png"]
-
-
-[NOTE]
-====
-Currently this feature is not integrated with Apache Isis' authentication mechanisms; the information provided is purely metadata provided for presentation purposes only.
-====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserRegistrationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserRegistrationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserRegistrationService.adoc
deleted file mode 100644
index eaf5d63..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-spi_UserRegistrationService.adoc
+++ /dev/null
@@ -1,98 +0,0 @@
-[[_rgsvc-spi_UserRegistrationService]]
-= `UserRegistrationService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `UserRegistrationService` provides the ability for users to sign-up to access an application by providing a valid email address, and also provides the capability for users to reset their password if forgotten.
-
-For user sign-up, the xref:ugvw.adoc#[Wicket viewer] will check whether an implementation of this service (and also the xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`EmailNotificationService`]) is available, and if so will render a sign-up page where the user enters their email address. A verification email is sent (using the aforementioned `EmailNotificationService`) which includes a link back to the running application; this allows the user then to complete their registration process (choose user name, password and so on). When the user has provided the additional details, the Wicket viewer calls _this_ service in order to create an account for them, and then logs the user on.
-
-For the password reset feature, the Wicket viewer will render a password reset page, and use the `EmailNotificationService` to send a "password forgotten" email. This service provides the ability to reset a password based on the user's email address.
-
-It is of course possible for domain objects to use this service; it will be injected into domain object or other domain services in the usual way. That said, we expect that such use cases will be comparatively rare; the primary use case is for the Wicket viewer's sign-up page.
-
-[NOTE]
-====
-For further details on the user registration feature (as supported by the Wicket viewer), see xref:ugvw.adoc#_ugvw_features_user-registration[here].
-====
-
-
-
-== SPI
-
-The SPI defined by the service is:
-
-[source,java]
-----
-public interface UserRegistrationService {
- @Programmatic
- boolean usernameExists(String username); // <1>
- @Programmatic
- boolean emailExists(String emailAddress); // <2>
- @Programmatic
- void registerUser(String username, String password, String emailAddress); // <3>
- @Programmatic
- boolean updatePasswordByEmail(String emailAddress, String password); // <4>
-}
-----
-<1> checks if there is already a user with the specified username
-<2> checks if there is already a user with the specified email address
-<3> creates the user, with specified password and email address. The username and email address must both be unique (not being used by an existing user)
-<4> allows the user to reset their password
-
-
-
-
-== Implementation
-
-The core Apache Isis framework itself defines only an API; there is no default implementation. Rather, the implementation will depend on the security mechanism being used.
-
-That said, if you have configured your app to use the http://github.com/isisaddons/isis-module-security[Isis addons security module], then note that the security module does provide an abstract implementation (`SecurityModuleAppUserRegistrationServiceAbstract`) of the `UserRegistrationService`. You will need to extend that service and provide implementation for the two abstract methods: `getInitialRole()` and `getAdditionalInitialRoles()`.
-
-This is needed so that the self-registered users are assigned automatically to your application role(s) and be able to use the application. Without any role such user will be able only to see/use the logout link of the application.
-
-
-
-
-== Registering the Services
-
-There is no default implementation of this service provided by the core Apache Isis framework.
-
-If using the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module) for
-authentication and authorization, then note that it provides an adapter class,
-`SecurityModuleAppUserRegistrationServiceAbstract`, that provides most of the implementation. You are still required
-to implement a subclass and register.
-
-For example:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class AppUserRegistrationService extends SecurityModuleAppUserRegistrationServiceAbstract {
- protected ApplicationRole getInitialRole() {
- return findRole("regular-user");
- }
- protected Set<ApplicationRole> getAdditionalInitialRoles() {
- return Collections.singleton(findRole("self-registered-user"));
- }
- private ApplicationRole findRole(final String roleName) {
- return applicationRoles.findRoleByName(roleName);
- }
- @Inject
- private ApplicationRoles applicationRoles;
-}
-----
-
-
-
-== Related Services
-
-The most common use case is to allow users to sign-up through Apache Isis' Wicket viewer. Because the process requires email to be sent, the following services must be configured:
-
-* xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]
-* xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`EmailNotificationService`]
-* `UserRegistrationService` (this service)
-
-The `EmailService` in particular requires additional xref:rgcfg.adoc#_rgcfg_configuring-core[configuration properties] to specify the external SMTP service.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
new file mode 100644
index 0000000..a5d40c3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api.adoc
@@ -0,0 +1,317 @@
+[[_rgsvc_api]]
+= Domain Services API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Apache Isis includes an extensive number of domain services for your domain objects to use; simply define the service as an annotated field and Apache Isis will inject the service into your object. These services' API are all defined in Apache Isis' applib (`o.a.i.core:isis-core-applib` module); this minimizes the coupling between your code and Apache Isis. It also allows you to easily mock out these services in your unit tests.
+
+[NOTE]
+====
+In addition there are a number of domain services that constitute an SPI; if present they are used by Apache Isis itself rather than by your domain objects. A good example of this is the xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService3`] service. The SPI services are covered in the xref:rgsvc.adoc#_rgsvc_spi[Domain Services (SPI) chapter].
+====
+
+
+
+The table below summarizes all the APIs defined by Apache Isis. It also lists their corresponding implementation, either a default implementation provided by Apache Isis itself, or provided by one of the in (non-ASF) link:http://www.isisaddons.org[Isis Addons] modules.
+
+.Domain Services
+[cols="3,3a,3a,3a", options="header"]
+|===
+
+|API
+|Description
+|Implementation
+|Notes
+
+
+|xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`o.a.i.applib.` +
+`services.actinv` +
+`ActionInvocation-` +
+`Context`]
+|Request-scoped access to whether action is invoked on object and/or on collection of objects
+|`ActionInvocationContext` +
+``o.a.i.core`` +
+``isis-core-applib``
+|API is also concrete class
+
+
+|xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`o.a.i.applib.` +
+`services.background` +
+`BackgroundService`]
+|Programmatic persistence of commands to be persisted (so can be executed by a background mechanism, eg scheduler)
+|`BackgroundServiceDefault` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|depends on: +
+xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommand-Service`]
+
+
+|xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`o.a.i.applib.` +
+`services.bookmark` +
+`BookmarkService`]
+|Convert object reference to a serializable "bookmark", and vice versa
+|`BookmarkServiceDefault` +
+``o.a.i.core`` +
+``isis-core-metamodel``
+|related services:
+`BookmarkHolder-` +
+`ActionContributions`,
+`BookmarkHolder-` +
+`Association-` +
+`Contributions`
+
+
+|xref:rgsvc.adoc#_rgsvc_api_ClockService[`o.a.i.applib.` +
+`services.clock` +
+`ClockService`]
+|Access the current time (and for testing, allow the time to be changed)
+|`ClockService` +
+``o.a.i.core`` +
+``isis-core-applib``
+|API is also a concrete class.
+
+
+|xref:rgsvc.adoc#_rgsvc_api_CommandContext[`o.a.i.applib.` +
+`services.command` +
+`CommandContext`]
+|Request-scoped access the current action that is being invoked, represented as a command object
+|`CommandContext` +
+``o.a.i.core`` +
+``isis-core-applib``
+|API is also a concrete class. +
+depends on: +
+xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] for persistent `Command`, else in-memory impl. used
+
+|xref:rgsvc.adoc#_rgsvc_api_DeepLinkService[`o.a.i.applib` +
+`services.deeplink` +
+`DeepLinkService`]
+|Obtain a URL to a domain object (eg for use within an email or report)
+|`DeepLinkServiceWicket` +
+``o.a.i.viewer`` +
+``isis-viewer-wicket-impl``
+|Implementation only usable within Wicket viewer
+
+
+|xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`o.a.i.applib` +
+`DomainObjectContainer`]
+|Generic repository to search, create and delete objects. Also miscellaneous other functions, eg obtain title of object.
+|`DomainObjectContainer-` +
+`Default` +
+``o.a.i.core`` +
+``isis-core-metamodel``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_EmailService[`o.a.i.applib.` +
+`services.email` +
+`EmailService`]
+|Send a HTML email, optionally with attachments.
+|`EmailServiceDefault` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_EventBusService[`o.a.i.applib.` +
+`services.eventbus` +
+`EventBusService`]
+|Programmatically post events to the internal event bus. Also used by Apache Isis itself to broadcast domain events:
+
+* xref:rgant.adoc#_rgant-Action_domainEvent[`Action#domainEvent()`]
+* xref:rgant.adoc#_rgant-Property_domainEvent[`Property#domainEvent()`]
+* xref:rgant.adoc#_rgant-Collection_domainEvent[`Collection#domainEvent()`]
+|`EventBusServiceJdo` +
+``o.a.i.core`` +
+``isis-core-objectstore-jdo-datanucleus``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`o.a.i.applib.` +
+`services.` +
+`fixturespec` +
+`FixtureScriptsDefault`]
+|Fallback implementation of xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`], providing the ability to execute fixture scripts.
+|`FixtureScriptsDefault` +
+``o.a.i.core`` +
+``isis-core-applib``
+|Interacts with xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScripts-
+SpecificationProvider`].
+
+
+|xref:rgsvc.adoc#_rgsvc_api_GuiceBeanProvider[`o.a.i.applib.` +
+`services.guice` +
+`GuiceBeanProvider`]
+|Access to internal framework services initialized using Guice DI.
+|`GuiceBeanProviderWicket` +
+``o.a.i.core`` +
+``isis-viewer-wicket-impl``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`o.a.i.applib.` +
+`services.jdosupport` +
+`IsisJdoSupport`]
+|Lower level access to the JDO Persistence API.
+|`IsisJdoSupportImpl` +
+``o.a.i.core`` +
+``isis-core-objectstore-jdo-datanucleus``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_JaxbService[`o.a.i.applib.` +
+`services.jaxb` +
+`JaxbService`]
+|Marshal and unmarshal JAXB-annotated view models to/from XML.
+|`JaxbServiceDefault` +
+``o.a.i.core`` +
+``isis-core-schema``
+|`1.11.0-SNAPSHOT`.
+
+
+|xref:rgsvc.adoc#_rgsvc_api_MementoService[`o.a.i.applib.` +
+`services.memento` +
+`MementoService`]
+|Capture a serializable memento of a set of primitives or xref:rgsvc.adoc#_rgsvc_api_BookmarkService[bookmarks]. Primarily used internally, eg in support of commands/auditing.
+|`MementoServiceDefault` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_MetaModelService[`o.a.i.applib.` +
+`services.metamodel` +
+`MetaModelService`]
+|Access to certain information from the Apache Isis metamodel.
+|`MetaModelServiceDefault` +
+``o.a.i.core`` +
+``isis-core-metamodel``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`o.a.i.applib.` +
+`services.` +
+`queryresultscache` +
+`QueryResultsCache`]
+|Request-scoped caching of the results of queries (or any data set generated by a given set of input arguments).
+|`QueryResultsCache` +
+``o.a.i.core`` +
+``isis-core-applib``
+|API is also a concrete class
+
+
+|xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`o.a.i.applib.` +
+`services.scratchpad` +
+`Scratchpad`]
+|Request-scoped service for interchanging information between and aggregating over multiple method calls; in particular for use by "bulk" actions (invoking of an action for all elements of a collection)
+|`Scratchpad` +
+``o.a.i.core`` +
+``isis-core-applib``
+|API is also a concrete class
+
+
+|xref:rgsvc.adoc#_rgsvc_api_SudoService[`o.a.i.applib.` +
+`services.sudo` +
+`SudoService`]
+|For use in testing while running xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[fixture scripts], allows a block of code to run as a specified user account.
+|`SudoServiceDefault` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|API is also a concrete class
+
+
+|xref:rgsvc.adoc#_rgsvc_api_SwaggerService[`o.a.i.applib.` +
+`services.sudo` +
+`SwaggerService`]
+|(`1.11.0-SNAPSHOT`) Generates link:http://swagger.io/[Swagger] spec files to describe the public and/or private RESTful APIs exposed by the xref:ugvro.adoc#[RestfulObjects viewer]. These can then be used with the link:http://swagger.io/swagger-ui/[Swagger UI] page to explore the REST API, or used to generate client-side stubs using the link:http://swagger.io/swagger-codegen/[Swagger codegen] tool, eg for use in a custom REST client app.
+|`SwaggerServiceDefault` +
+``o.a.i.core`` +
+``isis-core-metamodel``
+|A `SwaggerServiceMenu` domain service is also provided which enables the swagger spec to be downloaded. Apache Isis' xref:cg.adoc#_cg_isis-maven-plugin[Maven plugin] also provides a xref:cg.adoc#_cg_isis-maven-plugin_swagger[swagger goal] which allows the spec file(s) to be generated at build time (eg so that client-side stubs can then be generated in turn).
+
+
+|xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`o.a.i.applib.` +
+`services.wrapper` +
+`WrapperFactory`]
+|Interact with another domain object "as if" through the UI (enforcing business rules, firing domain events)
+|`WrapperFactoryDefault` +
+``o.a.i.core`` +
+``isis-core-wrapper``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`o.a.i.applib.` +
+`services.xmlsnapshot` +
+`XmlSnapshotService`]
+|Generate an XML representation of an object and optionally a graph of related objects.
+|`XmlSnapshotServiceDefault` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|
+
+|===
+
+Key:
+
+* `o.a.i` is an abbreviation for `org.apache.isis`
+* `o.ia.m` is an abbreviation for `org.isisaddons.module`
+
+
+
+
+
+There is also a number of deprecated domain services.
+
+.Deprecated Domain Services
+[cols="3,3a,3a,3a", options="header"]
+|===
+
+|API
+|Description
+|Implementation
+|Notes
+
+|`o.a.i.applib.` +
+`annotation`
+`Bulk.InteractionContext`
+|Request-scoped access to whether action is invoked on object and/or on collection of objects
+|`Bulk.InteractionContext` +
+``o.a.i.core`` +
+``isis-core-applib``
+|Replaced by xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`ActionInvocationContext`]
+
+
+
+|===
+
+Key:
+
+* `o.a.i` is an abbreviation for `org.apache.isis`
+* `o.ia.m` is an abbreviation for `org.isisaddons.module`
+
+
+
+include::_rgsvc_api_ActionInvocationContext.adoc[leveloffset=+1]
+include::_rgsvc_api_BackgroundService.adoc[leveloffset=+1]
+include::_rgsvc_api_BookmarkService.adoc[leveloffset=+1]
+include::_rgsvc_api_ClockService.adoc[leveloffset=+1]
+include::_rgsvc_api_CommandContext.adoc[leveloffset=+1]
+include::_rgsvc_api_DeepLinkService.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer.adoc[leveloffset=+1]
+include::_rgsvc_api_EmailService.adoc[leveloffset=+1]
+include::_rgsvc_api_EventBusService.adoc[leveloffset=+1]
+include::_rgsvc_api_FixtureScriptsDefault.adoc[leveloffset=+1]
+include::_rgsvc_api_GuiceBeanProvider.adoc[leveloffset=+1]
+include::_rgsvc_api_IsisJdoSupport.adoc[leveloffset=+1]
+include::_rgsvc_api_JaxbService.adoc[leveloffset=+1]
+include::_rgsvc_api_MementoService.adoc[leveloffset=+1]
+include::_rgsvc_api_MetamodelService.adoc[leveloffset=+1]
+include::_rgsvc_api_QueryResultsCache.adoc[leveloffset=+1]
+include::_rgsvc_api_Scratchpad.adoc[leveloffset=+1]
+include::_rgsvc_api_SudoService.adoc[leveloffset=+1]
+include::_rgsvc_api_SwaggerService.adoc[leveloffset=+1]
+include::_rgsvc_api_WrapperFactory.adoc[leveloffset=+1]
+include::_rgsvc_api_XmlSnapshotService.adoc[leveloffset=+1]
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ActionInvocationContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ActionInvocationContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ActionInvocationContext.adoc
new file mode 100644
index 0000000..dddf939
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ActionInvocationContext.adoc
@@ -0,0 +1,98 @@
+[[_rgsvc_api_ActionInvocationContext]]
+= `ActionInvocationContext`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `ActionInvocationContext` domain service is a xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] service intended to support the implementation of "bulk" actions annotated with xref:rgant.adoc#_rgant-Action_invokeOn[`@Action#invokeOn()`]. This allows the user to select multiple objects in a table and then invoke the same action against all of them.
+
+When an action is invoked in this way, this service allows each object instance to "know where it is" in the collection; it acts a little like an iterator. In particular, an object can determine if it is the last object to be called, and so can perform special processing, eg to return a summary calculated result.
+
+== API
+
+The API defined by the service is:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+@RequestScoped // <1>
+public static class ActionInvocationContext {
+ public InvokedOn getInvokedOn() { ... } // <2>
+ public List<Object> getDomainObjects() { ... } // <3>
+ public int getSize() { ... }
+ public int getIndex() { ... } // <4>
+ public boolean isFirst() { ... }
+ public boolean isLast() { ... }
+}
+----
+<1> is xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`], so this domain service instance is scoped to a particular request and is then destroyed
+<2> an enum set to either `OBJECT` (if action has been invoked on a single object) or `COLLECTION` (if has been invoked on a collection).
+<3> returns the list of domain objects which are being acted upon
+<4> is the 0-based index to the object being acted upon.
+
+
+
+== Usage
+
+For actions that are void or that return null, Apache Isis will return to the list once executed. But for bulk actions that are non-void, Apache Isis will render the returned object/value from the last object invoked (and simply discards the object/value of all actions except the last).
+
+One idiom is for the domain objects to also use the xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`] service to share information, for example to aggregate values. The `ActionInvocationContext#isLast()` method can then be used to determine if all the information has been gathered, and then do something with it (eg derive variance across a range of values, render a graph etc).
+
+More prosaically, the `ActoinInvocationContext` can be used to ensure that the action behaves appropriately depending on how it has been invoked (on a single object and/or a collection) whether it is called in bulk mode or regular mode. Here's a snippet of code from the bulk action in the Isis addon example https://github.com/isisaddons/isis-app-todoapp/[todoapp] (not ASF):
+
+[source,java]
+----
+public class ToDoItem ... {
+ @Action(invokeOn=InvokeOn.OBJECTS_AND_COLLECTIONS)
+ public ToDoItem completed() {
+ setComplete(true);
+ ...
+ return actionInteractionContext.getInvokedOn() == InvokedOn.OBJECT
+ ? this // <1>
+ : null; // <2>
+ }
+ @Inject
+ ActionInteractionContext actionInteractionContext;
+}
+----
+<1> if invoked as a regular action, return this object;
+<2> otherwise (if invoked on collection of objects), return null, so that the xref:ugvw.adoc#[Wicket viewer] will re-render the list of objects
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
+implementation of `ActionInvocationContext` class is automatically registered (it is annotated with `@DomainService`)
+so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+== Unit testing support
+
+The `ActionInvocationContext` class also has a couple of static factory methods intended to support unit testing:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+@RequestScoped
+public class ActionInvocationContext {
+ public static ActionInvocationContext onObject(final Object domainObject) {
+ return new ActionInvocationContext(InvokedOn.OBJECT, Collections.singletonList(domainObject));
+ }
+ public static ActionInvocationContext onCollection(final Object... domainObjects) {
+ return onCollection(Arrays.asList(domainObjects));
+ }
+ public static ActionInvocationContext onCollection(final List<Object> domainObjects) {
+ return new ActionInvocationContext(InvokedOn.COLLECTION, domainObjects);
+ }
+ ...
+}
+----
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService.adoc
new file mode 100644
index 0000000..5909bd5
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService.adoc
@@ -0,0 +1,123 @@
+[[_rgsvc_api_BackgroundService]]
+= `BackgroundService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `BackgroundService`, and the companion xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`] SPI service (used by Apache Isis itself), enable action invocations to be persisted such that they may be invoked in the background.
+
+The `BackgroundService` is responsible for capturing a memento representing the action invocation in a typesafe way, and persisting it rather than executing it directly.
+
+The default `BackgroundServiceDefault` implementation (provided by isis-core) works by using a proxy wrapper around the target so that it can capture the action to invoke and its arguments using (a private copy of) xref:rgsvc.adoc#_rgsvc_api_MementoService[`MementoService`]. The persistence delegates the persistence of the memento to an appropriate implementation of the companion `BackgroundCommandService`. One such implementation of `BackgroundCommandService` is provided by (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module.
+
+The persisting of commands is only half the story; there needs to be a separate process to read the commands and execute them. The `BackgroundCommandExecution` abstract class (discussed xref:rgsvc.adoc#_rgsvc_api_BackgroundService_BackgroundCommandExecution[below]) provides infrastructure to do this; the concrete
+implementation of this class depends on the configured `BackgroundCommandService` (in order to query for the persisted (background) ``Command``s.
+
+
+
+== API & Implementation
+
+Returns a proxy around the object which is then used to obtain the signature of the action to be invoked in the background.
+
+[source,java]
+----
+public interface BackgroundService {
+ @Programmatic
+ <T> T execute(final T object);
+}
+----
+
+The default implementation is provided by core (`o.a.i.core.runtime.services.background.BackgroundServiceDefault`).
+
+
+
+== Usage
+
+Using the service is very straight-forward; wrap the target domain object using `BackgroundService#execute(...)` and invoke the method on the object returned by that method.
+
+For example:
+
+[source,java]
+----
+public void submitCustomerInvoices() {
+ for(Customer customer: customerRepository.findCustomersToInvoice()) {
+ backgroundService.execute(customer).submitInvoice();
+ }
+ container.informUser("Calculating...");
+}
+----
+
+This will create a bunch of background commands executing the `submitInvoice()` action for each of the customers returned from the customer repository.
+
+The action method invoked must be part of the Apache Isis metamodel, which is to say it must be public, accept only scalar arguments, and must not be annotated with xref:rgant.adoc#_rgant-Programmatic[`@Programmatic`] or `@Ignore`. However, it may be annotated with xref:rgant.adoc#_rgant-Action_hidden[`@Action#hidden()`] or xref:rgant.adoc#_rgant-ActionLayout_hidden[`@ActionLayout#hidden()`] and it will still be invoked.
+
+In fact, when invoked by the background service, no business rules (hidden, disabled, validation) are enforced; the action method must take responsibility for performing appropriate validation and error checking.
+
+[TIP]
+====
+If you want to check business rules, you can use xref:rgant.adoc#_rgant-WrapperFactory[`@WrapperFactory#wrapNoExecute(...)`].
+====
+
+
+
+== End-user experience
+
+For the end-user, executing an action that delegates work off to the `BackgroundService` raises the problem of how does the user know the work is complete?
+
+One option is for the background jobs to take responsibility to notify the user themselves. In the above example, this would be the `submitInvoice()` method called upon each customer. One could imagine more complex designs where only the final command executed notifies the user.
+
+However, an alternative is to rely on the fact that the `BackgroundService` will automatically hint that the `Command` representing the original interaction (to `submitCustomerInvoices()` in the example above) should be persisted. This will be available if the related xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] and xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] domain services are configured, and the `CommandService` supports persistent commands. Note that (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module does indeed provide such an implementation of `CommandService` (as well as of the required `BackgroundCommandService`).
+
+Thus, the original action can run a query to obtain it corresponding `Command`, and return this to the user. The upshot is that the child ``Command``s created by the `BackgroundService` will then be associated with `Command` for the original action.
+
+We could if we wanted write the above example as follows:
+
+[source,java]
+----
+public Command submitCustomerInvoices() {
+ for(Customer customer: customerRepository.findCustomersToInvoice()) {
+ backgroundService.execute(customer).submitInvoice();
+ }
+ return commandContext.getCommand();
+}
+@Inject
+CommandContext commandContext; // <1>
+----
+<1> the injected xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] domain service.
+
+The user would be returned a domain object representing their action invocation.
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `BackgroundService` is automatically registered (it is annotated with `@DomainService`) so no
+further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+== Related Services
+
+This service is closely related to the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] and also that service's supporting xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] service.
+
+The `CommandContext` service is responsible for providing a parent `Command` with which the background ``Command``s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s. The latter is analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s.
+
+The implementations of `CommandService` and `BackgroundCommandService` go together; typically both parent `Command`s and child background `Command`s will be persisted in the same way. The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides implementations of both (see xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]).
+
+
+include::_rgsvc_api_BackgroundService_BackgroundCommandExecution.adoc[leveloffset=+1]
+include::_rgsvc_api_BackgroundService_Quartz.adoc[leveloffset=+1]
+
+
+
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_BackgroundCommandExecution.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_BackgroundCommandExecution.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_BackgroundCommandExecution.adoc
new file mode 100644
index 0000000..3acf433
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_BackgroundCommandExecution.adoc
@@ -0,0 +1,25 @@
+[[_rgsvc_api_BackgroundService_BackgroundCommandExecution]]
+= `BackgroundCommandExecution` abstract class
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `BackgroundCommandExecution` (in isis-core) is an abstract template class provided by isis-core that defines an abstract hook method to obtain background `Command`s to be executed:
+
+[source,java]
+----
+public abstract class BackgroundCommandExecution
+ extends AbstractIsisSessionTemplate {
+ ...
+ protected abstract List<? extends Command> findBackgroundCommandsToExecute();
+ ...
+}
+----
+
+The developer is required to implement this hook method in a subclass.
+
+
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_Quartz.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_Quartz.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_Quartz.adoc
new file mode 100644
index 0000000..6a4dd36
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BackgroundService_Quartz.adoc
@@ -0,0 +1,162 @@
+[[_rgsvc_api_BackgroundService_Quartz]]
+= Quartz Scheduler Configuration
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The last part of the puzzle is to actually run the (appropriate implementation of) `BackgroundCommandExecution). This could be run in a batch job overnight, or run continually by, say, the http://quartz-scheduler.org[Quartz] scheduler or by http://camel.apache.org]Apache Camel]. This section looks at configuring Quartz.
+
+If using (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module, then note that this already provides a suitable concrete implementation, namely `org.isisaddons.module.command.dom.BackgroundCommandExecutionFromBackgroundCommandServiceJdo`. We therefore just need to schedule this to run as a Quartz job.
+
+
+First, we need to define a Quartz job, for example:
+
+[source,java]
+----
+import org.isisaddons.module.command.dom.BackgroundCommandExecutionFromBackgroundCommandServiceJdo;
+public class BackgroundCommandExecutionQuartzJob extends AbstractIsisQuartzJob {
+ public BackgroundCommandExecutionQuartzJob() {
+ super(new BackgroundCommandExecutionFromBackgroundCommandServiceJdo());
+ }
+}
+----
+
+where `AbstractIsisQuartzJob` is in turn the following boilerplate:
+
+[source,java]
+----
+package domainapp.webapp.quartz;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+...
+public class AbstractIsisQuartzJob implements Job {
+ public static enum ConcurrentInstancesPolicy {
+ SINGLE_INSTANCE_ONLY,
+ MULTIPLE_INSTANCES
+ }
+
+ private final AbstractIsisSessionTemplate isisRunnable;
+ private final ConcurrentInstancesPolicy concurrentInstancesPolicy;
+ private boolean executing;
+
+ public AbstractIsisQuartzJob(AbstractIsisSessionTemplate isisRunnable) {
+ this(isisRunnable, ConcurrentInstancesPolicy.SINGLE_INSTANCE_ONLY);
+ }
+ public AbstractIsisQuartzJob(
+ AbstractIsisSessionTemplate isisRunnable,
+ ConcurrentInstancesPolicy concurrentInstancesPolicy) {
+ this.isisRunnable = isisRunnable;
+ this.concurrentInstancesPolicy = concurrentInstancesPolicy;
+ }
+
+ public void execute(final JobExecutionContext context)
+ throws JobExecutionException {
+ final AuthenticationSession authSession = newAuthSession(context);
+ try {
+ if(concurrentInstancesPolicy == ConcurrentInstancesPolicy.SINGLE_INSTANCE_ONLY &&
+ executing) {
+ return;
+ }
+ executing = true;
+
+ isisRunnable.execute(authSession, context);
+ } finally {
+ executing = false;
+ }
+ }
+
+ AuthenticationSession newAuthSession(JobExecutionContext context) {
+ String user = getKey(context, SchedulerConstants.USER_KEY);
+ String rolesStr = getKey(context, SchedulerConstants.ROLES_KEY);
+ String[] roles = Iterables.toArray(
+ Splitter.on(",").split(rolesStr), String.class);
+ return new SimpleSession(user, roles);
+ }
+
+ String getKey(JobExecutionContext context, String key) {
+ return context.getMergedJobDataMap().getString(key);
+ }
+}
+----
+
+
+This job can then be configured to run using Quartz' `quartz-config.xml` file:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<job-scheduling-data
+ xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData
+http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
+ version="1.8">
+ <schedule>
+ <job>
+ <name>BackgroundCommandExecutionJob</name>
+ <group>Isis</group>
+ <description>
+ Poll and execute any background actions persisted by the BackgroundActionServiceJdo domain service
+ </description>
+ <job-class>domainapp.webapp.quartz.BackgroundCommandExecutionQuartzJob</job-class>
+ <job-data-map>
+ <entry>
+ <key>webapp.scheduler.user</key>
+ <value>scheduler_user</value>
+ </entry>
+ <entry>
+ <key>webapp.scheduler.roles</key>
+ <value>admin_role</value>
+ </entry>
+ </job-data-map>
+ </job>
+ <trigger>
+ <cron>
+ <name>BackgroundCommandExecutionJobEveryTenSeconds</name>
+ <job-name>BackgroundCommandExecutionJob</job-name>
+ <job-group>Isis</job-group>
+ <cron-expression>0/10 * * * * ?</cron-expression>
+ </cron>
+ </trigger>
+ </schedule>
+</job-scheduling-data>
+----
+
+The remaining two pieces of configuration are the `quartz.properties` file:
+
+[source,ini]
+----
+org.quartz.scheduler.instanceName = SchedulerQuartzConfigXml
+org.quartz.threadPool.threadCount = 1
+org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
+org.quartz.plugin.jobInitializer.class =org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
+org.quartz.plugin.jobInitializer.fileNames = webapp/scheduler/quartz-config.xml
+org.quartz.plugin.jobInitializer.failOnFileNotFound = true
+----
+
+and the entry in `web.xml` for the Quartz servlet:
+
+[source,xml]
+----
+<servlet>
+ <servlet-name>QuartzInitializer</servlet-name>
+ <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
+ <init-param>
+ <param-name>config-file</param-name>
+ <param-value>webapp/scheduler/quartz.properties</param-value>
+ </init-param>
+ <init-param>
+ <param-name>shutdown-on-unload</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>start-scheduler-on-load</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+----
+
[11/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
ISIS-1243: fixing naming of the domain service API and SPI docs, also fix to asciidoc template.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/46825ce1
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/46825ce1
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/46825ce1
Branch: refs/heads/master
Commit: 46825ce182434b7854f3b91c9f2a5d04fd2204ed
Parents: d231dcf
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Dec 22 09:28:24 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Dec 22 09:28:24 2015 +0000
----------------------------------------------------------------------
adocs/documentation/monitor.rb | 42 +-
.../_migration-notes_1.10.0-to-1.11.0.adoc | 2 +-
...tes_1.8.0-to-1.9.0_exception-recognizer.adoc | 2 +-
..._fixture-scripts-specification-provider.adoc | 2 +-
.../_migration-notes_1.9.0-to-1.10.0.adoc | 4 +-
.../asciidoc/guides/_cg_asciidoc-templates.adoc | 8 +-
.../asciidoc/guides/_cg_isis-maven-plugin.adoc | 2 +-
.../guides/_cg_isis-maven-plugin_swagger.adoc | 2 +-
.../guides/_cg_isis-maven-plugin_xsd.adoc | 2 +-
.../src/main/asciidoc/guides/_rgant-Action.adoc | 10 +-
.../asciidoc/guides/_rgant-Action_command.adoc | 18 +-
.../guides/_rgant-Action_domainEvent.adoc | 8 +-
.../guides/_rgant-Action_publishing.adoc | 2 +-
.../guides/_rgant-Action_semantics.adoc | 2 +-
.../main/asciidoc/guides/_rgant-Collection.adoc | 2 +-
.../guides/_rgant-Collection_domainEvent.adoc | 8 +-
.../guides/_rgant-Collection_notPersisted.adoc | 2 +-
.../asciidoc/guides/_rgant-Discriminator.adoc | 2 +-
.../asciidoc/guides/_rgant-DomainObject.adoc | 16 +-
.../guides/_rgant-DomainObjectLayout.adoc | 6 +-
...gant-DomainObjectLayout_cssClassUiEvent.adoc | 8 +-
.../_rgant-DomainObjectLayout_iconUiEvent.adoc | 8 +-
.../_rgant-DomainObjectLayout_titleUiEvent.adoc | 8 +-
.../guides/_rgant-DomainObject_auditing.adoc | 2 +-
...gant-DomainObject_createdLifecycleEvent.adoc | 8 +-
...rgant-DomainObject_loadedLifecycleEvent.adoc | 4 +-
.../guides/_rgant-DomainObject_objectType.adoc | 2 +-
...nt-DomainObject_persistedLifecycleEvent.adoc | 4 +-
...t-DomainObject_persistingLifecycleEvent.adoc | 4 +-
.../guides/_rgant-DomainObject_publishing.adoc | 2 +-
...ant-DomainObject_removingLifecycleEvent.adoc | 4 +-
...gant-DomainObject_updatedLifecycleEvent.adoc | 4 +-
...ant-DomainObject_updatingLifecycleEvent.adoc | 4 +-
.../src/main/asciidoc/guides/_rgant-Inject.adoc | 4 +-
.../guides/_rgant-PersistenceCapable.adoc | 2 +-
.../asciidoc/guides/_rgant-PostConstruct.adoc | 4 +-
.../main/asciidoc/guides/_rgant-PreDestroy.adoc | 2 +-
.../main/asciidoc/guides/_rgant-PrimaryKey.adoc | 2 +-
.../asciidoc/guides/_rgant-Programmatic.adoc | 2 +-
.../main/asciidoc/guides/_rgant-Property.adoc | 2 +-
.../guides/_rgant-Property_domainEvent.adoc | 6 +-
.../guides/_rgant-Property_notPersisted.adoc | 2 +-
.../asciidoc/guides/_rgant-RequestScoped.adoc | 2 +-
.../main/asciidoc/guides/_rgant-ViewModel.adoc | 2 +-
.../guides/_rgant-XmlJavaTypeAdapter.adoc | 2 +-
.../asciidoc/guides/_rgant-XmlRootElement.adoc | 4 +-
.../main/asciidoc/guides/_rgant_aaa_jee.adoc | 2 +-
.../guides/_rgcfg_configuring-core.adoc | 16 +-
.../main/asciidoc/guides/_rgcms_classes.adoc | 2 +-
.../guides/_rgcms_classes_domainevent.adoc | 2 +-
...s_classes_domainevent_ActionDomainEvent.adoc | 2 +-
.../guides/_rgcms_classes_lifecycleevent.adoc | 12 +-
...asses_lifecycleevent_ObjectCreatedEvent.adoc | 2 +-
...ses_lifecycleevent_ObjectPersistedEvent.adoc | 2 +-
...es_lifecycleevent_ObjectPersistingEvent.adoc | 2 +-
...sses_lifecycleevent_ObjectRemovingEvent.adoc | 2 +-
...asses_lifecycleevent_ObjectUpdatedEvent.adoc | 2 +-
...sses_lifecycleevent_ObjectUpdatingEvent.adoc | 2 +-
.../guides/_rgcms_classes_roles_Dto.adoc | 2 +-
.../_rgcms_classes_roles_HoldsUpdatedAt.adoc | 2 +-
.../_rgcms_classes_roles_Persistable.adoc | 2 +-
.../asciidoc/guides/_rgcms_classes_super.adoc | 2 +-
...s_classes_super_AbstractContainedObject.adoc | 4 +-
...gcms_classes_super_AbstractDomainObject.adoc | 2 +-
.../_rgcms_classes_super_AbstractService.adoc | 2 +-
..._rgcms_classes_super_AbstractSubscriber.adoc | 4 +-
.../_rgcms_classes_super_FixtureScripts.adoc | 4 +-
.../asciidoc/guides/_rgcms_classes_uievent.adoc | 2 +-
.../guides/_rgcms_methods_lifecycle.adoc | 2 +-
.../_rgcms_methods_lifecycle_created.adoc | 4 +-
.../_rgcms_methods_lifecycle_jdo-api.adoc | 4 +-
.../guides/_rgcms_methods_lifecycle_loaded.adoc | 2 +-
.../_rgcms_methods_lifecycle_persisted.adoc | 2 +-
.../_rgcms_methods_lifecycle_persisting.adoc | 2 +-
.../_rgcms_methods_lifecycle_removed.adoc | 2 +-
.../_rgcms_methods_lifecycle_removing.adoc | 2 +-
.../_rgcms_methods_lifecycle_updated.adoc | 2 +-
.../_rgcms_methods_lifecycle_updating.adoc | 2 +-
.../guides/_rgcms_methods_prefixes_default.adoc | 4 +-
.../guides/_rgcms_methods_reserved_title.adoc | 2 +-
.../main/asciidoc/guides/_rgcms_schema-aim.adoc | 2 +-
.../asciidoc/guides/_rgcms_schema-common.adoc | 2 +-
.../src/main/asciidoc/guides/_rgsvc-api.adoc | 317 ---------------
.../_rgsvc-api_ActionInvocationContext.adoc | 98 -----
.../guides/_rgsvc-api_BackgroundService.adoc | 123 ------
...roundService_BackgroundCommandExecution.adoc | 25 --
.../_rgsvc-api_BackgroundService_Quartz.adoc | 162 --------
.../guides/_rgsvc-api_BookmarkService.adoc | 116 ------
.../_rgsvc-api_BulkInteractionContext.adoc | 9 -
.../guides/_rgsvc-api_ClockService.adoc | 101 -----
.../guides/_rgsvc-api_CommandContext.adoc | 216 ----------
.../guides/_rgsvc-api_DeepLinkService.adoc | 56 ---
.../_rgsvc-api_DomainObjectContainer.adoc | 40 --
...nObjectContainer_generic-repository-api.adoc | 89 ----
...-api_DomainObjectContainer_messages-api.adoc | 50 ---
...mainObjectContainer_object-creation-api.adoc | 49 ---
...nObjectContainer_object-persistence-api.adoc | 62 ---
..._DomainObjectContainer_presentation-api.adoc | 46 ---
...pi_DomainObjectContainer_properties-api.adoc | 54 ---
...-api_DomainObjectContainer_security-api.adoc | 48 ---
...-api_DomainObjectContainer_services-api.adoc | 37 --
...pi_DomainObjectContainer_validation-api.adoc | 26 --
.../guides/_rgsvc-api_EmailService.adoc | 95 -----
.../guides/_rgsvc-api_EventBusService.adoc | 405 -------------------
.../_rgsvc-api_FixtureScriptsDefault.adoc | 50 ---
.../guides/_rgsvc-api_GuiceBeanProvider.adoc | 91 -----
.../guides/_rgsvc-api_IsisJdoSupport.adoc | 276 -------------
.../asciidoc/guides/_rgsvc-api_JaxbService.adoc | 68 ----
.../guides/_rgsvc-api_MementoService.adoc | 131 ------
.../guides/_rgsvc-api_MetamodelService.adoc | 42 --
.../guides/_rgsvc-api_QueryResultsCache.adoc | 126 ------
.../asciidoc/guides/_rgsvc-api_Scratchpad.adoc | 128 ------
.../asciidoc/guides/_rgsvc-api_SudoService.adoc | 69 ----
.../guides/_rgsvc-api_SwaggerService.adoc | 71 ----
.../guides/_rgsvc-api_WrapperFactory.adoc | 162 --------
.../guides/_rgsvc-api_XmlSnapshotService.adoc | 220 ----------
.../src/main/asciidoc/guides/_rgsvc-spi.adoc | 299 --------------
.../guides/_rgsvc-spi_AuditingService.adoc | 85 ----
.../_rgsvc-spi_BackgroundCommandService.adoc | 131 ------
.../_rgsvc-spi_ClassDiscoveryService.adoc | 82 ----
.../guides/_rgsvc-spi_CommandService.adoc | 100 -----
.../_rgsvc-spi_ContentMappingService.adoc | 107 -----
.../_rgsvc-spi_ContentNegotiationService.adoc | 204 ----------
.../_rgsvc-spi_EmailNotificationService.adoc | 81 ----
.../_rgsvc-spi_ErrorReportingService.adoc | 106 -----
.../guides/_rgsvc-spi_EventSerializer.adoc | 74 ----
.../guides/_rgsvc-spi_ExceptionRecognizer.adoc | 119 ------
...spi_FixtureScriptsSpecificationProvider.adoc | 76 ----
.../guides/_rgsvc-spi_LocaleProvider.adoc | 70 ----
.../guides/_rgsvc-spi_PublishingService.adoc | 192 ---------
.../_rgsvc-spi_RepresentationService.adoc | 103 -----
.../guides/_rgsvc-spi_TranslationService.adoc | 80 ----
.../guides/_rgsvc-spi_TranslationsResolver.adoc | 67 ---
.../guides/_rgsvc-spi_UrlEncodingService.adoc | 59 ---
.../guides/_rgsvc-spi_UserProfileService.adoc | 47 ---
.../_rgsvc-spi_UserRegistrationService.adoc | 98 -----
.../src/main/asciidoc/guides/_rgsvc_api.adoc | 317 +++++++++++++++
.../_rgsvc_api_ActionInvocationContext.adoc | 98 +++++
.../guides/_rgsvc_api_BackgroundService.adoc | 123 ++++++
...roundService_BackgroundCommandExecution.adoc | 25 ++
.../_rgsvc_api_BackgroundService_Quartz.adoc | 162 ++++++++
.../guides/_rgsvc_api_BookmarkService.adoc | 116 ++++++
.../_rgsvc_api_BulkInteractionContext.adoc | 9 +
.../guides/_rgsvc_api_ClockService.adoc | 101 +++++
.../guides/_rgsvc_api_CommandContext.adoc | 216 ++++++++++
.../guides/_rgsvc_api_DeepLinkService.adoc | 56 +++
.../_rgsvc_api_DomainObjectContainer.adoc | 40 ++
...nObjectContainer_generic-repository-api.adoc | 89 ++++
..._api_DomainObjectContainer_messages-api.adoc | 50 +++
...mainObjectContainer_object-creation-api.adoc | 49 +++
...nObjectContainer_object-persistence-api.adoc | 62 +++
..._DomainObjectContainer_presentation-api.adoc | 46 +++
...pi_DomainObjectContainer_properties-api.adoc | 54 +++
..._api_DomainObjectContainer_security-api.adoc | 48 +++
..._api_DomainObjectContainer_services-api.adoc | 37 ++
...pi_DomainObjectContainer_validation-api.adoc | 26 ++
.../guides/_rgsvc_api_EmailService.adoc | 95 +++++
.../guides/_rgsvc_api_EventBusService.adoc | 405 +++++++++++++++++++
.../_rgsvc_api_FixtureScriptsDefault.adoc | 50 +++
.../guides/_rgsvc_api_GuiceBeanProvider.adoc | 91 +++++
.../guides/_rgsvc_api_IsisJdoSupport.adoc | 276 +++++++++++++
.../asciidoc/guides/_rgsvc_api_JaxbService.adoc | 68 ++++
.../guides/_rgsvc_api_MementoService.adoc | 131 ++++++
.../guides/_rgsvc_api_MetamodelService.adoc | 42 ++
.../guides/_rgsvc_api_QueryResultsCache.adoc | 126 ++++++
.../asciidoc/guides/_rgsvc_api_Scratchpad.adoc | 128 ++++++
.../asciidoc/guides/_rgsvc_api_SudoService.adoc | 69 ++++
.../guides/_rgsvc_api_SwaggerService.adoc | 71 ++++
.../guides/_rgsvc_api_WrapperFactory.adoc | 162 ++++++++
.../guides/_rgsvc_api_XmlSnapshotService.adoc | 220 ++++++++++
.../src/main/asciidoc/guides/_rgsvc_spi.adoc | 299 ++++++++++++++
.../guides/_rgsvc_spi_AuditingService.adoc | 85 ++++
.../_rgsvc_spi_BackgroundCommandService.adoc | 131 ++++++
.../_rgsvc_spi_ClassDiscoveryService.adoc | 82 ++++
.../guides/_rgsvc_spi_CommandService.adoc | 100 +++++
.../_rgsvc_spi_ContentMappingService.adoc | 107 +++++
.../_rgsvc_spi_ContentNegotiationService.adoc | 204 ++++++++++
.../_rgsvc_spi_EmailNotificationService.adoc | 81 ++++
.../_rgsvc_spi_ErrorReportingService.adoc | 106 +++++
.../guides/_rgsvc_spi_EventSerializer.adoc | 74 ++++
.../guides/_rgsvc_spi_ExceptionRecognizer.adoc | 119 ++++++
...spi_FixtureScriptsSpecificationProvider.adoc | 76 ++++
.../guides/_rgsvc_spi_LocaleProvider.adoc | 70 ++++
.../guides/_rgsvc_spi_PublishingService.adoc | 192 +++++++++
.../_rgsvc_spi_RepresentationService.adoc | 103 +++++
.../guides/_rgsvc_spi_TranslationService.adoc | 80 ++++
.../guides/_rgsvc_spi_TranslationsResolver.adoc | 67 +++
.../guides/_rgsvc_spi_UrlEncodingService.adoc | 59 +++
.../guides/_rgsvc_spi_UserProfileService.adoc | 47 +++
.../_rgsvc_spi_UserRegistrationService.adoc | 98 +++++
.../_tg_stop-scaffolding-start-coding.adoc | 16 +-
.../guides/_ugbtb_deployment_tomcat.adoc | 2 +-
...gbtb_more-advanced_decoupling_event-bus.adoc | 2 +-
.../_ugbtb_more-advanced_decoupling_mixins.adoc | 2 +-
...-advanced_decoupling_vetoing-visibility.adoc | 2 +-
.../_ugbtb_more-advanced_headless-access.adoc | 2 +-
...dless-access_BackgroundCommandExecution.adoc | 6 +-
.../guides/_ugbtb_more-advanced_i18n.adoc | 6 +-
...placing-default-service-implementations.adoc | 4 +-
...b_more-advanced_transactions-and-errors.adoc | 6 +-
.../_ugbtb_more-advanced_view-models_jaxb.adoc | 6 +-
...-advanced_view-models_programming-model.adoc | 2 +-
...btb_more-advanced_view-models_use-cases.adoc | 6 +-
.../_ugfun_core-concepts_building-blocks.adoc | 6 +-
...re-concepts_framework-provided-services.adoc | 46 +--
..._core-concepts_other-deployment-options.adoc | 2 +-
...concepts_principles_apache-isis-vs_cqrs.adoc | 4 +-
...rinciples_apache-isis-vs_event-sourcing.adoc | 2 +-
.../asciidoc/guides/_ugfun_how-tos_crud.adoc | 8 +-
.../guides/_ugfun_how-tos_domain-services.adoc | 6 +-
.../guides/_ugsec_api-for-applications.adoc | 2 +-
.../guides/_ugsec_usage-by-isis-viewers.adoc | 2 +-
.../src/main/asciidoc/guides/_ugtst_aaa.adoc | 2 +-
.../_ugtst_fixture-scripts_api-and-usage.adoc | 6 +-
...gtst_integ-test-support_wrapper-factory.adoc | 4 +-
.../asciidoc/guides/_ugvro_architecture.adoc | 6 +-
.../main/asciidoc/guides/_ugvro_ro-spec.adoc | 2 +-
.../guides/_ugvw_extending_custom-pages.adoc | 4 +-
.../_ugvw_features_user-registration.adoc | 10 +-
.../src/main/asciidoc/guides/rgsvc.adoc | 8 +-
.../src/main/asciidoc/guides/ugsec.adoc | 2 +-
.../templates/isis-asciidoc-templates-idea.xml | 2 +-
222 files changed, 6102 insertions(+), 6108 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/monitor.rb
----------------------------------------------------------------------
diff --git a/adocs/documentation/monitor.rb b/adocs/documentation/monitor.rb
index ddda73e..6581087 100644
--- a/adocs/documentation/monitor.rb
+++ b/adocs/documentation/monitor.rb
@@ -20,10 +20,10 @@ $CELLULOID_TEST=false
# parse cmd line args
#
opts = Slop.parse do |o|
- o.int '-p', '--port', 'port (default: 4000)', default: 4000
- o.bool '-x', '--suppress', 'suppress monitoring'
- o.bool '-b', '--browser', 'launch browser'
- o.bool '-h', '--help', 'help'
+ o.int '-p', '--port', 'port (default: 4000)', default: 4000
+ o.bool '-x', '--suppress', 'suppress monitoring'
+ o.bool '-b', '--browser', 'launch browser'
+ o.bool '-h', '--help', 'help'
end
if opts.help? then
@@ -69,7 +69,8 @@ def process(file,srcBasePath,targetBasePath,templateDir,i,lastTimeGenerated,prim
if priming then
regenerate = ""
else
- regenerate = srcSplit[1] + ".adoc"
+ regenerate = srcSplit[1]
+ regenerate += ".adoc" unless regenerate.end_with? ".adoc"
end
else
regenerate = srcBase
@@ -85,39 +86,35 @@ def process(file,srcBasePath,targetBasePath,templateDir,i,lastTimeGenerated,prim
timeUntilNext > 0 then
puts "skipping before regenerating (3 seconds not yet elapsed)"
else
- cmd = "asciidoctor #{regenerate} --require asciidoctor-diagram --backend html --eruby erb --template-dir '#{templateDir}' --destination-dir='#{targetRelDir}' -a imagesdir='' -a toc=right -a icons=font -a source-highlighter=coderay"
-
- unless priming then
- puts ""
- puts "#{i}: #{cmd}"
- # wait 1 further second for any additional edits
- sleep 1
- end
- system cmd
- lastTimeGenerated=Time.now
+
+ cmd = "asciidoctor #{regenerate} --require asciidoctor-diagram --backend html --eruby erb --template-dir '#{templateDir}' --destination-dir='#{targetRelDir}' -a imagesdir='' -a toc=right -a icons=font -a source-highlighter=coderay"
+
+ unless priming then
+ puts ""
+ puts "#{i}: #{cmd}"
+ # wait 1 further second for any additional edits
+ sleep 1
end
+ system cmd
+ lastTimeGenerated=Time.now
end
+ end
else
-
- unless File.directory?(srcBase) then
+ unless File.directory?(srcBase) then
cmd = "cp #{srcBase} #{targetRelDir}"
-
unless priming then
puts ""
puts "#{i}: #{cmd}"
end
system cmd
-
end
-
end
Dir.chdir workingDir
return i+1, lastTimeGenerated
-
end
@@ -126,8 +123,6 @@ if not opts.suppress? then
i=0
lastTimeGenerated = Time.now - 10
-
-
puts ""
puts ""
puts ""
@@ -191,7 +186,6 @@ else
end
-
httpServer.start
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc b/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
index d5c3e05..5f02bee 100644
--- a/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
+++ b/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
@@ -21,7 +21,7 @@ At the time of writing `1.11.0` has not been released; these notes relate to `1.
Classes annotated with xref:guides/rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`] are now recognized
as view models. These are serialized out into XML and converted into URL.
-The xref:guides/rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] is responsible for performing the XML conversion.
+The xref:guides/rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] is responsible for performing the XML conversion.
The default implementation is located in the `org.apache.isis.core:isis-core-schema` module, specifically under the
`org.apache.isis.core.schema.services` package.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_exception-recognizer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_exception-recognizer.adoc b/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_exception-recognizer.adoc
index 11683ab..308fe7f 100644
--- a/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_exception-recognizer.adoc
+++ b/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_exception-recognizer.adoc
@@ -6,7 +6,7 @@
-The `ExceptionRecognizerCompositeForJdoObjectStore` service (an implementation of the xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`] SPI) recognizes certain expected exceptions thrown by the JDO objectstore (for example, violations of uniqueness) and converts them into meaningful messages for the end-user.
+The `ExceptionRecognizerCompositeForJdoObjectStore` service (an implementation of the xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`] SPI) recognizes certain expected exceptions thrown by the JDO objectstore (for example, violations of uniqueness) and converts them into meaningful messages for the end-user.
Prior to 1.9.0 this implementation was _not_ annotated with xref:rgant.adoc#_rgant-DomainService[`@DomainService`] and thus needed to be explicitly registered in `isis.properties`.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_fixture-scripts-specification-provider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_fixture-scripts-specification-provider.adoc b/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_fixture-scripts-specification-provider.adoc
index d525740..fcb4cee 100644
--- a/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_fixture-scripts-specification-provider.adoc
+++ b/adocs/documentation/src/main/asciidoc/_migration-notes_1.8.0-to-1.9.0_fixture-scripts-specification-provider.adoc
@@ -6,7 +6,7 @@
-The `FixtureScriptsSpecificationProvider` SPI service is an alternative to subclassing the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] domain service. The logic that would normally be in the subclass moves to the provider service instead, and the framework instantiates a fallback default instance, xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`FixtureScriptsDefault`].
+The `FixtureScriptsSpecificationProvider` SPI service is an alternative to subclassing the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] domain service. The logic that would normally be in the subclass moves to the provider service instead, and the framework instantiates a fallback default instance, xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`FixtureScriptsDefault`].
This new design is optional; if you continue to provide your own subclass then everything will continue as before. However the new design is more flexible and involves less code.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/_migration-notes_1.9.0-to-1.10.0.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/_migration-notes_1.9.0-to-1.10.0.adoc b/adocs/documentation/src/main/asciidoc/_migration-notes_1.9.0-to-1.10.0.adoc
index 8da3dba..25c3dc1 100644
--- a/adocs/documentation/src/main/asciidoc/_migration-notes_1.9.0-to-1.10.0.adoc
+++ b/adocs/documentation/src/main/asciidoc/_migration-notes_1.9.0-to-1.10.0.adoc
@@ -40,7 +40,7 @@ Therefore, in the parent `pom.xml` of your own domain applications, remove:
== `allowLateRegistration`
-One possible issue is that (as per link:https://issues.apache.org/jira/browse/ISIS-830[ISIS-830]) the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] is now initialized as one of the first domain
+One possible issue is that (as per link:https://issues.apache.org/jira/browse/ISIS-830[ISIS-830]) the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] is now initialized as one of the first domain
services; this is to ensure that any object lifecycle events caused by domain services initializing themselves can be
posted on the event bus for subscribers. The typical case for such lifecycle events to occur is from domain services
that seed reference data; one such example can be found in the (non-ASF)
@@ -88,7 +88,7 @@ isis.services.eventbus.allowLateRegistration=true
If you do that, be aware that not all subscribers may not receive some events generated by other domain services.
-For more details, see the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] man page.
+For more details, see the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] man page.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_cg_asciidoc-templates.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_asciidoc-templates.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_asciidoc-templates.adoc
index 81c4597..bc09490 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_asciidoc-templates.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_asciidoc-templates.adoc
@@ -251,9 +251,9 @@ a hyperlink to the "man page" for an (API) domain service, where:
for example:
-pass:[<pre>xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`\]</pre>]
+pass:[<pre>xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`\]</pre>]
-|xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]
+|xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]
@@ -266,8 +266,8 @@ a hyperlink to the "man page" for an (SPI) domain service, where:
for example:
-pass:[<pre>xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`\]</pre>]
-|xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`]
+pass:[<pre>xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`\]</pre>]
+|xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
index f804eff..33aee52 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
@@ -17,7 +17,7 @@ Use to verify at build time that the metamodel of an application is valid. This
* `xsd` +
+
-(`1.11.0-SNAPSHOT`) Uses the xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] to generate XSD schemas from any JAXB-annotated view models/DTOs. +
+(`1.11.0-SNAPSHOT`) Uses the xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] to generate XSD schemas from any JAXB-annotated view models/DTOs. +
+
This is instead of and preferable to using the JAXB link:https://jaxb.java.net/2.2.4/docs/schemagen.html[schemagen] tool, because it uses the framework's support (via xref:rgant.adoc#_rgant-XmlJavaValueType[`@XmlJavaValueType`]) to translate any references to domain objects into ``OidDto``s (as defined by the Apache Isis xref:rgcms.adoc#_rgcms_schema-common[common schema]).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_swagger.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_swagger.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_swagger.adoc
index f2a2ab6..8c8d6d7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_swagger.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_swagger.adoc
@@ -6,7 +6,7 @@
:toc: right
-The `swagger` goal of the `isis-maven-plugin` uses the xref:rgsvc.adoc#_rgsvc-api_SwaggerService[`SwaggerService`] to
+The `swagger` goal of the `isis-maven-plugin` uses the xref:rgsvc.adoc#_rgsvc_api_SwaggerService[`SwaggerService`] to
generate link:http://swagger.io[Swagger] spec files to describe the public and/or private RESTful APIs exposed by the xref:ugvro.adoc#[RestfulObjects viewer].
These spec files, once generated, can then be used in the build pipeline to generate client-side stubs, typically using Swagger's own link:https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin[swagger-codegen-maven] plugin.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_xsd.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_xsd.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_xsd.adoc
index 179e4f4..f50f4a3 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_xsd.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin_xsd.adoc
@@ -6,7 +6,7 @@
:toc: right
-The `xsd` goal of the `isis-maven-plugin` uses the xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] to
+The `xsd` goal of the `isis-maven-plugin` uses the xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] to
generate XSD schemas from any JAXB-annotated xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model/DTOs].
This is instead of and preferable to using the JAXB link:https://jaxb.java.net/2.2.4/docs/schemagen.html[schemagen]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Action.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action.adoc
index fd7ac5b..bde910d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action.adoc
@@ -22,25 +22,25 @@ The table below summarizes the annotation's attributes.
|`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
(`AS_CONFIGURED`)
|whether the action invocation should be reified into a `o.a.i.applib.` +
-`services.command.Command` object through the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service.
+`services.command.Command` object through the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service.
|`commandExecuteIn()`
|`FOREGROUND`,`BACKGROUND` +
(`FOREGROUND`)
-|whether to execute the command immediately, or to persist it (assuming that an appropriate implementation of xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] has been configured) such that a background scheduler can execute the command asynchronously
+|whether to execute the command immediately, or to persist it (assuming that an appropriate implementation of xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] has been configured) such that a background scheduler can execute the command asynchronously
|`commandPersistence()`
|`PERSISTED`, `NOT_PERSISTED`, `IF_HINTED` +
(`PERSISTED`)
-|whether the reified `Command` (as provided by the `CommandContext` domain service) should actually be persisted (assuming an appropriate implementation of xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] has been configured).
+|whether the reified `Command` (as provided by the `CommandContext` domain service) should actually be persisted (assuming an appropriate implementation of xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] has been configured).
|xref:rgant.adoc#_rgant-Action_domainEvent[`domainEvent()`]
|subtype of `ActionDomainEvent` +
(`ActionDomainEvent.Default`)
-|the event type to be posted to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to
+|the event type to be posted to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to
broadcast the action's business rule checking (hide, disable, validate) and its invocation (pre-execute and
post-execute).
@@ -62,7 +62,7 @@ Currently this is only supported for no-arg actions.
|xref:rgant.adoc#_rgant-Action_publishing[`publishing()`]
|`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
(`AS_CONFIGURED`)
-|whether the action invocation should be published to the registered xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
+|whether the action invocation should be published to the registered xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
|`publishing-` +
`PayloadFactory()`
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_command.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_command.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_command.adoc
index 3d870ee..63d6723 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_command.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_command.adoc
@@ -9,13 +9,13 @@ The `@Action(command=...)` attribute (and the related `@Action(commandPersistenc
The annotation works with (and is influenced by the behaviour of) a number of domain services:
-* xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`]
-* xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`]
-* xref:rgsvc.adoc#_rgsvc-spi_BackgroundService[`BackgroundService`] and
-* xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]
+* xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`]
+* xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`]
+* xref:rgsvc.adoc#_rgsvc_spi_BackgroundService[`BackgroundService`] and
+* xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]
-Each action invocation is reified by the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service into a `Command` object, capturing details of the target object, the action, the parameter arguments, the user, a timestamp and so on.
+Each action invocation is reified by the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service into a `Command` object, capturing details of the target object, the action, the parameter arguments, the user, a timestamp and so on.
If an appropriate `CommandService` is configured (for example using (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module), then the `Command` itself is persisted.
@@ -28,7 +28,7 @@ If background ``Command``s are used, then an external scheduler, using xref:ugbt
-The `command()` attribute determines whether the action invocation should be reified into a `Command` object (by the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service).
+The `command()` attribute determines whether the action invocation should be reified into a `Command` object (by the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service).
The default is `AS_CONFIGURED`, meaning that the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.command.actions` is used to determine the whether the action is reified:
@@ -48,7 +48,7 @@ If there is no configuration property in `isis.properties` then all actions are
[NOTE]
====
-Note: `Command` reification does not necessarily imply that `Command` objects will be persisted; that depends on whether there is a xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] configured that will persist said ``Command``s.
+Note: `Command` reification does not necessarily imply that `Command` objects will be persisted; that depends on whether there is a xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] configured that will persist said ``Command``s.
====
This default can be overridden on an action-by-action basis; if `command()` is set to `ENABLED` then the action is reified irrespective of the configured value; if set to `DISABLED` then the action is NOT reified irrespective of the configured value.
@@ -86,7 +86,7 @@ public class Order {
}
----
-will suppress the persistence of the `Command` object _unless_ a child background `Command` has been created in the body of the action by way of the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`].
+will suppress the persistence of the `Command` object _unless_ a child background `Command` has been created in the body of the action by way of the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`].
On the other hand:
@@ -112,7 +112,7 @@ will prevent the parent `Command` object from being persisted, _even if_ a child
For persisted commands, the `commandExecuteIn()` attribute determines whether the `Command` should be executed in the foreground (the default) or executed in the background.
-Background execution means that the command is not executed immediately, but is available for a configured xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`] to execute, eg by way of an in-memory scheduler such as Quartz. See xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_BackgroundCommandExecution[here] for further information on this topic.
+Background execution means that the command is not executed immediately, but is available for a configured xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`] to execute, eg by way of an in-memory scheduler such as Quartz. See xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_BackgroundCommandExecution[here] for further information on this topic.
For example:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_domainEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_domainEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_domainEvent.adoc
index 04954b6..b791411 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_domainEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_domainEvent.adoc
@@ -13,7 +13,7 @@ Whenever a domain object (or list of domain objects) is to be rendered, the fram
* pre-execute phase: before the invocation of the action
* post-execute: after the invocation of the action
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
By default the event raised is `ActionDomainEvent.Default`. For example:
@@ -60,7 +60,7 @@ rather than through the constructor. This substantially reduces the boilerplate
== Subscribers
-Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -155,8 +155,8 @@ then no event will be posted.
== Raising events programmatically
-Normally events are only raised for interactions through the UI. However, events can be raised programmatically either by calling the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] API directly, or by emulating the UI by
-wrapping the target object using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] domain service.
+Normally events are only raised for interactions through the UI. However, events can be raised programmatically either by calling the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] API directly, or by emulating the UI by
+wrapping the target object using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] domain service.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_publishing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_publishing.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_publishing.adoc
index 482ca93..9cab47d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_publishing.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_publishing.adoc
@@ -7,7 +7,7 @@
-The `publishing()` attribute determines whether and how an action invocation is published via the registered implementation of a xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`]). This attribute is also supported for xref:rgant.adoc#_rgant-DomainObject_publishing[domain objects], where it controls whether changed objects are published as events.
+The `publishing()` attribute determines whether and how an action invocation is published via the registered implementation of a xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`]). This attribute is also supported for xref:rgant.adoc#_rgant-DomainObject_publishing[domain objects], where it controls whether changed objects are published as events.
A common use case is to notify external "downstream" systems of changes in the state of the Isis application.
The default value for the attribute is `AS_CONFIGURED`, meaning that the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.publish.actions` is used to determine the whether the action is published:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_semantics.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_semantics.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_semantics.adoc
index 7d4cde2..f9d6013 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_semantics.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Action_semantics.adoc
@@ -66,7 +66,7 @@ public class Customer {
}
----
-Actions that are safe and request-cacheable automatically use the xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`QueryResultsCache`] service to cache the result of the method. Note though that the results of this caching will only be apparent if the action is invoked from another method using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] service.
+Actions that are safe and request-cacheable automatically use the xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`QueryResultsCache`] service to cache the result of the method. Note though that the results of this caching will only be apparent if the action is invoked from another method using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] service.
Continuing the example above, imagine code that loops over a set of ``Order``s where each `Order` has an associated `Customer`. We want to check the credit rating of each `Customer` (a potentially expensive operation) but we don't want to do it more than once per `Customer`. Invoking through the `WrapperFactory` will allow us to accomplish this by exploiting the semantics of `checkCredit()` action:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection.adoc
index 165d928..6896116 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection.adoc
@@ -21,7 +21,7 @@ The table below summarizes the annotation's attributes.
|xref:rgant.adoc#_rgant-Collection_domainEvent[`domainEvent()`]
|subtype of `CollectionDomainEvent` +
(`CollectionDomainEvent.Default`)
-|the event type to be posted to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to broadcast the collection's business rule checking (hide, disable, validate) and its modification (before and after).
+|the event type to be posted to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to broadcast the collection's business rule checking (hide, disable, validate) and its modification (before and after).
|xref:rgant.adoc#_rgant-Collection_editing[`editing()`]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_domainEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_domainEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_domainEvent.adoc
index 4ce69d3..4c0f045 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_domainEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_domainEvent.adoc
@@ -13,7 +13,7 @@ Whenever a domain object (or list of domain objects) is to be rendered, the fram
* pre-execute phase: before the modification of the collection
* post-execute: after the modification of the collection
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
[WARNING]
@@ -73,7 +73,7 @@ rather than through the constructor. This substantially reduces the boilerplate
== Subscribers
-Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -166,8 +166,8 @@ then no event will be posted.
== Raising events programmatically
-Normally events are only raised for interactions through the UI. However, events can be raised programmatically either by calling the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] API directly, or by emulating the UI by
-wrapping the target object using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] domain service.
+Normally events are only raised for interactions through the UI. However, events can be raised programmatically either by calling the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] API directly, or by emulating the UI by
+wrapping the target object using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] domain service.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_notPersisted.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_notPersisted.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_notPersisted.adoc
index ecf645f..e27e33a 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_notPersisted.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Collection_notPersisted.adoc
@@ -6,7 +6,7 @@
-The (somewhat misnamed) `notPersisted()` attribute indicates that the collection should be excluded from any snapshots generated by the xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]. This attribute is also supported for xref:rgant.adoc#_rgant-Property_notPersisted[properties].
+The (somewhat misnamed) `notPersisted()` attribute indicates that the collection should be excluded from any snapshots generated by the xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]. This attribute is also supported for xref:rgant.adoc#_rgant-Property_notPersisted[properties].
[WARNING]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Discriminator.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Discriminator.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Discriminator.adoc
index 4ce8798..05ed639 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Discriminator.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Discriminator.adoc
@@ -23,7 +23,7 @@ The object type is used internally by Apache Isis to generate a string represent
* in the `toString()` value of `Bookmark`
* in the URLs of the xref:ugvro.adoc#[RestfulObjects viewer]
* in the URLs of the xref:ugvw.adoc#[Wicket viewer] (in general and in particular if xref:ugvw.adoc#_ugvw_features_hints-and-copy-url[copying URLs])
-* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]
+* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]
For example:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject.adoc
index 17f288b..02fccc2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject.adoc
@@ -22,7 +22,7 @@ The table below summarizes the annotation's attributes.
|xref:rgant.adoc#_rgant-DomainObject_auditing[`auditing()`]
|`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
(`AS_CONFIGURED`)
-|indicates whether each of the changed properties of an object should be submitted to the registered xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`].
+|indicates whether each of the changed properties of an object should be submitted to the registered xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`].
|xref:rgant.adoc#_rgant-DomainObject_autoCompleteRepository[`autoCompleteRepository()`]
@@ -46,7 +46,7 @@ The table below summarizes the annotation's attributes.
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectCreatedEvent` +
(`ObjectCreatedEvent.Default`)
-|the event type to be posted to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance is created
+|the event type to be posted to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance is created
|xref:rgant.adoc#_rgant-DomainObject_editing[`editing()`]
|`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
@@ -69,19 +69,19 @@ The table below summarizes the annotation's attributes.
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectPersistedEvent` +
(`ObjectPersistedEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance has just been persisted
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance has just been persisted
|xref:rgant.adoc#_rgant-DomainObject_persistingLifecycleEvent[`persisting-` +
`LifecycleEvent()`] +
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectPersistingEvent` +
(`ObjectPersistingEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance is about to be persisted
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance is about to be persisted
|xref:rgant.adoc#_rgant-DomainObject_publishing[`publishing()`]
|`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
(`AS_CONFIGURED`)
-|whether changes to the object should be published to the registered xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`].
+|whether changes to the object should be published to the registered xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
|`publishing-` +
@@ -94,21 +94,21 @@ The table below summarizes the annotation's attributes.
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectRemovingEvent` +
(`ObjectRemovingEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance is about to be deleted
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance is about to be deleted
|xref:rgant.adoc#_rgant-DomainObject_updatedLifecycleEvent[`updated-` +
`LifecycleEvent()`] +
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectUpdatedEvent` +
(`ObjectUpdatedEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance has just been updated
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance has just been updated
|xref:rgant.adoc#_rgant-DomainObject_updatingLifecycleEvent[`updating-` +
`LifecycleEvent()`] +
(`1.11.0-SNAPSHOT`)
|subtype of `ObjectUpdatingEvent` +
(`ObjectUpdatingEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] whenever an instance is about to be updated
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] whenever an instance is about to be updated
|===
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout.adoc
index 5948b59..af9ab1f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout.adoc
@@ -51,7 +51,7 @@ The table below summarizes the annotation's attributes.
|xref:rgant.adoc#_rgant-DomainObjectLayout_cssClassUiEvent[`cssClassUiEvent()`]
|subtype of `CssClassUiEvent` +
(`CssClassUiEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to obtain a CSS class for the domain object.
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to obtain a CSS class for the domain object.
|xref:rgant.adoc#_rgant-DomainObjectLayout_describedAs[`describedAs()`]
|String.
@@ -60,7 +60,7 @@ The table below summarizes the annotation's attributes.
|xref:rgant.adoc#_rgant-DomainObjectLayout_iconUiEvent[`iconUiEvent()`]
|subtype of `IconUiEvent` +
(`IconUiEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to obtain the icon (name) for the domain object.
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to obtain the icon (name) for the domain object.
|xref:rgant.adoc#_rgant-DomainObjectLayout_named[`named()`]
|String.
@@ -82,7 +82,7 @@ A typical use case is if the desired name is a reserved Java keyword, such as `d
|xref:rgant.adoc#_rgant-DomainObjectLayout_titleUiEvent[`titleUiEvent()`]
|subtype of `TitleUiEvent` +
(`TitleUiEvent.Default`)
-|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to obtain the title for the domain object.
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to obtain the title for the domain object.
|===
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_cssClassUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_cssClassUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_cssClassUiEvent.adoc
index 4e80dd2..6b1211e 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_cssClassUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_cssClassUiEvent.adoc
@@ -10,7 +10,7 @@ in any wrapping ``<div>``s and ``<span>``s that render the domain object. This
xref:rgcms.adoc#_rgcms_methods_reserved_cssClass[`cssClass()`] reserved method. (If `cssClass()` is present, then
it will take precedence).
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use obtain a reference to the domain object from the event. From this they can, if they wish, specify a CSS class for
the domain object using the event's API.
@@ -56,7 +56,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -119,8 +119,8 @@ then no event will be posted.
== Raising events programmatically
Normally events are only raised for interactions through the UI. However, events can be raised programmatically either
-by calling the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] API directly, or as a result
-of calling the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]'s
+by calling the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] API directly, or as a result
+of calling the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]'s
`cssClassOf(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_iconUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_iconUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_iconUiEvent.adoc
index ab98026..fcb9b17 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_iconUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_iconUiEvent.adoc
@@ -10,7 +10,7 @@ object (if possible). This is as an alternative to implementing
xref:rgcms.adoc#_rgcms_methods_reserved_iconName[`iconName()`] reserved method. (If `iconName()` is present, then
it will take precedence).
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use obtain a reference to the domain object from the event. From this they can, if they wish, specify an icon name for
the domain object using the event's API.
@@ -57,7 +57,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -115,8 +115,8 @@ then no event will be posted.
== Raising events programmatically
Normally events are only raised for interactions through the UI. However, events can be raised programmatically either
-by calling the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] API directly, or as a result
-of calling the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]'s
+by calling the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] API directly, or as a result
+of calling the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]'s
`iconNameOf(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_titleUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_titleUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_titleUiEvent.adoc
index 86a8856..1ebae33 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_titleUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObjectLayout_titleUiEvent.adoc
@@ -10,7 +10,7 @@ This is as an alternative to implementing xref:rgcms.adoc#_rgcms_methods_reserve
using the xref:rgant.adoc#_rgant-Title[`@Title`] annotation, within the class itself. (If either
`title()` or `@Title` are present, then they will take precedence).
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use obtain a reference to the domain object from the event. From this they can, if they wish, specify a title for
the domain object using the event's API.
@@ -56,7 +56,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -115,6 +115,6 @@ thn no event will be posted.
== Raising events programmatically
Normally events are only raised for interactions through the UI. However, events can be raised programmatically either
-by calling the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] API directly, or as a result
-of calling the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]'s
+by calling the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] API directly, or as a result
+of calling the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]'s
`titleOf(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_auditing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_auditing.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_auditing.adoc
index 1d07822..e5f3b96 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_auditing.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_auditing.adoc
@@ -5,7 +5,7 @@
:_imagesdir: images/
-The `auditing()` attribute indicates that if the object is modified, then each of its changed properties should be submitted to the xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`], if one has been configured.
+The `auditing()` attribute indicates that if the object is modified, then each of its changed properties should be submitted to the xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`], if one has been configured.
The default value for the attribute is `AS_CONFIGURED`, meaning that the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.audit.objects` is used to determine the whether the action is published:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_createdLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_createdLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_createdLifecycleEvent.adoc
index 82e3b38..7765f14 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_createdLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_createdLifecycleEvent.adoc
@@ -5,11 +5,11 @@
:_imagesdir: images/
-Whenever a domain object is instantiated or otherwise becomes known to the framework, a "created" lifecycle event is fired. This is typically when the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]'s xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`newTransientInstance()`] is called;
+Whenever a domain object is instantiated or otherwise becomes known to the framework, a "created" lifecycle event is fired. This is typically when the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]'s xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`newTransientInstance()`] is called;
it will also happen if the object is simply instantiated with `new(...)`, and then the container's
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_services-api[`injectServicesInto(...)`] method is called.
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_services-api[`injectServicesInto(...)`] method is called.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the object just created. The subscriber could then, for example, update the
object, eg looking up state from some external datastore.
@@ -49,7 +49,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_loadedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_loadedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_loadedLifecycleEvent.adoc
index d5ab183..5e4c897 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_loadedLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_loadedLifecycleEvent.adoc
@@ -7,7 +7,7 @@
Whenever a persistent domain object is loaded from the database, a "loaded" lifecycle event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object just loaded. The subscriber could then, for example, update
or default values on the object (eg to support on-the-fly migration scenarios).
@@ -46,7 +46,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_objectType.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_objectType.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_objectType.adoc
index fcaa4d2..aa1ccc1 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_objectType.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_objectType.adoc
@@ -13,7 +13,7 @@ This value is used internally to generate a string representation of an objects
* in the `toString()` value of `Bookmark`
* in the URLs of the xref:ugvro.adoc#[RestfulObjects viewer]
* in the URLs of the xref:ugvw.adoc#[Wicket viewer] (in general and in particular if xref:ugvw.adoc#_ugvw_features_hints-and-copy-url[copying URLs])
-* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]
+* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]
For example:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistedLifecycleEvent.adoc
index 6c1fabd..eb73b5b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistedLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistedLifecycleEvent.adoc
@@ -8,7 +8,7 @@
Whenever a (just created, still transient) domain object has been saved (INSERTed in)to the database, a "persisted" lifecycle
event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object. The subscriber could then, for example, maintain an
external datastore.
@@ -52,7 +52,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistingLifecycleEvent.adoc
index 9b5518c..2354995 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistingLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_persistingLifecycleEvent.adoc
@@ -8,7 +8,7 @@
Whenever a (just created, still transient) domain object is about to be saved (INSERTed in)to the database, a "persisting" lifecycle
event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object. The subscriber could then, for example, update the object,
or it could use it maintain an external datastore. One possible application is to maintain a full-text search database using
link:https://lucene.apache.org/[Apache Lucene] or similar.
@@ -55,7 +55,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_publishing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_publishing.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_publishing.adoc
index 55d08c3..f07b57f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_publishing.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_publishing.adoc
@@ -6,7 +6,7 @@
-The `publishing()` attribute determines whether and how a modified object instance is published via the registered implementation of a xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`]). This attribute is also supported for xref:rgant.adoc#_rgant-Action_publishing[actions], where it controls whether action invocations are published as events.
+The `publishing()` attribute determines whether and how a modified object instance is published via the registered implementation of a xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`]). This attribute is also supported for xref:rgant.adoc#_rgant-Action_publishing[actions], where it controls whether action invocations are published as events.
A common use case is to notify external "downstream" systems of changes in the state of the Isis application.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_removingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_removingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_removingLifecycleEvent.adoc
index 9ba1710..fc7cbfe 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_removingLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_removingLifecycleEvent.adoc
@@ -8,7 +8,7 @@
Whenever a (persistent) domain object is about to be removed (DELETEd) from the database, a "removing"
lifecycle event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object. The subscriber could then, for example, could use it
maintain an external datastore. One possible application is to maintain a full-text search database
using link:https://lucene.apache.org/[Apache Lucene] or similar.
@@ -55,7 +55,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatedLifecycleEvent.adoc
index dc2eae1..ca462a6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatedLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatedLifecycleEvent.adoc
@@ -8,7 +8,7 @@
Whenever a (persistent) domain object has been modified and has been updated in the database, an "updated" lifecycle
event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object.
[WARNING]
@@ -51,7 +51,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatingLifecycleEvent.adoc
index e644c8d..4dc1301 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatingLifecycleEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-DomainObject_updatingLifecycleEvent.adoc
@@ -8,7 +8,7 @@
Whenever a (persistent) domain object has been modified and is about to be updated to the database, an "updating"
lifecycle event is fired.
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and can
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and can
use the event to obtain a reference to the domain object. The subscriber could then, for example, update the object,
or it could use it maintain an external datastore. One possible application is to maintain a full-text search database
using link:https://lucene.apache.org/[Apache Lucene] or similar.
@@ -55,7 +55,7 @@ The benefit is that subscribers can be more targeted as to the events that they
== Subscribers
Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
-or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured)
+or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured)
using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Inject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Inject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Inject.adoc
index 7025e43..8c06d4b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Inject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Inject.adoc
@@ -94,7 +94,7 @@ public class Customer {
[NOTE]
====
-An alternative and almost equivalent design would be to publish an event using the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] and implement the domain services as subscribers to
+An alternative and almost equivalent design would be to publish an event using the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] and implement the domain services as subscribers to
the event. This alternative design is used in the (non-ASF) http://github.com/isisaddons/isis-module-poly[Isis addons' poly] module, for example.
====
@@ -114,7 +114,7 @@ Customer cust = container.newTransientInstance(Customer.class); <1>
// initialize state of "cust"
container.persist(cust);
----
-<1> where `container` is an instance of xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`].
+<1> where `container` is an instance of xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`].
View models are created similarly:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-PersistenceCapable.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-PersistenceCapable.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-PersistenceCapable.adoc
index 2f7d05b..c755915 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-PersistenceCapable.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-PersistenceCapable.adoc
@@ -24,7 +24,7 @@ The object type is used internally by Apache Isis to generate a string represent
* in the `toString()` value of `Bookmark`
* in the URLs of the xref:ugvro.adoc#[RestfulObjects viewer]
* in the URLs of the xref:ugvw.adoc#[Wicket viewer] (in general and in particular if xref:ugvw.adoc#_ugvw_features_hints-and-copy-url[copying URLs])
-* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]
+* in XML snapshots generated by the xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]
The actual format of the object type used by Apache Isis for the concatenation of `schema()` and `@PersistenceCapable#table()`. If the `table()` is not present, then the class' simple name is used instead.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-PostConstruct.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-PostConstruct.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-PostConstruct.adoc
index c7d216f..2cf790a 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-PostConstruct.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-PostConstruct.adoc
@@ -33,10 +33,10 @@ Isis uses argument to pass in the configuration properties read from all xref:rg
[TIP]
====
-Alternatively, you could inject xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`] into the service and read configuration properties using `DomainObjectContainer#getProperty(...)` and related methods. Note that when using this latter API only those configuration properties prefixes `application.` key are provided.
+Alternatively, you could inject xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`] into the service and read configuration properties using `DomainObjectContainer#getProperty(...)` and related methods. Note that when using this latter API only those configuration properties prefixes `application.` key are provided.
====
-A common use case is for domain services that interact with the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. For example:
+A common use case is for domain services that interact with the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. For example:
[source,java]
----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-PreDestroy.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-PreDestroy.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-PreDestroy.adoc
index 4588986..ab38082 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-PreDestroy.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-PreDestroy.adoc
@@ -21,7 +21,7 @@ public void deinit() { ... } <2>
<1> It is not necessary to annotate the method with xref:rgant.adoc#_rgant-Programmatic[`@Programmatic`]; it will be automatically excluded from the Apache Isis metamodel.
<2> the method can have any name, but must have `public` visibility, and accept no arguments.
-A common use case is for domain services that interact with the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. For example:
+A common use case is for domain services that interact with the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. For example:
[source,java]
----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-PrimaryKey.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-PrimaryKey.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-PrimaryKey.adoc
index 8fc8b1d..150d048 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-PrimaryKey.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-PrimaryKey.adoc
@@ -8,7 +8,7 @@
The `@javax.jdo.annotation.PrimaryKey` annotation is used by JDO/DataNucleus to indicate that a property is used as the primary key for an entity with application-managed identity.
-Apache Isis also uses this annotation in a very minimal way: to ensure that the framework's own logic to initialize newly instantiated objects (eg using xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`] does not touch the primary key, and also to ensure that the primary key property is always disabled (read-only).
+Apache Isis also uses this annotation in a very minimal way: to ensure that the framework's own logic to initialize newly instantiated objects (eg using xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`] does not touch the primary key, and also to ensure that the primary key property is always disabled (read-only).
[NOTE]
====
[03/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_XmlSnapshotService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_XmlSnapshotService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_XmlSnapshotService.adoc
new file mode 100644
index 0000000..88409bb
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_XmlSnapshotService.adoc
@@ -0,0 +1,220 @@
+[[_rgsvc_api_XmlSnapshotService]]
+= `XmlSnapshotService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `XmlSnapshotService` provides the capability to generate XML snapshots (and if required corresponding XSD schemas) based on graphs of domain objects.
+
+Typical use cases include creating mementos for business-focused auditing, such that a report could be generated as to which end-user performed a business action (perhaps for legal reasons). For one system that we know of, a digest of this snapshot of data is signed with the public encryption key so as to enforce non-repudiation.
+
+Another use case is to grab raw data such that it could be merged into a report template or communication.
+
+The service offers a basic API to create a snapshot of a single object, and an more flexible API that allows the size of the graph to be customized.
+
+The core framework provides an implementation of this service (`o.a.i.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault`).
+
+
+
+== Standard API
+
+The (basic) API of `XmlSnapshotService` is:
+
+[source]
+----
+public interface XmlSnapshotService {
+ public interface Snapshot {
+ Document getXmlDocument();
+ Document getXsdDocument();
+ String getXmlDocumentAsString();
+ String getXsdDocumentAsString();
+ }
+ @Programmatic
+ public XmlSnapshotService.Snapshot snapshotFor(Object domainObject);
+ ...
+}
+----
+
+
+The most straight-forward usage of this service is simply:
+
+[source,java]
+----
+XmlSnapshot snapshot = xmlsnapshotService.snapshotFor(customer);
+Element customerAsXml = snapshot.getXmlElement();
+----
+
+This will return an XML (document) element that contains the names and values of each of the customer's value properties, along with the titles of reference properties, and also the number of items in collections.
+
+
+As well as obtaining the XML snapshot, it is also possible to obtain an XSD schema that the XML snapshot conforms to.
+
+[source]
+----
+XmlSnapshot snapshot = ...;
+Element customerAsXml = snapshot.getXmlElement();
+Element customerXsd = snapshot.getXsdElement();
+----
+
+This can be useful for some tools. For example, link:http://www.altova.com/stylevision.html[Altova Stylevision] can use the XML and XSD to transform into reports. Please note that this link does not imply endorsement (nor even a recommendation that this is a good design).
+
+
+
+
+
+== Builder API
+
+The contents of the snapshot can be adjusted by including "paths" to other references or collections. To do this, the
+builder is used. The API for this is:
+
+[source,java]
+----
+public interface XmlSnapshotService {
+ ...
+ public interface Builder {
+ void includePath(final String path);
+ void includePathAndAnnotation(String path, String annotation);
+ XmlSnapshotService.Snapshot build();
+ }
+ @Programmatic
+ public XmlSnapshotService.Builder builderFor(Object domainObject);
+}
+----
+
+We start by obtaining a builder:
+
+[source,java]
+----
+XmlSnapshot.Builder builder = xmlsnapshotService.builderFor(customer);
+----
+
+Suppose now that we want the snapshot to also include details of the customer's address, where `address` in this case is a reference property to an instance of the `Address` class. We can "walk-the-graph" by including these references within the builder.
+
+[source,java]
+----
+builder.includePath("address");
+----
+
+We could then go further and include details of every order in the customer's `orders` collection, and details of every
+product of every order:
+
+[source,java]
+----
+builder.includePath("orders/product");
+----
+
+When all paths are included, then the builder can build the snapshot:
+
+[source,java]
+----
+XmlSnapshot snapshot = builder.build();
+Element customerAsXml = snapshot.getXmlElement();
+----
+
+All of this can be strung together in a fluent API:
+
+[source,java]
+----
+Element customerAsXml = xmlsnapshotService.builderFor(customer)
+ .includePath("address")
+ .includePath("orders/product")
+ .build()
+ .getXmlElement();
+----
+
+
+As you might imagine, the resultant XML document can get quite large very quickly with only a few "include"s.
+
+
+[NOTE]
+====
+If an XSD schema is beng generated (using `snapshot.getXsdElement()` then note that for the XSD to be correct, the object being snapshotted must have non-null values for the paths that are `include()`'d. If this isn't done then the XSD will not be correct reflect for another snapshotted object that does have non-null values.
+====
+
+
+
+
+== Automatic inclusions
+
+If the domain object being snapshotted implements the `SnapshottableWithInclusions` interace, then this moves the
+responsibility for determining what is included within the snapshot from the caller to the snapshottable object itself:
+
+[source]
+----
+public interface SnapshottableWithInclusions extends Snapshottable {
+ List<String> snapshotInclusions();
+}
+----
+
+If necessary, both approaches can be combined.
+
+
+[TIP]
+====
+As an alternative to using `include()`, you might consider building a view model domain object which can reference only the relevant information required for the snapshot. For example, if only the 5 most recent Orders for a Customer were required, a `CustomerAndRecentOrders` view model could hold a collection of just those 5 ``Order``s. Typically such view models would implement `SnapshottableWithInclusions`.
+
+One reason for doing this is to provide a stable API between the domain model and whatever it is that might be consuming the XML. With a view model you can refactor the domain entities but still preserve a view model such that the XML is the same.
+====
+
+
+
+== Convenience API
+
+The `XmlSnapshotService` also provides some API for simply manipulating XML:
+
+[source]
+----
+public interface XmlSnapshotService {
+ ...
+ @Programmatic
+ public Document asDocument(String xmlStr); // <1>
+ @Programmatic
+ public <T> T getChildElementValue( // <2>
+ Element el, String tagname, Class<T> expectedCls);
+ @Programmatic
+ public Element getChildElement( // <3>
+ Element el, String tagname);
+ @Programmatic
+ public String getChildTextValue(Element el); // <4>
+}
+----
+<1> is a convenience method to convert xml string back into a W3C Document
+<2> is a convenience method to extract the value of an XML element, based on its type.
+<3> is a convenience method to walk XML document.
+<4> is a convenience method to obtain value of child text node.
+
+
+
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `XmlSnapshotService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+== Related Services
+
+The xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`] provides a mechanism for obtaining a string representations of a single domain object.
+
+The xref:rgsvc.adoc#_rgsvc_api_MementoService[`MementoService`] also provides a mechanism for generating string representations of domain objects.
+
+The xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] (`1.11.0-SNAPSHOT`) is a simple wrapper around
+standard JAXB functionality for generating both XMLs and XSDs from JAXB-annotated classes. Note that (as of
+`1.11.0-SNAPSHOT`) there is built-in support for JAXB classes (ie annotated with
+xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]) to be used as view models.
+
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi.adoc
new file mode 100644
index 0000000..9fad324
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi.adoc
@@ -0,0 +1,299 @@
+[[_rgsvc_spi]]
+= Domain Services SPI
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Apache Isis includes an extensive number of domain services for your domain objects to use; these are listed in xref:rgsvc.adoc#_rgsvc_api[Reference: Domain Services (API)] chapter.
+
+There are other domain services that constitute not an API but an SPI; if present they are used by Apache Isis itself rather than by your domain objects. A good example of this is the xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`] service; if an implementation is present then Apache Isis will call that service in order to record audit log entries. If no implementation is available then Apache Isis will carry on regardless.
+
+Some domain services can be considered both API and SPI; a good example is the xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`] that is of direct use for domain objects wishing to send out emails, but is also used by the framework to support the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality supported by the xref:ugvw.adoc#[Wicket viewer]. The same is true of the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]; this can be used by domain objects to broadcast arbitrary events, but is also used by the framework to automatically emit events for xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`] etc.
+
+For these hybrid services we have categorized the service as an "API" service. This chapter therefore contains only the strictly SPI services.
+
+
+The table below lists the SPIs that are defined in the Isis applib (`o.a.i.core:isis-core-applib` module).
+
+
+.Applib SPI Services
+[cols="2,4a,1,1", options="header"]
+|===
+
+
+|SPI
+|Description
+|Implementation
+|Notes
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`o.a.i.applib.` +
+`services.audit` +
+`AuditingService3`]
+|Create an audit record for every changed property of every changed object within a transaction.
+|`AuditingService` +
+``o.ia.m.audit`` +
+``isis-module-audit``
+|related services:
+`AuditingService-` +
+`Contributions`,
+`AuditingService-` +
+`Repository`
+
+|xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`o.a.i.applib.` +
+`services.background` +
+`BackgroundCommandService`]
+|Persisted a memento of an action invocation such that it can be executed asynchronously ("in the background") eg by a scheduler.
+|`BackgroundCommandServiceJdo` +
+``o.ia.m.command`` +
+``isis-module-command``
+|related services:
+`BackgroundCommandService-` +
+`JdoContributions`,
+`BackgroundCommandService-` +
+`JdoRepository`
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_ClassDiscoveryService[`o.a.i.applib.` +
+`services.classdiscovery` +
+`ClassDiscoveryService`]
+|Mechanism to locate (from the classpath) classes with a specific annotation (eg xref:rgant.adoc#_rgant-DomainService[`@DomainService`])
+
+Subtypes of a given type (eg xref:rgcms.adoc#_rgcms_classes_super_FixtureScript[`FixtureScript`]).
+|`ClassDiscoveryService-` +
+`UsingReflections` +
+``o.a.i.core`` +
+``isis-core-applib``
+|requires `org.reflections:reflections` as Maven dependency
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_CommandService[`o.a.i.applib.` +
+`services.command.spi` +
+`CommandService`]
+|Service to act as a factory and repository (create and save) of command instances, ie representations of an action invocation. Used for command/auditing and background services.
+|`CommandServiceJdo` +
+``o.ia.m.command`` +
+``isis-module-command``
+|related services: +
+`CommandService-` ++
+`JdoContributions`,
+`CommandService-` ++
+`JdoRepository`
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`o.a.i.applib.` +
+`services.userreg` +
+`EmailNotificationService`]
+|Notify a user during xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[self-registration] of users.
+|`EmailNotificationService-` +
+`Default` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|depends on: +
+a configured `EmailService`
+
+|xref:rgsvc.adoc#_rgsvc_spi_ErrorReportingService[`o.a.i.applib.` +
+`services.error` +
+`ErrorReportingService`]
+|Record details of an error occurring in the system (eg in an external incident recording system such as JIRA), and return a more friendly (jargon-free) message to display to the end user, with optional reference (eg `XXX-1234`).
+|(none)
+|
+
+|xref:rgsvc.adoc#_rgsvc_spi_EventSerializer[`o.a.i.applib.` +
+`services.publish` +
+`EventSerializer`]
+|Creates a representation of either an action invocation or a changed object being published through the xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
+|`RestfulObjects-` +
+`SpecEventSerializer` +
+``o.ia.m.publishing`` +
+``isis-module-publishing``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`o.a.i.applib.` +
+`services.exceprecog` +
+`ExceptionRecognizer2`]
+|Convert certain exceptions (eg foreign or unique key violation in the database) into a format that can be rendered to the end-user.
+|`ExceptionRecognizer-` +
+`CompositeFor-` +
+`JdoObjectStore` +
+``o.a.i.core`` +
+``isis-core-applib``
+|Extensible using composite pattern if required
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_LocaleProvider[`o.a.i.applib.` +
+`services.i18n` +
+`LocaleProvider`]
+|Request-scoped service to return the locale of the current user, in support of i18n (ie so that the app's UI, messages and exceptions can be translated to the required locale by the xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`].
+|`LocaleProviderWicket` +
+``o.a.i.viewer`` +
+``isis-viewer-wicket-impl``
+|
+
+|xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`o.a.i.applib.` +
+`services.fixturespec` +
+`FixtureScripts-` +
+`SpecificationProvider`]
+|Provides settings for xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`FixtureScriptsDefault`] fallback domain service for executing fixture scripts.
+|
+|
+
+|xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`o.a.i.applib.` +
+`services.publish` +
+`PublishingService`]
+|Publish any action invocations and changed objects, typically for interchange with an external system in a different bounded context.
+|`PublishingService` +
+``o.ia.m.publishing`` +
+``isis-module-publishing``
+|related services:
+`PublishingService-` ++
+``Contributions``,
+`PublishingService-` ++
+``Repository``. +
+depends on: +
+`EventSerializer`
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`o.a.i.applib.` +
+`services.i18n` +
+`TranslationService`]
+|Translate an app's UI, messages and exceptions for the current user (as per the locale provided by xref:rgsvc.adoc#_rgsvc_spi_LocaleProvider[`LocalProvider`].
+|`TranslationServicePo` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|related services: `TranslationServicePoMenu` +
+depends on: +
+`TranslationsResolver`, `LocaleProvider`
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_TranslationsResolver[`o.a.i.applib.` +
+`services.i18n` +
+`TranslationsResolver`]
+|Obtain translations for a particuar phrase and locale, in support of i18n (ie so that the app's UI, messages and exceptions can be translated to the required locale by the xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`]
+|`TranslationsResolverWicket` +
+``o.a.i.viewer`` +
+``isis-viewer-wicket-impl``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_UrlEncodingService[`o.a.i.applib.` +
+`services.urlencoding` +
+`UrlEncodingService`]
+|Converts strings into a form safe for use within a URL. Used to convert view models mementos into usable URL form.
+
+|`UrlEncodingServiceUsingBaseEncoding` +
+``o.a.i.applib`` +
+``isis-core-applib``
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_UserProfileService[`o.a.i.applib.` +
+`services.userprof` +
+`UserProfileService`]
+|Obtain an alternative (usually enriched/customized) name for the current user, to render in the UI.
+|
+|
+
+|xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`o.a.i.applib.` +
+`services.userreg` +
+`UserRegistrationService`]
+|Create a new user account with the configured security mechanism.
+|`SecurityModule-` +
+`AppUserRegistrationService` +
+``o.ia.m.security`` +
+``isis-module-security``
+|depends (implicitly) on: +
+a configured `EmailService`
+
+
+|===
+
+
+Key:
+
+* `o.a.i` is an abbreviation for `org.apache.isis`
+* `o.ia.m` is an abbreviation for `org.isisaddons.module`
+
+
+Where an implementation is available (on the classpath) then it is always registered automatically (that is, they are all (with one exception) annotated with xref:rgant.adoc#_rgant-DomainService[`@DomainService`]. The one exception is xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`], which must be registered explicitly in `isis.properties`; this makes the service extensible (for new exceptions to be recognized).
+
+
+
+
+There are also some "internal" SPI services whose definitions depend on the internals of the framework (rather than the applib).
+
+[WARNING]
+====
+We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
+====
+
+
+
+."Internal" SPI Services
+[cols="3,3,2,2a", options="header"]
+|===
+
+|SPI
+|Maven Module +
+Impl'n (g: a:)
+|Implementation
+|Notes
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`o.a.i.v.ro.` +
+`rendering.service.conneg.` +
+`ContentMappingService`]
+|(Attempt to) map the returned data into the representation required by the client's HTTP `Accept` header.
+|
+|No default implementation.
+
+|xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`o.a.i.v.ro.` +
+`rendering.service.conneg.` +
+`ContentNegotiationService`]
+|Encodes the algorithm that delegates to any registered xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]s.
+|`ContentNegotiationService-` +
+`XRoDomainType` +
+``o.a.i.core`` +
+`isis-core-viewer-restfulobjects-rendering`
+|
+
+
+|xref:rgsvc.adoc#_rgsvc_spi_RepresentationService[`o.a.i.v.ro.` +
+`rendering.service.` +
+`RepresentationService`]
+|Generates the representations, delegating to any registered xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`]s.
+|`RepresentationService-` +
+`ForRestfulObjects` +
+``o.a.i.core`` +
+`isis-core-viewer-restfulobjects-rendering`
+|
+
+
+|===
+
+Key:
+
+* `o.a.i.v.ro` is an abbreviation for `org.apache.isis.viewer.restfulobjects`
+
+
+include::_rgsvc_spi_AuditingService.adoc[leveloffset=+1]
+include::_rgsvc_spi_BackgroundCommandService.adoc[leveloffset=+1]
+include::_rgsvc_spi_ClassDiscoveryService.adoc[leveloffset=+1]
+include::_rgsvc_spi_CommandService.adoc[leveloffset=+1]
+include::_rgsvc_spi_ContentMappingService.adoc[leveloffset=+1]
+include::_rgsvc_spi_ContentNegotiationService.adoc[leveloffset=+1]
+include::_rgsvc_spi_EmailNotificationService.adoc[leveloffset=+1]
+include::_rgsvc_spi_ErrorReportingService.adoc[leveloffset=+1]
+include::_rgsvc_spi_EventSerializer.adoc[leveloffset=+1]
+include::_rgsvc_spi_ExceptionRecognizer.adoc[leveloffset=+1]
+include::_rgsvc_spi_FixtureScriptsSpecificationProvider.adoc[leveloffset=+1]
+include::_rgsvc_spi_LocaleProvider.adoc[leveloffset=+1]
+include::_rgsvc_spi_PublishingService.adoc[leveloffset=+1]
+include::_rgsvc_spi_RepresentationService.adoc[leveloffset=+1]
+include::_rgsvc_spi_TranslationService.adoc[leveloffset=+1]
+include::_rgsvc_spi_TranslationsResolver.adoc[leveloffset=+1]
+include::_rgsvc_spi_UrlEncodingService.adoc[leveloffset=+1]
+include::_rgsvc_spi_UserProfileService.adoc[leveloffset=+1]
+include::_rgsvc_spi_UserRegistrationService.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_AuditingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_AuditingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_AuditingService.adoc
new file mode 100644
index 0000000..8dd93c4
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_AuditingService.adoc
@@ -0,0 +1,85 @@
+[[_rgsvc_spi_AuditingService]]
+= `AuditingService3`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+The `AuditingService3` auditing service provides a simple mechanism to capture changes to data. It is called for each property that has changed on any domain object, as a set of pre- and post-values.
+
+[NOTE]
+====
+In case you are wondering what happened to `AuditingService` and `AuditingService2`, these were earlier versions of the SPI that have since been deprecated and removed.
+====
+
+
+== SPI
+
+The SPI for the service is:
+
+[source,java]
+----
+public interface AuditingService3 {
+
+ @Programmatic
+ public void audit(
+ final UUID transactionId, String targetClassName, final Bookmark target,
+ String memberIdentifier, final String propertyName,
+ final String preValue, final String postValue,
+ final String user, final java.sql.Timestamp timestamp);
+ }
+----
+
+The framework will call this for each and every domain object property that is modified within a transaction.
+
+
+
+== Implementation
+
+The most full-featured available implementation is the (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' Audit module]. This creates an audit records for each changed property (ie every time that `AuditingService3#audit(...)` is called. The implementation is `org.isisaddons.module.audit.dom.AuditingService`.
+
+The module also provides:
+
+* `AuditingServiceMenu` service which provides actions to search for ``AuditEntry``s, underneath an 'Activity' menu on the secondary menu bar.
+
+* `AuditingServiceRepository` service to to search for persisted `AuditEntry``s. None of its actions are visible in the user interface (they are all `@Programmatic`).
+
+* `AuditingServiceContributions` which contrbutes collections to the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[ `HasTransactionId`] interface. This will therefore display all audit entries that occurred in a given transaction, in other words whenever a command, a published event or another audit entry is displayed.
+
+
+
+If you just want to debug (writing to stderr), you can instead configure `o.a.i.applib.services.audit.AuditingService3$Stderr`
+
+
+
+== Usage
+
+The typical way to indicate that an object should be audited is to annotate it with the xref:rgant.adoc#_rgant-DomainObject_auditing[`@DomainObject#auditing()`] annotation.
+
+
+
+
+== Registering the Services
+
+The (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module provides an implementation of
+this service (`AuditingService`), and also provides a number of related domain services (`AuditingServiceMenu`,
+`AuditingServiceRepository` and `AuditingServiceContributions`).
+
+Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
+then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
+
+If menu items or contributions are not required in the UI, these can be suppressed either using security or by
+implementing a xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
+
+
+
+== Related Services
+
+The auditing service works very well with the xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`]. The `CommandService` captures the _cause_ of an interaction (an action was invoked, a property was edited), while the `AuditingService3` captures the _effect_ of that interaction in terms of changed state.
+
+You may also want to configure the xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
+
+All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_BackgroundCommandService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_BackgroundCommandService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_BackgroundCommandService.adoc
new file mode 100644
index 0000000..6aeb1d6
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_BackgroundCommandService.adoc
@@ -0,0 +1,131 @@
+[[_rgsvc_spi_BackgroundCommandService]]
+= `BackgroundCommandService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `BackgroundCommandService` (SPI) service supports the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] (API) service, persisting action invocations as commands such that they can subsequently be invoked in the background.
+
+The `BackgroundService` is responsible for capturing a memento representing the action invocation, and then hands off to the xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`] `BackgroundCommandService` to actually persist it.
+
+The persisting of commands is only half the story; there needs to be a separate process to read the commands and execute them. The abstract xref:rgsvc.adoc#_rgsvc_api_BackgroundService_BackgroundCommandExecution[`BackgroundCommandExecution`] provides a mechanism to execute such commands. This can be considered an API, albeit "internal" because the implementation relies on internals of the framework.
+
+
+
+== SPI
+
+The SPI of the `BackgroundCommandService` is:
+
+[source,java]
+----
+public interface BackgroundCommandService {
+ void schedule(
+ ActionInvocationMemento aim, // <1>
+ Command parentCommand, // <2>
+ String targetClassName,
+ String targetActionName,
+ String targetArgs);
+
+}
+----
+<1> is a wrapper around a xref:rgsvc.adoc#_rgsvc_api_MementoService[`MementoService`]'s `Memento`, capturing the details of the action invocation to be retained (eg persisted to a database) so that it can be executed at a later time
+<2> reference to the parent `Command` requesting the action be performed as a background command. This allows information such as the initiating user to be obtained.
+
+The API of `ActionInvocationMemento` in turn is:
+
+[source,java]
+----
+public class ActionInvocationMemento {
+ public String getActionId() { ... }
+ public String getTargetClassName() { ... }
+ public String getTargetActionName() { ... }
+ public Bookmark getTarget() { ... }
+ public int getNumArgs() { ... }
+ public Class<?> getArgType(int num) throws ClassNotFoundException { ... }
+ public <T> T getArg(int num, Class<T> type) { ... }
+
+ public String asMementoString() { ... } // <1>
+}
+----
+<1> lets the `BackgroundCommandService` implementation convert the action invocation into a simple string.
+
+
+
+== "Internal" SPI
+
+The `BackgroundCommandExecution` (in isis-core) is an abstract template class for xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_AbstractIsisSessionTemplate[headless access], that defines an abstract hook method to obtain background `Command`s to be executed:
+
+[source,java]
+----
+public abstract class BackgroundCommandExecution
+ extends AbstractIsisSessionTemplate {
+ ...
+ protected abstract List<? extends Command> findBackgroundCommandsToExecute();
+ ...
+}
+----
+
+The developer is required to implement this hook method in a subclass.
+
+
+
+
+== Implementation
+
+The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation (`org.isisaddons.module.command.dom.BackgroundCommandServiceJdo`) that persists ``Command``s using the JDO/DataNucleus object store. It further provides a number of supporting services:
+
+* `org.isisaddons.module.command.dom.BackgroundCommandServiceJdoRepository` is a repository to search for persisted background ``Command``s
+
+* `org.isisaddons.module.command.dom.BackgroundCommandServiceJdoContributions` contributes actions for searching for persisted child and sibling ``Command``s.
+
+The module also provides a concrete subclass of `BackgroundCommandExecution` that knows how to query for persisted (background) `Command`s such that they can be executed by a scheduler.
+
+[TIP]
+====
+Details of setting up the Quartz scheduler to actually execute these persisted commands can be found on the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] page.
+====
+
+
+
+
+== Usage
+
+Background commands can be created either declaratively or imperatively.
+
+The declarative approach involves annotating an action using xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] with `@Action#commandExecuteIn=CommandExecuteIn.BACKGROUND`.
+
+The imperative approach involves explicitly calling the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] from within domain object's action.
+
+
+
+
+== Registering the Services
+
+The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation
+of this service (`BackgroundCommandService`), and also provides a number of related domain services
+(`BackgroundCommandServiceJdo`, `BackgroundCommandJdoRepository` and `BackgroundCommandServiceJdoContributions`). This
+module also provides service implementations of the
+xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`].
+
+Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
+then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
+
+If contributions are not required in the UI, these can be suppressed either using security or by implementing a
+xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
+
+
+
+
+
+== Related Services
+
+As discussed above, this service supports the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] , persisting `Command`s such that they can be executed in the background.
+
+There is also a tie-up with the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] and its supporting xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] domain service. The `CommandContext` service is responsible for providing a parent `Command` with which the background `Command`s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s (analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s). The `BackgroundCommandService` ensures that these background `Command`s are associated with the parent "foreground" `Command`.
+
+What that means is that the implementations of `CommandService` and `BackgroundCommandService` go together, hence both implemented in the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module.).
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ClassDiscoveryService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ClassDiscoveryService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ClassDiscoveryService.adoc
new file mode 100644
index 0000000..059d070
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ClassDiscoveryService.adoc
@@ -0,0 +1,82 @@
+[[_rgsvc_spi_ClassDiscoveryService]]
+= `ClassDiscoveryService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `ClassDiscovery` service is used to automatically discover subclasses of any given type on the classpath. The primary use case is to support "convention-over-configuration" designs that work with a minimum of configuration.
+
+This service is used by the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] service to automatically locate any xref:rgcms.adoc#_rgcms_classes_super_FixtureScript[`FixtureScript`] implementations.
+
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface ClassDiscoveryService2 {
+ @Programmatic
+ <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type, String packagePrefix);
+ @Deprecated
+ @Programmatic
+ <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type); // <1>
+}
+----
+<1> no longer used
+
+
+
+== Implementation
+
+Isis provides an implementation of this service, namely `o.a.i.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections`.
+
+[NOTE]
+====
+This implementation is also used to discover domain services annotated with xref:rgant.adoc#_rgant-DomainService[`@DomainService`]. Currently this logic uses the implementation directly, so is not pluggable. However, the entire `ServicesInstaller`
+====
+
+
+
+== Usage
+
+The usage will vary depending upon the conventions of the design. As of 1.9.0, the usage of the service has been
+centralized such that the packages to be scanned are located from the xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[`AppManifest`]'s `#getModules()` method.
+
+For example, the xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype]'s app manifest includes:
+
+[source,java]
+----
+public class DomainAppAppManifest implements AppManifest {
+ @Override
+ public List<Class<?>> getModules() {
+ return Arrays.asList(
+ DomainAppDomainModule.class, // domain (entities and repositories)
+ DomainAppFixtureModule.class, // fixtures
+ DomainAppAppModule.class // home page service etc
+ );
+ }
+ ...
+}
+----
+
+where the three module classes in effect define three different package prefixes to search under (for domain services, fixture scripts and persistent entities).
+
+Other usages of the `ClassDiscoveryService` are likely to work in a similar way, requiring some sort of scope to be specified.
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `ClassDiscoveryService2` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_CommandService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_CommandService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_CommandService.adoc
new file mode 100644
index 0000000..ba0dfac
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_CommandService.adoc
@@ -0,0 +1,100 @@
+[[_rgsvc_spi_CommandService]]
+= `CommandService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `CommandService` service supports the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service such that `Command` objects (that reify the invocation of an action on a domain object into an object) can be persisted.
+
+Persistent `Command`s support several use cases:
+
+* they enable profiling of the running application (which actions are invoked then most often, what is their response time)
+* they act as a parent to any background commands that might be invoked through the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`]
+* if xref:rgsvc.adoc#_rgsvc_spi_AuditingService[auditing] is configured, they provide better audit information, since the `Command` (the 'cause' of an action) can be correlated to the audit records (the "effect" of the action) by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`]
+* if xref:rgsvc.adoc#_rgsvc_spi_PublishingService[publishing] is configured, they provide better traceability as the `Command` is also correlated with any published events, again through the unique xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`]
+* the associated xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation attribute also allows action invocations to be performed in the background. In this case the act of invoking the action on an object instead returns the `Command` to the user.
+
+
+
+The screencast below provides a run-through of the command (profiling) service, auditing service, publishing service. It also shows how commands can be run in the background either explicitly by scheduling through the background service or implicitly by way of a framework annotation.
+
+
+
+video::tqXUZkPB3EI[youtube,width="560px",height="315px"]
+
+[NOTE]
+====
+Note that this screencast shows an earlier version of the xref:ugvw.adoc#[Wicket viewer] UI (specifically, pre 1.8.0).
+====
+
+
+== SPI
+
+The `CommandService` service defines the following very simple API:
+
+[source,java]
+----
+public interface CommandService {
+ @Programmatic
+ Command create();
+ @Programmatic
+ void startTransaction(Command command, final UUID transactionId);
+ @Programmatic
+ void complete(Command command);
+ @Programmatic
+ boolean persistIfPossible(Command command);
+}
+----
+
+where `Command` is defined as defined by the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service.
+
+
+== Implementation
+
+The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation (`org.isisaddons.module.command.dom.CommandServiceJdo`) that persists ``Command``s using the JDO/DataNucleus object store. It further provides a number of supporting services:
+
+* `org.isisaddons.module.command.dom.CommandServiceJdoRepository` is a repository to search for persisted ``Command``s
+
+* `org.isisaddons.module.command.dom.CommandServiceJdoContributions` contributes actions for searching for persisted child and sibling ``Command``s.
+
+
+
+== Usage
+
+The typical way to indicate that an action should be reified into a `Command` is by annotating the action using xref:rgant.adoc#_rgant-Action_command[`@Action#command()`].
+
+
+
+
+== Registering the Services
+
+The (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module provides an implementation
+of this service (`CommandService`), and also provides a number of related domain services
+(`CommandJdoRepository` and `CommandServiceJdoContributions`). This
+module also provides service implementations of the
+xref:rgsvc.adoc#_rgsvc_spi_CommandService[`BackgroundCommandService`].
+
+Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
+then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
+
+If contributions are not required in the UI, these can be suppressed either using security or by implementing a
+xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
+
+
+
+
+== Related Services
+
+As discussed above, this service supports the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`], providing the ability for `Command` objects to be
+persisted. This is closely related to the xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]that allows the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] to schedule commands for background/asynchronous execution.
+
+The implementations of `CommandService` and `BackgroundCommandService` are intended to go together, so that persistent parent `Command`s can be associated with their child background `Command`s.
+
+The services provided by this module combines very well with the xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`]. The `CommandService` captures the _cause_ of an interaction (an action was invoked, a property was edited), while the `AuditingService3` captures the _effect_ of that interaction in terms of changed state.
+
+You may also want to configure the xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
+
+All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentMappingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentMappingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentMappingService.adoc
new file mode 100644
index 0000000..997ce3e
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentMappingService.adoc
@@ -0,0 +1,107 @@
+[[_rgsvc_spi_ContentMappingService]]
+= `ContentMappingService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `ContentMappingService` supports the (default implementation of the) xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`] allowing the xref:ugvro.adoc#[RestfulObjects viewer] to allow domain objects to be transformed into some other format as specified by the HTTP `Accept` header.
+
+See xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`] for further discussion.
+
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface ContentMappingService {
+ @Programmatic
+ Object map(Object object, // <1>
+ List<MediaType> acceptableMediaTypes, // <2>
+ RepresentationType representationType); // <3>
+
+}
+
+----
+<1> typically the input is a domain object (whose structure might change over time), and the output is a DTO (whose structure is guaranteed to be preserved over time)
+<2> as per the caller's HTTP `Accept` header
+<3> the representation type required (as per the link:http://restfulobjects.org[Restful Objects spec]).
+
+
+[WARNING]
+====
+This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
+====
+
+
+== Implementations
+
+No default implementations are provided by Apache Isis framework itself. However, the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] includes a sample implementation to convert its `ToDoItem`
+entity into (two different versions of) a `ToDoItemDto` (JAXB annotated). This uses the
+link:http://orika-mapper.github.io/orika-docs/intro.html[Orika] mapping library.
+
+The source code is:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+public class CustomContentMappingService implements ContentMappingService {
+ private MapperFactory mapperFactory; // <1>
+ @Programmatic
+ @PostConstruct
+ public void init() {
+ mapperFactory = new DefaultMapperFactory.Builder().build();
+ mapperFactory.registerClassMap(
+ mapperFactory.classMap(ToDoItem.class, ToDoItemDto.class) // <2>
+ .byDefault() // <3>
+ .toClassMap());
+ mapperFactory.registerClassMap(
+ mapperFactory.classMap(Bookmark.class, OidDto.class) // <4>
+ .field("identifier", "objectIdentifier") // <5>
+ .byDefault() // all other fields are compatible // <6>
+ .toClassMap());
+ }
+ @Programmatic
+ @Override // <7>
+ public Object map(
+ final Object object,
+ final List<MediaType> acceptableMediaTypes,
+ final RepresentationType representationType) {
+ if(object instanceof ToDoItem) {
+ final Bookmark bookmark = bookmarkService.bookmarkFor(object);
+ final ToDoItemDto dto =
+ mapperFactory.getMapperFacade().map(object, ToDoItemDto.class); // <8>
+ final OidDto oidDto =
+ mapperFactory.getMapperFacade().map(bookmark, OidDto.class); // <9>
+ dto.setOid(oidDto); // <10>
+ return dto;
+ }
+ return null;
+ }
+ @javax.inject.Inject
+ private BookmarkService bookmarkService;
+}
+----
+<1> registry of known mappings
+<2> how to map `ToDoItem` to `ToDoItemDto` ...
+<3> ... all properties have same name in both source and destination types
+<4> how to map `Bookmark` to `OidDto` ...
+<5> ... this property has a different name
+<6> ... all other properties have same name
+<7> the main API to implement. This implementation ignores the `acceptableMediaTypes` and `representationType`
+<8> map the domain object to the DTO
+<9> and map its oid (by way of the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]
+<10> and perform some additional manual wiring (because domain objects don't _know_ their Oids).
+
+You'll notice that the implementation doesn't actually use the `acceptableMediaTypes` and `representationType` parameters. That's because the calling `ContentNegotiationServiceXRoDomainType` will double check that the returned object is of the correct type (as defined by the `x-ro-domain-type` parameter of the HTTP `Accept` header). Since this (example) todoapp only offers a single mapping, there's therefore no need to for the mapping service to check further.
+
+
+
+== Related Services
+
+This service is a companion to the default implementation of the xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentNegotiationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentNegotiationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentNegotiationService.adoc
new file mode 100644
index 0000000..498a859
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ContentNegotiationService.adoc
@@ -0,0 +1,204 @@
+[[_rgsvc_spi_ContentNegotiationService]]
+= `ContentNegotiationService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `ContentNegotiationService` is a plug-in point for the xref:ugvro.adoc#[RestfulObjects viewer] so that it can generate representations according to HTTP `Accept` header of the request. This idea is discussed in section 34.1 of the link:http://restfulobjects.org[Restful Objects spec] v1.0.
+
+The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain Javascript library, say) expect, or at least works best with, a certain style of representation.
+
+Another use case is to support "third party" REST clients over which you have no control. In this scenario you _must not_ naively expose entities through the RO viewer, because over time those entities will inevitably evolve and change their structure. If the entities were exposed directly then those REST clients will break.
+
+Instead you need to create some sort of stable facade over your domain entities, one which you will preserve even if the domain entities change. There are three ways in which you can do this:
+
+* first is to solve the problem at the domain layer by defining a regular Apache Isis xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]. This is then surfaced over the RO viewer. +
++
+If the underlying entities change, then care must be taken to ensure that structure of the view model nevertheless is unchanged.
+
+* a second option is to solve the problem at the persistence layer, but defining a (SQL) view in the database and then xref:ugbtb.adoc#_ugbtb_more-advanced_mapping-rdbms-views[mapping this] to a (read-only) entity. Again this is surfaced by the RO viewer. +
++
+If the underlying tables change (as the result of a change in their corresponding domain entities) then once more the view must be refactored so that it still presents the same structure.
+
+* our third option is to solve the problem at the presentation layer, using the `ContentNegotiationService` described in this section. +
++
+The `ContentNegotiationService` is responsible for inspecting the HTTP `Accept` header, and use this to select the correct representation to render. +
++
+The Apache Isis framework provides a default implementation of `ContentNegotiationService` which inspects the "x-ro-domaintype" component of the HTTP `Accept` header. If present, this implementation will delegate to the companion xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] service, if configured. +
++
+A typical implementation of `ContentMappingService` will convert the domain object into some sort of DTO (data transfer object) as specified by the "x-ro-domaintype". If this DTO is annotated with JAXB or Jackson mappings, then the RO viewer (courtesy of the underlying link:http://resteasy.jboss.org/[RestEasy] framework) can serialize these directly +
++
+What all that means is that, if the underlying entities change, we are required to update the mappings in the `ContentMappingService` to map to the same DTOs.
+
+This diagram illustrates the three options available:
+
+image::{_imagesdir}reference-services-spi/ContentNegotiationService/facade-choices.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/facade-choices.png"]
+
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface ContentNegotiationService {
+ @Programmatic
+ Response.ResponseBuilder buildResponse( // <1>
+ RepresentationService.Context2 renderContext2,
+ ObjectAdapter objectAdapter);
+ @Programmatic
+ Response.ResponseBuilder buildResponse( // <2>
+ RepresentationService.Context2 renderContext2,
+ ObjectAndProperty objectAndProperty);
+ @Programmatic
+ Response.ResponseBuilder buildResponse( // <3>
+ RepresentationService.Context2 renderContext2,
+ ObjectAndCollection objectAndCollection);
+ @Programmatic
+ Response.ResponseBuilder buildResponse( // <4>
+ RepresentationService.Context2 renderContext2,
+ ObjectAndAction objectAndAction);
+ @Programmatic
+ Response.ResponseBuilder buildResponse( // <5>
+ RepresentationService.Context2 renderContext2,
+ ObjectAndActionInvocation objectAndActionInvocation);
+}
+----
+<1> representation of a single object, as per section 14.4 of the RO spec, v1.0
+<2> representation of a single property of an object, as per section 16.4 of the RO spec v1.0
+<3> representation of a single collection of an object, as per section 17.5 of the RO spec v1.0
+<4> representation of a single action (prompt) of an object, as per section 18.2 of the RO spec v1.0
+<5> representation of the results of a single action invocation, as per section 19.5 of the RO spec v1.0
+
+These methods provide:
+
+* a `RepresentationService.Context2` which provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings)
+
+* an object representing the information to be rendered +
++
+eg `ObjectAdapter`, `ObjectAndProperty`, `ObjectAndCollection` etc
+
+In all cases, returning `null` will result in the regular RO spec representation being returned.
+
+
+[WARNING]
+====
+This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
+====
+
+
+
+== Implementation
+
+`ContentNegotiationServiceAbstract` (in `o.a.i.v.ro.rendering.service.conneg`) provides a no-op implementation of the SPI, along with supporting methods:
+
+[source,java]
+----
+public abstract class ContentNegotiationServiceAbstract implements ContentNegotiationService {
+ ...
+ protected Object objectOf(final ObjectAdapter objectAdapter) { ... }
+ protected Object returnedObjectOf(ObjectAndActionInvocation objectAndActionInvocation) { ... }
+
+ protected Class<?> loadClass(String cls) { ... }
+
+ protected void ensureJaxbAnnotated(Class<?> domainType) { ... }
+ protected void ensureDomainObjectAssignable(
+ String xRoDomainType, Class<?> domainType, Object domainObject) { ... }
+}
+----
+
+As discussed in the introduction, the framework also provides a default implementation, `o.a.i.v.ro.rendering.service.conneg.ContentNegotiationServiceXRoDomainType`. This handles content negotiation for two of the possible representations, object representations and for action result representations:
+
+* For object representations it will handle requests with HTTP `Accept` headers of the form:
+** `application/json;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=...`
+** `application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=...`
+
+* for action result representations it will similarly handle requests with HTTP `Accept` headers of the form:
+** `application/json;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=...` +
+** `application/xml;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=...`
+
+
+The value of the `x-ro-domain-type` parameter corresponds to the DTO to be mapped into by the xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`].
+
+If the DTO is annotated with JAXB, then also note that the runtime type must be annotated with the JAXB `javax.xml.bind.annotation.XmlRootElement` so that RestEasy is able to unambiguously serialize it.
+
+
+
+
+== Usage
+
+You can find an example of all these services in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]. This defines a `ToDoItemDto` class that is JAXB annotated (it is in fact generated from an XSD).
+
+The example app also includes an implementation of `ContentMappingService` that maps `todoapp.dom.module.todoitem.ToDoItem` entities to `todoapp.dto.module.todoitem.ToDoItemDto` classes.
+
+A REST client can therefore request a DTO representation of an entity by invoking
+
+[source]
+----
+http://localhost:8080/restful/objects/TODO/0
+----
+
+with an `Accept` header of:
+
+[source]
+----
+application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto
+----
+
+will result in an XML serialization of that class:
+
+image::{_imagesdir}reference-services-spi/ContentNegotiationService/accept-xml.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/accept-xml.png"]
+
+
+while similarly hitting the same URL with an `Accept` header of:
+
+[source]
+----
+application/json;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto
+----
+
+will result in the JSON serialization of that class:
+
+image::{_imagesdir}reference-services-spi/ContentNegotiationService/accept-json.png[width="700px",link="{_imagesdir}reference-services-spi/ContentNegotiationService/accept-json.png"]
+
+
+
+
+[_rgsvc_spi_ContentNegotiationService_Configuration]]
+== Configuration
+
+The default `ContentNegotiationServiceXRoDomainType` implementation provides a xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] which controls whether a mapped domain object is pretty-printed (formatted, indented) or not:
+
+[source,ini]
+----
+isis.services.ContentNegotiationServiceXRoDomainType.prettyPrint=true
+----
+
+If the property is not set, then the default depends on the xref:rgcfg.adoc#_rgcfg_deployment-types[deployment type]; production mode will disable pretty printing, while prototyping mode will enable it.
+
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
+implementation of `ContentNegotiationService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+== Related Services
+
+The default implementation of `ContentNegotiationService` delegates to xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] (if present) to convert domain entities into a stable form (eg DTO).
+
+The `ContentNegotiationService` is itself called by the (default implementation of) xref:rgsvc.adoc#_rgsvc_spi_RepresentationService[`RepresentationService`].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EmailNotificationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EmailNotificationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EmailNotificationService.adoc
new file mode 100644
index 0000000..469ef7c
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EmailNotificationService.adoc
@@ -0,0 +1,81 @@
+[[_rgsvc_spi_EmailNotificationService]]
+= `EmailNotificationService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `EmailNotificationService` supports the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] (self sign-up) features of the xref:ugvw.adoc#[Wicket viewer] whereby a user can sign-up to access an application by providing a valid email address.
+
+The Wicket viewer will check whether an implementation of this service (and also the xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`UserRegistrationService`]) is available, and if so will (unless configured not to) expose a sign-up page where the user enters their email address. A verification email is sent using this service; the email includes a link back to the running application. The user then completes the registration process (choosing a user name, password and so on) and the Wicket viewer creates an account for them (using the aforementioned `UserRegistrationService`).
+
+The role of this service in all of this is to format and send out emails for the initial registration, or for password resets.
+
+The default implementation of this service uses the xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`], which must be configured in order for user registration to be enabled.
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface EmailNotificationService extends Serializable {
+ @Programmatic
+ boolean send(EmailRegistrationEvent ev); // <1>
+ @Programmatic
+ boolean send(PasswordResetEvent ev); // <2>
+ @Programmatic
+ boolean isConfigured(); // <3>
+}
+----
+<1> sends an email to verify an email address as part of the initial user registration
+<2> sends an email to reset a password for an already-registered user
+<3> determines whether the implementation was configured and initialized correctly
+
+If `isConfigured()` returns false then it is _not_ valid to call `send(...)` (and doing so will result in an `IllegalStateException` being thrown.
+
+
+== Implementation
+
+The framework provides a default implementation, `o.a.i.core.runtime.services.userreg.EmailNotificationServiceDefault`
+that constructs the emails to send.
+
+
+
+=== Alternative Implementations
+
+The text of these email templates is hard-coded as resources, in other words baked into the core jar files. If you need to use different text then you can of course always write and register your own implementation to be used instead of Isis' default.
+
+If you have configured an alternative email service implementation, it should process the message body as HTML.
+
+If you wish to write an alternative implementation of this service, note that (unlike most Apache Isis domain services) the implementation is also instantiated and injected by Google Guice. This is because `EmailNotificationService` is used as part of the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality and is used by Wicket pages that are accessed outside of the usual Apache Isis runtime.
+
+This implies a couple of additional constraints:
+
+* first, implementation class should also be annotated with `@com.google.inject.Singleton`
+* second, there may not be any Apache Isis session running. (If necessary, one can be created on the fly using `IsisContext.doInSession(...)`)
+
+To ensure that your alternative implementation takes the place of the default implementation, register it explicitly in `isis.properties`.
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
+implementation of `EmailNotificationService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+== Related Services
+
+As noted elsewhere, the default implementation of this service uses xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]. This service has no specific configuration properties but does require that the `EmailService` has been configured.
+
+Conversely, this service is used by (Isis' default implementation of) xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`UserRegistrationService`].
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ErrorReportingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ErrorReportingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ErrorReportingService.adoc
new file mode 100644
index 0000000..ff9309b
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ErrorReportingService.adoc
@@ -0,0 +1,106 @@
+[[_rgsvc_spi_ErrorReportingService]]
+= `ErrorReportingService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `ErrorReportingService` service is an optional SPI that providies the ability to record any errors/exceptions that
+ might occur in the application into an external incident recording system (such as JIRA). The service also allows
+ a user-friendly (jargon-free) error message to be returned and rendered to the end-user, along with an optional
+ incident reference (eg a JIRA issue `XXX-1234`).
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface ErrorReportingService {
+ Ticket reportError(ErrorDetails errorDetails);
+}
+----
+
+where `ErrorDetails` provided to the service is:
+
+[source,java]
+----
+public class ErrorDetails {
+ public String getMainMessage() { ... } // <1>
+ public boolean isRecognized() { ... } // <2>
+ public boolean isAuthorizationCause() { ... } // <3>
+ public List<String> getStackTraceDetailList() { // <4>
+}
+----
+<1> the main message to be displayed to the end-user. The service is responsible for translating this into the language of the end-user (it can use xref:rgsvc.adoc#_rgsvc_spi_LocaleProvider[`LocaleProvider`] if required).
+<2> whether this message has already been recognized by an xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`] service. Generally this converts potentially non-recoverable (fatal) exceptions into recoverable exceptions (warnings) as well providing an alternative mechanism for generating user-friendly error messages.
+<3> whether the cause of the exception was due to a lack of privileges. In such cases the UI restricts the information shown to the end-user, to avoid leaking potentially sensitive information
+<4> the stack trace of the exception, including the trace of any exceptions in the causal chain. These technical details are hidden from the user and only shown for non-recoverable exceptions.
+
+
+and `Ticket` (returned by the service) has the constructor:
+
+[source,java]
+----
+public class Ticket implements Serializable {
+ public Ticket(
+ final String reference, // <1>
+ final String userMessage, // <2>
+ final String details) { ... } // <3>
+}
+----
+<1> is a unique identifier that the end-user can use to track any follow-up from this error. For example, an
+implementation might automatically log an issue in a bug tracking system such as JIRA, in which case the reference would
+probably be the JIRA issue number <tt>XXX-1234</tt>.
+<2> a short, jargon-free message to display to the end-user.
+<3> is optional additional details to show. For example, these might include text on how to recover from the error, or
+ workarounds, or just further details on contacting the help desk if the issue is severe and requires immediate
+ attention.
+
+
+
+
+== Implementation
+
+The (non-ASF) http://github.com/isisaddons/isis-app-kitchensink[Isis addons' kitchensink] app provides an example
+implementation:
+
+[source,java]
+----
+@DomainService( nature = NatureOfService.DOMAIN )
+public class KitchensinkErrorReportingService implements ErrorReportingService {
+ private int ticketNumber = 1;
+ @Override
+ public Ticket reportError(final ErrorDetails errorDetails) {
+ return new Ticket(
+ nextTicketReference(),
+ "The Kitchen sink app is sorry to report that: " + errorDetails.getMainMessage(),
+ "These are additional details for the end-user to read.\n"
+ + "This content should be able to span many lines.\n"
+ + "More detail.\n"
+ + "Some suggested work-arounds.\n"
+ + "Details of how to contact help desk.\n"
+ + "And so on");
+ }
+ String nextTicketReference() {
+ return "" + ticketNumber++;
+ }
+}
+----
+
+which is rendered as:
+
+image::{_imagesdir}reference-services-spi/ErrorReportingService/kitchensink-example.png[width="860px",link="{_imagesdir}reference-services-spi/ErrorReportingService/kitchensink-example.png"]
+
+
+
+
+== Registering the Services
+
+There is no default implementation of this service. To register your own implementation (and assuming that an
+`AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), then just
+ensure that the implementation is on the classpath and the module containing the implementation is returned in
+`AppManifest#getModules()`.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EventSerializer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EventSerializer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EventSerializer.adoc
new file mode 100644
index 0000000..5bf54c0
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_EventSerializer.adoc
@@ -0,0 +1,74 @@
+[[_rgsvc_spi_EventSerializer]]
+= `EventSerializer`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `EmailSerializer` service is a supporting service intended for use by (any implementation of) xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`]. Its responsibility is to combine the `EventMetadata` and the `EventPayload` into some serialized form (such as JSON, XML or a string) that can then be published.
+
+See xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`] for further discussion.
+
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface EventSerializer {
+ Object serialize( // <1>
+ EventMetadata metadata, // <2>
+ EventPayload payload); // <3>
+}
+----
+<1> returns an object for maximum flexibility, which is then handed off to the `PublishingService`.
+<2> standard metadata about the event, such as the user, the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`], date/time etc
+<3> for published actions, will generally be an `EventPayloadForActionInvocation` (or subclass thereof); for published objects, will generally be an `EventPayloadForObjectChanged` (or subclass thereof)
+
+It's important to make sure that the publishing service implementation is able to handle the serialized form. Strings are a good lowest common denominator, but in some cases a type-safe equivalent, such as a w3c DOM `Document` or JSON node might be passed instead.
+
+
+
+
+
+== Implementation
+
+The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an implementation (`org.isisaddons.module.publishing.dom.eventserializer.RestfulObjectsSpecEventSerializer`) that represents the event payload using the representation defined by the link:http://restfulobjects.org[Restful Objects spec] of (transient) objects, grafting on the metadata as additional JSON nodes.
+
+For example, this is the JSON generated on an action invocation:
+
+.JSON representation of a published action invocation
+image::{_imagesdir}reference-services-spi/EventSerializer/action-invocation-published-to-stderr.png[width="750px",link="{_imagesdir}reference-services-spi/EventSerializer/action-invocation-published-to-stderr.png"]
+
+while this is the object change JSON:
+
+.JSON representation of a published changed object
+image::{_imagesdir}reference-services-spi/EventSerializer/changed-object-published-to-stderr.png[width="750px",link="{_imagesdir}reference-services-spi/EventSerializer/changed-object-published-to-stderr.png"]
+
+You could if you wish change the representation by registering your own implementation of this API in `isis.properties`:
+
+
+
+
+== Registering the Services
+
+There is no default implementation of this service provided by the core Apache Isis framework.
+
+The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an
+implementation of this service (`RestfulObjectsSpecEventSerializer`) that serializes action invocations and published
+objects into a format based on the Restful Objects specification. It also (as you might imagine) provides an
+implementation of the xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`].
+
+Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
+then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
+
+
+
+== Related Services
+
+This service is intended (though not mandated) to be used by implementations of xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`]. The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module does use it (though the (non-ASF)
+http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] module does not).
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ExceptionRecognizer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ExceptionRecognizer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ExceptionRecognizer.adoc
new file mode 100644
index 0000000..95faabf
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_ExceptionRecognizer.adoc
@@ -0,0 +1,119 @@
+[[_rgsvc_spi_ExceptionRecognizer]]
+= `ExceptionRecognizer`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `ExceptionRecognizer` service provides the mechanism for both the domain programmer and also for components to be able to recognize and handle certain exceptions that may be thrown by the system. Rather than display an obscure error to the end-user, the application can instead display a user-friendly message.
+
+For example, the JDO/DataNucleus Objectstore provides a set of recognizers to recognize and handle SQL constraint exceptions such as uniqueness violations. These can then be rendered back to the user as expected errors, rather than fatal stacktraces.
+
+It is also possible to provide additional implementations, registered in `isis.properties`. Unlike other services, where any service registered in `isis.properties` replaces any default implementations, in the case of this service all implementations registered are "consulted" to see if they recognize an exception (the chain-of-responsibility pattern).
+
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface ExceptionRecognizer2 ... {
+ public enum Category { // <1>
+ ...
+ }
+ public static class Recognition { // <2>
+ private Category category;
+ private String reason;
+ ...
+ }
+ @Programmatic
+ public Recognition recognize2(Throwable ex); // <3>
+
+ @Deprecated
+ @Programmatic
+ public String recognize(Throwable ex); // <4>
+
+}
+----
+<1> an enumeration of varies categories of exceptions that are recognised
+<2> represents the fact that an exception has been recognized as has been converted into a user-friendy message, and has been categorized
+<3> the main API, to attempt to recognize an exception
+<4> deprecated API which converted exceptions into strings (reasons), ie without any categorization. This is no longer called.
+
+
+The categories are:
+
+[source,java]
+----
+public interface ExceptionRecognizer2 ... {
+ public enum Category {
+ CONSTRAINT_VIOLATION, // <1>
+ NOT_FOUND, // <2>
+ CONCURRENCY, // <3>
+ CLIENT_ERROR, // <4>
+ SERVER_ERROR, // <5>
+ OTHER // <6>
+ }
+ ...
+}
+
+----
+<1> a violation of some declarative constraint (eg uniqueness or referential integrity) was detected.
+<2> the object to be acted upon cannot be found (404)
+<3> a concurrency exception, in other words some other user has changed this object.
+<4> recognized, but for some other reason... 40x error
+<5> 50x error
+<6> recognized, but uncategorized (typically: a recognizer of the original `ExceptionRecognizer` API).
+
+
+In essence, if an exception is recognized then it is also categorized. This lets the viewer act accordingly. For example, if an exception is raised from the loading of an individual object, then this is passed by the registered ``ExceptionRecognizer``s. If any of these recognize the exception as representing a not-found exception, then an Apache Isis `ObjectNotFoundException` is raised. Both the viewers interprets this correctly (the xref:ugvw.adoc#[Wicket viewer] as a suitable error page, the xref:ugvro.adoc#[Restful Objects viewer] as a 404 status return code).
+
+
+If the implementation recognizes the exception then it returns a user-friendly message to be rendered (by the viewer) back to the user; otherwise it returns `null`. There is no need for the implementation to check for exception causes; the casual chain is unwrapped by Apache Isis core and each exception in the chain will also be passed through to the recognizer (from most specific to least). The recognizer implementation can therefore be as fine-grained or as coarse-grained as it wishes.
+
+
+
+
+== Implementation
+
+The framework provides two default implementations:
+
+* `o.a.i.core.metamodel.services.container.DomainObjectContainerDefault` provided by Apache Isis core is itself an `ExceptionRecognizer`, and will handle ``ConcurrencyException``s. It will also handle any application exceptions raised by the system (subclasses of `o.a.i.applib.RecoverableException`).
+
+* `o.a.i.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore` bundles up a number of more fine-grained implementations:
+** `ExceptionRecognizerForSQLIntegrityConstraintViolationUniqueOrIndexException`
+** `ExceptionRecognizerForJDOObjectNotFoundException`
+** `ExceptionRecognizerForJDODataStoreException`
+
+
+If you want to recognize and handle additional exceptions (for example to capture error messages specific to the JDBC driver you might be using), then create a fine-grained implementation of `ExceptionRecognizer2` for the particular error message (there are some convenience implementations of the interface that you can subclass from if required) and register in `isis.properties`.
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then the default
+implementations provided by the framework (`DomainObjectContainerDefault` and
+`ExceptionRecognizerCompositeForJdoObjectStore`) will be registered.
+
+In addition, you can register any further exception recognizers in `isis.properties`:
+
+[source,ini]
+----
+isis.services=...,\
+ com.mycompany.myapp.MyExceptionRecognizer,\
+ ...
+----
+
+[NOTE]
+====
+Prior to 1.9.0, the `ExceptionRecognizerCompositeForJdoObjectStore` also required manual registration.
+====
+
+If the JDO exception recognizers are not required (rather unlikely), then they can be disabled en-masse using the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.ExceptionRecognizerCompositeForJdoObjectStore.disable`.
+
[10/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Programmatic.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Programmatic.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Programmatic.adoc
index 967e3a9..9b2923f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Programmatic.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Programmatic.adoc
@@ -5,7 +5,7 @@
:_imagesdir: images/
-The `@Programmatic` annotation causes the method to be excluded completely from the Apache Isis metamodel. This means it won't appear in any UI, and it won't appear in any xref:rgsvc.adoc#_rgsvc-api_MementoService[memento]s or xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[snapshot]s.
+The `@Programmatic` annotation causes the method to be excluded completely from the Apache Isis metamodel. This means it won't appear in any UI, and it won't appear in any xref:rgsvc.adoc#_rgsvc_api_MementoService[memento]s or xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[snapshot]s.
A common use-case is to ignore implementation-level artifacts. For example:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Property.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property.adoc
index 323a0ab..ecf9d33 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property.adoc
@@ -23,7 +23,7 @@ It is also possible to apply the annotation to actions of domain services that a
|xref:rgant.adoc#_rgant-Property_domainEvent[`domainEvent()`]
|subtype of `PropertyDomainEvent` +
(`PropertyDomainEvent.Default`)
-|the event type to be posted to the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] to broadcast the property's business rule checking (hide, disable, validate) and its modification (before and after).
+|the event type to be posted to the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] to broadcast the property's business rule checking (hide, disable, validate) and its modification (before and after).
|xref:rgant.adoc#_rgant-Property_editing[`editing()`]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_domainEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_domainEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_domainEvent.adoc
index 2084b94..0adcabe 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_domainEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_domainEvent.adoc
@@ -13,7 +13,7 @@ Whenever a domain object (or list of domain objects) is to be rendered, the fram
* pre-execute phase: before the modification of the property
* post-execute: after the modification of the property
-Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
+Subscribers subscribe through the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can influence each of these phases.
By default the event raised is `PropertyDomainEvent.Default`. For example:
@@ -56,7 +56,7 @@ rather than through the constructor. This substantially reduces the boilerplate
== Subscribers
-Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API or (if the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] has been appropriately configured) using the link:http://www.axonframework.org/[Axon Framework] API. The examples below use the Guava API.
Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
@@ -150,5 +150,5 @@ then no event will be posted.
== Raising events programmatically
Normally events are only raised for interactions through the UI. However, events can be raised programmatically by
-wrapping the target object using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] service.
+wrapping the target object using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] service.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_notPersisted.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_notPersisted.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_notPersisted.adoc
index bc4de15..f7f63dd 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_notPersisted.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-Property_notPersisted.adoc
@@ -7,7 +7,7 @@
-The (somewhat misnamed) `notPersisted()` attribute indicates that the collection should be excluded from any snapshots generated by the xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]. This attribute is also supported for xref:rgant.adoc#_rgant-Collection_notPersisted[collections].
+The (somewhat misnamed) `notPersisted()` attribute indicates that the collection should be excluded from any snapshots generated by the xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]. This attribute is also supported for xref:rgant.adoc#_rgant-Collection_notPersisted[collections].
[WARNING]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-RequestScoped.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-RequestScoped.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-RequestScoped.adoc
index f835832..290139d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-RequestScoped.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-RequestScoped.adoc
@@ -11,7 +11,7 @@ The `@javax.enterprise.context.RequestScoped` link:https://jcp.org/en/jsr/detail
Although Apache Isis does not (currently) leverage CDI, the semantics are the same as request-scoped service; a new instance is created for each HTTP request, reserved for the exclusive use of all objects interacted with during that request.
-One of the built-in domain services that uses this annotation is xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`], intended to allow the arbitrary sharing of data between objects. Here is the full source code of this service is:
+One of the built-in domain services that uses this annotation is xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`], intended to allow the arbitrary sharing of data between objects. Here is the full source code of this service is:
[source,java]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-ViewModel.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-ViewModel.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-ViewModel.adoc
index 5302435..f16f21c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-ViewModel.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-ViewModel.adoc
@@ -35,7 +35,7 @@ Note that there is a `DomainObjectContainer#newViewModelInstance(.)`; this is fo
The view model's memento will be derived from the value of the view model object's properties. Any xref:rgant.adoc#_rgant-Property_notPersisted[`@Property#notPersisted()`] properties will be excluded from the memento, as will any xref:rgant.adoc#_rgant-Programmatic[`@Programmatic`] properties. Properties that are merely xref:rgant.adoc#_rgant-Property_hidden[hidden] _are_ included in the memento.
-Only properties supported by the configured xref:rgsvc.adoc#_rgsvc-api_MementoService[`MementoService`] can be used. The default implementation supports all the value types and persisted entities.
+Only properties supported by the configured xref:rgsvc.adoc#_rgsvc_api_MementoService[`MementoService`] can be used. The default implementation supports all the value types and persisted entities.
(As of 1.8.0) there are some limitations:
* view models cannot hold collections other view models (simple properties _are_ supported, though)
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlJavaTypeAdapter.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlJavaTypeAdapter.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlJavaTypeAdapter.adoc
index 2d5da7a..5fb817d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlJavaTypeAdapter.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlJavaTypeAdapter.adoc
@@ -8,7 +8,7 @@
The JAXB `@XmlJavaTypeAdapter` annotation (`1.11.0-SNAPSHOT`) is used with the framework-provided
`PersistentEntityAdapter` to instruct JAXB to serialize references to persistent entities using the canonical
`OidDto` complex type: the object's type and its identifier. This is the formal XML equivalent to the `Bookmark`
-provided by the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`].
+provided by the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`].
For example:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlRootElement.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlRootElement.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlRootElement.adoc
index 3169161..0378260 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlRootElement.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant-XmlRootElement.adoc
@@ -19,7 +19,7 @@ significant advantages:
* the view model can be used as a "canonical" DTO, for example when accessing data using the
xref:ugvro.adoc#[RestfulObjects viewer] in combination with the
-xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`]. +
+xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]. +
+
This provides a stable and
versioned API to access data in XML format using whatever client-side technology may be appropriate.
@@ -39,7 +39,7 @@ the object's type and its identifier.
[TIP]
====
The memento string for view models is converted into a form compatible with use within a URL. This is performed by the
-xref:rgsvc.adoc#_rgsvc-spi_UrlEncodingService[`UrlEncodingService`], the default implementation of which
+xref:rgsvc.adoc#_rgsvc_spi_UrlEncodingService[`UrlEncodingService`], the default implementation of which
simply encodes to base 64. If the view model XML graph is too large to be serialized to a string, then an alternative
implementation (eg which maps XML strings to a GUID, say) can be configured using the technique described in
xref:rg.adoc#_ugfun_how-tos_replacing-default-service-implementations[here] in the user guide.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgant_aaa_jee.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgant_aaa_jee.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgant_aaa_jee.adoc
index 9ad9522..2b26d29 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgant_aaa_jee.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgant_aaa_jee.adoc
@@ -62,7 +62,7 @@ The table below lists the JEE annotations currently recognized. Expect to see m
|xref:rgant.adoc#_rgant-XmlJavaTypeAdapter[`javax.xml.bind` +
`.annotation` +
`XmlJavaTypeAdapter`]
-|JAXB annotation defining how to serialize an entity. Used in conjunction with the (framework provided) `PersistentEntityAdapter` class to serialize persistent entities into a canonical OID (equivalent to the `Bookmark` provided by the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]).
+|JAXB annotation defining how to serialize an entity. Used in conjunction with the (framework provided) `PersistentEntityAdapter` class to serialize persistent entities into a canonical OID (equivalent to the `Bookmark` provided by the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]).
|Domain
|
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcfg_configuring-core.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcfg_configuring-core.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcfg_configuring-core.adoc
index 0d675e4..78d7759 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcfg_configuring-core.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcfg_configuring-core.adoc
@@ -261,21 +261,21 @@ If no configuration property is available, then the defaults is determined by th
`email.tls.enabled`
|`true`,`false` +
(`true`)
-|Whether to enable TLS for the email SMTP connection (used by xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]). +
+|Whether to enable TLS for the email SMTP connection (used by xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]). +
NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
| `isis.service.` +
`email.sender.hostname` +
| host (`_smtp.gmail.com_`)
-|The hostname of the external SMTP provider (used by xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]). +
+|The hostname of the external SMTP provider (used by xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]). +
NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
| `isis.service.` +
`email.port` +
| port number (`_587_`)
-|The port number for the SMTP service on the the external SMTP host (used by xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]). +
+|The port number for the SMTP service on the the external SMTP host (used by xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]). +
NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
@@ -283,14 +283,14 @@ NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.serv
| `isis.service.` +
`email.sender.address` +
| email address
-|The email address to use for sending out email (used by xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]). *Mandatory*. +
+|The email address to use for sending out email (used by xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]). *Mandatory*. +
NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
| `isis.service.` +
`email.sender.password` +
| email password
-|The corresponding password for the email address to use for sending out email (used by xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]). *Mandatory*. +
+|The corresponding password for the email address to use for sending out email (used by xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]). *Mandatory*. +
NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
@@ -299,13 +299,13 @@ NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.serv
`eventbus.implementation` +
| `guava`, `axon`, +
FQCN (`_guava_`)
-|which implementation to use by the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] as the underlying event bus.
+|which implementation to use by the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] as the underlying event bus.
| `isis.services.` +
`eventbus.allowLateRegistration` +
|`true`,`false` +
(`false`)
-|whether a domain service can register with the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`] after any events have posted. +
+|whether a domain service can register with the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] after any events have posted. +
Since this almost certainly constitutes a bug in application code, by default this is disallowed.
@@ -408,7 +408,7 @@ By default this configuration property is enabled. To disable the visibility fi
isis.reflector.facet.filterVisibility=false
----
-Filtering is supported by the Wicket viewer, and by the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] domain service (provided the wrapper's execution mode is _not_ "skip rules"). However the Restful Objects viewer does _not_ currently support filtering.
+Filtering is supported by the Wicket viewer, and by the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] domain service (provided the wrapper's execution mode is _not_ "skip rules"). However the Restful Objects viewer does _not_ currently support filtering.
[NOTE]
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes.adoc
index 1e8649d..57cd296 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes.adoc
@@ -5,7 +5,7 @@
:_imagesdir: images/
-This chapter describes the usage of various classes and interfaces that are not otherwise associated with xref:rgsvc.adoc#_rgsvc-api[domain] xref:rgsvc.adoc#_rgsvc-spi[services], xref:ugfun.adoc#_ugfun_object-layout[object layout] or xref:rgcfg.adoc#_rgcfg[configuration].
+This chapter describes the usage of various classes and interfaces that are not otherwise associated with xref:rgsvc.adoc#_rgsvc_api[domain] xref:rgsvc.adoc#_rgsvc_spi[services], xref:ugfun.adoc#_ugfun_object-layout[object layout] or xref:rgcfg.adoc#_rgcfg[configuration].
include::_rgcms_classes_AppManifest-bootstrapping.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent.adoc
index 82f2942..6274694 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent.adoc
@@ -7,7 +7,7 @@
This section catalogues the various domain event classes defined by Apache Isis.
-These events are broadcast on the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. The domain
+These events are broadcast on the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. The domain
events are broadcast as a result of being specified in the xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`], xref:rgant.adoc#_rgant-Property_domainEvent[`@Property#domainEvent()`] or xref:rgant.adoc#_rgant-Collection_domainEvent[`@Collection#domainEvent()`] attributes.
They are listed in the table below.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent_ActionDomainEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent_ActionDomainEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent_ActionDomainEvent.adoc
index 645569b..ed61c6d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent_ActionDomainEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_domainevent_ActionDomainEvent.adoc
@@ -15,6 +15,6 @@ The class has a number of responsibilities (in addition to those it inherits):
* provide selected metadata about the action parameters from the metamodel (names, types)
-* link back to the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service's `Command` object
+* link back to the xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] service's `Command` object
The class itself is instantiated automatically by the framework whenever interacting with a rendered object's action.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent.adoc
index 2ad3836..172f15f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent.adoc
@@ -39,7 +39,7 @@ Impl'n (g: a:)
|(abstract class). +
`ObjectCreatedEvent.Default` is the concrete implementation that is used.
|Broadcast when an object is first instantiated
-using the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`DomainObjectContainer`]'s
+using the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`DomainObjectContainer`]'s
`#newTransientInstance(...)` method.
@@ -61,7 +61,7 @@ using the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`
|(abstract class). +
`ObjectPersistedEvent.Default` is the concrete implementation that is used.
|Broadcast when an object is first saved (inserted) into the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#persist(...)` method.
@@ -73,7 +73,7 @@ xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainO
|(abstract class). +
`ObjectPersistingEvent.Default` is the concrete implementation that is used.
|Broadcast when an object is about to be saved (inserted) into the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#persist(...)` method.
@@ -85,7 +85,7 @@ xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainO
|(abstract class). +
`ObjectRemovingEvent.Default` is the concrete implementation that is used.
|Broadcast when an object is about to be deleted from the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#remove(...)` method.
@@ -98,7 +98,7 @@ xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainO
`ObjectUpdatedEvent.Default` is the concrete implementation that is used.
|Broadcast when an object has just been updated in the database. This is done either explicitly when the current
transaction is flushed using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#flush(...)` method, else is done implicitly when the transaction commits at the end of the user request.
@@ -111,7 +111,7 @@ xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainO
`ObjectUpdatingEvent.Default` is the concrete implementation that is used.
|Broadcast when an object is about to be updated in the database. This is done either explicitly when the current
transaction is flushed using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#flush(...)` method, else is done implicitly when the transaction commits at the end of the user request.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectCreatedEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectCreatedEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectCreatedEvent.adoc
index 3db2610..8b667be 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectCreatedEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectCreatedEvent.adoc
@@ -8,7 +8,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object is first instantiated using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`DomainObjectContainer`]'s
`#newTransientInstance(...)` method.
`ObjectCreatedEvent.Default` is the concrete implementation that is used.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistedEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistedEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistedEvent.adoc
index 1973b28..1a9b3fb 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistedEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistedEvent.adoc
@@ -7,7 +7,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object is first saved (inserted) into the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#persist(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistingEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistingEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistingEvent.adoc
index 4828a53..7bc3c6a 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistingEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectPersistingEvent.adoc
@@ -7,7 +7,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object is about to be saved (inserted) into the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#persist(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectRemovingEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectRemovingEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectRemovingEvent.adoc
index 7335583..b683ab0 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectRemovingEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectRemovingEvent.adoc
@@ -7,7 +7,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object is about to be deleted from the database using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#remove(...)` method.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatedEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatedEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatedEvent.adoc
index 6989e72..7f5bf1e 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatedEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatedEvent.adoc
@@ -9,7 +9,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object has just been updated in the database. This is done either explicitly when the current
transaction is flushed using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#flush(...)` method, else is done implicitly when the transaction commits at the end of the user request.
`ObjectUpdatedEvent.Default` is the concrete implementation that is used.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatingEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatingEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatingEvent.adoc
index 8554ff7..9f141de 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatingEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_lifecycleevent_ObjectUpdatingEvent.adoc
@@ -9,7 +9,7 @@
Subclass of xref:rgcms.adoc#_rgcms_classes_lifecycleevent_AbstractLifecycleEvent[`AbstractLifecycleEvent`], broadcast
when an object is about to be updated in the database. This is done either explicitly when the current
transaction is flushed using the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-persistence-api[`DomainObjectContainer`]'s
`#flush(...)` method, else is done implicitly when the transaction commits at the end of the user request.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Dto.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Dto.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Dto.adoc
index 15b4293..93ff771 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Dto.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Dto.adoc
@@ -58,4 +58,4 @@ referenced by the DTO).
== Related Services
The `Dto_downloadXml` and `Dto_downloadXsd` delegate to the
-xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] to actually generate the XML/XSD.
\ No newline at end of file
+xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] to actually generate the XML/XSD.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_HoldsUpdatedAt.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_HoldsUpdatedAt.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_HoldsUpdatedAt.adoc
index 0509d0f..50631ba 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_HoldsUpdatedAt.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_HoldsUpdatedAt.adoc
@@ -17,7 +17,7 @@ public interface HoldsUpdatedAt {
}
----
-The current time is obtained from the xref:rgsvc.adoc#_rgsvc-api_ClockService[`ClockService`].
+The current time is obtained from the xref:rgsvc.adoc#_rgsvc_api_ClockService[`ClockService`].
Entities that implement this interface often also implement xref:rgcms.adoc#_rgcms_classes_roles_HoldsUpdatedBy[`HoldsUpdatedBy`] role interface; as a convenience the xref:rgcms.adoc#_rgcms_classes_roles_Timestampable[`Timestampable`] interface combines the two roles.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Persistable.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Persistable.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Persistable.adoc
index eaaccc1..79be2ba 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Persistable.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_roles_Persistable.adoc
@@ -30,5 +30,5 @@ This will return the XML text wrapped up in a xref:rgcms.adoc#_rgcms_classes_val
== Related Services
-The mixin delegates to the xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`] service to obtain
+The mixin delegates to the xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`] service to obtain
a reference to the JDO `PersistenceManagerFactory`.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super.adoc
index 82be5d0..1332867 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super.adoc
@@ -82,7 +82,7 @@ Impl'n (g: a:)
|``o.a.i.core`` +
``isis-core-applib``
|(abstract class). +
-`FixtureScriptsDefault` is a default implementation that is used when the alternative xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] is provided
+`FixtureScriptsDefault` is a default implementation that is used when the alternative xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] is provided
(and no other implementation of `FixtureScripts` was found).
|depends on: +
`ClassDiscoveryService`
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractContainedObject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractContainedObject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractContainedObject.adoc
index 806ed81..da9d9d8 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractContainedObject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractContainedObject.adoc
@@ -23,10 +23,10 @@ when the transaction is flushed (typically when a query is performed).
* `getContainer()` - which returns the `DomainObjectContainer`
-Each of these methods simply delegates to an equivalent method in xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`].
+Each of these methods simply delegates to an equivalent method in xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`].
[TIP]
====
-In practice we find that there's little to gain from subclassing; it's easier/less obscure to simply inject xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`] into a simple pojo class.
+In practice we find that there's little to gain from subclassing; it's easier/less obscure to simply inject xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`] into a simple pojo class.
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractDomainObject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractDomainObject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractDomainObject.adoc
index a9dec97..8d5837b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractDomainObject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractDomainObject.adoc
@@ -9,6 +9,6 @@ This class extends xref:rgcms.adoc#_rgcms_classes_super_AbstractContainedObject[
in convenience methods for managing the persistence lifecycle of the object instance.
Each of these methods, eg `isPersistent(...)`, delegates to an equivalent method in
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`].
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`].
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractService.adoc
index d4b01a6..d928d29 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractService.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractService.adoc
@@ -7,4 +7,4 @@
This class extends xref:rgcms.adoc#_rgcms_classes_super_AbstractContainedObject[`AbstractContainedObject`], adding
in an implementation of `getId()` based upon the classes name.
-In practice there is little to gain from subclassing; simply inject xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`] for broadly equivalent functionality.
+In practice there is little to gain from subclassing; simply inject xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`] for broadly equivalent functionality.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractSubscriber.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractSubscriber.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractSubscriber.adoc
index f5aa7b7..72b7562 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractSubscriber.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_AbstractSubscriber.adoc
@@ -5,12 +5,12 @@
:_imagesdir: images/
-This is a convenience superclass for creating subscriber domain services on the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. It uses xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] and
+This is a convenience superclass for creating subscriber domain services on the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. It uses xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] and
xref:rgant.adoc#_rgant-PreDestroy[`@PreDestroy`] callbacks to automatically register/unregister itself
with the `EventBusService`.
It's important that subscribers register before any domain services that might emit events on the
-xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. For example, the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module provides a domain service that automatically
+xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. For example, the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module provides a domain service that automatically
seeds certain domain entities; these will generate xref:rgcms.adoc#_rgcms_classes_lifecycleevent[lifecycle events] and so
any subscribers must be registered before such seed services. The easiest way to do this is to use the
xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_FixtureScripts.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_FixtureScripts.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_FixtureScripts.adoc
index 2f1cb42..51e143b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_FixtureScripts.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_super_FixtureScripts.adoc
@@ -6,7 +6,7 @@
This abstract class is intended to allow a domain service that can execute xref:rgcms.adoc#_rgcms_classes_super_FixtureScript[`FixtureScript`]s to be easily written.
-However, it has now been deprecated; instead we recommend that the xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] service is
-implemented instead. The framework will then automatically use xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`FixtureScriptsDefault`] as a fallback implementation of this class.
+However, it has now been deprecated; instead we recommend that the xref:rgsvc.adoc#_rgsvc_spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] service is
+implemented instead. The framework will then automatically use xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`FixtureScriptsDefault`] as a fallback implementation of this class.
See the see the xref:ugtst.adoc#_ugtst_fixture-scripts[user guide's testing chapter] for further discussion on the use of fixture scripts, in particular xref:ugtst.adoc#_ugtst_fixture-scripts_api-and-usage[fixture scripts' API and usage].
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_uievent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_uievent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_uievent.adoc
index ddc6016..34978df 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_uievent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_uievent.adoc
@@ -7,7 +7,7 @@
This section catalogues the various UI event classes defined by Apache Isis.
-These events are broadcast on the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]. The domain
+These events are broadcast on the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]. The domain
events are broadcast as a result of being specified in the xref:rgant.adoc#_rgant-DomainObjectLayout_titleUiEvent[`@DomainObjectLayout#titleUiEvent()`], xref:rgant.adoc#_rgant-DomainObjectLayout_iconUiEvent[`@DomainObjectLayout#iconUiEvent()`] or xref:rgant.adoc#_rgant-DomainObjectLayout_cssClassUiEvent[`@DomainObjectLayout#cssClassUiEvent()`] attributes.
They are listed in the table below.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle.adoc
index 89e7a7b..c9bc5ac 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle.adoc
@@ -29,7 +29,7 @@ The lifecycle callback methods supported by Isis are:
|Description
|xref:rgcms.adoc#_rgcms_methods_lifecycle_created[`created()`]
-|called when an object has just been created using xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`newTransientInstance()`]
+|called when an object has just been created using xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`newTransientInstance()`]
|xref:rgcms.adoc#_rgcms_methods_lifecycle_loaded[`loaded()`]
|called when a (persistent) object has just been loaded from the object store.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_created.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_created.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_created.adoc
index ca9e3e4..72956d4 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_created.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_created.adoc
@@ -5,12 +5,12 @@
:_imagesdir: images/
-The `created()` lifecycle callback method is called when an object has just been created using xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`newTransientInstance()`]
+The `created()` lifecycle callback method is called when an object has just been created using xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`newTransientInstance()`]
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectCreatedEvent[`ObjectCreatedEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectCreatedEvent[`ObjectCreatedEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_jdo-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_jdo-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_jdo-api.adoc
index 407487d..61a97a1 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_jdo-api.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_jdo-api.adoc
@@ -13,7 +13,7 @@ As an alternative to relying on Apache Isis to call lifecycle callback methods,
We may decide to deprecate the Apache Isis callbacks in the future because they merely duplicate this functionality already available in JDO.
====
-You can gain access to the relevant JDO API using the xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`] domain service.
+You can gain access to the relevant JDO API using the xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`] domain service.
For example:
@@ -46,7 +46,7 @@ public class ObjectChangedListenerService
----
<1> must be `@RequestScoped` because we register on the `PersistenceManager`, which is different for each request.
<2> implement whichever callback lifecycle listeners are of interest
-<3> use the injected xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`] service to obtain the `PersistenceManager`.
+<3> use the injected xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`] service to obtain the `PersistenceManager`.
Note that it isn't possible to register on the `PersistenceManagerFactory` because listeners cannot be attached once a persistence session has been created (which it will have been when the service's `@PostConstruct` method is called).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_loaded.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_loaded.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_loaded.adoc
index 41fa351..fe48807 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_loaded.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_loaded.adoc
@@ -11,5 +11,5 @@ The `loaded()` lifecycle callback method is called when a (persistent) object ha
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectLoadedEvent[`ObjectLoadedEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectLoadedEvent[`ObjectLoadedEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisted.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisted.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisted.adoc
index 6b079af..c4e4cd9 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisted.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisted.adoc
@@ -12,5 +12,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_persisting[`persisting()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectPersistedEvent[`ObjectPersistedEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectPersistedEvent[`ObjectPersistedEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisting.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisting.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisting.adoc
index 4a22ea2..01ac178 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisting.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_persisting.adoc
@@ -12,5 +12,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_persisted[`persisted()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectPersistingEvent[`ObjectPersistingEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectPersistingEvent[`ObjectPersistingEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removed.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removed.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removed.adoc
index ef3414e..97318c8 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removed.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removed.adoc
@@ -12,5 +12,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_removing[`removing()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectRemovedEvent[`ObjectRemovedEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectRemovedEvent[`ObjectRemovedEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removing.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removing.adoc
index 6d5f880..bb0b2a6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removing.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_removing.adoc
@@ -12,5 +12,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_removed[`removed()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectRemovingEvent[`ObjectRemovingEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectRemovingEvent[`ObjectRemovingEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updated.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updated.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updated.adoc
index 6287e54..54f85c4 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updated.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updated.adoc
@@ -14,5 +14,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_updating[`updating()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectUpdatedEvent[`ObjectUpdatedEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectUpdatedEvent[`ObjectUpdatedEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updating.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updating.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updating.adoc
index 3f87a20..da822bf 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updating.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_lifecycle_updating.adoc
@@ -11,5 +11,5 @@ See also xref:rgcms.adoc#_rgcms_methods_lifecycle_updated[`updated()`].
[TIP]
====
-Alternatively, consider using a xref:rgsvc.adoc#_rgsvc-api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectUpdatingEvent[`ObjectUpdatingEvent`].
+Alternatively, consider using a xref:rgsvc.adoc#_rgsvc_api_EventBusService[event bus] xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[subscriber] on the xref:rgcms.adoc#_rgcms_classes_lifecycleevent_ObjectUpdatingEvent[`ObjectUpdatingEvent`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_prefixes_default.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_prefixes_default.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_prefixes_default.adoc
index 635cf6e..44200c0 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_prefixes_default.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_prefixes_default.adoc
@@ -8,7 +8,7 @@
The `default...()` supporting method is called for action parameters to return the initial argument value. This may be some sensible default (eg today's date, or 0 or 1), or -- for an action that is modifying the state of an object -- might default to the current value of a corresponding property.
-The method is _also_ called for properties in the case when an object is newly instantiated using xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`]. This is a much less common use case. If a default is not specified then properties are initialized to a default based on their type (eg 0 or `false`).
+The method is _also_ called for properties in the case when an object is newly instantiated using xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`]. This is a much less common use case. If a default is not specified then properties are initialized to a default based on their type (eg 0 or `false`).
The signature of the supporting method depends on whether it is for an action parameter or a property.
@@ -123,7 +123,7 @@ public class ShoppingCartItem {
There are, in fact, two other ways to set properties of a newly instantiated object to default values.
-The first is to use the xref:rgcms.adoc#_rgcms_methods_lifecycle_created[`created()`] callback, called by the framework when xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`] is called. This method is called after any dependencies have been injected into the service.
+The first is to use the xref:rgcms.adoc#_rgcms_methods_lifecycle_created[`created()`] callback, called by the framework when xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`] is called. This method is called after any dependencies have been injected into the service.
The second is more straightforward: simply initialize properties in the constructor. However, this cannot use any injected services as they will not have been initialized.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_reserved_title.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_reserved_title.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_reserved_title.adoc
index 4a97ea5..851c9b9 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_reserved_title.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_methods_reserved_title.adoc
@@ -42,7 +42,7 @@ public String title() {
----
<1> simple xref:rgcms.adoc#_rgcms_classes_utility_TitleBuffer[tility class] to help construct the title string
<2> imperative conditional logic
-<3> using the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] to determine if the `dueBy` field is visible for this user ...
+<3> using the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] to determine if the `dueBy` field is visible for this user ...
<4> ... but ignore if not
As the example above shows, the implementation can be as complex as you like.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-aim.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-aim.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-aim.adoc
index 4434846..37fdfb6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-aim.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-aim.adoc
@@ -8,7 +8,7 @@
The "aim" schema defines the serialized form (or memento) of an action invocation.
Action invocations are captured (in memory rather than in serialized form) when the end-user invokes the action
-"through" the UI, by way of the xref:rgsvc.adoc#_rgsvc-api_CommandContext[CommandContext] service. Using the
+"through" the UI, by way of the xref:rgsvc.adoc#_rgsvc_api_CommandContext[CommandContext] service. Using the
`ActionInvocationMementoDtoUtils` utility class, a service can instantiate `ActionInvocationMementoDto` which can then
be serialized to/from using the same `ActionInvocationMementoDtoUtils` class.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-common.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-common.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-common.adoc
index def83e7..fca3f1b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-common.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_schema-common.adoc
@@ -8,7 +8,7 @@
The main purpose of the common schema is to define the `oidDto` complex type: the object's type and its identifier.
This is basically a formal XML equivalent to the `Bookmark` object obtained from the
-xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`].
+xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`].
Although simple, this is an enormously powerful concept, in that it represents a URI to any domain object managed by
a given Apache Isis application. With it, we have the ability to lookup any arbitrary object. Further discussion and
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api.adoc
deleted file mode 100644
index 6bc0db1..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api.adoc
+++ /dev/null
@@ -1,317 +0,0 @@
-[[_rgsvc-api]]
-= Domain Services API
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-Apache Isis includes an extensive number of domain services for your domain objects to use; simply define the service as an annotated field and Apache Isis will inject the service into your object. These services' API are all defined in Apache Isis' applib (`o.a.i.core:isis-core-applib` module); this minimizes the coupling between your code and Apache Isis. It also allows you to easily mock out these services in your unit tests.
-
-[NOTE]
-====
-In addition there are a number of domain services that constitute an SPI; if present they are used by Apache Isis itself rather than by your domain objects. A good example of this is the xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService3`] service. The SPI services are covered in the xref:rgsvc.adoc#_rgsvc-spi[Domain Services (SPI) chapter].
-====
-
-
-
-The table below summarizes all the APIs defined by Apache Isis. It also lists their corresponding implementation, either a default implementation provided by Apache Isis itself, or provided by one of the in (non-ASF) link:http://www.isisaddons.org[Isis Addons] modules.
-
-.Domain Services
-[cols="3,3a,3a,3a", options="header"]
-|===
-
-|API
-|Description
-|Implementation
-|Notes
-
-
-|xref:rgsvc.adoc#_rgsvc-api_ActionInvocationContext[`o.a.i.applib.` +
-`services.actinv` +
-`ActionInvocation-` +
-`Context`]
-|Request-scoped access to whether action is invoked on object and/or on collection of objects
-|`ActionInvocationContext` +
-``o.a.i.core`` +
-``isis-core-applib``
-|API is also concrete class
-
-
-|xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`o.a.i.applib.` +
-`services.background` +
-`BackgroundService`]
-|Programmatic persistence of commands to be persisted (so can be executed by a background mechanism, eg scheduler)
-|`BackgroundServiceDefault` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|depends on: +
-xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommand-Service`]
-
-
-|xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`o.a.i.applib.` +
-`services.bookmark` +
-`BookmarkService`]
-|Convert object reference to a serializable "bookmark", and vice versa
-|`BookmarkServiceDefault` +
-``o.a.i.core`` +
-``isis-core-metamodel``
-|related services:
-`BookmarkHolder-` +
-`ActionContributions`,
-`BookmarkHolder-` +
-`Association-` +
-`Contributions`
-
-
-|xref:rgsvc.adoc#_rgsvc-api_ClockService[`o.a.i.applib.` +
-`services.clock` +
-`ClockService`]
-|Access the current time (and for testing, allow the time to be changed)
-|`ClockService` +
-``o.a.i.core`` +
-``isis-core-applib``
-|API is also a concrete class.
-
-
-|xref:rgsvc.adoc#_rgsvc-api_CommandContext[`o.a.i.applib.` +
-`services.command` +
-`CommandContext`]
-|Request-scoped access the current action that is being invoked, represented as a command object
-|`CommandContext` +
-``o.a.i.core`` +
-``isis-core-applib``
-|API is also a concrete class. +
-depends on: +
-xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] for persistent `Command`, else in-memory impl. used
-
-|xref:rgsvc.adoc#_rgsvc-api_DeepLinkService[`o.a.i.applib` +
-`services.deeplink` +
-`DeepLinkService`]
-|Obtain a URL to a domain object (eg for use within an email or report)
-|`DeepLinkServiceWicket` +
-``o.a.i.viewer`` +
-``isis-viewer-wicket-impl``
-|Implementation only usable within Wicket viewer
-
-
-|xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`o.a.i.applib` +
-`DomainObjectContainer`]
-|Generic repository to search, create and delete objects. Also miscellaneous other functions, eg obtain title of object.
-|`DomainObjectContainer-` +
-`Default` +
-``o.a.i.core`` +
-``isis-core-metamodel``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_EmailService[`o.a.i.applib.` +
-`services.email` +
-`EmailService`]
-|Send a HTML email, optionally with attachments.
-|`EmailServiceDefault` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_EventBusService[`o.a.i.applib.` +
-`services.eventbus` +
-`EventBusService`]
-|Programmatically post events to the internal event bus. Also used by Apache Isis itself to broadcast domain events:
-
-* xref:rgant.adoc#_rgant-Action_domainEvent[`Action#domainEvent()`]
-* xref:rgant.adoc#_rgant-Property_domainEvent[`Property#domainEvent()`]
-* xref:rgant.adoc#_rgant-Collection_domainEvent[`Collection#domainEvent()`]
-|`EventBusServiceJdo` +
-``o.a.i.core`` +
-``isis-core-objectstore-jdo-datanucleus``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_FixtureScriptsDefault[`o.a.i.applib.` +
-`services.` +
-`fixturespec` +
-`FixtureScriptsDefault`]
-|Fallback implementation of xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`], providing the ability to execute fixture scripts.
-|`FixtureScriptsDefault` +
-``o.a.i.core`` +
-``isis-core-applib``
-|Interacts with xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScripts-
-SpecificationProvider`].
-
-
-|xref:rgsvc.adoc#_rgsvc-api_GuiceBeanProvider[`o.a.i.applib.` +
-`services.guice` +
-`GuiceBeanProvider`]
-|Access to internal framework services initialized using Guice DI.
-|`GuiceBeanProviderWicket` +
-``o.a.i.core`` +
-``isis-viewer-wicket-impl``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`o.a.i.applib.` +
-`services.jdosupport` +
-`IsisJdoSupport`]
-|Lower level access to the JDO Persistence API.
-|`IsisJdoSupportImpl` +
-``o.a.i.core`` +
-``isis-core-objectstore-jdo-datanucleus``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_JaxbService[`o.a.i.applib.` +
-`services.jaxb` +
-`JaxbService`]
-|Marshal and unmarshal JAXB-annotated view models to/from XML.
-|`JaxbServiceDefault` +
-``o.a.i.core`` +
-``isis-core-schema``
-|`1.11.0-SNAPSHOT`.
-
-
-|xref:rgsvc.adoc#_rgsvc-api_MementoService[`o.a.i.applib.` +
-`services.memento` +
-`MementoService`]
-|Capture a serializable memento of a set of primitives or xref:rgsvc.adoc#_rgsvc-api_BookmarkService[bookmarks]. Primarily used internally, eg in support of commands/auditing.
-|`MementoServiceDefault` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_MetaModelService[`o.a.i.applib.` +
-`services.metamodel` +
-`MetaModelService`]
-|Access to certain information from the Apache Isis metamodel.
-|`MetaModelServiceDefault` +
-``o.a.i.core`` +
-``isis-core-metamodel``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`o.a.i.applib.` +
-`services.` +
-`queryresultscache` +
-`QueryResultsCache`]
-|Request-scoped caching of the results of queries (or any data set generated by a given set of input arguments).
-|`QueryResultsCache` +
-``o.a.i.core`` +
-``isis-core-applib``
-|API is also a concrete class
-
-
-|xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`o.a.i.applib.` +
-`services.scratchpad` +
-`Scratchpad`]
-|Request-scoped service for interchanging information between and aggregating over multiple method calls; in particular for use by "bulk" actions (invoking of an action for all elements of a collection)
-|`Scratchpad` +
-``o.a.i.core`` +
-``isis-core-applib``
-|API is also a concrete class
-
-
-|xref:rgsvc.adoc#_rgsvc-api_SudoService[`o.a.i.applib.` +
-`services.sudo` +
-`SudoService`]
-|For use in testing while running xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[fixture scripts], allows a block of code to run as a specified user account.
-|`SudoServiceDefault` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|API is also a concrete class
-
-
-|xref:rgsvc.adoc#_rgsvc-api_SwaggerService[`o.a.i.applib.` +
-`services.sudo` +
-`SwaggerService`]
-|(`1.11.0-SNAPSHOT`) Generates link:http://swagger.io/[Swagger] spec files to describe the public and/or private RESTful APIs exposed by the xref:ugvro.adoc#[RestfulObjects viewer]. These can then be used with the link:http://swagger.io/swagger-ui/[Swagger UI] page to explore the REST API, or used to generate client-side stubs using the link:http://swagger.io/swagger-codegen/[Swagger codegen] tool, eg for use in a custom REST client app.
-|`SwaggerServiceDefault` +
-``o.a.i.core`` +
-``isis-core-metamodel``
-|A `SwaggerServiceMenu` domain service is also provided which enables the swagger spec to be downloaded. Apache Isis' xref:cg.adoc#_cg_isis-maven-plugin[Maven plugin] also provides a xref:cg.adoc#_cg_isis-maven-plugin_swagger[swagger goal] which allows the spec file(s) to be generated at build time (eg so that client-side stubs can then be generated in turn).
-
-
-|xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`o.a.i.applib.` +
-`services.wrapper` +
-`WrapperFactory`]
-|Interact with another domain object "as if" through the UI (enforcing business rules, firing domain events)
-|`WrapperFactoryDefault` +
-``o.a.i.core`` +
-``isis-core-wrapper``
-|
-
-
-|xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`o.a.i.applib.` +
-`services.xmlsnapshot` +
-`XmlSnapshotService`]
-|Generate an XML representation of an object and optionally a graph of related objects.
-|`XmlSnapshotServiceDefault` +
-``o.a.i.core`` +
-``isis-core-runtime``
-|
-
-|===
-
-Key:
-
-* `o.a.i` is an abbreviation for `org.apache.isis`
-* `o.ia.m` is an abbreviation for `org.isisaddons.module`
-
-
-
-
-
-There is also a number of deprecated domain services.
-
-.Deprecated Domain Services
-[cols="3,3a,3a,3a", options="header"]
-|===
-
-|API
-|Description
-|Implementation
-|Notes
-
-|`o.a.i.applib.` +
-`annotation`
-`Bulk.InteractionContext`
-|Request-scoped access to whether action is invoked on object and/or on collection of objects
-|`Bulk.InteractionContext` +
-``o.a.i.core`` +
-``isis-core-applib``
-|Replaced by xref:rgsvc.adoc#_rgsvc-api_ActionInvocationContext[`ActionInvocationContext`]
-
-
-
-|===
-
-Key:
-
-* `o.a.i` is an abbreviation for `org.apache.isis`
-* `o.ia.m` is an abbreviation for `org.isisaddons.module`
-
-
-
-include::_rgsvc-api_ActionInvocationContext.adoc[leveloffset=+1]
-include::_rgsvc-api_BackgroundService.adoc[leveloffset=+1]
-include::_rgsvc-api_BookmarkService.adoc[leveloffset=+1]
-include::_rgsvc-api_ClockService.adoc[leveloffset=+1]
-include::_rgsvc-api_CommandContext.adoc[leveloffset=+1]
-include::_rgsvc-api_DeepLinkService.adoc[leveloffset=+1]
-include::_rgsvc-api_DomainObjectContainer.adoc[leveloffset=+1]
-include::_rgsvc-api_EmailService.adoc[leveloffset=+1]
-include::_rgsvc-api_EventBusService.adoc[leveloffset=+1]
-include::_rgsvc-api_FixtureScriptsDefault.adoc[leveloffset=+1]
-include::_rgsvc-api_GuiceBeanProvider.adoc[leveloffset=+1]
-include::_rgsvc-api_IsisJdoSupport.adoc[leveloffset=+1]
-include::_rgsvc-api_JaxbService.adoc[leveloffset=+1]
-include::_rgsvc-api_MementoService.adoc[leveloffset=+1]
-include::_rgsvc-api_MetamodelService.adoc[leveloffset=+1]
-include::_rgsvc-api_QueryResultsCache.adoc[leveloffset=+1]
-include::_rgsvc-api_Scratchpad.adoc[leveloffset=+1]
-include::_rgsvc-api_SudoService.adoc[leveloffset=+1]
-include::_rgsvc-api_SwaggerService.adoc[leveloffset=+1]
-include::_rgsvc-api_WrapperFactory.adoc[leveloffset=+1]
-include::_rgsvc-api_XmlSnapshotService.adoc[leveloffset=+1]
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ActionInvocationContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ActionInvocationContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ActionInvocationContext.adoc
deleted file mode 100644
index 6b501a1..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_ActionInvocationContext.adoc
+++ /dev/null
@@ -1,98 +0,0 @@
-[[_rgsvc-api_ActionInvocationContext]]
-= `ActionInvocationContext`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `ActionInvocationContext` domain service is a xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] service intended to support the implementation of "bulk" actions annotated with xref:rgant.adoc#_rgant-Action_invokeOn[`@Action#invokeOn()`]. This allows the user to select multiple objects in a table and then invoke the same action against all of them.
-
-When an action is invoked in this way, this service allows each object instance to "know where it is" in the collection; it acts a little like an iterator. In particular, an object can determine if it is the last object to be called, and so can perform special processing, eg to return a summary calculated result.
-
-== API
-
-The API defined by the service is:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-@RequestScoped // <1>
-public static class ActionInvocationContext {
- public InvokedOn getInvokedOn() { ... } // <2>
- public List<Object> getDomainObjects() { ... } // <3>
- public int getSize() { ... }
- public int getIndex() { ... } // <4>
- public boolean isFirst() { ... }
- public boolean isLast() { ... }
-}
-----
-<1> is xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`], so this domain service instance is scoped to a particular request and is then destroyed
-<2> an enum set to either `OBJECT` (if action has been invoked on a single object) or `COLLECTION` (if has been invoked on a collection).
-<3> returns the list of domain objects which are being acted upon
-<4> is the 0-based index to the object being acted upon.
-
-
-
-== Usage
-
-For actions that are void or that return null, Apache Isis will return to the list once executed. But for bulk actions that are non-void, Apache Isis will render the returned object/value from the last object invoked (and simply discards the object/value of all actions except the last).
-
-One idiom is for the domain objects to also use the xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`] service to share information, for example to aggregate values. The `ActionInvocationContext#isLast()` method can then be used to determine if all the information has been gathered, and then do something with it (eg derive variance across a range of values, render a graph etc).
-
-More prosaically, the `ActoinInvocationContext` can be used to ensure that the action behaves appropriately depending on how it has been invoked (on a single object and/or a collection) whether it is called in bulk mode or regular mode. Here's a snippet of code from the bulk action in the Isis addon example https://github.com/isisaddons/isis-app-todoapp/[todoapp] (not ASF):
-
-[source,java]
-----
-public class ToDoItem ... {
- @Action(invokeOn=InvokeOn.OBJECTS_AND_COLLECTIONS)
- public ToDoItem completed() {
- setComplete(true);
- ...
- return actionInteractionContext.getInvokedOn() == InvokedOn.OBJECT
- ? this // <1>
- : null; // <2>
- }
- @Inject
- ActionInteractionContext actionInteractionContext;
-}
-----
-<1> if invoked as a regular action, return this object;
-<2> otherwise (if invoked on collection of objects), return null, so that the xref:ugvw.adoc#[Wicket viewer] will re-render the list of objects
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default
-implementation of `ActionInvocationContext` class is automatically registered (it is annotated with `@DomainService`)
-so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-== Unit testing support
-
-The `ActionInvocationContext` class also has a couple of static factory methods intended to support unit testing:
-
-[source,java]
-----
-@DomainService(nature = NatureOfService.DOMAIN)
-@RequestScoped
-public class ActionInvocationContext {
- public static ActionInvocationContext onObject(final Object domainObject) {
- return new ActionInvocationContext(InvokedOn.OBJECT, Collections.singletonList(domainObject));
- }
- public static ActionInvocationContext onCollection(final Object... domainObjects) {
- return onCollection(Arrays.asList(domainObjects));
- }
- public static ActionInvocationContext onCollection(final List<Object> domainObjects) {
- return new ActionInvocationContext(InvokedOn.COLLECTION, domainObjects);
- }
- ...
-}
-----
\ No newline at end of file
[08/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EmailService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EmailService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EmailService.adoc
deleted file mode 100644
index ea86c0c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EmailService.adoc
+++ /dev/null
@@ -1,95 +0,0 @@
-[[_rgsvc-api_EmailService]]
-= `EmailService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `EmailService` provides the ability to send HTML emails, with attachments, to one or more recipients.
-
-Apache Isis provides a default implementation to send emails using an external SMTP provider. Note that this must be configured (using a number of configuration properties) before it can be used. The that sends email as an HTML message, using an external SMTP provider.
-
-
-
-== API & Implementation
-
-The API for the service is:
-
-[source,java]
-----
-public interface EmailService {
- @Programmatic
- boolean send( // <1>
- List<String> to, List<String> cc, List<String> bcc, // <2>
- String subject,
- String body, // <3>
- DataSource... attachments);
- @Programmatic
- boolean isConfigured(); // <4>
- }
-----
-<1> is the main API to send the email (and optional attachments). Will return `false` if failed to send
-<2> pass either `null` or `Collections.emptyList()` if not required
-<3> should be HTML text
-<4> indicates whether the implementation was configured and initialized correctly. If this returns `false` then any attempt to call `send(...)` will fail.
-
-As noted in the introduction, the core framework provides a default implementation (`EmailServiceDefault`) that sends email as an HTML message, using an external SMTP provider.
-
-
-
-== Configuration
-
-To use this service the following properties must be configured:
-
-* `isis.service.email.sender.address`
-* `isis.service.email.sender.password`
-
-and these properties may optionally be configured (each has a default to use gmail, documented xref:rgcfg.adoc#_rgcfg_configuring-core[here]):
-
-* `isis.service.email.sender.hostname`
-* `isis.service.email.port`
-* `isis.service.email.tls.enabled`
-
-These configuration properties can be specified either in `isis.properties` or in an xref:ugbtb.adoc#_ugbtb_deployment_externalized-configuration[external configuration file].
-
-If prototyping (that is, running the app using `org.apache.isis.WebServer`), the configuration properties can also be specified as system properties. For example, if you create a test email account on gmail, you can configure the service using:
-
-[source,ini]
-----
--Disis.service.email.sender.address=xxx@gmail.com -Disis.service.email.sender.password=yyy
-----
-
-where "xxx" is the gmail user account and "yyy" is its password
-
-
-
-
-== Alternative Implementations
-
-If you wish to write an alternative implementation, be aware that it should process the message body as HTML (as opposed to plain text or any other format).
-
-Also, note that (unlike most Apache Isis domain services) the implementation is also instantiated and injected by Google Guice. This is because `EmailService` is used as part of the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality and is used by Wicket pages that are accessed outside of the usual Apache Isis runtime. This implies a couple of additional constraints:
-
-* first, implementation class should also be annotated with `@com.google.inject.Singleton`
-* second, there may not be any Apache Isis session running. (If necessary, one can be created on the fly using `IsisContext.doInSession(...)`)
-
-To ensure that your alternative implementation takes the place of the default implementation, register it explicitly in `isis.properties`.
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `EmailService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-== Related Services
-
-The email service is used by the xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`EmailNotificationService`] which is, in turn, used by xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`UserRegistrationService`].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EventBusService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EventBusService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EventBusService.adoc
deleted file mode 100644
index 940ed87..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_EventBusService.adoc
+++ /dev/null
@@ -1,405 +0,0 @@
-[[_rgsvc-api_EventBusService]]
-= `EventBusService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `EventBusService` allows domain objects to emit events to subscribing domain services using an in-memory event bus.
-
-The primary user of the service is the framework itself, which automatically emit events for xref:rgant.adoc#_rgant-Action_domainEvent[actions], xref:rgant.adoc#_rgant-Property_domainEvent[properties] and xref:rgant.adoc#_rgant-Collection_domainEvent[collections]. Multiple events are generated:
-
-* when an object member is to be viewed, an event is fired; subscribers can veto (meaning that the member is hidden)
-* when an object member is to be enabled, the same event instance is fired; subscribers can veto (meaning that the member is disabled, ie cannot be edited/invoked)
-* when an object member is being validated, then a new event instance is fired; subscribers can veto (meaning that the candidate values/action arguments are rejected)
-* when an object member is about to be changed, then the same event instance is fired; subscribers can perform pre-execution operations
-* when an object member has been changed, then the same event instance is fired; subscribers can perform post-execution operations
-
-If a subscriber throws an exception in the first three steps, then the interaction is vetoed. If a subscriber throws an exception in the last two steps, then the transaction is aborted. For more on this topic, see xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`], xref:rgant.adoc#_rgant-Property_domainEvent[`@Property#domainEvent()`] and xref:rgant.adoc#_rgant-Collection_domainEvent[`@Collection#domainEvent()`].
-
-It is also possible for domain objects to programmatically generate domain events. However the events are published, the primary use case is to decoupling interactions from one module/package/namespace and another.
-
-Two implementations are available, using either link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`], or alternatively using the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus]. It is also possible to plug in a custom implementation.
-
-
-
-[[_rgsvc-api_EventBusService_api-and-implementation]]
-== API & Implementation
-
-The API defined by `EventBusService` is:
-
-[source,java]
-----
-public abstract class EventBusService {
- @Programmatic
- public void post(Object event) { ... } // <1>
- @Programmatic
- public void register(final Object domainService) { ... } // <2>
- @Programmatic
- public void unregister(final Object domainService) { ... } // <3>
-}
-----
-<1> posts the event onto event bus
-<2> allows domain services to register themselves. This should be done in their xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] initialization method (for both singleton and xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] domain services.
-<3> exists for symmetry, but need never be called (it is in fact deliberately a no-op).
-
-Isis provides a default implementation of the service, `o.a.i.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo`.
-
-
-
-
-
-== Registering Subscribers
-
-The `register()` method should be called in the xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] lifecycle method. It is valid and probably the least confusing to readers to also "unregister" in the xref:rgant.adoc#_rgant-PreDestroy[`@PreDestroy`] lifecycle method (though as noted xref:rgsvc.adoc#_rgsvc-api_EventBusService_api-and-implementation[above], unregistering is actually a no-op).
-
-For example:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN) // <1>
-@DomainServiceLayout( menuOrder="1") // <2>
-public class MySubscribingDomainService {
- @PostConstruct
- public void postConstruct() {
- eventBusService.register(this); // <3>
- }
- @PreDestroy
- public void preDestroy() {
- eventBusService.unregister(this); // <4>
- }
- ...
- @javax.inject.Inject
- EventBusService eventBusService;
-}
-----
-<1> subscribers are typically not visible in the UI, so specify a `DOMAIN` nature
-<2> It's important that subscribers register before any domain services that might emit events on the event bus service.
-For example, the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module provides a
-domain service that automatically seeds certain domain entities; these will generate
-xref:rgcms.adoc#_rgcms_classes_lifecycleevent[lifecycle events] and so any subscribers must be registered before such seed
-services. The easiest way to do this is to use the xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute.
-<3> register with the event bus service during xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`]
- initialization
-<4> corresponding deregister when shutting down
-
-This works for both singleton (application-scoped) and also xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`] domain services.
-
-
-[TIP]
-====
-The xref:rgcms.adoc#_rgcms_classes_super_AbstractSubscriber[`AbstractSubscriber`] class automatically performs this
-registration. As a convenience, (as of `1.11.0-SNAPSHOT`) it is also annotated with the
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute.
-====
-
-
-
-== Annotating Members
-
-As discussed in the introduction, the framework will automatically emit domain events for all of the object members (actions, properties or collections) of an object whenever that object is rendered or (more generally) interacted with.
-
-For example:
-
-[source,java]
-----
-public class Customer {
- @Action
- public Customer placeOrder(Product product, @ParameterLayout(named="Quantity") int qty) { ... }
- ...
-}
-----
-
-will propagate an instance of the default `o.a.i.applib.services.eventbus.ActionDomainEvent.Default` class. If using the Guava event bus this can be subscribed to using:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class MySubscribingDomainService
- @Programmatic
- @com.google.common.eventbus.Subscribe
- public void on(ActionDomainEvent ev) { ... }
- ...
-}
-----
-
-or if using Axonframework, the subscriber uses a different annotation:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class MySubscribingDomainService
- @Programmatic
- @org.axonframework.eventhandling.annotation.EventHandle
- public void on(ActionDomainEvent ev) { ... }
- ...
-}
-----
-
-More commonly though you will probably want to emit domain events of a specific subtype. As a slightly more interesting example, suppose in a library domain that a `LibraryMember` wants to leave the library. A letter should be sent out detailing any books that they still have out on loan:
-
-In the `LibraryMember` class, we publish the event by way of an annotation:
-
-[source,java]
-----
-public class LibraryMember {
- @Action(domainEvent=LibraryMemberLeaveEvent.class) // <1>
- public void leave() { ... }
- ...
-}
-----
-<1> `LibraryMemberLeaveEvent` is a subclass of `o.a.i.applib.eventbus.ActionDomainEvent`. The topic of subclassing is discussed in more detail xref:rgsvc.adoc#_rgsvc-api_EventBusService_event-hierarchy[below].
-
-Meanwhile, in the `BookRepository` domain service, we subscribe to the event and act upon it. For example:
-
-[source,java]
-----
-public class BookRepository {
- @Programmatic
- @com.google.common.eventbus.Subscribe
- public void onLibraryMemberLeaving(LibraryMemberLeaveEvent e) {
- LibraryMember lm = e.getLibraryMember();
- List<Book> lentBooks = findBooksOnLoanFor(lm);
- if(!lentBooks.isEmpty()) {
- sendLetter(lm, lentBooks);
- }
- }
- ...
-}
-----
-
-This design allows the `libraryMember` module to be decoupled from the `book` module.
-
-
-
-[[_rgsvc-api_EventBusService_event-hierarchy]]
-== Event hierarchy
-
-By creating domain event subtypes we can be more semantically precise and in turn providesmore flexibility for subscribers: they can choose whether to be broadly applicable (by subscribing to a superclass) or to be tightly focussed (by subscribing to a subclass).
-
-We recommend that you define event classes at (up to) four scopes:
-
-* at the top "global" scope is the Apache Isis-defined `o.a.i.applib.event.ActionDomainEvent`
-* for the "module" scope, create a static class to represent the module itself, and creating nested classes within
-* for each "class" scope, create a nested static event class in the domain object's class for all of the domain object's actions
-* for each "action" scope, create a nested static event class for that action, inheriting from the "domain object" class.
-
-To put all that into code; at the module level we can define:
-
-[source,java]
-----
-package com.mycompany.modules.libmem;
-...
-public static class LibMemModule {
- private LibMemModule() {}
- public abstract static class ActionDomainEvent<S>
- extends org.apache.isis.applib.event.ActionDomainEvent<S> {}
- ... // <1>
- public abstract static class PropertyDomainEvent<S,T>
- extends org.apache.isis.applib.event.PropertyDomainEvent<S,T> {}
- public abstract static class CollectionDomainEvent<S,E>
- extends org.apache.isis.applib.event.CollectionDomainEvent<S,E> {}
-}
-----
-<1> similar events for properties and collections should also be defined
-
-For the class-level we can define:
-
-[source,java]
-----
-public static class LibraryMember {
- public abstract static class ActionDomainEvent
- extends LibMemModule.ActionDomainEvent<LibraryMember> { }
- ... // <1>
-}
-----
-<1> similar events for properties and collections should also be defined
-
-and finally at the action level we can define:
-
-[source,java]
-----
-public class LibraryMember {
- public static class LeaveEvent extends LibraryMember.ActionDomainEvent { }
- @Action(domainEvent=LeaveEvent.class)
- public void leave() { ... }
- ...
-}
-----
-
-The subscriber can subscribe either to the general superclass (as before), or to any of the classes in the hierarchy.
-
-
-=== Variation (for contributing services)
-
-A slight variation on this is to not fix the generic parameter at the class level, ie:
-
-[source,java]
-----
-public static class LibraryMember {
- public abstract static class ActionDomainEvent<S>
- extends LibMemModule.ActionDomainEvent<S> { }
- ...
-}
-----
-
-and instead parameterize down at the action level:
-
-[source,java]
-----
-public class LibraryMember {
- public static class LeaveEvent
- extends LibraryMember.ActionDomainEvent<LibraryMember> { } // <1>
- }
- @Action(domainEvent=LeaveEvent.class)
- public void leave() { ... }
- ...
-}
-----
-
-This then allows for other classes - in particular domain services contributing members - to also inherit from the class-level domain events.
-
-
-
-
-== Programmatic posting
-
-To programmatically post an event, simply call `#post()`.
-
-The `LibraryMember` example described above could for example be rewritten into:
-
-[source,java]
-----
-public class LibraryMember {
- ...
- public void leave() {
- ...
- eventBusService.post(new LibraryMember.LeaveEvent(...)); // <1>
- }
- ...
-}
-----
-<1> `LibraryMember.LeaveEvent` could be _any_ class, not just a subclass of `o.a.i.applib.event.ActionDomainEvent`.
-
-In practice we suspect there will be few cases where the programmatic approach is required rather than the declarative approach afforded by xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`] et al.
-
-
-
-== Using `WrapperFactory`
-
-An alternative way to cause events to be posted is through the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`]. This is useful when you wish to enforce a (lack-of-) trust boundary between the caller and the callee.
-
-For example, suppose that `Customer#placeOrder(...)` emits a `PlaceOrderEvent`, which is subscribed to by a `ReserveStockSubscriber`. This subscriber in turn calls `StockManagementService#reserveStock(...)`. Any business rules on `#reserveStock(...)` should be enforced.
-
-In the `ReserveStockSubscriber`, we therefore use the `WrapperFactory`:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class ReserveStockSubscriber {
- @Programmatic
- @Subscribe
- public void on(Customer.PlaceOrderEvent ev) {
- wrapperFactory.wrap(stockManagementService)
- .reserveStock(ev.getProduct(), ev.getQuantity());
- }
- ...
- @Inject
- StockManagementService stockManagementService;
- @Inject
- WrapperFactory wrapperFactory;
-}
-----
-
-
-== Implementation SPI
-
-The implementation of `EventBusService` provided by Apache Isis will by default use link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`] as the underlying in-memory event bus. Alternatively the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus] can be used. Which is used is specified through configuration property (described xref:rgsvc.adoc#_rgsvc-api_EventBusService_Configuration[below]).
-
-[NOTE]
-.Guava vs Axon, which to use?
-====
-Guava actually queues up events; they are not guaranteed to be dispatched immediately. This generally is not problem, but can be for cases where the subscriber may in turn want to post its own events (using xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`]).
-
-The Axon `SimpleEventBus`-based implementation on the other hand is fully synchronous; events are dispatched as soon as they are posted. This works well in all scenarios (that we have tested).
-====
-
-
-It is also possible to use some other implementation.
-
-[source,java]
-----
-public interface EventBusImplementation {
- void register(Object domainService);
- void unregister(Object domainService);
- void post(Object event);
-}
-----
-
-As is probably obvious, the `EventBusService` just delegates down to these method calls when its own similarly named methods are called.
-
-If you do provide your own implementation of this SPI, be aware that your subscribers will need to use whatever convention is required (eg different annotations) such that the events are correctly routed through to your subscribers.
-
-
-
-[[_rgsvc-api_EventBusService_Configuration]]
-== Configuration
-
-The implementation of `EventBusService` provided by Apache Isis will by default use link:https://code.google.com/p/guava-libraries/[Guava]'s https://code.google.com/p/guava-libraries/wiki/EventBusExplained[`EventBus`] as the underlying in-memory event bus. Alternatively the link:http://www.axonframework.org/[AxonFramework]'s link:http://www.axonframework.org/docs/2.4/single.html#d5e1489[SimpleEventBus] can be used.
-
-To specify which, add the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.eventbus.implementation`:
-
-[source,ini]
-----
-isis.services.eventbus.implementation=guava
-----
-
-or
-
-[source,ini]
-----
-isis.services.eventbus.implementation=axon
-----
-
-If you have written your own implementation of the `EventBusServiceImplementation` SPI, then specify instead its fully-qualified class name:
-
-[source,ini]
-----
-isis.services.eventbus.implementation=com.mycompany.isis.MyEventBusServiceImplementation
-----
-
-
-
-In addition, there is one further configuration property, whether to allow "late registration":
-
-[source,ini]
-----
-isis.services.eventbus.allowLateRegistration=false
-----
-
-Late registration refers to the idea that a domain service can register itself with the `EventBusService` after events have been posted. Since domain services are set up at boot time, this almost certainly constitutes a bug in the code and so by default late registration is _not_ allowed. Setting the above property to `true` disables this check.
-
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `EventBusService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-== Related Services
-
-The `EventBusService` is intended for fine-grained publish/subscribe for object-to-object interactions within an Apache Isis domain object model. The event propagation is strictly in-memory, and there are no restrictions on the object acting as the event (it need not be serializable, for example).
-
-The xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`] meanwhile is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations (for actions annotated with xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`]) and of changed objects (for objects annotated with xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`]).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_FixtureScriptsDefault.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_FixtureScriptsDefault.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_FixtureScriptsDefault.adoc
deleted file mode 100644
index 83e2fbb..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_FixtureScriptsDefault.adoc
+++ /dev/null
@@ -1,50 +0,0 @@
-[[_rgsvc-api_FixtureScriptsDefault]]
-= `FixtureScriptsDefault`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `FixtureScriptsDefault` service provides the ability to execute xref:ugtst.adoc#_ugtst_fixture-scripts_api-and-usage[fixture scripts] .
-
-The service extends from the xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`], and is only instantiated by the framework if there no custom implementation of `FixtureScripts` has been otherwise provided; in other words it is a fallback.
-
-If this service is instantiated (as a fallback) then it uses the xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] to obtain a `FixtureScriptsSpecification`. This configures this service, telling it which package to search for `FixtureScript` classes, how to execute those classes, and hints that influence the UI.
-
-[TIP]
-====
-We recommend using xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`] rather than subclassing xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`].
-====
-
-
-
-== API & Implementation
-
-The API for the service is:
-
-[source,java]
-----
-public class FixtureScriptsDefault ... {
- @Programmatic
- public List<FixtureResult> runFixtureScript(
- FixtureScript fixtureScript,
- String parameters) { ... }
-}
-----
-
-... in other words the same as xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`] superclass that it inherits from.
-
-
-== Configuration
-
-As noted in the introduction, this service is only instantiated if there is no other implementation of `FixtureScripts` available on the classpath.
-
-If an instance of `FixtureScriptsSpecificationProvider` is available on the classpath, then the service will be visible in the UI (assuming xref:rgcfg.adoc#_rgcfg_deployment-types[prototype mode]). Otherwise the service will be available only to be injected and invoked programmatically.
-
-
-
-
-== Related Services
-
-The service interacts with xref:rgsvc.adoc#_rgsvc-spi_FixtureScriptsSpecificationProvider[`FixtureScriptsSpecificationProvider`].
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_GuiceBeanProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_GuiceBeanProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_GuiceBeanProvider.adoc
deleted file mode 100644
index 87004c1..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_GuiceBeanProvider.adoc
+++ /dev/null
@@ -1,91 +0,0 @@
-[[_rgsvc-api_GuiceBeanProvider]]
-= `GuiceBeanProvider`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `GuiceBeanProvider` domain service acts as a bridge between Apache Isis' xref:ugvw.adoc#[Wicket viewer] internal bootstrapping using link:https://github.com/google/guice[Google Guice].
-
-This service operates at a very low-level, and you are unlikely to have a need for it. It is used internally by the framework, in the default implementation of the xref:rgsvc.adoc#_rgsvc-api_DeepLinkService[`DeepLinkService`].
-
-[NOTE]
-====
-Currently Apache Isis uses a combination of Guice (within the Wicket viewer only) and a home-grown dependency injection framework. In future versions we intended to refactor the framework to use CDI throughout. At that time this service is likely to become redundant because we will allow any of the internal components of Apache Isis to be injected into your domain object code.
-====
-
-
-== API & Implementation
-
-The API defined by this service is:
-
-[source,java]
-----
-public interface GuiceBeanProvider {
- @Programmatic
- <T> T lookup(Class<T> beanType);
- @Programmatic
- <T> T lookup(Class<T> beanType, final Annotation qualifier);
-}
-----
-
-The xref:ugvw.adoc#[Wicket viewer] this provides an implementation of this service.
-
-
-
-== Usage
-
-Using the xref:ugvw.adoc#[Wicket viewer] requires subclassing of `IsisWicketApplication`. In the subclass it is commonplace to override `newIsisWicketModule()`, for example:
-
-[source,java]
-----
-@Override
-protected Module newIsisWicketModule() {
- final Module isisDefaults = super.newIsisWicketModule();
- final Module overrides = new AbstractModule() {
- @Override
- protected void configure() {
- bind(String.class).annotatedWith(Names.named("applicationName"))
- .toInstance("ToDo App");
- bind(String.class).annotatedWith(Names.named("applicationCss"))
- .toInstance("css/application.css");
- bind(String.class).annotatedWith(Names.named("applicationJs"))
- .toInstance("scripts/application.js");
- ...
- }
- };
- return Modules.override(isisDefaults).with(overrides);
-}
-----
-
-This "module" is in fact a Guice module, and so the `GuiceBeanProvider` service can be used to lookup any of the components bound into it.
-
-For example:
-
-[source,java]
-----
-public class SomeDomainObject {
- private String lookupApplicationName() {
- return guiceBeanProvider.lookup(String.class, Names.named("applicationName"));
- }
- @Inject
- GuiceBeanProvider guiceBeanProvider;
-}
-----
-
-should return "ToDo App".
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
-xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `GuiceBeanProvider` is
-automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_IsisJdoSupport.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_IsisJdoSupport.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_IsisJdoSupport.adoc
deleted file mode 100644
index e5395c9..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_IsisJdoSupport.adoc
+++ /dev/null
@@ -1,276 +0,0 @@
-[[_rgsvc-api_IsisJdoSupport]]
-= `IsisJdoSupport`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `IsisJdoSupport` service provides a number of general purpose methods for working with the JDO/DataNucleus objectstore. In general these act at a lower-level of abstraction than the APIs normally used (specifically, those of xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]), but nevertheless deal with some of the most common use cases. For service also provides access to the underlying JDO `PersistenceManager` for full control.
-
-The following sections discuss the functionality provided by the service, broken out into categories.
-
-
-
-
-[[_rgsvc-api_IsisJdoSupport_executing-sql]]
-== Executing SQL
-
-You can use the `IsisJdoSupportService` to perform arbitrary SQL SELECTs or UPDATEs:
-
-[source,java]
-----
-public interface IsisJdoSupport {
- @Programmatic
- List<Map<String, Object>> executeSql(String sql);
- @Programmatic
- Integer executeUpdate(String sql);
- ...
-}
-----
-
-
-The `executeSql(...)` method allows arbitrary SQL `SELECT` queries to be submitted:
-
-[source,java]
-----
-List<Map<String, Object>> results = isisJdoSupport.executeSql("select * from custMgmt.customers");
-----
-
-The result set is automatically converted into a list of maps, where the map key is the column name.
-
-
-In a similar manner, the `executeUpdate(...)` allows arbitrary SQL ``UPDATE``s to be performed.
-
-[source,java]
-----
-int count = isisJdoSupport.executeUpdate("select count(*) from custMgmt.customers);
-----
-
-The returned value is the number of rows updated.
-
-[TIP]
-====
-As an alternative, consider using DataNucleus' link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[type-safe JDO query API], discussed xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport_type-safe-query-api[below].
-====
-
-
-
-
-[[_rgsvc-api_IsisJdoSupport_type-safe-jdoql-queries]]
-== Type-safe JDOQL Queries
-
-DataNucleus provides an link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[extension to JDO], so that JDOQL queries can be built up and executed using a set of type-safe classes.
-
-The types in question for type safe queries are not the domain entities, but rather are companion "Q..." query classes. These classes are generated dynamically by an link:https://www.jcp.org/en/jsr/detail?id=269[annotation processor] as a side-effect of compilation, one "Q..." class for each of the xref:rgant.adoc#_rgant-PersistenceCapable[`@PersistenceCapable`] domain entity in your application. For example, a `ToDoItem` domain entity will give rise to a `QToDoItem` query class. These "Q..." classes mirror the structure of domain entity, but expose properties that allow predicates to be built up for querying instances, as well as other functions in support of order by. group by and other clauses.
-
-[NOTE]
-====
-Most IDEs (including IntelliJ and Eclipse) enable annotation processing by default, as does Maven. The DataNucleus' link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[documentation] offers some guidance on confirming that APT is enabled.
-====
-
-The `IsisJdoSupport` service offers two methods at different levels of abstraction:
-
-[source,java]
-----
-public interface IsisJdoSupport {
- @Programmatic
- <T> List<T> executeQuery(final Class<T> cls, final BooleanExpression be);
- @Programmatic
- <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls);
- ...
-}
-----
-
-
-The `executeQuery(...)` method supports the common case of obtaining a set of objects that meet some criteria, filtered using the provided `BooleanExpression`. To avoid memory leaks, the returned list is cloned and the underlying query closed.
-
-For example, in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] there is an implementation of `ToDoItemRepository` using type-safe queries. The following JDOQL:
-
-[source,sql]
-----
-SELECT
-FROM todoapp.dom.module.todoitem.ToDoItem
-WHERE atPath.indexOf(:atPath) == 0
- && complete == :complete")
-----
-
-can be expressed using type-safe queries as follows:
-
-[source,java]
-----
-public List<ToDoItem> findByAtPathAndCategory(final String atPath, final Category category) {
- final QToDoItem q = QToDoItem.candidate();
- return isisJdoSupport.executeQuery(ToDoItem.class,
- q.atPath.eq(atPath).and(
- q.category.eq(category)));
-}
-----
-
-[NOTE]
-====
-You can find the full example of the JDOQL equivalent in the xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_generic-repository-api[`DomainObjectContainer`]
-====
-
-
-The `newTypesafeQuery(...)` method is a lower-level API that allows a type safe query to be instantiated for most sophisticated querying, eg using group by or order by clauses. See the
-DataNucleus link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[documentation] for full details of using this.
-
-One thing to be aware of is that after the query has been executed, it should be closed, using `query.closeAll()`. If calling `query.executeList()` we also recommend cloning the resultant list first. The following utility method does both of these tasks:
-
-[source,java]
-----
-private static <T> List<T> executeListAndClose(final TypesafeQuery<T> query) {
- final List<T> elements = query.executeList();
- final List<T> list = Lists.newArrayList(elements);
- query.closeAll();
- return list;
-}
-----
-
-
-
-[[_rgsvc-api_IsisJdoSupport_fixture-support]]
-== Fixture support
-
-When writing xref:ugtst.adoc#_ugtst_integ-test-support[integration tests] you'll usually need to tear down some/all mutable transactional data before each test. One way to do that is to use the `executeUpdate(...)` method described xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport_executing-sql[above].
-
-Alternatively, the `deleteAll(...)` method will let your test delete all instances of a class without resorting to SQL:
-
-[source,java]
-----
-public interface IsisJdoSupport {
- @Programmatic
- void deleteAll(Class<?>... pcClasses);
- ...
-}
-----
-
-For example:
-
-[source,java]
-----
-public class TearDownAll extends FixtureScriptAbstract {
- @Override
- protected void execute(final ExecutionContext ec) {
- isisJdoSupport.deleteAll(Order.class);
- isisJdoSupport.deleteAll(CustomerAddress.class);
- isisJdoSupport.deleteAll(Customer.class);
- }
- @Inject
- IsisJdoSupport isisJdoSupport;
-}
-----
-
-[NOTE]
-====
-It can occasionally be the case that Apache Isis' internal adapter for the domain object is
-still in memory. JDO/DataNucleus seems to bump up the version of the object prior to its deletion,
-which under normal circumstances would cause Apache Isis to throw a concurrency exception. Therefore
-to prevent this from happening (ie to _force_ the deletion of all instances), concurrency checking
-is temporarily disabled while this method is performed.
-====
-
-
-
-
-[[_rgsvc-api_IsisJdoSupport_reloading-entities]]
-== Reloading entities
-
-An http://www.datanucleus.org/products/datanucleus/jdo/orm/relationships.html[(intentional) limitation] of JDO/DataNucleus is that persisting a child entity (in a 1:n bidirectional relationship) does not cause the parent's collection to be updated.
-
-[source,java]
-----
-public interface IsisJdoSupport {
- @Programmatic
- <T> T refresh(T domainObject);
- @Programmatic
- void ensureLoaded(Collection<?> collectionOfDomainObjects);
- ...
-}
-----
-
-
-
-The `refresh(T domainObject)` method can be used to reload the parent object (or indeed any object). Under the covers it uses the JDO `PersistenceManager#refresh(...)` API.
-
-
-For example:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
-public class OrderContributions {
- public Order newOrder(final Customer customer) {
- Order order = newTransientInstance(Order.class);
- order.setCustomer(customer);
- container.persist(customer);
- container.flush(); // <1>
- isisJdoSupport.refresh(customer); // <2>
- return order;
- }
- @Inject
- DomainObjectContainer container;
- @Inject
- IsisJdoSupport isisJdoSupport;
-}
-----
-<1> flush to database, ensuring that the database row corresponding to the `Order` exists in its `order` table.
-<2> reload the parent (customer) from the database, so that its collection of ``Order``s is accurate.
-
-
-[NOTE]
-====
-The particular example that led to this method being added was a 1:m bidirectional relationship,
-analogous to `Customer 1<-->* Order`. Persisting the child `Order` object did not cause
-the parent ``Customer``'s collection of orders to be updated. In fact, JDO does not make any
-such guarantee to do so. Options are therefore either to maintain the collection in code, or to
-refresh the parent.
-====
-
-
-The `ensureLoaded(...)` method allows a collection of domain objects to be loaded from the database in a single hit. This can be valuable as a performance optimization to avoid multiple roundtrips to the database. Under the covers it uses the `PersistenceManager#retrieveAll(...)` API.
-
-
-
-
-
-[[_rgsvc-api_IsisJdoSupport_jdo-persistencemanager]]
-== JDO `PersistenceManager`
-
-The functionality provided by `IsisJdoSupport` focus only on the most common use cases. If you require more flexibility than this, eg for dynamically constructed queries, then you can use the service to access the underlying JDO `PersistenceManager` API:
-
-[source,java]
-----
-public interface IsisJdoSupport {
- @Programmatic
- PersistenceManager getJdoPersistenceManager();
- ...
-}
-----
-
-For example:
-
-[source,java]
-----
-public List<Order> findOrders(...) {
- javax.jdo.PersistenceManager pm = isisJdoSupport.getPersistenceManager();
-
- // knock yourself out...
-
- return someListOfOrders;
-}
-----
-
-
-
-
-== Registering the Services
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `IsisJdoSupport` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_JaxbService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_JaxbService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_JaxbService.adoc
deleted file mode 100644
index 8405a1c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_JaxbService.adoc
+++ /dev/null
@@ -1,68 +0,0 @@
-[[_rgsvc-api_JaxbService]]
-= `JaxbService` (`1.11.0-SNAPSHOT`)
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `JaxbService` (`1.11.0-SNAPSHOT`) allows instances of JAXB-annotated classes to be marshalled to XML and
-unmarshalled from XML back into domain objects.
-
-
-
-
-
-[[_rgsvc-api_JaxbService_api-and-implementation]]
-== API & Implementation
-
-The API defined by `JaxbService` is:
-
-[source,java]
-----
-public interface JaxbService {
- @Programmatic
- <T> T fromXml(Class<T> domainClass, String xml); // <1>
- @Programmatic
- public String toXml(final Object domainObject); // <2>
- public enum IsisSchemas { // <3>
- INCLUDE, IGNORE
- }
- @Programmatic
- public Map<String, String> toXsd(final Object domainObject, final IsisSchemas isSchemas);} // <4>
-}
-----
-<1> unmarshalls the XML into an instance of the class.
-<2> marshalls the domain object into XML
-<3> whether to include or exclude the Isis schemas in the generated map of XSDs. Discussed further below.
-<4> generates a map of each of the schemas referenced; the key is the schema namespace, the value is the XML of the schema itself.
-
-With respect to the `IsisSchemas` enum: a JAXB-annotated domain object will live in its own XSD namespace and may
-reference multiple other XSD schemas. In particular, many JAXB domain objects will reference the
-xref:rgcms.adoc#_rgcms_schema[common Isis schemas] (for example the `OidDto` class that represents a reference to
-a persistent entity). The enum indicates whether these schemas should be included or excluded from the map.
-
-Isis provides a default implementation of the service, `o.a.i.schema.services.jaxb.JaxbServiceDefault`.
-
-
-
-== Usage within the framework
-
-This service is provided as a convenience for applications, but is also used internally by the framework to
-xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]-annotated
-xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view models]. The functionality to download XML and XSD schemas is also
-exposed in the UI through mixins to xref:rgcms.adoc#_rgcms_classes_roles_Dto[`Dto`] interface.
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `JaxbService` service is automatically registered and injected (it is annotated with `@DomainService`)
-so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MementoService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MementoService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MementoService.adoc
deleted file mode 100644
index 5f4ceb9..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MementoService.adoc
+++ /dev/null
@@ -1,131 +0,0 @@
-[[_rgsvc-api_MementoService]]
-= `MementoService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `MementoService` was originally introduced to simplify the implementation of xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[ViewModel]s which are required by the framework to return string representation of all of their backing state, moreover which is safe for use within a URL.
-
-However, it can also be used to create a memento of arbitrary objects. Indeed, it is used internally by the core implementation of xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`] to capture the state of action invocations so that they can be executed by a background process.
-
-
-
-
-== API & Implementation
-
-The API defined by `MementoService` is:
-
-[source,java]
-----
-public interface MementoService {
- public static interface Memento {
- @Programmatic
- public Memento set(String name, Object value);
- @Programmatic
- public <T> T get(String name, Class<T> cls);
- @Programmatic
- public String asString();
- public Set<String> keySet();
- }
- @Programmatic
- public Memento create();
- @Programmatic
- public Memento parse(final String str);
- @Programmatic
- public boolean canSet(Object input);
-}
-----
-
-The core framework provides a default implementation of this API, namely `o.a.i.core.runtime.services.memento.MementoServiceDefault`. The string returned (from `Memento#asString()`) is a base-64 URL encoded representation of the underlying format (an XML string).
-
-[NOTE]
-====
-In fact, the `MementoServiceDefault` implementation does provide a mechanism to disable the URL encoding, but this is not part of the `MementoService` public API. Note also that the encoding method is not pluggable.
-
-However, you are of course free to write some other implementation of `MementoService`, perhaps based on `MementoServiceDefault` code if you wish.
-====
-
-The types of objects that are supported by the `MementoService` are implementation-specific, but would typically include all the usual value types as well as Apache Isis' `Bookmark` class (to represent references to arbitrary entities). Nulls can also be set.
-
-In the case of the default implementation provided by the core framework, the types supported are:
-
-* `java.lang.String`
-* `java.lang.Boolean`, `boolean`
-* `java.lang.Byte`, `byte`
-* `java.lang.Short`, `short`
-* `java.lang.Integer`, `int`
-* `java.lang.Long`, `long`
-* `java.lang.Float`, `float`
-* `java.lang.Double`, `double`
-* `java.lang.Character`, `char`
-* `java.math.BigDecimal`
-* `java.math.BigInteger`
-* `org.joda.time.LocalDate`
-* `org.apache.isis.applib.services.bookmark.Bookmark`
-
-If using another implementation, the `canSet(...)` method can be used to check if the candidate object's type is supported.
-
-
-
-== Usage
-
-As noted in the introduction, a common use case for this service is in the implementation of the xref:rgcms.adoc#_rgcms_classes_super_AbstractViewModel[`ViewModel`] interface.
-
-[TIP]
-====
-Rather than implementing `ViewModel`, it's usually easier to annotate your view models with xref:rgant.adoc#_rgant-ViewModel[`@ViewModel`] (or equivalently xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=EXTERNAL_ENTITY`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=INMEMORY_ENTITY`].
-====
-
-For example, suppose you were implementing a view model that represents an external entity in a SOAP web service. To access this service the view model needs to store (say) the hostname, port number and an id to the object.
-
-Using an injected `MementoService` the view model can roundtrip to and from this string, thus implementing the `ViewModel` API:
-
-[source,java]
-----
-public class ExternalEntity implements ViewModel {
- private String hostname;
- private int port;
- private String id;
- public String viewModelMemento() { // <1>
- return mementoService.create()
- .set("hostname", hostname)
- .set("port", port)
- .set("id", id)
- .asString();
- }
- public void viewModelInit(String mementoStr) { // <2>
- Memento memento = mementoService.parse(mementoStr);
- hostname = memento.get("hostname", String.class);
- port = memento.get("port", int.class);
- id = memento.get("id", String.class);
- ...
- @Inject
- MementoService mementoService;
-}
-----
-<1> part of the `ViewModel` API
-<2> part of the `ViewModel` API
-
-
-
-
-
-== Related Services
-
-The memento service is used by the xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] service and also xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`]. These both use a memento to capture a representation of an action invocation.
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `MementoService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MetamodelService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MetamodelService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MetamodelService.adoc
deleted file mode 100644
index 7f4dd2f..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_MetamodelService.adoc
+++ /dev/null
@@ -1,42 +0,0 @@
-[[_rgsvc-api_MetamodelService]]
-= `MetamodelService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `MetaModelService` provides access (albeit currently extremely limited) to aspects of Apache Isis' internal metamodel.
-
-Currently this is limited to looking up the object type (as specified in xref:rgant.adoc#_rgant-DomainObject_objectType[`@DomainObject#objectType()`] and equivalent mechanisms, and as used in xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`Bookmark`]s and elsewhere) from an object's class, and vice versa. In the future we expect other aspects of the metamodel to also be formally surfaced through this API.
-
-
-== API & Implementation
-
-The API defined by the service is:
-
-[source,java]
-----
-public interface MetaModelService {
- @Programmatic
- Class<?> fromObjectType(final String objectType); // <1>
- @Programmatic
- String toObjectType(final Class<?> domainType); // <2>
-}
-----
-<1> reverse lookup of a domain class' object type
-<2> lookup of a domain class' object type
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `MetamodelService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_QueryResultsCache.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_QueryResultsCache.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_QueryResultsCache.adoc
deleted file mode 100644
index ba1619c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_QueryResultsCache.adoc
+++ /dev/null
@@ -1,126 +0,0 @@
-[[_rgsvc-api_QueryResultsCache]]
-= `QueryResultsCache`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The purpose of the `QueryResultsCache` is to improve response times to the user, by providing a short-term (link:../../more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html[request-scoped]) cache of the value of some (safe or idempotent) method call. This will typically be as the result of running a query, but could be any expensive operation.
-
-Caching such values is useful for code that loops "naively" through a bunch of stuff, performing an expensive operation each time. If the data is such that the same expensive operation is made many times, then the query cache is a perfect fit.
-
-
-[NOTE]
-====
-This service was inspired by similar functionality that exists in relational databases, for example Sybase's http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20023_1251/html/optimizer/X43480.htm[subquery results cache] and Oracle's http://www.dba-oracle.com/oracle11g/oracle_11g_result_cache_sql_hint.htm[result_cache] hint.
-====
-
-
-
-== API & Implementation
-
-The API defined by `QueryResultsCache` is:
-
-[source,java]
-----
-@RequestScoped
-public class QueryResultsCache {
- public static class Key {
- public Key(Class<?> callingClass, String methodName, Object... keys) {...}
- public Class<?> getCallingClass() { ... }
- public String getMethodName() { ... }
- public Object[] getKeys() { ... }
- }
- public static class Value<T> {
- public Value(T result) { ... }
- private T result;
- public T getResult() {
- return result;
- }
- }
- @Programmatic
- public <T> T execute(
- final Callable<T> callable,
- final Class<?> callingClass, final String methodName, final Object... keys) { ... }
- @Programmatic
- public <T> T execute(final Callable<T> callable, final Key cacheKey) { ... }
- @Programmatic
- public <T> Value<T> get(
- final Class<?> callingClass, final String methodName, final Object... keys) { ... }
- @Programmatic
- public <T> Value<T> get(final Key cacheKey) { ... }
- @Programmatic
- public <T> void put(final Key cacheKey, final T result) { ... }
-}
-----
-
-This class (`o.a.i.applib.services.queryresultscache.QueryResultsCache`) is also the implementation.
-
-
-
-
-== Usage
-
-Suppose that there's a `TaxService` that calculates tax on `Taxable` items, with respect to some `TaxType`, and for a given `LocalDate`. To calculate tax it must run a database query and then perform some additional calculations.
-
-Our original implementation is:
-
-[source,java]
-----
-@DomainService
-public class TaxService {
- public BigDecimal calculateTax(
- final Taxable t, final TaxType tt, final LocalDate d) {
- // query against DB using t, tt, d
- // further expensive calculations
- }
-}
-----
-
-Suppose now that this service is called in a loop, for example iterating over a bunch of orders, where several of those orders are for the same taxable products, say. In this case the result of the calculation would always be the same for any given product.
-
-We can therefore refactor the method to use the query cache as follows:
-
-[source,java]
-----
-public class TaxService {
- public BigDecimal calculateTax(
- final Taxable t, final TaxType tt, final LocalDate d) {
- return queryResultsCache.execute(
- new Callable<BigDecimal>(){ // <1>
- public BigDecimal call() throws Exception {
- // query against DB using t, tt, d
- // further expensive calculations
- }
- },
- TaxService.class, // <2>
- "calculateTax",
- t, tt, d);
- }
-}
-----
-<1> the `Callable` is the original code
-<2> the remaining parameters in essence uniquely identify the method call.
-
-This refactoring will be worthwhile provided that enough of the orders being processed reference the same taxable products. If however every order is for a different product, then no benefit will be gained from the refactoring.
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `QueryResultsCache` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-== Related Services
-
-The xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`] service is also intended for actions that are called many times, allowing arbitrary information to be shared between them. Those methods could be called from some outer loop in domain code, or by the framework itself if the action invoked has the xref:rgant.adoc#_rgant-Action_invokeOn[`@Action#invokeOn()`] annotation attribute set to `OBJECT_AND_COLLECTION` or `COLLECTION_ONLY`.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_Scratchpad.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_Scratchpad.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_Scratchpad.adoc
deleted file mode 100644
index 0b550c0..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_Scratchpad.adoc
+++ /dev/null
@@ -1,128 +0,0 @@
-[[_rgsvc-api_Scratchpad]]
-= `Scratchpad`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `Scratchpad` service is a link:../../more-advanced-topics/how-to-09-020-How-to-write-a-typical-domain-service.html[request-scoped] service to allow objects to exchange information even if they do not directly call each other.
-
-
-
-
-== API & Implementation
-
-The API of `Scratchpad` service is:
-
-[source,java]
-----
-@RequestScoped
-public class Scratchpad {
- @Programmatic
- public Object get(Object key) { ... }
- @Programmatic
- public void put(Object key, Object value) { ... }
- @Programmatic
- public void clear() { ... }
-}
-----
-
-This class (`o.a.i.applib.services.scratchpad.Scratchpad`) is also the implementation. And, as you can see, the service is just a request-scoped wrapper around a `java.util.Map`.
-
-
-
-
-
-== Usage
-
-The most common use-case is for xref:rgant.adoc#_rgant-Action_invokeOn[bulk] actions that act upon multiple objects in a list. The (same) `Scratchpad` service is injected into each of these objects, and so they can use pass information.
-
-For example, the Isis addons example https://github.com/isisaddons/isis-app-todoapp/[todoapp] (not ASF) demonstrates how the `Scratchpad` service can be used to calculate the total cost of the selected `ToDoItem`s:
-
-
-[source,java]
-----
-@Action(
- semantics=SemanticsOf.SAFE,
- invokeOn=InvokeOn.COLLECTION_ONLY
-)
-public BigDecimal totalCost() {
- BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
- if(getCost() != null) {
- total = total != null ? total.add(getCost()) : getCost();
- scratchpad.put("runningTotal", total);
- }
- return total.setScale(2);
-}
-@Inject
-Scratchpad scratchpad;
-----
-
-A more complex example could use a xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model] to enable bulk updates to a set of objects. The view model's job is to gather track of the items to be updated:
-
-[source,java]
-----
-public class ToDoItemUpdateBulkUpdate extends AbstractViewModel {
- private List<ToDoItem> _items = ...;
- public ToDoItemBulkUpdate add(ToDoItem item) {
- _items.add(item);
- return this;
- }
- ... // <1>
-}
-----
-<1> not shown - the implementation of `ViewModel` for converting the list of `_items` into a string.
-
-The bulk action in the objects simply adds the selected item to the view model:
-
-[source,java]
-----
-@Action(
- invokeOn=InvokeOn.COLLECTIONS_ONLY
- semantics=SemanticsOf.SAFE
-)
-public ToDoItemBulkUpdate bulkUpdate() {
- return lookupBulkUpdateViewModel().add(this);
-}
-private ToDoItemBulkUpdate lookupBulkUpdateViewModel() {
- ToDoItemBulkUpdate bulkUpdate =
- (ToDoItemBulkUpdate) scratchpad.get("bulkUpdateViewModel"); // <1>
- if(bulkUpdate == null) {
- bulkUpdate = container.injectServicesInto(new ToDoItemBulkUpdate());
- scratchpad.put("bulkUpdateViewModel", bulkUpdate); // <2>
- }
- return bulkUpdate;
-}
-@Inject
-Scratchpad scratchpad;
-----
-<1> look for the `ToDoItemBulkUpdate` in the scratchpad...
-<2> ... and add one if there isn't one (ie for the first object returned).
-
-If using the xref:ugvw.adoc#[Wicket viewer], the `ToDoItemBulkUpdate` view model returned from the last action invoked will be displayed. Thereafter this view model can be used to perform a bulk update of the "enlisted" items.
-
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `Scratchpad` service is automatically registered and injected (it is annotated with `@DomainService`)
-so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
-
-
-
-
-
-== Related Services
-
-The xref:rgsvc.adoc#_rgsvc-api_ActionInteractionContext[`ActionInteractionContext`] service allows xref:rgant.adoc#_rgant-Action_invokeOn[bulk actions] to co-ordinate with each other.
-
-The xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`QueryResultsCache`] is useful for caching the results of expensive method calls.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SudoService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SudoService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SudoService.adoc
deleted file mode 100644
index 8d29c42..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SudoService.adoc
+++ /dev/null
@@ -1,69 +0,0 @@
-[[_rgsvc-api_SudoService]]
-= `SudoService`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `SudoService` allows the current user reported by the `DomainObjectContainer` to be temporarily changed to some
-other user. This is useful both for xref:ugtst.adoc#_ugtst_integ-test-support[integration testing] (eg if testing a workflow system whereby objects are moved from one user to another) and while running xref:ugtst.adoc#_ugtst_fixture-scripts[fixture scripts] (eg setting up objects that would normally require several users to have acted upon the objects).
-
-
-== API & Implementation
-
-The API provided by the service is:
-
-[source,java]
-----
-public interface SudoService {
- @Programmatic
- void sudo(String username, final Runnable runnable);
- @Programmatic
- <T> T sudo(String username, final Callable<T> callable);
- @Programmatic
- void sudo(String username, List<String> roles, final Runnable runnable);
- @Programmatic
- <T> T sudo(String username, List<String> roles, final Callable<T> callable);
-}
-----
-
-which will run the provided block of code (a `Runnable` or a `Callable`) in a way such that calls to
-`DomainObjectContainer#getUser()` will return the specified user (and roles, if specified)
-
-The core framework provides a default implementation of this service (`o.a.i.core.runtime.services.sudo.SudoServiceDefault`).
-
-
-
-
-== Usage
-
-A good example can be found in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] which uses the `SudoService` in a fixture script to set up `ToDoItem` objects:
-
-[source,java]
-----
-protected void execute(final ExecutionContext ec) {
- ...
- sudoService.sudo(getUsername(),
- new Runnable() {
- @Override
- public void run() {
- wrap(toDoItem).completed();
- }
- });
- ...
-}
-----
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `SudoService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SwaggerService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SwaggerService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SwaggerService.adoc
deleted file mode 100644
index 63267b1..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_SwaggerService.adoc
+++ /dev/null
@@ -1,71 +0,0 @@
-[[_rgsvc-api_SwaggerService]]
-= `SwaggerService` (`1.11.0-SNAPSHOT`)
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-The `SwaggerService` (`1.11.0-SNAPSHOT`) generates link:http://swagger.io/[Swagger] spec files to describe the public and/or private RESTful APIs exposed by the xref:ugvro.adoc#[RestfulObjects viewer].
-
-These spec files can then be used with the link:http://swagger.io/swagger-ui/[Swagger UI] page to explore the REST API, or used to generate client-side stubs using the link:http://swagger.io/swagger-codegen/[Swagger codegen] tool, eg for use in a custom REST client app.
-
-[NOTE]
-====
-Not all of the REST API exposed by the xref:ugvro.adoc#[Restful Objects viewer] is included in the Swagger spec files; the emphasis is those REST resources that are used to develop custom apps: domain objects, domain object collections and action invocations. When combined with Apache Isis' own xref:ugvro.adoc#_ugvro_simplified-representations[simplified representations], these are pretty much all that is needed for this use case.
-====
-
-
-
-
-
-[[_rgsvc-api_SwaggerService_api-and-implementation]]
-== API & Implementation
-
-The API defined by `SwaggerService` is:
-
-[source,java]
-----
-public interface SwaggerService {
- enum Visibility {
- PUBLIC, // <1>
- PRIVATE, // <2>
- PRIVATE_WITH_PROTOTYPING; // <3>
- }
- enum Format { // <4>
- JSON,
- YAML
- }
- String generateSwaggerSpec(final Visibility visibility, final Format format);
-}
-----
-<1> Generate a Swagger spec for use by third-party clients, ie public use. This specification is restricted only to
-xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]s and to domain services with a xref:rgant.adoc#_rgant_DomainService_nature[nature] of `VIEW_REST_ONLY`.
-<2> Generate a Swagger spec for use only by internally-managed clients, ie private internal use. This specification includes domain entities and all menu domain services (as well as any view models).
-<3> Generate a Swagger spec that is the same as private case (above), but also including any xref:rgant.adoc#_rgant_Action_restrictTo[prototype] actions.
-<4> Swagger specs can be written either in JSON or YAML format.
-
-Isis provides a default implementation of the service, `o.a.i.core.metamodel.services.swagger.SwaggerServiceDefault`.
-
-
-
-== Usage within the framework
-
-This service is provided as a convenience for applications, it is not (currently) used by the framework itself.
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `SwaggerService` service is automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-
-
-== Related Services
-
-A `SwaggerServiceMenu` domain service provides a prototype action that enables the swagger spec to be downloaded from the Wicket viewer's UI.
-
-Apache Isis' xref:cg.adoc#_cg_isis-maven-plugin[Maven plugin] also provides a xref:cg.adoc#_cg_isis-maven-plugin_swagger[swagger goal] which allows the spec file(s) to be generated at build time. this then allows client-side stubs can then be generated in turn as part of a build pipeline.
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_WrapperFactory.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_WrapperFactory.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_WrapperFactory.adoc
deleted file mode 100644
index f8ebe76..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rgsvc-api_WrapperFactory.adoc
+++ /dev/null
@@ -1,162 +0,0 @@
-[[_rgsvc-api_WrapperFactory]]
-= `WrapperFactory`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-
-
-The `WrapperFactory` provides the ability to enforce business rules for programmatic interactions between domain objects. If there is a (lack-of-) trust boundary between the caller and callee -- eg if they reside in different modules -- then the wrapper factory is a useful mechanism to ensure that any business constraints defined by te callee are honoured.
-
-For example, if the calling object attempts to modify an unmodifiable property on the target object, then an exception will be thrown. Said another way: interactions are performed "as if" they are through the viewer.
-
-[NOTE]
-====
-For a discussion of the use of the `WrapperFactory` within integration tests (the primary or at least original use case for this service) can be found xref:ugtst.adoc#_ugtst_integ-test-support_wrapper-factory[here]
-====
-
-This capability goes beyond enforcing the (imperative) constraints within the `hideXxx()`, `disableXxx()` and `validateXxx()` supporting methods; it also enforces (declarative) constraints such as those represented by annotations, eg `@MaxLength` or `@Regex`.
-
-This capability is frequently used within xref:ugtst.adoc#_ugtst_integ-test-support[integration tests], but can also be used in production code. (There are analogies that can be drawn here with the way that JEE beans can interact through an EJB local interface).
-
-
-
-
-== API
-
-The API provided by the service is:
-
-[source,java]
-----
-public interface WrapperFactory {
- @Programmatic
- <T> T wrap(T domainObject); // <1>
- @Programmatic
- <T> T unwrap(T possibleWrappedDomainObject); // <2>
- @Programmatic
- <T> boolean isWrapper(T possibleWrappedDomainObject); // <3>
-
- public static enum ExecutionMode { // <4>
- EXECUTE(true,true),
- SKIP_RULES(false, true), // <5>
- NO_EXECUTE(true, false); // <6>
- }
- @Programmatic
- <T> T wrap(T domainObject, ExecutionMode mode); // <7>
- @Programmatic
- <T> T wrapNoExecute(T domainObject); // <8>
- @Programmatic
- <T> T wrapSkipRules(T domainObject); // <9>
- ...
- }
-----
-<1> wraps the underlying domain object. If it is already wrapped, returns the object back unchanged.
-<2> Obtains the underlying domain object, if wrapped. If the object is not wrapped, returns back unchanged.
-<3> whether the supplied object has been wrapped.
-<4> enumerates how the wrapper interacts with the underlying domain object.
-<5> validate all business rules and then execute.
-<6> skip all business rules and then execute (including creating xref:rgant.adoc#_rgant-Action_command[command]s and firing pre- and post-execute xref:rgant.adoc#_rgant-Action_domainEvent[domain event]s).
-<7> validate all business rules (including those from xref:rgant.adoc#_rgant-Action_domainEvent[domain event]s) but do not execute.
-<8> convenience method to invoke `wrap(...)` with `ExecuteMode#NO_EXECUTE` (make this feature more discoverable)
-<9> convenience method to invoke `wrap(...)` with `ExecuteMode#SKIP_RULES` (make this feature more discoverable)
-
-
-
-The service works by returning a "wrapper" around a supplied domain object (a link:http://www.javassist.org[javassist] proxy), and it is this wrapper that ensures that the hide/disable/validate rules implies by the Apache Isis programming model are enforced. The wrapper can be interacted with as follows:
-
-* a `get...()` method for properties or collections
-* a `set...()` method for properties
-* an `addTo...()` or `removeFrom...()` method for collections
-* any action
-
-Calling any of the above methods may result in a (subclass of) `InteractionException` if the object disallows it. For example, if a property is annotated with `@Hidden` then a `HiddenException` will be thrown. Similarly if an action has a `validateXxx()` method and the supplied arguments are invalid then an `InvalidException` will be thrown.
-
-In addition, the following methods may also be called:
-
-* the xref:rgcms.adoc#_rgcms_methods_reserved_title[`title()`] and `toString()` methods
-* any xref:rgcms.adoc#_rgcms_methods_prefixes_default[`default...()`], xref:rgcms.adoc#_rgcms_methods_prefixes_choices[`choices...()`] or xref:rgcms.adoc#_rgcms_methods_prefixes_autoComplete[`autoComplete...()`] methods
-
-An exception will be thrown if any other methods are thrown.
-
-
-
-
-
-== Usage
-
-The caller will typically obtain the target object (eg from some repository) and then use the injected `WrapperFactory` to wrap it before interacting with it.
-
-For example:
-
-[source,java]
-----
-public class CustomerAgent {
- @Action
- public void refundOrder(final Order order) {
- final Order wrappedOrder = wrapperFactory.wrap(order);
- try {
- wrappedOrder.refund();
- } catch(InteractionException ex) { // <1>
- container.raiseError(ex.getMessage()); // <2>
- return;
- }
- }
- ...
- @Inject
- WrapperFactory wrapperFactory;
- @Inject
- DomainObjectContainer container;
-}
-----
-<1> if any constraints on the `Order`'s `refund()` action would be violated, then ...
-<2> ... these will be trapped and raised to the user as a warning.
-
-[NOTE]
-====
-It ought to be possible to implement an xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`]s that would allow the above boilerplate to be removed. This recognizer service would recognize the `InteractionException` and convert to a suitable message.
-
-At the time of writing Apache Isis does not provide an out-of-the-box implementation of such an `ExceptionRecognizer`; but it should be simple enough to write one…
-====
-
-
-
-
-== Listener API
-
-The `WrapperFactory` also provides a listener API to allow other services to listen in on interactions.
-
-[source,java]
-----
-public interface WrapperFactory {
- ...
- @Programmatic
- List<InteractionListener> getListeners(); // <1>
- @Programmatic
- public boolean addInteractionListener(InteractionListener listener); // <2>
- @Programmatic
- public boolean removeInteractionListener(InteractionListener listener); // <3>
- @Programmatic
- public void notifyListeners(InteractionEvent ev); // <4>
-}
-----
-<1> all ``InteractionListener``s that have been registered.
-<2> registers an `InteractionListener`, to be notified of interactions on all wrappers. The listener will be notified of interactions even on wrappers created before the listener was installed. (From an implementation perspective this is because the wrappers delegate back to the container to fire the events).
-<3> remove an `InteractionListener`, to no longer be notified of interactions on wrappers.
-<4> used by the framework itself
-
-The original intent of this API was to enable test transcripts to be captured (in a BDD-like fashion) from integration tests. No such feature has yet been implemented however. Also, the capabilities have by and large been superceded by Apache Isis' support for domain events. We may therefore deprecate this API in the future.
-
-
-
-
-== Registering the Service
-
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `WrapperFactory` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
-
-To use an alternative implementation, use
-xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
[02/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_FixtureScriptsSpecificationProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_FixtureScriptsSpecificationProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_FixtureScriptsSpecificationProvider.adoc
new file mode 100644
index 0000000..5d200c3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_FixtureScriptsSpecificationProvider.adoc
@@ -0,0 +1,76 @@
+[[_rgsvc_spi_FixtureScriptsSpecificationProvider]]
+= `FixtureScriptsSpecificationProvider`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `FixtureScriptsSpecificationProvider` configures the
+xref:rgsvc.adoc#_rgsvc_api_FixtureScriptsDefault[`FixtureScriptsDefault`] domain service, providing the
+location to search for fixture scripts and other settings.
+
+The service is only used if the `FixtureScriptsDefault` service is instantiated as a fallback by the framework. If
+the application provides its own subclass of xref:rgcms.adoc#_rgcms_classes_super_FixtureScripts[`FixtureScripts`]
+superclass, then this provider service is not used.
+
+[TIP]
+====
+Of the two designs, we encourage you to implement this "provider" SPI rather than subclass `FixtureScripts`. The
+primary benefit (apart from decoupling responsibilities) is that it ensures that there is always an instance of
+`FixtureScripts` available for use.
+====
+
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface FixtureScriptsSpecificationProvider {
+ @Programmatic
+ FixtureScriptsSpecification getSpecification();
+}
+----
+
+where `FixtureScriptsSpecification` exposes these values:
+
+[source,java]
+----
+public class FixtureScriptsSpecification {
+ public String getPackagePrefix() { ... }
+ public FixtureScripts.NonPersistedObjectsStrategy getNonPersistedObjectsStrategy() { ... }
+ public FixtureScripts.MultipleExecutionStrategy getMultipleExecutionStrategy() { ... }
+ public Class<? extends FixtureScript> getRunScriptDefaultScriptClass() { ... }
+ public DropDownPolicy getRunScriptDropDownPolicy() { ... }
+ public Class<? extends FixtureScript> getRecreateScriptClass() { ... }
+ ...
+}
+----
+
+The class is immutable but it has a builder (obtained using `FixturescriptsSpecification.builder(...)`) for a fluent API.
+
+
+
+== Implementation
+
+The xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype] has a simple implementation of this service:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+public class DomainAppFixturesProvider implements FixtureScriptsSpecificationProvider {
+ @Override
+ public FixtureScriptsSpecification getSpecification() {
+ return FixtureScriptsSpecification
+ .builder(DomainAppFixturesProvider.class)
+ .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
+ .withRunScriptDefault(RecreateSimpleObjects.class)
+ .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
+ .withRecreate(RecreateSimpleObjects.class)
+ .build();
+ }
+}
+----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_LocaleProvider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_LocaleProvider.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_LocaleProvider.adoc
new file mode 100644
index 0000000..8005f63
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_LocaleProvider.adoc
@@ -0,0 +1,70 @@
+[[_rgsvc_spi_LocaleProvider]]
+= `LocaleProvider`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `LocaleProvider` service is one of the services that work together to implement Apache Isis' support for i18n, being used by Isis' default implementation of xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`].
+
+The role of the service itself is simply to return the `Locale` of the current user.
+
+
+[NOTE]
+====
+For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
+====
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface LocaleProvider {
+ @Programmatic
+ Locale getLocale();
+}
+----
+
+This is notionally request-scoped, returning the `Locale` of the current user; _not_ that of the server. (Note that the implementation is not required to actually be xref:rgant.adoc#_rgant-RequestScoped[`@RequestScoped`], however).
+
+
+
+
+== Implementation
+
+Isis' xref:ugvw.adoc#[Wicket viewer] provides an implementation of this service (`LocaleProviderWicket`) which leverages Apache Wicket APIs.
+
+[NOTE]
+====
+Currently there is no equivalent implementation for the xref:ugvro.adoc#[RestfulObjects viewer].
+====
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
+xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `LocaleProvider` is
+automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+== Related Services
+
+This service works in conjunction with xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`] and xref:rgsvc.adoc#_rgsvc_spi_TranslationsResolver[`TranslationsResolver`] in order to provide i18n support.
+
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_PublishingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_PublishingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_PublishingService.adoc
new file mode 100644
index 0000000..ab736ff
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_PublishingService.adoc
@@ -0,0 +1,192 @@
+[[_rgsvc_spi_PublishingService]]
+= `PublishingService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `PublishingService` is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations and of changed objects. A typical use case is to publish onto a pub/sub bus such as link:http://activemq.apache.org/[ActiveMQ] with link:http://camel.apache.org[Camel] to keep other systems up to date.
+
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface PublishingService {
+ public void publish(
+ EventMetadata metadata, // <1>
+ EventPayload payload); // <2>
+ @Deprecated
+ @Programmatic
+ void setEventSerializer(EventSerializer eventSerializer); // <3>
+}
+----
+<1> standard metadata about the event, such as the user, the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`transactionId`], date/time etc
+<2> for published actions, an `EventPayloadForActionInvocation` (or subclass thereof); for published objects, an `EventPayloadForObjectChanged` (or subclass thereof)
+<3> injects in the xref:rgsvc.adoc#_rgsvc_spi_EventSerializer[`EventSerializer`] service. This is deprecated because not every implementation is required to use an `EventSerializer` so its inclusion within the SPI of `PublishingService` was in retrospect a mistake.
+
+
+Typically implementations will use the injected `EventSerializer` to convert the metadata and payload into a form to be published:
+
+[source,java]
+----
+public interface EventSerializer {
+ public Object serialize(EventMetadata metadata, EventPayload payload);
+}
+----
+
+The serialized form returned by `EventSerializer` must be in a form that the `PublishingService` implementation is able to handle. Strings are a good lowest common denominator, but (if custom implementations of both `EventSerializer` and `PublishingService` were in use) then it might also be some other type, for example an `org.w3c.dom.Document` or an `org.json.JSONObject` might be returned instead.
+
+
+
+== Implementation
+
+The framework provides no default implementations of this service. There are however two implementations available in
+the (non-ASF) link:http://isisaddons.org[Isis Addons].
+
+=== isis-module-publishing
+
+The (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module provides an
+implementation (`org.isisaddons.module.publishing.dom.PublishingService`) that persists each
+event as a `PublishedEvent` entity. This holds the serialized form of the event metadata and payload as translated
+into a string by the injected `EventSerializer`. The module also provides its own implementation of `EventSerializer`,
+namely `RestfulObjectsSpecEventSerializer`, which represents the event payload using the representation defined by the link:http://restfulobjects.org[Restful Objects spec] of (transient) objects, grafting on the metadata as additional
+JSON nodes.
+
+The `PublishedEvent` entity also has a `state` field taking the values either "QUEUED" or "PROCESSED". The intention
+here is that an event bus can poll this table to grab pending events and dispatch them to downstream systems. When
+``PublishedEvent``s are persisted initially they always take the value "QUEUED".
+
+=== isis-module-publishmq
+
+The (non-ASF) http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] module provides an
+implementation (`org.isisaddons.module.publismq.dom.servicespi.PublishingServiceUsingActiveMq`) that publishes each
+action invocation as an event on an link:http://activemq.apache.org[ActiveMQ] message queue. These are converted into
+a canonical XML form (the xref:rgcms.adoc#_rgcms_schema-aim[ActionInvocationMemento] schema) using the
+`ActionInvocationMementoDtoUtils` class; the idea
+being that subscribers on the ActiveMQ message queue can then query back for further information, for example using
+the xref:ugvro.adoc#[RestfulObjects viewer].
+
+[NOTE]
+====
+At the time of writing this implementation does not publish changed object events.
+====
+
+
+
+== Usage
+
+To indicate that an action invocation should be published, annotate it with the xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`] annotation.
+
+To indicate that a changed object should be published is to annotate it with the xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`] annotation.
+
+
+It is also possible to "fine-tune" the `EventPayload` using the `#publishingFactory()` attribute (for both annotations). By default the `EventPayload` that is serialized identifies the object(s) being interacted with or changed, and in the case of the action invocation provides details of the action arguments and result (if any) of that action. However, the payload does not (by default) include any information about the new state of these objects. It is therefore the responsibility of the subscriber to call back to Apache Isis to determine any information that has not been published.
+
+Although the representations (if using the Restful Object serializer and Restful Objects viewer) does include hrefs for the objects, this nevertheless requires an additional network call to obtain this information).
+
+In some circumstances, then, it may make more sense to eagerly "push" information about the change to the subscriber by including that state within the payload.
+
+To accomplish this, an implementation of a "`PayloadFactory`" must be specified in the annotation.
+
+For actions, we implement the `PublishingPayloadFactoryForAction` (in `o.a.i.applib.annotation`):
+
+[source,java]
+----
+public interface PublishingPayloadFactoryForAction {
+ @Programmatic
+ public EventPayload payloadFor(
+ Identifier actionIdentifier,
+ Object target,
+ List<Object> arguments,
+ Object result);
+}
+}
+----
+The `EventPayloadForActionInvocation` abstract class (in the Isis applib) should be used as the base class for the object instance returned from `payLoadFor(...)`.
+
+For objects, the interface to implement is `PublishingPayloadFactoryForObject`:
+
+[source,java]
+----
+public interface PublishingPayloadFactoryForObject {
+
+ @Programmatic
+ public EventPayload payloadFor(
+ Object changedObject,
+ PublishingChangeKind publishingChangeKind); // <1>
+}
+----
+<1> an enum taking the values `CREATE`, `UPDATE`, `DELETE`
+
+Similarly, the `EventPayloadForObjectChanged` abstract class should be used as the base class for the object returned from `payLoadFor(...)`.
+
+For example, the following will eagerly include a `ToDoItem`'s `description` property whenever it is changed:
+
+[source,java]
+----
+@DomainObject(publishingPayloadFactory=ToDoItemPayloadFactory.class)
+public class ToDoItem {
+ ...
+}
+----
+
+where `ToDoItemPayloadFactory` is defined as:
+
+[source,java]
+----
+public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
+ public static class ToDoItemPayload
+ extends EventPayloadForObjectChanged<ToDoItem> {
+ public ToDoItemPayload(ToDoItem changed) { super(changed); }
+ public String getDescription() { return getChanged().getDescription(); }
+ }
+ @Override
+ public EventPayload payloadFor(Object changedObject, PublishingChangeKind kind) {
+ return new ToDoItemPayload((ToDoItem) changedObject);
+ }
+}
+----
+
+
+
+
+== Registering the Services
+
+There is no default implementation of this service provided by the core Apache Isis framework.
+
+Both the (non-ASF) Isis addons' http://github.com/isisaddons/isis-module-publishing[publishing] module and the
+http://github.com/isisaddons/isis-module-publishmq[publishmq] module provide implementations of this service.
+Assuming that an `AppManifest` is being used to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app])
+then this can be activated by updating the `pom.xml` and updating the `AppManifest#getModules()` method.
+
+The modules also provide services that contribute to the UI. If contributions are not required in the UI, these can be
+suppressed either using security or by implementing a
+xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
+
+
+
+
+
+== Related Services
+
+The `PublishingService` is intended for coarse-grained publish/subscribe for system-to-system interactions, from Apache Isis to some other system. Here the only events published are those that action invocations (for actions annotated with xref:rgant.adoc#_rgant-Action_publishing[`@Action#publishing()`]) and of changed objects (for objects annotated with xref:rgant.adoc#_rgant-DomainObject_publishing[`@DomainObject#publishing()`].
+
+The xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`] meanwhile is intended for fine-grained publish/subscribe for object-to-object interactions within an Apache Isis domain object model. The event propagation is strictly in-memory, and there are no restrictions on the object acting as the event (it need not be serializable, for example).
+
+All three of these services collaborate implicitly by way of the xref:rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] interface.
+
+
+
+
+== Design Notes
+
+The following class diagram shows how the above components fit together:
+
+image::{_imagesdir}reference-services-spi/PublishingService/yuml.me-23db58a4.png[width="800px",link="{_imagesdir}reference-services-spi/PublishingService/yuml.me-23db58a4.png"]
+
+This yuml.me diagram was generated at http://yuml.me/edit/23db58a4[yuml.me].
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_RepresentationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_RepresentationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_RepresentationService.adoc
new file mode 100644
index 0000000..60e12cf
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_RepresentationService.adoc
@@ -0,0 +1,103 @@
+[[_rgsvc_spi_RepresentationService]]
+= `RepresentationService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `RepresentationService` is the main plug-in point for the xref:ugvro.adoc#[RestfulObjects viewer] to generate representations.
+
+The default implementation generates representations according to the link:http://restfulobjects.org[Restful Objects spec] v1.0. However, it also delegates to the xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`] which provides a mechanism for altering representations according to the HTTP `Accept` header.
+
+The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain Javascript library, say) expect, or at least works best with, a certain style of representation.
+
+In all there are three domain services that can influence the representations generated: this service, xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`]and the xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]. The diagram below shows how these collaborate:
+
+image::{_imagesdir}reference-services-spi/RepresentationService/service-collaborations.png[width="700px",link="{_imagesdir}reference-services-spi/RepresentationService/service-collaborations.png"]
+
+The `RepresentationServiceForRestfulObjects` is the default implementation of this service; likewise `ContentNegotiationServiceXRoDomainType` is the default implementation of the `ContentNegotiationService`. If you inspect the source code you'll see that the default implementation of this service's primary responsibility is to generate the default Restful Objects representations. Therefore, if you what you want to do is to generate a _different _representation then in many cases replacing either this service _or_ the `ContentNegotiationService` will be equivalent (you'll notice that their SPIs are very similar).
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface RepresentationService {
+ @Programmatic
+ Response objectRepresentation( // <1>
+ Context rendererContext,
+ ObjectAdapter objectAdapter);
+ @Programmatic
+ Response propertyDetails( // <2>
+ Context rendererContext,
+ ObjectAndProperty objectAndProperty,
+ MemberReprMode memberReprMode);
+ @Programmatic
+ Response collectionDetails( // <3>
+ Context rendererContext,
+ ObjectAndCollection objectAndCollection,
+ MemberReprMode memberReprMode);
+ @Programmatic
+ Response actionPrompt( // <4>
+ Context rendererContext,
+ ObjectAndAction objectAndAction);
+ @Programmatic
+ Response actionResult( // <5>
+ Context rendererContext,
+ ObjectAndActionInvocation objectAndActionInvocation,
+ ActionResultReprRenderer.SelfLink selfLink);
+ public static interface Context extends RendererContext {
+ ObjectAdapterLinkTo getAdapterLinkTo();
+ }
+}
+----
+<1> representation of a single object, as per section 14.4 of the RO spec, v1.0
+<2> representation of a single property of an object, as per section 16.4 of the RO spec v1.0
+<3> representation of a single collection of an object, as per section 17.5 of the RO spec v1.0
+<4> representation of a single action (prompt) of an object, as per section 18.2 of the RO spec v1.0
+<5> representation of the results of a single action invocation, as per section 19.5 of the RO spec v1.0
+
+These methods provide:
+
+* a `RendererContext` which provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings)
+
+* an object representing the information to be rendered +
++
+eg `ObjectAdapter`, `ObjectAndProperty`, `ObjectAndCollection` etc
+
+* for members, whether the representation is in read/write mode +
++
+ie `MemberReprMode`
+
+
+
+[WARNING]
+====
+This is an "internal" SPI, meaning that it uses types that are not part of the Isis applib. We do not guarantee that link:http://semver.org[semantic versioning] will be honoured for these APIs.
+====
+
+
+
+== Implementation
+
+As discussed in the introduction, the framework provides a default implementation, `o.a.i.v.ro.rendering.service.RepresentationServiceForRestfulObjects`. This delegates to xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`] to generate an alternative representation; but if none is provided then it falls back on generating the representations as defined in the link:http://restfulobjects.org[Restful Objects spec] v1.0.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' default implementation of `RepresentationService` service is automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+
+
+
+== Related Services
+
+The default implementation delegates to xref:rgsvc.adoc#_rgsvc_spi_ContentNegotiationService[`ContentNegotiationService`], whose default implementation may delegate in turn to xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`] (if present).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationService.adoc
new file mode 100644
index 0000000..dc5503e
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationService.adoc
@@ -0,0 +1,80 @@
+[[_rgsvc_spi_TranslationService]]
+= `TranslationService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `TranslationService` is the cornerstone of Apache Isis' i18n support. Its role is to be able to provide translated versions of the various elements within the Apache Isis metamodel (service and object classes, properties, collections, actions, action parameters) and also to translate business rule (disable/valid) messages, and exceptions. These translations provide for both singular and plural forms.
+
+
+[NOTE]
+====
+For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
+====
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface TranslationService {
+ @Programmatic
+ String translate(String context, String text); // <1>
+ @Programmatic
+ String translate(String context, // <2>
+ String singularText,
+ String pluralText, int num);
+
+ enum Mode { READ, WRITE;}
+ @Programmatic
+ Mode getMode(); // <3>
+}
+
+----
+<1> translate the text, in the locale of the "current user".
+<2> return a translation of either the singular or the plural text, dependent on the `num` parameter, in the locale of the "current user"
+<3> whether this implementation is operating in read or in write mode.
+
+If in read mode, then the translations are expected to be present.
+
+If in write mode, then the implementation is saving translation keys, and will always return the untranslated translation.
+
+
+
+
+== Implementation
+
+The Apache Isis framework provides a default implementation (`TranslationServicePo`) that uses the GNU `.pot` and `.po` files for translations. It relies on the `LocaleProvider` service (to return the `Locale` of the current user) and also the `TranslationsResolver` service (to read existing translations).
+
+The framework also provides a supporting `TranslationServicePoMenu` provides menu items under the "Prototyping" secondary menu for controlling this service and downloading `.pot` files for translation.
+
+For more details on the implementation, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[i18n support].
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `TranslationService` service (along with the supporting menu service) are automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+If the menu items are not required then these can be suppressed either using security or by implementing a xref:ugbtb.adoc#_ugbtb_more-advanced_decoupling_vetoing-visibility[vetoing subscriber].
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+
+== Related Services
+
+This service works in conjunction with xref:rgsvc.adoc#_rgsvc_spi_LocaleProvider[`LocaleProvider`] and xref:rgsvc.adoc#_rgsvc_spi_TranslationsResolver[`TranslationsResolver`] in order to provide i18n support.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationsResolver.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationsResolver.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationsResolver.adoc
new file mode 100644
index 0000000..faceae0
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_TranslationsResolver.adoc
@@ -0,0 +1,67 @@
+[[_rgsvc_spi_TranslationsResolver]]
+= `TranslationsResolver`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `TranslationsResolver` service is one of the services that work together to implement Apache Isis' support for i18n, being used by Isis' default implementation of xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`].
+
+The role of the service itself is locate and return translations.
+
+
+[NOTE]
+====
+For the "big picture" and further details on Apache Isis' i18n support, see xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[here].
+====
+
+
+
+== SPI
+
+The SPI defined by this service is:
+
+[source,java]
+----
+public interface TranslationsResolver {
+ @Programmatic
+ List<String> readLines(final String file);
+}
+----
+
+
+== Implementation
+
+Isis' xref:ugvw.adoc#[Wicket viewer] provides an implementation of this service (`TranslationsResolverWicket`) which leverages Apache Wicket APIs. This searches for translation files in the standard `WEB-INF/` directory.
+
+[NOTE]
+====
+Currently there is no equivalent implementation for the xref:ugvro.adoc#[RestfulObjects viewer].
+====
+
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `TranslationsResolver` is
+automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+
+
+== Related Services
+
+
+This service works in conjunction with xref:rgsvc.adoc#_rgsvc_spi_LocaleProvider[`LocaleProvider`] and xref:rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`] in order to provide i18n support.
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UrlEncodingService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UrlEncodingService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UrlEncodingService.adoc
new file mode 100644
index 0000000..6d094a5
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UrlEncodingService.adoc
@@ -0,0 +1,59 @@
+[[_rgsvc_spi_UrlEncodingService]]
+= `UrlEncodingService` (`1.11.0-SNAPSHOT`)
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `UrlEncodingService` (`1.11.0-SNAPSHOT`) defines a consistent way to convert strings to/from a form safe for use
+within a URL. The service is used by the framework to map xref:ugbtb.adoc#_ugbtb_more-advanced_view-models[view model]
+mementos (derived from the state of the view model itself) into a form that can be used as a view model. When the
+framework needs to recreate the view model (for example to invoke an action on it), this URL is converted back into a
+view model memento, from which the view model can then be hydrated.
+
+Defining this functionality as an SPI has two use cases:
+
+* first, (though some browsers support longer strings), there is a limit of 2083 characters for URLs. For view model
+mementos that correspond to large strings (as might occur when serializing a JAXB
+xref:rgant.adoc#_rgant-XmlRootElement[`@XmlRootElement`]-annotated view model), the service provides a
+hook. +
++
+For example, each memento string could be mapped to a GUID held in some cluster-aware cache.
+
+* the service provides the ability, to encrypt the string in order to avoid leakage of potentially sensitive
+state within the URL.
+
+The framework provides a default implementation of this service, `UrlEncodingServiceUsingBaseEncoding` (also in the
+applib) that uses `base-64` encoding to `UTF-8` charset.
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface UrlEncodingService {
+ @Programmatic
+ public String encode(final String str); // <1>
+ @Programmatic
+ public String decode(String str); // <2>
+}
+----
+<1> convert the string (eg view model memento) into a string safe for use within an URL
+<2> unconvert the string from its URL form into its original form URL
+
+
+
+== Implementation
+
+The framework provides a default implementation (`UrlEncodingServiceUsingBaseEncoding`) that simply converts the string
+using base-64 encoding and UTF-8 character set. As already noted, be aware that the maximum length of a URL should not
+exceed 2083 characters. For large view models, there's the possibility that this limit could be exceeded; in such
+cases register an alternative implementation of this service.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserProfileService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserProfileService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserProfileService.adoc
new file mode 100644
index 0000000..c9f9a3a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserProfileService.adoc
@@ -0,0 +1,47 @@
+[[_rgsvc_spi_UserProfileService]]
+= `UserProfileService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `UserProfileService` provides the ability for the domain application to return supplementary metadata about the current user. This information is used (by the xref:ugvw.adoc#[Wicket viewer]) to customize the appearance of the tertiary "Me" menu bar (top right). For example, rather than display the username, instead the user's first and last name could be displayed.
+
+Another use case is to allow the user to switch context in some fashion or other. This might be to emulate a sort of "sudo"-like function, or perhaps to focus on some particular set of data.
+
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface UserProfileService {
+ @Programmatic
+ String userProfileName(); // <1>
+}
+----
+<1> is used (in the Wicket viewer) as the menu name of the tertiary "Me" menu bar.
+
+If the method returns `null` or throws an exception then the framework will default to using the current user name.
+
+In the future this API may be expanded; one obvious possibility is to return a profile photo or avatar URL.
+
+
+
+== Implementation
+
+There is no default implementation of this service provided by the core Apache Isis framework.
+
+An example implementation can be found in the (non-ASF)
+http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]:
+
+image::{_imagesdir}reference-services-spi/UserProfileService/todoapp.png[width="800px",link="{_imagesdir}reference-services-spi/UserProfileService/todoapp.png"]
+
+
+[NOTE]
+====
+Currently this feature is not integrated with Apache Isis' authentication mechanisms; the information provided is purely metadata provided for presentation purposes only.
+====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserRegistrationService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserRegistrationService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserRegistrationService.adoc
new file mode 100644
index 0000000..ad2111a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_spi_UserRegistrationService.adoc
@@ -0,0 +1,98 @@
+[[_rgsvc_spi_UserRegistrationService]]
+= `UserRegistrationService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `UserRegistrationService` provides the ability for users to sign-up to access an application by providing a valid email address, and also provides the capability for users to reset their password if forgotten.
+
+For user sign-up, the xref:ugvw.adoc#[Wicket viewer] will check whether an implementation of this service (and also the xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`EmailNotificationService`]) is available, and if so will render a sign-up page where the user enters their email address. A verification email is sent (using the aforementioned `EmailNotificationService`) which includes a link back to the running application; this allows the user then to complete their registration process (choose user name, password and so on). When the user has provided the additional details, the Wicket viewer calls _this_ service in order to create an account for them, and then logs the user on.
+
+For the password reset feature, the Wicket viewer will render a password reset page, and use the `EmailNotificationService` to send a "password forgotten" email. This service provides the ability to reset a password based on the user's email address.
+
+It is of course possible for domain objects to use this service; it will be injected into domain object or other domain services in the usual way. That said, we expect that such use cases will be comparatively rare; the primary use case is for the Wicket viewer's sign-up page.
+
+[NOTE]
+====
+For further details on the user registration feature (as supported by the Wicket viewer), see xref:ugvw.adoc#_ugvw_features_user-registration[here].
+====
+
+
+
+== SPI
+
+The SPI defined by the service is:
+
+[source,java]
+----
+public interface UserRegistrationService {
+ @Programmatic
+ boolean usernameExists(String username); // <1>
+ @Programmatic
+ boolean emailExists(String emailAddress); // <2>
+ @Programmatic
+ void registerUser(String username, String password, String emailAddress); // <3>
+ @Programmatic
+ boolean updatePasswordByEmail(String emailAddress, String password); // <4>
+}
+----
+<1> checks if there is already a user with the specified username
+<2> checks if there is already a user with the specified email address
+<3> creates the user, with specified password and email address. The username and email address must both be unique (not being used by an existing user)
+<4> allows the user to reset their password
+
+
+
+
+== Implementation
+
+The core Apache Isis framework itself defines only an API; there is no default implementation. Rather, the implementation will depend on the security mechanism being used.
+
+That said, if you have configured your app to use the http://github.com/isisaddons/isis-module-security[Isis addons security module], then note that the security module does provide an abstract implementation (`SecurityModuleAppUserRegistrationServiceAbstract`) of the `UserRegistrationService`. You will need to extend that service and provide implementation for the two abstract methods: `getInitialRole()` and `getAdditionalInitialRoles()`.
+
+This is needed so that the self-registered users are assigned automatically to your application role(s) and be able to use the application. Without any role such user will be able only to see/use the logout link of the application.
+
+
+
+
+== Registering the Services
+
+There is no default implementation of this service provided by the core Apache Isis framework.
+
+If using the (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module) for
+authentication and authorization, then note that it provides an adapter class,
+`SecurityModuleAppUserRegistrationServiceAbstract`, that provides most of the implementation. You are still required
+to implement a subclass and register.
+
+For example:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class AppUserRegistrationService extends SecurityModuleAppUserRegistrationServiceAbstract {
+ protected ApplicationRole getInitialRole() {
+ return findRole("regular-user");
+ }
+ protected Set<ApplicationRole> getAdditionalInitialRoles() {
+ return Collections.singleton(findRole("self-registered-user"));
+ }
+ private ApplicationRole findRole(final String roleName) {
+ return applicationRoles.findRoleByName(roleName);
+ }
+ @Inject
+ private ApplicationRoles applicationRoles;
+}
+----
+
+
+
+== Related Services
+
+The most common use case is to allow users to sign-up through Apache Isis' Wicket viewer. Because the process requires email to be sent, the following services must be configured:
+
+* xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]
+* xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`EmailNotificationService`]
+* `UserRegistrationService` (this service)
+
+The `EmailService` in particular requires additional xref:rgcfg.adoc#_rgcfg_configuring-core[configuration properties] to specify the external SMTP service.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_tg_stop-scaffolding-start-coding.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_tg_stop-scaffolding-start-coding.adoc b/adocs/documentation/src/main/asciidoc/guides/_tg_stop-scaffolding-start-coding.adoc
index dd0cd14..6b7ade3 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_tg_stop-scaffolding-start-coding.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_tg_stop-scaffolding-start-coding.adoc
@@ -241,7 +241,7 @@ Fixture scripts are used to setup the app into a known state. They are great for
* rename the `SimpleObjectsTearDownFixture` class
* and update to delete from the appropriate underlying database table(s)
-* use the injected xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`] domain service.
+* use the injected xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`] domain service.
* refactor/rename the fixture script classes that create instances your entity:
* `RecreateSimpleObjects`, which sets up a set of objects for a given scenario
* `SimpleObjectCreate` which creates a single object
@@ -366,7 +366,7 @@ The Wicket UI doesn't allow collections to be modified (added to/removed from).
* Add domain actions to add/remove from the collection
* to create objects, xref:ugfun.adoc#_ugfun_how-tos_class-structure_inject-services[inject] associated domain service
** generally we recommend using the xref:rgant.adoc#_rgant-Inject[`@Inject`] annotation with either private or default visibility
-* the service itself should use xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]
+* the service itself should use xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]
* use the xref:rgant.adoc#_rgant-MemberOrder[`@MemberOrder(name=...)`] annotation to associate an action with a property or with a collection
@@ -449,7 +449,7 @@ The Wicket UI will automatically invoke the "home page" action, if available. Th
To ensure testability, there should be no dependencies on system time, for example usage of `LocalDate.now()`. Instead the domain objects should delegate to the provided `ClockService`.
* remove any dependencies on system time (eg defaults for date/time action parameters)
-* inject xref:rgsvc.adoc#_rgsvc-api_ClockService[`ClockService`]
+* inject xref:rgsvc.adoc#_rgsvc_api_ClockService[`ClockService`]
* call `ClockService.now()` etc where required.
@@ -507,7 +507,7 @@ Under the covers Apache Isis uses the https://code.google.com/p/guava-libraries/
By default the events generated are `ActionDomainEvent.Default` (for actions) and `PropertyDomainEvent.Default` (for properties). Subclasses of these can be specified using the xref:rgant.adoc#_rgant-Action_domainEvent[`@Action(domainEvent=...)`] or xref:rgant.adoc#_rgant-Property_domainEvent[`Property(domainEvent=...)`] for properties.
-Using the guidance in the docs for the xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]:
+Using the guidance in the docs for the xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]:
* write a domain service subscriber to subscribe to events
* use the domain service to perform log events
@@ -526,12 +526,12 @@ Note that currently (1.8.0) only no-arg actions can be specified as bulk actions
Thus:
* Write a no-arg action for your domain entity, annotate with `@Action(invokeOn=...)`
-* Inject the xref:rgsvc.adoc#_rgsvc-api_ActionInvocationContext[`ActionInteractionContext`] (request-scoped) service
+* Inject the xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`ActionInteractionContext`] (request-scoped) service
* Use the `ActionInteractionContext` service to determine whether the action was invoked in bulk or as a regular action.
* return null if invoked on a collection; the Wicket viewer will go back to the original collection
** (if return non-null, then Wicket viewer will navigate to the object of the last invocation� generally not what is required)
-The similar xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`] (request-scoped) domain service is a good way to share information between bulk action invocations:
+The similar xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`] (request-scoped) domain service is a good way to share information between bulk action invocations:
* Inject the `Scratchpad` domain service
* for each action, store state (eg a running total)
@@ -542,7 +542,7 @@ The similar xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`] (request-scoped)
== Performance tuning
-The xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`QueryResultsCache`] (request-scoped) domain service allows arbitrary objects to be cached for the duration of a request.
+The xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`QueryResultsCache`] (request-scoped) domain service allows arbitrary objects to be cached for the duration of a request.
This can be helpful for "naive" code which would normally make the same query within a loop.
@@ -657,7 +657,7 @@ change back to:
There will probably be some compile issues to fix up once you've done this; comment out all code that doesn't compile.
-Isis has great support for writing xref:ugtst.adoc#_ugtst_integ-test-support[integration tests]; well-written integration tests should leverage fixture scripts and use the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`@WrapperFactory`] domain service.
+Isis has great support for writing xref:ugtst.adoc#_ugtst_integ-test-support[integration tests]; well-written integration tests should leverage fixture scripts and use the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`@WrapperFactory`] domain service.
* use the tests from the original archetype and the documentation on the website to develop integration tests for your app's functionality.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_deployment_tomcat.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_deployment_tomcat.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_deployment_tomcat.adoc
index d37c599..9311a2a 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_deployment_tomcat.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_deployment_tomcat.adoc
@@ -14,7 +14,7 @@ See the guidance xref:ugbtb.adoc#_ugbtb_deployment_externalized-configuration[be
== JVM Args
-The xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] uses link:http://www.javassist.org[Javassist] to create on-the-fly classes acting as a proxy. The cost of these proxies can be mitigated using:
+The xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] uses link:http://www.javassist.org[Javassist] to create on-the-fly classes acting as a proxy. The cost of these proxies can be mitigated using:
[source,ini]
----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_event-bus.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_event-bus.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_event-bus.adoc
index 44db788..97dd52c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_event-bus.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_event-bus.adoc
@@ -4,7 +4,7 @@
:_basedir: ../
:_imagesdir: images/
-NOTE: TODO - see xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`], xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`], xref:rgant.adoc#_rgant-Property_domainEvent[`@Property#domainEvent()`], xref:rgant.adoc#_rgant-Collection_domainEvent[`@Collection#domainEvent()`], xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`].
+NOTE: TODO - see xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`], xref:rgant.adoc#_rgant-Action_domainEvent[`@Action#domainEvent()`], xref:rgant.adoc#_rgant-Property_domainEvent[`@Property#domainEvent()`], xref:rgant.adoc#_rgant-Collection_domainEvent[`@Collection#domainEvent()`], xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`].
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_mixins.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_mixins.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_mixins.adoc
index 32b734f..29eb3e6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_mixins.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_mixins.adoc
@@ -135,7 +135,7 @@ dynamically. If writing integration tests or fixtures, or (sometimes) just regu
instantiate mixins directly.
For this you can use the
-xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_object-creation-api[`DomainObjectContainer#mixin(...)`
+xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`DomainObjectContainer#mixin(...)`
method. For example:
[source,java]
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_vetoing-visibility.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_vetoing-visibility.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_vetoing-visibility.adoc
index 269ad4d..d5abe7f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_vetoing-visibility.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_decoupling_vetoing-visibility.adoc
@@ -5,7 +5,7 @@
:_imagesdir: images/
-NOTE: TODO - a write-up of the "vetoing subscriber" design pattern, eg as described in the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]
+NOTE: TODO - a write-up of the "vetoing subscriber" design pattern, eg as described in the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]
eg if included an addon such as auditing or security.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access.adoc
index 9369935..b7c77c0 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access.adoc
@@ -16,7 +16,7 @@ There are several main use-cases:
Note that the calling thread runs in the same process space as the Apache Isis domain object model (must be physically linked to the JAR files containing the domain classes). For use cases where the calling thread runs in some other process space (eg migrating data from a legacy system), then the xref:ugvro.adoc#[Restful Objects viewer] is usually the way to go.
-The API described in this chapter is reasonably low-level, allowing code to interact very directly with the Apache Isis metamodel and runtime. Such callers should be considered trusted: they do not (by default) honour any business rules eg implicit in the Isis annotations or hide/disable/validate methods. However the xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`] service could be used to enforce such business rules if required.
+The API described in this chapter is reasonably low-level, allowing code to interact very directly with the Apache Isis metamodel and runtime. Such callers should be considered trusted: they do not (by default) honour any business rules eg implicit in the Isis annotations or hide/disable/validate methods. However the xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`] service could be used to enforce such business rules if required.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access_BackgroundCommandExecution.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access_BackgroundCommandExecution.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access_BackgroundCommandExecution.adoc
index c2ab8d1..06d6747 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access_BackgroundCommandExecution.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_headless-access_BackgroundCommandExecution.adoc
@@ -6,7 +6,7 @@
-The `BackgroundCommandExecution` class (a subclass of xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_AbstractIsisSessionTemplate[AbstractIsisSessionTemplate]) is intended to simplify the execution of background ``Command``s persisted by way of the xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] and the xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`].
+The `BackgroundCommandExecution` class (a subclass of xref:ugbtb.adoc#_ugbtb_more-advanced_headless-access_AbstractIsisSessionTemplate[AbstractIsisSessionTemplate]) is intended to simplify the execution of background ``Command``s persisted by way of the xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] and the xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`].
Its signature is:
@@ -34,9 +34,9 @@ image::{_imagesdir}headless-access/BackgroundCommandExecution.png[width="400px"]
== Background Execution
-The `BackgroundCommandExecutionFromBackgroundCommandServiceJdo` is a concrete subclass of `BackgroundCommandExecution` (see the xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundCommandService`]), the intended use being for the class to be instantiated regularly (eg every 10 seconds) by a scheduler such as http://quartz-scheduler.org[Quartz]) to poll for ``Command``s to be executed, and then execute them.
+The `BackgroundCommandExecutionFromBackgroundCommandServiceJdo` is a concrete subclass of `BackgroundCommandExecution` (see the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundCommandService`]), the intended use being for the class to be instantiated regularly (eg every 10 seconds) by a scheduler such as http://quartz-scheduler.org[Quartz]) to poll for ``Command``s to be executed, and then execute them.
-This implementation queries for ``Command``s persisted by the link:http://www.isisaddons.org/isis-module-command[Isis addons Command Module]'s implementations of xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`] using the `BackgroundCommandServiceJdoRepository`.
+This implementation queries for ``Command``s persisted by the link:http://www.isisaddons.org/isis-module-command[Isis addons Command Module]'s implementations of xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] and xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`] using the `BackgroundCommandServiceJdoRepository`.
The diagram below (link:http://yuml.me/edit/25343da1[yuml.me/25343da1]) shows the inheritance hierarchy for this class:
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_i18n.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_i18n.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_i18n.adoc
index 78008b3..2e134e6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_i18n.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_i18n.adoc
@@ -175,7 +175,7 @@ msgstr "Iche heisse {firstName} {lastName}."
then the translation would be: "Ich heisse James Bond".
-The same class is used in xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`] so that you can raise translatable info, warning and error messages; each of the relevant methods are overloaded.
+The same class is used in xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`] so that you can raise translatable info, warning and error messages; each of the relevant methods are overloaded.
For example:
@@ -194,7 +194,7 @@ public interface DomainObjectContainer {
=== `TranslatableException`
-Another mechanism by which messages can be rendered to the user are as the result of exception messages thrown and recognized by an xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`].
+Another mechanism by which messages can be rendered to the user are as the result of exception messages thrown and recognized by an xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`].
In this case, if the exception implements `TranslatableException`, then the message will automatically be translated before being rendered. The `TranslatableException` itself takes the form:
@@ -258,7 +258,7 @@ To ensure your app is fully internationalized app, you must therefore:
====
We make no apologies for this requirement: one of the reasons that we decided to implement Apache Isis' i18n support in this way is because it encourages/requires the app to be properly tested.
-Behind the scenes Apache Isis uses a JUnit rule (`ExceptionRecognizerTranslate`) to intercept any exceptions that are thrown. These are simply passed through to the registered xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`]s so that any messages are recorded as requiring translation.
+Behind the scenes Apache Isis uses a JUnit rule (`ExceptionRecognizerTranslate`) to intercept any exceptions that are thrown. These are simply passed through to the registered xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`]s so that any messages are recorded as requiring translation.
====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_replacing-default-service-implementations.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_replacing-default-service-implementations.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_replacing-default-service-implementations.adoc
index d74652d..5ba01a7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_replacing-default-service-implementations.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_replacing-default-service-implementations.adoc
@@ -6,11 +6,11 @@
-The framework provides default implementations for many of the xref:rgsvc.adoc#_rgsvc-api[API Services]. This is convenient, but sometimes you will want to replace the default implementation with your own service implementation.
+The framework provides default implementations for many of the xref:rgsvc.adoc#_rgsvc_api[API Services]. This is convenient, but sometimes you will want to replace the default implementation with your own service implementation.
The trick is to use the xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] attribute, specifying a low number (typically `"1"`).
-For example, suppose you wanted to provide your own implementation of xref:rgsvc.adoc#_rgsvc-api_LocaleProvider[`LocaleProvider`]. Here's how:
+For example, suppose you wanted to provide your own implementation of xref:rgsvc.adoc#_rgsvc_api_LocaleProvider[`LocaleProvider`]. Here's how:
[source,java]
----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_transactions-and-errors.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_transactions-and-errors.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_transactions-and-errors.adoc
index 86908f0..a3fe75c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_transactions-and-errors.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_transactions-and-errors.adoc
@@ -6,7 +6,7 @@
In Apache Isis, every action invocation (in fact, every interaction) is automatically wrapped in a transaction, and any repository query automatically does a flush.
-What that means is that there's no need to explicitly start or commit transactions in Apache Isis; this will be done for you. Indeed, if you do try to manage transactions (eg by reaching into the JDO `PersistenceManager` exposed by the xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[IsisJdoSupport] domain service, then you are likely to confuse Isis and get a stack trace for your trouble.
+What that means is that there's no need to explicitly start or commit transactions in Apache Isis; this will be done for you. Indeed, if you do try to manage transactions (eg by reaching into the JDO `PersistenceManager` exposed by the xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[IsisJdoSupport] domain service, then you are likely to confuse Isis and get a stack trace for your trouble.
@@ -23,11 +23,11 @@ If you throw any other exception (ie not a subclass of `RecoverableException`),
== Raise message/errors to users
-NOTE: TODO - xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer_messages-api[`DomainObjectContainer`]
+NOTE: TODO - xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_messages-api[`DomainObjectContainer`]
== Exception Recognizers
-NOTE: TODO - xref:rgsvc.adoc#_rgsvc-spi_ExceptionRecognizer[`ExceptionRecognizer`] service
+NOTE: TODO - xref:rgsvc.adoc#_rgsvc_spi_ExceptionRecognizer[`ExceptionRecognizer`] service
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_jaxb.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_jaxb.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_jaxb.adoc
index a21ad06..51eef39 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_jaxb.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_jaxb.adoc
@@ -157,7 +157,7 @@ on top of the entity so that the implementation details (of the entity's structu
However, the identity of the underlying entity can be well defined; Apache Isis defines the
xref:rgcms.adoc#_rgcms_schema-common[Common schema] which defines the `<oid-dto>` element (and corresponding `OidDto` class):
the object's type and its identifier. This is basically a formal XML equivalent to the `Bookmark` object obtained
-from the xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`].
+from the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`].
There is only one requirement to make this work: every referenced domain entity must be annotated with
xref:rgant.adoc#_rgant-XmlJavaTypeAdapter[`@XmlJavaTypeAdapter`], specifying the framework-provided
@@ -217,7 +217,7 @@ public class ToDoItemDto extends todoapp.app.viewmodels.todoitem.v1_0.ToDoItemDt
There's nothing to prevent a JAXB DTO from containing rich graphs of data, parent containing children containing
children. Be aware though that all of this state will become the DTO's memento, ultimately converted into a URL-safe
-form, by way of the xref:rgsvc.adoc#_rgsvc-spi_UrlEncodingService[`UrlEncodingService`].
+form, by way of the xref:rgsvc.adoc#_rgsvc_spi_UrlEncodingService[`UrlEncodingService`].
There are limits to the lengths of URLs, however. Therefore the DTO should not include state that can easily be
derived from other information. If the URL does exceed limits, then provide a custom implementation of `UrlEncodingService`
@@ -231,7 +231,7 @@ on the server).
== Generating XSDs and DTOs
The xref:cg.adoc#_cg_isis-maven-plugin[Apache Isis maven plugin] provides the xref:cg.adoc#_cg_isis-maven-plugin_xsd[xsd] goal that allows the XSDs to be generated from any JAXB-annotated view models.
-These use the xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`] to generate the schemas; using the
+These use the xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`] to generate the schemas; using the
standard `schemagen` command line will not correctly interpret any references to domain entities as OIDs.
The documentation for the `xsd` goal also explains how to generate DTO classes from the generated XSDs. Note that these
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_programming-model.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_programming-model.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_programming-model.adoc
index e7305b4..29cafd8 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_programming-model.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_programming-model.adoc
@@ -8,7 +8,7 @@
So much for the theory; how should view models be implemented? Fundamentally all view models' state is serialized into
a string memento; this memento is then held by the client (browser) in the form of a URL. As you might imagine, this
-URL can become quite long, but Apache Isis offers a mechanism (the xref:rgsvc.adoc#_rgsvc-spi_UrlEncodingService[`UrlEncodingService`]) if it exceeds the maximum length for a URL
+URL can become quite long, but Apache Isis offers a mechanism (the xref:rgsvc.adoc#_rgsvc_spi_UrlEncodingService[`UrlEncodingService`]) if it exceeds the maximum length for a URL
(2083 characters). Also, of course, this string memento must only contain characters that it is valid for use within
a URL.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_use-cases.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_use-cases.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_use-cases.adoc
index ccaffb6..3a10b53 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_use-cases.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_more-advanced_view-models_use-cases.adoc
@@ -110,8 +110,8 @@ Instead, a view model can be defined to act as a DTO. To put this formal contra
model can (as of `1.11.0-SNAPSHOT`) simply be defined as a JAXB-annotated entity; this allows the consumer to obtain
the DTO in XML format along with a corresponding XSD schema describing the structure of that XML. These XML
representations can be surfaced by the xref:ugvro.adoc#[RestfulObjects viewer] (by implementing
-the xref:rgsvc.adoc#_rgsvc-spi_ContentMappingService[`ContentMappingService`]); the XSD can be obtained
-using the xref:rgsvc.adoc#_rgsvc-api_JaxbService[`JaxbService`]. Using the formalism of XML also allows
+the xref:rgsvc.adoc#_rgsvc_spi_ContentMappingService[`ContentMappingService`]); the XSD can be obtained
+using the xref:rgsvc.adoc#_rgsvc_api_JaxbService[`JaxbService`]. Using the formalism of XML also allows
DTOs to be carefully and properly versioned using XML namespaces.
[TIP]
@@ -129,7 +129,7 @@ JAXB-annotated view models are in many regards the most powerful of all the view
One important variation of the DTO use case concerns subscribers on an enterprise event bus such as
link:http://camel.apache.org[Apache Camel(TM)] and similar.
-A xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`] implementation (eg that provided by
+A xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`] implementation (eg that provided by
(non-ASF) http://github.com/isisaddons/isis-module-publishmq[Isis addons' publishmq] module) can publish XML events
onto a message queue, typically representing action invocations within the originating Isis application. The ESB
(Apache Camel) then dispatches this event to all interested subscribers. These subscribers represent external systems
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_building-blocks.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_building-blocks.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_building-blocks.adoc
index c526ced..d864f24 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_building-blocks.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_building-blocks.adoc
@@ -77,7 +77,7 @@ google-maps API.
Also worth mentioning: domain services can also be either singletons (discussed above) or request-scoped; the latter
being annotated with `@javax.enterprise.context.RequestScoped`. An example of the request-scoped service is the
-xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`] service, for sharing arbitrary data between multiple objects.
+xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`] service, for sharing arbitrary data between multiple objects.
The final type of domain object is the *mixin*. These are similar to contributed services in that they also contribute (or rather,
mixin) both behaviour or (derived) state to entities/view models. However, they provide a more control over contributed services,
@@ -309,7 +309,7 @@ Some examples:
scanned by the mail room, the barcode could be read to attach the correspondence to the relevant domain object.
* as a handle to any object in an audit record (as used by the
-xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`], in fact).
+xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`], in fact).
* and of course both the xref:ugvro.adoc#[RestfulObjects viewer] and
xref:ugvw.adoc#[Wicket viewer]
@@ -317,7 +317,7 @@ use the oid tuple to look up, render and allow the user to interact with domain
Although the exact content of an OID should be considered opaque by domain objects, it is possible for domain objects
to obtain OIDs. These are represented as `Bookmark`s, obtained from the
-xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]. Deep links meanwhile can be obtained from
+xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]. Deep links meanwhile can be obtained from
the xref:rgant.adoc#_rgant-DeepLinkService[`@DeepLinkService`].
OIDs can also be converted into XML format, useful for integration scenarios. The
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_framework-provided-services.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_framework-provided-services.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_framework-provided-services.adoc
index b57e68e..f9a6c97 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_framework-provided-services.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_framework-provided-services.adoc
@@ -12,43 +12,43 @@ Some framework domain services are SPI: they exist primarily so that the applica
General purpose:
-* xref:rgsvc.adoc#_rgsvc-api_DomainObjectContainer[`DomainObjectContainer`]
-* xref:rgsvc.adoc#_rgsvc-api_ClockService[`ClockService`]
-* xref:rgsvc.adoc#_rgsvc-api_IsisJdoSupport[`IsisJdoSupport`]
-* xref:rgsvc.adoc#_rgsvc-api_WrapperFactory[`WrapperFactory`]
-* xref:rgsvc.adoc#_rgsvc-api_EventBusService[`EventBusService`]
-* xref:rgsvc.adoc#_rgsvc-api_EmailService[`EmailService`]
+* xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer[`DomainObjectContainer`]
+* xref:rgsvc.adoc#_rgsvc_api_ClockService[`ClockService`]
+* xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`]
+* xref:rgsvc.adoc#_rgsvc_api_WrapperFactory[`WrapperFactory`]
+* xref:rgsvc.adoc#_rgsvc_api_EventBusService[`EventBusService`]
+* xref:rgsvc.adoc#_rgsvc_api_EmailService[`EmailService`]
Commands/Background/Auditing:
-* xref:rgsvc.adoc#_rgsvc-api_CommandContext[`CommandContext`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-spi_CommandService[`CommandService`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-spi_AuditingService[`AuditingService`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-api_BackgroundService[`BackgroundService`]
-* xref:rgsvc.adoc#_rgsvc-spi_BackgroundCommandService[`BackgroundCommandService`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-spi_PublishingService[`PublishingService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_api_CommandContext[`CommandContext`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`]
+* xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`] (SPI)
Information Sharing:
-* xref:rgsvc.adoc#_rgsvc-api_Scratchpad[`Scratchpad`]
-* xref:rgsvc.adoc#_rgsvc-api_ActionInvocationContext[`ActionInvocationContext`]
-* xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`QueryResultsCache`]
+* xref:rgsvc.adoc#_rgsvc_api_Scratchpad[`Scratchpad`]
+* xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`ActionInvocationContext`]
+* xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`QueryResultsCache`]
UserManagement:
-* xref:rgsvc.adoc#_rgsvc-spi_UserProfileService[`UserProfileService`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-spi_UserRegistrationService[`UserRegistrationService`] (SPI)
-* xref:rgsvc.adoc#_rgsvc-spi_EmailNotificationService[`EmailNotificationService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_UserProfileService[`UserProfileService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`UserRegistrationService`] (SPI)
+* xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`EmailNotificationService`] (SPI)
Bookmarks and Mementos:
-* xref:rgsvc.adoc#_rgsvc-api_BookmarkService[`BookmarkService`]
-* xref:rgsvc.adoc#_rgsvc-api_MementoService[`MementoService`]
-* xref:rgsvc.adoc#_rgsvc-api_DeepLinkService[`DeepLinkService`]
-* xref:rgsvc.adoc#_rgsvc-api_XmlSnapshotService[`XmlSnapshotService`]
+* xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]
+* xref:rgsvc.adoc#_rgsvc_api_MementoService[`MementoService`]
+* xref:rgsvc.adoc#_rgsvc_api_DeepLinkService[`DeepLinkService`]
+* xref:rgsvc.adoc#_rgsvc_api_XmlSnapshotService[`XmlSnapshotService`]
-A full list of services can be found in the xref:rgsvc.adoc#_rgsvc-api[Domain Services (API)] and xref:rgsvc.adoc#_rgsvc-spi[Domain Services (SPI)] chapters of the reference guide.
+A full list of services can be found in the xref:rgsvc.adoc#_rgsvc_api[Domain Services (API)] and xref:rgsvc.adoc#_rgsvc_spi[Domain Services (SPI)] chapters of the reference guide.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_other-deployment-options.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_other-deployment-options.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_other-deployment-options.adoc
index 6d25950..cdcaf06 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_other-deployment-options.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_core-concepts_other-deployment-options.adoc
@@ -41,7 +41,7 @@ Once you've sketched out your domain model, you can then "start-over" using your
The programming model defined by Apache Isis deliberately minimizes the dependencies on the rest of the framework. In fact, the only hard dependency that the domain model classes have on Apache Isis is through the `org.apache.isis.applib` classes, mostly to pick up annotations such as `@Disabled`.
So, if you have used Apache Isis for prototyping (discussed above), then note that it's quite feasible to take your domain model a the basis of your actual development effort; Apache Isis' annotations and programming conventions will help ensure that any subtle semantics you might have captured in your prototyping are not lost.
-If you go this route, your deployment platform will of course need to provide similar capabilities to Apache Isis. In particular, you'll need to figure out a way to inject domain services into domain entities (eg using a JPA listener), and you'll also need to reimplement any domain services you have used that Apache Isis provides "out-of-the-box" (eg xref:rgsvc.adoc#_rgsvc-api_QueryResultsCache[`QueryResultsCache`] domain service).
+If you go this route, your deployment platform will of course need to provide similar capabilities to Apache Isis. In particular, you'll need to figure out a way to inject domain services into domain entities (eg using a JPA listener), and you'll also need to reimplement any domain services you have used that Apache Isis provides "out-of-the-box" (eg xref:rgsvc.adoc#_rgsvc_api_QueryResultsCache[`QueryResultsCache`] domain service).
[05/12] isis git commit: ISIS-1243: fixing naming of the domain
service API and SPI docs, also fix to asciidoc template.
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BookmarkService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BookmarkService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BookmarkService.adoc
new file mode 100644
index 0000000..8f506b1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BookmarkService.adoc
@@ -0,0 +1,116 @@
+[[_rgsvc_api_BookmarkService]]
+= `BookmarkService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `BookmarkService` provides the ability to obtain a serializable `o.a.i.applib.bookmarks.Bookmark` for any (persisted) domain object, and to lookup domain objects given a `Bookmark`. This can then in turn be converted to and from a string.
+
+For example, a `Customer` object with:
+
+* an object type of "custmgmt.Customer" (as per xref:rgant.adoc#_rgant-DomainObject_objectType[`DomainObject#objectType()`] or equivalent) , and
+* an id=123
+
+could correspond to a `Bookmark` with a string representation of `custmgmt.Customer|123`.
+
+[NOTE]
+====
+A `Bookmark` is little more than an API equivalent of Apache Isis' internal `Oid` (object identifier). Nevertheless, the ability to uniquely address _any_ domain object within an Apache Isis system -- to in effect provide a URN -- is immensely useful.
+
+For example, a `Bookmark` could be converted into a barcode, and then this used for automated scanning of correspondence from a customer.
+====
+
+``Bookmark``s are used by several other domain services as a means of storing areference to an arbitrary object (a polymorphic relationship). For example, the (non-ASF) http://github.com/isisaddons/isis-module-auditing[Isis addons' auditing] module's implementation of xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`] uses bookmarks to capture the object that is being audited.
+
+[TIP]
+====
+One downside of using ``Bookmark``s is that there is no way for the JDO/DataNucleus objectstore to enforce any kind of referental integrity. However, the (non-ASF) http://github.com/isisaddons/isis-module-poly[Isis addons' poly] module describes and supports a design pattern to address this requirement.
+====
+
+
+
+
+== API & Implementation
+
+The API defined by `BookmarkService` is:
+
+[source,java]
+----
+public interface BookmarkService {
+ @Programmatic
+ Object lookup(BookmarkHolder bookmarkHolder);
+ @Programmatic
+ Object lookup(Bookmark bookmark);
+ @Programmatic
+ <T> T lookup(Bookmark bookmark, Class<T> cls); // <1>
+ @Programmatic
+ Bookmark bookmarkFor(Object domainObject);
+ @Programmatic
+ Bookmark bookmarkFor(Class<?> cls, String identifier);
+}
+----
+<1> same as `lookup(Bookmark bookmark)`, but downcasts to the specified type.
+
+
+The core framework provides a default implementation of this API, namely `o.a.i.core.metamodel.services.bookmarks.BookmarkServiceDefault`
+
+
+== `BookmarkHolder`
+
+The `BookmarkHolder` interface is intended to be implemented by domain objects that use a `Bookmark` to reference a (single) domain object; an example might be a class such as the audit entry, mentioned above. The interface is simply:
+
+
+[source,java]
+----
+public interface BookmarkHolder {
+ @Programmatic
+ Bookmark bookmark();
+}
+
+----
+
+There are two services that will contribute to this interface:
+
+* `BookmarkHolderActionContributions` will provide a `lookup(...)` action
+* `BookmarkHolderAssociationContributions` provides an `object` property.
+
+Either of these can be suppressed, if required, using a vetoing subscriber. For example, to suppress the `object` property (so that only the `lookup(...)` action is ever shown for implementations of `BookmarkHolder`, define:
+
+[source,java]
+----
+@DomainObject
+public class AlwaysHideBookmarkHolderAssociationsObjectProperty {
+ @Subscribe
+ public void on(BookmarkHolderAssociationContributions.ObjectDomainEvent ev) {
+ ev.hide();
+ }
+}
+----
+
+A more sophisticated implementation could look inside the passed `ev` argument and selectively hide or not based on the contributee.
+
+
+
+
+== Usage by other services
+
+Bookmarks are used by the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's implementation of xref:rgsvc.adoc#_rgsvc_api_BackgroundCommandService[`BackgroundCommandService`], which uses a bookmark to capture the target object on which an action will be invoked subsequently.
+
+Bookmarks are also used by the (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module's implementation of xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`], and by the (non-ASF) http://github.com/isisaddons/isis-module-auditing[Isis addons' auditing] module's implementation of xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`].
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `BookmarkService` is automatically registered (it is annotated with `@DomainService`) so no further
+configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BulkInteractionContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BulkInteractionContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BulkInteractionContext.adoc
new file mode 100644
index 0000000..fdb3e5e
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_BulkInteractionContext.adoc
@@ -0,0 +1,9 @@
+[[_rgsvc_api_BulkInteractionContext]]
+= `BulkInteractionContext`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+This service is deprecated, replaced by xref:rgsvc.adoc#_rgsvc_api_ActionInvocationContext[`ActionInvocationContext`].
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ClockService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ClockService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ClockService.adoc
new file mode 100644
index 0000000..86f9914
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_ClockService.adoc
@@ -0,0 +1,101 @@
+[[_rgsvc_api_ClockService]]
+= `ClockService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+Most applications deal with dates and times in one way or another. For example, if an `Order` is placed, then the `Customer` may have 30 days to pay the `Invoice`, otherwise a penalty may be levied.
+
+However, such date/time related functionality can quickly complicate automated testing: "today+30" will be a different value every time the test is run.
+
+Even disregarding testing, there may be a requirement to ensure that date/times are obtained from an NNTP server (rather than the system PC). While instantiating a `java.util.Date` to current the current time is painless enough, we would not want complex technical logic for querying an NNTP server spread around domain logic code.
+
+Therefore it's common to provide a domain service whose responsibility is to provide the current time. This service can be injected into any domain object (and can be mocked out for unit testing). Apache Isis provides such a facade through the `ClockService`.
+
+
+
+== API & Implementation
+
+The API defined by `ClockService` is:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+public class ClockService {
+ @Programmatic
+ public LocalDate now() { ... }
+ @Programmatic
+ public LocalDateTime nowAsLocalDateTime() { ... }
+ @Programmatic
+ public DateTime nowAsDateTime() { ... }
+ @Programmatic
+ public Timestamp nowAsJavaSqlTimestamp() { ... }
+ @Programmatic
+ public long nowAsMillis() { ... }
+}
+----
+
+This class (`o.a.i.applib.services.clock.ClockService`) is also the default implementation. The time provided by this default implementation is based on the system clock.
+
+
+
+
+== Testing Support
+
+The default `ClockService` implementation in fact simply delegates to another class defined in the API, namely the `o.a.i.applib.clock.Clock`, an abstract singleton class. It is not recommended that your code use the `Clock` directly, but you should understand how this all works:
+
+* there are two subclasses implementations `Clock`, namely `SystemClock` and `FixtureClock`.
+* the first implementation that is instantiated registers itself as the singleton.
+* if running in xref:rgcfg.adoc#_rgcfg_deployment-types[production] (server) mode, then (unless another implementation has beaten it to the punch) the framework will instantiate the ``SystemClock`. Once instantiated this cannot be replaced.
+* if running in xref:rgcfg.adoc#_rgcfg_deployment-types[prototype] mode, then the framework will instead instantiate `FixtureClock`. This _can_ be replaced if required.
+
+The `FixtureClock` will behave as the system clock, unless its is explicitly set using `FixtureClock#setDate(...)` or `FixtureClock#setTime(...)` and so forth.
+
+
+
+=== Alternative Implementations
+
+Suppose you want (as discussed in the introduction to this service) to use a clock that delegates to NNTP. For most domain services this would amount to implementing the appropriate service and registering in `isis.properties` so that it is used in preference to any implementations provided by default by the framework.
+
+In the case of the `ClockService`, though, this approach (unfortunately) will not work, because parts of Apache Isis (still) delegate to the `Clock` singleton rather than using the `ClockService` domain service.
+
+The workaround, therefore, is to implement your functionality as a subclass of `Clock`. You can write a domain service that will ensure that your implementation is used ahead of any implementations provided by the framework.
+
+For example:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class NntpClockServiceInitializer {
+ @Programmatic
+ @PostConstruct
+ public void postConstruct(Map<String,String> properties) {
+ new NntpClock(properties); // <1>
+ }
+ private static class NntpClock extends Clock {
+ NntpClock(Map<String,String> properties) { ... } // <2>
+ protected long time() { ... } // <3>
+ ... NNTP stuff here ...
+ }
+ }
+}
+----
+<1> enough to simply instantiate the `Clock`; it will register itself as singleton
+<2> connect to NNTP service using configuration properties from `isis.properties`
+<3> call to NNTP service here
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `ClockService` is automatically registered (it is annotated with `@DomainService`) so no further
+configuration is required.
+
+If you want to use a different implementation of `Clock`, eg delegating to NNTP, then do _not_ register directly, but
+instead subclass from `o.a.i.applib.clock.Clock` singleton (as described in the section above).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_CommandContext.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_CommandContext.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_CommandContext.adoc
new file mode 100644
index 0000000..54a257a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_CommandContext.adoc
@@ -0,0 +1,216 @@
+[[_rgsvc_api_CommandContext]]
+= `CommandContext`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `CommandContext` service is a xref:rgant.adoc#_rgant-RequestScoped[request-scoped] service that reifies the invocation of an action on a domain object into an object itself. This reified information is encapsulated within the `Command` object.
+
+By default, the `Command` is held in-memory only; once the action invocation has completed, the `Command` object is gone. The optional
+ supporting xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] enables the implementation of `Command` to be pluggable. With an appropriate implementation (eg as provided by the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`]) the `Command` may then be persisted.
+
+Persistent ``Command``s support several use cases:
+
+* they enable profiling of the running application (which actions are invoked then most often, what is their response time)
+* they act as a parent to any background commands that might be invoked through the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`]
+* if xref:rgsvc.adoc#_rgsvc_spi_AuditingService[`AuditingService`] is configured, they provide better audit information, since the `Command` (the 'cause' of an action) can be correlated to the audit records (the "effect" of the action) through the unique `transactionId` GUID
+* if xref:rgsvc.adoc#_rgsvc_spi_PublishingService[`PublishingService`] is configured, they provide better traceability as the `Command` is also correlated with any published events, again through the unique `transactionId` GUID
+
+Assuming that the `CommandService` supports persistent `Command`s, the associated xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation also allows action invocations to be performed in the background. In this case the act of invoking the action on an object instead returns the `Command` to the user.
+
+
+
+[[_rgsvc_api_CommandContext_screencast]]
+== Screencast
+
+
+The screencast provides a run-through of the command (profiling) service, auditing service, publishing service. It also shows how commands can be run in the background either explicitly by scheduling through the background service or implicitly by way of a framework annotation.
+
+video::tqXUZkPB3EI[youtube,width="640px",height="360px"]
+
+[NOTE]
+====
+Note that this screencast shows an earlier version of the xref:ugvw.adoc#[Wicket viewer] UI (specifically, pre 1.8.0).
+====
+
+
+
+
+== API & Implementation
+
+The `CommandContext` request-scoped service defines the following very simple API:
+
+[source,java]
+----
+@RequestScoped
+public class CommandContext {
+ @Programmatic
+ public Command getCommand() { ... }
+}
+----
+
+This class (`o.a.i.applib.services.CommandContext`) is also the default implementation. Under normal circumstances there shouldn't be any need to replace this implementation with another.
+
+The `Command` type referenced above is in fact an interface, defined as:
+
+[source,java]
+----
+public interface Command extends HasTransactionId {
+
+ public abstract String getUser(); // <1>
+ public abstract Timestamp getTimestamp(); // <2>
+
+ public abstract Bookmark getTarget(); // <3>
+ public abstract String getMemberIdentifier(); // <4>
+ public abstract String getTargetClass(); // <5>
+ public abstract String getTargetAction(); // <6>
+ public String getArguments(); // <7>
+ public String getMemento(); // <8>
+
+ public ExecuteIn getExecuteIn(); // <9>
+ public Executor getExecutor(); // <10>
+ public Persistence getPersistence(); // <11>
+ public boolean isPersistHint(); // <12>
+
+ public abstract Timestamp getStartedAt(); // <13>
+ public abstract Timestamp getCompletedAt(); // <14>
+ public Command getParent(); // <15>
+
+ public Bookmark getResult(); // <16>
+ public String getException(); // <17>
+}
+----
+<1> `getUser()` - is the user that initiated the action.
+<2> `getTimestamp()` - the date/time at which this action was created.
+<3> `getTarget()` - bookmark of the target object (entity or service) on which this action was performed
+<4> `getMemberIdentifier()` - holds a string representation of the invoked action
+<5> `getTargetClass()` - a human-friendly description of the class of the target object
+<6> `getTargetAction()` - a human-friendly name of the action invoked on the target object
+<7> `getArguments()` - a human-friendly description of the arguments with which the action was invoked
+<8> `getMemento()` - a formal (XML or similar) specification of the action to invoke/being invoked
+<9> `getExecuteIn()` - whether this command is executed in the foreground or background
+<10> `getExecutor()` - the (current) executor of this command, either user, or background service, or other (eg redirect after post).
+<11> `getPersistence()`- the policy controlling whether this command should ultimately be persisted (either "persisted", "if hinted", or "not persisted")
+<12> `isPersistHint()` - whether that the command should be persisted, if persistence policy is "if hinted".
+<13> `getStartedAt()` - the date/time at which this action started (same as `timestamp` property for foreground commands)
+<14> `getCompletedAt()` - the date/time at which this action completed.
+<15> `getParent()` - for actions created through the `BackgroundService`, captures the parent action
+<16> `getResult()` - bookmark to object returned by action, if any
+<17> `getException()` - exception stack trace if action threw exception
+
+
+
+
+== Usage
+
+The typical way to indicate that an action should be treated as a command is to annotate it with the xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation.
+
+For example:
+
+[source,java]
+----
+public class ToDoItem ... {
+ @Action(command=CommandReification.ENABLED)
+ public ToDoItem completed() { ... }
+}
+----
+
+
+[TIP]
+====
+As an alternative to annotating every action with `@Action#command()`, alternatively this can be configured as the default using `isis.services.command.actions` configuration property.
+
+See xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] and xref:rgcfg.adoc#_rgcfg_configuring-core[runtime configuration] for further details.
+====
+
+
+The xref:rgant.adoc#_rgant-Action_command[`@Action#command()`] annotation can also be used to specify whether the command should be performed in the background, for example:
+
+[source,java]
+----
+public class ToDoItem ... {
+ @Command(executeIn=ExecuteIn.BACKGROUND)
+ public ToDoItem scheduleImplicitly() {
+ completeSlowly(3000);
+ return this;
+ }
+}
+----
+
+When a background command is invoked, the user is returned the command object itself (to provide a handle to the command being invoked).
+
+This requires that an implementation of xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] that persists the commands (such as the (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's `CommandService`) is configured. It also requires that a scheduler is configured to execute the background commands, see xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]).
+
+
+
+== Interacting with the services
+
+Typically the domain objects have little need to interact with the `CommandContext` and `Command` directly; what is more useful is that these are persisted in support of the various use cases identified above.
+
+One case however where a domain object might want to obtain the `Command` is to determine whether it has been invoked in the foreground, or in the background. It can do this using the `getExecutedIn()` method:
+
+Although not often needed, this then allows the domain object to access the `Command` object through the `CommandContext` service. To expand th above example:
+
+
+[source,java]
+----
+public class ToDoItem ... {
+ @Action(
+ command=CommandReification.ENABLED,
+ commandExecuteIn=CommandExecuteIn.BACKGROUND
+ )
+ public ToDoItem completed() {
+ ...
+ Command currentCommand = commandContext.getCommand();
+ ...
+ }
+ @Inject
+ CommandContext commandContext;
+}
+----
+
+
+If run in the background, it might then notify the user (eg by email) if all work is done.
+
+This leads us onto a related point, distinguishing the current effective user vs the originating "real" user. When running in the foreground, the current user can be obtained from the `DomainObjectContainer`, using:
+
+[source,java]
+----
+String user = container.getUser().getName();
+----
+
+If running in the background, however, then the current user will be the credentials of the background process, for example as run by a Quartz scheduler job.
+
+The domain object can still obtain the original ("effective") user that caused the job to be created, using:
+
+[source,java]
+----
+String user = commandContext.getCommand().getUser();
+----
+
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `CommandContext` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+
+
+
+== Related Services
+
+As discussed above, the supporting xref:rgsvc.adoc#_rgsvc_spi_CommandService[`CommandService`] enables `Command` objects to be persisted. Other related services are the xref:rgsvc.adoc#_rgsvc_api_BackgroundService[`BackgroundService`] and xref:rgsvc.adoc#_rgsvc_spi_BackgroundCommandService[`BackgroundCommandService`]). For `BackgroundService` captures commands for execution in the background, while the [BackgroundCommandService] persists such commands for execution.
+
+The implementations of `CommandService` and `BackgroundCommandService` are intended to go together, so that persistent parent `Command`s can be associated with their child background `Command`s.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DeepLinkService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DeepLinkService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DeepLinkService.adoc
new file mode 100644
index 0000000..2dcceb1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DeepLinkService.adoc
@@ -0,0 +1,56 @@
+[[_rgsvc_api_DeepLinkService]]
+= `DeepLinkService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `DeepLinkService` provides the ability to obtain a `java.net.URI` that links to a representation of any (persisted) domain entity or
+view model.
+
+A typical use case is to generate a clickable link for rendering in an email, PDF, tweet or other communication.
+
+
+
+== API & Implementation
+
+The API defined by `DeepLinkService` is:
+
+[source,java]
+----
+public interface DeepLinkService {
+ URI deepLinkFor(Object domainObject); // <1>
+}
+----
+<1> Creates a URI that can be used to obtain a representation of the provided domain object in one of the Apache Isis viewers.
+
+The xref:ugvw.adoc#[Wicket viewer] this provides an implementation for accessing the representation through this viewer. (For the xref:ugvro.adoc#[RestfulObjects viewer], a URL can be constructed according to the link:http://www.restfulobjects.org[Restful Objects spec] in conjunction with a `Bookmark` obtained via the xref:rgsvc.adoc#_rgsvc_api_BookmarkService[`BookmarkService`]).
+
+
+
+== Usage within the framework
+
+The xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`EmailNotificationService`] uses this service in order to generate emails as part of xref:ugvw.adoc#_ugvw_features_user-registration[user registration].
+
+
+
+== Implementations
+
+The Wicket viewer core framework provides a default implementation of this API:
+
+* `org.apache.isis.viewer.wicket.viewer.services.DeepLinkServiceWicket`
+
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]), _and_ that the
+xref:ugvw.adoc#[Wicket viewer] is being used, then an implementation of `DeepLinkService` is
+automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer.adoc
new file mode 100644
index 0000000..26ef7d3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer.adoc
@@ -0,0 +1,40 @@
+[[_rgsvc_api_DomainObjectContainer]]
+= `DomainObjectContainer`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `DomainObjectContainer` service provides a set of general purpose functionality for domain objects to call. Principal amongst these are a generic APIs for querying objects and creating and persisting objects. In addition, the service provides access to security context (the "current user"), allows information and warning messages to be raised, and various other miscellaneous functions.
+
+[NOTE]
+====
+Compared to other services provided by Apache Isis, the `DomainObjectContainer` provides by far the most number of methods, addressing several quite distinct responsibilities. This is a historical accident: in early versions of Apache Isis the `DomainObjectContainer` was the one and only domain service provided by the framework.
+
+In the future we may deprecate this service and break out its responsibilities into a number of small services. However, given how important this service was in days past, we are unlikely to delete it as a service even once it has been deprecated.
+====
+
+The sections below discuss the functions provided by the service, broken out into categories.
+
+
+include::_rgsvc_api_DomainObjectContainer_object-creation-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_generic-repository-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_object-persistence-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_messages-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_security-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_presentation-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_validation-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_properties-api.adoc[leveloffset=+1]
+include::_rgsvc_api_DomainObjectContainer_services-api.adoc[leveloffset=+1]
+
+
+
+
+
+== Registering the Service
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `DomainObjectContainer` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_generic-repository-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_generic-repository-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_generic-repository-api.adoc
new file mode 100644
index 0000000..14f7089
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_generic-repository-api.adoc
@@ -0,0 +1,89 @@
+[[_rgsvc_api_DomainObjectContainer_generic-repository-api]]
+= Generic Repository API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The repository API acts as an abstraction over the JDO/DataNucleus objectstore. You can use it during prototyping to write naive queries (find all rows, then filter using the Guava `Predicate` API, or you can use it to call JDO link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/query.html#named[named queries] using JDOQL.
+
+As an alternative, you could also use link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/jdoql_typesafe.html[JDO typesafe queries] through the xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`] service.
+
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ public <T> List<T> allInstances(Class<T> ofType, long... range); // <1>
+ @Programmatic
+ <T> List<T> allMatches(Query<T> query); // <2>
+ @Programmatic
+ <T> List<T> allMatches(Class<T> ofType, Predicate<? super T> predicate, long... range); // <3>
+ @Programmatic
+ <T> List<T> allMatches(Class<T> ofType, String title, long... range); // <4>
+ @Programmatic
+ <T> List<T> allMatches(Class<T> ofType, T pattern, long... range); // <5>
+ ...
+}
+----
+<1> all persisted instances of specified type. Mostly for prototyping, though can be useful to obtain all instances of domain entities if the number is known to be small. The optional varargs parameters are for paging control; more on this below.
+<2> all persistence instances matching the specified `Query`. Query itself is an Isis abstraction on top of JDO/DataNucleus' Query API. *This is the primary API used for querying*
+<3> all persistenced instances of specified type matching `Predicate`. Only really intended for prototyping because in effect constitutes a client-side WHERE clause
+<4> all persisted instances with the specified string as their title. Only very occasionally used
+<5> all persisted instances matching object (query-by-example). Only very occasionally used
+
+There are various implementations of the `Query` API, but these either duplicate functionality of the other overloads of `allMatches(...)` or they are not supported by the JDO/DataNucleus object store. The only significant implementation of `Query` to be aware of is `QueryDefault`, which identifies a named query and a set of parameter/argument tuples.
+
+For example, in the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] the `ToDoItem` is annotated:
+
+[source,java]
+----
+@javax.jdo.annotations.Queries( {
+ @javax.jdo.annotations.Query(
+ name = "findByAtPathAndComplete", language = "JDOQL", // <1>
+ value = "SELECT "
+ + "FROM todoapp.dom.module.todoitem.ToDoItem "
+ + "WHERE atPath.indexOf(:atPath) == 0 " // <2>
+ + " && complete == :complete"), // <3>
+ ...
+})
+public class ToDoItem ... {
+ ...
+}
+----
+<1> name of the query
+<2> defines the `atPath` parameter
+<3> defines the `complete` parameter
+
+This JDO query definitions are used in the `ToDoItemRepositoryImplUsingJdoql` service:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.DOMAIN)
+public class ToDoItemRepositoryImplUsingJdoql implements ToDoItemRepositoryImpl {
+ @Programmatic
+ public List<ToDoItem> findByAtPathAndCategory(final String atPath, final Category category) {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByAtPathAndCategory", // <1>
+ "atPath", atPath, // <2>
+ "category", category)); // <3>
+ }
+ ...
+ @javax.inject.Inject
+ DomainObjectContainer container;
+}
+----
+<1> corresponds to the "findByAtPathAndCategory" JDO named query
+<2> provide argument for the `atPath` parameter. The pattern is parameter, argument, parameter, argument, ... and so on.
+<3> provide argument for the `category` parameter. The pattern is parameter, argument, parameter, argument, ... and so on.
+
+Other JDOQL named queries (not shown) follow the exact same pattern.
+
+With respect to the other query APIs, the varargs parameters are optional, but allow for (client-side and managed) paging. The first parameter is the `start` (0-based, the second is the `count`.
+
+[TIP]
+====
+It is also possible to query using DataNucleus' type-safe query API. For more details, see xref:rgsvc.adoc#_rgsvc_api_IsisJdoSupport[`IsisJdoSupport`].
+====
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_messages-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_messages-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_messages-api.adoc
new file mode 100644
index 0000000..b3b89b5
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_messages-api.adoc
@@ -0,0 +1,50 @@
+[[_rgsvc_api_DomainObjectContainer_messages-api]]
+= Messages API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `DomainObjectContainer` allows domain objects to raise information, warning or error messages. These messages can either be simple strings, or can be translated.
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ void informUser(String message); // <1>
+ @Programmatic
+ String informUser(TranslatableString message, Class<?> contextClass, String contextMethod); // <2>
+
+ @Programmatic
+ void warnUser(String message); // <3>
+ @Programmatic
+ String warnUser(TranslatableString message, Class<?> contextClass, String contextMethod); // <4>
+
+ @Programmatic
+ void raiseError(String message); // <5>
+ @Programmatic
+ String raiseError(TranslatableString message, Class<?> contextClass, String contextMethod); // <6>
+ ...
+}
+----
+<1> display as a transient message to the user (not requiring acknowledgement). In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast that automatically disappears after a period of time.
+<2> ditto, but with translatable string, for xref:ugbtb.adoc#_ugbtb_more-advanced_i18n[i18n support].
+<3> warn the user about a situation with the specified message. In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast that must be closed by the end-user.
+<4> ditto, but with translatable string, for i18n support.
+<5> show the user an unexpected application error. In the xref:ugvw.adoc#[Wicket viewer] this is implemented as a toast (with a different colour) that must be closed by the end-user.
+<6> ditto, but with translatable string, for i18n support.
+
+
+For example:
+
+[source,java]
+----
+public Order addItem(Product product, @ParameterLayout(named="Quantity) int quantity) {
+ if(productRepository.stockLevel(product) == 0) {
+ container.warnUser(
+ product.getDescription() + " out of stock; order fulfillment may be delayed");
+ }
+ ...
+}
+----
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-creation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-creation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-creation-api.adoc
new file mode 100644
index 0000000..d018631
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-creation-api.adoc
@@ -0,0 +1,49 @@
+[[_rgsvc_api_DomainObjectContainer_object-creation-api]]
+= Object Creation API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The object creation APIs are used to instantiate new domain objects or view models.
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ <T> T newTransientInstance(final Class<T> ofType); // <1>
+ @Programmatic
+ <T> T newViewModelInstance(final Class<T> ofType, final String memento); // <2>
+ @Programmatic
+ <T> T mixin(); // <3>
+ ...
+}
+----
+<1> create a new non-persisted domain entity. Any services will be automatically injected into the service
+<2> create a new view model, with the specified memento (as per xref:rgcms.adoc#_rgcms_classes_super_AbstractViewModel[ViewModel#viewModelMemento()]. In general it is easier to just annotate with xref:rgant.adoc#_rgant-ViewModel[`@ViewModel`] and let Apache Isis manage the memento automatically.
+<3> programmatically instantiate a mixin, as annotated with
+xref:rgant.adoc#_rgant-Mixin[`@Mixin`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature()`].
+
+For example:
+
+[source,java]
+----
+Customer cust = container.newTransientInstance(Customer.class);
+cust.setFirstName("Freddie");
+cust.setLastName("Mercury");
+container.persist(cust);
+----
+
+As an alternative to using `newTransientInstance(...)` or `mixin(...)`, you could also simply `new()` up the object.
+Doing this will not inject any domain services, but they can be injected manually using xref:rg .adoc#_rgsvc_api_DomainObjectContainer_services-api[#injectServicesInto(...)`].
+
+[NOTE]
+====
+Calling `new(...)` also this circumvents Apache Isis' xref:rgcms.adoc#_rgcms_methods_reserved_created[`created()`]
+callback, and in addition any default values for properties (either explicitly set by
+xref:rgcms.adoc#_rgcms_methods_prefixes_default[`default...()`] or defaulted implicitly according to Apache Isis'
+own conventions) will not be called either. If you don't intend to use these features, though, the net effect is code
+that has less coupling to Isis and is arguably easier to understand (has "less magic" happening).
+====
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-persistence-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-persistence-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-persistence-api.adoc
new file mode 100644
index 0000000..9b7f365
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_object-persistence-api.adoc
@@ -0,0 +1,62 @@
+[[_rgsvc_api_DomainObjectContainer_object-persistence-api]]
+= Object Persistence API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+
+The persistence API is used to persist newly created objects (as per xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`#newTransientInstance(...)`], above and to delete (remove) objects that are persistent.
+
+Note that there is no API for updating existing objects; the framework (or rather, JDO/DataNucleus) performs object dirty tracking and so any objects that are modified in the course of a request will be automatically updated).
+
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ boolean isPersistent(Object domainObject); // <1>
+ @Programmatic
+ boolean isViewModel(Object domainObject); // <2>
+
+ @Programmatic
+ void persist(Object domainObject); // <3>
+ @Programmatic
+ void persistIfNotAlready(Object domainObject); // <4>
+
+ @Programmatic
+ void remove(Object persistentDomainObject); // <5>
+ @Programmatic
+ void removeIfNotAlready(Object domainObject); // <6>
+
+ @Programmatic
+ boolean flush(); // <7>
+ ...
+}
+----
+<1> test whether a particular domain object is persistent or not
+<2> test whether a particular domain object is a view model or not. Note that this includes any domain objects annotated with xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=Nature.EXTERNAL_ENTITY)`] or xref:rgant.adoc#_rgant-DomainObject_nature[`@DomainObject#nature=Nature.INMEMORY_ENTITY`]
+<3> persist a transient object. Note though that this will throw an exception if the object is already persistent; this can happen if JDO/DataNucleus's link:http://www.datanucleus.org/products/accessplatform_4_0/jdo/orm/cascading.html[persistence-by-reachability] is in effect. For this reason it is generally better to use:
+<4> persist an object but only if know to not have been persistent. But if the object is persistent, is a no-op
+<5> remove (ie DELETE) a persistent object. For similar reasons to the persistence, it is generally better to use:
+<6> remove (ie DELETE) an object only if known to be persistent. But if the object has already been deleted, then is a no-op.
+<7> flushes all pending changes to the objectstore. Explained further below.
+
+For example:
+
+[source,java]
+----
+Customer cust = container.newTransientInstance(Customer.class);
+cust.setFirstName("Freddie");
+cust.setLastName("Mercury");
+container.persistIfNotAlready(cust);
+----
+
+You should be aware that by default Apache Isis queues up calls to `#persist()` and `#remove()`. These are then executed either when the request completes (and the transaction commits), or if the queue is flushed. This can be done either implicitly by the framework, or as the result of a direct call to `#flush()`.
+
+By default the framework itself will cause `#flush()` to be called whenever a query is executed by way of `#allMatches(Query)`, as documented xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_generic-repository-api[above]. However, this behaviour can be disabled using the xref:rgcfg.adoc#_rgcfg_configuring-core[configuration property] `isis.services.container.disableAutoFlush`.
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_presentation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_presentation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_presentation-api.adoc
new file mode 100644
index 0000000..496c2ca
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_presentation-api.adoc
@@ -0,0 +1,46 @@
+[[_rgsvc_api_DomainObjectContainer_presentation-api]]
+= Presentation API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+A responsibility of every domain object is to return a title. This can be done declaratively using the xref:rgant.adoc#_rgant-Title[`@Title`] annotation on property/ies, or it can be done imperatively by writing a xref:rgcms.adoc#_rgcms_methods_reserved_title[`title()`] method.
+
+It's quite common for titles to be built up of the titles of other objects. If using building up the title using `@Title` then Apache Isis will automatically use the title of the objects referenced by the annotated properties. We also need programmatic access to these titles if going the imperative route.
+
+Similarly, it often makes sense if xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_messages-api[raising messages] to use the title of an object in a message rather (than a some other property of the object), because this is how end-users will be used to identifying the object.
+
+The API defined by `DomainObjectContainer` is simply:
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ String titleOf(Object domainObject); // <1>
+ ...
+}
+----
+<1> return the title of the object, as rendered in the UI by the Apache Isis viewers.
+
+
+By way of example, here's some code from the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp] showing the use of the API in an message:
+
+[source,java]
+----
+ public List<ToDoItem> delete() {
+ final String title = container.titleOf(this); // <1>
+ ...
+ container.removeIfNotAlready(this);
+ container.informUser(
+ TranslatableString.tr(
+ "Deleted {title}", "title", title), // <2>
+ this.getClass(), "delete");
+ ...
+ }
+
+----
+<1> the title is obtained first, because we're not allowed to reference object after it's been deleted
+<2> use the title in an i18n `TranslatableString`
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_properties-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_properties-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_properties-api.adoc
new file mode 100644
index 0000000..dc6b925
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_properties-api.adoc
@@ -0,0 +1,54 @@
+[[_rgsvc_api_DomainObjectContainer_properties-api]]
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+
+= Properties API
+
+The properties API allows domain objects to read the configuration properties aggregated from the various xref:rgcfg.adoc#_rgcfg_configuration-files[configuration files].
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ String getProperty(String name); // <1>
+ @Programmatic
+ String getProperty(String name, String defaultValue); // <2>
+ @Programmatic
+ List<String> getPropertyNames(); // <3>
+}
+----
+<1> Return the configuration property with the specified name; else return null.
+<2> Return the configuration property with the specified name; if it doesn't exist then return the specified default value.
+<3> Return the names of all the available properties.
+
+For example, here's a fictitious service that might wrap link:http://twitter4j.org/en/configuration.html[Twitter4J]. say:
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class TweetService {
+ @Programmatic
+ @PostConstruct
+ public void init() {
+ this.oauthConsumerKey = container.getProperty("tweetservice.oauth.consumerKey");
+ this.oauthConsumerSecret = container.getProperty("tweetservice.oauth.consumerSecret");
+ this.oauthAccessToken = container.getProperty("tweetservice.oauth.accessToken");
+ this.oauthAccessTokenSecret = container.getProperty("tweetservice.oauth.accessTokenSecret");
+ }
+ ...
+ @Inject
+ DomainObjectContainer container;
+}
+----
+
+[TIP]
+====
+If you _do_ have a domain service that needs to access properties, then note that an alternative is to define a xref:rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] method and pass in a `Map<String,String>` of properties. The two techniques are almost identical; it's mostly a matter of taste.
+====
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_security-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_security-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_security-api.adoc
new file mode 100644
index 0000000..7c3bb59
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_security-api.adoc
@@ -0,0 +1,48 @@
+[[_rgsvc_api_DomainObjectContainer_security-api]]
+= Security API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The security API allows the domain object to obtain the identity of the user interacting with said object.
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ UserMemento getUser();
+ ...
+}
+----
+
+where in turn (the essence of) `UserMemento` is:
+
+[source,java]
+----
+public final class UserMemento {
+ public String getName() { ... }
+ public boolean isCurrentUser(final String userName) { ... }
+
+ public List<RoleMemento> getRoles() { ... }
+ public boolean hasRole(final RoleMemento role) { ... }
+ public boolean hasRole(final String roleName) { ... }
+ ...
+}
+----
+
+and `RoleMemento` is simpler still:
+
+[source,java]
+----
+public final class RoleMemento {
+ public String getName() { ... }
+ public String getDescription() { ... }
+ ...
+}
+----
+
+The roles associated with the `UserMemento` will be based on the configured xref:ugsec.adoc#[security] (typically Shiro).
+
+In addition, when using the xref:ugvw.adoc#[Wicket viewer] there will be an additional "org.apache.isis.viewer.wicket.roles.USER" role; this is used internally to restrict access to web pages without authenticating.
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_services-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_services-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_services-api.adoc
new file mode 100644
index 0000000..d25ab0a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_services-api.adoc
@@ -0,0 +1,37 @@
+[[_rgsvc_api_DomainObjectContainer_services-api]]
+= Services API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The services API allows your domain objects to programmatically inject services into arbitrary objects, as well as to look up services by type:
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ <T> T injectServicesInto(final T domainObject); // <1>
+ @Programmatic
+ <T> T lookupService(Class<T> service); // <2>
+ @Programmatic
+ <T> Iterable<T> lookupServices(Class<T> service); // <3>
+ ...
+}
+----
+<1> injects services into domain object; used extensively internally by the framework (eg to inject to other services, or to entities, or integration test instances, or fixture scripts). Service injection is done automatically if objects are created using `#newTransientInstance()`, described xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[above]
+<2> returns the first registered service that implements the specified class
+<3> returns an `Iterable` in order to iterate over all registered services that implement the specified class
+
+The primary use case is to instantiate domain objects using a regular constructor ("new is the new new") rather than using the xref:rgsvc.adoc#_rgsvc_api_DomainObjectContainer_object-creation-api[`#newTransientInstance()`] API, and then using the `#injectServicesInto(...)` API to set up any dependencies.
+
+For example:
+
+[source,java]
+----
+Customer cust = container.injectServicesInto( new Customer());
+cust.setFirstName("Freddie");
+cust.setLastName("Mercury");
+container.persist(cust);
+----
+
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_validation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_validation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_validation-api.adoc
new file mode 100644
index 0000000..40d31c7
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_DomainObjectContainer_validation-api.adoc
@@ -0,0 +1,26 @@
+[[_rgsvc_api_DomainObjectContainer_validation-api]]
+= Validation API
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The validation API allows a domain object to programmatically validate itself or any other domain object. Specifically, this means the validating the current state of all properties, as well as any object-level validation defined by xref:rgcms.adoc#_rgcms_methods_reserved_validate[`validate()`].
+
+The API provided is:
+
+[source,java]
+----
+public interface DomainObjectContainer {
+ @Programmatic
+ boolean isValid(Object domainObject);
+ @Programmatic
+ String validate(Object domainObject);
+ ...
+}
+----
+
+If an object is changed by editing its properties, then (using the xref:ugvw.adoc#[Wicket viewer] at least) Apache Isis will check that the state of the object is valid. There is currently however no equivalent guarantee for actions.
+
+The intent of this API was (originally at least) to provide a fallback whereby actions could at least be able to perform this validation programmatically (eg in their own xref:rgcms.adoc#_rgcms_methods_prefixes_validate[`validate...()`] or xref:rgcms.adoc#_rgcms_methods_prefixes_disable[`disable...()`] methods. However, this feature should be considered experimental; your mileage may vary.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/46825ce1/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EmailService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EmailService.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EmailService.adoc
new file mode 100644
index 0000000..f427437
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgsvc_api_EmailService.adoc
@@ -0,0 +1,95 @@
+[[_rgsvc_api_EmailService]]
+= `EmailService`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `EmailService` provides the ability to send HTML emails, with attachments, to one or more recipients.
+
+Apache Isis provides a default implementation to send emails using an external SMTP provider. Note that this must be configured (using a number of configuration properties) before it can be used. The that sends email as an HTML message, using an external SMTP provider.
+
+
+
+== API & Implementation
+
+The API for the service is:
+
+[source,java]
+----
+public interface EmailService {
+ @Programmatic
+ boolean send( // <1>
+ List<String> to, List<String> cc, List<String> bcc, // <2>
+ String subject,
+ String body, // <3>
+ DataSource... attachments);
+ @Programmatic
+ boolean isConfigured(); // <4>
+ }
+----
+<1> is the main API to send the email (and optional attachments). Will return `false` if failed to send
+<2> pass either `null` or `Collections.emptyList()` if not required
+<3> should be HTML text
+<4> indicates whether the implementation was configured and initialized correctly. If this returns `false` then any attempt to call `send(...)` will fail.
+
+As noted in the introduction, the core framework provides a default implementation (`EmailServiceDefault`) that sends email as an HTML message, using an external SMTP provider.
+
+
+
+== Configuration
+
+To use this service the following properties must be configured:
+
+* `isis.service.email.sender.address`
+* `isis.service.email.sender.password`
+
+and these properties may optionally be configured (each has a default to use gmail, documented xref:rgcfg.adoc#_rgcfg_configuring-core[here]):
+
+* `isis.service.email.sender.hostname`
+* `isis.service.email.port`
+* `isis.service.email.tls.enabled`
+
+These configuration properties can be specified either in `isis.properties` or in an xref:ugbtb.adoc#_ugbtb_deployment_externalized-configuration[external configuration file].
+
+If prototyping (that is, running the app using `org.apache.isis.WebServer`), the configuration properties can also be specified as system properties. For example, if you create a test email account on gmail, you can configure the service using:
+
+[source,ini]
+----
+-Disis.service.email.sender.address=xxx@gmail.com -Disis.service.email.sender.password=yyy
+----
+
+where "xxx" is the gmail user account and "yyy" is its password
+
+
+
+
+== Alternative Implementations
+
+If you wish to write an alternative implementation, be aware that it should process the message body as HTML (as opposed to plain text or any other format).
+
+Also, note that (unlike most Apache Isis domain services) the implementation is also instantiated and injected by Google Guice. This is because `EmailService` is used as part of the xref:ugvw.adoc#_ugvw_features_user-registration[user registration] functionality and is used by Wicket pages that are accessed outside of the usual Apache Isis runtime. This implies a couple of additional constraints:
+
+* first, implementation class should also be annotated with `@com.google.inject.Singleton`
+* second, there may not be any Apache Isis session running. (If necessary, one can be created on the fly using `IsisContext.doInSession(...)`)
+
+To ensure that your alternative implementation takes the place of the default implementation, register it explicitly in `isis.properties`.
+
+
+
+== Registering the Services
+
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
+`AppManifest` to xref:rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
+implementation of `EmailService` service is automatically registered and injected (it is annotated with
+`@DomainService`) so no further configuration is required.
+
+To use an alternative implementation, use
+xref:rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
+further in this xref:ugfun.adoc#_ugfun_how-tos_replacing-default-service-implementations["how to"] tip).
+
+
+== Related Services
+
+The email service is used by the xref:rgsvc.adoc#_rgsvc_spi_EmailNotificationService[`EmailNotificationService`] which is, in turn, used by xref:rgsvc.adoc#_rgsvc_spi_UserRegistrationService[`UserRegistrationService`].
\ No newline at end of file