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 2013/09/12 08:14:09 UTC
svn commit: r1522455 - /isis/site/trunk/content/applib-guide/how-tos/
Author: danhaywood
Date: Thu Sep 12 06:14:08 2013
New Revision: 1522455
URL: http://svn.apache.org/r1522455
Log:
conditional choices; deleting unreferenced files
Added:
isis/site/trunk/content/applib-guide/how-tos/how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.md
Removed:
isis/site/trunk/content/applib-guide/how-tos/how-to-01-000-How-to-write-a-basic-Domain-Entity-or-Service.md
isis/site/trunk/content/applib-guide/how-tos/how-to-02-000-How-to-add-business-rules.md
isis/site/trunk/content/applib-guide/how-tos/how-to-03-000-How-to-provide-drop-downs-and-default-values.md
isis/site/trunk/content/applib-guide/how-tos/how-to-05-000-How-to-provide-additional-UI-hints.md
isis/site/trunk/content/applib-guide/how-tos/how-to-06-000-How-to-deal-with-errors.md
isis/site/trunk/content/applib-guide/how-tos/how-to-07-000-How-to-handle-entity-persistence-lifecycle.md
Modified:
isis/site/trunk/content/applib-guide/how-tos/about.md
isis/site/trunk/content/applib-guide/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.md
isis/site/trunk/content/applib-guide/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.md
Modified: isis/site/trunk/content/applib-guide/how-tos/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/about.md?rev=1522455&r1=1522454&r2=1522455&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/about.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/about.md Thu Sep 12 06:14:08 2013
@@ -96,21 +96,30 @@ drop-down list box.
In a similar vein, there may be a default value for an action parameter;
this can also be specified.
+For properties:
+
* [How to specify a set of choices for a property](./how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.html)
* [How to specify an auto-complete for a property](./how-to-03-015-How-to-specify-an-autocomplete-for-a-property.html)
* [How to specify the default value of an object property](./how-to-03-017-How-to-specify-default-value-of-an-object-property.html)
+For actions:
+
* [How to specify a set of choices for an action parameter](./how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.html)
* [How to specify an auto-complete for an action parameter](./how-to-03-025-How-to-specify-an-autocomplete-for-an-action-parameter.html)
-* [How to specify that a class of objects has a limited number of instances](./how-to-03-030-How-to-specify-that-a-class-of-objects-has-a-limited-number-of-instances.html)
+* [How to specify default values for an action parameter](./how-to-03-050-How-to-specify-default-values-for-an-action-parameter.html)
-* [How to find an entity (for an action parameter or property) using auto-complete](./how-to-03-040-How-to-find-an-entity-(for-an-action-parameter-or-property)-using-auto-complete.html)
+* [How to specify conditional choices for action parameters (eg category/subcategory](./how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.html)
-* [How to specify default values for an action parameter](./how-to-03-050-How-to-specify-default-values-for-an-action-parameter.html)
+
+For both:
+
+* [How to specify (for an action parameter or property) that a class has a limited number of instances](./how-to-03-030-How-to-specify-that-a-class-of-objects-has-a-limited-number-of-instances.html)
+
+* [How to find an entity (for an action parameter or property) using auto-complete](./how-to-03-040-How-to-find-an-entity-(for-an-action-parameter-or-property)-using-auto-complete.html)
@@ -193,11 +202,13 @@ get visibility into and influence this b
* [How to hook into the object lifecycle using callbacks](./how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.html)
-##How to handle security concerns
+##How to control access to entity features
+
+*Isis* allows you to control access to entities either using application logic or through a pluggable authorisation manager.
-* [Hiding, disabling or validating for specific users or roles](./how-to-08-010-Hiding,-disabling-or-validating-for-specific-users-or-roles.html)
+* [How to write application logic to hide, disable and validate for specific users/roles](./how-to-08-010-Hiding,-disabling-or-validating-for-specific-users-or-roles.html)
-* [How to use Isis authorization manager](./how-to-08-020-How-to-use-Isis-authorization-manager.html)
+* [How to use Isis' authorization manager](./how-to-08-020-How-to-use-Isis-authorization-manager.html)
Modified: isis/site/trunk/content/applib-guide/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.md?rev=1522455&r1=1522454&r2=1522455&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.md Thu Sep 12 06:14:08 2013
@@ -18,7 +18,7 @@ or alternatively
public PropertyType[] choicesPropertyName()
-where `PropertyType` is the same type as that of the property itself.
+where `PropertyType` is the same type as that of the property itself. Any subtype of `Collection` may also be used.
For example:
Modified: isis/site/trunk/content/applib-guide/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.md?rev=1522455&r1=1522454&r2=1522455&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.md Thu Sep 12 06:14:08 2013
@@ -20,7 +20,7 @@ The syntax is:
public List<ParameterType> choicesNActionName()
-where N indicates the 0-based parameter number.
+where N indicates the 0-based parameter number. Any subtype of `Collection` may also be used.
For example:
Added: isis/site/trunk/content/applib-guide/how-tos/how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.md?rev=1522455&view=auto
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.md (added)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-03-029-How-to-specify-conditional-choices-for-action-parameters.md Thu Sep 12 06:14:08 2013
@@ -0,0 +1,28 @@
+How to specify conditional choices for action parameters
+-------------------------------------------------------
+
+Sometimes there is a dependency between the value of one parameter and the set of values to another. For example, if selecting a particular category, then this implies a set of subcategories belonging to that category. Or, if selecting a particular country, then this implies a set of states/counties within that country.
+
+To specify such a dependency, the `choicesNActionName()` can be overloaded with the `N-1` preceding parameters.
+
+The syntax is:
+
+ public Collection<ParameterType> choicesNActionName(arg0, arg1, ..., argN-1)
+
+where N indicates the 0-based parameter number. Any subtype of `Collection` may also be used.
+
+For example:
+
+ public class Book {
+ public void categorize(
+ Genre genre,
+ Subgenre subgenre) {
+ ...
+ }
+ public Collection<Subgenre> choices1Categorize(Genre genre) {
+ return genre.getSubgenres();
+ }
+ ....
+ }
+
+> NOTE: at this writing this capability does not exist for properties that have dependencies. Instead, make the properties read-only (using `@Disabled`) and provide an action to update them instead.
\ No newline at end of file