<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: JsonRestStore &#8212; Custom Services, Schemas, and Lazy Loading</title>
	<atom:link href="http://blog.medryx.org/2008/07/24/jsonreststore-overview/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/</link>
	<description>Observations of a physician software developer.</description>
	<pubDate>Sat, 31 Jul 2010 03:52:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: PukSapy</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-258</link>
		<dc:creator>PukSapy</dc:creator>
		<pubDate>Mon, 03 May 2010 13:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-258</guid>
		<description>NiksPymN say: You the talented person
 
_____________
&lt;a href="http://livitra.rx-tadacip.info/site_map.html" rel="nofollow"&gt;livitra
 attorneys
  0&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>NiksPymN say: You the talented person</p>
<p>_____________<br />
<a href="http://livitra.rx-tadacip.info/site_map.html" rel="nofollow">livitra<br />
 attorneys<br />
  0</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dynaturtle</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-252</link>
		<dc:creator>dynaturtle</dc:creator>
		<pubDate>Thu, 24 Dec 2009 08:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-252</guid>
		<description>Hello, Medryx, I have a problem with the server side scripting. I use python. And I fail at deletion. The jsonreststore send the delete method to the server and I successfully deleted the specified uuid item in the database. But it seems that the client side item didn't delete. It is still there when I try to list all items in the store. I guess it probably the problem of the return value of delete request. What should the server return for the delete operation? Right now I just return nothing to the client.</description>
		<content:encoded><![CDATA[<p>Hello, Medryx, I have a problem with the server side scripting. I use python. And I fail at deletion. The jsonreststore send the delete method to the server and I successfully deleted the specified uuid item in the database. But it seems that the client side item didn&#8217;t delete. It is still there when I try to list all items in the store. I guess it probably the problem of the return value of delete request. What should the server return for the delete operation? Right now I just return nothing to the client.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Weier O'Phinney</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-236</link>
		<dc:creator>Matthew Weier O'Phinney</dc:creator>
		<pubDate>Tue, 01 Sep 2009 20:35:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-236</guid>
		<description>There's a subtle correction you need to make in this article. In RESTful architectures, POST will create, and PUT is used to update -- which is exactly opposite of what you describe. JsonRestStore does do the correct thing here -- it's designed to POST content that needs to be created on the server, and PUT content to update.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a subtle correction you need to make in this article. In RESTful architectures, POST will create, and PUT is used to update &#8212; which is exactly opposite of what you describe. JsonRestStore does do the correct thing here &#8212; it&#8217;s designed to POST content that needs to be created on the server, and PUT content to update.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Fenwick</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-156</link>
		<dc:creator>Nick Fenwick</dc:creator>
		<pubDate>Wed, 13 May 2009 02:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-156</guid>
		<description>Thanks for this post.  I'd like to offer a tip I got from neonstalwart on #dojo.  I've got a servlet that needs to do some custom authentication based on a security token (a simple string) known by the browser, and I was able to make my JsonDataStore pass it with every server request by adding it to the 'content' attributes in the service.  e.g. to add a 'myCustomContent' attribute with a value from the 'foobarwibble' variable:

var mdService = function(query, queryOptions) {
return dojo.xhrGet({url:"queryUrl.php", handleAs:'json', content:{myCustomContent: foobarwibble, query:query, queryOptions:queryOptions}});
}

(and do that for the other xhr methods too)  Then the receiving GET,POST etc. handler may perform its own authentication before deciding whether to service the request.

However, a correction: Your first example needs to return from the 'put' method, i.e. change:
mdService.put = function(id, value) {
mdService.post(id, value);
}
to:
mdService.put = function(id, value) {
return mdService.post(id, value);
}

Otherwise the code in JsonRest.js that uses the result of 'put' as a Deferred (as a result of executing service[action.method]) runs into a 'dfd is undefined' error.  Trying to debug that led me to learn a little more about debugAtAllCosts and how it can help firebug reveal the line of code experiencing an error :)</description>
		<content:encoded><![CDATA[<p>Thanks for this post.  I&#8217;d like to offer a tip I got from neonstalwart on #dojo.  I&#8217;ve got a servlet that needs to do some custom authentication based on a security token (a simple string) known by the browser, and I was able to make my JsonDataStore pass it with every server request by adding it to the &#8216;content&#8217; attributes in the service.  e.g. to add a &#8216;myCustomContent&#8217; attribute with a value from the &#8216;foobarwibble&#8217; variable:</p>
<p>var mdService = function(query, queryOptions) {<br />
return dojo.xhrGet({url:&#8221;queryUrl.php&#8221;, handleAs:&#8217;json&#8217;, content:{myCustomContent: foobarwibble, query:query, queryOptions:queryOptions}});<br />
}</p>
<p>(and do that for the other xhr methods too)  Then the receiving GET,POST etc. handler may perform its own authentication before deciding whether to service the request.</p>
<p>However, a correction: Your first example needs to return from the &#8216;put&#8217; method, i.e. change:<br />
mdService.put = function(id, value) {<br />
mdService.post(id, value);<br />
}<br />
to:<br />
mdService.put = function(id, value) {<br />
return mdService.post(id, value);<br />
}</p>
<p>Otherwise the code in JsonRest.js that uses the result of &#8216;put&#8217; as a Deferred (as a result of executing service[action.method]) runs into a &#8216;dfd is undefined&#8217; error.  Trying to debug that led me to learn a little more about debugAtAllCosts and how it can help firebug reveal the line of code experiencing an error <img src='http://blog.medryx.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philou</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-138</link>
		<dc:creator>philou</dc:creator>
		<pubDate>Mon, 15 Dec 2008 20:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-138</guid>
		<description>Dear Maulin,

I realise you're providing this tutorial as a service to the community presumably in your spare time. Many thanks for that. However, I feel that there are surely more people like myself out and about who fail to benefit from tutorials like these, because we are simply not able to translate your "illustrative code" into something that works. It is true that I am not a professional programmer, but I would consider myself Pro enough to eventually get a grasp of what is being discussed here. Alas, I find that I am spending hour after hour trying to piece together these tutorials (be they yours or those by Kris Zyp), and I often stumble over a little detail which was not mentioned anywhere, since it may be obvious to those who are as familiar with dojo as you are. (Example: The JsonRestStore data would not show up in my dataGrid for days, because I wasn't calling "grid.startup();", which apparently wasn't necessery for the itemFileWriteStore I was using before.)

My question: 
Is it not possible to provide an archive with a complete html and a json file which can be used to see the basic functionality of the tutorial in action (here: referencing)? Bryan Forbes has done that on sitepen for dataGrid and it has helped my understanding tremendously.

Either way many thanks,
p.</description>
		<content:encoded><![CDATA[<p>Dear Maulin,</p>
<p>I realise you&#8217;re providing this tutorial as a service to the community presumably in your spare time. Many thanks for that. However, I feel that there are surely more people like myself out and about who fail to benefit from tutorials like these, because we are simply not able to translate your &#8220;illustrative code&#8221; into something that works. It is true that I am not a professional programmer, but I would consider myself Pro enough to eventually get a grasp of what is being discussed here. Alas, I find that I am spending hour after hour trying to piece together these tutorials (be they yours or those by Kris Zyp), and I often stumble over a little detail which was not mentioned anywhere, since it may be obvious to those who are as familiar with dojo as you are. (Example: The JsonRestStore data would not show up in my dataGrid for days, because I wasn&#8217;t calling &#8220;grid.startup();&#8221;, which apparently wasn&#8217;t necessery for the itemFileWriteStore I was using before.)</p>
<p>My question:<br />
Is it not possible to provide an archive with a complete html and a json file which can be used to see the basic functionality of the tutorial in action (here: referencing)? Bryan Forbes has done that on sitepen for dataGrid and it has helped my understanding tremendously.</p>
<p>Either way many thanks,<br />
p.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philou</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-137</link>
		<dc:creator>philou</dc:creator>
		<pubDate>Fri, 12 Dec 2008 18:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-137</guid>
		<description>OK, silly me:
my dojo.data.Grid wasn't sowing anything because I had made a mistake in my grid "layout" definition.

However, I still can't get your protoype: toString method to work. I have copied the Schema definition exactly as you have it above and passed it to the store, but the grid still shows [object Object].

I have tried to use a formatter function for the grid cell which should display the referenced object and then had the formatter function return object.toString, but it still shows [object Object] in the grid.

nonWorkingFormatterFunction (object) {
  return object.toString;
}

if I use the formatterFunction to return object.myProperty, then the content of myProperty is correctly displayed in the grid. That works, but it means I will have to put a formatter function somewhere for every kind of reference....

Any idea?

Many thanks!
p.</description>
		<content:encoded><![CDATA[<p>OK, silly me:<br />
my dojo.data.Grid wasn&#8217;t sowing anything because I had made a mistake in my grid &#8220;layout&#8221; definition.</p>
<p>However, I still can&#8217;t get your protoype: toString method to work. I have copied the Schema definition exactly as you have it above and passed it to the store, but the grid still shows [object Object].</p>
<p>I have tried to use a formatter function for the grid cell which should display the referenced object and then had the formatter function return object.toString, but it still shows [object Object] in the grid.</p>
<p>nonWorkingFormatterFunction (object) {<br />
  return object.toString;<br />
}</p>
<p>if I use the formatterFunction to return object.myProperty, then the content of myProperty is correctly displayed in the grid. That works, but it means I will have to put a formatter function somewhere for every kind of reference&#8230;.</p>
<p>Any idea?</p>
<p>Many thanks!<br />
p.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philou</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-134</link>
		<dc:creator>philou</dc:creator>
		<pubDate>Tue, 09 Dec 2008 20:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-134</guid>
		<description>Hi,

I'm trying to use your "$ref:" notation but the dojox.data.Grid doesn't show anything, not even [Object object] in the cell with the reference.
I have a "user" store and a "role" store. The "user" with id "1" has a "user_privilege_level":{$ref:"role/admin", "role_id":"admin"}
I have also used this schema for the roleStore: 
var roleSchema = { prototype: {toString:function() { return this.role_id;}}};
According to your tutorial, this should show the "role_id" (="admin") in the "user_privilege_level" cell of "user/1". But it doesn't.
However, firebug shows this when I check the usersStore item in the DOM that should have the reference (for the field: user_privilege_level):

user/1..........Object user_id=1 user_full_name=Joe
-&#62;
   __id.........."user/1"
   user_full_name.........."Joe"
   user_privilege_level..........Object $ref=role/admin role_id=admin __id=user/role/admin
   -&#62;
         $ref.........."role/admin"
          __id.........."user/role/admin"
          role_id.........."admin"
          _loadObject..........function()
          -&#62;
                  prototype
user/2 .... etc etc

Do you have any idea how I can track down where I'm going wrong?
Many thanks,
p.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m trying to use your &#8220;$ref:&#8221; notation but the dojox.data.Grid doesn&#8217;t show anything, not even [Object object] in the cell with the reference.<br />
I have a &#8220;user&#8221; store and a &#8220;role&#8221; store. The &#8220;user&#8221; with id &#8220;1&#8243; has a &#8220;user_privilege_level&#8221;:{$ref:&#8221;role/admin&#8221;, &#8220;role_id&#8221;:&#8221;admin&#8221;}<br />
I have also used this schema for the roleStore:<br />
var roleSchema = { prototype: {toString:function() { return this.role_id;}}};<br />
According to your tutorial, this should show the &#8220;role_id&#8221; (=&#8221;admin&#8221;) in the &#8220;user_privilege_level&#8221; cell of &#8220;user/1&#8243;. But it doesn&#8217;t.<br />
However, firebug shows this when I check the usersStore item in the DOM that should have the reference (for the field: user_privilege_level):</p>
<p>user/1&#8230;&#8230;&#8230;.Object user_id=1 user_full_name=Joe<br />
-&gt;<br />
   __id&#8230;&#8230;&#8230;.&#8221;user/1&#8243;<br />
   user_full_name&#8230;&#8230;&#8230;.&#8221;Joe&#8221;<br />
   user_privilege_level&#8230;&#8230;&#8230;.Object $ref=role/admin role_id=admin __id=user/role/admin<br />
   -&gt;<br />
         $ref&#8230;&#8230;&#8230;.&#8221;role/admin&#8221;<br />
          __id&#8230;&#8230;&#8230;.&#8221;user/role/admin&#8221;<br />
          role_id&#8230;&#8230;&#8230;.&#8221;admin&#8221;<br />
          _loadObject&#8230;&#8230;&#8230;.function()<br />
          -&gt;<br />
                  prototype<br />
user/2 &#8230;. etc etc</p>
<p>Do you have any idea how I can track down where I&#8217;m going wrong?<br />
Many thanks,<br />
p.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philou</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-124</link>
		<dc:creator>philou</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-124</guid>
		<description>Hi,

I have the same problem as Nr. 8 - Zladivliba: My JSON service returns the data in the correct format (I assume?!?), but the data doesn't show in the JsonRestStore (in Firebug), nor in the dataGrid which the store is attached to. Interestingly, only dojo release 1.2.0. actually calls the url specified in the first Service function:
&lt;code&gt;
var Service = function(query, queryOptions) {
return dojo.xhrGet({url:”/test/”, handleAs:”json” }); }
&lt;/code&gt;
dojo 1.2.1 and 1.2.2. do not make the server call to "/test/" for whatever reason. I can see all this happening (or not) in Firebug. Is that a good thing?

Isn't there a working example of a JsonRestStore implementation to be found anywhere, so we can take it apart with Firebug etc. and see how it works? I have found a "JsonRestStore.js" file in the "dojox/data/tests/stores" folder of the developer distribution, but there seems to be no .html file to go with it?

Many thanks for taking the time to write this tutorial,
philou</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have the same problem as Nr. 8 - Zladivliba: My JSON service returns the data in the correct format (I assume?!?), but the data doesn&#8217;t show in the JsonRestStore (in Firebug), nor in the dataGrid which the store is attached to. Interestingly, only dojo release 1.2.0. actually calls the url specified in the first Service function:<br />
<code><br />
var Service = function(query, queryOptions) {<br />
return dojo.xhrGet({url:”/test/”, handleAs:”json” }); }<br />
</code><br />
dojo 1.2.1 and 1.2.2. do not make the server call to &#8220;/test/&#8221; for whatever reason. I can see all this happening (or not) in Firebug. Is that a good thing?</p>
<p>Isn&#8217;t there a working example of a JsonRestStore implementation to be found anywhere, so we can take it apart with Firebug etc. and see how it works? I have found a &#8220;JsonRestStore.js&#8221; file in the &#8220;dojox/data/tests/stores&#8221; folder of the developer distribution, but there seems to be no .html file to go with it?</p>
<p>Many thanks for taking the time to write this tutorial,<br />
philou</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-123</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 28 Nov 2008 00:48:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-123</guid>
		<description>This article illustrates why I have tended to use Prototype over Dojo in most cases. Is there a SIMPLE example of accessing a restful resource using JsonRestStore? and the tying is to a DataGrid?

Thx
Eric</description>
		<content:encoded><![CDATA[<p>This article illustrates why I have tended to use Prototype over Dojo in most cases. Is there a SIMPLE example of accessing a restful resource using JsonRestStore? and the tying is to a DataGrid?</p>
<p>Thx<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kathy Nichols</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-120</link>
		<dc:creator>Kathy Nichols</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-120</guid>
		<description>mckatpckoug0r7k2</description>
		<content:encoded><![CDATA[<p>mckatpckoug0r7k2</p>
]]></content:encoded>
	</item>
</channel>
</rss>
