<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>mushiengine</title>
	<atom:link href="http://finker.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://finker.wordpress.com</link>
	<description>things that I rather share</description>
	<lastBuildDate>Tue, 19 Oct 2010 07:00:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='finker.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/a9b7d25ce7a80cdae894d94156715032?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>mushiengine</title>
		<link>http://finker.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://finker.wordpress.com/osd.xml" title="mushiengine" />
	<atom:link rel='hub' href='http://finker.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JQuery and Rails 3</title>
		<link>http://finker.wordpress.com/2010/10/19/jquery-and-rails-3/</link>
		<comments>http://finker.wordpress.com/2010/10/19/jquery-and-rails-3/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 07:00:36 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.mushiengine.com/?p=117</guid>
		<description><![CDATA[Just a quickie. For you and myself so I don&#8217;t forget. There is a bunch of post about this but they all seem abit convoluted where the jquery&#8217;s rails plugin documentation actually does the trick. The only thing is after you added the gem to Gemfile you need to issue &#8216;bundle install&#8217; before generate. Thats [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=117&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just a quickie. For you and myself so I don&#8217;t forget. There is a bunch of post about this but they all seem abit convoluted where the jquery&#8217;s rails <a href="http://github.com/rails/jquery-ujs" target="_blank">plugin</a> documentation actually does the trick. The only thing is after you added the gem to Gemfile you need to issue &#8216;bundle install&#8217; before generate. Thats it <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=117&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2010/10/19/jquery-and-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>52.215226 0.142449</georss:point>
		<geo:lat>52.215226</geo:lat>
		<geo:long>0.142449</geo:long>
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Paypal adaptive API and Spring 3 rest template — Part 3</title>
		<link>http://finker.wordpress.com/2010/09/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-3/</link>
		<comments>http://finker.wordpress.com/2010/09/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-3/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 20:33:00 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adaptive_Payments_API]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[rest_template]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[spring_3]]></category>

		<guid isPermaLink="false">http://blog.mushiengine.com/?p=110</guid>
		<description><![CDATA[This is part 3 and the final part of this series of how to use Spring 3 rest template and paypal&#8217;s adaptive API. You can find part 1 and part 2 here and here. This part is all about unmarshalling paypal&#8217;s responds back to your expected objects. The problem need to be solve here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=110&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part 3 and the final part of this series of how to use <a href="http://www.springsource.org/">Spring</a> 3 rest template and <a href="https://www.x.com/community/ppx/adaptive_payments" target="_blank">paypal&#8217;s</a> adaptive API. You can find part 1 and part 2 <a href="http://blog.mushiengine.com/2010/08/24/paypal-adaptive-api-and-spring-3-rest-template-part-1/" target="_blank">here</a> and <a href="http://blog.mushiengine.com/2010/08/25/paypal-adaptive-api-and-spring-3-rest-template-%E2%80%94-part-2/" target="_blank">here</a>. This part is all about unmarshalling paypal&#8217;s responds back to your expected objects. The problem need to be solve here is that paypal replies with 200 even if the pay request have failed for what ever reason (that is not HTTP related). Compounded by the fact that the the success response have a different parent tag to a failed response even tho the object structure is the same (JAXB doesn&#8217;t support multiple XMLRootElements).</p>
<p>There could be another way to skin this cat if you have post a alternative solution here will give readers a alternative option <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Solution Objective:</h2>
<p>I wanted to keep my code as clean and transparent as possible in relation the code that is making the REST call, which should do not more then this line:</p>
<pre><code>ResponseEntity
 responseEntity = restOperations.postForEntity(paypalProperties.getAdaptiveUrl(), entity, PaypalPayReply.class);
</code></pre>
<p>Also to keep non business related unit tests at a minium I need to eliminate any if else statements by pushing all type mapping decisions to spring.</p>
<h2>Solution Resources:</h2>
<p>In this part you will be using Spring <a href="http://static.springsource.org/spring-ws/sites/1.5/reference/html/oxm.html" target="_blank">OXM</a> and writing your own <a href="http://static.springsource.org/spring/docs/3.0.1.RELEASE/api/org/springframework/http/converter/HttpMessageConverter.html" target="_blank">HttpMessageConverter</a> to unmarshall the correct object back to the caller. All code is available at <a href="http://github.com/klclee/paypalAdaptive" target="_blank">github</a>.</p>
<h2>Paypal XML Success/Fail similarities:</h2>
<p>Both success and failure messages has a &#8216;responseEnvelope&#8217; element that contains a &#8216;ack&#8217; element which indicates Success or failure of the request. Take a look at <a href="http://github.com/klclee/paypalAdaptive/tree/master/src/main/java/rest/reply/PayResponse.java" target="_blank">this</a> (success) and <a href="http://github.com/klclee/paypalAdaptive/tree/master/src/main/java/rest/reply/PaypalFailure.java" target="_blank">this</a> (failure) Jaxb2 Objects. I use the &#8216;ack&#8217; element to determine different business rules.</p>
<h2>Setting up a custom HttpMessageConverter:</h2>
<p>The line of code you see in &#8216;solution objective&#8217;  returns PaypalPayReply interface, inorder for spring to know how to unmashall this we have to use a custom HttpMessageConverter. Implementing your own give you a chance to hook into the spring rest unmarshalling/marshalling process. The class that does this is at <a href="http://github.com/klclee/paypalAdaptive/tree/master/src/main/java/rest/reply/PaypalReplyHttpConvertor.java" target="_blank">rest.reply.PaypalReplyHttpConvertor</a>. Once you have set it up make sure you have added it to your spring config.</p>
<h2>Finally setting up OXM:</h2>
<p>In order for the the HttpMessageConverter to work properly you need to set up your OXM mapper, and its relative <a href="http://github.com/klclee/paypalAdaptive/blob/master/src/main/resources/spring-rest-template.xml" target="_blank">config</a> and code <a href="http://github.com/klclee/paypalAdaptive/blob/master/src/main/java/rest/reply/OXMapperImpl.java" target="_blank">here</a>.</p>
<p>Thats it the final piece of information is about paypal&#8217;s <a href="https://www.paypal.com/ipn">IPN</a> which you are likley to be using. When testing this make sure you always receive the related IPN message, otherwise paypal will degrade the frequency of messages and makes testing very difficult.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=110&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2010/09/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>52.215226 0.142449</georss:point>
		<geo:lat>52.215226</geo:lat>
		<geo:long>0.142449</geo:long>
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Paypal adaptive API and Spring 3 rest template — Part 2</title>
		<link>http://finker.wordpress.com/2010/08/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-2/</link>
		<comments>http://finker.wordpress.com/2010/08/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-2/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 09:57:31 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adaptive_Payments_API]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[rest_template]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[spring_3]]></category>

		<guid isPermaLink="false">http://blog.mushiengine.com/?p=102</guid>
		<description><![CDATA[So wellcome to part 2 This is where we start getting into the meat of the implementation. Assume you have set up the project described from part 1, this part will focus on getting the request done. All the code describe here can be found at my github account. So I wont write everything here and you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=102&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So wellcome to part 2 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This is where we start getting into the meat of the implementation. Assume you have set up the project described from <a href="http://blog.mushiengine.com/2010/08/24/paypal-adaptive-api-and-spring-3-rest-template-part-1/" target="_blank">part 1</a>, this part will focus on getting the request done.</p>
<p>All the code describe here can be found at my <a href="http://github.com/klclee/paypalAdaptive" target="_blank">github</a> account. So I wont write everything here and you can check out the code to work that out. Hopefully I have made the code descriptive enough to follow <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  if  not you can sent it  to <a href="http://refactormycode.com/" target="_blank">here</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h3>Set up your rest template definitions:</h3>
<p>Add this to your existing definition. The 2 convertors here are very useful. This tells spring to either use Jaxb2 or String when unmarshalling the data. Spring rest template will find the best fit for your needs.. this is very cool as it save loads of if statements and therefore some tests too <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  In part 3 this is also where we will add our custom converter definition:</p>
<pre><code>
&lt;bean id="restTemplate" class="org.springframework.web.client.RestTemplate"&gt;

&lt;property name="messageConverters"&gt;

&lt;list&gt;

&lt;bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter"/&gt;

&lt;bean class="org.springframework.http.converter.StringHttpMessageConverter"/&gt;

&lt;/list&gt;

&lt;/property&gt;

&lt;/bean&gt;
</code></pre>
<p><code> </code></p>
<h3>Go back to MainPost class:</h3>
<p>Add the following dependancy from RestTemplate</p>
<pre><code>
<div id="_mcePaste">@Autowired</div>
<div id="_mcePaste">private RestOperations restOperations;</div>

</code></pre>
<p>Then in makeRequest() you need to use the postForEntity method. This is because you need to set some custom headers for paypal and the only way you can do this is to create a <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/http/HttpEntity.html" target="_blank">HttpEntity</a> yourself. Have a look at the generateHttpHeader() in the <a href="http://github.com/klclee/paypalAdaptive/blob/master/src/main/java/rest/MainPost.java">code</a>. What you want at the end of a successful invocation is to get a paykey from paypal so you can finally construct  a URL to pass back to the browser for a redirect. From here also take a look at the DSOs for mapping the request to be send</p>
<p>On thing to note if the request fail it throws a <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/client/HttpStatusCodeException.html" target="_blank">HttpStatusCodeException</a> Runtime exception. This is different to how you will be use to if you used apache httpClient directly, even tho I am not sure I totally agree how spring deal with this but is good to know nonetheless.</p>
<p>Stay tune for part 3 where we will work with rest templates HttpConvertor</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=102&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2010/08/25/paypal-adaptive-api-and-spring-3-rest-template-%e2%80%94-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>52.215226 0.142449</georss:point>
		<geo:lat>52.215226</geo:lat>
		<geo:long>0.142449</geo:long>
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Paypal adaptive API and Spring 3 rest template &#8212; Part 1</title>
		<link>http://finker.wordpress.com/2010/08/24/paypal-adaptive-api-and-spring-3-rest-template-part-1/</link>
		<comments>http://finker.wordpress.com/2010/08/24/paypal-adaptive-api-and-spring-3-rest-template-part-1/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 10:00:19 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adaptive_Payments_API]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[rest_template]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[spring_3]]></category>

		<guid isPermaLink="false">http://blog.mushiengine.com/?p=79</guid>
		<description><![CDATA[Recently I have totally rewrote how we use paypal. Switching to use the newish adaptive payment API, and IPN. My serverside setup is using spring and recently switch to version 3 (if you haven&#8217;t heard about it for some reason try this link). One of the new things available for spring 3 is rest templates, very useful bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=79&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I have totally rewrote how we use paypal. Switching to use the newish <a href="https://www.x.com/community/ppx/adaptive_payments" target="_blank">adaptive payment API</a>, and <a href="https://www.paypal.com/ipn">IPN</a>. My serverside setup is using spring and recently switch to version 3 (if you haven&#8217;t heard about it for some reason try this <a href="http://www.infoq.com/presentations/Whats-New-in-Spring-3.0">link</a>). One of the new things available for spring 3 is <a href="http://blog.springsource.com/2009/03/27/rest-in-spring-3-resttemplate/" target="_blank">rest templates</a>, very useful bit of API. Allow you to use a range of binding API, I use JAXB2 and it comes working out of the box <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I am going to give a full example of how to use spring 3 rest template with adaptive payment API. This example will be split into 3 parts. First part is setting up your project. Second is making the request and finally unmarshalling the response back to a JAXB2 annotated object.</p>
<p>So without further deplay, lets get on with it!</p>
<h3>Setting up paypal:</h3>
<p>So I would expect you have a active paypal account. If not you will need one to carryon. Once you have that you will need to do the following to setup a sandbox envioment for you to test your implementation:</p>
<ul>
<li>Login to <a href="https://developer.paypal.com" target="_blank">developer.paypal.com</a> and set up some test accounts. You will need at lest one Seller account (so you can take payments) and one Buyer account (so you can make payments). I personally just use the preconfigured options as works well for me.</li>
<li>Once you have these accounts you can test them by login into <a href="https://www.sandbox.paypal.com/" target="_blank">sandbox.paypal.com</a> using your test accounts.</li>
<li>To set up to use the adaptive payment API you will need a API key.</li>
<li>Login to <a href="https://www.x.com/" target="_blank">x.com</a> using your normal paypal account.</li>
<li>Go to this <a href="https://www.x.com/community/ppx/testing" target="_blank">link</a> and follow the instructions</li>
<li>You do need to submit a application request that paypal will approve, but you can carry on testing while this is happening.</li>
</ul>
<h3>Setting up the project:</h3>
<p>I use eclipse helios with the IAM maven plugin. Here is my pom.xml</p>
<div id="_mcePaste">&lt;project xmlns=&#8221;http://maven.apache.org/POM/4.0.0&#8243; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;</div>
<div id="_mcePaste">xsi:schemaLocation=&#8221;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&#8221;&gt;</div>
<div id="_mcePaste">&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;paypalAdaptive&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;paypalAdaptive&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;</div>
<div id="_mcePaste">&lt;packaging&gt;jar&lt;/packaging&gt;</div>
<div id="_mcePaste">&lt;name&gt;paypalAdaptive&lt;/name&gt;</div>
<div id="_mcePaste">&lt;url&gt;http://maven.apache.org&lt;/url&gt;</div>
<div id="_mcePaste">&lt;properties&gt;</div>
<div id="_mcePaste">&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;</div>
<div id="_mcePaste">&lt;/properties&gt;</div>
<div id="_mcePaste">&lt;dependencies&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-core&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-context&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-beans&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-orm&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;spring-oxm&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;3.0.2.RELEASE&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<div id="_mcePaste">&lt;/dependencies&gt;</div>
<div id="_mcePaste">&lt;/project&gt;</div>
<div>I have added OXM as a dependancy tho is not strictly requires as you can define <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/http/converter/HttpMessageConverter.html" target="_blank">HTTP converts</a> that will marshall/unmarshall JAXB2 bean for you. However for this particular use we will have our own which will utilise oxm internally.</div>
<div>The other things you will need is your spring file. To start off with, this can be very simple, we will build more on it as we move into part 2/3. Here is what you should start with:</div>
<div>
<div>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</div>
<div>&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221;</div>
<div>xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;</div>
<div>xmlns:context=&#8221;http://www.springframework.org/schema/context&#8221;</div>
<div>xmlns:oxm=&#8221;http://www.springframework.org/schema/oxm&#8221;</div>
<div>xsi:schemaLocation=&#8221;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</div>
<div><span style="white-space:pre;"> </span>http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd</div>
<div><span style="white-space:pre;"> </span>http://www.springframework.org/schema/oxm</div>
<div><span style="white-space:pre;"> </span>http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd&#8221;&gt;</div>
<div>&lt;context:annotation-config/&gt;</div>
<div>&lt;/beans&gt;</div>
<div><span id="more-79"></span></div>
</div>
<div>Notice that I have added some namespaces here for oxm and context to support the good old @Autowired  annotation.</div>
<div>The last thing for this tutorial is to set up your Main application so you can run your settings. Something like this will be fine:</div>
<pre><code>
package rest;

public class MainPost {

	public String makeRequest(){
		System.out.println("Hello Paypal");
	}

	public static void main(String[] arg) {
		ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring-rest-template.xml");
		MainPost mainPost = (MainPost) ctx.getBean("rest");
		mainPost.makeRequest();
	}
}</code></pre>
<p>The only thing to note that this class is manage by spring. It has to else nothing will get injected otherwise.</p>
<p>Thats it for this part. Let continue to <a href="http://blog.mushiengine.com/2010/08/25/paypal-adaptive-api-and-spring-3-rest-template-%E2%80%94-part-2/" target="_blank">part 2</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=79&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2010/08/24/paypal-adaptive-api-and-spring-3-rest-template-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>52.215226 0.142449</georss:point>
		<geo:lat>52.215226</geo:lat>
		<geo:long>0.142449</geo:long>
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>setting up apache Shiro with CXF and Spring in a Social Context</title>
		<link>http://finker.wordpress.com/2010/01/30/setting-up-apache-shiro-with-cxf-and-spring-in-a-social-context/</link>
		<comments>http://finker.wordpress.com/2010/01/30/setting-up-apache-shiro-with-cxf-and-spring-in-a-social-context/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 15:07:11 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache Shiro]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Shiro]]></category>
		<category><![CDATA[social networking]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=64</guid>
		<description><![CDATA[Last week I needed to add some security on my CXF REST services. I have 2 main contenders Spring security or the new Apache Shiro. I ended up with Shiro but it have some particulars. This should save you some time! Common sense will tell me that Spring Security will be the default way forward [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=64&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I needed to add some security on my CXF REST services. I have 2 main contenders Spring security or the new <a href="http://incubator.apache.org/shiro/">Apache Shiro</a>. I ended up with Shiro but it have some particulars. This should save you some time!</p>
<p>Common sense will tell me that Spring Security will be the default way forward as it will slot neatly in the world of spring. However since the scared last year or so about Spring wanting to charge for bug fix releases I am now always looking for a back door just in case I get screwed. So I played with Shiro, a direct ancestor of JSecruity there are more then enough to have my end points secured. (That was the other thing Spring security was a bit too heavy weight for this purpose anyways)</p>
<p>On to setting things up.</p>
<h3>Installing the jars:</h3>
<p>At the time of writing Shiro haven&#8217;t made any major releases yet so is not available in maven repo. But you can download the source from their SVN and issues &#8216;mvn install&#8217; (or include &#8216;deploy&#8217; so it makes it into you own maven remote repos). After successful install you will find a few modules available for you. In my case I needed shiro-core, shiro-web, shiro-spring. O, i will also add &#8216;javadoc:javadoc&#8217;, it is very good especially if you want to know more about the IniShiroFilter</p>
<h3>Setting up your web.xml</h3>
<p>Apart form the normal CSF config. I use the &#8216;<a href="http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/web/filter/DelegatingFilterProxy.html">org.springframework.web.filter.DelegatingFilterProxy</a>&#8216;. This makes things cleaner as now you can leave web.xml and have everything done in the spring.xml</p>
<h3>Setting up the spring wiring.</h3>
<p>Saving me repeat myself. Have a look the shiro source you checked out. In &#8216;shiro-trunk/samples/spring&#8217; there is most of what you need. The only thing that is really missing is the IniShiroFilter config (In the sample it all use ShiroFilter instead, however if you read the javadoc it is deprecated and will be removed for version 1 release!). One thing that needs to be done in the IniShiroFilter Spring config you need to add the securityManager reference to the &#8216;securityManager&#8217; property i.e.:</p>
<p>&lt;bean id=&#8221;shiroFilter&#8221; class=&#8221;org.apache.shiro.web.servlet.IniShiroFilter&#8221;&gt;<br />
&lt;property name=&#8221;securityManager&#8221; ref=&#8221;securityManager&#8221;/&gt;</p>
<p>Otherwise it will throw a null pointer when you make a request.</p>
<p>The actual config of the filter itslef really depends on what you want to do and what you environments are. But before you go further I really recommend that you read the javadoc you have for IniShiroFilter, have a cup of something, think it over then make your move as it is really flexible! My REST services serves different front ends, flex, iphone, rails a and some calls are poxied to facebook, netlog, etc. So using their Standard Authentication filters is not very useful for me and i wrote my own and override isAccessAllow methods.</p>
<h3>If you are using a CustomAuthFilter</h3>
<p>I had to create my own AuthFilter cuz of the social network session pass throughs. This presented a problem. As the AuthFilter have to be inside the config property of the IniShrioFilter. At the moment it cannot use a spring bean. So if you are doing this and inside the filter  you want to use a spring bean you will need to do that yourself using the usual &#8216;<a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/context/ApplicationContext.html">ApplicationContext</a>&#8216; way.</p>
<h3>Avoiding the BASIC Authentication challenge Browser Popup</h3>
<p>Again this might not apply to you. However due to the hybride nature of the clients sending the BASIC challenge wasn&#8217;t great for my user experenience. All the apps provide a different experience when a 401 occurs (specially the flex apps in a browser). But if you use/extends one of the BasicHttpAuthenticationFilters this is the default behavior, when a 401 fails the browser gets the BASIC challenge then a dialog pops up for user name and password appears. to override this you can either over ride the &#8216;sendChallenge&#8217; method in your AuthFilter and don&#8217;t set a BASIC into the response header  or in your IniShiroFilter config add this to your filter &#8216;authFilter.authcScheme=NONE&#8217;. This way you client browser get a 401 but not a awful popup for user and pwd entry.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=64&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2010/01/30/setting-up-apache-shiro-with-cxf-and-spring-in-a-social-context/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>setting up ruby1.9 and rails on lenny</title>
		<link>http://finker.wordpress.com/2009/12/27/setting-up-ruby1-9-and-rails-on-lenny/</link>
		<comments>http://finker.wordpress.com/2009/12/27/setting-up-ruby1-9-and-rails-on-lenny/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 15:40:29 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby1.9]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=59</guid>
		<description><![CDATA[I was searching a round on how to get rails running on lenny which is our production OS. I have found this post to be really useful http://articles.slicehost.com/2009/4/9/debian-lenny-ruby-on-rails however the aptitude install statment fro ruby is for 1.8. After searching for the correct packages for 1.9 this is what I have: sudo aptitude install ruby1.9-dev [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=59&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was searching a round on how to get rails running on lenny which is our production OS. I have found this post to be really useful <a title="debian-lenny-ruby-on-rails" href="http://articles.slicehost.com/2009/4/9/debian-lenny-ruby-on-rails" target="_blank">http://articles.slicehost.com/2009/4/9/debian-lenny-ruby-on-rails</a> however the aptitude install statment fro ruby is for 1.8. After searching for the correct packages for 1.9 this is what I have:</p>
<pre><em>sudo aptitude install ruby1.9-dev ruby1.9 rdoc1.9 ri1.9 libreadline-ruby1.9 libruby1.9 libopenssl-ruby1.9 sqlite3 libsqlite3-ruby libsqlite-dev libsqlite3-dev</em></pre>
<p>It installs both 1.8 and 1.9 so i also added a soft link making sure that 1.9 is default:</p>
<pre><code>sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

</code></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=59&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2009/12/27/setting-up-ruby1-9-and-rails-on-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>the new &#8216;social&#8217; search engine</title>
		<link>http://finker.wordpress.com/2009/08/24/the-new-social-search-engine/</link>
		<comments>http://finker.wordpress.com/2009/08/24/the-new-social-search-engine/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 15:41:46 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[social networking]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=53</guid>
		<description><![CDATA[Recently I got a job to work for a company that makes apps for social network photo printing  call hotprints.. I dusted off the 2 applications I wrote to be run in facebook nearly 4 years  ago to remind myslef what I done and get reacquainted with my virtual social well being. I see how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=53&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I got a job to work for a company that makes apps for social network photo printing  call <a href="http://www.hotprints.com/" target="_blank">hotprints</a>.. I dusted off the 2 applications I wrote to be run in facebook nearly 4 years  ago to remind myslef what I done and get reacquainted with my virtual social well being. I see how much  facebook have moved on with their platform, now they have theses things call &#8216;pages&#8217; which is place where you can place your company mark on to the site. Members can become a fan and with the ability to add application to as tabs in the pages. Companies can relay on other company to increase exposure.. That all great but what does that meant to me as a web users?</p>
<p>I think this could fundamentally change our way of doing web search. Not only can I search for the things I am interested from something like google (gosh that so last year!) and gives me specific results of things that I can think of,  but I could potentially get more accurate result base on my <a href="http://www.readwriteweb.com/archives/social_graph_concepts_and_issues.php" target="_blank">social graph</a> even suggest related issues that I didn&#8217;t think of. <a href="http://en.wikipedia.org/wiki/Bing.com">Bing.com</a> says it can also share its searches to facebook.. I definitely want to have a go and see what I can do with the FB social graph and the pages integration to automatically gain a better understanding of my search preferences..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=53&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2009/08/24/the-new-social-search-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Grails, GWT, appengine to work.</title>
		<link>http://finker.wordpress.com/2009/07/24/getting-grails-gwt-appengine-to-work/</link>
		<comments>http://finker.wordpress.com/2009/07/24/getting-grails-gwt-appengine-to-work/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 09:26:11 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=49</guid>
		<description><![CDATA[The GWT grails plugin is great. I really like GWT and what it can do, plus the promise of Wave integration on both client and appengine should present some interesting possibilities. Working with grails is a breeze once there is a understanding of how it works setting up a site is fast fast fast So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=49&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The<a href="http://www.grails.org/plugin/gwt"> GWT grails plugin</a> is great. I really like <a href="http://code.google.com/webtoolkit/">GWT</a> and what it can do, plus the promise of <a href="http://wave.google.com/">Wave</a> integration on both client and <a href="http://code.google.com/appengine/">appengine</a> should present some interesting possibilities. Working with grails is a breeze once there is a understanding of how it works setting up a site is fast fast fast <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So I been working on using grails, appengine, GWT to work together.. This is what I done:</p>
<ul>
<li>create a grails app as normal &#8216;grails create-app&#8217;</li>
</ul>
<ul>
<li>installed the plugins I want. &#8216;grails install-plugin GWT&#8217; + &#8216;grails install-plugin app-engine&#8217;</li>
</ul>
<ul>
<li>write my GWT client as I would do in Java (under src/gwt). Setting up the Service Interfaces etc.</li>
</ul>
<ul>
<li>created a grails service to act as my GWT servlet as suggested (this bit i love as I don&#8217;t need to edit my web.xml)</li>
</ul>
<ul>
<li>create the html page &#8216;grails create-gwt-page &lt;page&gt;.html &lt;module&gt;</li>
</ul>
<ul>
<li>run the application using &#8216;grails app-engine run&#8217; (this bit works well too as it invokes the gwt complier, compiles my GWT app and places all files in the right place.. sweet..)</li>
</ul>
<ul>
<li>run the Hosted client &#8216;grails run-gwt-client&#8217; expecting things will slot in place</li>
</ul>
<ul>
<li>Doesn&#8217;t work <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
</ul>
<p>A few of things I noticed:</p>
<ul>
<li>When doing &#8216;grails app-engine run&#8217; (which will try to compile your GWT app) the gwt compiler compiles the application that sits under src/gwt but the classes do not get added to the classpath (the classes don&#8217;t get put into the classes dir) as grails only puts the classes in src/java. So when you use a GWT component the app blows up. By making sure classes under src/gwt gets compiled in grails solves the problem.</li>
</ul>
<ul>
<li>When creating the html page if you don&#8217;t add a sub directory as part of the page creation the gwt gets confuse with rpc calls.</li>
</ul>
<ul>
<li>Also the html page needs to be added into web.xml under src/templates/war as welcome-file-list tag like in a java base GWT application. If it don&#8217;t exist use &#8216;grails install-templates&#8217;</li>
</ul>
<ul>
<li>Finally if you include other GWT modules as jars (such as gwtext) it needs to be added to your classpath manually. When using &#8216;grails compile-gwt-modules&#8217; the script looks into lib/gwt and add the jars to classpath but if you action &#8216;grails app-engine run&#8217; it doesn&#8217;t look into lib/gwt (or gets overridden) tho it does invoke the gwt compiler.</li>
</ul>
<p>After doing this I have managed to login using the google&#8217;s appengine API and displays my app which is using <a href="http://code.google.com/p/gwt-ext/">gwtext</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=49&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2009/07/24/getting-grails-gwt-appengine-to-work/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickly get Maven2 to work with Google Eclipse Plugin</title>
		<link>http://finker.wordpress.com/2009/07/22/quickly-get-maven2-to-work-with-google-eclipse-plugin/</link>
		<comments>http://finker.wordpress.com/2009/07/22/quickly-get-maven2-to-work-with-google-eclipse-plugin/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:27:04 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=47</guid>
		<description><![CDATA[Trying to use maven2 and google eclipse plugin (for appengine and GWT) can be a little tricky. As the plugin insist to create a project structure that is not very maven like. The problem is in the &#8216;war&#8217; dir that is created under ${basedir}, maven need it to be in under src/main/webapp, if you force [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=47&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trying to use maven2 and <a href="http://code.google.com/eclipse/">google eclipse plugin</a> (for <a href="http://code.google.com/appengine/">appengine</a> and <a href="http://code.google.com/webtoolkit/">GWT</a>) can be a little tricky. As the plugin insist to create a project structure that is not very maven like. The problem is in the &#8216;war&#8217; dir that is created under ${basedir}, maven need it to be in under src/main/webapp, if you force the change (i.e. drag and drop) eclipse complain and will not run finally the plugin do not allow you reconfig.</p>
<p>But I would still like to use all the cool integrated feature that the plugin offers with maven2 for building.. so what to do :~</p>
<p>Tried using the maven war plugin and change the source dir that didn&#8217;t work. So all i done is to create a symbolic link from /src/main: ln -s ../../war/ webapp</p>
<p>that works.. not ideal tho if anyone find another way before I do please leave a comment&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=47&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2009/07/22/quickly-get-maven2-to-work-with-google-eclipse-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
		<item>
		<title>Configuring MUC room with XIFF</title>
		<link>http://finker.wordpress.com/2009/05/10/configuring-muc-room-with-xiff/</link>
		<comments>http://finker.wordpress.com/2009/05/10/configuring-muc-room-with-xiff/#comments</comments>
		<pubDate>Sun, 10 May 2009 10:17:46 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://finker.wordpress.com/?p=40</guid>
		<description><![CDATA[XMPP allows you to create new room on demand. In openfire set the service setting to allow anyone or a list of JID to do this. Then in XIFF create a new Room object with a JID that don&#8217;t exist on the server and do a room.join(). There you have yourself a new room with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=40&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>XMPP allows you to create new room on demand. In <a href="http://www.igniterealtime.org/projects/openfire/">openfire</a> set the service setting to allow anyone or a list of JID to do this. Then in XIFF create a new Room object with a JID that don&#8217;t exist on the server and do a <code>room.join()</code>. There you have yourself a new room with yourself in it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  When doing this openfire use default room configuration however sometimes you would like to have alternate configurations. Such as creating a private room with a password, or a room that is not listed in the directory so you have control on the people in there. This can all be done in <a href="http://www.igniterealtime.org/projects/xiff/index.jsp">XIFF</a>. Although the documentation is a little thin and the API isn&#8217;t very easy to work out on how to do it. So this is a mini guide on how can be done as I just manage to discover it myself after go through the source code.</p>
<p>So firstly create your new room in XIFF do something like this:</p>
<p><code><br />
public function createNewRoom():void{<br />
var room:Room = new Room(_xmppSocketConnection);<br />
//Add the event listener here for the join room event<br />
room.addEventListener(RoomEvent.ROOM_JOIN, config);<br />
room.roomJID = new JID("exDirectoryRoom@service.server.com");<br />
room.join();<br />
}<br />
</code></p>
<p>After joining the room this is where you exec a <code>room.configure</code> method. This method signature takes in <code>fieldmap:Object</code> so is not very intuitive.. emm.. Digging around in the source code this is the  <code>room.configure</code> implmentataion:</p>
<p><code><br />
public function configure(fieldmap:Object):void<br />
	    {<br />
	        var iq:IQ = new IQ(roomJID, IQ.SET_TYPE);<br />
	        var owner:MUCOwnerExtension = new MUCOwnerExtension();<br />
			var form:FormExtension;</p>
<p>			if (fieldmap is FormExtension) {<br />
				form = FormExtension(fieldmap);<br />
			} else {<br />
				form = new FormExtension();<br />
				fieldmap["FORM_TYPE"] = [MUCOwnerExtension.NS];<br />
				form.setFields(fieldmap);<br />
			}<br />
			form.type = FormExtension.SUBMIT_TYPE;<br />
			owner.addExtension(form);</p>
<p>	        iq.addExtension(owner);<br />
	        myConnection.send(iq);<br />
	    }<br />
</code></p>
<p>So you can pass in a FormExtension class with all the for var and value as of XMPP spec <a href="http://xmpp.org/extensions/xep-0045.html#createroom-instant">XEP-0045</a> or just pass in the var and values directly. If you are doing that the API again isn&#8217;t very clear on how this can be done but looking into the source of <code>FormExtension</code> the easiest way is to create a new Dictionary class and the key is the form variable. The value however <strong>MUST</strong> be an <strong>Array</strong>. So in my example I want the room to be ex-directory here is what to do:</p>
<p><code><br />
public function config(event:RoomEvent):void{<br />
 var fileds:Dictionary = new Dictionary();<br />
fileds["muc#roomconfig_publicroom"] = new Array(false);<br />
room.configure(fileds);<br />
}<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/finker.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/finker.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/finker.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=finker.wordpress.com&amp;blog=6069896&amp;post=40&amp;subd=finker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://finker.wordpress.com/2009/05/10/configuring-muc-room-with-xiff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ca71b072efc6f4b2e0c1116cffe42f5f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pepyscourt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
