<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi<div><br></div><div>some comments</div><div><br></div><div>I believe the method can't be used since you don't know the team for the players &nbsp;so you can't retrieve the pipe directly..right?</div><div><br></div><div><pre class="line-pre" style="font-size: 12px; line-height: 16px; font-family: Consolas, 'Liberation Mono', Courier, monospace; word-wrap: break-word; width: 744px; margin-top: 0px; margin-bottom: 0px; padding: 0px; background-color: rgb(255, 255, 255); position: static; z-index: auto; "><div class="line" id="file-junctionapplication-java-LC9"> <span class="n" style="color: rgb(51, 51, 51); ">getPlayers</span><span class="o" style="font-weight: bold; ">(</span><span class="n" style="color: rgb(51, 51, 51); ">Callback</span><span class="o" style="font-weight: bold; ">&lt;</span><span class="n" style="color: rgb(51, 51, 51); ">List</span><span class="o" style="font-weight: bold; ">&lt;</span><span class="n" style="color: rgb(51, 51, 51); ">Player</span><span class="o" style="font-weight: bold; ">&gt;&gt;</span> <span class="n" style="color: rgb(51, 51, 51); ">callback</span><span class="o" style="font-weight: bold; ">)</span> <span class="o" style="font-weight: bold; ">{</span></div><div class="line" id="file-junctionapplication-java-LC10" style="background-color: rgb(255, 255, 204); position: static; z-index: auto; ">    <span class="n" style="color: rgb(51, 51, 51); ">pipe</span><span class="o" style="font-weight: bold; ">.</span><span class="na" style="color: teal; ">get</span><span class="o" style="font-weight: bold; ">(</span><span class="s" style="color: rgb(221, 17, 68); ">"player"</span><span class="o" style="font-weight: bold; ">).</span><span class="na" style="color: teal; ">read</span><span class="o" style="font-weight: bold; ">(</span><span class="n" style="color: rgb(51, 51, 51); ">callback</span><span class="o" style="font-weight: bold; ">);</span></div><div class="line" id="file-junctionapplication-java-LC11">  <span class="o" style="font-weight: bold; ">}</span></div></pre><div><br></div><div>Further my questions is, how is a third (or arbitrary) nested resources are supported? I mean for a url schema like this</div><div><br></div><div><a href="http://soccer.org/leagues/">soccer.org/leagues/</a>{id}/teams/{id}/players/{id}</div><div><br></div><div>first we access the leagues:</div><div>---</div><div>getLeagues(Callback&lt;List&lt;Leagues&gt;&gt; callback) {</div><div>&nbsp;pipe.get("leagues").read(callback);</div><div>}</div><div>---</div><div>then the teams for this league:</div><div>---</div><div><div><div>getTeamsOnLeaque(Leaque league, Callback&lt;List&lt;Team&gt;&gt; callback) {</div></div></div><div><div>&nbsp; &nbsp;pipe.junction("league","team").read(leaque, callback);</div><div>}</div></div><div>---</div><div>..and then we access the "Players" for a "Team":</div><div>---</div><div><div>&nbsp; getPlayersOnTeam(Team team, Callback&lt;List&lt;Player&gt;&gt; callback) {</div><div>&nbsp; &nbsp; pipe.junction("team","player").read(team, callback);</div><div>&nbsp; }</div></div><div>---</div><div>But where is the "League" information to fill the "/leagues/{id}..." path?&nbsp;</div><div>Unless you mean something like:</div><div>---</div><div><div>&nbsp; getPlayersOnTeam(Leaque league, Team team, Callback&lt;List&lt;Player&gt;&gt; callback) {</div><div>&nbsp; &nbsp; pipe.junction("league", "team","player").read(league, team, callback);</div><div>&nbsp; }</div></div><div>---</div><div><br></div><div>probably I am missing sth..</div><div><br></div><div>Thanks,</div><div>Christos</div><div><br></div><div>On Apr 4, 2013, at 5:52 PM, Summers Pittman &lt;<a href="mailto:supittma@redhat.com">supittma@redhat.com</a>&gt; wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite">What if we create a new metaphor, a Junction.<br><br><a href="https://gist.github.com/secondsun/dcf5682b6ff17c729d9a">https://gist.github.com/secondsun/dcf5682b6ff17c729d9a</a><br><br>It joins two pipes together and can be used over and over again with different data?<br>It isn't a Pipe though, but perhaps that could be changed to look more like Christos's previous example.<br><br>At the very least I like the words "junction" or "join" more than "of"<br><br>----- Original Message -----<br>| From: "Christos Vasilakis" &lt;cvasilak@gmail.com&gt;<br>| To: "AeroGear Developer Mailing List" &lt;aerogear-dev@lists.jboss.org&gt;<br>| Sent: Wednesday, April 3, 2013 3:03:02 AM<br>| Subject: Re: [aerogear-dev] [Aerogear Pipeline] Support for nested endpoints<br>| <br>| <br>| On Apr 2, 2013, at 4:03 PM, Matthias Wessendorf &lt; matzew@apache.org &gt; wrote:<br>| <br>| <br>| <br>| <br>| Two thoughts....<br>| <br>| 1) the 'original' leaguesPipe has no clue about the subpipes, right ?<br>| 2) should a pipe offer a 'getter' for all it's sub pipes ?<br>| <br>| <br>| Just a thought is instead of using Pipe, to continue using Pipeline adding an<br>| extra parameter " of" for specifying the parent : E.g.:<br>| <br>| …..<br>| id&lt;AGPipe&gt; leaguesPipe = [pipeline pipe@"leagues"];<br>| <br>| id&lt;AGPipe&gt; allTeamsInSeattlePipe = [pipeline subPipe@"teams" of :leaguesPipe<br>| for:@"seattle"]<br>| <br>| id&lt;AGPipe&gt; allPlayersInTrebuchetPipe = [pipeline subPipe:@"players" of:<br>| allTeamsInSeattlePipe for:@"trebuchet"];<br>| …..<br>| <br>| <br>| Wdyt?<br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| -M<br>| <br>| <br>| <br>| <br>| <br>| Thanks,<br>| Christos<br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| <br>| soccer.org/leagues/seattle/teams/trebuchet/players/foo - &gt;<br>| [[pipeline pipe:@"players" pathParams:@[@"seattle", @"trebuchet"]] read<br>| :@"foo"] ..<br>| -----<br>| <br>| <br>| Wdyt?<br>| <br>| Thanks<br>| Christos<br>| <br>| On Mar 18, 2013, at 1:12 PM, Sebastien Blanc &lt; scm.blanc@gmail.com &gt; wrote:<br>| <br>| <br>| <br>| Well, that would not be possible, for that you will have to create a "child"<br>| pipe. But I agree, that is maybe no optimal ...<br>| <br>| <br>| On Fri, Mar 15, 2013 at 6:44 PM, Summers Pittman &lt; supittma@redhat.com &gt;<br>| wrote:<br>| <br>| <br>| <br>| On 03/15/2013 01:34 PM, Sebastien Blanc wrote:<br>| <br>| <br>| I like the idea but I will more see that has a method/function for the<br>| pipelineManager (and will be easier to implement in JS, I think) :<br>| <br>| var myParentPipe = Aerogear.Pipeline({name:"parentPipe"}).pipes.parentPipe<br>| <br>| var myChildPipe = Aerogear.Pipeline.fromParent(myParentPipe, {options} )<br>| What would it look like to get a child record from a parent?<br>| <br>| <br>| <br>| <br>| <br>| <br>| On Fri, Mar 15, 2013 at 5:37 PM, Douglas Campos &lt; qmx@qmx.me &gt; wrote:<br>| <br>| <br>| What about this?<br>| <br>| Pipeline&lt;Post&gt; postPipeline = …<br>| Post post = // get from the pipeline<br>| Pipeline&lt;Comment&gt;<br>| postPipeline.childPipelineForOrOtherWeirdName(Comment.class, post)<br>| <br>| <br>| On 15/03/2013, at 12:26, Summers Pittman &lt; supittma@redhat.com &gt; wrote:<br>| <br>| &gt; On 03/14/2013 04:48 AM, Matthias Wessendorf wrote:<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; On Thu, Mar 14, 2013 at 9:32 AM, Sebastien Blanc &lt; scm.blanc@gmail.com &gt;<br>| &gt;&gt; wrote:<br>| &gt;&gt; Hi,<br>| &gt;&gt; While I was playing with scaffolding and tried to build a simple Blog<br>| &gt;&gt; Application with Aerogear I faced the current situation :<br>| &gt;&gt; I have a Post object which contains many Comment objects. Now I want to<br>| &gt;&gt; call my Post pipe to retrieve the related comments, I have currently 2<br>| &gt;&gt; options :<br>| &gt;&gt; <br>| &gt;&gt; /posts/1 -&gt; assuming comments will be implicitly retrieved (eager loading)<br>| &gt;&gt; /comments/?postid=1<br>| &gt;&gt; <br>| &gt;&gt; But regarding our model the correct form should be :<br>| &gt;&gt; <br>| &gt;&gt; /posts/1/comments<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; +1<br>| &gt;&gt; that is the ideal way to model URIs for "nested" resources.<br>| &gt;&gt; <br>| &gt;&gt; See [1], extracted from [2]<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; But, AFAIK, with the current API, it is not possible to define this last<br>| &gt;&gt; pattern (at least for JS and iOs, confirmed by Matzew). When doing a read<br>| &gt;&gt; we can pass an id option but as mentioned in the doc, this id will always<br>| &gt;&gt; be append to the endpoint.<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; Well, it is possible - but in a very (IMO) ugly way:<br>| &gt;&gt; <br>| &gt;&gt; https://gist.github.com/matzew/6ab432e437b9a017a21d<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; IMO, we should be able to support this pattern but for now I'm not really<br>| &gt;&gt; sure how to specify this in our API, so if you have any ideas feedback<br>| &gt;&gt; this thread has been made for you !<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; Suggestion: Enhance the read function - example:<br>| &gt;&gt; <br>| &gt;&gt; https://gist.github.com/matzew/04f069dfbed2cc77a8b4<br>| &gt; I'm thinking of the inverse myself. Add a "ParentPath" property which can<br>| &gt; be used to extract information from parent objects.<br>| &gt; <br>| &gt; https://gist.github.com/secondsun/17ce96082eda37dbd10e<br>| &gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; -Matthias<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; [1]<br>| &gt;&gt; http://www.infoq.com/resource/articles/rest-introduction/en/resources/figure2.jpg<br>| &gt;&gt; [2] http://www.infoq.com/articles/rest-introduction<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; Seb<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; _______________________________________________<br>| &gt;&gt; aerogear-dev mailing list<br>| &gt;&gt; aerogear-dev@lists.jboss.org<br>| &gt;&gt; https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; <br>| &gt;&gt; --<br>| &gt;&gt; Matthias Wessendorf<br>| &gt;&gt; <br>| &gt;&gt; blog: http://matthiaswessendorf.wordpress.com/<br>| &gt;&gt; sessions: http://www.slideshare.net/mwessendorf<br>| &gt;&gt; twitter: http://twitter.com/mwessendorf<br>| &gt;&gt; <br>| &gt;&gt; _______________________________________________<br>| &gt;&gt; aerogear-dev mailing list<br>| &gt;&gt; <br>| &gt;&gt; aerogear-dev@lists.jboss.org<br>| &gt;&gt; https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| &gt; <br>| &gt; _______________________________________________<br>| &gt; aerogear-dev mailing list<br>| &gt; aerogear-dev@lists.jboss.org<br>| &gt; https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| -- qmx<br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| <br>| --<br>| Matthias Wessendorf<br>| <br>| blog: http://matthiaswessendorf.wordpress.com/<br>| sessions: http://www.slideshare.net/mwessendorf<br>| twitter: http://twitter.com/mwessendorf<br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| <br>| --<br>| Matthias Wessendorf<br>| <br>| blog: http://matthiaswessendorf.wordpress.com/<br>| sessions: http://www.slideshare.net/mwessendorf<br>| twitter: http://twitter.com/mwessendorf<br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br>| <br>| <br>| _______________________________________________<br>| aerogear-dev mailing list<br>| aerogear-dev@lists.jboss.org<br>| https://lists.jboss.org/mailman/listinfo/aerogear-dev<br><br>_______________________________________________<br>aerogear-dev mailing list<br>aerogear-dev@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></div></body></html>