<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-194979309481348616</id><updated>2024-09-05T05:28:36.735-07:00</updated><category term="google app engine"/><category term="GWT"/><category term="JSON"/><category term="Lessons"/><category term="OAuth"/><category term="datastore"/><category term="google apps marketplace"/><title type='text'>Learning to Cloud</title><subtitle type='html'>Tips and Tricks of Google App Engine based on my learnings</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-5682704456298553735</id><published>2011-12-24T14:53:00.000-08:00</published><updated>2011-12-24T14:53:57.009-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><title type='text'>Google&#39;s GSON library to parse JSON</title><content type='html'>Google&#39;s &lt;a href=&quot;http://code.google.com/apis/accounts/docs/OAuth2WebServer.html&quot; target=&quot;_blank&quot;&gt;OAuth 2.0 library&lt;/a&gt; returns access token related information in JSON format as shown in the sample below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-size: 9pt; line-height: 15px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;&quot;&gt;{
  &quot;access_token&quot;:&quot;1/fFAGRNJru1FTz70BzhT3Zg&quot;,
  &quot;expires_in&quot;:3920,
  &quot;token_type&quot;:&quot;Bearer&quot;
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
I was looking for a library to parse JSON and stumbled across &lt;a href=&quot;http://code.google.com/p/google-gson/&quot; target=&quot;_blank&quot;&gt;GSON&lt;/a&gt;, which was very straightforward to use. The library has methods to create a java object from JSON or JSON from a java object. The sample program below shows how to do the former.&lt;br /&gt;
&lt;br /&gt;
Download GSON library from &lt;a href=&quot;http://code.google.com/p/google-gson/downloads/list&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Create a class that can be used to create java objects to hold converted JSON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-size: 9pt; line-height: 15px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;&quot;&gt;&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt; GoogleAccessToken {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;String &lt;/span&gt;access_token&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;String &lt;/span&gt;refresh_token&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;String &lt;/span&gt;token_type&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;expires_in&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; String toString() {&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;           return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&quot;access_token: &quot;&lt;span class=&quot;s2&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;access_token&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; + &lt;/span&gt;&quot;refresh_token: &quot;&lt;span class=&quot;s2&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;refresh_token&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; +&lt;/span&gt;&quot; - &quot;&lt;span class=&quot;s2&quot;&gt; + &lt;/span&gt;&quot;token_type:&quot;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt;+ &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;token_type&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-size: 9pt;&quot;&gt;&quot; - &quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-size: 9pt;&quot;&gt;&quot;expires_in:&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; + &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;expires_in&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; String getAccessToken() {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;access_token&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; String getRefreshToken() {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;refresh_token&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; String getTokenType() {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;token_type&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;int&lt;/span&gt; getExpiresIn() {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;expires_in&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Assume myJsonString variable has the JSON that needs to be parsed.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;&quot;&gt;&lt;div class=&quot;p1&quot; style=&quot;color: #007000; font-size: 9pt; line-height: 15px;&quot;&gt;
Gson gson = &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; GsonBuilder().create();&lt;/div&gt;
&lt;span style=&quot;color: #007000;&quot;&gt;&lt;span style=&quot;font-size: 9pt; line-height: 15px;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;p1&quot; style=&quot;color: #007000; font-size: 9pt; line-height: 15px;&quot;&gt;
GoogleAccessToken jsonObject = gson.fromJson(myJsonString,&lt;span style=&quot;font-size: 9pt;&quot;&gt;GoogleAccessToken.&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that the JSON is converted to java object form, you can access it&#39;s variables using the accessor functions.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;&quot;&gt;&lt;div class=&quot;p1&quot; style=&quot;color: #007000; font-size: 9pt; line-height: 15px;&quot;&gt;
jsonObject.toString()&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;color: #007000; font-size: 9pt; line-height: 15px;&quot;&gt;
//the above line prints the following:&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;color: #007000; font-size: 9pt; line-height: 15px;&quot;&gt;
//access_token:&amp;nbsp;&lt;span style=&quot;font-size: 9pt;&quot;&gt;1/fFAGRNJru1FTz70BzhT3Zg&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;refresh_token: &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;token_type: &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;Bearer&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-size: 9pt;&quot;&gt;- &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-size: 9pt;&quot;&gt;expires_in:&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;3920&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/5682704456298553735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/12/googles-gson-library-to-parse-json.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/5682704456298553735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/5682704456298553735'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/12/googles-gson-library-to-parse-json.html' title='Google&#39;s GSON library to parse JSON'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-5721205224003591906</id><published>2011-10-17T22:21:00.000-07:00</published><updated>2011-11-13T09:43:55.352-08:00</updated><title type='text'>How to use google app engine&#39;s (experimental) federated identity option for providing OpenID support</title><content type='html'>Google App Engine provides two simple ways for providing authentication services for your app.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Google Accounts API&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Using Google Accounts API, you can allow users to login to your app using their google account (gmail id).&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Federated Login&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Using Federated Login, you can allow users to login using any OpenID identity provider (Yahoo, Google Apps account etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div&gt;
The focus of this post is to explain the latter using Google Apps Domain as the identity provider. If you are interested in learning about the former, you can refer to this &lt;a href=&quot;http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html&quot;&gt;link&lt;/a&gt;. Google App Engine team did a good job of documenting this approach whereas documentation for federated login approach is not comprehensive.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here are the requirements we are going to fulfill in this example:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Provide users ability to login using their Google Apps email ID&lt;/li&gt;
&lt;li&gt;Provide users ability to invoke your app from their google apps universal navigation bar [SSO implementation - users should not be prompted to enter their password again because they are already logged into their google apps].&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;How-to&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Set authentication option in Google App Engine Settings to Federated Login&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgu1f8VT4M1-S80QkBqDQ0yGODLjQwvS-ak5nKMZ8wG6wd1ZnLcVutBEF9dPLL_QTy04ulHeGjgjdcWDY7MOUuxXON_yQf5UINq046Uw1ose1gsqyx91qq3kRr_ZJ2L_QjihUJ5bVKed4/s1600/App+Engine+Application+Settings.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgu1f8VT4M1-S80QkBqDQ0yGODLjQwvS-ak5nKMZ8wG6wd1ZnLcVutBEF9dPLL_QTy04ulHeGjgjdcWDY7MOUuxXON_yQf5UINq046Uw1ose1gsqyx91qq3kRr_ZJ2L_QjihUJ5bVKed4/s400/App+Engine+Application+Settings.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Set up security constraints in web.xml so that when users go to any of your app urls directly, App Engine will prompt them for authentication. When App Engine encounters a url that needs to be accessed only by logged in users and the user is not logged in, it directs the user to URL /_ah/login_required. You will have to create a servlet that handle requests to this URL. &amp;nbsp;We will address this an a later step but it&#39;s important to keep in mind that /_ah/login_required URL itself should be accessible without user being logged in. Otherwise, it would result in a recursion error.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;security-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;web-resource-collection&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;web-resource-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;accessible without login&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;web-resource-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;/_ah/login_required&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;web-resource-collection&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/span&gt;security-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;security-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;web-resource-collection&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;web-resource-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;accessible&amp;nbsp;with login&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;web-resource-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;url-pattern&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/*&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;url-pattern&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;web-resource-collection&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;auth-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;role-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;role-name&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/span&gt;auth-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;security-constraint&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Create servlet mapping for the servlet you&#39;ll be creating to handle requests to /_ah/login_required URL&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;servlet&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;LoginRequiredServlet&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-class&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;com.yourcompany.server.LoginRequiredServlet&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-class&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;servlet&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;servlet-mapping&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;LoginRequiredServlet&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;/_ah/login_required&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;servlet-mapping&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Create a simple login page to which LoginRequiredServlet can direct users to for entry of login id/domain&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;In LoginRequiredServlet, use App Engine&#39;s UserService class to create login url and redirect user to that url if the user is not already logged in&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UserService userService = UserServiceFactory.getUserService();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User user = userService.getCurrentUser();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (user != null) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Forward the user to you app start page&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //forwardingUrl is the link to which you want user &amp;nbsp;to be&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // sent to after successful authentication&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;String loginUrl = userService.createLoginURL(forwardingUrl,&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;null&lt;/span&gt;, domain, &lt;span class=&quot;s1&quot;&gt;null&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;resp.sendRedirect(loginUrl);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;
You will find more information the following article useful:&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 30px;&quot;&gt;&lt;a href=&quot;http://code.google.com/appengine/articles/openid.html&quot; target=&quot;_blank&quot;&gt;Using Federated Authentication via OpenID in Google App Engine&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/5721205224003591906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/how-to-use-google-app-engines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/5721205224003591906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/5721205224003591906'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/how-to-use-google-app-engines.html' title='How to use google app engine&#39;s (experimental) federated identity option for providing OpenID support'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgu1f8VT4M1-S80QkBqDQ0yGODLjQwvS-ak5nKMZ8wG6wd1ZnLcVutBEF9dPLL_QTy04ulHeGjgjdcWDY7MOUuxXON_yQf5UINq046Uw1ose1gsqyx91qq3kRr_ZJ2L_QjihUJ5bVKed4/s72-c/App+Engine+Application+Settings.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-8378958746132111264</id><published>2011-10-13T17:34:00.000-07:00</published><updated>2011-10-15T14:28:11.802-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lessons"/><title type='text'>Lessons</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
I am a self taught web programmer. So, everything I do takes a longer that I would like because I have to do a lot research to understand a topic before I code for it. For instance, I wanted to implement openID. So, I had to first learn what OpenID was all about and then try to implement it. Along the way, I have learned a few lessons&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;If, at first, you can&#39;t find what you are&amp;nbsp;looking&amp;nbsp;for, try harder - Every day my admiration for search engines increases. It&#39;s amazing how you can solve majority of the issues by googling around. Sometime the initial keywords do not work but if you apply some creativity to come up with the right keywords, you can always find the information that can help in solving the problems you are facing.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Main constraint for doing anything is mental tenacity. Serious works requires tremendous amount of concentration and achieving that is very exhausting but if you persist the results will appear.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Don&#39;t give up - There were several&amp;nbsp;occasions when i felt like giving up on some issues but I continued to persist only to realize I was really close to success. Had I given up I wouldn&#39;t have attained success. This theory is exemplified by this video.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/FpJQqzJj534?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/8378958746132111264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/lessons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/8378958746132111264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/8378958746132111264'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/lessons.html' title='Lessons'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-1695691127885327293</id><published>2011-10-11T08:46:00.000-07:00</published><updated>2011-10-15T14:27:19.925-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google app engine"/><category scheme="http://www.blogger.com/atom/ns#" term="google apps marketplace"/><title type='text'>Google Apps Integration and App Engine&#39;s namespaces</title><content type='html'>I have integrated our GAE app with Google Apps Marketplace. I set the namespace strategy to GOOGLE_APPS_DOMAIN so that each Google Apps domain will have it&#39;s own isolated dataset.&lt;br /&gt;
&lt;br /&gt;
When I enter the app from the app&#39;s login page by entering Google App&#39;s email id and password, everything works fine. Namespace is being set to the domain name. However, when I enter the app from Google Apps universal navigation link, Namespace is being set to blank instead of the domain name. After a quick troubleshooting session, I found that &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;NamespaceManager.&lt;/span&gt;&lt;wbr style=&quot;background-color: white; color: red; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/wbr&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;getGoogleAppsNamespace(). &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;not returning the domain name when the app is accessed from the universal navigation bar.&lt;br /&gt;
&lt;br /&gt;
After some delving into App Engine&#39;s API source code, I came up with a workaround that I can use until I find the root cause of why the original approach didn&#39;t work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;GOOGLE_APPS_DOMAIN&lt;span class=&quot;s2&quot;&gt;: {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; * Original code. Commented out because getGoogleAppsNamespace&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; * not returning the &lt;span class=&quot;s4&quot;&gt;apps&lt;/span&gt; domain name. Unable to find out the&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; * reason&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; */&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// NamespaceManager.set(NamespaceManager.getGoogleAppsNamespace());&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt; (NamespaceManager.getGoogleAppsNamespace().equals(&lt;span class=&quot;s5&quot;&gt;&quot;&quot;&lt;/span&gt;)) {&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Object userOrganizationObject;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;String userOrganization;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;userOrganizationObject = com.google.apphosting.api.ApiProxy&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;.getCurrentEnvironment()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;.getAttributes()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;.get(&lt;/span&gt;&quot;com.google.appengine.api.users.UserService.user_organization&quot;&lt;span class=&quot;s2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt; (userOrganizationObject == &lt;span class=&quot;s1&quot;&gt;null&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;userOrganization = &lt;span class=&quot;s5&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;} &lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;userOrganization = userOrganizationObject.toString();&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;NamespaceManager.set(userOrganization);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;} &lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;NamespaceManager.set(NamespaceManager&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;.getGoogleAppsNamespace());&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/1695691127885327293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/google-apps-integration-and-app-engines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/1695691127885327293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/1695691127885327293'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/10/google-apps-integration-and-app-engines.html' title='Google Apps Integration and App Engine&#39;s namespaces'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-4711347495380142205</id><published>2011-04-28T22:01:00.000-07:00</published><updated>2011-04-28T22:01:21.017-07:00</updated><title type='text'>Using Google Refine and Google Maps API to calculate distance between two addresses</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Distance Calculation Using Refine and Google Maps API:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #1f497d; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Create two columns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1.0in; mso-list: l1 level2 lfo1; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Origin – origin address (address can be anything – complete address, just city, start, zip, country or any combination of tose]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1.0in; mso-list: l1 level2 lfo1; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;o&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Destination – destination address&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #1f497d; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Create a new column “distance api response” based on Origin column using the url option&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; text-indent: .5in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; text-indent: .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt;&quot;&gt;Copy this in expression field show below [if you use the column names Origin and Destination, you don’t have to change anything in this formula]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; text-indent: .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&quot;&lt;a href=&quot;http://maps.googleapis.com/maps/api/directions/json?origin=&quot;&gt;&lt;span style=&quot;color: black; font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: black;&quot;&gt;&lt;span style=&quot;color: black; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: black;&quot;&gt;http://maps.googleapis.com/maps/api/directions/json?origin=&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&quot;+escape(value, &quot;url&quot;)+&quot;&amp;amp;destination=&quot;+escape(cells[&quot;Destination&quot;].value, &quot;url&quot;)+&quot;&amp;amp;sensor=false&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1.0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMpFGMJecvbiXkZ0-LdEFEmGPqepDrAteeR7HFoD3fdo-6-i_qjKBk-ulnk3gZQIpNV1q_tQlmwmpr7hrFDbFKIzY6R5b1a4rElkrg8JCwaDiflUnqPkJAQbl0v7cBp_K-NpX4BPLGvY/s1600/refine.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMpFGMJecvbiXkZ0-LdEFEmGPqepDrAteeR7HFoD3fdo-6-i_qjKBk-ulnk3gZQIpNV1q_tQlmwmpr7hrFDbFKIzY6R5b1a4rElkrg8JCwaDiflUnqPkJAQbl0v7cBp_K-NpX4BPLGvY/s320/refine.png&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1.0in;&quot;&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo2; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #1f497d; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-themecolor: dark2;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: dark2;&quot;&gt;Create a new column called “distance” – create it based on “distance api response” column and use the following formula in the expression&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri;&quot;&gt;with(value.parseJson().routes[0].legs[0].distance,pair,pair.text)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/4711347495380142205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/using-google-refine-and-google-maps-api.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/4711347495380142205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/4711347495380142205'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/using-google-refine-and-google-maps-api.html' title='Using Google Refine and Google Maps API to calculate distance between two addresses'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMpFGMJecvbiXkZ0-LdEFEmGPqepDrAteeR7HFoD3fdo-6-i_qjKBk-ulnk3gZQIpNV1q_tQlmwmpr7hrFDbFKIzY6R5b1a4rElkrg8JCwaDiflUnqPkJAQbl0v7cBp_K-NpX4BPLGvY/s72-c/refine.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-2185906964547068088</id><published>2011-04-18T21:52:00.000-07:00</published><updated>2011-11-13T09:35:53.960-08:00</updated><title type='text'>How to get GWT DateBox to show only the date part</title><content type='html'>While searching for tips on this, I found this useful &lt;a href=&quot;http://gwt-tips.blogspot.com/2009/06/if-youre-like-me-and-you-really-love-to.html&quot;&gt;blog post&lt;/a&gt;.&lt;br /&gt;
The only change i made is I replaced the deprecated function&lt;br /&gt;
getShortDateFormat with getFormat method from DateTimeFormat class.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;With deprecated method:&lt;/u&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;So to format a DateBox to display a date like 06/26/2009&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;dateBox = new DateBox();&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;dateBox.setFormat(&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;new DateBox.DefaultFormat(&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;DateTimeFormat.getShortDateFormat()&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;With new method:&lt;/u&gt;&lt;br /&gt;
fromDate = new DateBox()&lt;br /&gt;
fromDate.setFormat(&lt;br /&gt;
new DateBox.DefaultFormat(&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT)&lt;/span&gt;));</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/2185906964547068088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/how-to-get-gwt-datebox-to-show-only.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/2185906964547068088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/2185906964547068088'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/how-to-get-gwt-datebox-to-show-only.html' title='How to get GWT DateBox to show only the date part'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-303770004937640555</id><published>2011-04-16T11:35:00.000-07:00</published><updated>2011-11-13T09:10:54.265-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GWT"/><title type='text'>Date Operations in GWT</title><content type='html'>Standard java class java.util.Calendar does not work in GWT. Instead, use GWT class&amp;nbsp;&lt;a href=&quot;http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/datepicker/client/CalendarUtil.html&quot;&gt;com.google.gwt.user.datepicker.client.CalendarUtil&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, for formatting and parsing date/time, use&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/i18n/client/DateTimeFormat.html&quot;&gt;com.google.gwt.i18n.client.DateTimeFormat&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;Convert Date to String - Format&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;








&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
DateTimeFormat.PredefinedFormat.&lt;span class=&quot;s1&quot;&gt;DATE_SHORT&lt;/span&gt;).format(newDate())&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;Convert String to Date - Parse&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;








&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.&lt;span class=&quot;s1&quot;&gt;DATE_SHORT&lt;/span&gt;).parse(dateString)&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/303770004937640555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/date-operations-in-gwt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/303770004937640555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/303770004937640555'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/04/date-operations-in-gwt.html' title='Date Operations in GWT'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-2372542138494172871</id><published>2011-03-26T16:50:00.000-07:00</published><updated>2011-03-26T16:50:07.075-07:00</updated><title type='text'>Data Nucleus Enhancer Errors</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;It appears like there is a limit on how many classes can be enhanced in google app engine projects on eclipse. If there are too many classes, you get the following error (&quot;CreateProcess error=87, The parameter is incorrect&quot;) at the build time and some classes do not get enhanced.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJOYLs6fI2B57A8zgTC6oeUgWFmHEiXgDy0KW1CyRj_aesOXHbe2fH9rs_JjRBoqaI7L_Q94ol09sq-vMG_ZKuIWwun_npITdMof9f4dq3e7tnaM2oIavZHGcQ7nEZurzMFX2QFkTmmJk/s1600/DataNucleusEnhanceError.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJOYLs6fI2B57A8zgTC6oeUgWFmHEiXgDy0KW1CyRj_aesOXHbe2fH9rs_JjRBoqaI7L_Q94ol09sq-vMG_ZKuIWwun_npITdMof9f4dq3e7tnaM2oIavZHGcQ7nEZurzMFX2QFkTmmJk/s400/DataNucleusEnhanceError.png&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;If you try to use the application, you get errors that look like the following:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;[ERROR] Excepton in class: javax.jdo.JDOUserException&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;[ERROR] Persistent class &quot;Class so&amp;amp;so&amp;nbsp;does not seem to have been enhanced. &amp;nbsp;You may want to rerun the enhancer and check for errors in the output.&quot; has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;How to fix?&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;In reality, all classes do not need to be enhanced. You can restrict it to a limited set of classes by changing ORM settings under App Engine settings in Eclipse&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaxqjgrPxiKXSO25olxOOveEmHscxxGdGwB2_gMu4775EQ2ARDF9FyjIwNYnw3ey3bKgj8jvkoTwX9wwyDhz49hvorwySrxlRVW8kgiMGPsAPCYpEhWLLeVrGHTQS0g0jF1wrYAhYzJNI/s1600/EnhancementsORMissues.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;178&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaxqjgrPxiKXSO25olxOOveEmHscxxGdGwB2_gMu4775EQ2ARDF9FyjIwNYnw3ey3bKgj8jvkoTwX9wwyDhz49hvorwySrxlRVW8kgiMGPsAPCYpEhWLLeVrGHTQS0g0jF1wrYAhYzJNI/s400/EnhancementsORMissues.png&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/2372542138494172871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/03/data-nucleus-enhancer-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/2372542138494172871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/2372542138494172871'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/03/data-nucleus-enhancer-errors.html' title='Data Nucleus Enhancer Errors'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJOYLs6fI2B57A8zgTC6oeUgWFmHEiXgDy0KW1CyRj_aesOXHbe2fH9rs_JjRBoqaI7L_Q94ol09sq-vMG_ZKuIWwun_npITdMof9f4dq3e7tnaM2oIavZHGcQ7nEZurzMFX2QFkTmmJk/s72-c/DataNucleusEnhanceError.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-7318437685864082362</id><published>2011-03-11T19:11:00.000-08:00</published><updated>2011-03-11T19:11:15.816-08:00</updated><title type='text'>SuggestBox with UIBinder</title><content type='html'>Using SuggestBox with in UIBinder is not straighforward. This &lt;a href=&quot;http://blog.jeffdouglas.com/2010/02/11/uibinder-with-suggestbox-multiwordsuggestoracle/&quot;&gt;article &lt;/a&gt;explains how to do it.</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/7318437685864082362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/03/suggestbox-with-uibinder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/7318437685864082362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/7318437685864082362'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/03/suggestbox-with-uibinder.html' title='SuggestBox with UIBinder'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-7430938356235368151</id><published>2011-02-14T10:55:00.000-08:00</published><updated>2011-02-14T10:56:50.374-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datastore"/><category scheme="http://www.blogger.com/atom/ns#" term="google app engine"/><title type='text'>Download and Upload bulk data to Google App Engine</title><content type='html'>The bulk loader tool can upload and download data to and from Google App Engine&#39;s datastore. This &lt;a href=&quot;http://apps.java-javafx.com/download?download=Bulk%20Loader%20the%20complete%20guide&quot;&gt;pdf document&lt;/a&gt; has step by step instructions.</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/7430938356235368151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/02/download-and-upload-bulk-data-to-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/7430938356235368151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/7430938356235368151'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/02/download-and-upload-bulk-data-to-google.html' title='Download and Upload bulk data to Google App Engine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-6051923479865725755</id><published>2011-01-22T08:19:00.000-08:00</published><updated>2011-01-22T08:19:14.525-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google app engine"/><title type='text'>How to programmatically log errors, warnings and info messages in google app engine</title><content type='html'>Google app engine documentation provides &lt;a href=&quot;http://code.google.com/appengine/articles/logging.html&quot;&gt;info&lt;/a&gt; on how to log server side errors, warnings or info messages in Python environment but there is no clear documentation on how to do the same in java environment. Here is an example of logging in java environment&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;import java.util.logging.Logger;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;private static final Logger log = Logger&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;.getLogger(MyClass.class.getName());&lt;/span&gt;&lt;br /&gt;
public class MyClass {&lt;br /&gt;
&lt;br /&gt;
public myMethod() {&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;log.info(&quot;Informational message&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;log.warning(&quot;warning&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;log.severe(&quot;severe error&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
When deployed to App Engine, you can find the logs app engine admin console&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXHPe655pR1U1eO3lCvb_7AkkNTUDlfHkyWPOujyRfDhyfB3HX3TMOgclF5gF2JnjJebBMlh0s0TC5E2V8ONMj8aYdOQwWai0rpNSihHR8ybYJIPsOUAzLwSA0WVfj4D0AVxRb100IgiM/s1600/ServerSideErrorLogs.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXHPe655pR1U1eO3lCvb_7AkkNTUDlfHkyWPOujyRfDhyfB3HX3TMOgclF5gF2JnjJebBMlh0s0TC5E2V8ONMj8aYdOQwWai0rpNSihHR8ybYJIPsOUAzLwSA0WVfj4D0AVxRb100IgiM/s1600/ServerSideErrorLogs.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Dev mode (if using Eclipse), you can see the logs on Eclipse console&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvqNGQOcx9m28PuI9S373wXsgsXb0MkLwaej5vVVrD8OikcoQgAcnZzSR1CVag_zbhGggX-oqXEgj7mzf-s62p08qZHq2lnDXtYZSHePHb1j-38FrbY6G6y-6iG7rzf998jLWuy2WKrok/s1600/DevMode.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;27&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvqNGQOcx9m28PuI9S373wXsgsXb0MkLwaej5vVVrD8OikcoQgAcnZzSR1CVag_zbhGggX-oqXEgj7mzf-s62p08qZHq2lnDXtYZSHePHb1j-38FrbY6G6y-6iG7rzf998jLWuy2WKrok/s320/DevMode.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/6051923479865725755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2011/01/how-to-programmatically-log-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/6051923479865725755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/6051923479865725755'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2011/01/how-to-programmatically-log-errors.html' title='How to programmatically log errors, warnings and info messages in google app engine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXHPe655pR1U1eO3lCvb_7AkkNTUDlfHkyWPOujyRfDhyfB3HX3TMOgclF5gF2JnjJebBMlh0s0TC5E2V8ONMj8aYdOQwWai0rpNSihHR8ybYJIPsOUAzLwSA0WVfj4D0AVxRb100IgiM/s72-c/ServerSideErrorLogs.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-194979309481348616.post-8148980064656928177</id><published>2010-12-29T09:43:00.000-08:00</published><updated>2011-01-22T08:20:14.696-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google app engine"/><category scheme="http://www.blogger.com/atom/ns#" term="GWT"/><title type='text'>Avoiding recompile after every change in Google App Engine/GWT development environment</title><content type='html'>Google app engine development environment plugin in eclipse provides a great way of making changes to the code and viewing the changes just by refreshing the browser instead of recompiling the whole project. This saves a lot of time as recompilation takes time and when you multiply that with the number of changes you make on any given day, you can see that most of your productive days goes down the drain.&lt;br /&gt;
&lt;br /&gt;
I noticed that this feature stropped working after some of the changes I&#39;ve made. After some research I found out that this is because of google user authentication code I&#39;ve added. After authenticating the user, I was forwarding the user to the URL that did not have gwt.codesvr URL parameter. Presence of this parameter is required to get the above behavior.&lt;br /&gt;
&lt;br /&gt;
This &lt;a href=&quot;https://groups.google.com/forum/?lnk=raot&amp;amp;pli=1#!searchin/google-web-toolkit/development$20server$20recompile/google-web-toolkit/4LdoMGlJe88/O2GgXEJyDyYJ&quot;&gt;post &lt;/a&gt;on Google Groups helped me identify the problem and fix it. I made the following code changes to make it work [slightly different from what&#39;s suggested on that post].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;UserService userService = UserServiceFactory.getUserService();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;User user = userService.getCurrentUser();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;if (user != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;String gwtCodeSvrParam = request.getParameter(&quot;gwt.codesvr&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;String forwardingUrl = myUrl;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!&quot;&quot;.equals(gwtCodeSvrParam)) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;forwardingUrl = forwardingUrl + &quot;?gwt.codesvr=&quot; + gwtCodeSvrParam;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;a href=&amp;lt;%&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;=forwardingUrl&lt;/span&gt; %&amp;gt;&amp;gt; Access the system &amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;The above code will ensure that myUrl will be used in production environment and myURL with gwt.codesvr will be used in development environment&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://learningtocloud.blogspot.com/feeds/8148980064656928177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningtocloud.blogspot.com/2010/12/avoiding-recompile-after-every-change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/8148980064656928177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/194979309481348616/posts/default/8148980064656928177'/><link rel='alternate' type='text/html' href='http://learningtocloud.blogspot.com/2010/12/avoiding-recompile-after-every-change.html' title='Avoiding recompile after every change in Google App Engine/GWT development environment'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>