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/06/05 13:56:56 UTC
[48/51] [abbrv] isis git commit: ISIS-1133: method prefixes.
ISIS-1133: method prefixes.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/67e1a998
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/67e1a998
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/67e1a998
Branch: refs/heads/master
Commit: 67e1a99874ddaad1a0689650190f835d95e45518
Parents: 69094f4
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Jun 4 23:11:35 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Jun 4 23:11:35 2015 +0100
----------------------------------------------------------------------
.../user-guide/_ug_reference-methods.adoc | 5 +-
.../_ug_reference-methods_lifecycle.adoc | 96 +++++++++++++++
...rence-methods_lifecycle_manpage-created.adoc | 9 ++
...erence-methods_lifecycle_manpage-loaded.adoc | 9 ++
...nce-methods_lifecycle_manpage-persisted.adoc | 9 ++
...ce-methods_lifecycle_manpage-persisting.adoc | 9 ++
...rence-methods_lifecycle_manpage-removed.adoc | 9 ++
...ence-methods_lifecycle_manpage-removing.adoc | 9 ++
...rence-methods_lifecycle_manpage-updated.adoc | 9 ++
...ence-methods_lifecycle_manpage-updating.adoc | 9 ++
...eference-methods_prefixes_manpage-addTo.adoc | 1 +
...e-methods_prefixes_manpage-autoComplete.adoc | 62 +++++-----
...erence-methods_prefixes_manpage-choices.adoc | 59 +++++----
...eference-methods_prefixes_manpage-clear.adoc | 25 +++-
...erence-methods_prefixes_manpage-default.adoc | 122 ++++++++++++++++++-
...erence-methods_prefixes_manpage-disable.adoc | 86 ++++++++++++-
..._reference-methods_prefixes_manpage-get.adoc | 12 +-
...reference-methods_prefixes_manpage-hide.adoc | 75 +++++++++++-
...ference-methods_prefixes_manpage-modify.adoc | 30 ++++-
...nce-methods_prefixes_manpage-removeFrom.adoc | 3 +-
..._reference-methods_prefixes_manpage-set.adoc | 6 +-
...rence-methods_prefixes_manpage-validate.adoc | 106 +++++++++++++++-
...-methods_prefixes_manpage-validateAddTo.adoc | 12 ++
...ods_prefixes_manpage-validateRemoveFrom.adoc | 12 ++
.../_ug_reference-methods_reserved.adoc | 85 +------------
25 files changed, 722 insertions(+), 147 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods.adoc
index a46c57e..0090596 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods.adoc
@@ -6,9 +6,12 @@
-The Apache Isis metamodel is built up from declaratively (ie, xref:_ug_reference-annotations[annotations]) and imperatively, from "supporting" methods and other reserved methods. This chapter documents both.
+The Apache Isis metamodel is built up from declaratively (ie, xref:_ug_reference-annotations[annotations]) and imperatively, from "supporting" methods and other reserved methods.
+
+This chapter documents the supporting methods and the reserved methods. It also documents (separately) the reserved methods that act as callback hooks into the persistence lifecycle of domain entities.
include::_ug_reference-methods_prefixes.adoc[leveloffset=+1]
include::_ug_reference-methods_reserved.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle.adoc
new file mode 100644
index 0000000..35ff6d7
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle.adoc
@@ -0,0 +1,96 @@
+[[_ug_reference-methods_reserved]]
+= Lifecycle Methods
+: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 lifecycle callback methods notify a domain entity about its interaction within the persistence lifecycle. For example, the entity is notified immediately prior to being persisted, or when it is about to be updated.
+
+[WARNING]
+====
+We believe there may some scenarios (not yet fully catalogued) where the lifecycle method is not called. As such we recommend that you don't rely on these methods and/or fully test they are called as required in your apps
+
+As an alternative, consider using Isis' event bus and domain events.
+====
+
+The lifecycle methods are:
+
+.Lifecycle methods (partial support)
+[cols="1,4a", options="header"]
+|===
+
+|Method
+|Description
+
+|xref:_ug_reference-methods_lifecycle_manpage-created[`created()`]
+|called when an object has just been created using xref:_ug_reference-services-api_manpage-DomainObjectContainer[`newTransientInstance()`]
+
+|xref:_ug_reference-methods_lifecycle_manpage-loaded[`loaded()`]
+|called when a (persistent) object has just been loaded from the object store.
+
+|xref:_ug_reference-methods_lifecycle_manpage-persisted[`persisted()`]
+|called when object has just been persisted from the object store.
+
+|xref:_ug_reference-methods_lifecycle_manpage-persisting[`persisting()`]
+|called when a (not-yet-persistent) object is just about to be persisted from the object store
+
+|xref:_ug_reference-methods_lifecycle_manpage-removed[`removed()`]
+|called when a (persistent) object has just been persisted from the object store
+
+|xref:_ug_reference-methods_lifecycle_manpage-removing[`removing()`]
+|called when a (persistent) object is just about to be deleted from the object store
+
+|xref:_ug_reference-methods_lifecycle_manpage-updated[`updated()`]
+|called when a (persistent) object has just been updated in the object store
+
+|xref:_ug_reference-methods_lifecycle_manpage-updating[`updating()`]
+|called when a (persistent) object is just about to be updated in the object store
+
+|===
+
+
+
+Some lifecycle methods have been deprecated:
+
+.Deprecated lifecycle methods
+[cols="1,4a", options="header"]
+|===
+
+|Method
+|Notes
+
+|`deleted()`
+|Replaced by xref:_ug_reference-methods_lifecycle_manpage-removed[`removed()`]
+
+|`deleting()`
+|Replaced by xref:_ug_reference-methods_lifecycle_manpage-removing[`removing()`]
+
+|`loading()`
+|callback for when the (persistent) object is just about to be loaded from the object store. +
+[WARNING]
+====
+This method is never called.
+====
+
+|`saved()`
+|Replaced by xref:_ug_reference-methods_lifecycle_manpage-persisted[`persisted()`]
+
+|`saving()`
+|Replaced by xref:_ug_reference-methods_lifecycle_manpage-persisting[`persisting()`]
+
+|===
+
+
+
+
+include::_ug_reference-methods_lifecycle_manpage-created.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-loaded.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-persisted.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-persisting.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-removed.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-removing.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-updated.adoc[leveloffset=+1]
+include::_ug_reference-methods_lifecycle_manpage-updating.adoc[leveloffset=+1]
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-created.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-created.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-created.adoc
new file mode 100644
index 0000000..775a16e
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-created.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-created]]
+= `created()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-loaded.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-loaded.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-loaded.adoc
new file mode 100644
index 0000000..d4d27aa
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-loaded.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-loaded]]
+= `loaded()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisted.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisted.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisted.adoc
new file mode 100644
index 0000000..2bebaa6
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisted.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-persisted]]
+= `persisted()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisting.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisting.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisting.adoc
new file mode 100644
index 0000000..766f7ae
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-persisting.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-persisting]]
+= `persisting()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removed.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removed.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removed.adoc
new file mode 100644
index 0000000..816afdb
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removed.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-removed]]
+= `removed()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removing.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removing.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removing.adoc
new file mode 100644
index 0000000..e18f464
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-removing.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-removing]]
+= `removing()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updated.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updated.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updated.adoc
new file mode 100644
index 0000000..badb294
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updated.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-updated]]
+= `updated()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updating.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updating.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updating.adoc
new file mode 100644
index 0000000..6ff47a9
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_lifecycle_manpage-updating.adoc
@@ -0,0 +1,9 @@
+[[_ug_reference-methods_reserved_manpage-updating]]
+= `updating()`
+: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/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-addTo.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-addTo.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-addTo.adoc
index e2c0f31..e732e41 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-addTo.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-addTo.adoc
@@ -27,6 +27,7 @@ public class LibraryMember {
reminderService.addReminder(this, book, clock.today().plusDays(21)); // <2>
}
public void removeFromBorrowed(Book book) { ... }
+ ...
}
----
<1> update the collection
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-autoComplete.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-autoComplete.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-autoComplete.adoc
index d2c32a2..688fa7d 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-autoComplete.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-autoComplete.adoc
@@ -6,23 +6,23 @@
-The `autoComplete...()` supporting method is called for both properties and for action parameters to find objects from a drop-down list box. The use case is when the number of candidate objects is expected to be large, so the user is required to enter some characters to narrow the search down.
+The `autoComplete...()` supporting method is called for action parameters and for properties to find objects from a drop-down list box. The use case is when the number of candidate objects is expected to be large, so the user is required to enter some characters to narrow the search down.
[TIP]
====
If the number of candidate objects is comparatively small, then use xref:_ug_reference-methods_prefixes_manpage-choices[`choices...()`] supporting method instead.
====
-The signature of the supporting method depends on whether it is for a property or for an action parameter.
+The signature of the supporting method depends on whether it is for a parameter or a property.
-== Properties
+== Parameters
-For a property of type `T`, the signature is:
+For an action parameter in (0-based) position _N_, and of type `T`, the signature is:
[source,java]
----
-public Collection<T> autoCompleteXxx(String search) { ... }
+public Collection<T> autoCompleteNXxx(String search) { ... }
----
@@ -31,25 +31,42 @@ For example:
[source,java]
----
public class ShoppingCartItem {
+ @Property(editing=Editing.DISABLED)
public Product getProduct() { ... }
public void setProduct(Product product) { ... }
- public Collection<Product> autoCompleteProduct(
- @MinLength(3) String search // <1>
+ @Property(editing=Editing.DISABLED)
+ public int getQuantity() { ... }
+ public void setQuantity(int quantity) { ... }
+
+ @Action(semantics=SemanticsOf.IDEMPOTENT)
+ public ShoppingCartItem updateProduct(
+ Product product,
+ @ParameterLayout(named="Quantity")
+ final int quantity) {
+ setProduct(product);
+ setQuantity(quantity);
+ }
+ public Collection<Product> autoComplete0UpdateProduct( // <1>
+ @MinLength(3) String search // <2>
) {
...
}
+ ...
+}
----
-<1> the xref:_ug_reference-annotations_manpage-MinLength[`@MinLength`] annotation specifies the minimum number of characters that must be entered before a search is performed for matching objects
+<1> `product` is the 0th argument of the action.
+<2> the xref:_ug_reference-annotations_manpage-MinLength[`@MinLength`] annotation specifies the minimum number of characters that must be entered before a search is performed for matching objects
-== Parameters
-For an action parameter in (0-based position n), and of type `T`, the signature is:
+== Properties
+
+For a property of type `T`, the signature is:
[source,java]
----
-public Collection<T> autoCompleteNXxx(String search) { ... }
+public Collection<T> autoCompleteXxx(String search) { ... }
----
@@ -58,28 +75,17 @@ For example:
[source,java]
----
public class ShoppingCartItem {
- @Property(editing=Editing.DISABLED)
public Product getProduct() { ... }
public void setProduct(Product product) { ... }
- @Property(editing=Editing.DISABLED)
- public int getQuantity() { ... }
- public void setQuantity(int quantity) { ... }
-
- @Action(semantics=SemanticsOf.IDEMPOTENT)
- public ShoppingCartItem updateProduct(
- Product product,
- @ParameterLayout(named="Quantity")
- final int quantity) {
- setProduct(product);
- setQuantity(quantity);
- }
- public Collection<Product> autoComplete0UpdateProduct( // <1>
- @MinLength(3) String search // <2>
+ public Collection<Product> autoCompleteProduct(
+ @MinLength(3) String search // <1>
) {
...
}
+ ...
+}
----
-<1> `product` is the 0th argument of the action.
-<2> the xref:_ug_reference-annotations_manpage-MinLength[`@MinLength`] annotation specifies the minimum number of characters that must be entered before a search is performed for matching objects
+<1> the xref:_ug_reference-annotations_manpage-MinLength[`@MinLength`] annotation specifies the minimum number of characters that must be entered before a search is performed for matching objects
+
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-choices.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-choices.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-choices.adoc
index a3ba010..6491c10 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-choices.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-choices.adoc
@@ -6,38 +6,14 @@
-The `choices...()` supporting method is called for both properties and for action parameters to find objects from a drop-down list box. Unlike xref:_ug_reference-methods_prefixes_manpage-autoComplete[`autoComplete...()`], the use case is when the number of objects is comparatively small and can be selected from a drop-down without any additional filtering.
+The `choices...()` supporting method is called for both action parameters and for properties, to find objects from a drop-down list box. Unlike xref:_ug_reference-methods_prefixes_manpage-autoComplete[`autoComplete...()`], the use case is when the number of objects is comparatively small and can be selected from a drop-down without any additional filtering.
-The signature of the supporting method depends on whether it is for a property or for an action parameter.
-
-
-== Properties
-
-For a property of type `T`, the signature is:
-
-[source,java]
-----
-public Collection<T> choicesXxx() { ... }
-----
-
-
-For example:
-
-[source,java]
-----
-public class ShoppingCartItem {
- public Product getProduct() { ... }
- public void setProduct(Product product) { ... }
-
- public Collection<Product> choicesProduct() {
- ...
- }
-----
+The signature of the supporting method depends on whether it is for an action parameter or a property.
== Parameters
-For an action parameter in (0-based position n), and of type `T`, the signature is:
+For an action parameter in (0-based) position _N_, and of type `T`, the signature is:
[source,java]
----
@@ -69,6 +45,7 @@ public class ShoppingCartItem {
public Collection<Integer> choices1UpdateProduct() {
return Arrays.asList(1,2,3,5,10,25,50,100);
}
+ ...
}
----
@@ -107,6 +84,7 @@ public class UpdateCategoryContributions ... {
final Category category) { // <4>
return Subcategory.listFor(category);
}
+ ...
}
----
<1> `ToDoItem` implements `Categorized`
@@ -133,6 +111,33 @@ public class ShoppingCartItem {
public Collection<Integer> choices1UpdateProduct(Product product) {
return productService.quantityChoicesFor(product); // <1>
}
+ ...
}
----
<1> `productService` is a (fictitous) injected service that knows what the quantity choices should be for any given product
+
+
+== Properties
+
+For a property of type `T`, the signature is:
+
+[source,java]
+----
+public Collection<T> choicesXxx() { ... }
+----
+
+
+For example:
+
+[source,java]
+----
+public class ShoppingCartItem {
+ public Product getProduct() { ... }
+ public void setProduct(Product product) { ... }
+
+ public Collection<Product> choicesProduct() {
+ ...
+ }
+----
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-clear.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-clear.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-clear.adoc
index 841b054..c539cbd 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-clear.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-clear.adoc
@@ -4,6 +4,29 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+The `clear...()` supporting method is called -- instead of the setter -- whenever an (optional) property is to be set to `null`. Its purpose is to allow additional business logic to be performed.
+
+
+For example:
+
+[source,java]
+----
+public class LibraryMember {
+ public Title getFavoriteTitle() { ... }
+ public void setFavoriteTitle(Title title) { ... }
+ public void modifyFavoriteTitle(Title title) { ... }
+ public void clearFavoriteTitle() {
+ if(getTitle() == null) { return; }
+ setFavoriteTitle(null); // <1>
+ titleFavoritesService.decrement(title); // <2>
+ }
+ ...
+}
+----
+<1> update the property
+<2> perform some additional business logic
+
+
+See also xref:_ug_reference-methods_prefixes_manpage-modify[`modify...()`]`
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-default.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-default.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-default.adoc
index 68126ac..a53d186 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-default.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-default.adoc
@@ -4,6 +4,126 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+The `default...()` supporting method is called for action parameters to return the initial argument value. This may be some sensible default (eg today's date, or 0 or 1), or -- for an action that is modifying the state of an object -- might default to the current value of a corresponding property.
+
+The method is _also_ called for properties in the case when an object is newly instantiated using xref:_ug_reference-services-api_manpage-DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`]. This is a much less common use case. If a default is not specified then properties are initialized to a default based on their type (eg 0 or `false`).
+
+The signature of the supporting method depends on whether it is for an action parameter or a property.
+
+
+== Parameters
+
+For an action parameter in (0-based position n), and of type `T`, the signature is:
+
+[source,java]
+----
+public T defaultNXxx() { ... }
+----
+
+
+For example:
+
+[source,java]
+----
+public class ShoppingCartItem {
+ @Property(editing=Editing.DISABLED)
+ public Product getProduct() { ... }
+ public void setProduct(Product product) { ... }
+
+ @Property(editing=Editing.DISABLED)
+ public int getQuantity() { ... }
+ public void setQuantity(int quantity) { ... }
+
+ @Action(semantics=SemanticsOf.IDEMPOTENT)
+ public ShoppingCartItem updateProduct(
+ Product product,
+ @ParameterLayout(named="Quantity")
+ final Integer quantity) {
+ setProduct(product);
+ setQuantity(quantity);
+ }
+ public Product default0UpdateProduct() { // <1>
+ return getProduct();
+ }
+ public int default1UpdateProduct() { // <2>
+ return getQuantity();
+ }
+ ...
+}
+----
+<1> default the 0-th parameter using the current value of the `product` property
+<2> default the 1-th parameter using the current value of the `quantity` property
+
+
+
+Defaults are also supported (of course) for xref:_ug_how-tos_contributed-members[contributed actions]. For example, here is a contributed action for updating category/subcategory of the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]:
+
+[source,java]
+----
+@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class UpdateCategoryContributions ... {
+ @ActionLayout(
+ describedAs = "Update category and subcategory"
+ )
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ public Categorized updateCategory(
+ final Categorized item, // <1>
+ final Category category,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ final Subcategory subcategory) {
+ item.setCategory(category);
+ item.setSubcategory(subcategory);
+ return item;
+ }
+ public Category default1UpdateCategory( // <2>
+ final Categorized item) {
+ return item != null? item.getCategory(): null;
+ }
+ public Subcategory default2UpdateCategory( // <3>
+ final Categorized item) {
+ return item != null? item.getSubcategory(): null;
+ }
+}
+----
+<1> `ToDoItem` implements `Categorized`
+<2> defaults the 1-th parameter using the item's `category` property
+<3> defaults the 2-th parameter using the item's `subcategory` property
+
+
+
+
+
+== Properties
+
+For a property of type `T`, the signature is:
+
+[source,java]
+----
+public T defaultXxx() { ... }
+----
+
+
+For example:
+
+[source,java]
+----
+public class ShoppingCartItem {
+ public int getQuantity() { ... }
+ public void setQuantity(int quantity) { ... }
+
+ public int defaultProduct() {
+ return 1;
+ }
+----
+
+
+=== Alternatives
+
+There are, in fact, two other ways to set properties of a newly instantiated object to default values.
+
+The first is to use the xref:_ug_reference-methods_lifecycle_manpage-created[`created()`] callback, called by the framework when xref:_ug_reference-services-api_manpage-DomainObjectContainer[`DomainObjectContainer#newTransientInstance(...)`] is called. This method is called after any dependencies have been injected into the service.
+
+The second is more straightforward: simply initialize properties in the constructor. However, this cannot use any injected services as they will not have been initialized.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-disable.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-disable.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-disable.adoc
index 6a692d7..c6dbd2c 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-disable.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-disable.adoc
@@ -4,6 +4,90 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+
+The `disable...()` supporting method is called for properties, collections and actions. It allows the modification of the property/collection to be vetoed (ie made read-only) and to prevent the invocation of the action ("grey it out").
+
+[NOTE]
+====
+Directly mutable collections are not currently supported by the xref:_ug_wicket-viewer[Wicket viewer]; they are always implicitly disabled.
+====
+
+Typically modification/invocation is vetoed based on the state of the domain object being interacted with, though it could be any reason at all (eg the current date/time of the interaction, or the state of some other related data such as stock levels, or the identity of the calling user).
+
+
+The reason for vetoing a modification/invocation is normally returned as a string. However, Isis' xref:_ug_more-advanced_i18n[i18n support] extends this so that reasons can be internationalized.
+
+
+
+== Actions
+
+For an action the signature of the supporting method is:
+
+[source,java]
+----
+public String disableXxx(...) { ... }
+----
+
+where the returned string is the reason the action invocation is vetoed (or `null` if not vetoed), and the supporting method takes the same parameter types as the action itself.
+
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public boolean isBlacklisted() { ... }
+
+ public Order placeOrder(
+ final Product product,
+ @ParameterLayout(named="Quantity")
+ final int quantity) {
+ ...
+ }
+ public String disablePlaceOrder(
+ final Product product,
+ final int quantity
+ ) {
+ return isBlacklisted()
+ ? "Blacklisted customers cannot place orders"
+ : null;
+ }
+ ...
+}
+----
+
+
+
+== Properties and Collections
+
+For both properties and collections the signature of the supporting method is:
+
+[source,java]
+----
+public String disableXxx() { ... }
+----
+
+where the returned string is the reason the modification is vetoed (or `null` if not vetoed).
+
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public boolean isBlacklisted() { ... }
+
+ public BigDecimal getCreditLimit() { ... }
+ public void setCreditLimit(BigDecimal creditLimit) { ... }
+ public String disableCreditLimit() {
+ return isBlacklisted()
+ ? "Cannot change credit limit for blacklisted customers"
+ : null;
+ }
+ ...
+}
+----
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-get.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-get.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-get.adoc
index a62c8da..f781b37 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-get.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-get.adoc
@@ -4,6 +4,16 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+The `get...()` prefix is simply the normal JavaBean getter prefix that denotes properties or collections.
+
+When Apache Isis builds its metamodel, it first searches for the getter methods, characterizing them as either properties or collections based on the return type. It then refines the metamodel based on the presence of annotations and supporting methods.
+
+All remaining `public` methods (that do not use one of the Isis prefixes) are interpreted as actions.
+
+Any methods "left over" that _do_ use one of the Isis prefixes, are interpreted to be orphaned. Isis "fails-fast" and will not boot, instead printing an error message to the log so that the issue can be easily diagnosed.
+
+
+See also xref:_ug_reference-methods_prefixes_manpage-set[`set...()`].
+
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-hide.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-hide.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-hide.adoc
index 22c4d7e..a70e27d 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-hide.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-hide.adoc
@@ -4,6 +4,79 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+The `hide...()` supporting method is called for properties, collections and actions. It allows the property/collection to be completely hidden from view.
+
+It's comparatively rare for properties or collections to be imperatively hidden from view, but actions are sometimes hidden or shown visible (as opposed to being just xref:_ug_reference-methods_prefixes_manpage-disable[disabled], ie greyed out).
+
+
+== Actions
+
+For an action the signature of the supporting method is either:
+
+[source,java]
+----
+public bool hideXxx(...) { ... }
+----
+
+where the supporting method takes the same parameter types as the action itself, or more simply:
+
+[source,java]
+----
+public bool hideXxx() { ... }
+----
+
+with no parameters at all. Returning `true` will hide the action, returning `false` leaves it visible.
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public boolean isBlacklisted() { ... }
+
+ public Order placeOrder(
+ final Product product,
+ @ParameterLayout(named="Quantity")
+ final int quantity) {
+ ...
+ }
+ public boolean hidePlaceOrder() {
+ return isBlacklisted();
+ }
+ ...
+}
+----
+
+
+
+== Properties and Collections
+
+For both properties and collections the signature of the supporting method is:
+
+[source,java]
+----
+public boolean hideXxx() { ... }
+----
+
+where returning `true` will hide the property/collection, returning `false` leaves it visible.
+
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public boolean isBlacklisted() { ... }
+
+ public BigDecimal getCreditLimit() { ... }
+ public void setCreditLimit(BigDecimal creditLimit) { ... }
+ public boolean hideCreditLimit() {
+ return isBlacklisted();
+ }
+ ...
+}
+----
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-modify.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-modify.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-modify.adoc
index fee2690..4178943 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-modify.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-modify.adoc
@@ -4,6 +4,34 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+
+
+The `modify...()` supporting method is called -- instead of the setter -- whenever a property has been set to be set to a new value. Its purpose is to allow additional business logic to be performed.
+
+
+For example:
+
+[source,java]
+----
+public class LibraryMember {
+ public Title getFavoriteTitle() { ... }
+ public void setFavoriteTitle(Title title) { ... }
+ public void modifyFavoriteTitle(Title title) {
+ if(getTitle() != null) {
+ titleFavoritesService.decrement(getTitle()); // <1>
+ }
+ setFavoriteTitle(title); // <2>
+ titleFavoritesService.decrement(title); // <3>
+ }
+ public void clearFavoriteTitle() { ... }
+ ...
+}
+----
+<1> perform some additional business logic
+<2> update the property
+<3> perform some additional business logic
+
+
+See also xref:_ug_reference-methods_prefixes_manpage-clear[`clear...()`]`
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-removeFrom.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-removeFrom.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-removeFrom.adoc
index 093eedd..d8b014e 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-removeFrom.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-removeFrom.adoc
@@ -23,12 +23,11 @@ public class LibraryMember {
public SortedSet<Book> getBorrowed() { ... }
public void setBorrowed(SortedSet<Book> borrowed) { ... }
public void addToBorrowed(Book book) { ... }
-
- }
public void removeFromBorrowed(Book book) {
getBorrowed().remove(book); // <1>
reminderService.removeReminder(this, book); // <2>
}
+ ...
}
----
<1> update the collection
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-set.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-set.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-set.adoc
index 30d6cae..5792bd2 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-set.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-set.adoc
@@ -4,6 +4,10 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+
+The `set...()` prefix is simply the normal JavaBean setter prefix that denotes writeable properties or collections.
+
+
+See also xref:_ug_reference-methods_prefixes_manpage-get[`get...()`].
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validate.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validate.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validate.adoc
index 3f21af9..9cc30d2 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validate.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validate.adoc
@@ -4,6 +4,110 @@
:_basedir: ../
:_imagesdir: images/
-IMPORTANT: TODO
+The `validate...()` supporting method is called for properties, actions and action parameters. It allows the proposed new value for a property to be rejected, or the proposed argument of an action parameter to be rejected, or to reject a whole set of action arguments for an actio invocation.
+
+
+The reason for vetoing a modification/invocation is normally returned as a string. However, Isis' xref:_ug_more-advanced_i18n[i18n support] extends this so that reasons can be internationalized if required.
+
+
+
+== Action Parameter
+
+For an action parameter in (0-based) position _N_, and of type `T`, the signature is:
+
+[source,java]
+----
+public String validateNXxx(T proposed) { ... }
+----
+
+where the returned string is the reason why the argument is rejected (or `null` if not vetoed).
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public Order placeOrder(
+ final Product product,
+ @ParameterLayout(named="Quantity")
+ final int quantity) {
+ ...
+ }
+ public String validate0PlaceOrder(
+ final Product product) {
+ return product.isDiscontinued()
+ ? "Product has been discontinued"
+ : null;
+ }
+ ...
+}
+----
+
+
+== Action Parameter Set
+
+In addition to validating a single single action argument, it is also possible to validate a complete set of action arguments. The signature is:
+
+[source,java]
+----
+public String validateXxx(...) { ... }
+----
+
+where the returned string is the reason why the argument is rejected (or `null` if not vetoed), and the supporting method takes the same parameter types as the action itself.
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public Order placeOrder(
+ final Product product,
+ @ParameterLayout(named="Quantity")
+ final int quantity) {
+ ...
+ }
+ public String validatePlaceOrder(
+ final Product product,
+ final int quantity) {
+ return quantity > product.getOrderLimit()
+ ? "May not order more than " + product.getOrderLimit() + " items for this product"
+ : null;
+ }
+ ...
+}
+----
+
+
+
+== Properties
+
+For properties of type `T` the signature of the supporting method is:
+
+[source,java]
+----
+public String validateXxx(T proposed) { ... }
+----
+
+where the returned string is the reason the modification is vetoed (or `null` if not vetoed).
+
+
+
+For example:
+
+[source,java]
+----
+public class Customer {
+ public BigDecimal getCreditLimit() { ... }
+ public void setCreditLimit(BigDecimal creditLimit) { ... }
+ public validateCreditLimit(BigDecimal creditLimit) {
+ return creditLimit.compareTo(BigDecimal.ZERO) < 0
+ ? "Credit limit cannot be negative"
+ : null;
+ }
+ ...
+}
+----
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateAddTo.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateAddTo.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateAddTo.adoc
index 83f4817..0151793 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateAddTo.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateAddTo.adoc
@@ -15,6 +15,16 @@ Directly mutable collections are not currently supported by the xref:_ug_wicket-
====
+The signature of the supporting method for a collection with element type `E` is:
+
+[source,java]
+----
+public String validateAddToXxx(E element) { ... }
+----
+
+where the returned string is the reason the collection modification invocation is vetoed (or `null` if not vetoed). Isis' xref:_ug_more-advanced_i18n[i18n support] extends this so that reasons can be internationalized if required.
+
+
For example:
[source,java]
@@ -26,6 +36,8 @@ public class LibraryMember {
return book.isReference()? "Reference books cannot be borrowed": null;
}
public void validateRemoveFromBorrowed(Book book) { ... }
+ ...
+}
----
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateRemoveFrom.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateRemoveFrom.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateRemoveFrom.adoc
index 01d5a18..586a411 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateRemoveFrom.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_prefixes_manpage-validateRemoveFrom.adoc
@@ -15,6 +15,16 @@ Directly mutable collections are not currently supported by the xref:_ug_wicket-
====
+The signature of the supporting method for a collection with element type `E` is:
+
+[source,java]
+----
+public String validateRemoveFromXxx(E element) { ... }
+----
+
+where the returned string is the reason the collection modification invocation is vetoed (or `null` if not vetoed). Isis' xref:_ug_more-advanced_i18n[i18n support] extends this so that reasons can be internationalized if required.
+
+
For example:
[source,java]
@@ -26,6 +36,8 @@ public class LibraryMember {
public void validateRemoveFromBorrowed(Book book) {
return !book.hasBeenReadBy(this)? "You didn't read this book yet": null;
}
+ ...
+}
----
http://git-wip-us.apache.org/repos/asf/isis/blob/67e1a998/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_reserved.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_reserved.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_reserved.adoc
index f34b5a6..b77d1cd 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_reserved.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-methods_reserved.adoc
@@ -46,87 +46,10 @@ See also `iconName()` and xref:_ug_reference-methods_reserved_manpage-cssClass[`
-
-The lifecycle callback methods notify a domain entity about its interaction within the persistence lifecycle. For example, the entity is notified immediately prior to being persisted, or when it is about to be updated.
-
-[WARNING]
-====
-We believe there may some scenarios (not yet fully catalogued) where the lifecycle method is not called. As such we recommend that you don't rely on these methods and/or fully test they are called as required in your apps
-
-As an alternative, consider using Isis' event bus and domain events.
-====
-
-The lifecycle methods are:
-
-.Lifecycle methods (partial support)
-[cols="1,4a", options="header"]
-|===
-
-|Method
-|Description
-
-|xref:_ug_reference-methods_reserved_manpage-created[`created()`]
-|called when an object has just been created using xref:_ug_reference-services-api_manpage-DomainObjectContainer[`newTransientInstance()`]
-
-|xref:_ug_reference-methods_reserved_manpage-loaded[`loaded()`]
-|called when a (persistent) object has just been loaded from the object store.
-
-|xref:_ug_reference-methods_reserved_manpage-persisted[`persisted()`]
-|called when object has just been persisted from the object store.
-
-|xref:_ug_reference-methods_reserved_manpage-persisting[`persisting()`]
-|called when a (not-yet-persistent) object is just about to be persisted from the object store
-
-|xref:_ug_reference-methods_reserved_manpage-removed[`removed()`]
-|called when a (persistent) object has just been persisted from the object store
-
-|xref:_ug_reference-methods_reserved_manpage-removing[`removing()`]
-|called when a (persistent) object is just about to be deleted from the object store
-
-|xref:_ug_reference-methods_reserved_manpage-updated[`updated()`]
-|called when a (persistent) object has just been updated in the object store
-
-|xref:_ug_reference-methods_reserved_manpage-updating[`updating()`]
-|called when a (persistent) object is just about to be updated in the object store
-
-|===
-
-
-
-Some lifecycle methods have been deprecated:
-
-.Deprecated lifecycle methods
-[cols="1,4a", options="header"]
-|===
-
-|Method
-|Notes
-
-|`deleted()`
-|Replaced by xref:_ug_reference-methods_reserved_manpage-removed[`removed()`]
-
-|`deleting()`
-|Replaced by removing()`
-
-|`loading()`
-|callback for when the (persistent) object is just about to be loaded from the object store. +
-[WARNING]
-====
-This method is never called.
-====
-
-|`saved()`
-|Replaced by persisted()`
-
-|`saving()`
-|Replaced by xref:_ug_reference-methods_reserved_manpage-persisting[`persisting()`]
-
-|===
-
-
-
-
include::_ug_reference-methods_reserved_manpage-cssClass.adoc[leveloffset=+1]
-include::_ug_reference-methods_reserved_manpage-iconName.adoc[leveloffset=+1]
+include::_ug_reference-methods_reserved_manpage-disable.adoc[leveloffset=+1]
include::_ug_reference-methods_reserved_manpage-getId.adoc[leveloffset=+1]
+include::_ug_reference-methods_reserved_manpage-hide.adoc[leveloffset=+1]
+include::_ug_reference-methods_reserved_manpage-iconName.adoc[leveloffset=+1]
include::_ug_reference-methods_reserved_manpage-title.adoc[leveloffset=+1]
+include::_ug_reference-methods_reserved_manpage-validate.adoc[leveloffset=+1]