You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2012/07/01 21:32:42 UTC

Re: AROW viewer now on github

belated...

On 28 June 2012 03:09, Adam Howard <ho...@gmail.com> wrote:

> > Those icons are nice...
>
> I found them on the IconArchive website[1]. They are all under different
> levels of CreativeCommons [2][3].
>

Thanks - I'll reference them from the icons site.


>
> >> Also, if you'd like, I could host the apacheisisdemo app on my heroku
> >> account.
>
> ... your Revenue Commisioners project on github[4].
>
>
Sorry, had misunderstood.  Yes, would welcome that.  Though it's not a
priority for me.




>  >> One question on the json viewer implementation though. Is it planned
> >> to support not including repository methods in the json that are
> >> annotated with @NotInServicesMenu? Or is there another way to handle
> >> that? Your model has alot of contributed actions that I see are not
> >> displayed in the html viewer.
> >>
> > We can certainly support it, though it'll have to be via the "extensions"
> > json-prop, probably of one of the domain-types representations.
>
> Couldn't those actions just be excluded from the service's json as if they
> were
> hidden? It seems like that is what the html viewer does…
>
> I just went back to look at the apacheisisdemo and I see that you've
> annotated
> the repository classes as @Hidden (CustomerProfiles) but the methods are
> not
> annotated (profileFor). This must be why the repositories don't show up on
> the
> htmlviewer but the methods are still contributed on the objects of their
> first
> argument. I have some methods that should only be contributed but they are
> in
> repositories that should not be hidden.
>
> 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!)




> 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.





>
>
> ..Thanks for setting up the git repo. This is my first git
> project so I still need to learn the best way to work with all of these
> separate
> but related repositories (Apache Isis, AROW, and my sample app).
>

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.

Cheers
Dan

Re: AROW viewer now on github

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 2 July 2012 05:48, Adam Howard <ho...@gmail.com> wrote:

> Replied inline...
>
> On Jul 1, 2012, at 2:33 PM, Dan Haywood <da...@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

Re: AROW viewer now on github

Posted by Adam Howard <ho...@gmail.com>.
Replied inline...

On Jul 1, 2012, at 2:33 PM, Dan Haywood <da...@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?

>> 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.

> 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?

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.