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

<channel>
	<title>Solution Hacker &#187; BlazeDS</title>
	<atom:link href="http://www.solutionhacker.com/tag/blazeds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:19:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=305</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>This blog provides solutions for enterpreneurs!</itunes:summary>
	<itunes:author>Solution Hacker</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.solutionhacker.com/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:subtitle>This blog provides solutions for enterpreneurs!</itunes:subtitle>
	<image>
		<title>Solution Hacker &#187; BlazeDS</title>
		<url>http://www.solutionhacker.com/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://www.solutionhacker.com</link>
	</image>
		<item>
		<title>Wiring up Flex, Mate, BlazeDS, Spring, Hibernate and MySQL with Maven 2 &#8211; Part 1</title>
		<link>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/</link>
		<comments>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 10:50:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[5. Fun]]></category>
		<category><![CDATA[6. Uncategorized]]></category>
		<category><![CDATA[Site Building]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[application stack]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[build process]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jetty plugin]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=199</guid>
		<description><![CDATA[<h2>Introduction</h2>
<p>This article is written on top of the great work that&#160;<strong>Sébastien Arbogast </strong>has done. He has written 3 articles that showed you how to wire up Flex, BlazeDS, Spring, Hibernate and MySQL with Maven as build process. I have included his articles below as your reference.</p>
<ol>
    <li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html">The Flex, Spring, and BlazeDS full stack – Part 1: Creating a Flex module</a></li>
    <li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html">The Flex, Spring and BlazeDS full stack – Part 2: Writing the to-do list server</a></li>
    <li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html">The Flex, Spring and BlazeDS full stack – Part 3: Putting the application together</a></li>
</ol>
<p>I have found Sebastien's work as a good foundation for my own project. To contribute back to the community, I will write a series of articles to show you how can customize and extend the todolist sample.</p>
<p><u>What is in the Part 1 of the series...</u></p>
<ol>
    <li>Enhancements on the <strong>Maven </strong>build process
    <ul>
        <li>Leverage <strong>RSL </strong>to factor our the framework swc, so the size of the application swf will be reduced. Apart from that, I also take advantage of <strong>Flash Player Cache</strong> that is available after version 9 update 3 to cache the framework libraries.</li>
        <li>Clean up the Flex and <strong>BlazeDS </strong>dependencies in POM as the latest version of the sdk is available and the BlazeDS dependencies are officially available.</li>
        <li>Include some common reports for maven site generation</li>
        <li>Embed <strong>Jetty</strong> web server in the build process for quick deployment and testing</li>
    </ul>
    </li>
    <li>Document how to get the sample up on <strong>Eclipse </strong>for development<strong><br />
    </strong></li>
    <li>Use <strong>Mate </strong>as Flex framework
    <ul>
        <li>Restructure ToDoList sample to leverage Mate framework</li>
        <li>Factor out Mate as RSL and integrate it with Maven build process via Flex-mojo plugin.</li>
    </ul>
    </li>
</ol>
<p><u>What are in the coming articles...</u></p>
<ol>
    <li>In part 2 of this series, I will show you how to use flex-mojo to build a modular Flex application.</li>
    <li>In part 3 of this series, I will show you how to test your flex app via FlexUnit (Unit test) and FlexMonkey (Functional test)</li>
    <li>In part 4 or this series, I will work on server side. I am planning to add monitoring, caching and security to the server side.</li>
</ol>
<p><!--more--><!--more--></p>
<h2><!--more-->Review "ToDoList" sample</h2>
<p>Before I start my journey, let me highlight what Sebastien has done first:</p>
<ol>
    <li>Sebastien's sample demonstrates how to use Maven as a build process. There are 3 parts or subprojects in his sample. They are:<br />
    <ul>
        <li><strong>todolist-config</strong> (configuration files shared by other subprojects)</li>
        <li><strong>todolist-ria </strong>(Flex frontend)</li>
        <li><strong>todolist-web</strong> (Server side that supports the Frontend)</li>
    </ul>
    </li>
    <li>All these subprojects are considered as <strong>modules </strong>of the main project (root POM). Finally, they are combined together into war artifact and ready to deploy to Tomcat or other J2EE webapp server.</li>
    <li>Flex frontend and backend communicate through a binary RPC protocol - <strong>AMF</strong>. AMF is considered to be the simplest and fastest remoting approach available in Flex. Recently, Adobe has released BlazeDS as an open source implementation of AMF spec. In this sample, <strong>BlazeDS </strong>is used. To use BlazeDS, there are few things you need to do:<br />
    <ul>
        <li>Externalize your POJO service via BlazeDS. This sample shows you how to integrate BlazeDS with Spring</li>
        <li>Make BlazeDS endpoints availabe to the Net via Servlet.</li>
        <li>Have frontend and backend shared the same BlazeDS configuration files.</li>
    </ul>
    </li>
    <li>In this sample, you can also find out how to use <strong>flex-mojo</strong> maven plugin to compile the Flex frontend code into swf. Apart from <a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">flex-mojo plugin</a>, there are other two good plugins worth to mention:<br />
    <ul>
        <li><strong>maven-assembly-plugin </strong>- can be used to bundle all the files under a directory into a zip file. It is used by todolist-config to bundle all the configuration files (<strong>service-config.xml </strong>and <strong>remoting-config.xml</strong>) into a zip during the <strong>package </strong>phase.</li>
        <li><strong>maven-dependency-plugin</strong><strong> - </strong>can be used to unpack the zip file and move to the place you want. It is used by todolist-web to unpack the config zip during the <strong>generate-resources</strong> phase.</li>
    </ul>
    </li>
</ol>
<h2>Enhancements on maven POM</h2>
<p>I have modified the sample's maven pom as follows:</p>
<ul>
    <li>Link to new repository "<strong>Sonatype Forge</strong>" in the root POM. So, I can use the new version of flex-mojo and simplify the todolist-ria adobe framework dependencies. Apart from that, I also take away the private repository from Sebastein because BlazeDS libraries are available in official maven repository (Note: The BlazeDS libraries available in official maven repo are in version 3.0 instead of 3.0.0.544. So, you need to modify the webapp pom correspondingly).</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &#60;repositories&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;repository&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;id&#62;flex-mojos-repository&#60;/id&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;url&#62;http://svn.sonatype.org/flexmojos/repository/&#60;/url&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;releases&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;enabled&#62;true&#60;/enabled&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/releases&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;snapshots&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;enabled&#62;false&#60;/enabled&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/snapshots&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/repository&#62;<br />
&#160;&#160;&#160; &#60;/repositories&#62;<br />
<br />
&#160;&#160;&#160; &#60;pluginRepositories&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;pluginRepository&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;id&#62;flex-mojos-repository&#60;/id&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;url&#62;http://svn.sonatype.org/flexmojos/repository/&#60;/url&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;releases&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;enabled&#62;true&#60;/enabled&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/releases&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;snapshots&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;enabled&#62;false&#60;/enabled&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/snapshots&#62;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/pluginRepository&#62;<br />
&#160;&#160;&#160; &#60;/pluginRepositories&#62;</p>
</blockquote>
<ul>
    <li>Because I link to Sonatype repository, I can have my todolist-ria depends on one flex-framework pom dependency instead of all the swc dependencies. Note that the pom dependency is a way to factor out all the adobe swc dependencies that makes your pom easier to maintain.</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#60;dependency&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;groupId&#62;com.adobe.flex.framework&#60;/groupId&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;artifactId&#62;flex-framework&#60;/artifactId&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;version&#62;3.1.0.2710&#60;/version&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;type&#62;pom&#60;/type&#62;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#60;/dependency&#62;</p>
</blockquote>
<ul>
    <li>I include mysql driver as dependency in my webapp pom. I think it is cleaner to bundle it in war. I have also added <strong>jetty plugin</strong> in the POM so you have a web server embedded in the build process. With this, you can run this sample application right after you check it out from svn (assume you have maven 2 installed). To start jetty, you can issue the following maven command under your webapp project.</li>
</ul>
<blockquote>
<p>project_root&#62; mvn clean install<br />
project_root/jp-web&#62; mvn jetty:run-war</p>
</blockquote>
<ul>
    <li>I have included some reports that will be shown after site generation. You may not be able to do <strong>mvn site-deploy </strong>because it is linked to my web hosting site. However, you can modify it for your own sake.</li>
</ul>
<h2>Get the sample up on Eclipse</h2>
<p>To develop on Eclipse, you can follow the steps below:</p>
<ol>
    <li>Create Eclipse project file via running the command below at the project root. This will create 2 eclipse projects. One for todolist-ria and one for the webapp. You noticed that I use the <strong>-Declipse.downloadSource=true</strong> to include the source files of my dependencies in my eclipse project. Therefore, I can get to the source code if needed.</li>
</ol>
<blockquote>
<p>mvn -Declipse.downloadSource=true eclipse:eclipse</p>
</blockquote>
<ol>
    <li>Import the projects into Eclipse</li>
    <li>Add new variable<strong> M2_REPO</strong> and set it equals to<strong> [home]/.m2/repository</strong></li>
    <li>If you have installed <strong>Flex Builder plugin</strong> to your Eclipse, you can Add <strong>Flex Project Nature</strong> to the todolist-ria project.
    <ul>
        <li>Select Application Server Type: J2EE</li>
        <li>Put check on "Use remote object access service" with LiveCycle Data Service selected.</li>
        <li>Set up the path. I have my tomcat installed under C:\tools with default <strong>8080 </strong>as port. You should make the changes if you installed it differently.</li>
        <li><img src="http://www.solutionhacker.com/wp-content/uploads/image/flexEclipse1.JPG" style="width: 531px; height: 284px;" alt="" /></li>
        <li>Remove the generated <strong>main.mxml</strong> under the src folder.</li>
        <li>Set <strong>index.mxml </strong>under src folder as default Flex application file to run.</li>
        <li>Use <strong>Default Flex SDK </strong>in Flex Compiler Configuration instead of Server Flex SDK</li>
        <li>Right click and select <strong>Recreate HTML Template</strong> if you see error.</li>
        <li>After all these, you have configured your Flex application pointing to the webapp server and sharing the BlazeDS configuration files. You can verify in Flex Compiler Configuration's Additional Compiler Parameters. See whether you see this: <strong>-services "C:\tools\tomcat-6.0.16\webapps\jp\WEB-INF\flex\services-config.xml" -locale en_US</strong></li>
        <li>Move the war to your tomcat's webapp folder and start it under remote debugging setting. If you are using window, set<strong> DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n</strong> under your bin/catalina.bat.</li>
        <li>Start your webapp via bin/startup.bat</li>
        <li>Put breakpoint under <strong>TodoServiceImpl</strong> save method and start remote debugger on localhost:8787</li>
        <li>Right click the<strong> index.mxml</strong> and Run As Flex Application.</li>
        <li>Add a new entry and save it on the flex app. <img onclick="grin(':razz:');" alt=":razz:" src="../../../../../wp-includes/images/smilies/icon_razz.gif" /> You should see your remote debugger halt at the breakpoint for you to debug.</li>
        <li>Now you can change your flex code and test it out without leaving your Eclipse. However, if you modify the service in webapp, you need to run "<strong>mvn clean install</strong>" and deploy the war to the tomcat before your flex code can call your server-side code via <strong>AMF</strong>.</li>
    </ul>
    </li>
</ol>
<h2>Use Mate as Framework</h2>
<p>If you are not familiar with Mate, click the image below that moves you to a nice presentation.</p>
<p>&#160;<a href="http://mate.asfusion.com/assets/content//presentations/360_max_presentation.pdf"><img src="http://www.solutionhacker.com/wp-content/uploads/image/mate1.JPG" style="width: 589px; height: 339px;" alt="" /></a></p>
<p><u>What did I do to restructure the todolist sample to make it Mate app?</u></p>
<ol>
    <li>&#160;</li>
</ol>
<h2>Download</h2>
<p>I have made my work available at: <a href="http://www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip">www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip</a></p>
<h2>Reference</h2>
<p>Below are the references I used for the article:</p>
<ol>
    <li><a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">Flex mojo compiler user guide</a></li>
    <li><a href="http://blog.flex-mojos.info/2008/06/04/scopes/">Flex mojo dependency scope rules</a></li>
    <li><a href="http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs">Flex 3 feature introduction: Flex 3 RSL</a></li>
    <li><a href="http://www.adobe.com/devnet/flex/articles/flash_player_cache.html">Improving Flex application performance using Flash Player Cache</a></li>
    <li><a href="http://fna.googlecode.com/svn/trunk/fna/site/mvn_archetypes/index.html">FNA archetype projects&#160;</a></li>
</ol>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This article is written on top of the great work that&#160;<strong>Sébastien Arbogast </strong>has done. He has written 3 articles that showed you how to wire up Flex, BlazeDS, Spring, Hibernate and MySQL with Maven as build process. I have included his articles below as your reference.</p>
<ol>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html">The Flex, Spring, and BlazeDS full stack – Part 1: Creating a Flex module</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html">The Flex, Spring and BlazeDS full stack – Part 2: Writing the to-do list server</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html">The Flex, Spring and BlazeDS full stack – Part 3: Putting the application together</a></li>
</ol>
<p>I have found Sebastien&#8217;s work as a good foundation for my own project. To contribute back to the community, I will write a series of articles to show you how can customize and extend the todolist sample.</p>
<p><u>What is in the Part 1 of the series&#8230;</u></p>
<ol>
<li>Enhancements on the <strong>Maven </strong>build process
<ul>
<li>Leverage <strong>RSL </strong>to factor our the framework swc, so the size of the application swf will be reduced. Apart from that, I also take advantage of <strong>Flash Player Cache</strong> that is available after version 9 update 3 to cache the framework libraries.</li>
<li>Clean up the Flex and <strong>BlazeDS </strong>dependencies in POM as the latest version of the sdk is available and the BlazeDS dependencies are officially available.</li>
<li>Include some common reports for maven site generation</li>
<li>Embed <strong>Jetty</strong> web server in the build process for quick deployment and testing</li>
</ul>
</li>
<li>Document how to get the sample up on <strong>Eclipse </strong>for development<strong><br />
    </strong></li>
<li>Use <strong>Mate </strong>as Flex framework
<ul>
<li>Restructure ToDoList sample to leverage Mate framework</li>
<li>Factor out Mate as RSL and integrate it with Maven build process via Flex-mojo plugin.</li>
</ul>
</li>
</ol>
<p><u>What are in the coming articles&#8230;</u></p>
<ol>
<li>In part 2 of this series, I will show you how to use flex-mojo to build a modular Flex application.</li>
<li>In part 3 of this series, I will show you how to test your flex app via FlexUnit (Unit test) and FlexMonkey (Functional test)</li>
<li>In part 4 or this series, I will work on server side. I am planning to add monitoring, caching and security to the server side.</li>
</ol>
<p><span id="more-199"></span><!--more--></p>
<h2><!--more-->Review &#8220;ToDoList&#8221; sample</h2>
<p>Before I start my journey, let me highlight what Sebastien has done first:</p>
<ol>
<li>Sebastien&#8217;s sample demonstrates how to use Maven as a build process. There are 3 parts or subprojects in his sample. They are:
<ul>
<li><strong>todolist-config</strong> (configuration files shared by other subprojects)</li>
<li><strong>todolist-ria </strong>(Flex frontend)</li>
<li><strong>todolist-web</strong> (Server side that supports the Frontend)</li>
</ul>
</li>
<li>All these subprojects are considered as <strong>modules </strong>of the main project (root POM). Finally, they are combined together into war artifact and ready to deploy to Tomcat or other J2EE webapp server.</li>
<li>Flex frontend and backend communicate through a binary RPC protocol &#8211; <strong>AMF</strong>. AMF is considered to be the simplest and fastest remoting approach available in Flex. Recently, Adobe has released BlazeDS as an open source implementation of AMF spec. In this sample, <strong>BlazeDS </strong>is used. To use BlazeDS, there are few things you need to do:
<ul>
<li>Externalize your POJO service via BlazeDS. This sample shows you how to integrate BlazeDS with Spring</li>
<li>Make BlazeDS endpoints availabe to the Net via Servlet.</li>
<li>Have frontend and backend shared the same BlazeDS configuration files.</li>
</ul>
</li>
<li>In this sample, you can also find out how to use <strong>flex-mojo</strong> maven plugin to compile the Flex frontend code into swf. Apart from <a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">flex-mojo plugin</a>, there are other two good plugins worth to mention:
<ul>
<li><strong>maven-assembly-plugin </strong>- can be used to bundle all the files under a directory into a zip file. It is used by todolist-config to bundle all the configuration files (<strong>service-config.xml </strong>and <strong>remoting-config.xml</strong>) into a zip during the <strong>package </strong>phase.</li>
<li><strong>maven-dependency-plugin</strong><strong> &#8211; </strong>can be used to unpack the zip file and move to the place you want. It is used by todolist-web to unpack the config zip during the <strong>generate-resources</strong> phase.</li>
</ul>
</li>
</ol>
<h2>Enhancements on maven POM</h2>
<p>I have modified the sample&#8217;s maven pom as follows:</p>
<ul>
<li>Link to new repository &#8220;<strong>Sonatype Forge</strong>&#8221; in the root POM. So, I can use the new version of flex-mojo and simplify the todolist-ria adobe framework dependencies. Apart from that, I also take away the private repository from Sebastein because BlazeDS libraries are available in official maven repository (Note: The BlazeDS libraries available in official maven repo are in version 3.0 instead of 3.0.0.544. So, you need to modify the webapp pom correspondingly).</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &lt;repositories&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;repository&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;id&gt;flex-mojos-repository&lt;/id&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url&gt;http://svn.sonatype.org/flexmojos/repository/&lt;/url&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;true&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;false&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/repository&gt;<br />
&#160;&#160;&#160; &lt;/repositories&gt;</p>
<p>&#160;&#160;&#160; &lt;pluginRepositories&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pluginRepository&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;id&gt;flex-mojos-repository&lt;/id&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url&gt;http://svn.sonatype.org/flexmojos/repository/&lt;/url&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;true&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;false&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/pluginRepository&gt;<br />
&#160;&#160;&#160; &lt;/pluginRepositories&gt;</p>
</blockquote>
<ul>
<li>Because I link to Sonatype repository, I can have my todolist-ria depends on one flex-framework pom dependency instead of all the swc dependencies. Note that the pom dependency is a way to factor out all the adobe swc dependencies that makes your pom easier to maintain.</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &lt;dependency&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;groupId&gt;com.adobe.flex.framework&lt;/groupId&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;artifactId&gt;flex-framework&lt;/artifactId&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;version&gt;3.1.0.2710&lt;/version&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;type&gt;pom&lt;/type&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &lt;/dependency&gt;</p>
</blockquote>
<ul>
<li>I include mysql driver as dependency in my webapp pom. I think it is cleaner to bundle it in war. I have also added <strong>jetty plugin</strong> in the POM so you have a web server embedded in the build process. With this, you can run this sample application right after you check it out from svn (assume you have maven 2 installed). To start jetty, you can issue the following maven command under your webapp project.</li>
</ul>
<blockquote>
<p>project_root&gt; mvn clean install<br />
project_root/jp-web&gt; mvn jetty:run-war</p>
</blockquote>
<ul>
<li>I have included some reports that will be shown after site generation. You may not be able to do <strong>mvn site-deploy </strong>because it is linked to my web hosting site. However, you can modify it for your own sake.</li>
</ul>
<h2>Get the sample up on Eclipse</h2>
<p>To develop on Eclipse, you can follow the steps below:</p>
<ol>
<li>Create Eclipse project file via running the command below at the project root. This will create 2 eclipse projects. One for todolist-ria and one for the webapp. You noticed that I use the <strong>-Declipse.downloadSource=true</strong> to include the source files of my dependencies in my eclipse project. Therefore, I can get to the source code if needed.</li>
</ol>
<blockquote>
<p>mvn -Declipse.downloadSource=true eclipse:eclipse</p>
</blockquote>
<ol>
<li>Import the projects into Eclipse</li>
<li>Add new variable<strong> M2_REPO</strong> and set it equals to<strong> [home]/.m2/repository</strong></li>
<li>If you have installed <strong>Flex Builder plugin</strong> to your Eclipse, you can Add <strong>Flex Project Nature</strong> to the todolist-ria project.
<ul>
<li>Select Application Server Type: J2EE</li>
<li>Put check on &#8220;Use remote object access service&#8221; with LiveCycle Data Service selected.</li>
<li>Set up the path. I have my tomcat installed under C:\tools with default <strong>8080 </strong>as port. You should make the changes if you installed it differently.</li>
<li><img src="http://www.solutionhacker.com/wp-content/uploads/image/flexEclipse1.JPG" style="width: 531px; height: 284px;" alt="" /></li>
<li>Remove the generated <strong>main.mxml</strong> under the src folder.</li>
<li>Set <strong>index.mxml </strong>under src folder as default Flex application file to run.</li>
<li>Use <strong>Default Flex SDK </strong>in Flex Compiler Configuration instead of Server Flex SDK</li>
<li>Right click and select <strong>Recreate HTML Template</strong> if you see error.</li>
<li>After all these, you have configured your Flex application pointing to the webapp server and sharing the BlazeDS configuration files. You can verify in Flex Compiler Configuration&#8217;s Additional Compiler Parameters. See whether you see this: <strong>-services &#8220;C:\tools\tomcat-6.0.16\webapps\jp\WEB-INF\flex\services-config.xml&#8221; -locale en_US</strong></li>
<li>Move the war to your tomcat&#8217;s webapp folder and start it under remote debugging setting. If you are using window, set<strong> DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n</strong> under your bin/catalina.bat.</li>
<li>Start your webapp via bin/startup.bat</li>
<li>Put breakpoint under <strong>TodoServiceImpl</strong> save method and start remote debugger on localhost:8787</li>
<li>Right click the<strong> index.mxml</strong> and Run As Flex Application.</li>
<li>Add a new entry and save it on the flex app. <img onclick="grin(':razz:');" alt=":razz:" src="../../../../../wp-includes/images/smilies/icon_razz.gif" /> You should see your remote debugger halt at the breakpoint for you to debug.</li>
<li>Now you can change your flex code and test it out without leaving your Eclipse. However, if you modify the service in webapp, you need to run &#8220;<strong>mvn clean install</strong>&#8221; and deploy the war to the tomcat before your flex code can call your server-side code via <strong>AMF</strong>.</li>
</ul>
</li>
</ol>
<h2>Use Mate as Framework</h2>
<p>If you are not familiar with Mate, click the image below that moves you to a nice presentation.</p>
<p>&#160;<a href="http://mate.asfusion.com/assets/content//presentations/360_max_presentation.pdf"><img src="http://www.solutionhacker.com/wp-content/uploads/image/mate1.JPG" style="width: 589px; height: 339px;" alt="" /></a></p>
<p><u>What did I do to restructure the todolist sample to make it Mate app?</u></p>
<ol>
<li>&#160;</li>
</ol>
<h2>Download</h2>
<p>I have made my work available at: <a href="http://www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip">www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip</a></p>
<h2>Reference</h2>
<p>Below are the references I used for the article:</p>
<ol>
<li><a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">Flex mojo compiler user guide</a></li>
<li><a href="http://blog.flex-mojos.info/2008/06/04/scopes/">Flex mojo dependency scope rules</a></li>
<li><a href="http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs">Flex 3 feature introduction: Flex 3 RSL</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/flash_player_cache.html">Improving Flex application performance using Flash Player Cache</a></li>
<li><a href="http://fna.googlecode.com/svn/trunk/fna/site/mvn_archetypes/index.html">FNA archetype projects&#160;</a></li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Remoting and Session Management</title>
		<link>http://www.solutionhacker.com/data-intelligence/report/flex-remoting-and-session-management/</link>
		<comments>http://www.solutionhacker.com/data-intelligence/report/flex-remoting-and-session-management/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 10:10:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/2008/06/22/flex-remoting-and-session-management/</guid>
		<description><![CDATA[<h2>Power of BlazeDS</h2>
<p>Recently, I found out that Adobe has released BlazeDS (subset of LiveCycleDS) that has 4 main advantages:</p>
<ol>
    <li>AS3 to Java object communication (no XML passes back and forth is needed!)</li>
    <li>Boost up performance b/c AMF is a binary protocol</li>
    <li>Built-in proxy support that gets around the cross domain security issue from Flex in ease.</li>
    <li>Allow push messaging</li>
</ol>
<p>I have followed the guideline and set it up. Now my Flex application can call my Java object method without passing xml back and forth. It is awesome! During the setup process, you may experience your flex cannot find the destination set up in the server.</p>
<div class="content"><blockquote>
<p>The error &#8220;[MessagingError message=&#8217;Destination &#8216;SomeBean&#8217; either does not exist or the destination has no channels defined (and the application does not define any default channels.)&#8217;]&#8221;.</p>
</blockquote></div>
<p>The trick here is to add a services argument to the mxmlc call, something of the form below should do the trick!&#160;</p>
<blockquote>
<p>-services &#8220;[local path to your java project]/WEB-INF/flex/services-config.xml&#8221;</p>
</blockquote>
<p>Now you may start enjoying how AS3 talks to your Java Object. However, if&#160; we bypass the Servlet layer in the code, how can we carry session across remote method calls? Great that I have found out how to handle it via this <a href="http://sujitreddyg.wordpress.com/2008/05/16/session-data-management-in-flex-remoting/">article</a>. In short, you can access Session from your Java object via:</p>
<blockquote>
<p>FlexContext.getFlexSession()</p>
</blockquote>
<p>Here is the quote I got from the <a href="http://livedocs.adobe.com/blazeds/1/blazeds_devguide/">BlazeDS developer guide</a>.</p>
<blockquote>
<p>The FlexContext class is useful for getting access to the session and the HTTP pieces of the session, such as the HTTP servlet request and response. This lets you access HTTP data when you use a Flex application in the context of a larger web application where other classes, such as JSPs or Struts actions, might have stored information.</p>
<p>The FlexSession class provides access to an ID and also provides <samp class="codeph">setAttribute</samp> and <samp class="codeph">getAttribute</samp> functionality. This is useful for storing data on the server that doesn't have to go back to the client. However, FlexSession is not cluster-aware; if a client connects to a different server in the cluster, the client receives a new FlexSession. Nothing stored in the FlexSession attributes is persisted for clustering purposes. The FlexSessionListener class is useful for monitoring who is connected. You add a listener by using the static method to track new connections being made. You receive a reference to the session that was added. Each session can then report when it is destroyed to those same listeners. You use this for monitoring connections that close, and also to clean up resources.</p>
</blockquote>
<p>When I looked into the source of FlexContext, I noticed that it leverages <strong>ThreadLocal </strong>to store context info like request, response and session.</p>
<pre name="code" class="java">
    private static ThreadLocal sessions = new ThreadLocal();  
    /**
     * The FlexSession for the current request.  Available for users.
     */
    public static FlexSession getFlexSession()
    {
        return (FlexSession)sessions.get();
    }
</pre>
<h2>Reference</h2>
<p>Below are some of the useful references I have read so far:</p>
<ol>
    <li><a href="http://jim-boone.com/2008/04/10/ria-prototype-client-using-blazeds-messaging-and-jms-j2ee-server/#more-33">Jim Boone's Blog</a></li>
</ol>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<h2>Power of BlazeDS</h2>
<p>Recently, I found out that Adobe has released BlazeDS (subset of LiveCycleDS) that has 4 main advantages:</p>
<ol>
<li>AS3 to Java object communication (no XML passes back and forth is needed!)</li>
<li>Boost up performance b/c AMF is a binary protocol</li>
<li>Built-in proxy support that gets around the cross domain security issue from Flex in ease.</li>
<li>Allow push messaging</li>
</ol>
<p>I have followed the guideline and set it up. Now my Flex application can call my Java object method without passing xml back and forth. It is awesome! During the setup process, you may experience your flex cannot find the destination set up in the server.</p>
<div class="content">
<blockquote>
<p>The error &ldquo;[MessagingError message=&rsquo;Destination &lsquo;SomeBean&rsquo; either does not exist or the destination has no channels defined (and the application does not define any default channels.)&rsquo;]&rdquo;.</p>
</blockquote>
</div>
<p>The trick here is to add a services argument to the mxmlc call, something of the form below should do the trick!&nbsp;</p>
<blockquote>
<p>-services &ldquo;[local path to your java project]/WEB-INF/flex/services-config.xml&rdquo;</p>
</blockquote>
<p>Now you may start enjoying how AS3 talks to your Java Object. However, if&nbsp; we bypass the Servlet layer in the code, how can we carry session across remote method calls? Great that I have found out how to handle it via this <a href="http://sujitreddyg.wordpress.com/2008/05/16/session-data-management-in-flex-remoting/">article</a>. In short, you can access Session from your Java object via:</p>
<blockquote>
<p>FlexContext.getFlexSession()</p>
</blockquote>
<p>Here is the quote I got from the <a href="http://livedocs.adobe.com/blazeds/1/blazeds_devguide/">BlazeDS developer guide</a>.</p>
<blockquote>
<p>The FlexContext class is useful for getting access to the session and the HTTP pieces of the session, such as the HTTP servlet request and response. This lets you access HTTP data when you use a Flex application in the context of a larger web application where other classes, such as JSPs or Struts actions, might have stored information.</p>
<p>The FlexSession class provides access to an ID and also provides <samp class="codeph">setAttribute</samp> and <samp class="codeph">getAttribute</samp> functionality. This is useful for storing data on the server that doesn&#8217;t have to go back to the client. However, FlexSession is not cluster-aware; if a client connects to a different server in the cluster, the client receives a new FlexSession. Nothing stored in the FlexSession attributes is persisted for clustering purposes. The FlexSessionListener class is useful for monitoring who is connected. You add a listener by using the static method to track new connections being made. You receive a reference to the session that was added. Each session can then report when it is destroyed to those same listeners. You use this for monitoring connections that close, and also to clean up resources.</p>
</blockquote>
<p>When I looked into the source of FlexContext, I noticed that it leverages <strong>ThreadLocal </strong>to store context info like request, response and session.</p>
<p><pre><pre name="code" class="java">
&nbsp;&nbsp;&nbsp;&nbsp;private static ThreadLocal sessions = new ThreadLocal();&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;/**
&nbsp;&nbsp;&nbsp;&nbsp; * The FlexSession for the current request.&nbsp;&nbsp;Available for users.
&nbsp;&nbsp;&nbsp;&nbsp; */
&nbsp;&nbsp;&nbsp;&nbsp;public static FlexSession getFlexSession()
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (FlexSession)sessions.get();
&nbsp;&nbsp;&nbsp;&nbsp;}
</pre></pre></p>
<h2>Reference</h2>
<p>Below are some of the useful references I have read so far:</p>
<ol>
<li><a href="http://jim-boone.com/2008/04/10/ria-prototype-client-using-blazeds-messaging-and-jms-j2ee-server/#more-33">Jim Boone&#8217;s Blog</a></li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/data-intelligence/report/flex-remoting-and-session-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Flex for RIA, no AJAX?</title>
		<link>http://www.solutionhacker.com/data-intelligence/report/why-flex-for-ria/</link>
		<comments>http://www.solutionhacker.com/data-intelligence/report/why-flex-for-ria/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 03:12:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Report]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/2007/08/26/why-flex-for-ria/</guid>
		<description><![CDATA[<p>Here is the list of reasons why I chose Flex for the RIA development.</p>
<ol>
    <li><strong>Write Once Deploy Everywhere</strong> - Flex generates SWF that runs on top of Flash Player VM and behaves consistently across different browsers, even mobile phones later. With this, all the browser compatibility issues are basically offloaded by Adobe.</li>
    <li><strong>Solid programming model</strong> with rich widgets and libraries.</li>
    <li><strong>AMF makes Flex object to Java POJO communication possible</strong>. No need to use verbose XML - Check out <strong>BlazeDS</strong>.</li>
    <li><strong>Flex IDE</strong> is a plugin in Eclipse that gives stepwise debugging, UI design console, code completion and more. Working with Actionscript is like Java.</li>
    <li><strong>Flex SDK is open source and free.</strong></li>
    <li><strong>Great support on video streaming</strong></li>
    <li><strong>Integrate with HTML, Javascript and CSS</strong>, so it is not invasive adoption.</li>
    <li><strong>Support offline application via AIR</strong> - Adobe has been working on the <a href="http://labs.adobe.com/technologies/air/">Adobe Integrated Runtime (AIR)</a> that allows for using existing web application development skills to build and deploy desktop applications. <strong>AIR </strong>is still in early development, but promises to allow developers to use their newly learned Flex skills to build desktop applications. No need to learn Swing, Applet...etc.</li>
    <li><strong>Provide several RPC methods</strong> like HTTPService, WebService, AMF and JSON. AMF is 10x faster than SOAP. James Ward developed his Census Flex application to provide performance benchmarks for the different RPC methods in the mainstream RIA technologies. (<a href="http://flexapps.cvs.sourceforge.net/flexapps/census/">Download</a>)</li>
    <li>You can<strong> keep the state in the Flex app</strong> and have your server completely stateless.</li>
    <li>More to come! :)</li>
</ol>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<p>Here is the list of reasons why I chose Flex for the RIA development.</p>
<ol>
<li><strong>Write Once Deploy Everywhere</strong> &#8211; Flex generates SWF that runs on top of Flash Player VM and behaves consistently across different browsers, even mobile phones later. With this, all the browser compatibility issues are basically offloaded by Adobe.</li>
<li><strong>Solid programming model</strong> with rich widgets and libraries.</li>
<li><strong>AMF makes Flex object to Java POJO communication possible</strong>. No need to use verbose XML &#8211; Check out <strong>BlazeDS</strong>.</li>
<li><strong>Flex IDE</strong> is a plugin in Eclipse that gives stepwise debugging, UI design console, code completion and more. Working with Actionscript is like Java.</li>
<li><strong>Flex SDK is open source and free.</strong></li>
<li><strong>Great support on video streaming</strong></li>
<li><strong>Integrate with HTML, Javascript and CSS</strong>, so it is not invasive adoption.</li>
<li><strong>Support offline application via AIR</strong> &#8211; Adobe has been working on the <a href="http://labs.adobe.com/technologies/air/">Adobe Integrated Runtime (AIR)</a> that allows for using existing web application development skills to build and deploy desktop applications. <strong>AIR </strong>is still in early development, but promises to allow developers to use their newly learned Flex skills to build desktop applications. No need to learn Swing, Applet&#8230;etc.</li>
<li><strong>Provide several RPC methods</strong> like HTTPService, WebService, AMF and JSON. AMF is 10x faster than SOAP. James Ward developed his Census Flex application to provide performance benchmarks for the different RPC methods in the mainstream RIA technologies. (<a href="http://flexapps.cvs.sourceforge.net/flexapps/census/">Download</a>)</li>
<li>You can<strong> keep the state in the Flex app</strong> and have your server completely stateless.</li>
<li>More to come! <img src='http://www.solutionhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/data-intelligence/report/why-flex-for-ria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

