<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!-- generator="wordpress/wordpress-mu-1.2.3-2.2.1" --><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dekoh Developers Blog</title>
	<link>http://blogs.dekoh.com/dev</link>
	<description>From the Dekoh Team</description>
	<pubDate>Thu, 17 Jul 2008 04:09:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.2.3-2.2.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DekohDevelopersBlog" /><feedburner:info uri="dekohdevelopersblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>DekohDevelopersBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Dekoh in Financial Domain</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/3YqmPrgEnAQ/</link>
		<comments>http://blogs.dekoh.com/dev/2008/07/16/dekoh-in-financial-domain/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 21:58:42 +0000</pubDate>
		<dc:creator>venkat</dc:creator>
		
		<category><![CDATA[Applications]]></category>

		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2008/07/16/dekoh-in-financial-domain/</guid>
		<description><![CDATA[I worked in design and development of Dekoh. After working with a financial client and did some live trading. I feel Dekoh platform would be the right for trading application scenarios. Following are some of the things which made me think so.
1. Most of current trading applications has no means of optimizing the platform the [...]]]></description>
			<content:encoded><![CDATA[<p>I worked in design and development of Dekoh. After working with a financial client and did some live trading. I feel Dekoh platform would be the right for trading application scenarios. Following are some of the things which made me think so.</p>
<p>1. Most of current trading applications has no means of optimizing the platform the way the user wants. With the Dekoh the trading applications can expose some API, which can be used by some third party goody applications like trading advices, chating, commenting etc.<br />
2. Dekoh can be used for offline trading. Where I can trade/see/monitor my trades even I am off line.<br />
3. As the number of users trading increases, exponentially the load on the server increases and thus causing the main server to slow down. With the use of Dekoh he can reduce the load on the server by delegating some work to the client machine which is most of the time idle. This is not a new concept but its like distributed environment with optimum resource utilization.<br />
4. Now a days I see most of the trading applications are complicated and platform dependent. I faced lot issues in using a trading application when I moved to vista. Dekoh is platform independent with concept like development once and use any where.</p>
<p>-venkat gunnu</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=3YqmPrgEnAQ:tKCFOQ_25XQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=3YqmPrgEnAQ:tKCFOQ_25XQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3YqmPrgEnAQ:tKCFOQ_25XQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/3YqmPrgEnAQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2008/07/16/dekoh-in-financial-domain/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2008/07/16/dekoh-in-financial-domain/</feedburner:origLink></item>
		<item>
		<title>Signed Java Applets broken on Vista</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/QLz44W9MnTA/</link>
		<comments>http://blogs.dekoh.com/dev/2007/11/01/signed-java-applets-broken-on-vista/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 07:58:34 +0000</pubDate>
		<dc:creator>terran</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/11/01/signed-java-applets-broken-on-vista/</guid>
		<description><![CDATA[Having written a pure java (applet) based installer for Dekoh, I had assumed it would work seamlessly on all operating systems. But I was shocked to see support for signed applets is broken on Vista.
Why do we need special handling in the Dekoh installer for Windows Vista?
The answer is twofold -

     [...]]]></description>
			<content:encoded><![CDATA[<p>Having written a pure java (applet) based installer for Dekoh, I had assumed it would work seamlessly on all operating systems. But I was shocked to see support for signed applets is broken on Vista.</p>
<p>Why do we need special handling in the Dekoh installer for Windows Vista?<br />
The answer is twofold -</p>
<ul>
<li>     The primary Dekoh installer is a hassle-free, one-click web based <a href="http://www.dekoh.com/cas" title="installer" >installer</a> based on a Java applet. (There are other installers like an <a href="http://www.dekoh.com/cas/install/installers" title="exe file" >exe file</a> that you can download for Windows, but the web based is the easiest to use. Our installer applet is a signed applet which would download and install the required components on the user&#8217;s PC.)</li>
</ul>
<ul>
<li> The second reason is related to why signed Java applets behave differently on IE 7 protected mode in Windows Vista as opposed to other Windows versions.</li>
</ul>
<p><strong>What is a Signed Applet?<br />
</strong>A signed applet is a jar file containing a Java applet which has been signed with a digital certificate typically issued by an authority like <a href="http://www.verisign.com/" title="VeriSign" onclick="javascript:urchinTracker ('/outbound/article/www.verisign.com');">VeriSign</a>. Normal Java applets have very limited permissions. A signed applet however has all the permissions that a Java program that runs from your command line would have, after getting the user&#8217;s consent.<br />
The browser&#8217;s Java plugin detects signed applets and accordingly shows a message and the signing certificate to the user asking whether to grant permission to the applet.<br />
Dekoh uses a signed applet for the installer as it&#8217;s the easiest way to download, install and start the Dekoh runtime on the computer. Being browser based, there&#8217;s no need to download anything separately or configure anything, making it especially easy for non-technical users. The Dekoh installer applet is signed with a VeriSign certificate.</p>
<p><strong>What has changed in Windows Vista?</strong><br />
Windows Vista has a new enhanced security model, the most visible part of it being UAC (User Account Control). Internet Explorer 7.0 comes bundled with Vista, and it has something called &#8216;protected mode&#8217;. In protected mode IE runs with greatly restricted privileges making it difficult for malicious code to install itself. Note that protected mode is only available on Windows Vista as it is based on Vista specific security features.</p>
<p>Processes running in protected mode have restricted access to objects with high integrity levels - such as important files and registry keys.</p>
<p><strong>How does this affect the installer applet?</strong><br />
Operations on the file system and the registry are redirected to virtual stores using virtualization. So, when a process running inside IE (such as a Java applet) tries to create a file called say C:\Users\hrish\test.txt (assuming C is the system root drive) the file would actually get redirected to C:\Users\hrish\AppData\Local\VirtualStore\test.txt.</p>
<p>So,<br />
File f = new File(&#8221;C:\\Users\\hrish\\test.txt&#8221;);<br />
boolean b = f.createNewFile();//Will succeed.<br />
boolean e = f.exists();//Is true.<br />
String path = f.getAbsolutePath();//path will be C:\Users\hrish\test.txt.<br />
But the actual file would be present in C:\Users\hrish\AppData\Local\VirtualStore\test.txt</p>
<p>Firefox is not affected by this, because it has no equivalent of protected mode.</p>
<p><strong>What are the options?<br />
</strong>IE has a mechanism to allow add-ons to access the file system using the user&#8217;s normal integrity level as opposed to the low integrity level that the Java plugin runs in right now. It&#8217;s called a Broker Process. This process would run with a higher integrity level than normal add-ons. The Sun Java plugin does not implement this Broker Process yet (why, I wonder?), but there is an RFE logged for this on Sun&#8217;s bugzilla - <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6504236" title="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6504236" onclick="javascript:urchinTracker ('/outbound/article/bugs.sun.com');">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6504236</a>.<br />
Some add-ons like the Flash plugin <a href="http://blogs.msdn.com/ie/archive/2006/11/17/flash-player-9-update.aspx" title="already implement it" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">already implement it</a>.</p>
<p><strong>Relation between UAC and protected mode</strong>.<br />
IE&#8217;s protected mode is automatically off when UAC is turned off. A comprehensive figure with all possibilities is <a href="http://blogs.msdn.com/ie/archive/2007/04/04/protected-mode-for-ie7-in-windows-vista-is-it-on-or-off.aspx" title="here" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">here</a>.</p>
<p>Dekoh Desktop : Don&#8217;t upload, Just share!<br />
<a href="https://login.dekoh.com/signupEA.jsp" title="Sign up" >Sign up now</a>.</p>
<p>References:<br />
1. <a href="http://blogs.msdn.com/ie/archive/2007/04/04/protected-mode-for-ie7-in-windows-vista-is-it-on-or-off.aspx" title="http://blogs.msdn.com/ie/archive/2007/04/04/protected-mode-for-ie7-in-windows-vista-is-it-on-or-off.aspx" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">http://blogs.msdn.com/ie/archive/2007/04/04/protected-mode-for-ie7-in-windows-vista-is-it-on-or-off.aspx</a><br />
2. <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/ProtectedMode.asp" title="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/ProtectedMode.asp" onclick="javascript:urchinTracker ('/outbound/article/msdn.microsoft.com');">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/ProtectedMode.asp</a><br />
3. <a href="http://www.microsoft.com/technet/technetmag/issues/2007/06/UAC/" title="http://www.microsoft.com/technet/technetmag/issues/2007/06/UAC/" onclick="javascript:urchinTracker ('/outbound/article/www.microsoft.com');">http://www.microsoft.com/technet/technetmag/issues/2007/06/UAC/</a><br />
4. <a href="http://blogs.msdn.com/ie/archive/2006/11/17/flash-player-9-update.aspx" title="http://blogs.msdn.com/ie/archive/2006/11/17/flash-player-9-update.aspx" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">http://blogs.msdn.com/ie/archive/2006/11/17/flash-player-9-update.aspx</a><br />
5. <a href="http://msdn2.microsoft.com/en-us/library/bb250462.aspx" title="http://msdn2.microsoft.com/en-us/library/bb250462.aspx" onclick="javascript:urchinTracker ('/outbound/article/msdn2.microsoft.com');">http://msdn2.microsoft.com/en-us/library/bb250462.aspx</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=QLz44W9MnTA:1epoODiATfI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=QLz44W9MnTA:1epoODiATfI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=QLz44W9MnTA:1epoODiATfI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/QLz44W9MnTA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/11/01/signed-java-applets-broken-on-vista/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/11/01/signed-java-applets-broken-on-vista/</feedburner:origLink></item>
		<item>
		<title>Choosing a good font size variation algorithm for your tag cloud</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/3aeYJhzw81k/</link>
		<comments>http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 15:59:36 +0000</pubDate>
		<dc:creator>venkat</dc:creator>
		
		<category><![CDATA[Widgets]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/</guid>
		<description><![CDATA[In a tag cloud, tags which are used more frequently are displayed in a bigger font size. The font size used to depict a tag is a function of the number of times it is used. The simplest implementation is to use a linear function to map the frequency of use of a tag to [...]]]></description>
			<content:encoded><![CDATA[<p>In a tag cloud, tags which are used more frequently are displayed in a bigger font size. The font size used to depict a tag is a function of the number of times it is used. The simplest implementation is to use a linear function to map the frequency of use of a tag to its font-size in the tag cloud.</p>
<p>Assume, in a tagcloud, the tag which is the least used occurs <code>minOccurs</code> times and the tag which is most used occurs <code>maxOccurs</code> times, and assume we want to map these to font sizes between the range <code>minFontSize</code> and <code>maxFontSize</code>.</p>
<p>A <strong>linear mapping</strong> would mean the formula used for calculating the font size of a tag which is used <code>occurencesOfCurrentTag</code> times would be:</p>
<pre>
weight = <strong>(</strong>occurencesOfCurrentTag-minOccurs<strong>)</strong>/<strong>(</strong>maxOccurs-minOccurs<strong>)</strong>;
fontSizeOfCurrentTag = minFontSize + Math.round<strong>(</strong>(maxFontSize-minFontSize)*weight<strong>)</strong>;</pre>
<p>Below is a screenshot of a tag cloud which does a linear mapping between font-size and frequency of use (the numbers in brackets next to the tag name). In my data set, some tags like tree occur only 6 times, while the tag shoja occurs 108 times; while most of the tags occur less than 40 times. Due to this distribution, the tag nikon has nearly same font size as tag nature, though the former occurs twice the number of times.</p>
<p><img SRC="http://blogs.dekoh.com/dev/files/2007/10/tagcloud-linear.png" ALT="Tag cloud where font size varies linearly with frequency of usage" /></p>
<p><strong>Logarithmic mapping</strong> is an alternative algorithm. The same data set when rendered using this new algorithm looks like:<br />
<img SRC="http://blogs.dekoh.com/dev/files/2007/10/tagcloud-logarithmic.png" ALT="Tag cloud where font size varies logarithmicaly with frequency of usage" /></p>
<p>Notice how tags like butterfly, baby, chandru stand-out even though they are not used as frequently as shoja. Also notice how the difference between tags nature and nikon is clear.</p>
<p>The font-size with this mapping would be calculated as:</p>
<pre>
weight = <strong>(</strong>Math.log(occurencesOfCurrentTag)-Math.log(minOccurs)<strong>)</strong>/<strong>(</strong>Math.log(maxOccurs)-Math.log(minOccurs)<strong>)</strong>;
fontSizeOfCurrentTag = minFontSize + Math.round<strong>(</strong>(maxFontSize-minFontSize)*weight<strong>)</strong>;</pre>
<p>i.e. we are using log of the frequency of occurence of the tag instead of plain frequency.</p>
<p>Dekoh provides an <a href="http://blogs.dekoh.com/dev/2007/03/08/open-source-ajax-widgets-available-from-dekoh/" >open source tag cloud widget</a> that does logarithmic font size mapping. You can <a href="http://www.dekoh.org/wiki/view/TagCloudWidget" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">embed the widget in your application</a> whether you use Java/Ruby/PHP on your backend.</p>
<p>I have taken the above screenshots with the default style and with &#8220;show frequency&#8221; and &#8220;color variation&#8221; options enabled. You can play with the styles and options on our <a href="http://www.dekoh.org/widgets/tagcloud/tagcloud_xml_example.html" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">live demo site</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=3aeYJhzw81k:kSMaMxZT3so:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=3aeYJhzw81k:kSMaMxZT3so:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=3aeYJhzw81k:kSMaMxZT3so:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/3aeYJhzw81k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/</feedburner:origLink></item>
		<item>
		<title>Writing plural and singular words using ChoiceFormat in MessageFormat</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/GV4QJMs7yLk/</link>
		<comments>http://blogs.dekoh.com/dev/2007/10/25/writing-plural-and-singular-words-using-choiceformat-in-messageformat/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 15:49:57 +0000</pubDate>
		<dc:creator>prashant</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/10/25/writing-plural-and-singular-words-using-choiceformat-in-messageformat/</guid>
		<description><![CDATA[In Dekoh Photos application I wanted to internationalize String that represents the number of comments made on a Photo.
So when there are no comments made i wanted to display &#8220;No Comments&#8221;, when there is 1 comment i wanted to display &#8220;1 Comment&#8221; and if there are more than one comment i wanted to display &#8220;n [...]]]></description>
			<content:encoded><![CDATA[<p>In Dekoh Photos application I wanted to internationalize String that represents the number of comments made on a Photo.</p>
<p>So when there are no comments made i wanted to display &#8220;No Comments&#8221;, when there is 1 comment i wanted to display &#8220;1 Comment&#8221; and if there are more than one comment i wanted to display &#8220;n Comments&#8221;.</p>
<p>Using the following neat trick that employs <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/text/ChoiceFormat.html" onclick="javascript:urchinTracker ('/outbound/article/java.sun.com');">choice format</a> all these possibilities can be addressed in one message key.</p>
<pre>    private static final MessageFormat comments = new MessageFormat(
            "{0, choice, 0#No Comments|1#{0} comment|2#{0} comments}");

    public static void main(String[] args)
    {
        String zero = comments.format(new Object[]{0});
        System.out.println("zero= " + zero);
        String one = comments.format(new Object[]{1});
        System.out.println("one = " + one);
        String two = comments.format(new Object[]{2});
        System.out.println("two = " + two);
        String three = comments.format(new Object[]{3});
        System.out.println("three = " + three);
    }</pre>
<p>Will print :</p>
<pre>zero= No Comments
one = 1 comment
two = 2 comments
three = 3 comments</pre>
<pre></pre>
<p>So the trick likes in this line</p>
<pre>"{0, choice, 0#No Comments|1#{0} comment|2#{0} comments}");</pre>
<p>{0} represents the number of comments, which will be supplied at runtime as a value. If this value is anything more than 1 {0} Comments will be returned.</p>
<p>Cool, eh ?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=GV4QJMs7yLk:Kb5u2K19o-Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=GV4QJMs7yLk:Kb5u2K19o-Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=GV4QJMs7yLk:Kb5u2K19o-Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/GV4QJMs7yLk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/10/25/writing-plural-and-singular-words-using-choiceformat-in-messageformat/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/10/25/writing-plural-and-singular-words-using-choiceformat-in-messageformat/</feedburner:origLink></item>
		<item>
		<title>Easing JPA application developement by Using Google-Guice</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/eZNv7ySMe2U/</link>
		<comments>http://blogs.dekoh.com/dev/2007/10/15/easing-jpa-application-developement-by-using-google-guice/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 06:09:50 +0000</pubDate>
		<dc:creator>prashant</dc:creator>
		
		<category><![CDATA[Applications]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/10/15/easing-jpa-application-developement-by-using-google-guice/</guid>
		<description><![CDATA[Persistence Support in Dekoh 
At the core of Dekoh is a Servlet (2.4) Container on which any Java web applications can be deployed. Persistence support for Dekoh applications is achieved by using a JPA provider - Toplink Essentials (Part of Glassfish). Each Dekoh desktop installation includes Toplink-Essentials and a Derby database. Dekoh Applications developers can [...]]]></description>
			<content:encoded><![CDATA[<h2>Persistence Support in Dekoh<a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#PersistenceSupportinDekoh" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h2>
<p>At the core of Dekoh is a Servlet (2.4) Container on which any Java web applications can be deployed. Persistence support for Dekoh applications is achieved by using a JPA provider - Toplink Essentials (Part of Glassfish). Each Dekoh desktop installation includes Toplink-Essentials and a Derby database. Dekoh Applications developers can use Java Persistence API to specify the OR mapping of the application data.</p>
<p>An important interface between JPA application developers and the JPA provider software is the <tt>javax.persistence.EntityManager</tt>.  The<tt> EntityManager</tt> is used to create new persistent entities representing application data, and to query for already persisted entities.</p>
<p>A Java EE Container, would manage the life cycle of the <tt>EntityManager</tt> instances and inject these managed instances into EJB Session/Entity beans. However since, Dekoh application use <tt>EntityManager</tt> in Java SE mode, applications have to manage the life cycle of <tt>EntityManager</tt> instance. Dekoh applications will also have to manage local transactions wherever required.</p>
<p><a href="http://code.google.com/p/google-guice/" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">Guice</a> and its extension <a href="http://code.google.com/p/warp-persist/" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">warp-persist</a> come to the rescue.  Guice is a lightweight dependency injection framework and <em>warp-persist</em> is an extension of Guice which provides a way to have <tt>EntityManager</tt> injected. The instances into which <tt>EntityManager</tt> needs to be injected are managed by <tt>Guice</tt>.</p>
<p>Let me explain how to use these two packages with the help of a sample Blog Reader application which bookmarks links to interesting blogs.</p>
<h2>Using Guice in a Dekoh application<a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#UsingGuiceinaDekohapplication" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h2>
<p>Before going over how to configure Guice, warp-persist, lets look at the JPA Entity class the sample application will be using. A JPA Entity is a Java Bean whose state is OR mapped to a Database.</p>
<pre>@Entity
@NamedQueries({
@NamedQuery(name = Blog.LIST_ALL_QUERY, query = "SELECT o FROM Blog o"),
@NamedQuery(name = Blog.BY_SUBJECT, query = "SELECT o FROM Blog o WHERE o.subject=:subject")
        })
public class Blog

{
    public static final String BY_SUBJECT = "sample.Blog.findBySubject";
    public static final String LIST_ALL_QUERY = "sample.Blog.listAll";</pre>
<pre>    private Long id; //get and set method omitted for brevity
    private String subject; //Subject of the blog entry being bookmarked
    private String link; //Link to the actual blog entry

    public Blog(String subject, String text)
    {
        this.subject = subject;
        this.link = text;
    }</pre>
<pre>}</pre>
<p>As you can see, <tt>Blog</tt> is a simple JPA entity with two persistent fields - <em>subject</em> and <em>link</em>. Our sample web application will let users create many bookmarks to blog entries and then list the bookmarks. Each bookmarked blog entry is an instance of the <tt>Blog</tt> entity.</p>
<p>The <tt>persistence.xml</tt> for this application :</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;

    &lt;persistence-unit name="blog-persistence-unit" transaction-type="RESOURCE_LOCAL"&gt;</pre>
<pre>        &lt;provider&gt;oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider&lt;/provider&gt;
        &lt;class&gt;sample.Blog&lt;/class&gt;
        &lt;properties/&gt; &lt;!--DB, connection and driver details --&gt;
&lt;/persistence&gt;</pre>
<p>Note that the transaction-type is chosen to be <em>RESOURCE_LOCAL</em>. This means that instead of using JTA to manage the transactions, we will be using the local transaction support provided by the <tt>EntityManager</tt>.</p>
<p>In this Blog Reader application, we will be creating a new instance of <tt>EntityManager</tt> for every HTTP request. <tt>warp-persist</tt> allows applications to configure the scope of each <tt>EntityManager</tt> instance created. To do this we need to configure a <tt>Filter</tt> to intercept all HTTP requests.</p>
<pre>  &lt;filter&gt;
        &lt;filter-name&gt;sessionPerRequestFilter&lt;/filter-name&gt;
        &lt;filter-class&gt;com.wideplay.warp.jpa.SessionPerRequestFilter&lt;/filter-class&gt;
  &lt;/filter&gt;</pre>
<p>With this filter setup, <tt>warp-persist</tt> will create one instance of <tt>EntityManager</tt> for each HTTP request. Each created instance is also closed when response is committed. A resource local transaction is used within this scope when required.</p>
<p>But before <tt>warp-persist</tt> can create an instance of <tt>EntityManager</tt> for you, it needs to be told of the <em>persistence-unit</em> of your application. To do this bootstrapping we will use a <tt>ServletContextListener</tt>. A <em>persistence-unit</em> is defined in JPA&#8217;s deployment descriptor - <tt>persistence.xml</tt> and contains details on how to connect to Database, and qualified class names of the entity classes.</p>
<pre>public class BlogAppContextListener implements ServletContextListener
{
    private static Injector injector;</pre>
<pre>    public void contextInitialized(ServletContextEvent servletContextEvent)
    {
        //Based on code examples in the the Warp-persist guide
        injector = Guice.createInjector(new BlogModule(), PersistenceService
                .usingJpa()
                .across(UnitOfWork.REQUEST)
                .addAccessor(BlogAccessor.class)
                .transactedWith(TransactionStrategy.LOCAL)
                .buildModule());
    }</pre>
<pre>
    public static &lt;T&gt; T getInstance(java.lang.Class&lt;T&gt; aClass) { //gets injected instances
        assert injector!=null : "contextInitialized is expected to be called before invoking this method";
        return injector.getInstance(aClass);
    }

   public void contextDestroyed(ServletContextEvent servletContextEvent)
    {
        //stop persistence service here..
    }
}</pre>
<h2>Creating and Finding Blog Entities<a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#CreatingandFindingBlogEntities" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h2>
<p>Lets look at the code to create and persist Blog entities.</p>
<pre>public class CreateBlog
{
    @Inject
    Provider&lt;EntityManager&gt; em;</pre>
<pre>    @Transactional</pre>
<pre>    public Blog createBlog(String subject, String link)
    {
        Blog blog = new Blog(subject, link);
        em.get().persist(blog);
        return blog;
    }
}</pre>
<p>This class uses <tt>wrap-persist</tt> annotations to inject the <tt>EntityManager</tt>. Also notice that the method <tt>createBlog</tt> simply uses <tt>Transactional</tt> annotation to let <tt>warp-persist</tt> start a local transaction at the beginning of the method, and the same transaction is committed before the method returns. Without using the @Transaction annotation, this method would have to manage the local transaction by itself. So this boilerplate code is avoided.</p>
<p>Since this class needs <tt>EntityManager</tt> injected, and since we need <tt>warp-persist</tt> to intercept method calls to <tt>createBlog</tt>, instances of this class will be managed by <tt>Guice</tt> framework. To get an instance of <tt>CreateBlog</tt> we will use the following snippet of the code :</p>
<pre> Blog blog = BlogAppContextListener.getInstance(CreateBlog.class).createBlog(subject, link);</pre>
<p>Remember that the <tt>BlogAppContextListener</tt> is the <tt>ServletContextListener</tt> which holds the configured <tt>injector</tt> instance.</p>
<h3>Finding instances of Blog Entities<a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#FindinginstancesofBlogEntities" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h3>
<p>The Blog entity uses JPA&#8217;s <tt>@NamedQuery</tt> annotation to define Queries using JPA Query Language. We can use <tt>EntityManager</tt> instance to create instances of these queries. This is what the <tt>BlogAccessorWithJPAQueries</tt> shown below does. Again this class needs <tt>EntityManager</tt> injected, so its instances are managed by <tt>Guice</tt>.</p>
<pre>public class BlogAccessorWithJPAQueries {</pre>
<pre>    @Inject
    Provider&lt;EntityManager&gt; em;</pre>
<pre>
    @SuppressWarnings("unchecked")
    public List&lt;Blog&gt; getAllBlogs() {
        EntityManager entityManager = em.get();
        Query listAllBlogs = entityManager.createNamedQuery(Blog.LIST_ALL_QUERY);
        return (List&lt;Blog&gt;) listAllBlogs.getResultList();

        //For a more interesting note that covers various approaches to cast the result list see :
        //http://www.javaspecialists.co.za/archive/newsletter.do?issue=133&amp;locale=en_US

    }</pre>
<pre>    @SuppressWarnings("unchecked")
    public List&lt;Blog&gt; getBlogBySubject(String name) {
        EntityManager entityManager = em.get();
        Query listAllBlogs = entityManager.createNamedQuery(Blog.BY_SUBJECT).setParameter("subject",name);
        return (List&lt;Blog&gt;) listAllBlogs.getResultList();
    }
}</pre>
<h2>Finding instances of Blog Entities made easy with <em>Dynamic Finders</em><a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#FindinginstancesofBlogEntitiesmadeeasywithDynamicFinders" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h2>
<p>A very innovative feature of <tt>warp-persist</tt> is the <tt>@Finder</tt> annotation. Any defined JPA <tt>NamedQuery</tt> can be supplied to <tt>Finder</tt> annotation and <tt>warp-persist</tt> will take care the code to create instance of <tt>javax.persistence.Query</tt>, set the required dynamic parameters on the <tt>Query</tt>, and finally execute the Query to return the <tt>ResultList</tt>.</p>
<p>Lets look at a version of <tt>BlogAccessor</tt> class which uses the <tt>@Finder</tt> annotation provided by <tt>warp-persist</tt>, and accomplishes the task of finding Blog instances with lesser amount of code.</p>
<pre>public interface BlogAccessor
{
    @Finder(namedQuery = Blog.LIST_ALL_QUERY)
    List&lt;Blog&gt; getAllBlogs();</pre>
<pre>    @Finder(namedQuery = Blog.BY_SUBJECT)
    List&lt;Blog&gt; getBlogsBySubject(@Named("subject")String name, @MaxResults int pageSize, @FirstResult int firstResultIndx);</pre>
<pre>    @Finder(namedQuery = Blog.LIST_ALL_QUERY)
    List&lt;Blog&gt; getBlogPage(@MaxResults int pageSize, @FirstResult int firstResultIndx);
}</pre>
<p>First thing to notice is that the <tt>BlogAccessor</tt> is now an <em>interface</em>. The <em>finder</em> methods <tt>getAllBlogs</tt> are backed by <tt>NamedQueries</tt> already defined in the <tt>Blog</tt> entity. The implementation of this accessor object is supplied by <tt>warp-persist</tt> package. Instances of <tt>BlogAccessor</tt> class can be obtained by asking the Guice&#8217;s injector instance. Notice that when the injector was being configured in the <tt>BlogApplicaitonContextListener</tt>, we needed to add the <em>accessor</em> class.</p>
<p>The dynamic parameters that need to be inserted into the <tt>javax.persistence.Query</tt> can be specified by using the method parameter <tt>name</tt>. In the JPA Query <tt>SELECT o FROM Blog o WHERE o.subject=:subject</tt> the dynamic parameter that needs to be supplied is <em>subject</em>.</p>
<pre>    List&lt;Blog&gt; getBlogsByName(@Named("subject")String name, @MaxResults int pageSize, @FirstResult int firstResultIndx);</pre>
<p>So the value passed in method parameter <tt>name</tt>, is set as the value of query parameter <em>subject</em>.</p>
<p>Using the finder annotation supplied by warp-persist package, JPA applications eliminate lot of similar looking code which creates instance of <tt>javax.persistence.Query</tt> objects, sets the required parameters and then obtains the result list.</p>
<p>Pagination of the result list of any <tt>NamedQuery</tt> is also trivial to achieve using the annotations provided by <tt>warp-persist</tt> package.</p>
<pre>    @Finder(namedQuery = Blog.LIST_ALL_QUERY)

    List&lt;Blog&gt; getAllEntityAByPage(@MaxResults int pageSize, @FirstResult int firstResultIndx);</pre>
<p>By supplying the values for method parameter annotated <tt>@MaxResults</tt> the number entity instances returned in the result list are controlled. The method parameter annotated <tt>@FirstResult</tt> is used to walk to the next page of results.</p>
<p>The index.jsp page in the application gets the instance of the <tt>BlogAccessor</tt> and displays the bookmarked blogs.</p>
<p><img src="http://blogs.dekoh.com/dev/files/2007/10/blogreader.jpg" alt="blogreader screenshot" align="left" height="368" width="786" /></p>
<p>So in this blog entry we have seen how to use <tt>Guice</tt> and <tt>warp-persist</tt> package to write a JPA based web application; which can be deployed on Dekoh. We have also seen how employing these two packages will eliminate a lot of boilerplate code when coding JPA applications that will be deployed in a Java SE environment like a Dekoh Servlet Container.</p>
<h2>Download source code of the sample<a href="https://196.12.47.8/dekoh-trac/wiki/GuiceJPA#Downloadsourcecodeofthesample" title="Link to this section" onclick="javascript:urchinTracker ('/outbound/article/196.12.47.8');"> </a></h2>
<ul>
<li><a href="http://blogs.dekoh.com/dev/files/2007/10/blogreader.war" title="Blog reader sample WAR file to be deployed on Dekoh" >Blog reader sample WAR file</a> to be deployed on Dekoh.</li>
<li>Blog reader sample application<a href="http://blogs.dekoh.com/dev/files/2007/10/blogreadersample_src_oct13.zip" title="Blog reader sample application source code and project files" > source code and project files</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=eZNv7ySMe2U:sqfzKcqcfGY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=eZNv7ySMe2U:sqfzKcqcfGY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=eZNv7ySMe2U:sqfzKcqcfGY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/eZNv7ySMe2U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/10/15/easing-jpa-application-developement-by-using-google-guice/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/10/15/easing-jpa-application-developement-by-using-google-guice/</feedburner:origLink></item>
		<item>
		<title>Caching DWR interface java script files</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/q22m7_BgnUw/</link>
		<comments>http://blogs.dekoh.com/dev/2007/07/24/caching-dwr-interface-java-script-files/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 10:28:11 +0000</pubDate>
		<dc:creator>venkat</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/07/24/caching-dwr-interface-java-script-files/</guid>
		<description><![CDATA[DWR provides a convenient mechanism to execute server side java classes from javascript running in the browser. We use it extensively while developing Dekoh applications. Recently I noticed that when we use DWR, there are many requests to java-script files from the browser. It appeared that some DWR scripts are not being cached by the [...]]]></description>
			<content:encoded><![CDATA[<p>DWR provides a convenient mechanism to execute server side java classes from javascript running in the browser. We use it extensively while developing Dekoh applications. Recently I noticed that when we use DWR, there are many requests to java-script files from the browser. It appeared that some DWR scripts are not being cached by the browser. I fired up <a href="http://livehttpheaders.mozdev.org/" onclick="javascript:urchinTracker ('/outbound/article/livehttpheaders.mozdev.org');">firefox live http headers</a> and noticed that inded some scripts were being downloaded with every page. We use DWR version 1.1.4. The headers for the repeat downloads looked like:</p>
<pre>GET /dekohportal/dwr/interface/locationchooser.js HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,as;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cache-Control: max-age=0  

HTTP/1.x 200 OK
Server: Pramati Server/5.0SP3 [Servlet/2.4 JSP/2.0]
Date: Tue, 24 Jul 2007 05:29:20 GMT
Transfer-Encoding: chunked
Connection: Keep-Alive</pre>
<p>Notice that in the response headers, there is no Last-Modified header. This is the reason why the browser is reloading the script on every page load. This script is a DWR interface script. When you expose java methods using DWR (through a create tag in the dwr-*.xml), DWR creates an interface javascript. This file implements javascript methods which invoke the remote java methods (using DWREngine._execute). The interface script does not change unless the methods exposed in the dwr-*.xml are changed and the application is restarted. Hence the script should have been cacheable. These scripts are generated by DefaultInterfaceProcessor in DWR. To enable caching, we need to change the InterfaceProcessor to add the Last-Modified header in the response and read the If-Modified-Since header in the request. DWR provides a nice mechanism to plugin custom implementation of processors. So instead of chaging the DefaultInterfaceProcessor (which is shipped with DWR), I subclassed the default implementation to support these new headers and plugged it in to our runtime. The code for custom interface processor looks like:</p>
<pre>import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import uk.ltd.getahead.dwr.impl.DefaultInterfaceProcessor;
import uk.ltd.getahead.dwr.impl.HtmlConstants;  

/**
 * This class is the InterfaceProcessor for DWRHandler which
 * will add the functionality to add las modified header and
 * check if modified since header.
 * @author &lt;a href="mailto:venkat@pramati.com" mce_href="mailto:venkat@pramati.com"&gt;Venkat Gunnu&lt;/a&gt;
 * @since Jul 19, 2007
 */  

public class HttpCachingInterfaceProcessor
        extends DefaultInterfaceProcessor  

{
	//Store the application startup time. This will be the time we will set
	//as the Last-Modified time for all the interface scripts
	private final long lastUpdatedTime = (System.currentTimeMillis() / 1000) * 1000;  

	public void handle(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
	{
		long ifModifiedSince = req.getDateHeader(HtmlConstants.HEADER_IF_MODIFIED);
		if (ifModifiedSince &lt; lastUpdatedTime) {
			//If the browser does not have the script in the cache or the cached copy is stale
			//set the Last-Modified date header and send the new script file
			//Note: If the browser does not have the script in its cache ifModifiedSince will be -1  

			resp.setDateHeader(HtmlConstants.HEADER_LAST_MODIFIED, lastUpdatedTime);
			super.handle(req, resp);
		} else {
			//If the browser has current version of the file, dont send the script. Just say it has not changed
			resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
		}
	}
}</pre>
<p>To plugin this new Interface Processor, we need to add init parameter for DWRServlet in web.xml. The snippet from web.xml would look like:</p>
<pre>&lt;servlet&gt;&lt;servlet-name&gt;dwr-invoker&lt;/servlet-name&gt;
&lt;servlet-class&gt;uk.ltd.getahead.dwr.DWRServlet&lt;/servlet-class&gt;
&lt;init-param&gt;
&lt;param-name&gt;interface&lt;/param-name&gt;
&lt;param-value&gt;util.dwr.HttpCachingInterfaceProcessor&lt;/param-value&gt;
&lt;/init-param&gt;
...
&lt;/servlet&gt;</pre>
<p>After adding the custom inerface processor following are the headers for the dwr interface request.</p>
<pre>GET /dekohportal/dwr/interface/locationchooser.js HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,as;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-aliveHTTP/1.x 200 OK
Server: Pramati Server/5.0SP3 [Servlet/2.4 JSP/2.0]
Date: Tue, 24 Jul 2007 05:49:43 GMT  

<font color="#ff0000"><strong>Last-Modified: Tue, 24 Jul 2007 05:49:33 GMT</strong>
</font>Transfer-Encoding: chunked
Connection: Keep-Alive</pre>
<p>Notice that now for the first request, DWR is sending the Last-Modfied header. When we make the second request, the browser sends an &#8220;If-Modified-Since&#8221; header and DWR now sends a 304 NOT_MODIFIED response.</p>
<pre>GET /dekohportal/dwr/interface/locationchooser.js HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,as;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
<strong><font color="#ff0000">If-Modified-Since: Tue, 24 Jul 2007 05:49:33 GMT</font></strong>  

<strong><font color="#ff0000">HTTP/1.x 304 NOT_MODIFIED</font></strong>
Server: Pramati Server/5.0SP3 [Servlet/2.4 JSP/2.0]
Date: Tue, 24 Jul 2007 05:50:42 GMT
<strong><font color="#ff0000">Content-Length: 0</font>
</strong>Connection: Keep-Alive</pre>
<p>Thus, by plugging in a custom interface processor, we can enable caching of interface java-scripts in DWR.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=q22m7_BgnUw:9QWYRyH0fPU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=q22m7_BgnUw:9QWYRyH0fPU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=q22m7_BgnUw:9QWYRyH0fPU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/q22m7_BgnUw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/07/24/caching-dwr-interface-java-script-files/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/07/24/caching-dwr-interface-java-script-files/</feedburner:origLink></item>
		<item>
		<title>Using Dekoh Photos: 1-2-3-4 to create, share, view and comment Photos</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/R9xMJCcpyD4/</link>
		<comments>http://blogs.dekoh.com/dev/2007/07/24/using-dekoh-photos-1-2-3-4-to-create-share-view-and-comment-photos/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 06:58:07 +0000</pubDate>
		<dc:creator>mayank</dc:creator>
		
		<category><![CDATA[Applications]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/07/24/using-dekoh-photos-1-2-3-4-to-create-share-view-and-comment-photos/</guid>
		<description><![CDATA[Dekoh is a desktop-web integration platform which allows you to securely and selectively share your desktop contents on dekoh network with your near ones.
 Dekoh comes with lot many bundled applications, to name a few exciting ones&#8230;,

Dekoh Calendar - Calendar with desktop reminders and synchronization with Google calendar.
Dekoh Photos - Unlock digital photos from your PC. Organize and share [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bp1.blogger.com/_mmTVNctoGW8/RojvGbvu71I/AAAAAAAAADc/YTIkdj9w5pM/s1600-h/dekoh_logo.jpg" onclick="javascript:urchinTracker ('/outbound/article/bp1.blogger.com');"><img border="0" src="http://bp1.blogger.com/_mmTVNctoGW8/RojvGbvu71I/AAAAAAAAADc/YTIkdj9w5pM/s200/dekoh_logo.jpg" /></a><a href="http://www.dekoh.com/" >Dekoh</a> is a desktop-web integration platform which allows you to securely and selectively share your desktop contents on dekoh network with your near ones.</p>
<p><a href="http://bp1.blogger.com/_mmTVNctoGW8/Rojo0bvu7tI/AAAAAAAAACc/93ZHkQNjnMw/s1600-h/newbanner1.jpg" onclick="javascript:urchinTracker ('/outbound/article/bp1.blogger.com');"></a> <a href="http://www.dekoh.com/" >Dekoh</a> comes with lot many bundled applications, to name a few exciting ones&#8230;,</p>
<ul>
<li>Dekoh Calendar - Calendar with desktop reminders and synchronization with Google calendar.</li>
<li>Dekoh Photos - Unlock digital photos from your PC. Organize and share them with others.</li>
<li>Dekoh Music - Organize, share play lists and stream music.</li>
<li>Dekoh Books - Connect with your friends and share your book catalog, reading list or wish list.</li>
<li>MyFlickr - Two-way synchronization of your desktop collection with your online one at Flickr.com.</li>
<li>devTool - Create your dummy Applications. Or a place holder for your applications.</li>
<li>wordPress - The popular blogging software. Blog privately to your own personal network.</li>
</ul>
<p>This blog entry is to give a walk through to one of the dekoh application, I guess, the most commonly shared media content on the Internet are Photos, let&#8217;s see how we can share our Photos using Dekoh Photos application.</p>
<p>As I just said, you get many applications bundled with Dekoh installation, to use them install them from available applications,<a href="http://bp1.blogger.com/_mmTVNctoGW8/RojiLbvu7lI/AAAAAAAAABc/oeN3ysbNBao/s1600-h/available+applications.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp1.blogger.com');"><img border="0" align="left" width="269" src="http://bp1.blogger.com/_mmTVNctoGW8/RojiLbvu7lI/AAAAAAAAABc/oeN3ysbNBao/s200/available+applications.JPG" height="127" /></a></p>
<p>These are Dekoh applications, which anyone as <a href="http://www.dekoh.org/" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">Dekoh developer</a> can create on his/her own and then can share them with buddies. Dekoh network will soon provide a Developer Gallery to allow developer to create, maintain and distribute their own applications and checkout popular applications.</p>
<p>Once you install Dekoh Photos, you can see it in the installed application listing as below,</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/Roji07vu7mI/AAAAAAAAABk/_ut9xcxf5Fk/s1600-h/installed+applications.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" width="339" src="http://bp3.blogger.com/_mmTVNctoGW8/Roji07vu7mI/AAAAAAAAABk/_ut9xcxf5Fk/s200/installed+applications.JPG" height="100" /></a></p>
<p>To use the application, check whether the application is in the &#8217;stop&#8217; state or in the &#8217;start&#8217; state. This basically start your application in the inbuilt web container.</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/Rojjg7vu7nI/AAAAAAAAABs/3VvuebXrsL8/s1600-h/stopped+photos.bmp" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" src="http://bp3.blogger.com/_mmTVNctoGW8/Rojjg7vu7nI/AAAAAAAAABs/3VvuebXrsL8/s200/stopped+photos.bmp" /></a> Stopped Dekoh Application</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/RojkS7vu7oI/AAAAAAAAAB0/b_On8wyea5U/s1600-h/photos+started.bmp" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" src="http://bp3.blogger.com/_mmTVNctoGW8/RojkS7vu7oI/AAAAAAAAAB0/b_On8wyea5U/s200/photos+started.bmp" /></a> Started Dekoh Application</p>
<p>1. Create Collection:  Create a new collection,</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/RojnG7vu7pI/AAAAAAAAAB8/JoDXw1XyZ0A/s1600-h/new+collection.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" align="left" src="http://bp3.blogger.com/_mmTVNctoGW8/RojnG7vu7pI/AAAAAAAAAB8/JoDXw1XyZ0A/s200/new+collection.JPG" /></a>Choose the pics you want to share,</p>
<p><a href="http://bp2.blogger.com/_mmTVNctoGW8/RojuZrvu70I/AAAAAAAAADU/J6uUPxdv7bo/s1600-h/file+chooser.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp2.blogger.com');"><img border="0" src="http://bp2.blogger.com/_mmTVNctoGW8/RojuZrvu70I/AAAAAAAAADU/J6uUPxdv7bo/s200/file+chooser.JPG" /></a></p>
<p>Once done! you get a new collection added.</p>
<p><a href="http://bp2.blogger.com/_mmTVNctoGW8/RojpHrvu7uI/AAAAAAAAACk/Hl5XfhE0RSU/s1600-h/recent+collection.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp2.blogger.com');"><img border="0" align="left" src="http://bp2.blogger.com/_mmTVNctoGW8/RojpHrvu7uI/AAAAAAAAACk/Hl5XfhE0RSU/s200/recent+collection.JPG" /></a></p>
<p>Your selected pictures are now imported into the collection, if required you can modify collection as below,</p>
<p><a href="http://bp1.blogger.com/_mmTVNctoGW8/Rojn7bvu7rI/AAAAAAAAACM/WdVMS8BwRf8/s1600-h/modifying+collection.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp1.blogger.com');"><img border="0" width="325" src="http://bp1.blogger.com/_mmTVNctoGW8/Rojn7bvu7rI/AAAAAAAAACM/WdVMS8BwRf8/s200/modifying+collection.JPG" height="90" /></a></p>
<p>2. Share: You are all set to share your snaps with your buddy(ies). To demonstrate I (logged in as user - mayankmishra01) shared my snaps with my buddy (user - mayank)</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/Rojok7vu7sI/AAAAAAAAACU/CmWip_NnYwc/s1600-h/share.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" align="left" width="237" src="http://bp3.blogger.com/_mmTVNctoGW8/Rojok7vu7sI/AAAAAAAAACU/CmWip_NnYwc/s200/share.JPG" height="122" /></a>Select the buddy(ies) you want to share your content.</p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/Rojps7vu7vI/AAAAAAAAACs/aRtnZgVfpJQ/s1600-h/tagged+and+shared.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" width="137" src="http://bp3.blogger.com/_mmTVNctoGW8/Rojps7vu7vI/AAAAAAAAACs/aRtnZgVfpJQ/s200/tagged+and+shared.JPG" height="200" /></a></p>
<p>You can see  &#8216;Shared to&#8217; label to instantly view the buddy(ies) to which your pictures got shared.</p>
<p>Great! You have shared them with your buddy.</p>
<p>3. Viewing Share: Even as user &#8216;mayank&#8217;, I received a notification email having album link to access shared album by user &#8216;mayankmishra01&#8242;</p>
<p>Let&#8217;s log in as user - &#8216;mayank&#8217; to see snaps shared to me.</p>
<p>I can see a instant notification also on the main page of Dekoh desktop about the activity on dekoh network related to my buddies&#8230;.</p>
<p><img border="0" align="left" width="246" src="http://bp0.blogger.com/_mmTVNctoGW8/RojsGLvu7yI/AAAAAAAAADE/Kz8oAHiMTjM/s200/activities+on+mayank+dekoh+network+for+mayank.JPG" height="91" /></p>
<p>To access the shared content by buddy (mayankmishra01), I selected the user in the &#8216;Buddies on Network&#8217; frame, and then Photos as<a href="http://bp3.blogger.com/_mmTVNctoGW8/Rojqo7vu7wI/AAAAAAAAAC0/6zyxErgvRDI/s1600-h/online+buddies1.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" align="left" src="http://bp3.blogger.com/_mmTVNctoGW8/Rojqo7vu7wI/AAAAAAAAAC0/6zyxErgvRDI/s200/online+buddies1.JPG" /></a> below,</p>
<p>I can see new photos shared for me,<a href="http://bp1.blogger.com/_mmTVNctoGW8/RojrIbvu7xI/AAAAAAAAAC8/5GQEUgMs-wY/s1600-h/shared+for+Mayank.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp1.blogger.com');"><img border="0" src="http://bp1.blogger.com/_mmTVNctoGW8/RojrIbvu7xI/AAAAAAAAAC8/5GQEUgMs-wY/s200/shared+for+Mayank.JPG" /></a><br />
4: Putting Comment: Accessing shared collection gives you option to even comment on the shared collection as, </p>
<p><a href="http://bp3.blogger.com/_mmTVNctoGW8/Rojsc7vu7zI/AAAAAAAAADM/WYS6ET1HueQ/s1600-h/commenting+on+shared+pics.JPG" onclick="javascript:urchinTracker ('/outbound/article/bp3.blogger.com');"><img border="0" src="http://bp3.blogger.com/_mmTVNctoGW8/Rojsc7vu7zI/AAAAAAAAADM/WYS6ET1HueQ/s200/commenting+on+shared+pics.JPG" /></a></p>
<p>We have used our pictures on Yahoo Photos, Picassa web, facebook and even on Flickr. But the prime difference which can be depicted out from this demo is that <strong>&#8220;No where we uploaded our picture collection, and no where we downloaded them&#8221;. </strong>This results in a significant advantage when we have hundreds of snaps to be shared (not uploaded or downloaded) with our mates and dear ones&#8230;.</p>
<p>Also, Tagging, commenting and using Dekoh network provides notification, accessibility to other users, and <a href="http://www.dekoh.org/" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">dekoh developers.</a> Also in regard to Dekoh Photos comments, issues, pats of the back, you can contact with Dekoh Team at <a href="http://www.dekoh.org/forums/forums/show/3.page" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">Dekoh Photo Forum</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=R9xMJCcpyD4:14ZvPztJeDE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=R9xMJCcpyD4:14ZvPztJeDE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=R9xMJCcpyD4:14ZvPztJeDE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/R9xMJCcpyD4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/07/24/using-dekoh-photos-1-2-3-4-to-create-share-view-and-comment-photos/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/07/24/using-dekoh-photos-1-2-3-4-to-create-share-view-and-comment-photos/</feedburner:origLink></item>
		<item>
		<title>Calling developers to join Dekoh Early Access Program</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/SDoN79nrTCE/</link>
		<comments>http://blogs.dekoh.com/dev/2007/07/21/calling-developers-to-join-dekoh-early-access-program/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 06:14:08 +0000</pubDate>
		<dc:creator>Chandru</dc:creator>
		
		<category><![CDATA[Applications]]></category>

		<category><![CDATA[Announcement]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/07/21/calling-developers-to-join-dekoh-early-access-program/</guid>
		<description><![CDATA[Plans for Dekoh, the new desktop-web integration platform, have been announced. Developers can build applications that have a desktop-like rich UI, work seamlessly online or offline, and have web 2.0 style sharing and community networking features, on Dekoh.
Since Dekoh uses open web technologies, web application developers can build cross-platform desktop applications without having to learn [...]]]></description>
			<content:encoded><![CDATA[<p>Plans for Dekoh, the new desktop-web integration platform, have been announced. Developers can build applications that have a desktop-like rich UI, work seamlessly online or offline, and have web 2.0 style sharing and community networking features, on Dekoh.</p>
<p>Since Dekoh uses open web technologies, web application developers can build cross-platform desktop applications without having to learn something new. To get started, visit the developer overview page.</p>
<p>Dekoh Desktop software and Dekoh Network (sharing service) is FREE. Dekoh software will be open to a limited number of beta users soon. Register now to get Early Access Release when it becomes available.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=SDoN79nrTCE:1o_LmxfUi-U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=SDoN79nrTCE:1o_LmxfUi-U:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=SDoN79nrTCE:1o_LmxfUi-U:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/SDoN79nrTCE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/07/21/calling-developers-to-join-dekoh-early-access-program/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/07/21/calling-developers-to-join-dekoh-early-access-program/</feedburner:origLink></item>
		<item>
		<title>Tips and Tricks for Dekoh Developers</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/8SBShGbIzwk/</link>
		<comments>http://blogs.dekoh.com/dev/2007/07/20/tips-and-tricks-for-dekoh-developers/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 12:51:47 +0000</pubDate>
		<dc:creator>rohit</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/07/20/tips-and-tricks-for-dekoh-developers/</guid>
		<description><![CDATA[When I was asked to write this blog, I was wondering, writing the first official blog, what should I do? I thought I can see better from the developer&#8217;s view and so decided to blog something that will be useful for the developer. Instead, of writing a tutorial or a step by step how to [...]]]></description>
			<content:encoded><![CDATA[<p>When I was asked to write this blog, I was wondering, writing the first official blog, what should I do? I thought I can see better from the developer&#8217;s view and so decided to blog something that will be useful for the developer. Instead, of writing a tutorial or a step by step how to I am writing a few tips that are considered to be common knowledge but i began using them on my current Dekoh Application assignment and they have helped me be much more productive than I would have been without this knowledge and eased the distribution of the application too.</p>
<p>1. Have a component.xml file in your Dekoh apps. This is like having a custom server deployment file, but it gives a lot of Dekoh power to your application. Like it will allow you to maintain versions and enable automatic updates, define dependencies and so on. <a href="http://www.dekoh.org/wiki/view/JSPApp#section-JSPApp-SavingComponent.xmlFile" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">Check this out to know the structure of component.xml</a>.</p>
<p>2. To deploy a component you can simply drop the .war in the Dekoh\server\downloads folder and restart the server.</p>
<p>3. If you maintain a component.xml file, update the version in this file and create a war. Then placing this war in Dekoh\server\downloads and restarting the server will take care of updating the application.</p>
<p>4. To go to the dekoh server command shell, stop the dekoh service and from command prompt run dekoh_shell.bat/dekoh_shell.sh in the Dekoh\server\downloads directory. From the command prompt you can deploy,undeploy,start and stop the dekoh applications running on the server.</p>
<p>5. While in development mode you may prefer to directly deploy your working doc-root to Dekoh so that the changes you make to your JSPs/JS reflect immediately in the application.</p>
<p>6. Also set your compiled Java classes to be placed in doc-root\WEB-INF\classes so that they are also available as soon as you change the code and compile it. You&#8217;ll just have to restart the application (not the server).</p>
<p>7. To enable remote debugging of deployed application open the dekoh_shell.bat/dekoh_shell.sh file and remove the comment to this line        set DEBUG_OPTIONS=-Xdebug -Xnoagent             -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005<br />
and then connect to port 5005 using your favorite debugger.</p>
<p>8. Dekoh provides you various widgets for reuse, including script.aculo.us and also custom widgets for example <a href="http://www.dekoh.org/wiki/view/ThumbnailMakerWidget" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">Thumbnail Maker</a> and <a href="http://www.dekoh.org/wiki/view/TagCloudWidget" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org');">Tag Cloud</a>. If you want to make a custom dialog, you can use the Dekoh dialog as<br />
new dekohDialog(&#8221;snipPreview&#8221;,</p>
<p>{<br />
className:&#8217;dekoh&#8217;,<br />
title: &#8220;Title&#8221; ,<br />
height:previewHeight,<br />
width:previewWidth,<br />
minHeight:320,<br />
minWidth:400,<br />
content:divContent,<br />
topMessage:metaDataDiv<br />
});<br />
Read <a href="http://web2desk.blogspot.com/2007/07/how-to-use-embeded-javascript-libraries.html" onclick="javascript:urchinTracker ('/outbound/article/web2desk.blogspot.com');">this blog post </a>to know more about using the bundled javascripts in your application.</p>
<p>9. In your JSP page or servlet you can use RequestContext.getRequestContext(request).isLocalRequest() to find whether the access is being made from the local machine or a remote end and deliver different content based on that.</p>
<p>10. Keep visiting <a href="http://www.dekoh.org%20/" onclick="javascript:urchinTracker ('/outbound/article/www.dekoh.org%20');">http://www.dekoh.org</a> and <a href="http://blogs.dekoh.com//" >http://blogs.dekoh.com/</a> for the latest developer information.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=8SBShGbIzwk:sIWRpX6qqdc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=8SBShGbIzwk:sIWRpX6qqdc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=8SBShGbIzwk:sIWRpX6qqdc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/8SBShGbIzwk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/07/20/tips-and-tricks-for-dekoh-developers/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/07/20/tips-and-tricks-for-dekoh-developers/</feedburner:origLink></item>
		<item>
		<title>Dekoh vs p2p</title>
		<link>http://feedproxy.google.com/~r/DekohDevelopersBlog/~3/pDdYHAJc0N0/</link>
		<comments>http://blogs.dekoh.com/dev/2007/04/11/dekoh-vs-p2p/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 12:12:27 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blogs.dekoh.com/dev/2007/04/11/dekoh-vs-p2p/</guid>
		<description><![CDATA[The initial applications built for the dekoh platform are a suite of consumer applications- Dekoh Photos, Music, Books and Calender. These are applications that have managing media as its primary functionality. Dekoh Photos allows organizing photos on a desktop into collections, creating view templates, tag photos/collections, share the collections with friends, publish to other photo [...]]]></description>
			<content:encoded><![CDATA[<p>The initial applications built for the dekoh platform are a suite of consumer applications- Dekoh Photos, Music, Books and Calender. These are applications that have managing media as its primary functionality. Dekoh Photos allows organizing photos on a desktop into collections, creating view templates, tag photos/collections, share the collections with friends, publish to other photo sites. The sharing functionality is enabled without needing any uploads- share the photos directly off your desktop. Others accessing these will be accessing your desktop- but do this by using just a browser. Just as you would if you are accessing aphoto site such as Flickr. No other software needed.</p>
<p>While these apps enable sharing of content, this is much beyond what P2P offers. P2P like Bit Torrent is just about sharing files. I can stream data. And I need specific software to view it. And no applications as such. It is just about files and data streaming. Dekoh, while it can enable everything P2P does, the platform is itself much beyond file sharing. It is a complete application platform with a good amount of Web2.0 enabling APIs/features like tagging, communities and collaboration.</p>
<p>Dev platform: The platform is an open development platform. Any web developer can build applications that can run on this platform. The APIs and developers guides are on the dev portal- dekoh.org</p>
<p>Dekoh is a rich web-desktop platform that enables building applications for the desktop using standard web programming languages and models. In so doing, dekoh enables bridging the desktop and its contents with the web. Bringing resources on the web available on the desktop (as part of the desktop apps written for dekoh). And gets applications running on the desktop available on the web. Users can share their dekoh applications with other users. Dekoh takes sharing beyond just access to the applications. Dekoh includes a Web2.0-enabling framework that allows sharing of data, tagging, collating and organizing data in templates, advanced security and collaboration between applications and users. With this, developers can build applications that are programmed using web programming languages (Java/JSP/Servlet/PHP/Flash/..), can work on data on the desktop, can enable collaboration across users and allows simple sharing. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=pDdYHAJc0N0:TFak0JP45u0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?i=pDdYHAJc0N0:TFak0JP45u0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:W1ccf-mKbkM"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=W1ccf-mKbkM" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?a=pDdYHAJc0N0:TFak0JP45u0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DekohDevelopersBlog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DekohDevelopersBlog/~4/pDdYHAJc0N0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.dekoh.com/dev/2007/04/11/dekoh-vs-p2p/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.dekoh.com/dev/2007/04/11/dekoh-vs-p2p/</feedburner:origLink></item>
	</channel>
</rss>
