incubator-isis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <...@haywood-associates.co.uk>
Subject Re: AROW viewer now on github
Date Mon, 02 Jul 2012 06:42:21 GMT
On 2 July 2012 05:48, Adam Howard <howard.adam@gmail.com> wrote:

> Replied inline...
>
> On Jul 1, 2012, at 2:33 PM, Dan Haywood <dan@haywood-associates.co.uk>
> wrote:
>
> >> So, firstly, it looks like @Hidden repositories are still included in
> the
> >> /services representation in the json-viewer (even in trunk as of last
> >> week).
> >
> > In which case, that's an error in the restfulobjects-viewer (nee
> > json-viewer).  I've made a note to fix (unless you fix first!)
>
> I'll try my best :) The html viewer checks
> serviceObjectAdapter.getSpecification().isHidden while it is building
> it's navigation. This method just checks that HiddenFacet is present
> so even marking the service class as @Hidden(When.NEVER) will hide it
> in the html viewer. The restfulobjects viewer would handle this in the
> ListReprRenderer but I think we want something better than just
> checking for the hidden facet. It could be hidden because of
> authorities or some business logic reason. This would also affect any
> other list results (like an actionresult that is a list.) Does
> something like ObjectMember.isVisible(AuthenticationSession,
> ObjectAdapter) exist for whole domain objects?
>

Good analysis.

The answer is no, there is no such method, other than the one you've
already found - objectAdapter.getSpecification.isHidden().

The reason there is no such method, ie that we only check whether the type
is hidden - is that the Isis programming conventions don't yet define any
imperative method (eg hideInstance()) that is used to determine whether a
particular object instance should be hidden in the UI.  That's not to say
it's a bad idea, just never been required.  If you think that's a good use
case, then raise a JIRA on it.

In the meantime, it does make sense to make the restfulobjects-viewer
similar to the other viewers, ie to call the
objectAdapter.getSpecification().isHidden() method when creating the
services JSON.



> >> And, secondly, is my original question. Can methods annotated
> >> @NotInServicesMenu be excluded from the /services representation but
> still
> >> included as contributed actions?
> >>
> >> Yes, that's certainly the intent of that annotation.  So, I've made a
> note
> > to check this also.
>
> I did some research into the restfulobjects, html, and dnd viewers and
> I don't think any of them respect this annotation. It looks like the
> appropriate course is to make NotInServiceMenuFacet implement
> HidingInteractionAdvisor and return a "hidden reason" string only if
> the object is a service. This change is in the metamodel so it should
> fix it for both the restfulobjects and html viewers. I don't know if
> the dnd viewer checks for hidden actions in the same way. I'll try
> going down this path and you can let me know if that is the wrong
> direction.
>

Again, good analysis.  That's exactly the correct course of action, and
will solve it for all viewers.



>
> > You might have noticed that I finished renaming json-viewer to
> > restfulobjects-viewer in the SVN trunk, and that has now been pushed to
> my
> > github.dom/danhaywood/apacheisis repository for your delectation.
>
> Since this is my first git and github project I don't know exactly how
> to manage this. Should I fork your apacheisis repo into my github
> account and then develop against that? Then when I have something
> ready I send you a pull request?
>

Yup, that's how it works!

You might want to configure your local GIT instance so that it rebases on
pull.  That should make it easier to preserve a linear history in the repo.
 To do that, you can either use:

git pull --rebase

or you can do

git fetch
git rebase

or you can use

git config autosetuprebase always
git config branch.master.rebase true

so that any git pull will automatically be done with the --rebase flag.




> Thanks.
> --
> Adam
> >
>
>
> p.s. all of the above is referring to version 0.2.0-incubating of the
> json(restfulobjects) and html viewers, and version 0.1.2-incubating of
> the dnd viewer. I apologize if any or all of these issues have been
> solved in trunk. I'll try them out with the latest code tomorrow.
> Wanted to get this email out to you since it seems like we can only
> have about one discussion a day due to the time difference.
>

I doubt they have, but no need to apologize... just very happy to have your
time and energy being devoted to Isis/RO!

Cheers
Dan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message