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 2014/02/12 18:08:27 UTC
svn commit: r1567686 - in /isis/site/trunk/content: ./
components/objectstores/jdo/non-ui/ components/objectstores/jdo/services/
reference/non-ui/ reference/services/
Author: danhaywood
Date: Wed Feb 12 17:08:26 2014
New Revision: 1567686
URL: http://svn.apache.org/r1567686
Log:
fixing links
Added:
isis/site/trunk/content/components/objectstores/jdo/non-ui/
isis/site/trunk/content/components/objectstores/jdo/non-ui/about.md
isis/site/trunk/content/components/objectstores/jdo/non-ui/background-command-execution-jdo.md
Modified:
isis/site/trunk/content/components/objectstores/jdo/services/background-command-service-jdo.md
isis/site/trunk/content/documentation.md
isis/site/trunk/content/reference/non-ui/background-command-execution.md
isis/site/trunk/content/reference/services/xmlsnapshot-service.md
Added: isis/site/trunk/content/components/objectstores/jdo/non-ui/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/non-ui/about.md?rev=1567686&view=auto
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/non-ui/about.md (added)
+++ isis/site/trunk/content/components/objectstores/jdo/non-ui/about.md Wed Feb 12 17:08:26 2014
@@ -0,0 +1,3 @@
+Title: DataNucleus (JDO) Object Store Non-UI Support Classes
+
+go back to: [documentation](../../../../documentation.html)
Added: isis/site/trunk/content/components/objectstores/jdo/non-ui/background-command-execution-jdo.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/non-ui/background-command-execution-jdo.md?rev=1567686&view=auto
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/non-ui/background-command-execution-jdo.md (added)
+++ isis/site/trunk/content/components/objectstores/jdo/non-ui/background-command-execution-jdo.md Wed Feb 12 17:08:26 2014
@@ -0,0 +1,20 @@
+Title: BackgroundCommandExecutionFromBackgroundCommandServiceJdo (1.4.0-snapshot)
+
+The `BackgroundCommandExecutionFromBackgroundCommandServiceJdo` is a concrete subclass of [BackgroundCommandExecution](../../../../reference/non-ui/background-command-execution.html). The intended use is for the class to be instantiated regularly (eg every 10 seconds) by a scheduler such as [Quartz](http://quartz.org)) to poll for `Command`s to be executed, and then execute them. As you might imagine, this implementation queries for `Command`s persisted by the JDO implementations of [CommandService](../services/command-service-jdo.html) and [BackgroundCommandService](../services/background-command-service.html), using the `BackgroundCommandServiceJdoRepository`.
+
+The diagram below shows how the inheritance hierarchy for this class:
+
+![](http://yuml.me/363b335f)
+
+
+#### neat!
+The diagrams on this page were created using [yuml.me](http://yuml.me).
+
+DSL ([edit](http://yuml.me/edit/363b335f)):
+
+ [AbstractIsisSessionTemplate|#doExecute()]^-[BackgroundCommandExecution|#findBackgroundCommandsToExecute()]
+ [BackgroundCommandExecution]^-[BackgroundCommandExecutionFromBackgroundCommandServiceJdo]
+ [BackgroundCommandExecutionFromBackgroundCommandServiceJdo]->injected[BackgroundCommandServiceJdoRepository|findBackgroundCommandsNotYetStarted()]
+
+
+
Modified: isis/site/trunk/content/components/objectstores/jdo/services/background-command-service-jdo.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/services/background-command-service-jdo.md?rev=1567686&r1=1567685&r2=1567686&view=diff
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/services/background-command-service-jdo.md (original)
+++ isis/site/trunk/content/components/objectstores/jdo/services/background-command-service-jdo.md Wed Feb 12 17:08:26 2014
@@ -9,7 +9,7 @@ There are two further services that can
### Executing the `Command`s
-The `BackgroundCommandServiceJdo` only persists the `Command`s to a database table, it doesn't actually execute those commands. For this, you can use `BackgroundCommandExecutionFromBackgroundCommandServiceJdo` class, a subclass implementation of [BackgroundCommandExecution](). The intention is that this class is instantiated regularly (eg every 10 seconds) by a scheduler such as [Quartz](http://quartz.org)) to poll for `Command`s to be executed, and then execute them. As you might imagine, to find new `Ccommand`s it uses the `BackgroundCommandServiceJdoRepository`.
+The `BackgroundCommandServiceJdo` only persists the `Command`s to a database table, it doesn't actually execute those commands. For this, you can use [BackgroundCommandExecutionFromBackgroundCommandServiceJdo](../non-ui/background-command-execution-jdo.html) class, a subclass implementation of [BackgroundCommandExecution](../../../../reference/non-ui/background-command-execution.html). The intention is that this class is instantiated regularly (eg every 10 seconds) by a scheduler such as [Quartz](http://quartz.org)) to poll for `Command`s to be executed, and then execute them. As you might imagine, to find new `Ccommand`s it uses the `BackgroundCommandServiceJdoRepository`.
An example of how to configure the Quartz scheduler can be found on the page that describes the applib [BackgroundService](../../../../reference/services/background-service.html).
Modified: isis/site/trunk/content/documentation.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1567686&r1=1567685&r2=1567686&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Wed Feb 12 17:08:26 2014
@@ -483,6 +483,10 @@ For both:
* [Publishing Service on JDO](components/objectstores/jdo/services/publishing-service-jdo.html)
* [Auditing Service on JDO](components/objectstores/jdo/services/auditing-service-jdo.html)
+#### Non-UI
+
+* [Background Command Execution](components/objectstores/jdo/non-ui/background-command-execution-jdo.html)
+
}
Modified: isis/site/trunk/content/reference/non-ui/background-command-execution.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/reference/non-ui/background-command-execution.md?rev=1567686&r1=1567685&r2=1567686&view=diff
==============================================================================
--- isis/site/trunk/content/reference/non-ui/background-command-execution.md (original)
+++ isis/site/trunk/content/reference/non-ui/background-command-execution.md Wed Feb 12 17:08:26 2014
@@ -11,29 +11,23 @@ where:
* `findBackgroundCommandsToExecute()` is a mandatory hook method for subclasses to implement.
-This allows for different implementations of the `CommandService` and `BackgroundCommandService` to persist to wherever.
+This allows for different implementations of the `CommandService` and `BackgroundCommandService` to persist to wherever.
-![](http://yuml.me/25343da1)
+The diagram below shows the dependencies between these various classes:
+![](http://yuml.me/25343da1)
-## Related Classes (JDO implementation)
-The JDO object store provides its own (concrete) subclass, `BackgroundCommandExecutionFromBackgroundCommandServiceJdo` that queries for persisted `Command`s (created either through [CommandServiceJdo](../../components/objectstores/jdo/services/command-service-jdo.html) or through [BackgroundCommandServiceJdo](../../components/objectstores/jdo/services/background-command-service-jdo.html)), using the corresponding repository:
+## Related Classes
-![](http://yuml.me/363b335f)
+The JDO object store provides its own (concrete) subclass, [BackgroundCommandExecutionFromBackgroundCommandServiceJdo](../../components/objectstores/jdo/non-ui/background-command-execution-jdo.html) that queries for persisted `Command`s (created either through [CommandServiceJdo](../../components/objectstores/jdo/services/command-service-jdo.html) or through [BackgroundCommandServiceJdo](../../components/objectstores/jdo/services/background-command-service-jdo.html)), using the corresponding repository.
#### neat!
-The diagrams on this page were created using [yuml.me](http://yuml.me).
+The diagram on this page were created using [yuml.me](http://yuml.me).
DSL ([edit](http://yuml.me/edit/25343da1)):
[AbstractIsisSessionTemplate|#doExecute()]^-[BackgroundCommandExecution|#findBackgroundCommandsToExecute()]
[BackgroundCommandExecution]->injected[BookmarkService|lookup()]
[BackgroundCommandExecution]->injected[CommandContext|setCommand()]
-
-DSL ([edit](http://yuml.me/edit/363b335f)):
-
- [AbstractIsisSessionTemplate|#doExecute()]^-[BackgroundCommandExecution|#findBackgroundCommandsToExecute()]
- [BackgroundCommandExecution]^-[BackgroundCommandExecutionFromBackgroundCommandServiceJdo]
- [BackgroundCommandExecutionFromBackgroundCommandServiceJdo]->injected[BackgroundCommandServiceJdoRepository|findBackgroundCommandsNotYetStarted()]
Modified: isis/site/trunk/content/reference/services/xmlsnapshot-service.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/reference/services/xmlsnapshot-service.md?rev=1567686&r1=1567685&r2=1567686&view=diff
==============================================================================
--- isis/site/trunk/content/reference/services/xmlsnapshot-service.md (original)
+++ isis/site/trunk/content/reference/services/xmlsnapshot-service.md Wed Feb 12 17:08:26 2014
@@ -2,8 +2,9 @@ Title: XML Snapshot Service [1.4.0-SNAPS
The *Apache Isis* framework provides the capability to generate XML snapshots (and if required corresponding XSD schemas) based on graphs of domain objects.
-### API
+## API
+The API of `XmlSnapshotService` is:
public interface XmlSnapshotService {
@@ -46,27 +47,58 @@ where:
* `getChildTextValue()` is a convenience method to obtain value of child text node.
-### Usage
+## Usage
-> TO DOCUMENT
+### Simple Usage
-### Usage (Deprecated)
+The simplest usage is:
-This is done using the
-`org.apache.isis.core.runtime.snapshot.XmlSnapshot` class.
+ XmlSnapshot snapshot = xmlsnapshotService.snapshotFor(customer);
+ Element customerAsXml = snapshot.getXmlElement();
-#### Generating an XML Snapshot
+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.
-The `XmlSnapshot` can be created either directly or using a builder.
+### Including other Elements
-#### Basic Usage
+The contents of the snapshot can be adjusted by including "paths" to other references or collections.
-The standard usage is to instantiate directly.
+For example, suppose 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 snapshot:
- XmlSnapshot snapshot = new XmlSnapshot(customer);
+ XmlSnapshot snapshot = xmlsnapshotService.snapshotFor(customer);
+ ...
+ snapshot.include("address");
+ ...
Element customerAsXml = snapshot.getXmlElement();
-This will return the Customer's fields, titles of simple references, number of items in collections.
+Or, we could go further and include details of every order in the customer's `orders` collection, and details of every
+product of every order:
+
+ ...
+ snapshot.include("orders/product"); // (2)
+ ...
+
+> As you might imagine, the resultant XML document can get quite large very quickly with only a few "include"s.
+
+
+### Using the Builder (fluent API)
+
+An alternative way to build customized snapshots is to use the builder (fluent) API:
+
+ XmlSnapshot.Builder builder = xmlsnapshotService.builderFor(customer)
+ .includePath("address")
+ .includePath("orders/product");
+ Element customerAsXml = builder.build().getXmlElement();
+
+
+#### Generating an XML Snapshot
+
+The `XmlSnapshot` can be created either directly or using a builder.
+
+#### Basic Usage
+
In order to use the `XmlSnapshot`, the domain object must implement `org.apache.isis.applib.snapshot.Snapshottable`. This is just a marker interface.