[ 
https://issues.apache.org/jira/browse/ISIS-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13761911#comment-13761911
 ] 

Dan Haywood commented on ISIS-454:
----------------------------------

The existing "disableXxx" method is similar to this; however I don't know 
whether there is any scoping so that disablement rules would override the 
default for the type.
                
> New mechanism to disable members "globally".  However, any disablement rules 
> applied on the member should overrule the policy defined on the type.
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-454
>                 URL: https://issues.apache.org/jira/browse/ISIS-454
>             Project: Isis
>          Issue Type: New Feature
>            Reporter: Jeroen van der Wal
>            Assignee: Dan Haywood
>            Priority: Minor
>
> If done using a method, this would be something like:
> public String disable(String memberName, MemberType memberType) {
>     if(memberName.equals("notes")) { return null; }
>     if(memberType == MemberType.PROPERTY) {
>          WithStatus ws = (WithStatus)domainObject;
>          return ws.isLocked()? "cannot modify because locked": null;
>      }
>     return null;
> }
> If done using an annotation, this would be something like:
> @Disabled(policy=StateIsLockedPolicy.class)
> public abstract class MyDomainObject<T extends EstatioDomainObject<T>, S 
> extends Lockable> extends MyDomainObject<T> implements WithStatus<T,S> {
>     public static StateIsLockedPolicy implements DisabledPolicy {
>         public String disable(Object domainObject, String memberName, 
> MemberType memberType) {
>             if(memberName.equals("notes")) { return null; }
>             if(memberType == MemberType.PROPERTY) {
>                 WithStatus ws = (WithStatus)domainObject;
>                 return ws.isLocked()? "cannot modify because locked": null;
>             }
>             return null;
>         }
>     }
>     ...
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to