Return-Path: Delivered-To: apmail-incubator-isis-commits-archive@minotaur.apache.org Received: (qmail 25636 invoked from network); 13 Dec 2010 08:00:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 08:00:43 -0000 Received: (qmail 34559 invoked by uid 500); 13 Dec 2010 08:00:42 -0000 Delivered-To: apmail-incubator-isis-commits-archive@incubator.apache.org Received: (qmail 34541 invoked by uid 500); 13 Dec 2010 08:00:42 -0000 Mailing-List: contact isis-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: isis-dev@incubator.apache.org Delivered-To: mailing list isis-commits@incubator.apache.org Received: (qmail 34534 invoked by uid 99); 13 Dec 2010 08:00:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 08:00:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 08:00:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0C76023889E7; Mon, 13 Dec 2010 08:00:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1045030 - /incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml Date: Mon, 13 Dec 2010 08:00:13 -0000 To: isis-commits@incubator.apache.org From: danhaywood@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101213080014.0C76023889E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: danhaywood Date: Mon Dec 13 08:00:13 2010 New Revision: 1045030 URL: http://svn.apache.org/viewvc?rev=1045030&view=rev Log: more on the applib documentation Modified: incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml Modified: incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml?rev=1045030&r1=1045029&r2=1045030&view=diff ============================================================================== --- incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml (original) +++ incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml Mon Dec 13 08:00:13 2010 @@ -3198,18 +3198,13 @@ public class Money extends Magnitude { Recognized Methods and Method Prefixes - *** + Methods and method prefixes recognized by Apache + Isis using the default programming model. - *** - - The Java 1.5 reflector allows the domain modeller to define - behaviourally complete domain objects, provide maximum feedback to the - user, and control any interaction that may take place (rather than place - that code in each and every user interface and back-end). This sections - lists the explicit methods that are recognised by the standard - reflector. All methods must be public to be - recognised. + The following table lists all of the methods or method prefixes + that are recognized by Apache Isis' default + programming model: @@ -3631,54 +3626,39 @@ public class Money extends Magnitude { (*) deprecated. - Methods that do not get matched with any of the listed rules are - deemed to be action methods that we expect the user to invoke via the - user interface. These are public methods, of the following format - - public void <actionName>([<property type> param]...) -public <type> <actionName>([<property type> param]...) - - that are not used for fields, titles, or for controlling other - methods. Essentially they are the methods left over from generating all - other aspects of the class. When such a method returns a reference the - framework will attempt to display that object. If an action method - returns null then nothing will be - displayed. + In order to be recognized, all methods must be + public. Any methods that do not match are deemed to be + action methods that the user can invoke from the user interface. Recognized Annotations - *** + All the annotations recognized in the Apache + Isis default programming model. - + This chapter defines the set of annotations that are recognised by + the Apache Isis default programming model. - + + @ActionOrder - + Note: The recommended mechanism for specifying the + order in which actions are listed to the user is + @MemberOrder (see ). - This section defines the set of annotations that are recognised by - the Apache Isis Java Programming Model. + @ActionOrder provides a mechanism to specify the + order in which actions appear in the user interface, in which the + order is specified in one place in the class. - - @ActionOrder + The syntax is: - Note: The recommended mechanism for specifying the order in - which actions are listed to the user is @MemberOrder (see - below). @ActionOrder provides an alternative mechanism, - in which the order is specified in one place in the class, with the - added advantage (currently) that you can easily specify groupings - (which may be rendered by the viewer as sub-menus). However, - @ActionOrder is more 'brittle' to change: if you change - the name of an existing action you will need to ensure that the - corresponding name within the @ActionOrder annotation is - also changed. + @ActionOrder("<comma separated list of action names>") - The syntax is: @ActionOrder("<comma - separated list of action names>") (the action names are - not case sensitive). + The action names are not case sensitive. For example: @@ -3692,10 +3672,12 @@ public class Customer { ... } - Actions can be grouped together by surrounding the group with - brackets, and prefixing the group with name and colon. This - information may be used by the viewing mechanism to render actions - into sub-menus. For example: + Compared to @MemberOrder, there is (currentlyon) one additional + advantage in that you can easily specify groupings (which may be + rendered by the viewer as sub-menus). This information may be used by + the viewing mechanism to render actions into sub-menus. + + For example: @ActionOrder("(Account Management: PlaceOrder, CheckCredit), (Personal Details: ChangeOfAddress, AddEmail)") public class Customer { @@ -3710,6 +3692,21 @@ public class Customer { ... } + + However, @ActionOrder is more 'brittle' to change: + if you change the name of an existing action you will need to ensure + that the corresponding name within the @ActionOrder + annotation is also changed. + + + + @Aggregated + + *** + + + + @@ -3717,7 +3714,9 @@ public class Customer { For immutable objects where there is a bounded set of instances, the @Bounded annotation can be - used. For example: + used. + + For example: @Bounded public class County { @@ -3727,10 +3726,14 @@ public class County { The number of instances is expected to be small enough that all instance can be held in memory. The viewer will use this information to render all the instances of this class in a drop-down list or - equivalent. (Note: Although this is not enforced, @Bounded is intended for use on final classes. Its behaviour when used on - interfaces, or classes with sub-classes is not specified). + equivalent. + + + Although this is not enforced, @Bounded is intended for use on final classes. Its behaviour when used on + interfaces, or classes with sub-classes is not specified + @@ -3739,6 +3742,19 @@ public class County { The @Debug annotation marks an action method as available in debug mode only, and so will not normally be displayed by the user interface. + + The exact means to access @Debug actions + depends on the viewer. + + + + @Defaulted + + + + *** + + @@ -3748,45 +3764,58 @@ public class County { is used to provide a short description of something that features on the user interface. How this description is used will depend upon the viewing mechanism - but it may be thought of as being like a 'tool - tip'. Descriptions may be provided for objects, members (properties, + tip'. + + Descriptions may be provided for objects, members (properties, collections and actions), and for individual parameters within an action method. @DescribedAs therefore works in a very similar manner to @Named. + moreinfo="none">@Named (see ). + + + Providing a description for an object - Providing a description for an object + To provide a description for an object, use the @DescribedAs annotation immediately before + the declaration of that object class. - To provide a description for an object, use the @DescribedAs annotation immediately before - the declaration of that object class. For example: + For example: - @DescribedAs("A Customer who may have originally become known to us via " + + @DescribedAs("A Customer who may have originally become known to us via " + "the marketing system or who may have contacted us directly.") public class ProspectiveSale { ... } + - Providing a description for a member + + Providing a description for an object member - Any member (property, collection or action) may provide a - description. To specify this description, use the @DescribedAs annotation immediately before - the declaration of that member. For example: + Any member (property, collection or action) may provide a + description. To specify this description, use the @DescribedAs annotation immediately before + the declaration of that member. - public class Customer { + For example: + + public class Customer { @DescribedAs("The name that the customer has indicated that they wish to be " + "addressed as (e.g. Johnny rather than Jonathan)") public String getFirstName() { ... } } + - Providing a description for an action - parameter + + Providing a description for an action parameter - To provide a description for an individual action parameter, use - the @DescribedAs annotation in-line - i.e. immediately before the parameter declaration. For example: + To provide a description for an individual action parameter, + use the @DescribedAs annotation + in-line i.e. immediately before the parameter declaration. - public class Customer { + For example: + + public class Customer { public Order placeOrder( Product product, @Named("Quantity") @@ -3801,6 +3830,7 @@ public class ProspectiveSale { } ... } + @@ -3811,7 +3841,9 @@ public class ProspectiveSale { When applied to the property it means that the user may not modify the value of that property (though it may still be modified programmatically). When applied to an action method, it means that the - user cannot invoke that method. For example: + user cannot invoke that method. + + For example: public class Customer { @Disabled @@ -3824,11 +3856,12 @@ public class ProspectiveSale { Note that if an action is marked as @Disabled, it will be shown on the user - interface but cannot ever be invoked. One possible reason to do this - is during prototyping, to indicate an action that is still to be - developed. If a method is intended for programmatic use, but not - intended ever to be invoked directly by a user, then it should be - marked as @Hidden instead. + interface but cannot ever be invoked. The only possible reason we can + think to do this is during prototyping, to indicate an action that is + still to be developed. If a method is intended for programmatic use, + but not intended ever to be invoked directly by a user, then it should + be marked as @Hidden + instead. This annotation can also take a single parameter indicating when it is to be hidden, for example the following code would disable the @@ -3848,6 +3881,26 @@ public class ProspectiveSale { + @Encodable + + + + *** + + + + + + @EqualByContent + + + + *** + + + + + @Executed The @Executed annotation overrides the @@ -3880,6 +3933,16 @@ public class ProspectiveSale { + @Facets + + + + *** + + + + + @FieldOrder Note: The recommended mechanism for specifying the order in @@ -3953,6 +4016,16 @@ public class Customer { + @Ignore + + + + *** + + + + + @Immutable The @Immutable annotation may @@ -4046,7 +4119,7 @@ public class Email { parameters. - + @MemberOrder @MemberOrder is the recommended mechanism for @@ -4200,7 +4273,7 @@ public class Email { validation, being passed the proposed value. - + @Named The @Named annotation is used @@ -4284,6 +4357,26 @@ public class CustomerImpl implements Cus } + + @NotContributed + + + + *** + + + + + + @NotInRepositoryMenu + + + + *** + + + + @NotPersistable @@ -4396,6 +4489,16 @@ public class InputForm { + @Parseable + + + + *** + + + + + @Plural Where Apache Isis displays a collection of several objects it @@ -4416,6 +4519,16 @@ public class Child { + @Prototype + + + + *** + + + + + @RegEx The @RegEx annotation may be @@ -4517,6 +4630,10 @@ public class ComplexNumber { Supporting Classes + + *** + + @@ -4525,12 +4642,46 @@ public class ComplexNumber { Title creation asdfsd + + The TitleBuffer helper class + + - Reason text creation + Reason text creation (for disable and validate methods) + + There are two different classes provided to help build reasons + returned by disableXxX() and + validateXxx() methods: + + + + the + org.apache.isis.applib.util.ReasonBuffer + helper class + + + + the + org.apache.isis.applib.util.Reasons helper + class + + + + For example: + + public class Customer { + ... + public String validatePlaceOrder(Product p, int quantity) { + return Reasons.coalesce( + whetherCustomerBlacklisted(this), + whetherProductOutOfStock(p) + ); + } +} - asdd + Which you use (if any) is up to you. @@ -4552,14 +4703,36 @@ public class ComplexNumber { - Fixtures - - - Fixtures + Clock - *** - + + + + Fixtures + + + + + + + + + + Adapter class hierarchy + + + + + + AbstractContainedObject --> DomainObjectContainer + + AbstractDomainObject : AbstractContainedObject + + AbstractService : AbstractContainedObject + + AbstractFactoryAndRepository : AbstractService +