<?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>Kusunam&#039;s Blog</title>
	<atom:link href="http://www.srinivaskusunam.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.srinivaskusunam.com</link>
	<description>Everything about Software Development &#38; Agile, TDD, Pair Programming</description>
	<lastBuildDate>Mon, 23 Nov 2009 02:35:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Going Agile from RUP</title>
		<link>http://www.srinivaskusunam.com/2009/11/22/going-agile-from-rup/</link>
		<comments>http://www.srinivaskusunam.com/2009/11/22/going-agile-from-rup/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 02:33:21 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/?p=175</guid>
		<description><![CDATA[I was a Developer, Lead, Architect for last 10 years and all my career i was concentrating mostly on how to design, architect, code and complete the given project. My teams never cared for writing Test Cases even JUnit Tests. I tried to write some JUnit Tests for my last 2-3 projects for 2 yrs [...]]]></description>
			<content:encoded><![CDATA[<p>I was a Developer, Lead, Architect for last 10 years and all my career i was concentrating mostly on how to design, architect, code and complete the given project. My teams never cared for writing Test Cases even JUnit Tests. I tried to write some JUnit Tests for my last 2-3 projects for 2 yrs but i was distracted quickly from keeping them up to date (I know this is shame on me). I was realized that even though I am becoming experienced day by day i was not becoming a good programmer. Recently i have decided to leave my current job and to go in to an Agile Team (eXtreme Programming). This post will talk about my first week experience in this Agile team.</p>
<p><strong>Environment</strong></p>
<p>This was 360 degree change from what and how i was working for my whole career. Here are the some of the things my new team are following:</p>
<ul>
<li>My team consists of Developers (different levels I to IV), Lead, Project Manager, QA Team, Customer (Total around 18-20 people) all sitting at one place around 2 big rectangular tables (20 ft x 6ft)</li>
<li>On these rectangular tables we have 6 desktop computers with 2 monitors, 2 key boards</li>
<li>One side we have notice board kind of tables with cloth on it with white and other color papers defining User Stories placed on cloth. They have sections for New Stories, In Development, Ready for QA and QA Complete.</li>
<li>Stand-up meetings every day for 15 minutes (It doesn&#8217;t take more than 15 minutes for 20 people). There is a small base ball which will be thrown in zig-zag order and who ever gets it gives his status like what he/she did yesterday and what he/she will do today. If they are stuck with some task they will ask whole team to help him/her if they have any previous experience on it. At the end you will have opportunity to announce anything.</li>
<li>Always work in pairs that is why we have 2 monitors and 2 key boards (I paired with 3 people in my first week)</li>
<li>None of us have any standard place where we sit every day (obviously no desk), no phone and we use our laptop just to check outlook for the office email and yahoo chat and sometime use social networking sites</li>
<li>Strictly follow TDD (Test Driven Development)</li>
<li>Few team members follow Ping-Pong style development i.e. one person will write a first test case and other person picks up his keyboard and writes production code to make the test pass and also write the next test case and first person writes production code and write next test case. I kind of love this style.</li>
</ul>
<p><strong>My Feelings</strong></p>
<ul>
<li>So far I love it and excited to take a task all by myself and pick a pair and execute it from end to end.</li>
<li>Still curious to see why some of my friends hate this methodology</li>
<li>I am keeping a close eye on XP methodology for last 4 yrs and I always knew this will rock and will become defacto in development. I already see lot of companies adapting to it (except big-3 i guess).</li>
<li>Practicing XP by yourself alone is not easy as I have tried it myself for last 1 yr or so and you need every one around you to talk, eat and breathe XP.</li>
</ul>
<blockquote><p>Keep watching my blog I will post more in coming weeks. My next post would be about the technologies and how I have coded my first task.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/11/22/going-agile-from-rup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Combobox wrapping it&#8217;s Content</title>
		<link>http://www.srinivaskusunam.com/2009/05/29/flex-combobox-wrapping-its-content/</link>
		<comments>http://www.srinivaskusunam.com/2009/05/29/flex-combobox-wrapping-its-content/#comments</comments>
		<pubDate>Sat, 30 May 2009 02:56:48 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/?p=158</guid>
		<description><![CDATA[Problem
In traditional HTML page where we need to display list of values in a Drop Down there is always a limitation of size of Combo box and also its content i.e. if you have a value whose length is greater than Combo box length value will be truncated showing only the text up to which [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
In traditional HTML page where we need to display list of values in a Drop Down there is always a limitation of size of Combo box and also its content i.e. if you have a value whose length is greater than Combo box length value will be truncated showing only the text up to which it can accommodate in Combo box.</p>
<p><strong>History</strong><br />
I have seen many many HTML applications with this problem and there was no easy way to address this unless you use some Java Script trick. It came back to me on my current project and I was sure it should be easy to address in Flex. I thought I might need to write some custom component which handles click event by showing box with list of values. But with some Google search I was able to find an easy solution. <a href="http://blog.flexexamples.com/2008/07/04/creating-a-variable-row-height-item-renderer-on-a-combobox-control-in-flex/">Here</a> is the original post.</p>
<p><strong>Solution</strong></p>
<div><object width="500" height="150" data="http://www.srinivaskusunam.com/wp-content/uploads/2009/05/combobox_variablerowheight.swf" type="application/x-shockwave-flash"><param name="MOVIE" value="http://www.srinivaskusunam.com/wp-content/uploads/2009/05/combobox_variablerowheight.swf" /><param name="PLAY" value="true" /><param name="LOOP" value="true" /><param name="QUALITY" value="high" /><param name="SCALE" value="noborder" /><param name="src" value="http://www.srinivaskusunam.com/wp-content/uploads/2009/05/combobox_variablerowheight.swf" /><param name="quality" value="high" /></object></div>
<p><br/><br />
<strong>Code</strong><br />
<br/></p>
<pre class="brush: css;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;top&quot;
        width=&quot;300&quot;
        height=&quot;150&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.DropdownEvent;

            private function comboBox_open(evt:DropdownEvent):void {
                evt.currentTarget.dropdown.variableRowHeight = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id=&quot;arr&quot;&gt;
        &lt;mx:Object name=&quot;This is text can't fit in Combobox&quot; abbr=&quot;BAL&quot; /&gt;
        &lt;mx:Object name=&quot;Some Text&quot; abbr=&quot;BOS&quot; /&gt;
    &lt;/mx:Array&gt;

	&lt;mx:Label text=&quot;Problemetic Combobox&quot; /&gt;
    &lt;mx:ComboBox id=&quot;comboBox1&quot;
            dataProvider=&quot;{arr}&quot;
            width=&quot;150&quot;
            labelField=&quot;name&quot;
            open=&quot;comboBox_open(event);&quot;/&gt;

	&lt;mx:Label text=&quot;Correct Combobox&quot; /&gt;
    &lt;mx:ComboBox id=&quot;comboBox2&quot;
            dataProvider=&quot;{arr}&quot;
            width=&quot;150&quot;
            labelField=&quot;name&quot;
            open=&quot;comboBox_open(event);&quot;&gt;
        &lt;mx:itemRenderer&gt;
            &lt;mx:Component&gt;
                &lt;mx:Text selectable=&quot;false&quot;
                        toolTip=&quot;{data.name} ({data.abbr})&quot; /&gt;
            &lt;/mx:Component&gt;
        &lt;/mx:itemRenderer&gt;
    &lt;/mx:ComboBox&gt;
&lt;/mx:Application&gt;
</pre>
<p><br/><br/></p>
<blockquote><p>I am updating this post after 2 weeks. Silly me I just figured out default combo box property <b>dropdownwidth</b> which seems to be doing the job I need for this. But again above solution is not redundant and it might be useful in cases if you do not want dropdown width to be different than combo box width. I can&#8217;t think having such a requirement but we never know <img src='http://www.srinivaskusunam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/05/29/flex-combobox-wrapping-its-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex Combobox selectedItem Problem</title>
		<link>http://www.srinivaskusunam.com/2009/05/13/flex-combobox-selecteditem-problem/</link>
		<comments>http://www.srinivaskusunam.com/2009/05/13/flex-combobox-selecteditem-problem/#comments</comments>
		<pubDate>Thu, 14 May 2009 01:44:03 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/?p=135</guid>
		<description><![CDATA[Problem
Flex combobox by default do not support &#8220;selectedItem&#8221; where &#8220;dataProvider&#8221; is not one of the primitive data types (String). This gets more hairy if you have list of VO&#8217;s as it&#8217;s Data Provider.

Solutions
In my case my Data Provider is list of ValueVO&#8217;s which consists of two properties i.e. code (type: String) and description (type: String). [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Flex combobox by default do not support &#8220;<strong>selectedItem</strong>&#8221; where &#8220;<strong>dataProvider</strong>&#8221; is not one of the primitive data types (String). This gets more hairy if you have list of VO&#8217;s as it&#8217;s Data Provider.<br />
<br />
<strong>Solutions</strong><br />
In my case my Data Provider is list of <strong>ValueVO&#8217;s </strong>which consists of two properties i.e. code (type: String) and description (type: String). We need to select one of the VO&#8217;s based on matching Code.<br />
<br />
I have implemented a custom Combobox which extends Flex default Combobox and provides a method for &#8220;selectedItem&#8221;. This method loops through the list of ValueVO&#8217;s and checks for matching &#8220;code&#8221; property.<br />
</p>
<pre class="brush: css;">
public class CustomSelectedComboBox extends ComboBox
{
     public function CustomSelectedComboBox()
     {
          super();
          this.rowCount = 10;
     }
     // value is the value you input that you want to search for.
     override public function set selectedItem(value:Object):void
     {
          if (value != null &amp;amp;&amp;amp; selectedIndex == -1)
          {
               /** do a painful search */
               for each(var item:Object in this.collection)
               {
                    /**Vdata is the Arraycollection item you whant to search in.
                    So VData is the name of the item within the ArrayCollection */
                    if (item.code == value )
                    {
                        super.selectedItem=item;
                        break;
                    }
               }
          }
     }
}
</pre>
<p>
This is how you use this custom combobox in MXML.<br />
</p>
<pre class="brush: css;">
&lt;custom:CustomSelectedComboBox     id=&quot;vehicleTypeCB&quot;
                           dataProvider=&quot;{__model.initializerVO.vehicleTypeList}&quot;
                           labelFunction=&quot;displayCodeAndDescription&quot;
                           selectedItem=&quot;{__model.updateVO.vehicleType}&quot;
                           prompt=&quot;Select one...&quot;/&gt;
</pre>
<p> <br />
Everything looks fine as you have added &#8220;dataProvider&#8221; and &#8220;selectedItem&#8221; and expects it to work. Guess what this will not work as expected and weird thing is it works sometime and doesn&#8217;t work some other time (just random). I was struggling on it for last 8 hrs and identified the problem, but did not find correct answer/ solution. But I have a work around to deal with it. Next question you would ask why is the above code is not working? From the above code in &#8220;selectedItem&#8221; we are expecting &#8220;dataProvider&#8221; to be set first as we are looping through it to find the VO which matches our &#8220;code&#8221; to select. But in this the order in which &#8220;dataProvider&#8221; and &#8220;selectedItem&#8221; called is not predictable.<br />
<br />
<strong>Work around</strong><br />
I took &#8220;selectedItem&#8221; out of the above MXML and added following call in &#8220;creationComplete&#8221; method inside a container where I have this &#8220;<strong>customSelectedComboBox</strong>&#8220;.<br />
</p>
<pre class="brush: css;">
vehicleTypeCB.selectedItem = __model.updateVO.vehicleType;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/05/13/flex-combobox-selecteditem-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maven Introduction and Concepts (Part – I)</title>
		<link>http://www.srinivaskusunam.com/2009/05/05/maven-introduction-and-concepts-part-%e2%80%93-i/</link>
		<comments>http://www.srinivaskusunam.com/2009/05/05/maven-introduction-and-concepts-part-%e2%80%93-i/#comments</comments>
		<pubDate>Wed, 06 May 2009 03:21:52 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/?p=115</guid>
		<description><![CDATA[Background
I am using Maven for build and release management for last 4years or so. But recently when I started using &#8216;Flex Mojos&#8217; plug-in for building my Flex project I realized that I do not have some of the basic knowledge about the Maven. I have to admit that I had only 30-40% of knowledge. For [...]]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>I am using Maven for build and release management for last 4years or so. But recently when I started using &#8216;Flex Mojos&#8217; plug-in for building my Flex project I realized that I do not have some of the basic knowledge about the Maven. I have to admit that I had only 30-40% of knowledge. For last few days I started reading &#8220;<strong>Maven – The Definitive Guide</strong>&#8221; from Sonatype and thought I will share some of the core concepts. I am planning to split this in to 2 parts. In first part I will cover core concepts about the Maven and in 2<sup>nd</sup> part I will cover different useful plug-ins and important commands.</p>
<h3>Audience</h3>
<p>This article assumes that you have some working knowledge of Maven2 and this should be used as a reference only.</p>
<h3>Core Concepts</h3>
<p>The core of Maven is pretty dumb, it doesn&#8217;t know how to do much beyond parsing few XML documents and keeping track of few lifecycle and few plugins. Most of the stuff is delegated to plugins.</p>
<p><strong>Convention over Configuration</strong>    <br />
Systems, libraries, and frameworks should assume reasonable defaults. Without requiring unnecessary configuration, systems should &#8220;just work&#8221;. Popular frameworks &#8220;Ruby On Rails&#8221; and EJB3 are based on this concept.</p>
<p>I have seen people breaking this rule and saying Maven is &#8220;stupid&#8221; it assumes my source files in &#8220;src\main\java&#8221; directory and I do not want to adhere to this folder structure. That is fine you can use whatever the structure you want and Maven doesn&#8217;t put any restriction on this but in your POM, make sure you tell that to Maven. But think again when you break any of these rules. I would do this only if somebody else owns this project and is a legacy code.</p>
<h5><strong>Plugins and Goals</strong></h5>
<p>A Maven plugin is a collection of one or more goals.</p>
<p>A goal is a &#8220;unit of work&#8221;. It is a specific task that may be executed as standalone goal or along with other goals as part of larger build.</p>
<pre class="brush: css;">
     mvn archetype:create        (pluginId:goalId)
</pre>
<h5><strong>Maven Lifecycle</strong></h5>
<p>The build lifecycle is an ordered sequence of phases involved in building a project. Most often used is the default Maven lifecycle, which begins with a phase to validate the basic integrity of the project and ends with a phase that involves deploying a project to production.</p>
<p> <span style="color:#d60093">Plugin goals can be attached to a lifecycle phase</span>. As Maven moves through the phases in a lifecycle, it will execute the goals attached to each particular phase. Each phase may have zero or more goals bound to it.</p>
<pre class="brush: css;">
 mvn install        (install – It is one of lifecycle phase)
</pre>
<h5><strong>Maven Co-ordinates</strong></h5>
<p>Maven Coordinates define a set of identifiers which can be used to uniquely identify a project, a dependency, or a plugin in a Maven POM</p>
<p><img src="http://www.srinivaskusunam.com/wp-content/uploads/2009/05/050609-0321-mavenintrod17.png" alt="" /></p>
<h5><strong>Maven Repositories</strong></h5>
<p>When you run Maven for the first time, you will notice that Maven downloads a number of files from a remote Maven repository. <span style="color:black">Maven ships with the bare minimum and fetches from a remote repository when it needs to. Maven ships with a default remote repository location (<a href="http://repo1.maven.org/maven2"></a></span>http://repo1.maven.org/maven2<span style="color:black">)<br />
</span></p>
<h5><strong>Maven Dependency (Transitive Dependency)</strong></h5>
<p>A dependency in Maven isn&#8217;t just a JAR file; it&#8217;s a POM file that, in turn, may declare dependencies on other artifacts. These dependencies of dependencies are called transitive dependencies</p>
<h5><strong>Optimizing Dependencies</strong></h5>
<p>In a multi module project use &#8220;dependencyManagement&#8221; section to categorize all the common dependency jar&#8217;s between projects. This avoids dependency duplication and sibling dependency mis-match.</p>
<pre class="brush: css;">
&lt;project&gt;
…..
 &lt;dependencyManagement&gt;
 &lt;dependencies&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring&lt;/artifactId&gt;
 &lt;version&gt;2.0.7&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependencies&gt;
 &lt;dependencyManagement&gt;
&lt;/project&gt;
</pre>
<h5><strong>Optimizing Plugins</strong></h5>
<p>Use &#8220;pluginManagement&#8221; section in top level POM just like the way we use for Dependency management.</p>
<pre class="brush: css;">
&lt;project&gt;
…..
 &lt;build&gt;
&lt;pluginManagement&gt;
&lt;plugins&gt;
&lt;plugin&gt;
 &lt;groupId&gt; org.apache.maven.plugins &lt;/groupId&gt;
 &lt;artifactId&gt;maven-complier-plugin&lt;/artifactId&gt;
 &lt;configuration&gt;
 &lt;source&gt;1.5&lt;/source&gt;
 &lt;target&gt;1.5&lt;/target&gt;
 &lt;/configuration&gt;
 &lt;/plugin&gt;
 &lt;/plugins&gt;
 &lt; pluginManagement &gt;
 &lt;/build&gt;
&lt;/project&gt;
</pre>
<p></strong></h5>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/05/05/maven-introduction-and-concepts-part-%e2%80%93-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Object Tree</title>
		<link>http://www.srinivaskusunam.com/2009/04/24/flex-object-tree/</link>
		<comments>http://www.srinivaskusunam.com/2009/04/24/flex-object-tree/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 19:07:46 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/2009/04/24/flex-object-tree/</guid>
		<description><![CDATA[I am sure you will run in to something like this if you are going to work on Flex for your next 4-5 projects. Luckily \ Un-luckily I ran in to this on my first project itself. This was definitely very complex to me when I started but it does make sense after I finish [...]]]></description>
			<content:encoded><![CDATA[<p>I am sure you will run in to something like this if you are going to work on Flex for your next 4-5 projects. Luckily \ Un-luckily I ran in to this on my first project itself. This was definitely very complex to me when I started but it does make sense after I finish it. Given the complexity of this I will update it iteratively.
</p>
<h3>Requirement<br />
</h3>
<ul>
<li>You have a Database table(s) whose data translate to something like Tree with top level is identified using separate column something like &#8216;isTopLevel&#8217;
</li>
</ul>
<h3>Assumptions<br />
</h3>
<ul>
<li>You will have 2 Database tables. One is &#8220;<span style="color:red"><strong>FolderVO</strong></span>&#8221; and other is &#8220;<span style="color:red"><strong>FileVO</strong></span>&#8220;. These two tables are linked using 3<sup>rd</sup> table called &#8220;<span style="color:red"><strong>Folder_File_Link</strong></span>&#8221;
</li>
<li>FolderVO will have a column to specify &#8216;isTopLevel&#8217; which will be populated for only top Folder in the tree
</li>
<li>
<div>&#8220;Folder_File_Link&#8221; will have its structure something like following to identify each folder&#8217;s children
</div>
<p style="margin-left: 36pt"><span style="color:red">linked        folderId        folder_file_Id    <br />
</span></p>
</li>
<li>A Folder can have either Folder or File list as its Children based on its property &#8220;<strong>folderLink</strong>&#8221; which take &#8220;<strong>Folder</strong>&#8221; or &#8220;<strong>File</strong>&#8220;<span style="color:red"><br />
			</span></li>
<li>This structure can be in some other formats too and purpose of this post is just to show how to develop Flex screens to handle something like this<span style="color:red"><br />
			</span></li>
</ul>
<h3>Explanation<br />
</h3>
<p>On the server side retrieve Folder with &#8216;<strong>isTopLevel</strong>&#8216; is set to &#8216;<strong>T</strong>&#8216; and go to link table and get all the Folders and Files attached to it. This is a recursive method at the end t will generate &#8220;<strong>FolderVO</strong>&#8221; object which will have following properties:
</p>
<p><span style="color:#00b050; font-size:10pt"><em>    public var folderId:int;<br />
</em></span></p>
<p><span style="color:#00b050; font-size:10pt"><em>    public var folderName:String;<br />
</em></span></p>
<p><span style="color:#00b050; font-size:10pt"><em>    public var folderCode:String;<br />
</em></span></p>
<p><span style="color:#00b050; font-size:10pt"><em>    public var folderDescription:String;<br />
</em></span></p>
<p><span style="font-size:10pt"><span style="color:#00b050"><em>    public var folderLink:String;    </em></span>//&#8212;-  This will identify whether this folder can have Folder or Files as Children<br />
</span></p>
<p><span style="color:#00b050; font-size:10pt"><em>    public var topFolder:String;<br />
</em></span></p>
<p><span style="font-size:10pt"><span style="color:#00b050"><em>    public var children:ArrayCollection; </em></span>//&#8212;- This contains FolderVO or FileVO objects    recursively<span style="color:#00b050"><em>    </em></span></span>
	</p>
<p>Here children is a Collection which contains Folders or Clients based on its property &#8216;<strong>folderLink</strong>&#8216;
</p>
<p>This Tree will support following features:
</p>
<ol>
<li>Create a Folder (either top level or any children)
</li>
<li>Remove Folder
</li>
<li>Attach any existing Files
</li>
<li>Remove any File from the Folder
</li>
</ol>
<p><img src="http://www.srinivaskusunam.com/wp-content/uploads/2009/04/042409-1907-flexobjectt15.png" alt=""/>
	</p>
<p><span style="color:red">**** Given the complexity of this form I will try to add details n next few days or weeks (depending on my schedule). But if you ran in to something like this and need any help drop me a message I will definitely help on this as I went through this pain already <span style="font-family:Wingdings">J</span><br />
		</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/04/24/flex-object-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility projects under Apache Commons</title>
		<link>http://www.srinivaskusunam.com/2009/04/17/utility-projects-under-apache-commons/</link>
		<comments>http://www.srinivaskusunam.com/2009/04/17/utility-projects-under-apache-commons/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 03:02:00 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/2009/04/17/utility-projects-under-apache-commons/</guid>
		<description><![CDATA[I was wondering why people do not use these Utility projects from Apache. Probably I have seen 1-2 projects which utilize org.apache.commons.beanutils. Even I was not using these until 2006-2007. In any application which is in Test or Prod I see &#8216;NullPointerExceptions&#8217; at least once. So what is the problem we write all these boiler [...]]]></description>
			<content:encoded><![CDATA[<p>I was wondering why people do not use these Utility projects from Apache. Probably I have seen 1-2 projects which utilize <span style="color:#0070c0"><strong>org.apache.commons.beanutils.</strong></span> Even I was not using these until 2006-2007. In any application which is in Test or Prod I see &#8216;NullPointerExceptions&#8217; at least once. So what is the problem we write all these boiler code to check for NULL then call some function on it like trim(), length, size() or any public methods. Sometimes we miss first NULL check and I have seen myself missing these repeatedly before I started using Apache Common Utility methods. Now I make use of these utility classes very often which are &#8216;Null safe&#8217; and protects my code from any &#8216;Null Pointers&#8217;. Here are some of the Utility projects I use on daily basis and recommend any one to use these if you are not using these already.</p>
<blockquote><p><a href="http://commons.apache.org/beanutils/"><span style="background-color:silver">Apache Commons Bean Utils</span></a></p>
<p>    BeanUtils    MethodUtils</p>
<p><a href="http://commons.apache.org/lang"><span style="background-color:silver">Apache Commons Lang</span></a></p>
<p>    ArrayUtils    DataUtils    DataFormatUtils    ObjectUtils    StringUtils</p>
<p><a href="http://commons.apache.org/collections"><span style="background-color:silver">Apache Commons Collections</span></a></p>
<p>    This has many classes useful on operating on Collections.</p></blockquote>
<p>I am sure many people who often involve with open source projects use these on regular basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/04/17/utility-projects-under-apache-commons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My FLEX Journey</title>
		<link>http://www.srinivaskusunam.com/2009/04/05/my-flex-journey/</link>
		<comments>http://www.srinivaskusunam.com/2009/04/05/my-flex-journey/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:00:58 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/2009/04/05/my-flex-journey/</guid>
		<description><![CDATA[I started this journey a month back or so and here is how it was and how it is now.

 Back Ground
 I am working on developing web  Enterprise applications using Java  J2EE technologies for last 10 years. All the time my biggest complaint was why do I need to write everything by myself i.e. [...]]]></description>
			<content:encoded><![CDATA[<p>I started this journey a month back or so and here is how it was and how it is now.</p>
<p><br/><br />
 <strong>Back Ground</strong><br />
 I am working on developing web  Enterprise applications using Java  J2EE technologies for last 10 years. All the time my biggest complaint was why do I need to write everything by myself i.e. HTML (first design the page) then use some framework like Struts  Spring as MVC and other stuff. Before I came in to Java I was a Visual Basic developer and it was cool in developing desktop applications by just dragging and dropping and defining the events. My biggest belief is as an Application Developer I should be worrying about my business logic and rest should be taken care by framework or technology. This is exactly what J2EE addressed on Server side when it was released i.e. it takes care of Deployment, Resource Management, Connection pooling, Transaction Management etc and I just need to work on my business logic.<br />
<br/></p>
<p><strong>FLEX</strong></p>
<p>Flex seems to be addressed some of these very well on the client side i.e. provide a working area where we can just drop existing components and start defining what they do and how they do. We can also reuse some of the custom components. I feel learning Flex is little bit steep in the beginning especially for someone like me, who has not worked on even driven applications for a long time. I started my first Flex screen by just looking at some of the examples from Adobe @ <a href="http://livedocs.adobe.com/flex/3/html/index.html">http://livedocs.adobe.com/flex/3/html/index.html</a> and luckily this screen was simple one with no Commits to database i.e. just read from Database and display on the screen. I have used XML communication between Flex and Java deployed as a WAR project on JBoss application server. This worked perfectly fine for my screen requirement. During this screen development I was spending most of time on Google and Adobe in searching how to construct XML on the server and also how to read it in Flex and also how to display collections in a drop down, Grid. First screen gave me some opportunity to learn how Flex works and also experiment different layouts, containers, components and also some Action Script.
</p>
<p>After I finished this screen I have to work on my 2<sup>nd</sup> screen which is more complex to me with 2 dropdowns, Tree component, editing tree nodes, screen modes (view, edit) and many more. I thought I can never finish this screen looking at my limited flex knowledge and also screen complexity. But as an applications Architect I had to approach it organized and iteratively and this worked (working) perfectly to me. I am still working on this screen and so far I do not have any road blocks.
</p>
<p><br/><br />
<strong>Flex Learning Resources:</strong><br />
A simple Getting Started    <b><a href="http://learn.adobe.com/wiki/display/Flex/E4X">http://learn.adobe.com/wiki/display/Flex/E4X</a></b>
</p>
<p>Adobe Resource Center    <b><a href="http://livedocs.adobe.com/flex/3/html/index.html">http://livedocs.adobe.com/flex/3/html/index.html</a></b>
</p>
<p> Flex in a week from Adobe    <b><a href="http://www.adobe.com/devnet/flex/videotraining/">http://www.adobe.com/devnet/flex/videotraining/</a></b>
</p>
<p>Flex Learning Path – Programmer    <b><a href="http://www.adobe.com/devnet/flex/learn/programmer/">http://www.adobe.com/devnet/flex/learn/programmer/</a></b>
</p>
<p>A must to have AIR for every Flex newbie &#8220;<strong>Tour de Flex </strong>Component Explorer&#8221;    
</p>
<p style="margin-left: 108pt"><b><a href="http://www.adobe.com/devnet/flex/tourdeflex/">http://www.adobe.com/devnet/flex/tourdeflex/</a></b>
</p>
<p><br/></p>
<p><strong>XML over HTTP (or) Remoting using AMF<br />
</strong></p>
<p>XML seems to be tempting and easier approach when you are beginning with Flex but as the application gets complex XML seems to be painful. First thing is we need to do 2 time XML parsing i.e. one on server and one on client and 2nd thing how do we manage XML when we need to do some heavy CUD operations? I ran in to this issue when I started my 2<sup>nd</sup> screen which has lot of CRUD operations and immediately I started looking out for some alternatives to this XML. First thing I ran in to is &#8216;BlazeDS&#8217; from Adobe which seems to be addressing &#8216;Remoting&#8217; perfectly for my needs. Also Adobe claims (I have also seen someone posted these performance numbers on web) that it is faster using AMF (Action Message Format) comparing to XML communication. Learning BlazeDS is easy and straight forward for any Java Developer (May be I will write another post on BlazeDS). There are other alternative to BlazeDS like GraniteDS and other claiming that they are better than BlazeDS but I will experiment with them once I get comfortable with all these new technologies (to me).
</p>
<p><br/></p>
<p><strong>Flex MVC Framework (Cairngorm)<br />
</strong></p>
<p>Currently 80% of my UI and Action Script code are on same MXML file and this is growing day by day and I started hating my code. Next question is how I refactor this code to put it in a nice MVC style framework. Cairngorm seems to be a nice one for a starter like me. I experimented with it yesterday only and also I have applied it to my 2<sup>nd</sup> screen and most of it is simple and easy but I hit a road-block in it i.e. how do I enable  disable UI components based on events and their response (result  fault). I will look in to it more in next couple of days (May be another post on Cairngorm). There are other frameworks like PureMVC, Swiz and Mate. I hear lot of good about Mate and this will be the next in my list to experiment.
</p>
<p><br/></p>
<p><strong>Maven2<br />
</strong></p>
<p>I hate Ant and a big fan of Maven even though it has some drawbacks. But I can be up and running with Maven in 5-10 minutes for any project. Flex do not have good support for Maven and this was the task I have spent overall a week or so (bad part is I have started on it before I started on developing Flex so I did not had any idea about what is SWC, SWF, RSL etc). There is an open source project called &#8220;flex-mojos&#8217; lead by <span style="color:#00b0f0">Marvin Froeder </span>(Velo) and it is the best plug-in available for Flex-Maven.  Please look at Google groups <a href="http://groups.google.com/group/flex-mojos">http://groups.google.com/group/flex-mojos</a> for further details also here is the latest wiki for it @ <a href="https://docs.sonatype.org/">https://docs.sonatype.org/</a>
</p>
<p><span style="color:#00b050">As always drop me a message for any questions or suggestions….</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/04/05/my-flex-journey/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Default Sorting for a DataGrid</title>
		<link>http://www.srinivaskusunam.com/2009/03/29/default-sorting-for-a-datagrid/</link>
		<comments>http://www.srinivaskusunam.com/2009/03/29/default-sorting-for-a-datagrid/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 16:58:55 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/?p=41</guid>
		<description><![CDATA[I thought it is just setting a property in default Flex Grid with something like &#8216;defaultSort&#8221; but i seems to be wrong. Flex default Grid do not support something like this but Adobe recommends sorting List on the server side and sent it back to Flex. But, this may not be possible all the times. [...]]]></description>
			<content:encoded><![CDATA[<p>I thought it is just setting a property in default Flex Grid with something like &#8216;defaultSort&#8221; but i seems to be wrong. Flex default Grid do not support something like this but Adobe recommends sorting List on the server side and sent it back to Flex. But, this may not be possible all the times. In my case I am extracting ArrayCollection from XML and need to do this sorting on the client side. There are multiple ways you can do this on client side. Here is the one I started using couple of days back and you can see the original post <a href="http://www.bealearts.co.uk/blog/2007/06/15/default-sorting-for-a-flex-datagrid/">here</a>.
</p>
<p><br/><br />
<strong>Solution-1:</strong><br />
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="550" HEIGHT="200"/><br />
CODEBASE=&#8221;http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0&#8243;><br />
<PARAM NAME="MOVIE" VALUE="http://www.srinivaskusunam.com/wp-content/uploads/2009/03/datagridsortingex.swf"><br />
<PARAM NAME="PLAY" VALUE="true"><PARAM NAME="LOOP" VALUE="true"><PARAM NAME="QUALITY" VALUE="high"><PARAM NAME="SCALE" value="noborder"><EMBED SRC="http://www.srinivaskusunam.com/wp-content/uploads/2009/03/datagridsortingex.swf" WIDTH="850" HEIGHT="610" PLAY="true" LOOP="true" QUALITY="high" scale="noborder" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT> <br/><br />
Here is the Source for the Code:</p>
<pre class="brush: css;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot; verticalAlign=&quot;top&quot;
    horizontalAlign=&quot;center&quot; backgroundGradientColors=&quot;[0x000000,0x323232]&quot; paddingTop=&quot;0&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;

&lt;mx:Script&gt;
	&lt;![CDATA[
		import mx.events.DataGridEvent;

	    /* Function to do default sort on Data Grid in ascending order. */
        public function sortAC():void {
			dgSort(dg, 0);
        }

 		private function dgSort(dgName:Object, dgColumn:int):void{
	        dgName.dispatchEvent(
				new DataGridEvent
				(
					DataGridEvent.HEADER_RELEASE,
					false,
					true,
					dgColumn,
					null,
					0,
					null,
					null,
					0
				)
			)
		}

	]]&gt;
&lt;/mx:Script&gt;

    &lt;mx:XMLList id=&quot;employees&quot;&gt;
        &lt;employee&gt;
			&lt;id&gt;2&lt;/id&gt;
            &lt;name&gt;Christina Coenraets&lt;/name&gt;
            &lt;phone&gt;555-219-2270&lt;/phone&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
        	&lt;id&gt;3&lt;/id&gt;
            &lt;name&gt;Joanne Wall&lt;/name&gt;
            &lt;phone&gt;555-219-2012&lt;/phone&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
        	&lt;id&gt;1&lt;/id&gt;
            &lt;name&gt;Maurice Smith&lt;/name&gt;
            &lt;phone&gt;555-219-2012&lt;/phone&gt;
        &lt;/employee&gt;
    &lt;/mx:XMLList&gt;
    &lt;mx:Panel title=&quot;DataGrid Control&quot; layout=&quot;vertical&quot; color=&quot;0xffffff&quot; borderAlpha=&quot;0.15&quot; width=&quot;500&quot;
         paddingTop=&quot;5&quot; paddingRight=&quot;10&quot; paddingBottom=&quot;10&quot; paddingLeft=&quot;10&quot; horizontalAlign=&quot;center&quot;&gt;

         &lt;mx:Label width=&quot;100%&quot; color=&quot;0x323232&quot;
            text=&quot;Select a row in the DataGrid control.&quot;/&gt;

        &lt;mx:DataGrid id=&quot;dg&quot; color=&quot;0x323232&quot; width=&quot;100%&quot; rowCount=&quot;3&quot; s
        	dataProvider=&quot;{employees}&quot;
        	creationComplete=&quot;sortAC()&quot;&gt;
            &lt;mx:columns&gt;
                &lt;mx:DataGridColumn dataField=&quot;id&quot; headerText=&quot;Id&quot;/&gt;
                &lt;mx:DataGridColumn dataField=&quot;name&quot; headerText=&quot;Name&quot;/&gt;
                &lt;mx:DataGridColumn dataField=&quot;phone&quot; headerText=&quot;Phone&quot;/&gt;
            &lt;/mx:columns&gt;
        &lt;/mx:DataGrid&gt;
    &lt;/mx:Panel&gt;
&lt;/mx:Application&gt;
</pre>
<p><br/><br />
<strong>Solution-2:</strong><br />
<a href="http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_4.html#441147">Here</a> is another way i found on Adobe website.</p>
<p><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="550" HEIGHT="200"/><br />
CODEBASE=&#8221;http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0&#8243;><br />
<PARAM NAME="MOVIE" VALUE="http://www.srinivaskusunam.com/wp-content/uploads/2009/03/datagridsortingex1.swf"><br />
<PARAM NAME="PLAY" VALUE="true"><PARAM NAME="LOOP" VALUE="true"><PARAM NAME="QUALITY" VALUE="high"><PARAM NAME="SCALE" value="noborder"><EMBED SRC="http://www.srinivaskusunam.com/wp-content/uploads/2009/03/datagridsortingex1.swf" WIDTH="850" HEIGHT="610" PLAY="true" LOOP="true" QUALITY="high" scale="noborder" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT> <br/><br />
Here is the Source for the Code:</p>
<pre class="brush: css;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;&gt;

&lt;mx:Script&gt;
	&lt;![CDATA[
		    import mx.collections.*;

            /* Function to sort the ICollectionView
               in ascending order. */
            public function sortAC():void {
                var sortA:Sort = new Sort();
                sortA.fields=[new SortField(&quot;label&quot;)];
                myAC.sort=sortA;
                //Refresh the collection view to show the sort.
                myAC.refresh();
            }
	]]&gt;
&lt;/mx:Script&gt;

    &lt;!-- An ArrayCollection with an array of objects. --&gt;
    &lt;mx:ArrayCollection id=&quot;myAC&quot;&gt;
        &lt;mx:Array id=&quot;myArray&quot;&gt;
            &lt;mx:Object label=&quot;LA&quot; data=&quot;Baton Rouge&quot;/&gt;
            &lt;mx:Object label=&quot;NH&quot; data=&quot;Concord&quot;/&gt;
            &lt;mx:Object label=&quot;TX&quot; data=&quot;Austin&quot;/&gt;
            &lt;mx:Object label=&quot;MA&quot; data=&quot;Boston&quot;/&gt;
            &lt;mx:Object label=&quot;AZ&quot; data=&quot;Phoenix&quot;/&gt;
            &lt;mx:Object label=&quot;OR&quot; data=&quot;Salem&quot;/&gt;
            &lt;mx:Object label=&quot;FL&quot; data=&quot;Tallahassee&quot;/&gt;
            &lt;mx:Object label=&quot;MN&quot; data=&quot;Saint Paul&quot;/&gt;
            &lt;mx:Object label=&quot;NY&quot; data=&quot;Albany&quot;/&gt;
        &lt;/mx:Array&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:DataGrid id=&quot;myDG&quot; dataProvider=&quot;{myAC}&quot; creationComplete=&quot;sortAC()&quot; /&gt;

&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/03/29/default-sorting-for-a-datagrid/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flex / Java multi module project structure for Maven</title>
		<link>http://www.srinivaskusunam.com/2009/03/23/flex-java-multi-module-project-structure-for-maven/</link>
		<comments>http://www.srinivaskusunam.com/2009/03/23/flex-java-multi-module-project-structure-for-maven/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:38:20 +0000</pubDate>
		<dc:creator>Srinivas Kusunam</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.srinivaskusunam.com/2009/03/23/flex-java-multi-module-project-structure-for-maven/</guid>
		<description><![CDATA[Recently I have started working on my first Flex project. It is been 2 weeks or so and first question came to my mind was how do I structure my project so that I can build it using Maven? I have decided to use &#8216;info.flex-mojos&#8216; project and also seriously considered his suggestion about one single [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have started working on my first Flex project. It is been 2 weeks or so and first question came to my mind was how do I structure my project so that I can build it using Maven? I have decided to use &#8216;<a href="http://blog.flex-mojos.info/">info.flex-mojos</a>&#8216; project and also seriously considered his suggestion about one single Flex project should not generate multiple SWF files read it at his blog &#8220;<a title="Multiple SWF from same Sources" href="http://flex-mojos.info/2008/12/20/multiple-swf-from-same-sources/">Multiple SWF from same Sources</a>&#8220;.<br />
<br />
<strong>Requirement</strong></p>
<ul>
<li>Need to build 2 WAR files, one WAR file need to have 2 main application MXML files which are accessed through a direct URL (one for each) and 2nd one with a single MXML application file<strong><br />
</strong></li>
</ul>
<p><strong>Setup<br />
</strong></p>
<p>Here is the structure I have setup for this project:<br />
<br />
<span style="color:#c00000">MyProjectName<br />
</span></p>
<p><span style="color:#c00000">&#8211; model </span><span style="color:#548dd4; font-size:9pt">(Hibernate model classes common for both exceptionsweb and formsweb)<br />
</span></p>
<p><span style="color:#c00000">&#8211; exceptions_web </span><span style="color:#548dd4; font-size:9pt">(web project which needs to have 2 main SWF files from modules screen1_module and screen2_module)<br />
</span></p>
<p><span style="color:#c00000">&#8211; forms_web </span><span style="color:#548dd4; font-size:9pt">(web project which contains 1 main SWF file from forms_module)</span><span style="color:#c00000"><br />
</span></p>
<p><span style="color:#c00000">&#8211; ria<br />
</span></p>
<p><span style="color:#c00000">&#8211; shared_module_lib </span><span style="color:#548dd4; font-size:9pt">(This is the shared library or RSL used in all the 3 Flex main modules)</span><span style="color:#c00000"><br />
</span></p>
<p><span style="color:#c00000">&#8211; screen1_module<br />
</span></p>
<p><span style="color:#c00000">&#8211; screen2_module<br />
</span></p>
<p><span style="color:#c00000">&#8211; forms_module</span><br />
<br/><br />
<strong>Build process</strong><br />
With this project structure Flex modules always generate new version with every build and we need to make sure that HTML or JSP file which wraps corresponding SWF file needs to be updated dynamically during the maven build process. Luckily we have &#8216;html-wrapper-mojo&#8217; plugin available from the same project &#8216;info.flex-mojos&#8217;. As the requirement is to have 2 SWF files in &#8216;exceptionsweb&#8217; WAR file, this plugin has a limitation of allowing only 1 SWF. This made me to spend more 8-20hrs and build it through a workaround i.e. using &#8216;maven-assembly-plugin&#8217; build 2nd flex project (screen1_module) as ZIP and unpack it in to &#8216;exceptions_web&#8217; war file.</p>
<p>Here is the order of the build:</p>
<ul>
<li>
<div>Build flex projects first</div>
<ul>
<li>Build &#8217;shared_module_lib&#8217; project as &#8216;SWC&#8217; i.e. <span style="color:#548dd4"><em>&lt;packaging&gt;swc&lt;/packaging&gt;</em></span> which will be referred as RSL in other projects</li>
<li>
<div>Build &#8217;screen1_module&#8217; project as regular SWF</div>
<ul>
<li>This project also needs to use &#8216;<span style="color:#548dd4">html-wrapper-mojo</span>&#8216; plugin to dynamically creating <span style="color:#548dd4">${project.build.finalName}.html (eg: screen1_module-1.0.0-SNAPSHOT.swf)</span> with a link to current version of SWF file it is building</li>
<li>Next use &#8216;<span style="color:#548dd4">maven-antrun-plugin</span>&#8216; to move above generated file (eg: screen1_module-1.0.0-SNAPSHOT.html) to the name by which users access i.e. <span style="color:#548dd4">Screen1.html<br />
</span></li>
<li>Use &#8216;<span style="color:#548dd4">maven-assembly-plugin</span>&#8216; to generate a zip file which will have Screen1.html, Screen1-1.0.0.swf and any history and player files which will be extracted in to WAR project</li>
</ul>
</li>
<li>Build &#8217;screen2_module&#8217; project as regular SWF</li>
<li>Build &#8216;forms_module&#8217; project as regular SWF</li>
</ul>
</li>
<li>Build &#8216;model&#8217; project as &#8216;jar&#8217; project</li>
<li>
<div>Build &#8216;exceptions_web&#8217; project as &#8216;war&#8217;</div>
<ul>
<li>Add screen2_module files – We need to generate <em>Screen2-1.0.0-SNAPSHOT.html</em> which will be used to access the corresponding SWF file. For this we need to use &#8216;html-wrapper-mojo&#8217; plugin to dynamically creating <span style="color:#548dd4">${project.build.finalName}.html</span> with a link to current version of SWF file it is building</li>
<li>Next use &#8216;maven-antrun-plugin&#8217; to move above generated file (eg: Screen2-1.0.0-SNAPSHOT.html) to the name by which users access i.e. Screen2.html</li>
<li>Use &#8216;maven-dependency-plugin&#8217; to unpack the &#8217;screen1_module&#8217; zip file</li>
<li>Use &#8216;maven-dependency-plugin&#8217; to copy player Adobe framework SWF and SWZ files to the WAR build</li>
</ul>
</li>
<li>
<div>Build &#8216;forms_web&#8217; project as &#8216;war&#8217;</div>
<ul>
<li>Add forms_module files – We need to generate Forms<em>-1.0.0-SNAPSHOT.html which is a wrapper to </em>corresponding SWF file. For this we need to use &#8216;html-wrapper-mojo&#8217; plugin</li>
<li>Next use &#8216;maven-antrun-plugin&#8217; to move above generated file (eg: Forms-1.0.0-SNAPSHOT.html) to the name by which users access i.e. Forms.html</li>
<li>Use &#8216;maven-dependency-plugin&#8217; to copy player Adobe framework SWF and SWZ files to the WAR build</li>
</ul>
</li>
</ul>
<p><span style="color:red">** This is my first attempt of building Flex with Maven. Any suggestions or questions are welcome.</span><br />
<strong>Top Level POM which builds all the sub projects.</strong><br />
</p>
<pre class="brush: css;">
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
	&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
	&lt;groupId&gt;com.company.project&lt;/groupId&gt;
	&lt;artifactId&gt;multimodule&lt;/artifactId&gt;
	&lt;name&gt;Multi module Parent project&lt;/name&gt;
	&lt;packaging&gt;pom&lt;/packaging&gt;
	&lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
	&lt;modules&gt;
		&lt;module&gt;ria&lt;/module&gt;
		&lt;module&gt;model&lt;/module&gt;
		&lt;module&gt;exceptions_web&lt;/module&gt;
		&lt;module&gt;forms_web&lt;/module&gt;
	&lt;/modules&gt;
&lt;/project&gt;
</pre>
<p>Download complete project structure with Maven scripts <a href="http://www.libertyleap.com/skusunam/wp-content/uploads/2009/03/flex-multimodule1.zip">here</a><br />
</p>
<blockquote><p>For the latest release of flex-mojos please access this <a href="https://docs.sonatype.org/" target="_blank">wiki</a> and also there is a very good example there in building Flex / Java and BlazeDS  i.e.  <a href="http://svn.sonatype.org/flexmojos/trunk/flexmojos-touchstone/todolist" target="_blank">Reference application</a>.<br />
If you have any questions use this friendly group @ <a href="http://code.google.com/p/flex-mojos/">http://code.google.com/p/flex-mojos/</a>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.srinivaskusunam.com/2009/03/23/flex-java-multi-module-project-structure-for-maven/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
