TiddlyHome RSS feed http://bidix.appspot.com/ The latest news from TiddlyHome en-us Copyright 2008 BidiX 2010-03-15 05:49 2010-03-15 05:49 http://blogs.law.harvard.edu/tech/rss TiddlyHome 2.0 HomePage <h1> Welcome to TiddlyHome 2.0 <sup>Beta</sup></h1><a class="externalLink" href="/" title="External link to /">TiddlyHome 2.0</a> is an early alpha Google AppEngine hosting service for <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a> users.<br><h1> Guided tour</h1><ul><li>Use <a class="externalLink" href="/BidiX/tiddlywikis" title="External link to /BidiX/tiddlywikis">/BidiX/tiddlywikis</a> and <a class="externalLink" href="/BidiX/namespaces" title="External link to /BidiX/namespaces">/BidiX/namespaces</a> to explore</li><li>Use <a class="externalLink" href="http://tiddlyhome.appspot.com/comments" title="External link to http://tiddlyhome.appspot.com/comments">/comments</a> to leave comment</li><li> But please <a class="externalLink" href="/login" title="External link to /login">login</a> and try</li><li> ... and stay tuned !</li></ul><h1> Your own TiddlyWiki at <a class="externalLink" href="/" title="External link to /">TiddlyHome 2.0</a></h1><ol><li> a google account is required</li><li> <a class="externalLink" href="/login" title="External link to /login">login</a> and set a username for TiddlyHome2</li><li> create a new TiddlyWiki at <code>/{YourName}/tiddlywikis </code> page</li><li> Optionally, from the new tiddlywiki page, you can Upload a local TiddlyWiki</li></ol><h1> How it works</h1><h4> environment</h4>TiddlyHome2 is a <a class="externalLink" href="http://code.google.com/appengine/" title="External link to http://code.google.com/appengine/">Google App Engine</a> application where :<br><ul><li> user authentication is done by Google Account</li><li> authorization and protection are manage by user</li><li> content (tiddlers) are saved in Google Datastore</li><li> conform to the <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a> single file paradigm</li></ul><h4> The data model:</h4><ul><li> User owns Namespaces</li><li> User owns Tiddlywikis</li><li> Namespace owns Tiddlers</li><li> <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a>, in a Namespace, references Tiddlers</li></ul><h4> RESTFull Api</h4><ul><li> see <a class="externalLink" href="http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/TiddlyHome%20Restful%20API.html" title="External link to http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/TiddlyHome%20Restful%20API.html">TiddlyHome Restful API</a> for details</li><li> Then <a class="externalLink" href="/" title="External link to /">TiddlyHome 2.0</a> could be easily called from an other application</li></ul> Site toRSS http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/HomePage.html 2008-09-27 08:15 TiddlyHome Restful API Following this <a class="externalLink" href="http://tiddlyhome.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/A%20Model%20for%20a%20RESTful%20API.html" title="External link to http://tiddlyhome.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/A%20Model%20for%20a%20RESTful%20API.html">model</a> above the <a class="externalLink" href="http://tiddlyhome2.bidix.info/" title="External link to http://tiddlyhome2.bidix.info/">TiddlyHome1</a> API.<br><br><br><h1> URI Resources</h1><br><h2> User</h2><ul><li> <code>{username</code>}<br>Display the resource <code>{username</code>} </li></ul><br><h2> Namespace</h2><ul><li> <code>{username}/namespaces</code><br>Namespace container owns by {username}. </li><li> <code>{username}/namespaces{namespace_id</code>} <br>{namespace_id} owns by {username}.</li></ul><br><h2> Tiddler</h2><ul><li> <code>{username}/namespaces{namespace_id}/tiddlers</code> <br>Tiddler container in {namespace_id} owns by {username}.</li><li> <code>{username}/namespaces{namespace_id}/tiddlers{tiddler_id</code>} <br>{tiddler_id} in {namespace_id} owns by {username}.</li></ul><br><h2> Tiddlywiki</h2><ul><li> <code>{username}/tiddlywikis</code><br>Tiddlywiki container own by {username}. </li><li> <code>{username}/tiddlywikis{tiddlywiki_id</code>} <br>{tiddlywiki_id} owns by {username}.</li></ul><br><h1> Requests to TiddlyHome Service</h1>Actually <code>PUT</code> is not implemented.<br><br>For now requested content-type (HTTP Request header) are not interpreted. All responses, except when specified, are in <code>Content-type: text/html</code>.<br><br>Return code conform to <a class="externalLink" href="http://bidix.appspot.com/BidiX/namespaces/TiddlyHome/tiddlers/A%20Model%20for%20a%20RESTful%20API" title="External link to http://bidix.appspot.com/BidiX/namespaces/TiddlyHome/tiddlers/A%20Model%20for%20a%20RESTful%20API">model</a>.<br><br><h2> User</h2><ul><li> <code>GET {username</code>} <br>Return username and mail address.<em>Need more developments.</em></li><li> <code>GET www.google.com/accounts/ServiceLogin?...</code> <br>For now available only from a browser. Redirect to the current page once the login (or logout) is done.</li></ul><br><h2> Namespace</h2><ul><li> <code>GET {username}/namespaces</code> <br>List of Namespace own by {username}.</li><li> <code>POST {username}/namespaces</code> <br>Create or update namespace with these attributes :<ul><li>name</li><li>access: 'on' | ''</li><li>owner_name:</li><li>previous_name: if different from name, previous name is deleted.</li><li>return_url: response redirect to this url</li></ul></li><li> <code>GET {username}/namespaces?new</code> <br>Return a form that submit a <code>POST {username}/namespaces</code>. This form is empty.</li><li> <code>GET {username}/namespaces{namespace_id</code>} <br>return an HTML page for {namespace_id} details.</li><li> <code>GET {username}/namespaces{namespace_id}?edit</code> <br>Return a form that submit a <code>POST {username}/namespaces</code>. This form is filled with {namespace_id} details.</li><li> <code>DELETE {username}/namespaces{namespace_id</code>} <br><code>GET {username}/namespaces{namespace_id}?delete</code> <br>Delete {namespace_id}.</li></ul><br><h2> Tiddlywiki</h2><ul><li> <code>GET {username}/tiddlywikis</code> <br>List of Tiddlywiki own by {username}.</li><li> <code>POST {username}/tiddlywikis</code> <br>Create or update tiddlywiki with these attributes :<ul><li>name</li><li>namespace_name</li><li>access: 'on' | ''</li><li>title</li><li>subtitle</li><li>{tiddler_title}: 'on' | '' (for each tiddler in {namespace_name})</li><li>previous_name: if different from name, previous name is deleted.</li><li>return_url: response redirect to this url</li></ul></li><li> <code>PUT {username}/tiddlywikis{tiddlywiki_id}?put</code> <br><code>POST {username}/tiddlywikis{tiddlywiki_id}?put</code> <br><em>Not documented</em></li><li> <code>GET {username}/tiddlywikis?new</code> <br>Return a form that submit a <code>POST {username}/tiddlywikis</code>. This form is empty.</li><li> <code>GET {username}/tiddlywikis{tiddlywiki_id</code>} <br>return an HTML page for {tiddlywiki_id} details.</li><li> <code>GET {username}/tiddlywikis{tiddlywiki_id}.html</code> <br>return a <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a> page for {tiddlywiki_id}.</li><li> <code>GET {username}/tiddlywikis{tiddlywiki_id}.xml</code> <br>return a xml page in RSS format for {tiddlywiki_id}.</li><li> <code>GET {username}/tiddlywikis{tiddlywiki_id}?edit</code> <br>Return a form that submit a <code>POST {username}/tiddlywikis</code>. This form is filled with {tiddlywiki_id} details.</li><li> <code>GET {username}/tiddlywikis{tiddlywiki_id}?upload</code> <br>Return a form that upload a <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a> a <code>POST {username}/tiddlywikis{tiddlywiki_id}?put</code>.</li><li> <code>DELETE {username}/tiddlywikis{tiddlywiki_id</code>} <br><code>GET {username}/tiddlywikis{tiddlywiki_id}?delete</code> <br>Delete {tiddlywiki_id}.</li></ul><br><h2> Tiddler</h2><ul><li> <code>GET {username}/namespaces{namespace_id}/tiddlers</code> <br>List of Tiddler in {namespace_id}.</li><li> <code>POST {username}/namespaces{namespace_id}/tiddlers</code> <br>Create or update a tiddler with these attributes :<ul><li>title</li><li>tags</li><li>text</li><li>html: wikified text</li><li>previous_title: if different from title, previous title is deleted.</li><li>return_url: response redirect to this url</li></ul></li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers?new</code> <br>Return a form that submit a <code>POST {username}/namespaces{namespace_id}/tiddlers</code>. This form is empty.</li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.html</code> <br>return an HTML page {tiddler_id} only with html content for publishing (Tiddlyhomes use this for <a class="externalLink null" href="http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#HomePage" title="External link to http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#HomePage" refresh="link" tiddlylink="HomePage">HomePage</a> and <a class="externalLink null" href="http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#HelpPage" title="External link to http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#HelpPage" refresh="link" tiddlylink="HelpPage">HelpPage</a>).</li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.txt</code> <br>return a text/plain page for {tiddler_id} text.</li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.js</code> <br>return a text/plain page for {tiddler_id} text.</li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.tw</code> <br>return a text/plain page for {tiddler_id} in <a class="externalLink" href="http://www.tiddlywiki.com/" title="External link to http://www.tiddlywiki.com/">TiddlyWiki</a> <a class="externalLink null" href="http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#StoreArea" title="External link to http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#StoreArea" refresh="link" tiddlylink="StoreArea">StoreArea</a> format.</li><li> <code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}?edit</code> <br>Return a form that submit a <code>POST {username}/namespaces{namespace_id}/tiddlers</code>. This form is filled with {tiddler_id} details.</li><li> <code>DELETE {username}/namespaces{namespace_id}/tiddlers{tiddler_id</code>} <br><code>GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}?delete</code> <br>Delete {tiddler_id}.</li></ul><br> Documentation Design RESTful API http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/TiddlyHome%20Restful%20API.html 2008-09-27 08:13 A Model for a RESTful API This article suggests a model for a RESTful API usable in a browser without using AJAX and that manage a suffix to request a particular content-type.<br><br>This model is implemented has a generic extension to Google Engine webapp. See it in action in TiddlyWiki context at <a class="externalLink" href="http://TiddlyHome.appspot.com" title="External link to http://TiddlyHome.appspot.com">TiddlyHome</a><br><br><h1> Resource</h1>The typical <a class="externalLink" href="http://en.wikipedia.org/wiki/URI" title="External link to http://en.wikipedia.org/wiki/URI">URI</a> of a resource is : <br><pre>{type}s{id}[.{format}] </pre>like in <code>/tiddlywikis/HowTo.html</code>. <br><br><br>To obtain the list of all resources of a type simply : <br><pre>{type}s </pre><br><h1> Membership relation </h1>When the resource is linked to an other resource, especially to explain membership, the URI becomes :<br><pre>{parent_type}s{parent_id}{children_type}s{children_id} </pre> (ex: <code>/tiddlywikis/HowTo/tiddlers/Upload</code> ).<br><br><h1> Basic functions on resource</h1>In <a class="externalLink null" href="http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#RESTful" title="External link to http://tiddlyhome2.bidix.info//BidiX/tiddlywikis/TiddlyHome.html#RESTful" refresh="link" tiddlylink="RESTful">RESTful</a> API, the <a class="externalLink" href="http:/http://en.wikipedia.org/wiki/CRUD_(acronym)" title="External link to http:/http://en.wikipedia.org/wiki/CRUD_(acronym)">CRUD</a> basic functions on a persistent resource can be accessed using HTTP methods :<br><table class="twtable"><tbody><tr class="evenRow"><th>HTTP Method</th><th>Function</th></tr><tr class="oddRow"><td><code>GET {uri_id</code>}</td><td align="left">Read {resource_id}</td></tr><tr class="evenRow"><td><code>PUT {uri_id</code>}</td><td align="left">Create or Update {resource_id}</td></tr><tr class="oddRow"><td><code>DELETE {uri_id</code>}</td><td>Delete {resource_id}</td></tr><tr class="evenRow"><td><code>POST {a_form</code>}</td><td align="left">Ask service to Create, Update or Delete some resource using {a_form}</td></tr></tbody></table><br><h1> API to manage a resource</h1><table class="twtable"><tbody><tr class="evenRow"><th>API call</th><th>Application function called</th></tr><tr class="oddRow"><td><code>GET {type}s</code></td><td>Type.list()</td></tr><tr class="evenRow"><td rowspan="2"><code>GET {type}{id}[.{format}]</code></td><td>id.display[_in_{format}]()</td></tr><tr class="oddRow"><td>404</td></tr><tr class="evenRow"><td><code>PUT {type}s{id</code>}</td><td>id.put()</td></tr><tr class="oddRow"><td><code>DELETE {type}s{id</code>}</td><td>id.delete()</td></tr><tr class="evenRow"><td><code>POST {type}s</code></td><td>Type.create_or_update()</td></tr></tbody></table><br><h1> RESTful extensions for browser</h1>Since methods PUT and DELETE can't easily be activated in a browser (except using AJAX). The query_string part of the URL is used to simulate PUT or DELETE. <br>On server, the Handler first changes the query_string in the corresponding method :<br><table class="twtable"><tbody><tr class="evenRow"><th align="left"> URL with query_string</th><th align="left"> API Call</th></tr><tr class="oddRow"><td align="left"><code>GET {type}s{id}?delete</code></td><td align="left"><code>DELETE {type}s{id</code>}</td></tr><tr class="evenRow"><td align="left"><code>GET {type}s{id}?put</code></td><td align="left"><code>PUT {type}s{id</code>}</td></tr><tr class="oddRow"><td align="left"><code>GET {type}s?new</code></td><td align="left"><code>GET {type}s</code> - with an attribut in_form = True</td></tr><tr class="evenRow"><td align="left"><code>GET {type}s{id}?edit</code></td><td align="left"><code>GET {type}s{id</code>} - with an attribut in_form = True</td></tr></tbody></table><br><h1> Specifying Content-type</h1>To easily specify the content-type required, a suffix is added to the resource like : <code>.html</code>, <code>.xml</code>, <code>.txt</code> <code>.js</code> ...<br><br><h1> Return codes</h1>Finally HTTP Status are used in response to HTTP request. Their normalised meaning are used, sometimes with some restrictive sense in the API context.<br><table class="twtable"><tbody><tr class="evenRow"><th>HTTP Code</th><th align="left">HTTP status message</th><th>API Meaning</th></tr><tr class="oddRow"><td align="center">200</td><td align="left">OK</td><td align="left">Ok</td></tr><tr class="evenRow"><td align="center">201</td><td align="left">Created</td><td align="left">New entity created</td></tr><tr class="oddRow"><td align="center">400</td><td>Bad Request</td><td align="left">The URL can't be processed (Type doesn't exist, bad format requested ...)</td></tr><tr class="evenRow"><td align="center">401</td><td>Unauthorized</td><td>The logged user is not authorized to execute this action</td></tr><tr class="oddRow"><td align="center">403</td><td>Forbidden</td><td>Action is not allowed</td></tr><tr class="evenRow"><td align="center">404</td><td>Not Found</td><td>Resource doesn't exist</td></tr><tr class="oddRow"><td align="center">405</td><td>Method not allowed</td><td>This resource doesn't allow this method (operation)</td></tr><tr class="evenRow"><td align="center">406</td><td>Not acceptable</td><td></td></tr></tbody></table><br><br> Documentation Design RESTful API http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/A%20Model%20for%20a%20RESTful%20API.html 2008-09-26 19:55 Experimental iTW available at TiddlyHome 2.0 Just as a proof of concept, an iTW is available at <a class="externalLink" href="http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW" title="External link to http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW">http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW</a> . The full TiddlyWiki is available (in Safari) at <a class="externalLink" href="http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW.html" title="External link to http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW.html">http://tiddlyhome.appspot.com/BidiX/tiddlywikis/iTW.html</a>.<br> Site toRSS http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/Experimental%20iTW%20available%20at%20TiddlyHome%202.0.html 2008-07-07 05:58 Data Model <ul><li> <strong>User</strong> is an extension of Google User with a <em>username</em></li><li> <strong>User</strong> owns <strong>Namespaces</strong></li><li> <strong>User</strong> owns <strong>Tiddlywikis</strong></li><li> <strong>Namespace</strong> owns <strong>Tiddlers</strong></li><li> <strong>TiddlyWiki</strong>, in a <strong>Namespace</strong>, references <strong>Tiddlers</strong></li></ul>Some rules :<br><ul><li> only the owner of an entity (<strong>TiddlyWiki</strong>, <strong>Namespace</strong>, <strong>Tiddler</strong>) can edit it</li><li> a <strong>Namespace</strong> (or a <strong>TiddlyWiki</strong>) can be <em>private</em>.</li><li> only the owner of a private <strong>Namespace</strong> (or a <strong>Tiddlywiki</strong>) can see it</li></ul><br><br><br> Documentation Design http://tiddlyhome2.bidix.info/BidiX/namespaces/TiddlyHome/tiddlers/Data%20Model.html 2008-06-24 09:22