isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cesar Lugo <cesar.l...@sisorg.com.mx>
Subject RE: Restful objects list action result with domain object representation instead of links
Date Fri, 20 Nov 2015 00:23:05 GMT
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 <cesar.lugo@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


Mime
View raw message