<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dogan kaya berktas &#187; Google App Engine</title>
	<atom:link href="http://doganberktas.com/tag/google-app-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://doganberktas.com</link>
	<description>is actually from a small planet somewhere in the vicinity of Betelgeuse</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:50:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using Twitter oauth on GAE/J</title>
		<link>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/</link>
		<comments>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:22:03 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[appengine-web.xml]]></category>
		<category><![CDATA[gae/j]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java platform]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter Inc]]></category>
		<category><![CDATA[twitter oauth]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=212</guid>
		<description><![CDATA[Twitter supports oauth and there are many libraries for it, for  Java(twitter4J)(oauth-signpost),  most of the time you see examples of a desktop version, so it can take time to implement it on a web application (it did take time for my case). Step 1. Get a Twitter account and create a Twitter application from http://twitter.com/apps [...]]]></description>
			<content:encoded><![CDATA[<p>Twitter supports <a href="http://apiwiki.twitter.com/OAuth-FAQ">oauth </a>and there are many libraries for it, for  Java(<a href="http://twitter4j.org/en/index.html#introduction">twitter4J</a>)(<a href="http://code.google.com/p/oauth-signpost/">oauth-signpost</a>),  most of the time you see examples of a desktop version, so it can take time to implement it on a web application (it did take time for my case).</p>
<p>Step 1. Get a Twitter account and create a Twitter application from http://twitter.com/apps (don&#8217;t forget to check in browser and enter a  valid callback url. <a href="http://doganberktas.com/wp-content/uploads/2010/01/2.jpg"><img class="size-full wp-image-218 alignnone" title="2" src="http://doganberktas.com/wp-content/uploads/2010/01/2.jpg" alt="" width="523" height="536" /></a></p>
<p>Step 2.  Download <a href="http://twitter4j.org/en/index.html#download">twitter4J</a> add the library (in my case twitter4j-core-2.1.1-SNAPSHOT.jar) to project and update classpath</p>
<p>Step 3. Create a <a href="http://code.google.com/eclipse/docs/getting_started.html#creating">web application</a> (I assume you have the <a href="http://code.google.com/eclipse/">Google plugin for Eclipse </a>)</p>
<p><a href="http://doganberktas.com/wp-content/uploads/2010/01/1.jpg"><img class="size-full wp-image-219 alignnone" title="1" src="http://doganberktas.com/wp-content/uploads/2010/01/1.jpg" alt="" width="455" height="559" /></a></p>
<p>Step 4. Add the following servlets and update your web.xml. First servlet will handle login part. It will create a RequestToken which will create the magical aggrements between the consumer(your application) and provider(twitter). First servlet save the  token and secret token since we will need them later.</p>
<pre>String token = requestToken.getToken();
String tokenSecret = requestToken.getTokenSecret();
</pre>
<ul>
<li><a href="http://code.google.com/p/dogansartifacts/source/browse/trunk/GoogleAppEngineJava/TwiitterClient/src/a/b/c/server/HomeServlet.java">Home servlet</a></li>
<li><a href="http://code.google.com/p/dogansartifacts/source/browse/trunk/GoogleAppEngineJava/TwiitterClient/src/a/b/c/server/LoginServlet.java">Login Servlet</a></li>
</ul>
<p>Step 5. You forget to update web.xml didn&#8217;t you, update the web.xml</p>
<p>Step 6.  Enable <a href="http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions">session</a> by adding</p>
<pre>    &lt;sessions-enabled&gt;true&lt;/sessions-enabled&gt;
</pre>
<p>to appengine-web.xml.</p>
<p>You can see my version from <a href="http://90.latest.denemekaya.appspot.com/login">http://90.latest.denemekaya.appspot.com/login</a></p>
<p>ps. don&#8217;t forget to set the callback in Twittter to the url of the servlet for callback.</p>
<p>Links:</p>
<ul>
<li>http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/</li>
<li>Explain the same procedure with Grails &#8212; http://blogs.bytecode.com.au/glen/2009/12/08/log-into-your-grails-app-using-your-twitter-credentials.html</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Memcache with Google App Engine (GAE/J)</title>
		<link>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/</link>
		<comments>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 21:39:23 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[gae/j]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[ifragman]]></category>
		<category><![CDATA[iphone application]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Servlet]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=196</guid>
		<description><![CDATA[A simple beginning &#8212; Fragman iPhone Application Memcache provides convenience to store a frequent query in memory, so that you don&#8217;t have to make the same execution over and over again. For the iPhone application I build (Fragman), I build a GAE/J backend for managing movie names, IMDB URLs, thumb images, video files, etc. It [...]]]></description>
			<content:encoded><![CDATA[<p><strong>A simple beginning &#8212; Fragman iPhone Application</strong></p>
<p>Memcache provides convenience to store a frequent query in memory, so that you don&#8217;t have to make the same execution over and over again. For the <a href="http://ifragman.com"><span style="color: #800000;">iPhone application I build (Fragman</span></a><span style="color: #800000;">)</span>, I build a GAE/J backend for managing movie names, IMDB URLs, thumb images, video files, etc. It interacts with the Obj-c code via calls encoded in JSON.</p>
<p>Since the categories are updated so frequently (new trailer, top 250 , soap opera trailers), every time the user starts the application from her iPhone, the corresponding categories Id(key) lists are  created which includes all the aspects mentioned above,</p>
<p>what I see, after people start to use the application that, most of the time, the application got stuck with the time constraint of GAE and  this causes inconvenience, so I decided to hold the category lists&#8217;s JSON in memory. Following is the code ,</p>
<p>this is the servlet for creating the JSON which is called after say upcoming movie list is changed. This servlet updates the memcached list</p>
<pre>        List keyList = new ArrayList();
	static Cache cache;
	static
	{
		try
		{
			CacheFactory cacheFactory =</pre>
<pre>CacheManager.getInstance().getCacheFactory();
			cache = cacheFactory.createCache(</pre>
<pre>Collections.emptyMap());
		}
		catch (CacheException e)
		{
			// ...
		}
		//.....
                public void doGet(HttpServletRequest request,</pre>
<pre>HttpServletResponse response) throws ServletException, IOException</pre>
<pre>	        {
                       //................
                       if(cache.containsKey(mode))
		       {
			     cache.remove(mode);
		       }
		       cache.put(mode, keyList);
	        }</pre>
<pre>                //........</pre>
<pre>          }</pre>
<p>And this is the servlet that fetch the Fragman beans from the datastore with the given keys (key list is got from the memecached list)</p>
<pre>          keyList = (List)cache.get(mode);</pre>
<pre>By doing this, I reduce the time that the servlet that creates the JSON takes.</pre>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple Chart for a GWT Application on GAE/J</title>
		<link>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/</link>
		<comments>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:41:17 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[gchart]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Google Web Toolkit]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[gwt 2.0]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Web development software]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=147</guid>
		<description><![CDATA[I am trying charting solutions for a GWT project and gchart seems a nice one. After some digging I create a sample project which is hosted on Google App Engine (GAE) demo. Source code is at Google project The chart will show the remaining number of months in the current year. First download the jar [...]]]></description>
			<content:encoded><![CDATA[<p>I am trying charting solutions for a GWT project and gchart seems a nice one. After some digging I create a sample project which is hosted on Google App Engine (GAE) <a href="http://ghart-samples.appspot.com/">demo</a>. Source code is at <a href="https://dogansartifacts.googlecode.com/svn/trunk/GoogleAppEngineJava/GChart-samples">Google project</a></p>
<p>The chart will show the remaining number of months in the current year.</p>
<ul>
<li>First download the jar from the project home page http://code.google.com/p/gchart/</li>
<li>Put it under war/WEB-INF/lib and add the gchart.jar to your classpath</li>
<li>Create a  Web Application project called it GChart-samples (I assume you have Google Eclipse Plugin and follow the basic steps from <a href="http://code.google.com/eclipse/docs/getting_started.html">here</a>)</li>
<li>This step is for make-up, find GChart_samples.html under war/WEB-INF and clear the part between &lt;body&gt; tags.</li>
<li>Open GChart_samples.gwt.xml and add the following line
<pre>&lt;inherits name='com.googlecode.gchart.GChart'/&gt;</pre>
</li>
<li>Create a class in client folder called FirstChart and change it as the following
<pre>package com.dogan.kaya.client;

import com.googlecode.gchart.client.GChart;

public class FirstChart extends GChart
{
	public FirstChart()
	{
		setChartSize(350, 350);

		addCurve();

		int[] data = { 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
		for (int i = 0; i &lt; data.length; i++)
		{
			getCurve().addPoint(i + 1, data[i]);
		}
		//curve customization
		getCurve().getSymbol().setHeight(10);
		getCurve().getSymbol().setWidth(10);
		getCurve().getSymbol().setBorderColor("black");
		getCurve().getSymbol().setBorderWidth(3);
		getCurve().getSymbol().setSymbolType(SymbolType.LINE);
		getCurve().getSymbol().setFillThickness(2);
		getCurve().getSymbol().setFillSpacing(0);
		//chart customization
		getXAxis().setAxisMin(1);
		getXAxis().setAxisMax(12);
		getXAxis().setTickCount(12);
		getXAxis().setHasGridlines(false);
		getXAxis().setTickLocation(TickLocation.CENTERED);
		getXAxis().setTickLabelFontSize(10);
		getYAxis().setAxisMin(0);
		getYAxis().setAxisMax(12);
		//to get inteter values on y axis, be careful
		//about the number of intervals it can be tricky
		getYAxis().setTickCount(13);
		getYAxis().setTicksPerLabel(2);
		getYAxis().setHasGridlines(false);
		getYAxis().setTickLabelFontSize(10);
		//
		update();
	}
}</pre>
</li>
<li>Open GChart_samples class and change it like the following
<pre>package com.dogan.kaya.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class GChart_samples implements EntryPoint
{
	public void onModuleLoad()
	{
		RootPanel.get().add(new FirstChart());
	}
}</pre>
</li>
<li>My output is sth like that</li>
</ul>
<p><a href="../wp-content/uploads/2009/12/chart1.jpg"></a><a href="http://doganberktas.com/wp-content/uploads/2009/12/chart11.jpg"><img class="alignnone size-full wp-image-154" title="chart1" src="http://doganberktas.com/wp-content/uploads/2009/12/chart11.jpg" alt="" width="361" height="199" /></a></p>
<p>ps:</p>
<p>some nice links about gchart are as follows:</p>
<ol>
<li style="text-align: justify;">gchart <a href="http://code.google.com/p/gchart/">homepage</a></li>
<li style="text-align: justify;">A simple tutorial at http://whatwouldnickdo.com/wordpress/264/simple-charts-in-gwt-with-gchart/</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to basics &#8212; A simple beginning to Grails</title>
		<link>http://doganberktas.com/2009/12/11/back-to-basics-a-simple-beginning-to-grails/</link>
		<comments>http://doganberktas.com/2009/12/11/back-to-basics-a-simple-beginning-to-grails/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 03:50:15 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache Struts]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[grails tutorial]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java enterprise platform]]></category>
		<category><![CDATA[Java platform]]></category>
		<category><![CDATA[relaible product]]></category>
		<category><![CDATA[Rife]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Spring Framework]]></category>
		<category><![CDATA[Web application frameworks]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=138</guid>
		<description><![CDATA[I guess I can finally finish my search for a good server side companion (at least for now).  A couple years ago RIFE was my only choice but unfortunately, it didn&#8217;t work out well as I expected (RIFE is an open source project but partly because of developers like me  who uses the framework but [...]]]></description>
			<content:encoded><![CDATA[<p>I guess I can finally finish my search for a good server side companion (at least for now).  A couple years ago <a href="http://rifers.org/">RIFE </a>was my only choice but unfortunately, it didn&#8217;t work out well as I expected (RIFE is an open source project but partly because of developers like me  who uses the framework but doesn&#8217;t pay his gratitude by adding sth to it, RIFE for the time being a dead project (at least for me!))</p>
<p style="text-align: center;"><a title="English Speaker" href="http://flickr.com/photos/23515014@N04/2948892935"><img class="alignnone" src="http://farm4.static.flickr.com/3254/2948892935_67a1da4122.jpg" alt="" width="454" height="500" /></a></p>
<p>Anyway, for some time I consider turn back to good old J2EE, then wander on the land of some other Java enterprise frameworks (Spring MVC, Wicket, Struts 2, Hibernate etc ) then Google App engine Java with its in progress full stack framework like environment. Then I decide that all the ones mentioned above has steep learning curves and without feeling complely comfortable with them, It is imposible to develop sth quickly.</p>
<p>Then the obvious direction was rails. First give a try to Django, then read some about  RoR but both of them somehow scare me out. I need to learn a new language (which Django tutorial specificly warns about looking a good python tutorial before devlde into Django), on the other hand, Grails (my love!) just start the sentence with &#8220;don&#8217;t worry about the groovy, you can learn it along the way&#8221;.</p>
<p>Obviously, Grails is relatively new compared to two other alternative and it has (or used to have) to many bugs for a relaible product.</p>
<p>But trust me, it is easy to just start and kick the first alfa version of sth out is a joy.</p>
<p>&#8211;</p>
<p>Ok this post is suppose to be a yet another introduction to Grails tutorial, so&#8230;</p>
<p><strong>Steps to Get Started</strong></p>
<p>1.  install Grails (there is nothing I can add here &#8212; <a href="http://www.grails.org/Installation">http://www.grails.org/Installation</a>)</p>
<p>2. open command line and create a project with grails create-app Yeap</p>
<p>3. Go to the created directory cd Yeap</p>
<p>4. Type grails run-app</p>
<p>That&#8217;s it!</p>
<p>I&#8217;m currently using <a href="http://grails.org/plugin/shiro">Apache Shiro</a> plugin (previously JSecurity), <a href="http://code.google.com/p/derjanandhisblog/wiki/GWTGrailsTutorial">Gwt plugin</a>, Postgresql, Eclipse for the development, More posts related to these will be here soon (I hope)</p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2009/12/11/back-to-basics-a-simple-beginning-to-grails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
