[ 
https://issues.apache.org/jira/browse/ISIS-1732?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-1732:
------------------------------
    Fix Version/s:     (was: 1.18.0)
                   2.0.3

> Document "hidden" as a supported method for services.
> -----------------------------------------------------
>
>                 Key: ISIS-1732
>                 URL: https://issues.apache.org/jira/browse/ISIS-1732
>             Project: Isis
>          Issue Type: Improvement
>    Affects Versions: 1.15.0
>            Reporter: Dan Haywood
>            Priority: Minor
>             Fix For: 2.0.3
>
>
> eg, in kitchensink, we have:
> {code}
> public abstract class RepositoryAbstract<T extends Entity> {
>     private final Class<T> cls;
>     public RepositoryAbstract(Class<T> cls, Visibility visibility) {
>         this.cls = cls;
>         this.visibility = visibility;
>     }
>     //region > visibility
>     private final Visibility visibility;
>     protected enum Visibility {
>         VISIBLE,
>         NOT_VISIBLE
>     }
>     public boolean hidden() {
>         return this.visibility == Visibility.NOT_VISIBLE;
>     }
>     //endregion
>  ....
> {code}
> and then:
> {code}
> @DomainService(
>         repositoryFor = ChildObject.class
> )
> public class ChildObjects extends RepositoryAbstract<ChildObject> {
>     public ChildObjects() {
>         super(ChildObject.class, Visibility.NOT_VISIBLE);
>     }
>     public ChildObject create(
>             final String name,
>             final ParentObject parentObject) {
>         return repositoryService.persist(ChildObject.create(name, 
> parentObject));
>     }
>     public List<ChildObject> listAll() {
>         return repositoryService.allInstances(ChildObject.class);
>     }
> }
> {code}
> if use super(...VISIBLE) then this service appears in the menu.  so, 
> "hidden()" is a way of globally hiding an object (or a domain service, at 
> least).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to