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

<channel>
	<title>Software Passion &#187; Tools</title>
	<atom:link href="http://www.softwarepassion.com/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarepassion.com</link>
	<description>by Krzysztof Grajek</description>
	<lastBuildDate>Thu, 18 Mar 2010 17:46:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting started with Apache Click and Eclipse Galileo</title>
		<link>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/</link>
		<comments>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:42:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[apache click]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=356</guid>
		<description><![CDATA[Last couple of days I read here and there about Apache Click, which is now in version 2.1.0. It looks preety cool and easy to learn, so I decided to give it a try and see for myself.
I understand that its cool to learn things using vi and shell only, but when you tried many [...]]]></description>
			<content:encoded><![CDATA[<p>Last couple of days I read here and there about Apache Click, which is now in version 2.1.0. It looks preety cool and easy to learn, so I decided to give it a try and see for myself.<br />
I understand that its cool to learn things using vi and shell only, but when you tried many frameworks before, you know how things works, you just want to see how or how not, productive you can be with the new framework, thats why I jump straight to the IDE.<br />
And here, first surprise, with apache click its&#8217; not that easy, well, I&#8217;m mean its still easy but I have encountered a few problems, and right now I would like to share the solution.<br />
First of all, I did not tried all the examples in the apache click user guide yet, haven&#8217;t build anything usefull and definietly I&#8217;m not an Apache Click expert, I think I have figured out how to plug it to Eclipse and I think this is good start <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Here you have a few points to build your Apache Click IDE:<br />
1. First of all download latest and greatest Eclipse Galileo from <a href="http://www.eclipse.org/downloads/">here</a> &#8211; choose Eclipse for Java EE developers<br />
2. Download Apache Click libraries from <a href="http://click.apache.org/">here</a> &#8211; choose version 2.1.0<br />
3. Download Apache Click IDE from <a href="http://click.apache.org/docs/click-ide-downloads.html">here</a> &#8211; note that it contains Click version 1.5 and it was last updated in November 2008 &#8211; maybe I&#8217;m missing something here?<br />
4. Unzip your ClickIDE and copy the &#8216;features&#8217; and &#8216;plugins&#8217; folders into your Eclipse home directory<br />
5. Unzip your latest click libraries and keep it for later <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
6. Start your Eclipse IDE and create new &#8216;Dynamic Web Project&#8217;<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/dynamic_web_project.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/dynamic_web_project-254x300.jpg" alt="" title="dynamic_web_project" width="254" height="300" class="aligncenter size-medium wp-image-361" /></a><br />
Choose target name, in this case &#8216;ClickDemo2&#8242;, select your target runtime as Tomcat 6+ etc.<br />
7. Under configuration combo box, select custom and click &#8216;Modify&#8217;<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config-300x265.jpg" alt="" title="custom_click_config" width="300" height="265" class="aligncenter size-medium wp-image-359" /></a><br />
8. Select &#8216;Click&#8217; in Project Facet List and save the configuration as click config<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/click_config.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/click_config-300x232.jpg" alt="" title="click_config" width="300" height="232" class="aligncenter size-medium wp-image-357" /></a><br />
9. Once you have your configuration created, dynamic web project screen should look like in the following screenshot:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config2.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config2-255x300.jpg" alt="" title="custom_click_config2" width="255" height="300" class="aligncenter size-medium wp-image-360" /></a><br />
10. The rest of the settings you can leave as it is, just click &#8216;Next&#8217; up to the point when you finish creating new dynamic web project.<br />
11. After your project is created it will have the structure like in the following screen:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/clickdemo_project_structure.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/clickdemo_project_structure-274x300.jpg" alt="" title="clickdemo_project_structure" width="274" height="300" class="aligncenter size-medium wp-image-358" /></a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Notice that there are click libraries from version 1.5, which is no good, we want to use the latest version which is 2.1.0.<br />
12. Copy the files &#8216;click-2.1.0.jar&#8217; and &#8216;click-extras-2.1.0.jar&#8217; into the same lib folder where the old libraries are found.<br />
13. Delete old libraries and refresh the project tree under eclipse (right click on the project node and select &#8216;Refresh&#8217;), now you will see the new libraries come up in the lib folder.<br />
14. Open your web.xml file under &#8216;WebContent/WEB-INF/&#8217; folder and change the class name of the main Click Servlet, from &#8216;net.sf.click.ClickServlet&#8217; to &#8216;org.apache.click.ClickServlet&#8217; in &#8217;servlet-class&#8217; declaration.<br />
15. With Eclipse, select the project node and click &#8216;New&#8217; -> &#8216;Other&#8217;, choose &#8216;Click Page&#8217; under &#8216;click&#8217; directory.<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page-300x285.jpg" alt="" title="new_click_page" width="300" height="285" class="aligncenter size-medium wp-image-362" /></a><br />
16. Fill out the necessary fields for your new click page as below:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page2.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page2-264x300.jpg" alt="" title="new_click_page2" width="264" height="300" class="aligncenter size-medium wp-image-363" /></a><br />
17. Name the file &#8216;index.htm&#8217; and click &#8216;Finish&#8217;<br />
18. Under the page java source file, fix the Page class by using the page from the: org.apache.click.Page instead of the old path.</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">package</span> <span class="co2">com.softwarepassion</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">java.util.Date</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">org.apache.click.Page</span><span class="sy0">;</span><br />
<br />
<br />
<span class="kw1">public</span> <span class="kw1">class</span> Index <span class="kw1">extends</span> Page <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a> time <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">public</span> Index<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; addModel<span class="br0">&#40;</span><span class="st0">&quot;time&quot;</span>, time<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
<span class="br0">&#125;</span></div></div>
<p>Modify your &#8216;index.htm&#8217; using html editor to look something like this:</p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;width:535px"><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/meta.html"><span class="kw2">META</span></a> <span class="kw3">HTTP-EQUIV</span><span class="sy0">=</span><span class="st0">&quot;Content-Type&quot;</span> <span class="kw3">CONTENT</span><span class="sy0">=</span><span class="st0">&quot;text/html;charset=UTF-8&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span>Blank<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span><br />
&nbsp; &nbsp; $imports<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
&nbsp; $time<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span></div></div>
<p>19. Start up your project in tomcat. The page should display current time!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Additional Comments:<br />
I know that this is just a quickfix, and I just cannot belive that there is no proper eclipse plugin using the latest click framework, which would be up to date, if you know any, than please comment and save me and my readers precious time.</p>
<p>Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Jasperberry &#8211; the most dynamic reports ever.</title>
		<link>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/</link>
		<comments>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:03:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[jasperberry]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=350</guid>
		<description><![CDATA[Today I will describe in short my latest and simplest quick and dirty trick, generating jasper report dynamically. Jasperberry is a component written very quickly to help me
generate pdf report in a situation where I don&#8217;t know the number of columns I will have, I don&#8217;t know their widths, the data they contain etc, all [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will describe in short my latest and simplest quick and dirty trick, generating jasper report dynamically. Jasperberry is a component written very quickly to help me<br />
generate pdf report in a situation where I don&#8217;t know the number of columns I will have, I don&#8217;t know their widths, the data they contain etc, all is generated at runtime dynamically.<br />
I know that there is DynamicJasper project but it seems to be dead, and its dead in a very strange way, I mean, I see that the authors commit new code but there is no chance to get any support unless, I guess, you pay for it.<br />
With dynamic jasper I couldn&#8217;t generate report with polish fonts displayed properly, tried many different tricks, no support on the forum, no support on stack overflow, no nothing. After 2 days I have realized that I will write my own library quicker to solve my problem than get an answer from the dynamic jasper community (if there is any).<br />
So here we have: jasperberry!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Don&#8217;t expect too much from it but if you want to display simple table with data, dynamic columns, adjustable fonts and colors than this is it.</p>
<p>In fact you don&#8217;t have to even know object properties to generate the report, we will use Apache DynaBeans for that:</p>
<p>This is a simple example code snipped showing you how to get started with the simplest and most dynamic reporting library ever (as well as lacking features probably but we hope its enough for simple projects)</p>
<p>This example assumes the following:</p>
<p>1. You want simple report<br />
2. You dont have to know the object which properties you want to display in advance, by this I mean you can create report columns dynamically, and by using apache dyna beans your objects don&#8217;t have to even exists. You just dynamically create them and inject them into the report.</p>
<p>Here is an example test class showing you how to use jasperberry, for more info please contact us directly at softberries.com<br />
Code:</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">public</span> <span class="kw1">class</span> JRXMLBuilderTest <span class="br0">&#123;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw1">static</span> List<span class="sy0">&lt;</span>JBColumnBean<span class="sy0">&gt;</span> columns<span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">public</span> JRXMLBuilderTest<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @BeforeClass<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> setUpClass<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>JBColumnBean<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col1 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col2 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col3 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col4 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col5 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col6 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col7 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Imię&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;surname&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Nazwisko&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">160</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment2&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment3&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment4&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment5&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col1<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col2<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col3<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col4<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col5<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col6<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col7<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @AfterClass<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> tearDownClass<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @Before<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setUp<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @After<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> tearDown<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="co3">/** * Test of build method, of class JRXMLBuilder. */</span><br />
&nbsp; &nbsp; @Test<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> testBuild<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;build&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<span class="sy0">&lt;</span>JBReportElement<span class="sy0">&gt;</span> elements <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>JBReportElement<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//col header font </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont colHeaderFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setBold</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#555555&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//detail font </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont detailFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#000000&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setPdfEncoding</span><span class="br0">&#40;</span><span class="st0">&quot;Cp1257&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBPage page <span class="sy0">=</span> <span class="kw1">new</span> JBPage<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBReport report <span class="sy0">=</span> <span class="kw1">new</span> JBReport<span class="br0">&#40;</span>page, colHeaderFont, detailFont, <span class="st0">&quot;#CCCCFF&quot;</span>, <span class="st0">&quot;#DEDEDE&quot;</span>, <span class="st0">&quot;#FFFFFF&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont titleFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setBold</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">20</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#FF0000&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setPdfEncoding</span><span class="br0">&#40;</span><span class="st0">&quot;Cp1257&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//add title elements </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elements.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> JBStaticTextElement<span class="br0">&#40;</span><span class="st0">&quot;Hello World!&quot;</span>, <span class="nu0">450</span>, <span class="nu0">10</span>, <span class="nu0">300</span>, titleFont<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elements.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> JBImageElement<span class="br0">&#40;</span><span class="st0">&quot;C:<span class="es0">\\</span><span class="es0">\\</span>Documents and Settings<span class="es0">\\</span><span class="es0">\\</span>admin<span class="es0">\\</span><span class="es0">\\</span>Moje dokumenty<span class="es0">\\</span><span class="es0">\\</span>NetBeansProjects<span class="es0">\\</span><span class="es0">\\</span>JASPER_BERRY<span class="es0">\\</span><span class="es0">\\</span>test.jpg&quot;</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">350</span>, <span class="nu0">242</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; report.<span class="me1">setTitleElements</span><span class="br0">&#40;</span>elements<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JRXMLBuilder instance <span class="sy0">=</span> <span class="kw1">new</span> JRXMLBuilder<span class="br0">&#40;</span>columns, report<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> expResult <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> result <span class="sy0">=</span> instance.<span class="me1">build</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperReport jr <span class="sy0">=</span> JasperCompileManager.<span class="me1">compileReport</span><span class="br0">&#40;</span><span class="st0">&quot;jasperberry_by_softberries.jrxml&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//PREPARE SOME DATA </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DynaProperty<span class="br0">&#91;</span><span class="br0">&#93;</span> props <span class="sy0">=</span> <span class="kw1">new</span> DynaProperty<span class="br0">&#91;</span>columns.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> columns.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; props<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw1">new</span> DynaProperty<span class="br0">&#40;</span>columns.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getProperty</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BasicDynaClass dynaClass <span class="sy0">=</span> <span class="kw1">new</span> BasicDynaClass<span class="br0">&#40;</span><span class="st0">&quot;tester&quot;</span>, <span class="kw2">null</span>, props<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<span class="sy0">&lt;</span>DynaBean<span class="sy0">&gt;</span> beans <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>DynaBean<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> <span class="nu0">100</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DynaBean db <span class="sy0">=</span> dynaClass.<span class="me1">newInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;name&quot;</span>, <span class="st0">&quot;Krzysztof &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;surname&quot;</span>, <span class="st0">&quot;Grajek &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment2&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment3&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment4&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment5&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beans.<span class="me1">add</span><span class="br0">&#40;</span>db<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperPrint jp <span class="sy0">=</span> JasperFillManager.<span class="me1">fillReport</span><span class="br0">&#40;</span>jr, <span class="kw2">null</span>, <span class="kw1">new</span> JRBeanCollectionDataSource<span class="br0">&#40;</span>beans<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperExportManager.<span class="me1">exportReportToPdfFile</span><span class="br0">&#40;</span>jp, <span class="st0">&quot;jasperberry.pdf&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assertEquals<span class="br0">&#40;</span>expResult, result<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Logger.<span class="me1">getLogger</span><span class="br0">&#40;</span>JRXMLBuilderTest.<span class="kw1">class</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">log</span><span class="br0">&#40;</span>Level.<span class="me1">SEVERE</span>, <span class="kw2">null</span>, ex<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></div>
<p>You should find similar snippet in a test suite of the project.<br />
The project itself is licensed under LGPL and its available from sourceforge <a href="http://sourceforge.net/projects/jasperberry/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Free file sharing service based on Amazon S3</title>
		<link>http://www.softwarepassion.com/free-file-sharing-service-based-on-amazon-s3/</link>
		<comments>http://www.softwarepassion.com/free-file-sharing-service-based-on-amazon-s3/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 16:56:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=140</guid>
		<description><![CDATA[A short note about a brand new rapidshare competition based on Amazon S3 called Storage For Free (www.storage43.com). Without registration you can share here your project files or basically anything you want to share quickly (up to 200 MB no registration required and the file is alive on the server for 30 days), if you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.softwarepassion.com/wp-content/storage-300x167.png" alt="storage" title="storage" width="300" height="167" class="alignleft size-medium wp-image-141" /><br/>A short note about a brand new rapidshare competition based on Amazon S3 called Storage For Free (<a href="http://www.storage43.com">www.storage43.com</a>). Without registration you can share here your project files or basically anything you want to share quickly (up to 200 MB no registration required and the file is alive on the server for 30 days), if you are still unhappy you can register for free and get 500MB for a single upload. This is another service that proves growing popularity of Amazon Web Services which in my opinion are great!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/free-file-sharing-service-based-on-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Continuous Integration with CruiseControll.NET</title>
		<link>http://www.softwarepassion.com/continuous-integration-with-cruisecontrollnet/</link>
		<comments>http://www.softwarepassion.com/continuous-integration-with-cruisecontrollnet/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 13:10:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=89</guid>
		<description><![CDATA[Today I will try to bite quite a big topic which is continuous integration setup for .NET application build using Visual Studio 2008, Vistual Studio Unit Tests and Cruise Control.NET.
Continuous integration, in a few simple words works the following way: there are a number of developers working on a project, developers use subversion or other [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will try to bite quite a big topic which is continuous integration setup for .NET application build using Visual Studio 2008, Vistual Studio Unit Tests and Cruise Control.NET.<br />
Continuous integration, in a few simple words works the following way: there are a number of developers working on a project, developers use subversion or other code versioning system to manage their source code. When they work on the project they commit changes to the subversion repo and from the other side another part of the process called &#8216;continuous integration server&#8217; checks this code out every few minutes, and tries to build it and run unit tests on it, to see if it is so far all ok.<br />
That was probably the shortest description  of continuous integration process you would ever be able to find on the internet <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>So, how do you set up your own? Well, actually its not that difficult but looks scary at the frist sight. First of all of course, you would have to download and install all software needed, and this is:</p>
<ul>
<ol><a href="http://msdn.microsoft.com/en-us/visualc/aa700831.aspx">Visual Studio 2008</a></ol>
<ol><a href="http://subversion.tigris.org/">Subversion</a></ol>
<ol><a href="http://tortoisesvn.tigris.org/">Tortoise</a> or <a href="http://ankhsvn.open.collab.net/">Ankh SVN(recommended)</a></ol>
<ol><a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET">CruiseControl .NET</a></ol>
</ul>
<p>That should be it on the server side! While installing just follow the defaults and you should be fine. I do install Cruise Control directly on the C: drive which ends up as C:CruiseControl.NET but you can install it wherever you want, I do it this way as its easier for me to write scripts if neccessary (short pathes instead of long ones).</p>
<p>Once CC.NET is installed you should be able to run it. You have two options, first one run it as a console app or run it as a service. For the setup, I would recommend running it as a console, make sure that CC.NET service is not running and double click ccnet.exe file inside C:CruiseControl.NETserver directory or any other &#8217;server&#8217; directory depending on your installation path.<br />
If all went fine you can see the CC.NET dashboard in your browser. Just browse to the url &#8216;http://localhost/ccnet&#8217; where &#8216;ccnet&#8217; is a virtual directory created by Cruise Control application setup.<br />
<img src="http://www.softwarepassion.com/wp-content/uploads/capture1-300x100.png" alt="capture1" title="capture1" width="300" height="100" class="aligncenter size-medium wp-image-94" /></p>
<p>Ok then, once all is runnning and installed we can start configuring our CC server. To do that you would need to open ccnet.config file in your favourite text editor. Inside ccnet.config you will be able to set your project which should be build and tested by Cruise Control. The ccnet.config file consist of a number of project sections. You can have as many &#8216;project sections as you wish, all contained inside the root element of the document.</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;cruisecontrol</span> <span class="re0">xmlns:cb</span>=<span class="st0">&quot;urn:ccnet.config.builder&quot;</span><span class="re2">&gt;</span></span><br />
<br />
&nbsp; <span class="sc3"><span class="re1">&lt;project</span> <span class="re0">name</span>=<span class="st0">&quot;Project One&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/project<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; <span class="sc3"><span class="re1">&lt;project</span> <span class="re0">name</span>=<span class="st0">&quot;Project Two&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/project<span class="re2">&gt;</span></span></span><br />
<br />
<span class="sc3"><span class="re1">&lt;/cruisecontrol<span class="re2">&gt;</span></span></span></div></div>
<p>Lets configure one of the projects, all elements described above would be a subnodes of the project element. First of all we need to specify a working directory for our project. Simply create a dir on your drive somewhere and add a path to it between &#8216;workingDirectory&#8217; elements. This directory will be used to download the subversion sources.</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;workingDirectory<span class="re2">&gt;</span></span></span>c:projectone<span class="sc3"><span class="re1">&lt;/workingDirectory<span class="re2">&gt;</span></span></span></div></div>
<p>After we specify &#8216;workingDirectory&#8217; we have to specify a trigger which will call updates on our source code, checked out form the subversion. Right here we specify that CC.NET should check the subversion repo every 60 seconds and if it finds any modifications it should run the whole continuous integration process.</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;triggers<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;intervalTrigger</span> <span class="re0">seconds</span>=<span class="st0">&quot;60&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/triggers<span class="re2">&gt;</span></span></span></div></div>
<p>To allow cruise controll download/update your sources, we need to specify the adress of the subversion repository as well as username and password</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc-1">&lt;!--set the sourcecontrol type to subversion and point to the subversion exe--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;sourcecontrol</span> <span class="re0">type</span>=<span class="st0">&quot;svn&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;executable<span class="re2">&gt;</span></span></span>C:Program FilesSubversionbinsvn.exe<span class="sc3"><span class="re1">&lt;/executable<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;workingDirectory<span class="re2">&gt;</span></span></span>C:projectone<span class="sc3"><span class="re1">&lt;/workingDirectory<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;trunkUrl<span class="re2">&gt;</span></span></span>http://svn_server.com/projectone<span class="sc3"><span class="re1">&lt;/trunkUrl<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;autoGetSource<span class="re2">&gt;</span></span></span>true<span class="sc3"><span class="re1">&lt;/autoGetSource<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;username<span class="re2">&gt;</span></span></span>your_username<span class="sc3"><span class="re1">&lt;/username<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;password<span class="re2">&gt;</span></span></span>your_password<span class="sc3"><span class="re1">&lt;/password<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/sourcecontrol<span class="re2">&gt;</span></span></span></div></div>
<p>This section was pretty easy, after we specify working directory, trigger and subversion settings we are ready to add sections responsible for building, testing and publishing our results.<br />
All of the mentioned should happen inside the &#8216;tasks&#8217; section so, just after the &#8217;sourcecontrol&#8217; element add the following:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;tasks<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/tasks<span class="re2">&gt;</span></span></span></div></div>
<p>Inside the &#8216;tasks&#8217; we will add the elements for building the project/solution (msbuild element), unit testing (2 times &#8216;exec&#8217; element), publishing our work to a separate directory (&#8216;buildpublisher&#8217; element) as well as publish our test results to CC.NET dashboard (&#8216;publishers&#8217; element).</p>
<p>To do all that, we need to first build our project. We are going to use MSBuild.exe which you should be able to find in C:WINDOWSMicrosoft.NETFrameworkv3.5 if you are using .NET 3.5 version. Instead of building single project we are going to build a whole solution. To build a solution you need to specify the place where the solution file exists as well as the name of the solution file itself. Depending on the project size and characteristics you have to set the timeout option to suit your needs and to prevent CC.NET to timeout before the project have a chance to actually build.</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc-1">&lt;!-- Configure MSBuild to compile the updated files --&gt;</span>c:<br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;msbuild<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;executable<span class="re2">&gt;</span></span></span>C:WINDOWSMicrosoft.NETFrameworkv3.5MSBuild.exe<span class="sc3"><span class="re1">&lt;/executable<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;workingDirectory<span class="re2">&gt;</span></span></span>C:projectonetrunk<span class="sc3"><span class="re1">&lt;/workingDirectory<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;projectFile<span class="re2">&gt;</span></span></span>projectOne.sln<span class="sc3"><span class="re1">&lt;/projectFile<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;buildArgs<span class="re2">&gt;</span></span></span>/noconsolelogger /p:Configuration=Debug<span class="sc3"><span class="re1">&lt;/buildArgs<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;targets<span class="re2">&gt;</span></span><span class="re1">&lt;/targets<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;timeout<span class="re2">&gt;</span></span></span>300<span class="sc3"><span class="re1">&lt;/timeout<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;logger<span class="re2">&gt;</span></span></span>C:CruiseControl.NETwebdashboardbinThoughtWorks.CruiseControl.MsBuild.dll<span class="sc3"><span class="re1">&lt;/logger<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/msbuild<span class="re2">&gt;</span></span></span></div></div>
<p>Ok, so we are already able to automatically build our project and this is really cool but what would be continuous integration without executing unit tests <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . As it makes development easier, for my projects, wherever possible I use built in Unit Test functionality in Visual Studio 2008.In my opinion, VS Unit Tests are a bit more tricky to set up than NUnit on CC.NET, especially publishing results part of it) but the developmnet on the other hand is easier and I will stick to it.<br />
We need to do the following three things to properly execute tests. First of all we need to run tests using MSTest.exe, this part is pretty easy but before doing that we need to delete previous test results or otherwise our MSTest would complain. Therefore you have to add into your tasks the two following &#8216;exec&#8217; sections.<br />
First one to delete any previouse test results using bat file (deleteTestLog.bat) with single command:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace">DEL C:projectoneresults.trx</div></div>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;exec<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;executable<span class="re2">&gt;</span></span></span>deleteTestLog.bat<span class="sc3"><span class="re1">&lt;/executable<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;baseDirectory<span class="re2">&gt;</span></span></span>C:CruiseControl.NETserver<span class="sc3"><span class="re1">&lt;/baseDirectory<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;buildArgs<span class="re2">&gt;</span></span><span class="re1">&lt;/buildArgs<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;buildTimeoutSeconds<span class="re2">&gt;</span></span></span>30<span class="sc3"><span class="re1">&lt;/buildTimeoutSeconds<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/exec<span class="re2">&gt;</span></span></span></div></div>
<p>Second &#8216;exec&#8217; section running the actual unit tests:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;exec<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc-1">&lt;!--Call mstest to run the tests contained in the TestProject --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;executable<span class="re2">&gt;</span></span></span>mstest.exe<span class="sc3"><span class="re1">&lt;/executable<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;baseDirectory<span class="re2">&gt;</span></span></span>C:projectonetrunkprojectOneTests<span class="sc3"><span class="re1">&lt;/baseDirectory<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc-1">&lt;!--testcontainer: points to the DLL that contains the tests --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc-1">&lt;!--runconfig: points to solutions testrunconfig that is created by vs.net, list what test to run --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc-1">&lt;!--resultsfile: normally the test run log is written to the uniquely named testresults directory &nbsp;--&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc-1">&lt;!-- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this option causes a fixed name copy of the file to be written as well --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;buildArgs<span class="re2">&gt;</span></span></span>/testcontainer:C:projectonetrunkprojectOneTestsBinDebugprojectOneTests.dll /resultsfile:C:projectoneresults.trx<span class="sc3"><span class="re1">&lt;/buildArgs<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;buildTimeoutSeconds<span class="re2">&gt;</span></span></span>90<span class="sc3"><span class="re1">&lt;/buildTimeoutSeconds<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/exec<span class="re2">&gt;</span></span></span></div></div>
<p>Right now our server builds and tests our solution automatically. If we want to publish the build results somewhere else, lets say to another virtual directory or web site we can copy the files using &#8216;buildPublisher&#8217;. This way, if its a web application, after each build you can browse to the web site url and see the latest changes in place, all freshly build and tested.</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;buildpublisher<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;sourceDir<span class="re2">&gt;</span></span></span>C:projectonetrunkprojectOne<span class="sc3"><span class="re1">&lt;/sourceDir<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;publishDir<span class="re2">&gt;</span></span></span>D:projectOnePublished<span class="sc3"><span class="re1">&lt;/publishDir<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;useLabelSubDirectory<span class="re2">&gt;</span></span></span>false<span class="sc3"><span class="re1">&lt;/useLabelSubDirectory<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/buildpublisher<span class="re2">&gt;</span></span></span></div></div>
<p>At this point we have a continuous integration server running which automatically update our solution if it detects any changes on subversion server, builds the sources, runs unit tests and publish the build results. This is great, one problem though, MSTest is not well integrated into CC.NET so we won&#8217;t be able to see our tests results, if any fails for e.g. on our CC dashboard.<br />
To publish your test results into cruise control dashboard you would need to add the following section inside your &#8216;project&#8217;, just after &#8216;exec&#8217; or &#8216;buildPublisher&#8217; sections:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc-1">&lt;!--Publishers will be done after the build has completed--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;publishers<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;merge<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;files<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;file<span class="re2">&gt;</span></span></span>results.trx<span class="sc3"><span class="re1">&lt;/file<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/files<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/merge<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;xmllogger</span> <span class="re0">logDir</span>=<span class="st0">&quot;C:CruiseControl.NETserverProjectOneArtifactsbuildlogs&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/publishers<span class="re2">&gt;</span></span></span></div></div>
<p>This will merge your test results into the dashboard. </p>
<p>I hope you will enjoy having continuous integration as part of your project building flow. Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/continuous-integration-with-cruisecontrollnet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Affirma S3 library for C#</title>
		<link>http://www.softwarepassion.com/affirma-s3-library-for-c/</link>
		<comments>http://www.softwarepassion.com/affirma-s3-library-for-c/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 12:20:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=70</guid>
		<description><![CDATA[Finally I have found S3 library that works in C#. The library was written by Joel Wetzel from Affirma Consulting and I just wanted to spread the word about it.
Once downloaded you are presented with the whole C# Visual Studio solution which contains the library project as well as some example on how to use [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I have found S3 library that works in C#. The library was written by Joel Wetzel from Affirma Consulting and I just wanted to spread the word about it.<br />
Once downloaded you are presented with the whole C# Visual Studio solution which contains the library project as well as some example on how to use it.<br />
There is even a simple wrapper written which greatly simplyfies the use of the affirma&#8217;s library.<br />
As an example:<br />
1. Create wrapper object (constructor listed)</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">public ThreeSharpWrapper(String awsAccessKeyId, String awsSecretAccessKey)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.config = new ThreeSharpConfig();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.config.AwsAccessKeyID = awsAccessKeyId;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.config.AwsSecretAccessKey = awsSecretAccessKey;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.service = new ThreeSharpQuery(this.config);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</div></div>
</pre>
<p>and then use it having the following methods:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">/// Adds a bucket to an S3 account<br />
public void AddBucket(String bucketName);<br />
<br />
&nbsp;/// Returns a string of XML, describing the contents of a bucket<br />
public String ListBucket(String bucketName);<br />
<br />
/// Adds a string to a bucket, as an object<br />
public void AddStringObject(String bucketName, String keyName, String data);<br />
<br />
/// Streams a file to a bucket as an object<br />
public void AddFileObject(String bucketName, String keyName, String localfile);<br />
<br />
/// Streams a file to a bucket as an object, with encryption<br />
public void AddEncryptFileObject(String bucketName, String keyName, String localfile, String encryptionKey, String encryptionIV);<br />
<br />
/// Gets a string object from a bucket, and returns it as a String<br />
public String GetStringObject(String bucketName, String keyName);<br />
<br />
/// Gets a file object from a bucket, and streams it to disk<br />
public void GetFileObject(String bucketName, String keyName, String localfile);<br />
<br />
/// Gets a file object from a bucket, streaming it to disk, with decryption<br />
public void GetDecryptFileObject(String bucketName, String keyName, String localfile, String encryptionKey, String encryptionIV);<br />
<br />
/// Copies an object from a source location to a destination location<br />
public void CopyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey);<br />
<br />
/// Generates a URL to access an S3 object in a bucket<br />
public String GetUrl(String bucketName, String keyName);<br />
<br />
/// Deletes an object from a bucket<br />
public void DeleteObject(String bucketName, String keyName);<br />
<br />
/// Deletes a bucket from an S3 account<br />
public void DeleteBucket(String bucketName);<br />
<br />
/// Changes the request payer value for the specified bucket<br />
public String PaymentChange(String bucketName, PaymentChangeRequest.Payer payer);<br />
<br />
/// Gets the request payer value for the specified bucket<br />
public String PaymentGet(String bucketName);</div></div>
</pre>
<p>The library is dead easy to use and most importantly it works (comparing to other S3 libraries I&#8217;ve found). Great work Joel!<br />
You can download the solution zip from <a href="http://storage43.com/file/show/47">here</a> or directly from the codeplex hosting the project <a href="http://threesharp.codeplex.com/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/affirma-s3-library-for-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux simple backup with FTP</title>
		<link>http://www.softwarepassion.com/linux-simple-backup-with-ftp/</link>
		<comments>http://www.softwarepassion.com/linux-simple-backup-with-ftp/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 07:11:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=55</guid>
		<description><![CDATA[This is my first post under new domain &#8217;softwarepassion.com&#8217;. I&#8217;m planning to blog more from now on as I have loads of new things to blog about  .
Today I will present you with simple backup shell script I have running on one of my servers. The script is damn easy and all it does [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first post under new domain &#8217;softwarepassion.com&#8217;. I&#8217;m planning to blog more from now on as I have loads of new things to blog about <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
Today I will present you with simple backup shell script I have running on one of my servers. The script is damn easy and all it does is:</p>
<ol>
<li>remove any earlier backup dirs and create new empty one</li>
<li>create mysql dump for the applications you want to backup</li>
<li>create tar.gz of the entire home directory</li>
<li>create tar.gz of the apache director to preserve settings </li>
<li>create tar.gz of everything I&#8217;ve created earlier to place everything in a single file</li>
<li>ftp the file to a backup server</li>
</ol>
<p>Lets start with the first task. Removing and creating dirs is pretty simple:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">rm -Rf /root/temp_bckp<br />
mkdir /root/temp_bckp</div></div>
</pre>
<p>Creating mysql backup we can do the easiest using mysqldump utility. The command for this is:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mysqldump --user=your_db_user your_db_name &gt; /root/temp_bckp/your_Db_name.sql --password=your_db_password<br />
echo 'sql dump finished'</div></div>
</pre>
<p>Once we got all dumps in place we can start compressing home and apache directories directory:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">tar -zcvf /root/temp_bckp/home_bckp.tar.gz /home<br />
echo 'tar of home finished'<br />
<br />
tar -zcvf /root/temp_bckp/etcapache.tar.gz /etc/apache2/<br />
echo 'tar of etc/apache finished'</div></div>
</pre>
<p>Somwhere at the top of the script we store current date as a variable and we use it to name the final backup archive:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">DATEX=`date +%d%m%y`</div></div>
</pre>
<p>Final backup archive:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">tar -zcvf /root/temp_bckp_$DATKA.tar.gz /root/temp_bckp<br />
echo 'tar of all finished'</div></div>
</pre>
<p>When we have all zipped together we are ready to send it over to the ftp backup server, I use ncftp utility which you can easily get on debian based distros using apt-get install ncftp or aptitude install ncftp.</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">ncftpput -u ftp_user -p ftp_password your-ftp-domain.com . temp_bckp_$DATKA.tar.gz<br />
echo 'ftp finished'</div></div>
</pre>
<p>For ftp server I personally use Linode services which are very cheap in the basic package, you can check their offers <a href="http://www.linode.com">here</a></p>
<p>Complete shell script you can download from storage43 under this <a href="http://storage43.com/file/show/46">link</a><br />
Happy backuping <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/linux-simple-backup-with-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where to analyse your traffic</title>
		<link>http://www.softwarepassion.com/where-to-analyse-your-traffic/</link>
		<comments>http://www.softwarepassion.com/where-to-analyse-your-traffic/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 08:36:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=40</guid>
		<description><![CDATA[I&#8217;m a big fan of tools which lets you analyze traffic on your website. I think everyone knows the Google Analitycs tool which is my favourite, althought I never had time to properly learn, how to use it (by the way any links to nice tutorials are welcome).Here I list theree tools I have my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of tools which lets you analyze traffic on your website. I think everyone knows the Google Analitycs tool which is my favourite, althought I never had time to properly learn, how to use it (by the way any links to nice tutorials are welcome).<br />Here I list theree tools I have my websites registered with:</p>
<p><span style="font-weight: bold;">Number 1. Google Analitycs</span></p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.google.com/analytics"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 206px;" src="http://1.bp.blogspot.com/_SjX7MIMF_HI/SXmEUMJZAuI/AAAAAAAAAPs/O0aVNkc2Jog/s320/google_An.JPG" alt="" id="BLOGGER_PHOTO_ID_5294408319343592162" border="0" /></a><span style="font-weight: bold;"><br />Number 2. Quantcast</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.quantcast.com"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 273px;" src="http://3.bp.blogspot.com/_SjX7MIMF_HI/SXmEofwyK3I/AAAAAAAAAP0/46lZntmYouQ/s320/quantcast.JPG" alt="" id="BLOGGER_PHOTO_ID_5294408668206476146" border="0" /></a><span style="font-weight: bold;">Number 3. Compete</span></p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.compete.com"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 242px;" src="http://3.bp.blogspot.com/_SjX7MIMF_HI/SXmE4RF6u2I/AAAAAAAAAP8/hc_qlZKZ8JM/s320/compete.JPG" alt="" id="BLOGGER_PHOTO_ID_5294408939146492770" border="0" /></a><span style="font-weight: bold;">Number 4. Alexa</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.alexa.com"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 201px;" src="http://4.bp.blogspot.com/_SjX7MIMF_HI/SXmFti9OdeI/AAAAAAAAAQE/TTPgKLvYiP4/s320/alexa.JPG" alt="" id="BLOGGER_PHOTO_ID_5294409854474941922" border="0" /></a><br />I guess there are many more and I&#8217;m still going blind. If anyone wants to share, the comments section is waiting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/where-to-analyse-your-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Reports</title>
		<link>http://www.softwarepassion.com/subversion-reports/</link>
		<comments>http://www.softwarepassion.com/subversion-reports/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 05:10:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=24</guid>
		<description><![CDATA[What a great piece of software for my final year project monthly reports! I have found tonight very little, very nice, very easy and most importantly very free tool on the web. It is called StatSVN and for those who don&#8217;t know yet what it is because they didn&#8217; read this post title &#8211; it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>What a great piece of software for my final year project monthly reports! I have found tonight very little, very nice, very easy and most importantly very free tool on the web. It is called StatSVN and for those who don&#8217;t know yet what it is because they didn&#8217; read this post title &#8211; it&#8217;s a subversion reporting tool. It does very easy job converting the log xml retrieved from the subversion server into human readable HTML document. Whoaaaa, I can&#8217;t belive sometimes how small things make me happy! Go ahead and try yourself!<br />Quick, easy and probably unnecessary tutorial on StatSVN:</p>
<p>1. Download the tool itself from sourceforge.net <a href="http://sourceforge.net/project/showfiles.php?group_id=164845&amp;package_id=186856">link,</a><br />2. Extract the zip file<br />3. Read the readme.txt <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />4. Check out your sources<br />5. Run &#8217;svn log &#8211;xml -v > svn.log&#8217; inside your project directory<br />6. Run java -jar statsvn.jar path_to_your_project_folder\svn.log path_to_your_project_folder<br />7. Wait<br />8. Go to the folder where statsvn.jar is and launch index.html<br />9. Feel guilty when you see no commits for a few days in a month <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The reprots consists mostly of the diagrams and the table stating the developer of the month which I like the most as I&#8217;m the only one working on the project <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ))</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_SjX7MIMF_HI/R5wYCQcuKwI/AAAAAAAAAI4/M9NxNNHYCuY/s1600-h/first.jpg" rel="lightbox[24]"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_SjX7MIMF_HI/R5wYCQcuKwI/AAAAAAAAAI4/M9NxNNHYCuY/s400/first.jpg" alt="" id="BLOGGER_PHOTO_ID_5160025700113984258" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_SjX7MIMF_HI/R5wYHgcuKxI/AAAAAAAAAJA/sbxnJ567Sb0/s1600-h/second.jpg" rel="lightbox[24]"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_SjX7MIMF_HI/R5wYHgcuKxI/AAAAAAAAAJA/sbxnJ567Sb0/s400/second.jpg" alt="" id="BLOGGER_PHOTO_ID_5160025790308297490" border="0" /></a><br />Simply wonderful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/subversion-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting Up with Erlang</title>
		<link>http://www.softwarepassion.com/starting-up-with-erlang/</link>
		<comments>http://www.softwarepassion.com/starting-up-with-erlang/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 04:44:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=21</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_SjX7MIMF_HI/R23oPiIttaI/AAAAAAAAAIo/EAKovJqlDeQ/s1600-h/erlang.gif" rel="lightbox[21]"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://bp2.blogger.com/_SjX7MIMF_HI/R23oPiIttaI/AAAAAAAAAIo/EAKovJqlDeQ/s400/erlang.gif" alt="" id="BLOGGER_PHOTO_ID_5147025302713382306" border="0" /></a><!-- the <a href="http://web.telia.com/~u83304791/">Ericsson Computer Science  Laboratory</a>.  &#8211;>Having a small break from all the courseworks and final year project I had a look at Erlang, new (for me) programming language which I spot sometimes here and there on the web. Designed at   the Ericsson Computer Science  Laboratory the open source version is freely available at www.erlang.org.<br />What really made me think about this programming language?<br />First, the SimpleDB released by Amazon as a nice addon to their web services suite is written in Erlang!<br />Secondly, I think the multicore computing is the future and we are going definitely into more cores than into speed of a single core (Sun, AMD and Intel trends is a simple proof), Erlang is about parallel programming.<br />Next, Erlang parallel programming doesn&#8217;t use locks, synchronized methods and corrupted memory (no shared memory). I assume it will be easier than in Java. <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br />And&#8230;finally?!<br />It&#8217;s functional language and finally maybe I will have one of those in my languages toolbox. <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />Let&#8217;s see what is it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/starting-up-with-erlang/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Netbeans 6.0 Finally Final Release</title>
		<link>http://www.softwarepassion.com/netbeans-60-finally-final-release/</link>
		<comments>http://www.softwarepassion.com/netbeans-60-finally-final-release/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 23:33:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=19</guid>
		<description><![CDATA[I was waiting for it very very long but looking at betas I just knew it will pay off. Just to share the exictement, Netbeans has moved from all the betas, milestones and release canditates to the final release. I have found it a bit buggy when working with EJB 3.0 and web services using [...]]]></description>
			<content:encoded><![CDATA[<p><center><br /><object id="netbeans-300x300" align="middle" height="300" width="300"><param name="movie" value="netbeans-300x300.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="http://www.netbeans.org/images/collateral/worldtour-0708/netbeans-300x300.swf" quality="high" bgcolor="#ffffff" name="netbeans-300x300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="300" width="300"></embed><br /></object><br /></center><br />I was waiting for it very very long but looking at betas I just knew it will pay off. Just to share the exictement, Netbeans has moved from all the betas, milestones and release canditates to the final release. I have found it a bit buggy when working with EJB 3.0 and web services using beta versions but I&#8217;ve heard that the final release is of excelent quality. This version of Netbeans is <span style="font-weight: bold;">different! </span><br />If you haven&#8217;t done so already you just have to give it a try!<br />Highly recommended!<br />Download the software from <a href="http://www.netbeans.org/">www.netbeans.org</a><br />Check out the Netbeans Magazine <a href="http://www.netbeans.org/download/magazine/04/nb04.pdf">Issue 4 </a>( in .pdf)<br />PS. I love the spalsh screen!<br /><img src="file:///C:/Users/kris/AppData/Local/Temp/moz-screenshot.jpg" alt="" /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_SjX7MIMF_HI/R1SbJxTwcLI/AAAAAAAAAIA/z4ldTY9AW6M/s1600-R/1401165673_2426dbbe30.jpg" rel="lightbox[19]"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_SjX7MIMF_HI/R1SbJxTwcLI/AAAAAAAAAIA/qVqLIl_zphU/s400/1401165673_2426dbbe30.jpg" alt="" id="BLOGGER_PHOTO_ID_5139903666893910194" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/netbeans-60-finally-final-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
