You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Willie Loyd Tandingan <ta...@gmail.com> on 2015/10/13 20:02:19 UTC

Restful objects list action result with domain object representation instead of links

Hi!

We're quite new to Apache ISIS and would like to use it for our backend
mainly using the restful objects viewer for the frontend implemented as
SPA. We only use the wicket viewer in development and prototyping. So far,
we've gotten highly positive, much amaze feedbacks from the developers due
to its free UI and they can focus more on business logic.

Most entities usually have CRUD pages and a view page in the form of a
grid. In the wicket viewer, actions that return list are shown as tables
with the properties as columns while honoring UI hints. Is it possible to
apply this behaviour to restful objects? Currently, actions returning a
list of domain objects only return links with the title and I would like it
to include/exclude other properties that are seen/unseen in the wicket
viewer. The user guide [1] shows an option to allow UI hints but it seems
to only apply specifically to collections rendering eagerly.

I had a quick look at the restful objects renderer code and it seems that
what I needed is ListReprRenderer with DomainObjectReprRenderer. The action
returning the list of domain object always has a parameter for pagination.

Thanks in advance!

[1] https://isis.apache.org/guides/ug.html#7.1.-features

RE: Restful objects list action result with domain object representation instead of links

Posted by Cesar Lugo <ce...@sisorg.com.mx>.
Just looked into it, it looks like a very helpful feature to significantly simplify and improve client requests. Would this work also for ViewModels?

Cesar.

-----Original Message-----
From: Willie Loyd Tandingan [mailto:tandingan.wlb@gmail.com] 
Sent: Wednesday, November 11, 2015 8:44 AM
To: users@isis.apache.org
Subject: Re: Restful objects list action result with domain object representation instead of links

Hey Dan,

I just tried it and works great for domain object, properties, collections!

Is it possible to extend it also for action results? Our use case involves search actions (with keywords, or all) returning lists that need to be displayed in a grid.


Many thanks,
Willie

On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> Hi Willie,
>
> Edit:this was in my drafts, forgot to send! Don't think it says 
> anything you didn't work out already...
>
> just following up, I've got the x-ro-follow-links stuff working to 
> support the eager loading of either collections, or of parent 
> references; ie
> ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was 
> to make it fully generic, but that's a lot of testing without 
> necessarily any real use case.  So I think I'm going to descope it 
> just to support your use cases.
>
> To explain how to use this feature I've recorded a screencast [1] 
> which uses the kitchensink app [2]
>
> If you want to try this out, you'll need to checkout the ISIS-1232 
> branch and build locally.
>
> Feedback welcome!
>
> Thx
> Dan
>
> [1] https://youtu.be/hSKnqqBQ7Zo
> [2] https://github.com/isisaddons/isis-app-kitchensink
> Hi Willie,
>
> I admit I haven't thought about any of this too much over and above 
> what's in the spec (that I wrote a *long* time ago).  I just wanted to 
> commit myself mentally to doing this stuff soon.
>
> I know that some of this stuff has been implemented on Naked 
> Objects.NET, so I will check with those guys (Richard and Stef) to see how they did it.
>
> But if you have ideas, please feel free to comment on the tickets raised.
>
> Thx
> Dan
>
>
>
> On 4 November 2015 at 16:57, Willie Loyd Tandingan < 
> tandingan.wlb@gmail.com>
> wrote:
>
> > That's great to hear!
> >
> > I'm pretty curious on how x-ro-sort-by, x-ro-page, and 
> > x-ro-page-size
> will
> > be implemented. Will these parameters be acquired from a request 
> > scoped service or something like an action invocation context? How 
> > about the properties for the paged collection e.g. total number of 
> > records, page number, size, etc.?
> >
> > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> dan@haywood-associates.co.uk>
> > wrote:
> >
> > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > I'll
> > > aim to implement the first two (x-ro-follow-links, table grids) in
> > 1.11.0.
> > >
> > > Thx
> > > Dan
> > >
> > > https://issues.apache.org/jira/browse/ISIS-1232
> > > https://issues.apache.org/jira/browse/ISIS-1233
> > > https://issues.apache.org/jira/browse/ISIS-1234
> > > https://issues.apache.org/jira/browse/ISIS-1235
> > >
> > >
> > > On 15 October 2015 at 22:26, Dan Haywood 
> > > <dan@haywood-associates.co.uk
> >
> > > wrote:
> > >
> > > > OK, I can focus on those sections, as and when I get the chance.
> > > >
> > > > IIRC, I did implement some of the x-ro-follow-links stuff, but 
> > > > it
> must
> > > > have been over 2 years ago, so I forget the details as to how to 
> > > > make
> > it
> > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan < 
> > > > tandingan.wlb@gmail.com> wrote:
> > > >
> > > >> Hello Dan,
> > > >>
> > > >> The short answer is no.  I'm not averse to enhancing this with
> > > extensions
> > > >> > as they make sense.
> > > >> >
> > > >> > But the longer answer is that there a couple of SPI services 
> > > >> > that
> > > allow
> > > >> you
> > > >> > to customize the representations, [1], [2].  The default RO
> > > >> representations
> > > >> > are performed by an implementation of [1].
> > > >> >
> > > >> > Eventually I'm thinking that Isis might provide 
> > > >> > out-of-the-box implementations for HAL, Collection+JSON, 
> > > >> > Siren etc... but you
> might
> > > >> find
> > > >> > that your client-side (Javascript?) widget UI libraries work 
> > > >> > best
> > with
> > > >> some
> > > >> > other more "adhoc" representations.
> > > >> >
> > > >> > What these SPI services *don't* allow is for the resources 
> > > >> > defined
> > by
> > > RO
> > > >> > (or their input JSON) to change.  I don't see any particular 
> > > >> > need
> to
> > > >> > customize this, though.
> > > >> >
> > > >>
> > > >> I think I saw ContentMappingService being used in ToDoApp. 
> > > >> Using
> those
> > > >> SPIs
> > > >> would work, however while going through the Spiro framework as
> > discussed
> > > >> in
> > > >> the other thread, I saw interesting additional sections in the 
> > > >> RO
> spec
> > > >> v1.1.0 about:
> > > >>
> > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > >>
> > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> there
> > > yet.
> > > >> Those sections, especially 34.9, addresses our need.
> > > >>
> > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > >> x-ro-page-size)
> > > >> are also nice to haves.
> > > >>
> > > >
> > > >
> > >
> >
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 21 November 2015 at 16:43, Willie Loyd Tandingan <tandingan.wlb@gmail.com
> wrote:

> There seems to be an existing support for following items in a list in
> ListReprRenderer though since invoking actions can use query parameters to
> specify the action's parameters, it coughs up a "199 RestfulObjects
> Argument 'x-ro-follow-links' found but no such parameter" whenever you
> specify x-ro-follow-links.
>
> I could get follow links to work for action results by ignoring parameters
> starting with "x-ro" in ObjectActionArgHelper. Though a bit crude, it does
> follow links for action results...
>

Just (belatedly) following up on this; seems to me that this is the most
straightforward thing to do, so have done it!

Cheers
Dan



>
> On Wed, Nov 11, 2015 at 10:44 PM, Dan Haywood <
> dan@haywood-associates.co.uk>
> wrote:
>
> > It would.  I'll look into it.
> >
> > Thx
> > Dan
> >
> >
> > On 11 November 2015 at 14:43, Willie Loyd Tandingan <
> > tandingan.wlb@gmail.com
> > > wrote:
> >
> > > Hey Dan,
> > >
> > > I just tried it and works great for domain object, properties,
> > collections!
> > >
> > > Is it possible to extend it also for action results? Our use case
> > involves
> > > search actions (with keywords, or all) returning lists that need to be
> > > displayed in a grid.
> > >
> > >
> > > Many thanks,
> > > Willie
> > >
> > > On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <
> > dan@haywood-associates.co.uk
> > > >
> > > wrote:
> > >
> > > > Hi Willie,
> > > >
> > > > Edit:this was in my drafts, forgot to send! Don't think it says
> > anything
> > > > you didn't work out already...
> > > >
> > > > just following up, I've got the x-ro-follow-links stuff working to
> > > support
> > > > the eager loading of either collections, or of parent references; ie
> > > > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was
> to
> > > > make it fully generic, but that's a lot of testing without
> necessarily
> > > any
> > > > real use case.  So I think I'm going to descope it just to support
> your
> > > use
> > > > cases.
> > > >
> > > > To explain how to use this feature I've recorded a screencast [1]
> which
> > > > uses the kitchensink app [2]
> > > >
> > > > If you want to try this out, you'll need to checkout the ISIS-1232
> > branch
> > > > and build locally.
> > > >
> > > > Feedback welcome!
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > [1] https://youtu.be/hSKnqqBQ7Zo
> > > > [2] https://github.com/isisaddons/isis-app-kitchensink
> > > > Hi Willie,
> > > >
> > > > I admit I haven't thought about any of this too much over and above
> > > what's
> > > > in the spec (that I wrote a *long* time ago).  I just wanted to
> commit
> > > > myself mentally to doing this stuff soon.
> > > >
> > > > I know that some of this stuff has been implemented on Naked
> > Objects.NET,
> > > > so I will check with those guys (Richard and Stef) to see how they
> did
> > > it.
> > > >
> > > > But if you have ideas, please feel free to comment on the tickets
> > raised.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > >
> > > >
> > > > On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> > > > tandingan.wlb@gmail.com>
> > > > wrote:
> > > >
> > > > > That's great to hear!
> > > > >
> > > > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and
> x-ro-page-size
> > > > will
> > > > > be implemented. Will these parameters be acquired from a request
> > scoped
> > > > > service or something like an action invocation context? How about
> the
> > > > > properties for the paged collection e.g. total number of records,
> > page
> > > > > number, size, etc.?
> > > > >
> > > > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > > > dan@haywood-associates.co.uk>
> > > > > wrote:
> > > > >
> > > > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for
> > these.
> > > > > I'll
> > > > > > aim to implement the first two (x-ro-follow-links, table grids)
> in
> > > > > 1.11.0.
> > > > > >
> > > > > > Thx
> > > > > > Dan
> > > > > >
> > > > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > > > >
> > > > > >
> > > > > > On 15 October 2015 at 22:26, Dan Haywood <
> > > dan@haywood-associates.co.uk
> > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > OK, I can focus on those sections, as and when I get the
> chance.
> > > > > > >
> > > > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but
> it
> > > > must
> > > > > > > have been over 2 years ago, so I forget the details as to how
> to
> > > make
> > > > > it
> > > > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > > > >
> > > > > > > Thx
> > > > > > > Dan
> > > > > > >
> > > > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > > > > tandingan.wlb@gmail.com> wrote:
> > > > > > >
> > > > > > >> Hello Dan,
> > > > > > >>
> > > > > > >> The short answer is no.  I'm not averse to enhancing this with
> > > > > > extensions
> > > > > > >> > as they make sense.
> > > > > > >> >
> > > > > > >> > But the longer answer is that there a couple of SPI services
> > > that
> > > > > > allow
> > > > > > >> you
> > > > > > >> > to customize the representations, [1], [2].  The default RO
> > > > > > >> representations
> > > > > > >> > are performed by an implementation of [1].
> > > > > > >> >
> > > > > > >> > Eventually I'm thinking that Isis might provide
> out-of-the-box
> > > > > > >> > implementations for HAL, Collection+JSON, Siren etc... but
> you
> > > > might
> > > > > > >> find
> > > > > > >> > that your client-side (Javascript?) widget UI libraries work
> > > best
> > > > > with
> > > > > > >> some
> > > > > > >> > other more "adhoc" representations.
> > > > > > >> >
> > > > > > >> > What these SPI services *don't* allow is for the resources
> > > defined
> > > > > by
> > > > > > RO
> > > > > > >> > (or their input JSON) to change.  I don't see any particular
> > > need
> > > > to
> > > > > > >> > customize this, though.
> > > > > > >> >
> > > > > > >>
> > > > > > >> I think I saw ContentMappingService being used in ToDoApp.
> Using
> > > > those
> > > > > > >> SPIs
> > > > > > >> would work, however while going through the Spiro framework as
> > > > > discussed
> > > > > > >> in
> > > > > > >> the other thread, I saw interesting additional sections in the
> > RO
> > > > spec
> > > > > > >> v1.1.0 about:
> > > > > > >>
> > > > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > > > >>
> > > > > > >> I had skimmed through RO v1.0.0 before and afaik, those
> weren't
> > > > there
> > > > > > yet.
> > > > > > >> Those sections, especially 34.9, addresses our need.
> > > > > > >>
> > > > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > > > >> x-ro-page-size)
> > > > > > >> are also nice to haves.
> > > > > > >>
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Willie Loyd Tandingan <ta...@gmail.com>.
There seems to be an existing support for following items in a list in
ListReprRenderer though since invoking actions can use query parameters to
specify the action's parameters, it coughs up a "199 RestfulObjects
Argument 'x-ro-follow-links' found but no such parameter" whenever you
specify x-ro-follow-links.

I could get follow links to work for action results by ignoring parameters
starting with "x-ro" in ObjectActionArgHelper. Though a bit crude, it does
follow links for action results...

On Wed, Nov 11, 2015 at 10:44 PM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> It would.  I'll look into it.
>
> Thx
> Dan
>
>
> On 11 November 2015 at 14:43, Willie Loyd Tandingan <
> tandingan.wlb@gmail.com
> > wrote:
>
> > Hey Dan,
> >
> > I just tried it and works great for domain object, properties,
> collections!
> >
> > Is it possible to extend it also for action results? Our use case
> involves
> > search actions (with keywords, or all) returning lists that need to be
> > displayed in a grid.
> >
> >
> > Many thanks,
> > Willie
> >
> > On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <
> dan@haywood-associates.co.uk
> > >
> > wrote:
> >
> > > Hi Willie,
> > >
> > > Edit:this was in my drafts, forgot to send! Don't think it says
> anything
> > > you didn't work out already...
> > >
> > > just following up, I've got the x-ro-follow-links stuff working to
> > support
> > > the eager loading of either collections, or of parent references; ie
> > > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was to
> > > make it fully generic, but that's a lot of testing without necessarily
> > any
> > > real use case.  So I think I'm going to descope it just to support your
> > use
> > > cases.
> > >
> > > To explain how to use this feature I've recorded a screencast [1] which
> > > uses the kitchensink app [2]
> > >
> > > If you want to try this out, you'll need to checkout the ISIS-1232
> branch
> > > and build locally.
> > >
> > > Feedback welcome!
> > >
> > > Thx
> > > Dan
> > >
> > > [1] https://youtu.be/hSKnqqBQ7Zo
> > > [2] https://github.com/isisaddons/isis-app-kitchensink
> > > Hi Willie,
> > >
> > > I admit I haven't thought about any of this too much over and above
> > what's
> > > in the spec (that I wrote a *long* time ago).  I just wanted to commit
> > > myself mentally to doing this stuff soon.
> > >
> > > I know that some of this stuff has been implemented on Naked
> Objects.NET,
> > > so I will check with those guys (Richard and Stef) to see how they did
> > it.
> > >
> > > But if you have ideas, please feel free to comment on the tickets
> raised.
> > >
> > > Thx
> > > Dan
> > >
> > >
> > >
> > > On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> > > tandingan.wlb@gmail.com>
> > > wrote:
> > >
> > > > That's great to hear!
> > > >
> > > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size
> > > will
> > > > be implemented. Will these parameters be acquired from a request
> scoped
> > > > service or something like an action invocation context? How about the
> > > > properties for the paged collection e.g. total number of records,
> page
> > > > number, size, etc.?
> > > >
> > > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > > dan@haywood-associates.co.uk>
> > > > wrote:
> > > >
> > > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for
> these.
> > > > I'll
> > > > > aim to implement the first two (x-ro-follow-links, table grids) in
> > > > 1.11.0.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > > >
> > > > >
> > > > > On 15 October 2015 at 22:26, Dan Haywood <
> > dan@haywood-associates.co.uk
> > > >
> > > > > wrote:
> > > > >
> > > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > > >
> > > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but it
> > > must
> > > > > > have been over 2 years ago, so I forget the details as to how to
> > make
> > > > it
> > > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > > >
> > > > > > Thx
> > > > > > Dan
> > > > > >
> > > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > > > tandingan.wlb@gmail.com> wrote:
> > > > > >
> > > > > >> Hello Dan,
> > > > > >>
> > > > > >> The short answer is no.  I'm not averse to enhancing this with
> > > > > extensions
> > > > > >> > as they make sense.
> > > > > >> >
> > > > > >> > But the longer answer is that there a couple of SPI services
> > that
> > > > > allow
> > > > > >> you
> > > > > >> > to customize the representations, [1], [2].  The default RO
> > > > > >> representations
> > > > > >> > are performed by an implementation of [1].
> > > > > >> >
> > > > > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > > > > >> > implementations for HAL, Collection+JSON, Siren etc... but you
> > > might
> > > > > >> find
> > > > > >> > that your client-side (Javascript?) widget UI libraries work
> > best
> > > > with
> > > > > >> some
> > > > > >> > other more "adhoc" representations.
> > > > > >> >
> > > > > >> > What these SPI services *don't* allow is for the resources
> > defined
> > > > by
> > > > > RO
> > > > > >> > (or their input JSON) to change.  I don't see any particular
> > need
> > > to
> > > > > >> > customize this, though.
> > > > > >> >
> > > > > >>
> > > > > >> I think I saw ContentMappingService being used in ToDoApp. Using
> > > those
> > > > > >> SPIs
> > > > > >> would work, however while going through the Spiro framework as
> > > > discussed
> > > > > >> in
> > > > > >> the other thread, I saw interesting additional sections in the
> RO
> > > spec
> > > > > >> v1.1.0 about:
> > > > > >>
> > > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > > >>
> > > > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> > > there
> > > > > yet.
> > > > > >> Those sections, especially 34.9, addresses our need.
> > > > > >>
> > > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > > >> x-ro-page-size)
> > > > > >> are also nice to haves.
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: Restful objects list action result with domain object representation instead of links

Posted by Cesar Lugo <ce...@sisorg.com.mx>.
Hello,

Just wondering, is this feature available in apache Isis 1.10.0? I tried to follow a link, but it issues an error "not a string". It would help a lot with my client application if I can eagerly load links (parent - child ) just like in the video.

This link works ok and shows value.href values with its link:
http://localhost:8080/restful/objects/simple.BusinessLocation/1/collections/itemBusinessLocations

The this one:
http://localhost:8080/restful/objects/simple.BusinessLocation/1/collections/itemBusinessLocations?x-ro-follow-links=value.href

issues:

{
className: "java.lang.IllegalArgumentException",
message: "is not a string",
stackTrace: [
"org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.checkValue(JsonRepresentation.java:1712)",
"org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.getString(JsonRepresentation.java:964)",
"org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.asString(JsonRepresentation.java:957)",
"org.apache.isis.viewer.restfulobjects.applib.util.Parser.valueOf(Parser.java:64)",
"org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest$RequestParameter.valueOf(RestfulRequest.java:93)",
"org.apache.isis.viewer.restfulobjects.server.ResourceContext.getArg(ResourceContext.java:240)",
"org.apache.isis.viewer.restfulobjects.server.ResourceContext.init(ResourceContext.java:135)",
"org.apache.isis.viewer.restfulobjects.server.ResourceContext.<init>(ResourceContext.java:125)",
"org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstract.init(ResourceAbstract.java:120)",
"org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstract.init(ResourceAbstract.java:87)",
"org.apache.isis.viewer.restfulobjects.server.resources.DomainObjectResourceServerside.accessCollection(DomainObjectResourceServerside.java:286)",
"sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
"sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)",
"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
"java.lang.reflect.Method.invoke(Method.java:497)",
"org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)",
"org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)",
"org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)",
"org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)",
"org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)",
"org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)",
"org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)",
"org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)",
"org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)",
"javax.servlet.http.HttpServlet.service(HttpServlet.java:790)",
"org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)",
"org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1684)",
"org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:41)",
"org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
"org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:307)",
"org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
"org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFilter(IsisLogOnExceptionFilter.java:52)",
"org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
"org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)",
"org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)",
"org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)",
"org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)",
"org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)",
"org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)",
"org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)",
"org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
"org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)",
"org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)",
"org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)",
"org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)",
"org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1114)",
"org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)",
"org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)",
"org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1048)",
"org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)",
"org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)",
"org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)",
"org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)",
"org.eclipse.jetty.server.Server.handle(Server.java:517)",
"org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)",
"org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)",
"org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)",
"org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)",
"org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)",
"org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)",
"org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)",
"org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)",
"org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)",
"java.lang.Thread.run(Thread.java:745)"
],
causedBy: null
}

Cesar.

-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk] 
Sent: Wednesday, November 11, 2015 8:45 AM
To: users
Subject: Re: Restful objects list action result with domain object representation instead of links

It would.  I'll look into it.

Thx
Dan


On 11 November 2015 at 14:43, Willie Loyd Tandingan <tandingan.wlb@gmail.com
> wrote:

> Hey Dan,
>
> I just tried it and works great for domain object, properties, collections!
>
> Is it possible to extend it also for action results? Our use case 
> involves search actions (with keywords, or all) returning lists that 
> need to be displayed in a grid.
>
>
> Many thanks,
> Willie
>
> On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood 
> <dan@haywood-associates.co.uk
> >
> wrote:
>
> > Hi Willie,
> >
> > Edit:this was in my drafts, forgot to send! Don't think it says 
> > anything you didn't work out already...
> >
> > just following up, I've got the x-ro-follow-links stuff working to
> support
> > the eager loading of either collections, or of parent references; ie
> > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was 
> > to make it fully generic, but that's a lot of testing without 
> > necessarily
> any
> > real use case.  So I think I'm going to descope it just to support 
> > your
> use
> > cases.
> >
> > To explain how to use this feature I've recorded a screencast [1] 
> > which uses the kitchensink app [2]
> >
> > If you want to try this out, you'll need to checkout the ISIS-1232 
> > branch and build locally.
> >
> > Feedback welcome!
> >
> > Thx
> > Dan
> >
> > [1] https://youtu.be/hSKnqqBQ7Zo
> > [2] https://github.com/isisaddons/isis-app-kitchensink
> > Hi Willie,
> >
> > I admit I haven't thought about any of this too much over and above
> what's
> > in the spec (that I wrote a *long* time ago).  I just wanted to 
> > commit myself mentally to doing this stuff soon.
> >
> > I know that some of this stuff has been implemented on Naked 
> > Objects.NET, so I will check with those guys (Richard and Stef) to 
> > see how they did
> it.
> >
> > But if you have ideas, please feel free to comment on the tickets raised.
> >
> > Thx
> > Dan
> >
> >
> >
> > On 4 November 2015 at 16:57, Willie Loyd Tandingan < 
> > tandingan.wlb@gmail.com>
> > wrote:
> >
> > > That's great to hear!
> > >
> > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and 
> > > x-ro-page-size
> > will
> > > be implemented. Will these parameters be acquired from a request 
> > > scoped service or something like an action invocation context? How 
> > > about the properties for the paged collection e.g. total number of 
> > > records, page number, size, etc.?
> > >
> > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > dan@haywood-associates.co.uk>
> > > wrote:
> > >
> > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > > I'll
> > > > aim to implement the first two (x-ro-follow-links, table grids) 
> > > > in
> > > 1.11.0.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > >
> > > >
> > > > On 15 October 2015 at 22:26, Dan Haywood <
> dan@haywood-associates.co.uk
> > >
> > > > wrote:
> > > >
> > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > >
> > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but 
> > > > > it
> > must
> > > > > have been over 2 years ago, so I forget the details as to how 
> > > > > to
> make
> > > it
> > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan < 
> > > > > tandingan.wlb@gmail.com> wrote:
> > > > >
> > > > >> Hello Dan,
> > > > >>
> > > > >> The short answer is no.  I'm not averse to enhancing this 
> > > > >> with
> > > > extensions
> > > > >> > as they make sense.
> > > > >> >
> > > > >> > But the longer answer is that there a couple of SPI 
> > > > >> > services
> that
> > > > allow
> > > > >> you
> > > > >> > to customize the representations, [1], [2].  The default RO
> > > > >> representations
> > > > >> > are performed by an implementation of [1].
> > > > >> >
> > > > >> > Eventually I'm thinking that Isis might provide 
> > > > >> > out-of-the-box implementations for HAL, Collection+JSON, 
> > > > >> > Siren etc... but you
> > might
> > > > >> find
> > > > >> > that your client-side (Javascript?) widget UI libraries 
> > > > >> > work
> best
> > > with
> > > > >> some
> > > > >> > other more "adhoc" representations.
> > > > >> >
> > > > >> > What these SPI services *don't* allow is for the resources
> defined
> > > by
> > > > RO
> > > > >> > (or their input JSON) to change.  I don't see any 
> > > > >> > particular
> need
> > to
> > > > >> > customize this, though.
> > > > >> >
> > > > >>
> > > > >> I think I saw ContentMappingService being used in ToDoApp. 
> > > > >> Using
> > those
> > > > >> SPIs
> > > > >> would work, however while going through the Spiro framework 
> > > > >> as
> > > discussed
> > > > >> in
> > > > >> the other thread, I saw interesting additional sections in 
> > > > >> the RO
> > spec
> > > > >> v1.1.0 about:
> > > > >>
> > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > >>
> > > > >> I had skimmed through RO v1.0.0 before and afaik, those 
> > > > >> weren't
> > there
> > > > yet.
> > > > >> Those sections, especially 34.9, addresses our need.
> > > > >>
> > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > >> x-ro-page-size)
> > > > >> are also nice to haves.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


RE: Restful objects list action result with domain object representation instead of links

Posted by Cesar Lugo <ce...@sisorg.com.mx>.
Got it. Thank you. Looks quite promising!

-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk] 
Sent: Thursday, November 19, 2015 6:20 PM
To: users
Subject: Re: Restful objects list action result with domain object representation instead of links

Sorry, no, it's in 1.11.0-SNAPSHOT.  You'll have to build from source [1]

The release notes describe what's in each release [2]

HTH
Dan


[1] http://isis.apache.org/guides/cg.html#_building_all_of_apache_isis
[2] http://isis.apache.org/release-notes.html


On 20 November 2015 at 00:17, Cesar Lugo <ce...@sisorg.com.mx> wrote:

> Hello,
>
> Just wondering, is this feature available in apache Isis 1.10.0? I 
> tried to follow a link, but it issues an error "not a string". It 
> would help a lot with my client application if I can eagerly load 
> links (parent - child
> ) just like in the video.
>
> This link works ok and shows value.href values with its link:
>
> http://localhost:8080/restful/objects/simple.BusinessLocation/1/collec
> tions/itemBusinessLocations
>
> The this one:
>
> http://localhost:8080/restful/objects/simple.BusinessLocation/1/collec
> tions/itemBusinessLocations?x-ro-follow-links=value.href
>
> issues:
>
> {
> className: "java.lang.IllegalArgumentException",
> message: "is not a string",
> stackTrace: [
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.check
> Value(JsonRepresentation.java:1712)",
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.getSt
> ring(JsonRepresentation.java:964)",
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.asStr
> ing(JsonRepresentation.java:957)",
>
> "org.apache.isis.viewer.restfulobjects.applib.util.Parser.valueOf(Pars
> er.java:64)",
>
> "org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest$Re
> questParameter.valueOf(RestfulRequest.java:93)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.getArg(R
> esourceContext.java:240)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.init(Res
> ourceContext.java:135)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.<init>(R
> esourceContext.java:125)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstra
> ct.init(ResourceAbstract.java:120)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstra
> ct.init(ResourceAbstract.java:87)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.DomainObjectRe
> sourceServerside.accessCollection(DomainObjectResourceServerside.java:
> 286)", "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
>
> "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:62)",
>
> "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:43)", "java.lang.reflect.Method.invoke(Method.java:497)",
>
> "org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.
> java:137)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(Resource
> MethodInvoker.java:296)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodIn
> voker.java:250)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodIn
> voker.java:237)",
>
> "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispa
> tcher.java:356)",
>
> "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispa
> tcher.java:179)",
>
> "org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.
> service(ServletContainerDispatcher.java:220)",
>
> "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.servi
> ce(HttpServletDispatcher.java:56)",
>
> "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.servi
> ce(HttpServletDispatcher.java:51)",
> "javax.servlet.http.HttpServlet.service(HttpServlet.java:790)",
> "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816
> )",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> Handler.java:1684)",
>
> "org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFi
> lterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.
> java:41)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> Handler.java:1667)",
>
> "org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFil
> ter.java:307)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> Handler.java:1667)",
>
> "org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFi
> lter(IsisLogOnExceptionFilter.java:52)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> Handler.java:1667)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(Abstrac
> tShiroFilter.java:449)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiro
> Filter.java:365)",
>
> "org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallab
> le.java:90)",
>
> "org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable
> .java:83)",
>
> "org.apache.shiro.subject.support.DelegatingSubject.execute(Delegating
> Subject.java:383)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(Abs
> tractShiroFilter.java:362)",
>
> "org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerReq
> uestFilter.java:125)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> Handler.java:1667)",
>
> "org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
> :581)",
>
> "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
> ava:143)",
>
> "org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav
> a:548)",
>
> "org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl
> er.java:226)",
>
> "org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
> er.java:1114)",
>
> "org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:
> 511)",
>
> "org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle
> r.java:185)",
>
> "org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
> r.java:1048)",
>
> "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
> ava:141)",
>
> "org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont
> extHandlerCollection.java:213)",
>
> "org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl
> ection.java:109)",
>
> "org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
> .java:119)", 
> "org.eclipse.jetty.server.Server.handle(Server.java:517)",
> "org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)",
>
> "org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.jav
> a:242)",
>
> "org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(Abstra
> ctConnection.java:245)", 
> "org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)",
>
> "org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoin
> t.java:75)",
>
> "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceA
> ndRun(ExecuteProduceConsume.java:213)",
>
> "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(Exec
> uteProduceConsume.java:147)",
>
> "org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo
> l.java:654)",
>
> "org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool
> .java:572)", "java.lang.Thread.run(Thread.java:745)"
> ],
> causedBy: null
> }
>
> Cesar.
>
> -----Original Message-----
> From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Sent: Wednesday, November 11, 2015 8:45 AM
> To: users
> Subject: Re: Restful objects list action result with domain object 
> representation instead of links
>
> It would.  I'll look into it.
>
> Thx
> Dan
>
>
> On 11 November 2015 at 14:43, Willie Loyd Tandingan < 
> tandingan.wlb@gmail.com
> > wrote:
>
> > Hey Dan,
> >
> > I just tried it and works great for domain object, properties,
> collections!
> >
> > Is it possible to extend it also for action results? Our use case 
> > involves search actions (with keywords, or all) returning lists that 
> > need to be displayed in a grid.
> >
> >
> > Many thanks,
> > Willie
> >
> > On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood 
> > <dan@haywood-associates.co.uk
> > >
> > wrote:
> >
> > > Hi Willie,
> > >
> > > Edit:this was in my drafts, forgot to send! Don't think it says 
> > > anything you didn't work out already...
> > >
> > > just following up, I've got the x-ro-follow-links stuff working to
> > support
> > > the eager loading of either collections, or of parent references; 
> > > ie
> > > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links 
> > > was to make it fully generic, but that's a lot of testing without 
> > > necessarily
> > any
> > > real use case.  So I think I'm going to descope it just to support 
> > > your
> > use
> > > cases.
> > >
> > > To explain how to use this feature I've recorded a screencast [1] 
> > > which uses the kitchensink app [2]
> > >
> > > If you want to try this out, you'll need to checkout the ISIS-1232 
> > > branch and build locally.
> > >
> > > Feedback welcome!
> > >
> > > Thx
> > > Dan
> > >
> > > [1] https://youtu.be/hSKnqqBQ7Zo
> > > [2] https://github.com/isisaddons/isis-app-kitchensink
> > > Hi Willie,
> > >
> > > I admit I haven't thought about any of this too much over and 
> > > above
> > what's
> > > in the spec (that I wrote a *long* time ago).  I just wanted to 
> > > commit myself mentally to doing this stuff soon.
> > >
> > > I know that some of this stuff has been implemented on Naked 
> > > Objects.NET, so I will check with those guys (Richard and Stef) to 
> > > see how they did
> > it.
> > >
> > > But if you have ideas, please feel free to comment on the tickets
> raised.
> > >
> > > Thx
> > > Dan
> > >
> > >
> > >
> > > On 4 November 2015 at 16:57, Willie Loyd Tandingan < 
> > > tandingan.wlb@gmail.com>
> > > wrote:
> > >
> > > > That's great to hear!
> > > >
> > > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and 
> > > > x-ro-page-size
> > > will
> > > > be implemented. Will these parameters be acquired from a request 
> > > > scoped service or something like an action invocation context? 
> > > > How about the properties for the paged collection e.g. total 
> > > > number of records, page number, size, etc.?
> > > >
> > > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > > dan@haywood-associates.co.uk>
> > > > wrote:
> > > >
> > > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for
> these.
> > > > I'll
> > > > > aim to implement the first two (x-ro-follow-links, table 
> > > > > grids) in
> > > > 1.11.0.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > > >
> > > > >
> > > > > On 15 October 2015 at 22:26, Dan Haywood <
> > dan@haywood-associates.co.uk
> > > >
> > > > > wrote:
> > > > >
> > > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > > >
> > > > > > IIRC, I did implement some of the x-ro-follow-links stuff, 
> > > > > > but it
> > > must
> > > > > > have been over 2 years ago, so I forget the details as to 
> > > > > > how to
> > make
> > > > it
> > > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > > >
> > > > > > Thx
> > > > > > Dan
> > > > > >
> > > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan < 
> > > > > > tandingan.wlb@gmail.com> wrote:
> > > > > >
> > > > > >> Hello Dan,
> > > > > >>
> > > > > >> The short answer is no.  I'm not averse to enhancing this 
> > > > > >> with
> > > > > extensions
> > > > > >> > as they make sense.
> > > > > >> >
> > > > > >> > But the longer answer is that there a couple of SPI 
> > > > > >> > services
> > that
> > > > > allow
> > > > > >> you
> > > > > >> > to customize the representations, [1], [2].  The default 
> > > > > >> > RO
> > > > > >> representations
> > > > > >> > are performed by an implementation of [1].
> > > > > >> >
> > > > > >> > Eventually I'm thinking that Isis might provide 
> > > > > >> > out-of-the-box implementations for HAL, Collection+JSON, 
> > > > > >> > Siren etc... but you
> > > might
> > > > > >> find
> > > > > >> > that your client-side (Javascript?) widget UI libraries 
> > > > > >> > work
> > best
> > > > with
> > > > > >> some
> > > > > >> > other more "adhoc" representations.
> > > > > >> >
> > > > > >> > What these SPI services *don't* allow is for the 
> > > > > >> > resources
> > defined
> > > > by
> > > > > RO
> > > > > >> > (or their input JSON) to change.  I don't see any 
> > > > > >> > particular
> > need
> > > to
> > > > > >> > customize this, though.
> > > > > >> >
> > > > > >>
> > > > > >> I think I saw ContentMappingService being used in ToDoApp.
> > > > > >> Using
> > > those
> > > > > >> SPIs
> > > > > >> would work, however while going through the Spiro framework 
> > > > > >> as
> > > > discussed
> > > > > >> in
> > > > > >> the other thread, I saw interesting additional sections in 
> > > > > >> the RO
> > > spec
> > > > > >> v1.1.0 about:
> > > > > >>
> > > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > > >>
> > > > > >> I had skimmed through RO v1.0.0 before and afaik, those 
> > > > > >> weren't
> > > there
> > > > > yet.
> > > > > >> Those sections, especially 34.9, addresses our need.
> > > > > >>
> > > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > > >> x-ro-page-size)
> > > > > >> are also nice to haves.
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Sorry, no, it's in 1.11.0-SNAPSHOT.  You'll have to build from source [1]

The release notes describe what's in each release [2]

HTH
Dan


[1] http://isis.apache.org/guides/cg.html#_building_all_of_apache_isis
[2] http://isis.apache.org/release-notes.html


On 20 November 2015 at 00:17, Cesar Lugo <ce...@sisorg.com.mx> wrote:

> Hello,
>
> Just wondering, is this feature available in apache Isis 1.10.0? I tried
> to follow a link, but it issues an error "not a string". It would help a
> lot with my client application if I can eagerly load links (parent - child
> ) just like in the video.
>
> This link works ok and shows value.href values with its link:
>
> http://localhost:8080/restful/objects/simple.BusinessLocation/1/collections/itemBusinessLocations
>
> The this one:
>
> http://localhost:8080/restful/objects/simple.BusinessLocation/1/collections/itemBusinessLocations?x-ro-follow-links=value.href
>
> issues:
>
> {
> className: "java.lang.IllegalArgumentException",
> message: "is not a string",
> stackTrace: [
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.checkValue(JsonRepresentation.java:1712)",
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.getString(JsonRepresentation.java:964)",
>
> "org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.asString(JsonRepresentation.java:957)",
>
> "org.apache.isis.viewer.restfulobjects.applib.util.Parser.valueOf(Parser.java:64)",
>
> "org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest$RequestParameter.valueOf(RestfulRequest.java:93)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.getArg(ResourceContext.java:240)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.init(ResourceContext.java:135)",
>
> "org.apache.isis.viewer.restfulobjects.server.ResourceContext.<init>(ResourceContext.java:125)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstract.init(ResourceAbstract.java:120)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.ResourceAbstract.init(ResourceAbstract.java:87)",
>
> "org.apache.isis.viewer.restfulobjects.server.resources.DomainObjectResourceServerside.accessCollection(DomainObjectResourceServerside.java:286)",
> "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
>
> "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)",
>
> "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
> "java.lang.reflect.Method.invoke(Method.java:497)",
>
> "org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)",
>
> "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)",
>
> "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)",
>
> "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)",
>
> "org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)",
>
> "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)",
>
> "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)",
> "javax.servlet.http.HttpServlet.service(HttpServlet.java:790)",
> "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1684)",
>
> "org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:41)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
>
> "org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:307)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
>
> "org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFilter(IsisLogOnExceptionFilter.java:52)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)",
>
> "org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)",
>
> "org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)",
>
> "org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)",
>
> "org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)",
>
> "org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)",
>
> "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)",
>
> "org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)",
>
> "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)",
>
> "org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)",
>
> "org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)",
>
> "org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1114)",
>
> "org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)",
>
> "org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)",
>
> "org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1048)",
>
> "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)",
>
> "org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)",
>
> "org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)",
>
> "org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)",
> "org.eclipse.jetty.server.Server.handle(Server.java:517)",
> "org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)",
>
> "org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)",
>
> "org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)",
> "org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)",
>
> "org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)",
>
> "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)",
>
> "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)",
>
> "org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)",
>
> "org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)",
> "java.lang.Thread.run(Thread.java:745)"
> ],
> causedBy: null
> }
>
> Cesar.
>
> -----Original Message-----
> From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Sent: Wednesday, November 11, 2015 8:45 AM
> To: users
> Subject: Re: Restful objects list action result with domain object
> representation instead of links
>
> It would.  I'll look into it.
>
> Thx
> Dan
>
>
> On 11 November 2015 at 14:43, Willie Loyd Tandingan <
> tandingan.wlb@gmail.com
> > wrote:
>
> > Hey Dan,
> >
> > I just tried it and works great for domain object, properties,
> collections!
> >
> > Is it possible to extend it also for action results? Our use case
> > involves search actions (with keywords, or all) returning lists that
> > need to be displayed in a grid.
> >
> >
> > Many thanks,
> > Willie
> >
> > On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood
> > <dan@haywood-associates.co.uk
> > >
> > wrote:
> >
> > > Hi Willie,
> > >
> > > Edit:this was in my drafts, forgot to send! Don't think it says
> > > anything you didn't work out already...
> > >
> > > just following up, I've got the x-ro-follow-links stuff working to
> > support
> > > the eager loading of either collections, or of parent references; ie
> > > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was
> > > to make it fully generic, but that's a lot of testing without
> > > necessarily
> > any
> > > real use case.  So I think I'm going to descope it just to support
> > > your
> > use
> > > cases.
> > >
> > > To explain how to use this feature I've recorded a screencast [1]
> > > which uses the kitchensink app [2]
> > >
> > > If you want to try this out, you'll need to checkout the ISIS-1232
> > > branch and build locally.
> > >
> > > Feedback welcome!
> > >
> > > Thx
> > > Dan
> > >
> > > [1] https://youtu.be/hSKnqqBQ7Zo
> > > [2] https://github.com/isisaddons/isis-app-kitchensink
> > > Hi Willie,
> > >
> > > I admit I haven't thought about any of this too much over and above
> > what's
> > > in the spec (that I wrote a *long* time ago).  I just wanted to
> > > commit myself mentally to doing this stuff soon.
> > >
> > > I know that some of this stuff has been implemented on Naked
> > > Objects.NET, so I will check with those guys (Richard and Stef) to
> > > see how they did
> > it.
> > >
> > > But if you have ideas, please feel free to comment on the tickets
> raised.
> > >
> > > Thx
> > > Dan
> > >
> > >
> > >
> > > On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> > > tandingan.wlb@gmail.com>
> > > wrote:
> > >
> > > > That's great to hear!
> > > >
> > > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and
> > > > x-ro-page-size
> > > will
> > > > be implemented. Will these parameters be acquired from a request
> > > > scoped service or something like an action invocation context? How
> > > > about the properties for the paged collection e.g. total number of
> > > > records, page number, size, etc.?
> > > >
> > > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > > dan@haywood-associates.co.uk>
> > > > wrote:
> > > >
> > > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for
> these.
> > > > I'll
> > > > > aim to implement the first two (x-ro-follow-links, table grids)
> > > > > in
> > > > 1.11.0.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > > >
> > > > >
> > > > > On 15 October 2015 at 22:26, Dan Haywood <
> > dan@haywood-associates.co.uk
> > > >
> > > > > wrote:
> > > > >
> > > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > > >
> > > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but
> > > > > > it
> > > must
> > > > > > have been over 2 years ago, so I forget the details as to how
> > > > > > to
> > make
> > > > it
> > > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > > >
> > > > > > Thx
> > > > > > Dan
> > > > > >
> > > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > > > tandingan.wlb@gmail.com> wrote:
> > > > > >
> > > > > >> Hello Dan,
> > > > > >>
> > > > > >> The short answer is no.  I'm not averse to enhancing this
> > > > > >> with
> > > > > extensions
> > > > > >> > as they make sense.
> > > > > >> >
> > > > > >> > But the longer answer is that there a couple of SPI
> > > > > >> > services
> > that
> > > > > allow
> > > > > >> you
> > > > > >> > to customize the representations, [1], [2].  The default RO
> > > > > >> representations
> > > > > >> > are performed by an implementation of [1].
> > > > > >> >
> > > > > >> > Eventually I'm thinking that Isis might provide
> > > > > >> > out-of-the-box implementations for HAL, Collection+JSON,
> > > > > >> > Siren etc... but you
> > > might
> > > > > >> find
> > > > > >> > that your client-side (Javascript?) widget UI libraries
> > > > > >> > work
> > best
> > > > with
> > > > > >> some
> > > > > >> > other more "adhoc" representations.
> > > > > >> >
> > > > > >> > What these SPI services *don't* allow is for the resources
> > defined
> > > > by
> > > > > RO
> > > > > >> > (or their input JSON) to change.  I don't see any
> > > > > >> > particular
> > need
> > > to
> > > > > >> > customize this, though.
> > > > > >> >
> > > > > >>
> > > > > >> I think I saw ContentMappingService being used in ToDoApp.
> > > > > >> Using
> > > those
> > > > > >> SPIs
> > > > > >> would work, however while going through the Spiro framework
> > > > > >> as
> > > > discussed
> > > > > >> in
> > > > > >> the other thread, I saw interesting additional sections in
> > > > > >> the RO
> > > spec
> > > > > >> v1.1.0 about:
> > > > > >>
> > > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > > >>
> > > > > >> I had skimmed through RO v1.0.0 before and afaik, those
> > > > > >> weren't
> > > there
> > > > > yet.
> > > > > >> Those sections, especially 34.9, addresses our need.
> > > > > >>
> > > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > > >> x-ro-page-size)
> > > > > >> are also nice to haves.
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
It would.  I'll look into it.

Thx
Dan


On 11 November 2015 at 14:43, Willie Loyd Tandingan <tandingan.wlb@gmail.com
> wrote:

> Hey Dan,
>
> I just tried it and works great for domain object, properties, collections!
>
> Is it possible to extend it also for action results? Our use case involves
> search actions (with keywords, or all) returning lists that need to be
> displayed in a grid.
>
>
> Many thanks,
> Willie
>
> On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > Hi Willie,
> >
> > Edit:this was in my drafts, forgot to send! Don't think it says anything
> > you didn't work out already...
> >
> > just following up, I've got the x-ro-follow-links stuff working to
> support
> > the eager loading of either collections, or of parent references; ie
> > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was to
> > make it fully generic, but that's a lot of testing without necessarily
> any
> > real use case.  So I think I'm going to descope it just to support your
> use
> > cases.
> >
> > To explain how to use this feature I've recorded a screencast [1] which
> > uses the kitchensink app [2]
> >
> > If you want to try this out, you'll need to checkout the ISIS-1232 branch
> > and build locally.
> >
> > Feedback welcome!
> >
> > Thx
> > Dan
> >
> > [1] https://youtu.be/hSKnqqBQ7Zo
> > [2] https://github.com/isisaddons/isis-app-kitchensink
> > Hi Willie,
> >
> > I admit I haven't thought about any of this too much over and above
> what's
> > in the spec (that I wrote a *long* time ago).  I just wanted to commit
> > myself mentally to doing this stuff soon.
> >
> > I know that some of this stuff has been implemented on Naked Objects.NET,
> > so I will check with those guys (Richard and Stef) to see how they did
> it.
> >
> > But if you have ideas, please feel free to comment on the tickets raised.
> >
> > Thx
> > Dan
> >
> >
> >
> > On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> > tandingan.wlb@gmail.com>
> > wrote:
> >
> > > That's great to hear!
> > >
> > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size
> > will
> > > be implemented. Will these parameters be acquired from a request scoped
> > > service or something like an action invocation context? How about the
> > > properties for the paged collection e.g. total number of records, page
> > > number, size, etc.?
> > >
> > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > dan@haywood-associates.co.uk>
> > > wrote:
> > >
> > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > > I'll
> > > > aim to implement the first two (x-ro-follow-links, table grids) in
> > > 1.11.0.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > >
> > > >
> > > > On 15 October 2015 at 22:26, Dan Haywood <
> dan@haywood-associates.co.uk
> > >
> > > > wrote:
> > > >
> > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > >
> > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but it
> > must
> > > > > have been over 2 years ago, so I forget the details as to how to
> make
> > > it
> > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > > tandingan.wlb@gmail.com> wrote:
> > > > >
> > > > >> Hello Dan,
> > > > >>
> > > > >> The short answer is no.  I'm not averse to enhancing this with
> > > > extensions
> > > > >> > as they make sense.
> > > > >> >
> > > > >> > But the longer answer is that there a couple of SPI services
> that
> > > > allow
> > > > >> you
> > > > >> > to customize the representations, [1], [2].  The default RO
> > > > >> representations
> > > > >> > are performed by an implementation of [1].
> > > > >> >
> > > > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > > > >> > implementations for HAL, Collection+JSON, Siren etc... but you
> > might
> > > > >> find
> > > > >> > that your client-side (Javascript?) widget UI libraries work
> best
> > > with
> > > > >> some
> > > > >> > other more "adhoc" representations.
> > > > >> >
> > > > >> > What these SPI services *don't* allow is for the resources
> defined
> > > by
> > > > RO
> > > > >> > (or their input JSON) to change.  I don't see any particular
> need
> > to
> > > > >> > customize this, though.
> > > > >> >
> > > > >>
> > > > >> I think I saw ContentMappingService being used in ToDoApp. Using
> > those
> > > > >> SPIs
> > > > >> would work, however while going through the Spiro framework as
> > > discussed
> > > > >> in
> > > > >> the other thread, I saw interesting additional sections in the RO
> > spec
> > > > >> v1.1.0 about:
> > > > >>
> > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > >>
> > > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> > there
> > > > yet.
> > > > >> Those sections, especially 34.9, addresses our need.
> > > > >>
> > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > >> x-ro-page-size)
> > > > >> are also nice to haves.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Yes, it will work for view models too.



On 11 November 2015 at 15:32, Cesar Lugo <ce...@sisorg.com.mx> wrote:

> Just looked into it, it looks like a very helpful feature to significantly
> simplify and improve client requests. Would this work also for ViewModels?
>
> Cesar.
>
> -----Original Message-----
> From: Willie Loyd Tandingan [mailto:tandingan.wlb@gmail.com]
> Sent: Wednesday, November 11, 2015 8:44 AM
> To: users@isis.apache.org
> Subject: Re: Restful objects list action result with domain object
> representation instead of links
>
> Hey Dan,
>
> I just tried it and works great for domain object, properties, collections!
>
> Is it possible to extend it also for action results? Our use case involves
> search actions (with keywords, or all) returning lists that need to be
> displayed in a grid.
>
>
> Many thanks,
> Willie
>
> On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > Hi Willie,
> >
> > Edit:this was in my drafts, forgot to send! Don't think it says
> > anything you didn't work out already...
> >
> > just following up, I've got the x-ro-follow-links stuff working to
> > support the eager loading of either collections, or of parent
> > references; ie
> > ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was
> > to make it fully generic, but that's a lot of testing without
> > necessarily any real use case.  So I think I'm going to descope it
> > just to support your use cases.
> >
> > To explain how to use this feature I've recorded a screencast [1]
> > which uses the kitchensink app [2]
> >
> > If you want to try this out, you'll need to checkout the ISIS-1232
> > branch and build locally.
> >
> > Feedback welcome!
> >
> > Thx
> > Dan
> >
> > [1] https://youtu.be/hSKnqqBQ7Zo
> > [2] https://github.com/isisaddons/isis-app-kitchensink
> > Hi Willie,
> >
> > I admit I haven't thought about any of this too much over and above
> > what's in the spec (that I wrote a *long* time ago).  I just wanted to
> > commit myself mentally to doing this stuff soon.
> >
> > I know that some of this stuff has been implemented on Naked
> > Objects.NET, so I will check with those guys (Richard and Stef) to see
> how they did it.
> >
> > But if you have ideas, please feel free to comment on the tickets raised.
> >
> > Thx
> > Dan
> >
> >
> >
> > On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> > tandingan.wlb@gmail.com>
> > wrote:
> >
> > > That's great to hear!
> > >
> > > I'm pretty curious on how x-ro-sort-by, x-ro-page, and
> > > x-ro-page-size
> > will
> > > be implemented. Will these parameters be acquired from a request
> > > scoped service or something like an action invocation context? How
> > > about the properties for the paged collection e.g. total number of
> > > records, page number, size, etc.?
> > >
> > > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> > dan@haywood-associates.co.uk>
> > > wrote:
> > >
> > > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > > I'll
> > > > aim to implement the first two (x-ro-follow-links, table grids) in
> > > 1.11.0.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > https://issues.apache.org/jira/browse/ISIS-1232
> > > > https://issues.apache.org/jira/browse/ISIS-1233
> > > > https://issues.apache.org/jira/browse/ISIS-1234
> > > > https://issues.apache.org/jira/browse/ISIS-1235
> > > >
> > > >
> > > > On 15 October 2015 at 22:26, Dan Haywood
> > > > <dan@haywood-associates.co.uk
> > >
> > > > wrote:
> > > >
> > > > > OK, I can focus on those sections, as and when I get the chance.
> > > > >
> > > > > IIRC, I did implement some of the x-ro-follow-links stuff, but
> > > > > it
> > must
> > > > > have been over 2 years ago, so I forget the details as to how to
> > > > > make
> > > it
> > > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > > >
> > > > > Thx
> > > > > Dan
> > > > >
> > > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > > tandingan.wlb@gmail.com> wrote:
> > > > >
> > > > >> Hello Dan,
> > > > >>
> > > > >> The short answer is no.  I'm not averse to enhancing this with
> > > > extensions
> > > > >> > as they make sense.
> > > > >> >
> > > > >> > But the longer answer is that there a couple of SPI services
> > > > >> > that
> > > > allow
> > > > >> you
> > > > >> > to customize the representations, [1], [2].  The default RO
> > > > >> representations
> > > > >> > are performed by an implementation of [1].
> > > > >> >
> > > > >> > Eventually I'm thinking that Isis might provide
> > > > >> > out-of-the-box implementations for HAL, Collection+JSON,
> > > > >> > Siren etc... but you
> > might
> > > > >> find
> > > > >> > that your client-side (Javascript?) widget UI libraries work
> > > > >> > best
> > > with
> > > > >> some
> > > > >> > other more "adhoc" representations.
> > > > >> >
> > > > >> > What these SPI services *don't* allow is for the resources
> > > > >> > defined
> > > by
> > > > RO
> > > > >> > (or their input JSON) to change.  I don't see any particular
> > > > >> > need
> > to
> > > > >> > customize this, though.
> > > > >> >
> > > > >>
> > > > >> I think I saw ContentMappingService being used in ToDoApp.
> > > > >> Using
> > those
> > > > >> SPIs
> > > > >> would work, however while going through the Spiro framework as
> > > discussed
> > > > >> in
> > > > >> the other thread, I saw interesting additional sections in the
> > > > >> RO
> > spec
> > > > >> v1.1.0 about:
> > > > >>
> > > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > > >>
> > > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> > there
> > > > yet.
> > > > >> Those sections, especially 34.9, addresses our need.
> > > > >>
> > > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > > >> x-ro-page-size)
> > > > >> are also nice to haves.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Willie Loyd Tandingan <ta...@gmail.com>.
Hey Dan,

I just tried it and works great for domain object, properties, collections!

Is it possible to extend it also for action results? Our use case involves
search actions (with keywords, or all) returning lists that need to be
displayed in a grid.


Many thanks,
Willie

On Tue, Nov 10, 2015 at 2:26 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> Hi Willie,
>
> Edit:this was in my drafts, forgot to send! Don't think it says anything
> you didn't work out already...
>
> just following up, I've got the x-ro-follow-links stuff working to support
> the eager loading of either collections, or of parent references; ie
> ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was to
> make it fully generic, but that's a lot of testing without necessarily any
> real use case.  So I think I'm going to descope it just to support your use
> cases.
>
> To explain how to use this feature I've recorded a screencast [1] which
> uses the kitchensink app [2]
>
> If you want to try this out, you'll need to checkout the ISIS-1232 branch
> and build locally.
>
> Feedback welcome!
>
> Thx
> Dan
>
> [1] https://youtu.be/hSKnqqBQ7Zo
> [2] https://github.com/isisaddons/isis-app-kitchensink
> Hi Willie,
>
> I admit I haven't thought about any of this too much over and above what's
> in the spec (that I wrote a *long* time ago).  I just wanted to commit
> myself mentally to doing this stuff soon.
>
> I know that some of this stuff has been implemented on Naked Objects.NET,
> so I will check with those guys (Richard and Stef) to see how they did it.
>
> But if you have ideas, please feel free to comment on the tickets raised.
>
> Thx
> Dan
>
>
>
> On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> tandingan.wlb@gmail.com>
> wrote:
>
> > That's great to hear!
> >
> > I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size
> will
> > be implemented. Will these parameters be acquired from a request scoped
> > service or something like an action invocation context? How about the
> > properties for the paged collection e.g. total number of records, page
> > number, size, etc.?
> >
> > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> dan@haywood-associates.co.uk>
> > wrote:
> >
> > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > I'll
> > > aim to implement the first two (x-ro-follow-links, table grids) in
> > 1.11.0.
> > >
> > > Thx
> > > Dan
> > >
> > > https://issues.apache.org/jira/browse/ISIS-1232
> > > https://issues.apache.org/jira/browse/ISIS-1233
> > > https://issues.apache.org/jira/browse/ISIS-1234
> > > https://issues.apache.org/jira/browse/ISIS-1235
> > >
> > >
> > > On 15 October 2015 at 22:26, Dan Haywood <dan@haywood-associates.co.uk
> >
> > > wrote:
> > >
> > > > OK, I can focus on those sections, as and when I get the chance.
> > > >
> > > > IIRC, I did implement some of the x-ro-follow-links stuff, but it
> must
> > > > have been over 2 years ago, so I forget the details as to how to make
> > it
> > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > tandingan.wlb@gmail.com> wrote:
> > > >
> > > >> Hello Dan,
> > > >>
> > > >> The short answer is no.  I'm not averse to enhancing this with
> > > extensions
> > > >> > as they make sense.
> > > >> >
> > > >> > But the longer answer is that there a couple of SPI services that
> > > allow
> > > >> you
> > > >> > to customize the representations, [1], [2].  The default RO
> > > >> representations
> > > >> > are performed by an implementation of [1].
> > > >> >
> > > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > > >> > implementations for HAL, Collection+JSON, Siren etc... but you
> might
> > > >> find
> > > >> > that your client-side (Javascript?) widget UI libraries work best
> > with
> > > >> some
> > > >> > other more "adhoc" representations.
> > > >> >
> > > >> > What these SPI services *don't* allow is for the resources defined
> > by
> > > RO
> > > >> > (or their input JSON) to change.  I don't see any particular need
> to
> > > >> > customize this, though.
> > > >> >
> > > >>
> > > >> I think I saw ContentMappingService being used in ToDoApp. Using
> those
> > > >> SPIs
> > > >> would work, however while going through the Spiro framework as
> > discussed
> > > >> in
> > > >> the other thread, I saw interesting additional sections in the RO
> spec
> > > >> v1.1.0 about:
> > > >>
> > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > >>
> > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> there
> > > yet.
> > > >> Those sections, especially 34.9, addresses our need.
> > > >>
> > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > >> x-ro-page-size)
> > > >> are also nice to haves.
> > > >>
> > > >
> > > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Willie,

Edit:this was in my drafts, forgot to send! Don't think it says anything
you didn't work out already...

just following up, I've got the x-ro-follow-links stuff working to support
the eager loading of either collections, or of parent references; ie
ISIS-1232 and ISIS-1233.  My original plan for x-ro-follow-links was to
make it fully generic, but that's a lot of testing without necessarily any
real use case.  So I think I'm going to descope it just to support your use
cases.

To explain how to use this feature I've recorded a screencast [1] which
uses the kitchensink app [2]

If you want to try this out, you'll need to checkout the ISIS-1232 branch
and build locally.

Feedback welcome!

Thx
Dan

[1] https://youtu.be/hSKnqqBQ7Zo
[2] https://github.com/isisaddons/isis-app-kitchensink
Hi Willie,

I admit I haven't thought about any of this too much over and above what's
in the spec (that I wrote a *long* time ago).  I just wanted to commit
myself mentally to doing this stuff soon.

I know that some of this stuff has been implemented on Naked Objects.NET,
so I will check with those guys (Richard and Stef) to see how they did it.

But if you have ideas, please feel free to comment on the tickets raised.

Thx
Dan



On 4 November 2015 at 16:57, Willie Loyd Tandingan <ta...@gmail.com>
wrote:

> That's great to hear!
>
> I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size will
> be implemented. Will these parameters be acquired from a request scoped
> service or something like an action invocation context? How about the
> properties for the paged collection e.g. total number of records, page
> number, size, etc.?
>
> On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
> > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> I'll
> > aim to implement the first two (x-ro-follow-links, table grids) in
> 1.11.0.
> >
> > Thx
> > Dan
> >
> > https://issues.apache.org/jira/browse/ISIS-1232
> > https://issues.apache.org/jira/browse/ISIS-1233
> > https://issues.apache.org/jira/browse/ISIS-1234
> > https://issues.apache.org/jira/browse/ISIS-1235
> >
> >
> > On 15 October 2015 at 22:26, Dan Haywood <da...@haywood-associates.co.uk>
> > wrote:
> >
> > > OK, I can focus on those sections, as and when I get the chance.
> > >
> > > IIRC, I did implement some of the x-ro-follow-links stuff, but it must
> > > have been over 2 years ago, so I forget the details as to how to make
> it
> > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > >
> > > Thx
> > > Dan
> > >
> > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > tandingan.wlb@gmail.com> wrote:
> > >
> > >> Hello Dan,
> > >>
> > >> The short answer is no.  I'm not averse to enhancing this with
> > extensions
> > >> > as they make sense.
> > >> >
> > >> > But the longer answer is that there a couple of SPI services that
> > allow
> > >> you
> > >> > to customize the representations, [1], [2].  The default RO
> > >> representations
> > >> > are performed by an implementation of [1].
> > >> >
> > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > >> > implementations for HAL, Collection+JSON, Siren etc... but you might
> > >> find
> > >> > that your client-side (Javascript?) widget UI libraries work best
> with
> > >> some
> > >> > other more "adhoc" representations.
> > >> >
> > >> > What these SPI services *don't* allow is for the resources defined
> by
> > RO
> > >> > (or their input JSON) to change.  I don't see any particular need to
> > >> > customize this, though.
> > >> >
> > >>
> > >> I think I saw ContentMappingService being used in ToDoApp. Using those
> > >> SPIs
> > >> would work, however while going through the Spiro framework as
> discussed
> > >> in
> > >> the other thread, I saw interesting additional sections in the RO spec
> > >> v1.1.0 about:
> > >>
> > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > >> 34.9 Minimizing Round-trips by supporting table grids
> > >>
> > >> I had skimmed through RO v1.0.0 before and afaik, those weren't there
> > yet.
> > >> Those sections, especially 34.9, addresses our need.
> > >>
> > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > >> x-ro-page-size)
> > >> are also nice to haves.
> > >>
> > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Willie Loyd Tandingan <ta...@gmail.com>.
I've just seen the ISIS-1232 branch and the screencast from kitchensink!
I'll try this one out tomorrow.

Cheers,
Willie



On Thu, Nov 5, 2015 at 5:34 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> Hi Willie,
>
> I admit I haven't thought about any of this too much over and above what's
> in the spec (that I wrote a *long* time ago).  I just wanted to commit
> myself mentally to doing this stuff soon.
>
> I know that some of this stuff has been implemented on Naked Objects.NET,
> so I will check with those guys (Richard and Stef) to see how they did it.
>
> But if you have ideas, please feel free to comment on the tickets raised.
>
> Thx
> Dan
>
>
>
> On 4 November 2015 at 16:57, Willie Loyd Tandingan <
> tandingan.wlb@gmail.com>
> wrote:
>
> > That's great to hear!
> >
> > I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size
> will
> > be implemented. Will these parameters be acquired from a request scoped
> > service or something like an action invocation context? How about the
> > properties for the paged collection e.g. total number of records, page
> > number, size, etc.?
> >
> > On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <
> dan@haywood-associates.co.uk>
> > wrote:
> >
> > > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> > I'll
> > > aim to implement the first two (x-ro-follow-links, table grids) in
> > 1.11.0.
> > >
> > > Thx
> > > Dan
> > >
> > > https://issues.apache.org/jira/browse/ISIS-1232
> > > https://issues.apache.org/jira/browse/ISIS-1233
> > > https://issues.apache.org/jira/browse/ISIS-1234
> > > https://issues.apache.org/jira/browse/ISIS-1235
> > >
> > >
> > > On 15 October 2015 at 22:26, Dan Haywood <dan@haywood-associates.co.uk
> >
> > > wrote:
> > >
> > > > OK, I can focus on those sections, as and when I get the chance.
> > > >
> > > > IIRC, I did implement some of the x-ro-follow-links stuff, but it
> must
> > > > have been over 2 years ago, so I forget the details as to how to make
> > it
> > > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > > >
> > > > Thx
> > > > Dan
> > > >
> > > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > > tandingan.wlb@gmail.com> wrote:
> > > >
> > > >> Hello Dan,
> > > >>
> > > >> The short answer is no.  I'm not averse to enhancing this with
> > > extensions
> > > >> > as they make sense.
> > > >> >
> > > >> > But the longer answer is that there a couple of SPI services that
> > > allow
> > > >> you
> > > >> > to customize the representations, [1], [2].  The default RO
> > > >> representations
> > > >> > are performed by an implementation of [1].
> > > >> >
> > > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > > >> > implementations for HAL, Collection+JSON, Siren etc... but you
> might
> > > >> find
> > > >> > that your client-side (Javascript?) widget UI libraries work best
> > with
> > > >> some
> > > >> > other more "adhoc" representations.
> > > >> >
> > > >> > What these SPI services *don't* allow is for the resources defined
> > by
> > > RO
> > > >> > (or their input JSON) to change.  I don't see any particular need
> to
> > > >> > customize this, though.
> > > >> >
> > > >>
> > > >> I think I saw ContentMappingService being used in ToDoApp. Using
> those
> > > >> SPIs
> > > >> would work, however while going through the Spiro framework as
> > discussed
> > > >> in
> > > >> the other thread, I saw interesting additional sections in the RO
> spec
> > > >> v1.1.0 about:
> > > >>
> > > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > > >> 34.9 Minimizing Round-trips by supporting table grids
> > > >>
> > > >> I had skimmed through RO v1.0.0 before and afaik, those weren't
> there
> > > yet.
> > > >> Those sections, especially 34.9, addresses our need.
> > > >>
> > > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > > >> x-ro-page-size)
> > > >> are also nice to haves.
> > > >>
> > > >
> > > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Willie,

I admit I haven't thought about any of this too much over and above what's
in the spec (that I wrote a *long* time ago).  I just wanted to commit
myself mentally to doing this stuff soon.

I know that some of this stuff has been implemented on Naked Objects.NET,
so I will check with those guys (Richard and Stef) to see how they did it.

But if you have ideas, please feel free to comment on the tickets raised.

Thx
Dan



On 4 November 2015 at 16:57, Willie Loyd Tandingan <ta...@gmail.com>
wrote:

> That's great to hear!
>
> I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size will
> be implemented. Will these parameters be acquired from a request scoped
> service or something like an action invocation context? How about the
> properties for the paged collection e.g. total number of records, page
> number, size, etc.?
>
> On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
> > I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.
> I'll
> > aim to implement the first two (x-ro-follow-links, table grids) in
> 1.11.0.
> >
> > Thx
> > Dan
> >
> > https://issues.apache.org/jira/browse/ISIS-1232
> > https://issues.apache.org/jira/browse/ISIS-1233
> > https://issues.apache.org/jira/browse/ISIS-1234
> > https://issues.apache.org/jira/browse/ISIS-1235
> >
> >
> > On 15 October 2015 at 22:26, Dan Haywood <da...@haywood-associates.co.uk>
> > wrote:
> >
> > > OK, I can focus on those sections, as and when I get the chance.
> > >
> > > IIRC, I did implement some of the x-ro-follow-links stuff, but it must
> > > have been over 2 years ago, so I forget the details as to how to make
> it
> > > work exactly.  Some slightly odd xpath-like syntax, I think.
> > >
> > > Thx
> > > Dan
> > >
> > > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > > tandingan.wlb@gmail.com> wrote:
> > >
> > >> Hello Dan,
> > >>
> > >> The short answer is no.  I'm not averse to enhancing this with
> > extensions
> > >> > as they make sense.
> > >> >
> > >> > But the longer answer is that there a couple of SPI services that
> > allow
> > >> you
> > >> > to customize the representations, [1], [2].  The default RO
> > >> representations
> > >> > are performed by an implementation of [1].
> > >> >
> > >> > Eventually I'm thinking that Isis might provide out-of-the-box
> > >> > implementations for HAL, Collection+JSON, Siren etc... but you might
> > >> find
> > >> > that your client-side (Javascript?) widget UI libraries work best
> with
> > >> some
> > >> > other more "adhoc" representations.
> > >> >
> > >> > What these SPI services *don't* allow is for the resources defined
> by
> > RO
> > >> > (or their input JSON) to change.  I don't see any particular need to
> > >> > customize this, though.
> > >> >
> > >>
> > >> I think I saw ContentMappingService being used in ToDoApp. Using those
> > >> SPIs
> > >> would work, however while going through the Spiro framework as
> discussed
> > >> in
> > >> the other thread, I saw interesting additional sections in the RO spec
> > >> v1.1.0 about:
> > >>
> > >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> > >> 34.9 Minimizing Round-trips by supporting table grids
> > >>
> > >> I had skimmed through RO v1.0.0 before and afaik, those weren't there
> > yet.
> > >> Those sections, especially 34.9, addresses our need.
> > >>
> > >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> > >> x-ro-page-size)
> > >> are also nice to haves.
> > >>
> > >
> > >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Willie Loyd Tandingan <ta...@gmail.com>.
That's great to hear!

I'm pretty curious on how x-ro-sort-by, x-ro-page, and x-ro-page-size will
be implemented. Will these parameters be acquired from a request scoped
service or something like an action invocation context? How about the
properties for the paged collection e.g. total number of records, page
number, size, etc.?

On Tue, Nov 3, 2015 at 8:31 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.  I'll
> aim to implement the first two (x-ro-follow-links, table grids) in 1.11.0.
>
> Thx
> Dan
>
> https://issues.apache.org/jira/browse/ISIS-1232
> https://issues.apache.org/jira/browse/ISIS-1233
> https://issues.apache.org/jira/browse/ISIS-1234
> https://issues.apache.org/jira/browse/ISIS-1235
>
>
> On 15 October 2015 at 22:26, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
> > OK, I can focus on those sections, as and when I get the chance.
> >
> > IIRC, I did implement some of the x-ro-follow-links stuff, but it must
> > have been over 2 years ago, so I forget the details as to how to make it
> > work exactly.  Some slightly odd xpath-like syntax, I think.
> >
> > Thx
> > Dan
> >
> > On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> > tandingan.wlb@gmail.com> wrote:
> >
> >> Hello Dan,
> >>
> >> The short answer is no.  I'm not averse to enhancing this with
> extensions
> >> > as they make sense.
> >> >
> >> > But the longer answer is that there a couple of SPI services that
> allow
> >> you
> >> > to customize the representations, [1], [2].  The default RO
> >> representations
> >> > are performed by an implementation of [1].
> >> >
> >> > Eventually I'm thinking that Isis might provide out-of-the-box
> >> > implementations for HAL, Collection+JSON, Siren etc... but you might
> >> find
> >> > that your client-side (Javascript?) widget UI libraries work best with
> >> some
> >> > other more "adhoc" representations.
> >> >
> >> > What these SPI services *don't* allow is for the resources defined by
> RO
> >> > (or their input JSON) to change.  I don't see any particular need to
> >> > customize this, though.
> >> >
> >>
> >> I think I saw ContentMappingService being used in ToDoApp. Using those
> >> SPIs
> >> would work, however while going through the Spiro framework as discussed
> >> in
> >> the other thread, I saw interesting additional sections in the RO spec
> >> v1.1.0 about:
> >>
> >> 34.4 Minimizing Round-trips (x-ro-follow-links)
> >> 34.9 Minimizing Round-trips by supporting table grids
> >>
> >> I had skimmed through RO v1.0.0 before and afaik, those weren't there
> yet.
> >> Those sections, especially 34.9, addresses our need.
> >>
> >> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
> >> x-ro-page-size)
> >> are also nice to haves.
> >>
> >
> >
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I've raised ISIS-1232, ISIS-1233, ISIS-1234 and ISIS-1235 for these.  I'll
aim to implement the first two (x-ro-follow-links, table grids) in 1.11.0.

Thx
Dan

https://issues.apache.org/jira/browse/ISIS-1232
https://issues.apache.org/jira/browse/ISIS-1233
https://issues.apache.org/jira/browse/ISIS-1234
https://issues.apache.org/jira/browse/ISIS-1235


On 15 October 2015 at 22:26, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> OK, I can focus on those sections, as and when I get the chance.
>
> IIRC, I did implement some of the x-ro-follow-links stuff, but it must
> have been over 2 years ago, so I forget the details as to how to make it
> work exactly.  Some slightly odd xpath-like syntax, I think.
>
> Thx
> Dan
>
> On 14 October 2015 at 19:29, Willie Loyd Tandingan <
> tandingan.wlb@gmail.com> wrote:
>
>> Hello Dan,
>>
>> The short answer is no.  I'm not averse to enhancing this with extensions
>> > as they make sense.
>> >
>> > But the longer answer is that there a couple of SPI services that allow
>> you
>> > to customize the representations, [1], [2].  The default RO
>> representations
>> > are performed by an implementation of [1].
>> >
>> > Eventually I'm thinking that Isis might provide out-of-the-box
>> > implementations for HAL, Collection+JSON, Siren etc... but you might
>> find
>> > that your client-side (Javascript?) widget UI libraries work best with
>> some
>> > other more "adhoc" representations.
>> >
>> > What these SPI services *don't* allow is for the resources defined by RO
>> > (or their input JSON) to change.  I don't see any particular need to
>> > customize this, though.
>> >
>>
>> I think I saw ContentMappingService being used in ToDoApp. Using those
>> SPIs
>> would work, however while going through the Spiro framework as discussed
>> in
>> the other thread, I saw interesting additional sections in the RO spec
>> v1.1.0 about:
>>
>> 34.4 Minimizing Round-trips (x-ro-follow-links)
>> 34.9 Minimizing Round-trips by supporting table grids
>>
>> I had skimmed through RO v1.0.0 before and afaik, those weren't there yet.
>> Those sections, especially 34.9, addresses our need.
>>
>> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page,
>> x-ro-page-size)
>> are also nice to haves.
>>
>
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
OK, I can focus on those sections, as and when I get the chance.

IIRC, I did implement some of the x-ro-follow-links stuff, but it must have
been over 2 years ago, so I forget the details as to how to make it work
exactly.  Some slightly odd xpath-like syntax, I think.

Thx
Dan

On 14 October 2015 at 19:29, Willie Loyd Tandingan <ta...@gmail.com>
wrote:

> Hello Dan,
>
> The short answer is no.  I'm not averse to enhancing this with extensions
> > as they make sense.
> >
> > But the longer answer is that there a couple of SPI services that allow
> you
> > to customize the representations, [1], [2].  The default RO
> representations
> > are performed by an implementation of [1].
> >
> > Eventually I'm thinking that Isis might provide out-of-the-box
> > implementations for HAL, Collection+JSON, Siren etc... but you might find
> > that your client-side (Javascript?) widget UI libraries work best with
> some
> > other more "adhoc" representations.
> >
> > What these SPI services *don't* allow is for the resources defined by RO
> > (or their input JSON) to change.  I don't see any particular need to
> > customize this, though.
> >
>
> I think I saw ContentMappingService being used in ToDoApp. Using those SPIs
> would work, however while going through the Spiro framework as discussed in
> the other thread, I saw interesting additional sections in the RO spec
> v1.1.0 about:
>
> 34.4 Minimizing Round-trips (x-ro-follow-links)
> 34.9 Minimizing Round-trips by supporting table grids
>
> I had skimmed through RO v1.0.0 before and afaik, those weren't there yet.
> Those sections, especially 34.9, addresses our need.
>
> 34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page, x-ro-page-size)
> are also nice to haves.
>

Re: Restful objects list action result with domain object representation instead of links

Posted by Willie Loyd Tandingan <ta...@gmail.com>.
Hello Dan,

The short answer is no.  I'm not averse to enhancing this with extensions
> as they make sense.
>
> But the longer answer is that there a couple of SPI services that allow you
> to customize the representations, [1], [2].  The default RO representations
> are performed by an implementation of [1].
>
> Eventually I'm thinking that Isis might provide out-of-the-box
> implementations for HAL, Collection+JSON, Siren etc... but you might find
> that your client-side (Javascript?) widget UI libraries work best with some
> other more "adhoc" representations.
>
> What these SPI services *don't* allow is for the resources defined by RO
> (or their input JSON) to change.  I don't see any particular need to
> customize this, though.
>

I think I saw ContentMappingService being used in ToDoApp. Using those SPIs
would work, however while going through the Spiro framework as discussed in
the other thread, I saw interesting additional sections in the RO spec
v1.1.0 about:

34.4 Minimizing Round-trips (x-ro-follow-links)
34.9 Minimizing Round-trips by supporting table grids

I had skimmed through RO v1.0.0 before and afaik, those weren't there yet.
Those sections, especially 34.9, addresses our need.

34.2 Sorting (x-ro-sort-by) and 34.3 Pagination (x-ro-page, x-ro-page-size)
are also nice to haves.

Re: Restful objects list action result with domain object representation instead of links

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Willie,

Welcome to the users@ mailing list,

comments within...


On 13 October 2015 at 19:02, Willie Loyd Tandingan <ta...@gmail.com>
wrote:

> Hi!
>
> We're quite new to Apache ISIS and would like to use it for our backend
> mainly using the restful objects viewer for the frontend implemented as
> SPA. We only use the wicket viewer in development and prototyping. So far,
> we've gotten highly positive, much amaze feedbacks from the developers due
> to its free UI and they can focus more on business logic.
>
>
Lovely to hear that your team's experience so far has been so positive!



> Most entities usually have CRUD pages and a view page in the form of a
> grid. In the wicket viewer, actions that return list are shown as tables
> with the properties as columns while honoring UI hints. Is it possible to
> apply this behaviour to restful objects?


The short answer is no.  I'm not averse to enhancing this with extensions
as they make sense.

But the longer answer is that there a couple of SPI services that allow you
to customize the representations, [1], [2].  The default RO representations
are performed by an implementation of [1].

Eventually I'm thinking that Isis might provide out-of-the-box
implementations for HAL, Collection+JSON, Siren etc... but you might find
that your client-side (Javascript?) widget UI libraries work best with some
other more "adhoc" representations.

What these SPI services *don't* allow is for the resources defined by RO
(or their input JSON) to change.  I don't see any particular need to
customize this, though.





> Currently, actions returning a
> list of domain objects only return links with the title and I would like it
> to include/exclude other properties that are seen/unseen in the wicket
> viewer. The user guide [1] shows an option to allow UI hints but it seems
> to only apply specifically to collections rendering eagerly.
>
> I had a quick look at the restful objects renderer code and it seems that
> what I needed is ListReprRenderer with DomainObjectReprRenderer. The action
> returning the list of domain object always has a parameter for pagination.
>
>
If you can specify exactly what's needed, we can take it from there.  Or,
since you've already started getting familiar with the codebase, happy to
review any pull requests.  Or, as I say, go your own way with a custom SPI
implementation of [2] or [3].

HTH
Dan




> Thanks in advance!
>
> [1] https://isis.apache.org/guides/ug.html#7.1.-features
>



[2]
http://isis.apache.org/guides/rg.html#_rg_services-spi_manpage-RepresentationService
[3]
http://isis.apache.org/guides/rg.html#_rg_services-spi_manpage-ContentMappingService