[
https://issues.apache.org/jira/browse/ISIS-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dan Haywood closed ISIS-454.
----------------------------
Resolution: Fixed
Fix Version/s: (was: core-2.0.0)
core-1.8.0
This was actually fixed as part of ISIS-970, released in v1.8.0
> 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
> Components: Core
> Affects Versions: core-1.2.0
> Reporter: Jeroen van der Wal
> Assignee: Dan Haywood
> Priority: Minor
> Fix For: core-1.8.0
>
>
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)