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/05/13 01:29:56 UTC

[1/2] isis git commit: ISIS-1133: more adocs (documentation/config folder)

Repository: isis
Updated Branches:
  refs/heads/master 4d596c391 -> b4dc32c72


http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_metamodel-service.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_metamodel-service.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_metamodel-service.adoc
new file mode 100644
index 0000000..4582520
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_metamodel-service.adoc
@@ -0,0 +1,8 @@
+= Metamodel Service
+: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/
+
+IMPORTANT: TODO
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translation-service.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translation-service.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translation-service.adoc
new file mode 100644
index 0000000..dc365c6
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translation-service.adoc
@@ -0,0 +1,8 @@
+= Translation Service
+: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/
+
+IMPORTANT: TODO
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translations-resolver.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translations-resolver.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translations-resolver.adoc
new file mode 100644
index 0000000..c9ca4bd
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_translations-resolver.adoc
@@ -0,0 +1,8 @@
+= Translations Resolver
+: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/
+
+IMPORTANT: TODO
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_runtime-configuration_configuring-core.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_runtime-configuration_configuring-core.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_runtime-configuration_configuring-core.adoc
index 774404d..8f16943 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_runtime-configuration_configuring-core.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_runtime-configuration_configuring-core.adoc
@@ -28,6 +28,12 @@ IMPORTANT: WIP...
 | `true`,`false` (`_false_`)
 |Whether the `DomainObjectContainer` should automatically flush pending changes prior to querying (via `allMatches()`, `firstMatch()` and so on).
 
+|`isis.services.` +
+`translation.po.mode`
+| `read`,`write`
+|Whether to force the `TranslationService` into either read or write mode. +
+See <<_i18n, i18n support>> to learn more about the translation service.
+
 |`isis.persistor.` +
 `disableConcurrencyChecking`
 | `true`,`false` (`_false_`)
@@ -36,12 +42,49 @@ IMPORTANT: WIP...
 |`isis.reflector.facet.` +
 `cssClassFa.patterns`
 |regex:fa-icon,regex2:fa-icon2,...
-|Comma separated list of key:value pairs, where the key is a regex matching action names (eg `create.*`) and the value is a link:fortawesome.github.io/Font-Awesome/icons/[font-awesome] icon name (eg `fa-plus`) to be applied (as per `@CssClassFa()`) to all action members matching the regex.
+|Comma separated list of key:value pairs, where the key is a regex matching action names (eg `create.*`) and the value is a link:fortawesome.github.io/Font-Awesome/icons/[font-awesome] icon name (eg `fa-plus`) to be applied (as per `@CssClassFa()`) to all action members matching the regex. +
+See <<_user-guide_how-tos_ui-hints_action-icons-and-css, UI hints>> for more details.
 
 |`isis.reflector.facet.` +
 `cssClass.patterns`
 |regex:css1,regex2:css2,...
-|Comma separated list of key:value pairs, where the key is a regex matching action names (eg `delete.*`) and the value is a link:http://getbootstrap.com/css/[Bootstrap] CSS button class (eg `btn-warning) to be applied (as per `@CssClass()`) to all action members matching the regex.
+|Comma separated list of key:value pairs, where the key is a regex matching action names (eg `delete.*`) and the value is a link:http://getbootstrap.com/css/[Bootstrap] CSS button class (eg `btn-warning) to be applied (as per `@CssClass()`) to all action members matching the regex. +
+See <<_user-guide_how-tos_ui-hints_action-icons-and-css, UI hints>> for more details.
+
+|`isis.reflector.facets`
+|`FQCN`
+|Fully qualified class names of a custom implementation of `ProgrammingModel` interface.
+See <<_finetuning, finetuning the programming model>> for more details.
+
+|`isis.reflector.facets.` +
+`include`
+|`FQCN`,`FQCN2`,...
+|Fully qualified class names of (new, custom) facet factory classes to be included to the programming model. +
+See <<_finetuning, finetuning the programming model>> for more details.
+
+|`isis.reflector.facets.` +
+`exclude`
+|`FQCN`,`FQCN2`,...
+|Fully qualified class names of (existing, built-in) facet factory classes to be included to the programming model. +
+See <<_finetuning, finetuning the programming model>> for more details.
+
+|`isis.reflector.validator`
+|`FQCN`
+|Custom implementation of `MetaModelValidator` (in the `org.apache.isis.core.metamodel.specloader.validator` package) +
+See <<_custom_validator, Custom Validator>> to learn more.
+
+|`isis.reflector.validator.` +
+`allowDeprecated`
+| `true`,`false` (`_true_`)
+| Whether deprecated annotations or naming conventions are tolerated or not.  If not, then a metamodel validation error will be triggered, meaning the app won't boot (fail-fast).
+
+|`isis.reflector.` +
+`layoutMetadataReaders`
+|`FQCN`,`FQCN2`,...
+|Fully qualified class names of classes to be instantiated to read layout metadata, as used in for <<_dynamic_object_layout, dynamic layout>>s. +
+See <<_layout_metadata_reader, Layout Metadata Reader>> for more information.
 
 |===
 
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/template/document.html.erb
----------------------------------------------------------------------
diff --git a/adocs/template/document.html.erb b/adocs/template/document.html.erb
index 0fa92cb..fb0b880 100644
--- a/adocs/template/document.html.erb
+++ b/adocs/template/document.html.erb
@@ -111,6 +111,10 @@
           position: relative;
         }
 
+        *:not(pre) a > code {
+            color: #210DDC;
+        }
+
         *:not(pre) > code {
             background-color: inherit;
             border: none;

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/validator/MyMetaModelValidator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/validator/MyMetaModelValidator.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/validator/MyMetaModelValidator.java
new file mode 100644
index 0000000..660a188
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/validator/MyMetaModelValidator.java
@@ -0,0 +1,27 @@
+/*
+ *  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.core.metamodel.specloader.validator;
+
+public class MyMetaModelValidator extends MetaModelValidatorComposite {
+
+    public MyMetaModelValidator() {
+        add(new MetaModelValidatorVisiting(new MyVisitor()));
+    }
+}


[2/2] isis git commit: ISIS-1133: more adocs (documentation/config folder)

Posted by da...@apache.org.
ISIS-1133: more adocs (documentation/config folder)


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/b4dc32c7
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/b4dc32c7
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/b4dc32c7

Branch: refs/heads/master
Commit: b4dc32c72566c7c310014b156cbc04c119e101f9
Parents: 4d596c3
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed May 13 00:29:39 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed May 13 00:29:39 2015 +0100

----------------------------------------------------------------------
 ...amodel-finetuning-the-programming-model.adoc |  81 +++++
 .../user-guide/_/writing-a-custom-theme.adoc    |  32 --
 .../_user-guide_appendices_dev-env.adoc         |   2 +
 ...de_appendices_dev-env_isis-maven-plugin.adoc |   8 +
 ..._user-guide_extending_programming-model.adoc |   9 +-
 ...ding_programming-model_custom-validator.adoc | 106 ++++++
 ..._extending_programming-model_finetuning.adoc |  79 ++++
 ...rogramming-model_layout-metadata-reader.adoc |  43 +++
 .../_user-guide_extending_wicket-viewer.adoc    | 266 +-------------
 ...ng_wicket-viewer_custom-bootstrap-theme.adoc |  33 ++
 ...de_extending_wicket-viewer_custom-pages.adoc |  82 +++++
 ...ng_wicket-viewer_isis-addons-extensions.adoc |  16 +
 ...g_wicket-viewer_replacing-page-elements.adoc | 159 ++++++++
 .../_user-guide_more-advanced_i18n.adoc         | 359 ++++++++++++++++++-
 .../_user-guide_reference_domain-services.adoc  |  13 +-
 ...domain-services_content-mapping-service.adoc |   8 +
 ...in-services_content-negotiation-service.adoc |   8 +
 ...ference_domain-services_locale-provider.adoc |   8 +
 ...rence_domain-services_metamodel-service.adoc |   8 +
 ...nce_domain-services_translation-service.adoc |   8 +
 ...e_domain-services_translations-resolver.adoc |   8 +
 ..._runtime-configuration_configuring-core.adoc |  47 ++-
 adocs/template/document.html.erb                |   4 +
 .../validator/MyMetaModelValidator.java         |  27 ++
 24 files changed, 1110 insertions(+), 304 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_/metamodel-finetuning-the-programming-model.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_/metamodel-finetuning-the-programming-model.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_/metamodel-finetuning-the-programming-model.adoc
new file mode 100644
index 0000000..b40fe1c
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_/metamodel-finetuning-the-programming-model.adoc
@@ -0,0 +1,81 @@
+Title: Fine-tuning the Programming Model
+
+== Core MetaModel
+
+The core metamodel defines APIs and implementations for building the Isis metamodel: a description of the set of entities, domain services and values that make up the domain model.
+
+The description of each domain class consists of a number of elements:
+
+* https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java[ObjectSpecification]
+
+Analogous to `java.lang.Class`; holds information about the class itself and holds collections of each of the three types of class' members (below);
+
+* https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java[OneToOneAssociation]
+
+Represents a class member that is a single-valued property of the class. The property's type is either a reference to another entity, or is a value type.
+
+* https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToManyAssociation.java[OneToManyAssociation]
+
+Represents a class member that is a collection of references to other entities. Note that Isis does not currently support collections of values.
+
+* https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java[ObjectAction]
+
+Represents a class member that is an operation that can be performed on the action. Returns either a single value, a collection of entities, or is `void`.
+
+The metamodel is built up through the https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/progmodel/ProgrammingModel.java[ProgrammingModel], which defines an API for registering a set of https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java[FacetFactory]s. Two special `FacetFactory` implementations - https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/accessor/PropertyAccessorFacetViaAccessorFactory.java[PropertyAccessorFacetFactory] and https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessorFactory.java[CollectionAccessorFacetFactory] - are used to identify the class members. Pretty much all the other `FacetFactory`s are responsible for installing https://github.com/apache/isis/blob/
 master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/Facet.java[Facet]s onto the metamodel elements. There are many many such `Facet`s, and are used to do such things get values from properties or collections, modify properties or collections, invoke action, hide or disable class members, provide UI hints for class members, and so on. In short, the `FacetFactory`s registered defines the Isis programming conventions.
+
+== Modifying the Programming Model
+
+The default implementation of `ProgrammingModel` is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java[ProgrammingModelFacetsJava5], which registers a large number of `FacetFactory`s. 
+
+By editing `isis.properties` you can modify the programming conventions either by (a) using the default programming model, but tweaking it to include new `FacetFactory`s or exclude existing, or (b) by specifying a completely different programming model implementation.
+
+Let's see how this is done.
+
+=== Fine-tuning the existing programming model
+
+Suppose that you wanted to completely remove support for the (already deprecated) `@ActionOrder` annotation. This would be done using:
+
+[source]
+----
+isis.reflector.facets.exclude=org.apache.isis.core.metamodel.facets.object.actionorder.annotation.ActionOrderFacetAnnotationFactory
+----
+
+Or, suppose you wanted to use the example https://github.com/apache/isis/blob/master/mothballed/misc/metamodel/namefile/src/main/java/org/apache/isis/example/metamodel/namefile/facets/NameFileFacetFactory.java["namefile"] `FacetFactory` as part of your programming conventions, use:
+
+[source]
+----
+isis.reflector.facets.include=org.apache.isis.example.metamodel.namefile.facets.NameFileFacetFactory
+----
+
+To include/exclude more than one `FacetFactory`, specify as a comma-separated list. And if you want to dig into this in more detail, the code that implements this logic is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java[JavaReflectorInstallerNoDecorators].
+
+=== Example
+
+This http://isis.markmail.org/thread/472c3mrvcgnripst[thread] from the users mailing list (in Apr 2014) shows a typical customization (to enable per-instance security).
+
+== Specifying a different LayoutMetadataReader
+
+While all facets can be specified using annotations, the facets that provide hints for the user interface can also be specified from a corresponding `.layout.json` file, described in more detail link:../components/viewers/wicket/dynamic-layouts.html[here]. It is the role of a `LayoutMetadataReader` to read/parse such a file and create the appropriate facets.
+
+In the case of the `.layout.json` file, the implementation used in `LayoutMetadataReaderFromJson`. This is also the default implementation. However, an alternative implementation can be specified using:
+
+[source]
+----
+isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
+----
+
+As of 1.8.0 there is only one implementation provided, but we anticipate other implementations in future releases.
+
+== Specifying a new programming model
+
+To specify a completely new programming model, you'll first need an implementation of `ProgrammingModel`. One option is to subclass from `ProgammingModelFacetsJava5`; in your subclass you could remove any `FacetFactory`s that you wanted to exclude, as well as registering your own implementations.
+
+To tell Isis to use your new programming model, use (something like):
+
+[source]
+----
+isis.reflector.facets=com.mycompany.myapp.isis.IsisProgrammingModel
+----
+
+Again, the code that implements this logic is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java[JavaReflectorInstallerNoDecorators].
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_/writing-a-custom-theme.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_/writing-a-custom-theme.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_/writing-a-custom-theme.adoc
deleted file mode 100644
index df5cc03..0000000
--- a/adocs/documentation/src/main/asciidoc/user-guide/_/writing-a-custom-theme.adoc
+++ /dev/null
@@ -1,32 +0,0 @@
-Title: Writing a Custom Theme (1.8.0)
-
-The Isis Wicket viewer uses http://getbootstrap.com/[Bootstrap] styles and components (courtesy of the
-https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap] integration).
-
-By default the viewer uses the default bootstrap theme. As described link:showing-a-theme-chooser.html[here], it is
-possible to allow the user to select other themes provided by http://bootswatch.com[bootswatch.com], and if required
-one of these can be link:specifying-a-default-theme.html[set as the default].
-
-However, you may instead want to write your own custom theme, for example to fit your company's look-n-feel/interface
-guidelines. This is done by implementing https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap]’s
-`de.agilecoders.wicket.core.settings.ITheme` class. This defines: 
-
-* the name of the theme
-* the resources it needs (the CSS and optional JS and/or fonts), and
-* optional urls to load them from a Content Delivery Network (CDN).
-
-To make use of the custom `ITheme` the application should register it by adding the following snippet in
-(your application's subclass of) `IsisWicketApplication`:
-
-[source]
-----
-public void init() {
-
-    ...
-    IBootstrapSettings settings = new BootstrapSettings();
-    ThemeProvider themeProvider = new SingleThemeProvider(new MyTheme());
-    settings.setThemeProvider(themeProvider);
-
-    Bootstrap.install(getClass(), settings);
-}
-----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env.adoc
index f0add1a..63dd9d9 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env.adoc
@@ -10,3 +10,5 @@ include::_user-guide_appendices_dev-env_cmd-line.adoc[leveloffset=+1]
 include::_user-guide_appendices_dev-env_intellij.adoc[leveloffset=+1]
 
 include::_user-guide_appendices_dev-env_eclipse.adoc[leveloffset=+1]
+
+include::_user-guide_appendices_dev-env_isis-maven-plugin.adoc[leveloffset=+1]

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env_isis-maven-plugin.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env_isis-maven-plugin.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env_isis-maven-plugin.adoc
new file mode 100644
index 0000000..d56f37d
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_appendices_dev-env_isis-maven-plugin.adoc
@@ -0,0 +1,8 @@
+= Isis Maven Plugin
+: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/
+:toc: right
+
+IMPORTANT: TODO
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model.adoc
index 1250a72..bd1e959 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model.adoc
@@ -3,13 +3,10 @@
 :_basedir: ../
 :_imagesdir: images/
 
-IMPORTANT: TODO
 
-== Disallowing deprecated annotations
+include::_user-guide_extending_programming-model_custom-validator.adoc[leveloffset=+1]
 
-== Custom validator
+include::_user-guide_extending_programming-model_finetuning.adoc[leveloffset=+1]
 
-== Finetuning the Programming Model
-
-== Layout metadata reader
+include::_user-guide_extending_programming-model_layout-metadata-reader.adoc[leveloffset=+1]
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_custom-validator.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_custom-validator.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_custom-validator.adoc
new file mode 100644
index 0000000..3ee496d
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_custom-validator.adoc
@@ -0,0 +1,106 @@
+= Custom validator
+: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' programming model includes a validator component that detects and prevents (by failing fast) a number of situations where the domain model is logically inconsistent with itself.
+
+For example, the validator will detect any orphaned supporting methods (eg `hideXxx()`) if the corresponding property or action has been renamed or deleted but the supporting method was not also updated.  Another example is that a class cannot have a title specified both using `title()` method and also using `@Title` annotation.
+
+[NOTE]
+====
+The support for <<Disallowing deprecated annotations>> is also implemented using the metamodel validator.
+====
+
+You can also impose your own application-specific rules by installing your own metamodel validator.  To give just one example, you could impose naming standards such as ensuring that a domain-specific abbreviation such as "ISBN" is always consistently capitalized wherever it appears in a class member.
+
+[TIP]
+====
+Isis' <<_isis_maven_plugin, Maven plugin>> will also validate the domain object model during build time.
+====
+
+
+== API and Implementation
+
+There are several ways to go about implementing a validator.
+
+=== `MetaModelValidator`
+
+Any custom validator must implement Isis' internal `MetaModelValidator` interface, so the simplest option is just to implement `MetaModelValidator` directly:
+
+
+[source,java]
+----
+public interface MetaModelValidator
+        implements SpecificationLoaderSpiAware { // <1>
+    public void validate(
+        ValidationFailures validationFailures);  // <2>
+}
+----
+<1> the `SpecificationLoader` is the internal API providing access to the Isis metamodel.
+<2> add any metamodel violations to the `ValidationFailures` parameter (the link:http://c2.com/cgi/wiki?CollectingParameter[collecting parameter] pattern)
+
+
+=== `Visitor`
+
+More often than not, you'll want to visit every element in the metamodel, and so for this you can instead subclass from `MetaModelValidatorVisiting.Visitor`:
+
+[source,java]
+----
+public final class MetaModelValidatorVisiting ... {
+    public static interface Visitor {
+        public boolean visit(                       // <1>
+            ObjectSpecification objectSpec,         // <2>
+            ValidationFailures validationFailures); // <3>
+    }
+    ...
+}
+----
+<1> return `true` continue visiting specs.
+<2> `ObjectSpecification` is the internal API representing a class
+<3> add any metamodel violations to the `ValidationFailures` parameter
+
+
+You can then create your custom validator by subclassing `MetaModelValidatorComposite` and adding the visiting validator:
+
+[source,java]
+----
+public class MyMetaModelValidator extends MetaModelValidatorComposite {
+    public MyMetaModelValidator() {
+        add(new MetaModelValidatorVisiting(new MyVisitor()));
+    }
+}
+----
+
+If you have more than one rule then each can live in its own visitor.
+
+=== `SummarizingVisitor`
+
+As a slight refinement, you can also subclass from `MetaModelValidatorVisiting.SummarizingVisitor`:
+
+[source,java]
+----
+public final class MetaModelValidatorVisiting ... {
+    public static interface SummarizingVisitor extends Visitor {
+        public void summarize(ValidationFailures validationFailures);
+    }
+    ...
+}
+----
+
+A `SummarizingVisitor` will be called once after every element in the metamodel has been visited.  This is great for performing checks on the metamodel as a whole.  For example, Isis uses this to check that there is at least one `@Persistable` domain entity defined.
+
+
+
+
+== Configuration
+
+Once you have implemented your validator, you must register it with the framework by defining the appropriate configuration property:
+
+[source,ini]
+----
+isis.reflector.validator=com.mycompany.myapp.MyMetaModelValidator
+----
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_finetuning.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_finetuning.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_finetuning.adoc
new file mode 100644
index 0000000..3030665
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_finetuning.adoc
@@ -0,0 +1,79 @@
+= Finetuning
+: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 core metamodel defines APIs and implementations for building the Isis metamodel: a description of the set of entities, domain services and values that make up the domain model.
+
+
+The description of each domain class consists of a number of elements:
+
+https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java[ObjectSpecification]::
+Analogous to `java.lang.Class`; holds information about the class itself and holds collections of each of the three types of class' members (below);
+
+https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java[OneToOneAssociation]::
+Represents a class member that is a single-valued property of the class. The property's type is either a reference to another entity, or is a value type.
+
+https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToManyAssociation.java[OneToManyAssociation]::
+Represents a class member that is a collection of references to other entities. Note that Isis does not currently support collections of values.
+
+https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java[ObjectAction]::
+Represents a class member that is an operation that can be performed on the action. Returns either a single value, a collection of entities, or is `void`.
+
+
+The metamodel is built up through the https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/progmodel/ProgrammingModel.java[ProgrammingModel], which defines an API for registering a set of https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetFactory.java[FacetFactory]s.  Two special `FacetFactory` implementations - https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/accessor/PropertyAccessorFacetViaAccessorFactory.java[PropertyAccessorFacetFactory] and https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessorFactory.java[CollectionAccessorFacetFactory] - are used to identify the class members.
+Pretty much all the other ``FacetFactory``s are responsible for installing https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/Facet.java[Facet]s onto the metamodel elements.
+
+There are many many such ``Facet``s, and are used to do such things get values from properties or collections, modify properties or collections, invoke action, hide or disable class members, provide UI hints for class members, and so on. In short, the ``FacetFactory``s registered defines the Isis programming conventions.
+
+
+
+== Modifying the Programming Model
+
+The default implementation of `ProgrammingModel` is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java[ProgrammingModelFacetsJava5], which registers a large number of ``FacetFactory``s.
+
+By editing `isis.properties` you can modify the programming conventions either by (a) using the default programming model, but tweaking it to include new `FacetFactory`s or exclude existing, or (b) by specifying a completely different programming model implementation.
+
+Let's see how this is done.
+
+=== Fine-tuning the existing programming model
+
+Suppose that you wanted to completely remove support for the (already deprecated) `@ActionOrder` annotation. This would be done using:
+
+[source,ini]
+----
+isis.reflector.facets.exclude=org.apache.isis.core.metamodel.facets.object.actionorder.annotation.ActionOrderFacetAnnotationFactory
+----
+
+Or, suppose you wanted to use the example https://github.com/apache/isis/blob/master/mothballed/misc/metamodel/namefile/src/main/java/org/apache/isis/example/metamodel/namefile/facets/NameFileFacetFactory.java["namefile"] `FacetFactory` as part of your programming conventions, use:
+
+[source,ini]
+----
+isis.reflector.facets.include=org.apache.isis.example.metamodel.namefile.facets.NameFileFacetFactory
+----
+
+To include/exclude more than one `FacetFactory`, specify as a comma-separated list. And if you want to dig into this in more detail, the code that implements this logic is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java[JavaReflectorInstallerNoDecorators].
+
+[TIP]
+====
+This http://isis.markmail.org/thread/472c3mrvcgnripst[thread] from the users mailing list (in Apr 2014) shows a typical customization (to enable per-instance security) (though note that <<_multi_tenancy, Multi-Tenancy>> is now a better solution to that particular use-case.
+====
+
+
+
+
+== Specifying a new programming model
+
+If you want to make many changes to the programming model, then (rather than include/exclude lots of facet factories) you can specify a completely new programming model.  For this you'll first need an implementation of ``ProgrammingModel``.
+
+One option is to subclass from `ProgammingModelFacetsJava5`; in your subclass you could remove any ``FacetFactory``s that you wanted to exclude, as well as registering your own implementations.
+
+To tell Isis to use your new programming model, use:
+
+[source,ini]
+----
+isis.reflector.facets=com.mycompany.myapp.isis.IsisProgrammingModel
+----
+
+Again, the code that implements this logic is https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java[JavaReflectorInstallerNoDecorators].
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_layout-metadata-reader.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_layout-metadata-reader.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_layout-metadata-reader.adoc
new file mode 100644
index 0000000..b431d78
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_programming-model_layout-metadata-reader.adoc
@@ -0,0 +1,43 @@
+= Layout Metadata Reader
+: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 metadata for domain objects is obtained both <<_static_object_layout, statically>> and <<_dynamic_object_layout, dynamically>>.
+
+The default implementation for reading dynamic layout metadata is `org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson`, which is responsible for reading from the `Xxx.layout.json` files on the classpath (for each domain entity `Xxx`).
+
+You can also implement your own metadata readers and plug them into Isis.  These could read from a different file format, or they could, even, read data dynamically from a URL or database.  (Indeed, one could imagine an implementation whereby users could share layouts, all stored in some central repository).
+
+
+
+== API and Implementation
+
+Any reader must implement Isis' internal `LayoutMetadataReader` interface:
+
+[source,java]
+----
+public interface LayoutMetadataReader {
+    public Properties asProperties(Class<?> domainClass) throws ReaderException;
+}
+----
+
+The implementation "simply" returns a set of properties where the property key is a unique identifier to both the class member and also the facet of the class member to which the metadata relates.
+
+See the implementation of the built-in `LayoutMetadataReaderFromJson` for more detail.
+
+
+
+== Configuration
+
+Once you have implemented your validator, you must register it with the framework by defining the appropriate configuration property:
+
+[source,ini]
+----
+isis.reflector.layoutMetadataReaders=\
+           com.mycompany.myapp.MyMetaModelValidator,\
+           org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson   # <1>
+----
+<1> the property replaces any existing metadata readers; if you want to preserve the ability to read from `Xxx.layout.json` then also register Isis' built-in implementation.
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer.adoc
index 67d4b88..71f49e3 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer.adoc
@@ -15,269 +15,11 @@ The Wicket viewer allows you to customize the GUI in several (progressively more
 The first two of these options are discussed in the <<Wicket Viewer>> chapter.  This chapter describes the remaining "heavier-weight/more powerful" options.
 
 
+include::_user-guide_extending_wicket-viewer_custom-bootstrap-theme.adoc[leveloffset=+1]
 
+include::_user-guide_extending_wicket-viewer_replacing-page-elements.adoc[leveloffset=+1]
 
-== Custom Bootstrap theme
-
-The Isis Wicket viewer uses http://getbootstrap.com/[Bootstrap] styles and components (courtesy of the https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap] integration).
-
-By default the viewer uses the default bootstrap theme. It is possible to configure the Wicket viewer to allow the user to <<_showing_a_theme_chooser, select other themes>> provided by http://bootswatch.com[bootswatch.com], and if required one of these can be <<_specifying_a_default_theme, set as the default>>.
-
-However, you may instead want to write your own custom theme, for example to fit your company's look-n-feel/interface guidelines. This is done by implementing https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap]’s `de.agilecoders.wicket.core.settings.ITheme` class. This defines:
-
-* the name of the theme
-* the resources it needs (the CSS and optional JS and/or fonts), and
-* optional urls to load them from a Content Delivery Network (CDN).
-
-To make use of the custom `ITheme` the application should register it by adding the following snippet in
-(your application's subclass of) `IsisWicketApplication`:
-
-[source,java]
-----
-public void init() {
-    ...
-    IBootstrapSettings settings = new BootstrapSettings();
-    ThemeProvider themeProvider = new SingleThemeProvider(new MyTheme());
-    settings.setThemeProvider(themeProvider);
-    Bootstrap.install(getClass(), settings);
-}
-----
-
-
-
-== Replacing page elements
-
-Replacing elements of the page is the most powerful general-purpose way to customize the look-n-feel of the viewer.  Examples at http://www.isisaddons.org[Isis Add-ons] include the link:isisaddons/isis-wicket-gmap3.html[gmap3], link:isisaddons/isis-wicket-fullcalendar2.html[calendar], link:isisaddons/isis-wicket-excel.html[excel download] and link:isisaddons/isis-wicket-wickedcharts.html[charting] integrations.
-
-The pages generated by Isis' Wicket viewer are built up of numerous elements, from fine-grained widgets for property/parameter fields, to much larger components that take responsibility for rendering an entire entity entity, or a collection of entities. Under the covers these are all implementations of the the Apache Wicket `Component` API. The larger components delegate to the smaller, of course.
-
-=== How the Wicket viewer selects components
-
-Components are created using Isis' `ComponentFactory` interface, which are registered in turn through the `ComponentFactoryRegistrar` interface. Every component is categorizes by type (the `ComponentType` enum), and Isis uses this to determine which `ComponentFactory` to use. For example, the `ComponentType.BOOKMARKED_PAGES` is used to locate the `ComponentFactory` that will build the bookmarked pages panel.
-
-Each factory is also handed a model (an implementation of `org.apache.wicket.IModel`) appropriate to its `ComponentType`; this holds the data to be rendered. For example, `ComponentType.BOOKMARKED_PAGES` is given a `BookmarkedPagesModel`, while `ComponentType.SCALAR_NAME_AND_VALUE` factories are provided a model of type of type `ScalarModel` .
-
-In some cases there are several factories for a given `ComponentType`; this is most notably the case for `ComponentType.SCALAR_NAME_AND_VALUE`. After doing a first pass selection of candidate factories by `ComponentType`, each factory is then asked if it `appliesTo(Model)`. This is an opportunity for the factory to check the model itself to see if the data within it is of the appropriate type.
-
-Thus, the `BooleanPanelFactory` checks that the `ScalarModel` holds a boolean, while the `JodaLocalDatePanelFactory` checks to see if it holds `org.joda.time.LocalDate`.
-
-There will typically be only one `ComponentFactory` capable of rendering a particular `ComponentType`/`ScalarModel` combination; at any rate, the framework stops as soon as one is found.
-
-[NOTE]
-====
-There is one refinement to the above algorithm where multiple component factories might be used to render an object; this is discussed in <<Additional Views of Collections>>, below.
-====
-
-
-=== How to replace a component
-
-This design (the http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern[chain of responsibility] design pattern) makes it quite straightforward to change the rendering of any element of the page. For example, you might switch out Isis' sliding bookmark panel and replace it with one that presents the bookmarks in some different fashion.
-
-First, you need to write a `ComponentFactory` and corresponding `Component`. The recommended approach is to start with the source of the `Component` you want to switch out. For example:
-
-[source,java]
-----
-public class MyBookmarkedPagesPanelFactory extends ComponentFactoryAbstract {
-    public MyBookmarkedPagesPanelFactory() {
-        super(ComponentType.BOOKMARKED_PAGES);
-    }
-    @Override
-    public ApplicationAdvice appliesTo(final IModel<?> model) {
-        return appliesIf(model instanceof BookmarkedPagesModel);
-    }
-    @Override
-    public Component createComponent(final String id, final IModel<?> model) {
-        final BookmarkedPagesModel bookmarkedPagesModel = (BookmarkedPagesModel) model;
-        return new MyBookmarkedPagesPanel(id, bookmarkedPagesModel);
-    }
-}
-----
-
-and
-
-[source,java]
-----
-public class MyBookmarkedPagesPanel
-    extends PanelAbstract<BookmarkedPagesModel> {
-   ...
-}
-----
-
-Here `PanelAbstract` ultimately inherits from `org.apache.wicket.Component`.
-Your new `Component` uses the information in the provided model (eg `BookmarkedPagesModel`) to know what to render.
-
-Next, you will require a custom implementation of the `ComponentFactoryRegistrar` that registers your custom `ComponentFactory` as a replacement:
-
-[source,java]
-----
-@Singleton
-public class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
-    @Override
-    public void addComponentFactories(ComponentFactoryList componentFactories) {
-        super.addComponentFactories(componentFactories);
-        componentFactories.add(new MyBookmarkedPagesPanelFactory());
-    }
-}
-----
-
-This will result in the new component being used instead of (that is, discovered prior to) Isis' default implementation.
-
-[WARNING]
-====
-Previously we suggested using "replace" rather than "add"; however this has unclear semantics for some component types; see https://issues.apache.org/jira/browse/ISIS-996[ISIS-996].
-====
-
-
-Finally (as for other customizations), you need to adjust the Guice bindings in your custom subclass of `IsisWicketApplication`:
-
-[source,java]
-----
-public class MyAppApplication extends IsisWicketApplication {
-    @Override
-    protected Module newIsisWicketModule() {
-        final Module isisDefaults = super.newIsisWicketModule();
-        final Module myAppOverrides = new AbstractModule() {
-            @Override
-            protected void configure() {
-                ...
-                bind(ComponentFactoryRegistrar.class)
-                    .to(MyComponentFactoryRegistrar.class);
-                ...
-            }
-        };
-
-        return Modules.override(isisDefaults).with(myAppOverrides);
-    }
-}
-----
-
-=== Additional Views of Collections
-
-As explained above, in most cases Isis' Wicket viewer will search for the first `ComponentFactory` that can render an element, and use it. In the case of (either standalone or parented) collections, though, Isis will show all available views.
-
-For example, out-of-the-box Isis provides a table view, a summary view (totals/sums/averages of any data), and a collapsed view (for `@Render(LAZILY)` collections). These are selected by clicking on the toolbar by each collection.
-
-Additional views though could render the objects in the collection as a variety of ways. Indeed, some third-party implementations already exist:
-
-* https://github.com/isisaddons/isis-wicket-excel[excel integration] (collection as a downloadable excel spreadsheet)
-* https://github.com/isisaddons/isis-wicket-gmap3[google maps v3 integration] (render any objects with a location on a map)
-* https://github.com/isisaddons/isis-wicket-wickedcharts[wicked charts integration] (barchart of any data)
-* https://github.com/isisaddons/isis-wicket-fullcalendar2[full calendar integration] (render any objects with date properties on a calendar)
-
-Registering these custom views is just a matter of adding the appropriate Maven module to the classpath. Isis uses the JDK `ServiceLoader` API to automatically discover and register the `ComponentFactory` of each such component.
-
-If you want to write your own alternative component and auto-register, then include a file `META-INF/services/org.apache.isis.viewer.wicket.ui.ComponentFactory` whose contents is the fully-qualified class name of the custom `ComponentFactory` that you have written.
-
-Wicket itself has lots of components available at its http://wicketstuff.org[wicketstuff.org] companion website; you might find some of these useful for your own customizations.
-
-=== Adding a Custom Object View (eg a Dashboard)
-
-One further use case in particular is worth highlighting; the rendering of an entire entity. Normally entities this is done using `EntityCombinedPanelFactory`, this being the first `ComponentFactory` for the `ComponentType.ENTITY` that is registered in Isis default `ComponentFactoryRegistrarDefault`.
-
-You could, though, register your own `ComponentFactory` for entities that is targeted at a particular class of entity - some sort of object representing a dashboard, for example. It can use the `EntityModel` provided to it to determine the class of the entity, checking if it is of the appropriate type. Your custom factory should also be registered before the `EntityCombinedPanelFactory` so that it is checked prior to the default `EntityCombinedPanelFactory`:
-
-[source,java]
-----
-@Singleton
-public class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
-    @Override
-    public void addComponentFactories(ComponentFactoryList componentFactories) {
-        componentFactories.add(new DashboardEntityFactory());
-        ...
-        super.addComponentFactories(componentFactories);
-        ...
-    }
-}
-----
-
-
-
-== Custom pages
-
-In the vast majority of cases customization should be sufficient by link:./customizing-the-viewer.html[replacing elements of a page]. However, it is also possible to define an entirely new page for a given page type.
-
-Isis defines eight page types (see the `org.apache.isis.viewer.wicket.model.models.PageType` enum):
-
-.PageType enum
-[cols="1,4", options="header"]
-|===
-| Page type
-| Renders
-
-| SIGN_IN
-| The initial sign-in page
-
-| HOME
-| The home page, displaying either the welcome message or dashboard
-
-| ABOUT
-| The about page, accessible from link top-right
-
-| ENTITY
-| Renders a single entity or view model
-
-| STANDALONE_COLLECTION
-| Page rendered after invoking an action that returns a collection of entites
-
-| VALUE
-| After invoking an action that returns a value type (though not URLs or Blob/Clobs, as these are handled appropriately automatically).
-
-| VOID_RETURN
-| After invoking an action that is `void`
-
-| ACTION_PROMPT
-| (No longer used).
-
-|===
-
-
-The `PageClassList` interface declares which class (subclass of `org.apache.wicket.Page` is used to render for each of these types.  For example, Isis' `WicketSignInPage` renders the signin page.
-
-To specify a different page class, create a custom subclass of `PageClassList`:
-
-[source,java]
-----
-@Singleton
-public class MyPageClassList extends PageClassListDefault {
-    protected Class<? extends Page> getSignInPageClass() {
-        return MySignInPage.class;
-    }
-}
-----
-
-
-You then need to register your custom `PageClassList`.  This is done by adjusting the Guice bindings (part of Isis' bootstrapping) in your custom subclass of `IsisWicketApplication`:
-
-[source,java]
-----
-public class MyAppApplication extends IsisWicketApplication {
-    @Override
-    protected Module newIsisWicketModule() {
-        final Module isisDefaults = super.newIsisWicketModule();
-        final Module myAppOverrides = new AbstractModule() {
-            @Override
-            protected void configure() {
-                ...
-                bind(PageClassList.class).to(MyPageClassList.class);
-                ...
-            }
-        };
-        return Modules.override(isisDefaults).with(myAppOverrides);
-    }
-}
-----
-
-
-
-
-== Isis Addons Extensions
-
-IMPORTANT: TODO
-
-[WARNING]
-====
-Note that Isis addons, while maintained by Isis committers, are not part of the ASF.
-====
-
+include::_user-guide_extending_wicket-viewer_custom-pages.adoc[leveloffset=+1]
 
+include::_user-guide_extending_wicket-viewer_isis-addons-extensions.adoc[leveloffset=+1]
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-bootstrap-theme.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-bootstrap-theme.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-bootstrap-theme.adoc
new file mode 100644
index 0000000..72b13d7
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-bootstrap-theme.adoc
@@ -0,0 +1,33 @@
+= Custom Bootstrap theme
+: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 Isis Wicket viewer uses http://getbootstrap.com/[Bootstrap] styles and components (courtesy of the https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap] integration).
+
+By default the viewer uses the default bootstrap theme. It is possible to configure the Wicket viewer to allow the user to <<_showing_a_theme_chooser, select other themes>> provided by http://bootswatch.com[bootswatch.com], and if required one of these can be <<_specifying_a_default_theme, set as the default>>.
+
+However, you may instead want to write your own custom theme, for example to fit your company's look-n-feel/interface guidelines. This is done by implementing https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap]’s `de.agilecoders.wicket.core.settings.ITheme` class. This defines:
+
+* the name of the theme
+* the resources it needs (the CSS and optional JS and/or fonts), and
+* optional urls to load them from a Content Delivery Network (CDN).
+
+To make use of the custom `ITheme` the application should register it by adding the following snippet in
+(your application's subclass of) `IsisWicketApplication`:
+
+[source,java]
+----
+public void init() {
+    ...
+    IBootstrapSettings settings = new BootstrapSettings();
+    ThemeProvider themeProvider = new SingleThemeProvider(new MyTheme());
+    settings.setThemeProvider(themeProvider);
+    Bootstrap.install(getClass(), settings);
+}
+----
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-pages.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-pages.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-pages.adoc
new file mode 100644
index 0000000..608978c
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_custom-pages.adoc
@@ -0,0 +1,82 @@
+= Custom pages
+: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/
+
+
+
+In the vast majority of cases customization should be sufficient by link:./customizing-the-viewer.html[replacing elements of a page]. However, it is also possible to define an entirely new page for a given page type.
+
+Isis defines eight page types (see the `org.apache.isis.viewer.wicket.model.models.PageType` enum):
+
+.PageType enum
+[cols="1,4", options="header"]
+|===
+| Page type
+| Renders
+
+| SIGN_IN
+| The initial sign-in page
+
+| HOME
+| The home page, displaying either the welcome message or dashboard
+
+| ABOUT
+| The about page, accessible from link top-right
+
+| ENTITY
+| Renders a single entity or view model
+
+| STANDALONE_COLLECTION
+| Page rendered after invoking an action that returns a collection of entites
+
+| VALUE
+| After invoking an action that returns a value type (though not URLs or Blob/Clobs, as these are handled appropriately automatically).
+
+| VOID_RETURN
+| After invoking an action that is `void`
+
+| ACTION_PROMPT
+| (No longer used).
+
+|===
+
+
+The `PageClassList` interface declares which class (subclass of `org.apache.wicket.Page` is used to render for each of these types.  For example, Isis' `WicketSignInPage` renders the signin page.
+
+To specify a different page class, create a custom subclass of `PageClassList`:
+
+[source,java]
+----
+@Singleton
+public class MyPageClassList extends PageClassListDefault {
+    protected Class<? extends Page> getSignInPageClass() {
+        return MySignInPage.class;
+    }
+}
+----
+
+
+You then need to register your custom `PageClassList`.  This is done by adjusting the Guice bindings (part of Isis' bootstrapping) in your custom subclass of `IsisWicketApplication`:
+
+[source,java]
+----
+public class MyAppApplication extends IsisWicketApplication {
+    @Override
+    protected Module newIsisWicketModule() {
+        final Module isisDefaults = super.newIsisWicketModule();
+        final Module myAppOverrides = new AbstractModule() {
+            @Override
+            protected void configure() {
+                ...
+                bind(PageClassList.class).to(MyPageClassList.class);
+                ...
+            }
+        };
+        return Modules.override(isisDefaults).with(myAppOverrides);
+    }
+}
+----
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_isis-addons-extensions.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_isis-addons-extensions.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_isis-addons-extensions.adoc
new file mode 100644
index 0000000..6ef681b
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_isis-addons-extensions.adoc
@@ -0,0 +1,16 @@
+= Isis Addons Extensions
+: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/
+
+
+
+IMPORTANT: TODO
+
+[WARNING]
+====
+Note that Isis addons, while maintained by Isis committers, are not part of the ASF.
+====
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_replacing-page-elements.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_replacing-page-elements.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_replacing-page-elements.adoc
new file mode 100644
index 0000000..4462152
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_extending_wicket-viewer_replacing-page-elements.adoc
@@ -0,0 +1,159 @@
+= Replacing page elements
+: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/
+
+
+
+Replacing elements of the page is the most powerful general-purpose way to customize the look-n-feel of the viewer.  Examples at http://www.isisaddons.org[Isis Add-ons] include the link:isisaddons/isis-wicket-gmap3.html[gmap3], link:isisaddons/isis-wicket-fullcalendar2.html[calendar], link:isisaddons/isis-wicket-excel.html[excel download] and link:isisaddons/isis-wicket-wickedcharts.html[charting] integrations.
+
+The pages generated by Isis' Wicket viewer are built up of numerous elements, from fine-grained widgets for property/parameter fields, to much larger components that take responsibility for rendering an entire entity entity, or a collection of entities. Under the covers these are all implementations of the the Apache Wicket `Component` API. The larger components delegate to the smaller, of course.
+
+== How the Wicket viewer selects components
+
+Components are created using Isis' `ComponentFactory` interface, which are registered in turn through the `ComponentFactoryRegistrar` interface. Every component is categorizes by type (the `ComponentType` enum), and Isis uses this to determine which `ComponentFactory` to use. For example, the `ComponentType.BOOKMARKED_PAGES` is used to locate the `ComponentFactory` that will build the bookmarked pages panel.
+
+Each factory is also handed a model (an implementation of `org.apache.wicket.IModel`) appropriate to its `ComponentType`; this holds the data to be rendered. For example, `ComponentType.BOOKMARKED_PAGES` is given a `BookmarkedPagesModel`, while `ComponentType.SCALAR_NAME_AND_VALUE` factories are provided a model of type of type `ScalarModel` .
+
+In some cases there are several factories for a given `ComponentType`; this is most notably the case for `ComponentType.SCALAR_NAME_AND_VALUE`. After doing a first pass selection of candidate factories by `ComponentType`, each factory is then asked if it `appliesTo(Model)`. This is an opportunity for the factory to check the model itself to see if the data within it is of the appropriate type.
+
+Thus, the `BooleanPanelFactory` checks that the `ScalarModel` holds a boolean, while the `JodaLocalDatePanelFactory` checks to see if it holds `org.joda.time.LocalDate`.
+
+There will typically be only one `ComponentFactory` capable of rendering a particular `ComponentType`/`ScalarModel` combination; at any rate, the framework stops as soon as one is found.
+
+[NOTE]
+====
+There is one refinement to the above algorithm where multiple component factories might be used to render an object; this is discussed in <<Additional Views of Collections>>, below.
+====
+
+
+
+== How to replace a component
+
+This design (the http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern[chain of responsibility] design pattern) makes it quite straightforward to change the rendering of any element of the page. For example, you might switch out Isis' sliding bookmark panel and replace it with one that presents the bookmarks in some different fashion.
+
+First, you need to write a `ComponentFactory` and corresponding `Component`. The recommended approach is to start with the source of the `Component` you want to switch out. For example:
+
+[source,java]
+----
+public class MyBookmarkedPagesPanelFactory extends ComponentFactoryAbstract {
+    public MyBookmarkedPagesPanelFactory() {
+        super(ComponentType.BOOKMARKED_PAGES);
+    }
+    @Override
+    public ApplicationAdvice appliesTo(final IModel<?> model) {
+        return appliesIf(model instanceof BookmarkedPagesModel);
+    }
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final BookmarkedPagesModel bookmarkedPagesModel = (BookmarkedPagesModel) model;
+        return new MyBookmarkedPagesPanel(id, bookmarkedPagesModel);
+    }
+}
+----
+
+and
+
+[source,java]
+----
+public class MyBookmarkedPagesPanel
+    extends PanelAbstract<BookmarkedPagesModel> {
+   ...
+}
+----
+
+Here `PanelAbstract` ultimately inherits from `org.apache.wicket.Component`.
+Your new `Component` uses the information in the provided model (eg `BookmarkedPagesModel`) to know what to render.
+
+Next, you will require a custom implementation of the `ComponentFactoryRegistrar` that registers your custom `ComponentFactory` as a replacement:
+
+[source,java]
+----
+@Singleton
+public class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
+    @Override
+    public void addComponentFactories(ComponentFactoryList componentFactories) {
+        super.addComponentFactories(componentFactories);
+        componentFactories.add(new MyBookmarkedPagesPanelFactory());
+    }
+}
+----
+
+This will result in the new component being used instead of (that is, discovered prior to) Isis' default implementation.
+
+[WARNING]
+====
+Previously we suggested using "replace" rather than "add"; however this has unclear semantics for some component types; see https://issues.apache.org/jira/browse/ISIS-996[ISIS-996].
+====
+
+
+Finally (as for other customizations), you need to adjust the Guice bindings in your custom subclass of `IsisWicketApplication`:
+
+[source,java]
+----
+public class MyAppApplication extends IsisWicketApplication {
+    @Override
+    protected Module newIsisWicketModule() {
+        final Module isisDefaults = super.newIsisWicketModule();
+        final Module myAppOverrides = new AbstractModule() {
+            @Override
+            protected void configure() {
+                ...
+                bind(ComponentFactoryRegistrar.class)
+                    .to(MyComponentFactoryRegistrar.class);
+                ...
+            }
+        };
+
+        return Modules.override(isisDefaults).with(myAppOverrides);
+    }
+}
+----
+
+
+
+
+== Additional Views of Collections
+
+As explained above, in most cases Isis' Wicket viewer will search for the first `ComponentFactory` that can render an element, and use it. In the case of (either standalone or parented) collections, though, Isis will show all available views.
+
+For example, out-of-the-box Isis provides a table view, a summary view (totals/sums/averages of any data), and a collapsed view (for `@Render(LAZILY)` collections). These are selected by clicking on the toolbar by each collection.
+
+Additional views though could render the objects in the collection as a variety of ways. Indeed, some third-party implementations already exist:
+
+* https://github.com/isisaddons/isis-wicket-excel[excel integration] (collection as a downloadable excel spreadsheet)
+* https://github.com/isisaddons/isis-wicket-gmap3[google maps v3 integration] (render any objects with a location on a map)
+* https://github.com/isisaddons/isis-wicket-wickedcharts[wicked charts integration] (barchart of any data)
+* https://github.com/isisaddons/isis-wicket-fullcalendar2[full calendar integration] (render any objects with date properties on a calendar)
+
+Registering these custom views is just a matter of adding the appropriate Maven module to the classpath. Isis uses the JDK `ServiceLoader` API to automatically discover and register the `ComponentFactory` of each such component.
+
+If you want to write your own alternative component and auto-register, then include a file `META-INF/services/org.apache.isis.viewer.wicket.ui.ComponentFactory` whose contents is the fully-qualified class name of the custom `ComponentFactory` that you have written.
+
+Wicket itself has lots of components available at its http://wicketstuff.org[wicketstuff.org] companion website; you might find some of these useful for your own customizations.
+
+
+
+
+== Adding a Custom Object View (eg a Dashboard)
+
+One further use case in particular is worth highlighting; the rendering of an entire entity. Normally entities this is done using `EntityCombinedPanelFactory`, this being the first `ComponentFactory` for the `ComponentType.ENTITY` that is registered in Isis default `ComponentFactoryRegistrarDefault`.
+
+You could, though, register your own `ComponentFactory` for entities that is targeted at a particular class of entity - some sort of object representing a dashboard, for example. It can use the `EntityModel` provided to it to determine the class of the entity, checking if it is of the appropriate type. Your custom factory should also be registered before the `EntityCombinedPanelFactory` so that it is checked prior to the default `EntityCombinedPanelFactory`:
+
+[source,java]
+----
+@Singleton
+public class MyComponentFactoryRegistrar extends ComponentFactoryRegistrarDefault {
+    @Override
+    public void addComponentFactories(ComponentFactoryList componentFactories) {
+        componentFactories.add(new DashboardEntityFactory());
+        ...
+        super.addComponentFactories(componentFactories);
+        ...
+    }
+}
+----
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_more-advanced_i18n.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_more-advanced_i18n.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_more-advanced_i18n.adoc
index adc5590..4e5aef1 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_more-advanced_i18n.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_more-advanced_i18n.adoc
@@ -3,5 +3,362 @@
 :_basedir: ../
 :_imagesdir: images/
 
-IMPORTANT: TODO
+
+Apache Isis' support for i18n allows every element of the domain model (the class names, property names, action names, parameter names and so forth) to be translated.
+
+It also supports translations of messages raised imperatively, by which we mean as the result of a call to `title()` to obtain an object's title, or messages messages resulting from any business rule violations (eg `disableXxx()` or `validateXxx()`, and so on.
+
+Isis does not translate the values of your domain objects, though.  So, if you have a domain concept such as `Country` whose name is intended to be localized according to the current user, you will need to model
+
+
+
+== Implementation Approach
+
+Most Java frameworks tackle i18n by using Java's own `ResourceBundle` API.  However, there are some serious drawbacks in this approach, such as:
+
+* if a string appears more than once (eg "name" or "description") then it must be translated everywhere it appears in every resource bundle file
+* there is no support for plural forms (see this link:http://stackoverflow.com/a/14327683/56880[SO answer])
+* there is no tooling support for translators
+
+Apache Isis therefore takes a different approach, drawing inspiration from GNU's https://www.gnu.org/software/gettext/manual/index.html[gettext] API and specifically its `.pot` and `.po` files.  These are intended to be used as follows:
+
+* the `.pot` (portable object template) file holds the message text to be translated
+* this file is translated into multiple `.po` (portable object) files, one per supported locale
+* these `.po` files are renamed according to their locale, and placed into the 'appropriate' location to be picked up by the runtime.  The name of each `.po` resolved in a very similar way to resource bundles.
+
+The format of the `.pot` and `.po` files is identical; the only difference is that the `.po` file has translations for each of the message strings.   These message strings can also have singular and plural forms.
+
+
+[IMPORTANT]
+====
+Although Isis' implementation is modelled after GNU's API, it does _not_ use any GNU software.  This is for two reasons: (a) to simplify the toolchain/developer experience, and (b) because GNU software is usually GPL, which would be incompatible with the Apache license).
+====
+
+This design tackles all the issues of ``ResourceBundle``s:
+
+* the `.po` message format is such that any given message text to translate need only be translated once, even if it appears in multiple places in the application (eg "Name")
+* the `.po` message format includes translations for (optional) plural form as well as singular form
+* there are lots of freely available editors https://www.google.co.uk/search?q=.po+file+editor[to be found], many summarized on this https://www.drupal.org/node/11131[Drupal.org] webpage. +
++
+In fact, there are also online communities/platforms of translators to assist with translating files. One such is https://crowdin.com/[crowdin] (nb: this link does not imply endorsement).
+
+In Isis' implementation, if the translation is missing from the `.po` file then the original message text from the `.pot` file will be returned.  In fact, it isn't even necessary for there to be any `.po` files; `.po` translations can be added piecemeal as the need arises.
+
+
+
+
+== Service API and Implementation
+
+The cornerstone of Isis' support for i18n is the `TranslationService` service. This is defined in the applib with the following API:
+
+[source,java]
+----
+public interface TranslationService {
+    public String translate(      // <1>
+            final String context,
+            final String text);
+    public String translate(      // <2>
+            final String context,
+            final String singularText,
+            final String pluralText,
+            final int num);
+    public enum Mode {
+        READ,
+        WRITE;
+    }
+    Mode getMode();               // <3>
+}
+----
+<1> is to translate the singular form of the text
+<2> is to translate the plural form of the text
+<3> indicates whether the translation service is in read or write mode.
+
+The `translate(...)` methods are closely modelled on GNU's gettext API.  The first version is used when no translation is required, the second is when both a singular and plural form will be required, with the `num` parameter being used to select which is returned.  In both cases the `context` parameter provides some contextual information for the translator; this generally corresponds to the class member.
+
+The mode meanwhile determines the behaviour of the service.  More on this below.
+
+=== `TranslationServicePo` (implementation)
+
+Isis provides a default implementation of `TranslationService`, namely `TranslationServicePo`.
+
+If the service is running in the normal read mode, then it simply provides translations for the locale of the current user.  This means locates the appropriate `.po` file (based on the requesting user's locale), finds the translation and returns it.
+
+If however the service is configured to run in write mode, then it instead records the fact that the message was requested to be translated (a little like a spy/mock in unit testing mock), and returns the original message. The service can then be queried to discover which messages need to be translated.  All requested translations are written into the `.pot` file.
+
+To make the service as convenient as possible to use, the service configures itself as follows:
+
+* if running in <<_deployment_types, prototype mode>> or during integration tests, then the service runs in _write_ mode, in which case it records all translations into the `.pot` file.  The `.pot` file is written out when the system is shutdown.
+* if running in <<_deployment_types, server (production) mode>>, then the service runs in _read_ mode. It is also possible to set a configuration setting in `isis.properties` to force read mode even if running in prototype mode (useful to manually test/demo the translations).
+
+When running in write mode the original text is returned to the caller untranslated. If in read mode, then the translated `.po` files are read and translations provided as required.
+
+== Translating validation and other (imperative) messages
+
+The `TranslationService` is used internally by Isis when building up the metamodel; the name and description of every class, property, collection, action and action parameter is automatically translated.  Thus the simple act of bootstrapping Isis will cause most of the messages requiring translation (that is: those for the Isis metamodel) to be captured by the `TranslationService`.
+
+However, for an application to be fully internationalized, any validation messages (from either `disableXxx()` or `validateXxx()` supporting methods) and also possibly an object's title (from the `title()` method) will also require translation. Moreover, these messages must be captured in the `.pot` file such that they can be translated.
+
+
+=== `TranslatableString`
+
+The first part of the puzzle is tackled by an extension to Isis' programming model.  Whereas previously the `disableXxx()` / `validateXxx()` / `title()` methods could only return a `java.lang.String`, they may now optionally return a `TranslatableString` (defined in Isis applib) instead.
+
+Here's a (silly) example from the <<_simpleapp_archetype, SimpleApp archetype>>:
+
+[source,java]
+----
+public TranslatableString validateUpdateName(final String name) {
+    return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null;
+}
+----
+
+This corresponds to the following entry in the `.pot` file:
+
+[source,ini]
+----
+#: dom.simple.SimpleObject#updateName()
+msgid "Exclamation mark is not allowed"
+msgstr ""
+----
+
+The full API of `TranslatableString` is modelled on the design of GNU gettext (in particular the https://code.google.com/p/gettext-commons/wiki/Tutorial[gettext-commons] library):
+
+[source,java]
+----
+public final class TranslatableString {
+    public static TranslatableString tr(       // <1>
+            final String pattern,
+            final Object... paramArgs) { ... }
+    public static TranslatableString trn(      // <2>
+            final String singularPattern,
+            final String pluralPattern,
+            final int number,
+            final Object... paramArgs) { ... }
+    public String translate(                   // <3>
+            final TranslationService translationService,
+            final String context) { ... }
+}
+----
+<1> returns a translatable string with a single pattern for both singular and plural forms.
+<2> returns a translatable string with different patterns for singular and plural forms; the one to use is determined by the 'number' argument
+<3> translates the string using the provided `TranslationService`, using the appropriate singular/regular or plural form, and interpolating any arguments.
+
+The interpolation uses the format `{xxx}`, where the placeholder can occur multiple times.
+
+For example:
+
+[source,java]
+----
+final TranslatableString ts = TranslatableString.tr(
+    "My name is {lastName}, {firstName} {lastName}.",
+    "lastName", "Bond", "firstName", "James");
+----
+
+would interpolate (for the English locale) as "My name is Bond, James Bond".
+
+For a German user, on the other hand, if the translation in the corresponding `.po` file was:
+
+[source,ini]
+----
+#: xxx.yyy.Whatever#context()
+msgid "My name is {lastName}, {firstName} {lastName}."
+msgstr "Iche heisse {firstName} {lastName}."
+----
+
+then the translation would be: "Ich heisse James Bond".
+
+
+The same class is used in <<_domain_object_container, `DomainObjectContainer`>> so that you can raise translatable info, warning and error messages; each of the relevant methods are overloaded.
+
+For example:
+
+[source,java]
+----
+public interface DomainObjectContainer {
+    void informUser(String message);
+    void informUser(
+        TranslatableMessage message,
+        final Class<?> contextClass, final String contextMethod); // <1>
+    ...
+}
+----
+<1> are concatenated together to form the context for the `.pot` file.
+
+
+=== `TranslatableException`
+
+Another mechanism by which messages can be rendered to the user are as the result of exception messages thrown and recognized by an <<_exception_recognizer, `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:
+
+[source,java]
+----
+public interface TranslatableException {
+    TranslatableString getTranslatableMessage(); // <1>
+    String getTranslationContext();              // <2>
+}
+
+----
+<1> the message to translate.  If returns `null`, then the `Exception#getMessage()` is used as a fallback
+<2> the context to use when translating the message
+
+
+
+
+
+== Integration Testing
+
+So much for the API; but as noted, it is also necessary to ensure that the required translations are recorded (by the `TranslationService`) into the `.pot` file.
+
+For this, we recommend that you ensure that all such methods are tested through _an integration test_ (not unit test). For example, here's the corresponding integration test for the "Exclamation mark" example from the simpleapp (above):
+
+[source,java]
+----
+@Rule
+public ExpectedException expectedException = ExpectedException.none();
+
+@Inject
+FixtureScripts fixtureScripts;
+
+@Test
+public void failsValidation() throws Exception {
+    // given
+    RecreateSimpleObjects fs = new RecreateSimpleObjects().setNumber(1);
+    fixtureScripts.runFixtureScript(fs, null);
+    SimpleObject simpleObjectWrapped = wrap(fs.getSimpleObjects().get(0));
+
+    // expect
+    expectedExceptions.expect(InvalidException.class);
+    expectedExceptions.expectMessage("Exclamation mark is not allowed");
+
+    // when
+    simpleObjectWrapped.updateName("new name!");
+}
+----
+
+Running this test will result in the framework calling the `validateUpdateName(...)` method, and thus to record that a translation is required in the `.pot` file.
+
+When the integration tests are complete (that is, when Isis is shutdown), the `TranslationServicePo` will write out all captured translations to its log (more on this below). This will include all the translations captured from the Isis metamodel, along with all translations as exercised by the integration tests.
+
+To ensure your app is fully internationalized app, you must therefore:
+
+* use `TranslatableString` rather than `String` for all validation/disable and title methods.
+* ensure that (at a minimum) all validation messages and title methods are integration tested.
+
+[NOTE]
+====
+We make no apologies for this requirement: one of the reasons that we decided to implement Isis' i18n support in this way is because it encourages/requires the app to be properly tested.
+====
+
+
+
+
+== Configuration
+
+There are several different aspects of the translation service that can be configured.
+
+=== Logging
+
+To configure the `TranslationServicePo` to write to out the `translations.pot` file, add the following to the _integtests_ `logging.properties` file:
+
+[source,ini]
+----
+log4j.appender.translations-po=org.apache.log4j.FileAppender
+log4j.appender.translations-po.File=./translations.pot
+log4j.appender.translations-po.Append=false
+log4j.appender.translations-po.layout=org.apache.log4j.PatternLayout
+log4j.appender.translations-po.layout.ConversionPattern=%m%n
+
+log4j.logger.org.apache.isis.core.runtime.services.i18n.po.PoWriter=INFO,translations-po
+log4j.additivity.org.apache.isis.core.runtime.services.i18n.po.PotWriter=false
+----
+
+Just to repeat, this is _not_ the `WEB-INF/logging.properties` file, it should instead be added to the `integtests/logging.properties` file.
+
+=== Location of the `.po` files
+
+The default location of the translated `.po` files is in the `WEB-INF` directory. These are named and searched for similarly to regular Java resource bundles.
+
+For example, assuming these translations:
+
+[source,ini]
+----
+/WEB-INF/translations-en-US.po
+        /translations-en.po
+        /translations-fr-FR.po
+        /translations.po
+----
+
+then:
+
+* a user with `en-US` locale will use `translations-en-US.po`
+* a user with `en-GB` locale will use `translations-en.po`
+* a user with `fr-FR` locale will use `translations-fr-FR.po`
+* a user with `fr-CA` locale will use `translations.po`
+
+The basename for translation files is always `translations`; this cannot be altered.
+
+
+=== Externalized translation files
+
+Normally Isis configuration files are read from the `WEB-INF` file. However, Isis can be configured to read config files from an link:../reference/externalized-configuration.html[external directory]; this is also supported for translations.
+
+Thus, if in `web.xml` the external configuration directory has been set:
+
+[source,xml]
+----
+<context-param>
+    <param-name>isis.config.dir</param-name>
+    <param-value>location of external config directory</param-value>
+</context-param>
+----
+
+Then this directory will be used as the base for searching for translations (rather than the default 'WEB-INF/' directory).
+
+=== Force read mode
+
+As noted above, if running in prototype mode then `TranslationServicePo` will be in write mode, if in production mode then will be in read mode. To force read mode (ie use translations) even if in prototype mode, add the following configuration property to `isis.properties`:
+
+[source]
+----
+isis.services.translation.po.mode=read
+----
+
+== Supporting services
+
+The `TranslationServicePo` has a number of supporting/related services.
+
+=== `LocaleProvider`
+
+The `LocaleProvider` API is used by the `TranslationServicePo` implementation to obtain the locale of the "current user".
+
+A default implementation is provided by the Wicket viewer.
+
+[NOTE]
+====
+Note that this default implementation does not support requests made through the Restful Objects viewer (there is no Wicket 'application' object available); the upshot is that requests through Restful Objects are never translated. Registering a different implementation of `LocaleProvider` that taps into appropriate REST (RestEasy?) APIs would be the way to address this.
+====
+
+
+=== `TranslationsResolver`
+
+The `TranslationResolver` is used by the `TranslationService` implementation to lookup translations for a specified locale. It is this service that reads from the `WEB-INF/` (or externalized directory).
+
+
+=== `TranslationServicePoMenu`
+
+The `TranslationServicePoMenu` provides a couple of menu actions in the UI (prototype mode only) that interacts with the underlying `TranslationServicePo`:
+
+* the `downloadTranslationsFile()` action - available only in write mode - allows the current `.pot` file to be downloaded. +
++
+[NOTE]
+====
+While this will contain all the translations from the metamodel, it will not necessarily contain all translations for all imperative methods returning `TranslatableString` instances; which are present and which are missing will depend on which imperative methods have been called (recorded by the service) prior to downloading.
+====
+
+* the `clearTranslationsCache()` action - available only in read mode - will clear the cache so that new translations can be loaded. +
++
+This allows a translator to edit the appropriate `translations-xx-XX.po` file and check the translation is correct without having to restart the app.
+
+
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services.adoc
index 0c42181..799afab 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services.adoc
@@ -7,7 +7,6 @@
 IMPORTANT: TODO
 
 
-
 include::_user-guide_reference_domain-services_action-invocation-context.adoc[leveloffset=+1]
 
 include::_user-guide_reference_domain-services_auditing-service.adoc[leveloffset=+1]
@@ -24,6 +23,10 @@ include::_user-guide_reference_domain-services_command-context.adoc[leveloffset=
 
 include::_user-guide_reference_domain-services_command-service.adoc[leveloffset=+1]
 
+include::_user-guide_reference_domain-services_content-mapping-service.adoc[leveloffset=+1]
+
+include::_user-guide_reference_domain-services_content-negotiation-service.adoc[leveloffset=+1]
+
 include::_user-guide_reference_domain-services_deep-link-service.adoc[leveloffset=+1]
 
 include::_user-guide_reference_domain-services_domain-object-container.adoc[leveloffset=+1]
@@ -38,8 +41,12 @@ include::_user-guide_reference_domain-services_exception-recognizer.adoc[levelof
 
 include::_user-guide_reference_domain-services_isis-jdo-support.adoc[leveloffset=+1]
 
+include::_user-guide_reference_domain-services_locale-provider.adoc[leveloffset=+1]
+
 include::_user-guide_reference_domain-services_memento-service.adoc[leveloffset=+1]
 
+include::_user-guide_reference_domain-services_metamodel-service.adoc[leveloffset=+1]
+
 include::_user-guide_reference_domain-services_publishing-service.adoc[leveloffset=+1]
 
 include::_user-guide_reference_domain-services_query-results-cache.adoc[leveloffset=+1]
@@ -48,6 +55,10 @@ include::_user-guide_reference_domain-services_scratch-pad.adoc[leveloffset=+1]
 
 include::_user-guide_reference_domain-services_settings-service.adoc[leveloffset=+1]
 
+include::_user-guide_reference_domain-services_translation-service.adoc[leveloffset=+1]
+
+include::_user-guide_reference_domain-services_translations-resolver.adoc[leveloffset=+1]
+
 include::_user-guide_reference_domain-services_user-profile-service.adoc[leveloffset=+1]
 
 include::_user-guide_reference_domain-services_user-registration-service.adoc[leveloffset=+1]

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-mapping-service.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-mapping-service.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-mapping-service.adoc
new file mode 100644
index 0000000..4455517
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-mapping-service.adoc
@@ -0,0 +1,8 @@
+= Content Mapping Service
+: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/
+
+IMPORTANT: TODO
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-negotiation-service.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-negotiation-service.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-negotiation-service.adoc
new file mode 100644
index 0000000..bc7b1fc
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_content-negotiation-service.adoc
@@ -0,0 +1,8 @@
+= Content Negotiation Service
+: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/
+
+IMPORTANT: TODO
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/b4dc32c7/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_locale-provider.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_locale-provider.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_locale-provider.adoc
new file mode 100644
index 0000000..1e1b33a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_user-guide_reference_domain-services_locale-provider.adoc
@@ -0,0 +1,8 @@
+= Locale Provider
+: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/
+
+IMPORTANT: TODO
+
+