<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks for trying out AeroGear!<div><br></div><div>I think what you are looking for are the docs for read (and save). In those methods, you can specify your record ID which will be appended to the URL. The docs are here&nbsp;<a href="http://aerogear.org/docs/specs/aerogear-js/AeroGear.Pipeline.adapters.Rest.html#read">http://aerogear.org/docs/specs/aerogear-js/AeroGear.Pipeline.adapters.Rest.html#read</a></div><div><br></div><div>In your example, you would want to do something like:</div><div><br></div><div>var schoolMenuPipe = AeroGear.Pipeline([ {<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>name : "schoolmenu",<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>recordId : "someID", //by default this is "id" but you can change it<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>settings : {<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>baseURL : "/harpsterserver/rest/p1/"<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>} ]).pipes.schoolmenu;</div><div><br></div><div>This will use schoolmenu as the endpoint. Then, in your read, you would do:</div><div><br></div><div>schoolMenuPipe.read( {&nbsp;id: 1 } );</div><div><br></div><div>That would give you the record where someID=1.</div><div><br></div><div>Hope that makes sense and let us know if you have more questions.</div><div><br><div><div>On Oct 7, 2013, at 12:51 PM, rnaszcyn &lt;<a href="mailto:rnaszcyn@redhat.com">rnaszcyn@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all. I have started to use Aerogear for my mobile connectivity with pretty<br>good luck. One question I have is what is the best way to connect using<br>Aerogear to REST endpoints that accept a parameter. For example, I have the<br>following working snippet in a Javascript file I used for a mobile<br>application.<br><br>// TODO: change the pipeline name to use the school id passed to the page<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>var schoolMenuPipe = AeroGear.Pipeline([ {<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>name : "schoolmenu",<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>recordId : "1",<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>settings : {<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>baseURL : "/harpsterserver/rest/p1/",<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>endpoint : "schoolmenu/1" &nbsp;&nbsp;// The school ID is temporarily hard coded!!<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>} ]).pipes.schoolmenu;<br><br>In order to get the parameter into the Pipeline call (in this case a school<br>ID) I have to include the endpoint in the settings object so the default<br>pipeline name won't be used for the endpoint.<br><br>The REST endpoint is running on EAP and is hard coded with a return value<br>now for prototype purposes.<br>@GET<br><span class="Apple-tab-span" style="white-space:pre">        </span>@Path("/school/{id}")<br><span class="Apple-tab-span" style="white-space:pre">        </span>@Produces("application/json")<br><span class="Apple-tab-span" style="white-space:pre">        </span>public School getSchool(@PathParam("id") Long id){<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>// TODO: add code that will search for a specific school<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return new School(2, "Marist High School");<br><span class="Apple-tab-span" style="white-space:pre">        </span>}<br><br>Everything is working fine right now but leaves me wondering if I have a<br>good solution pattern. I am new to Aerogear so perhaps I am missed some<br>documentation or code example.<br><br><br><br>--<br>View this message in context: <a href="http://aerogear-dev.1069024.n5.nabble.com/proper-way-to-use-AeroGear-Pipeline-with-parameter-fed-REST-endpoint-tp4956.html">http://aerogear-dev.1069024.n5.nabble.com/proper-way-to-use-AeroGear-Pipeline-with-parameter-fed-REST-endpoint-tp4956.html</a><br>Sent from the aerogear-dev mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev<br></blockquote></div><br></div></body></html>