<?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>Jeff Douglas - Technology, Coding and Bears... OH MY! &#187; Flex</title>
	<atom:link href="http://blog.jeffdouglas.com/category/technology/flex-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffdouglas.com</link>
	<description>Get your head out of your #@! and into the clouds!</description>
	<lastBuildDate>Thu, 02 Feb 2012 11:57:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Developing Apps with the Adobe Flash Builder for Force.com</title>
		<link>http://blog.jeffdouglas.com/2010/01/11/developing-apps-with-the-stratus-framework/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=developing-apps-with-the-stratus-framework</link>
		<comments>http://blog.jeffdouglas.com/2010/01/11/developing-apps-with-the-stratus-framework/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 03:27:52 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=2018</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of work the past couple of weeks with the new Adobe Flash Builder for Force.com and the new Stratus framework. I&#8217;m in the putting together a fairly large Adobe Air demo and an accompanying blog post. In the meantime I ported a small app from Flex 3 to the new [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2010%2F01%2F11%2Fdeveloping-apps-with-the-stratus-framework%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2010%2F01%2F11%2Fdeveloping-apps-with-the-stratus-framework%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been doing a lot of work the past couple of weeks with the new <a href="http://developer.force.com/flashbuilder">Adobe Flash Builder for Force.com</a> and the new Stratus framework. I&#8217;m in the putting together a fairly large Adobe Air demo and an accompanying blog post. In the meantime I ported a small app from Flex 3 to the new Adobe Flash Builder for Force.com and did a small screencast of some new functionality. It was a demo that I did of a way to provide a graphical representation of an floor layout (warehouse, real estate, floorplan, etc.) and show how to tie the elements to distinct records in Salesforce.com.</p>
<p><span class="youtube">
<object width="560" height="340">
<param name="movie" value="http://www.youtube.com/v/ZGTiQD0J5bs?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;loop=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1&amp;hd=1&#038;w=550" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube.com/v/ZGTiQD0J5bs?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;loop=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1&amp;hd=1&#038;w=550" type="application/x-shockwave-flash" allowfullscreen="true" width="560" height="340"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=ZGTiQD0J5bs&fmt=18">www.youtube.com/watch?v=ZGTiQD0J5bs</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2010/01/11/developing-apps-with-the-stratus-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Embed a Flex Slider in a Visualforce Page</title>
		<link>http://blog.jeffdouglas.com/2009/10/29/embed-a-flex-slider-in-a-visualforce-page/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=embed-a-flex-slider-in-a-visualforce-page</link>
		<comments>http://blog.jeffdouglas.com/2009/10/29/embed-a-flex-slider-in-a-visualforce-page/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 17:45:41 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Visualforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1552</guid>
		<description><![CDATA[I did a simple Flex callback with JavaScript about a year ago and I always wanted to follow up with this topic. Somehow I never quite found the time. This is an example of how you can create a Flex component (a horizontal slider in this case), wrap it up as a Visualforce component and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F10%2F29%2Fembed-a-flex-slider-in-a-visualforce-page%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F10%2F29%2Fembed-a-flex-slider-in-a-visualforce-page%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I did a simple <a href="http://blog.jeffdouglas.com/2008/12/09/flex-callback-example-with-visualforce/" target="_blank">Flex callback with JavaScript</a> about a year ago and I always wanted to follow up with this topic. Somehow I never quite found the time. This is an example of how you can create a Flex component (a horizontal slider in this case), wrap it up as a Visualforce component and then make it reusable in your Visualforce pages. This technique provides you with some great ways to add &#8220;eye candy&#8221; to your Visualforce pages without breaking the UI model.</p>
<p><strong>You can </strong><a href="http://jeffdouglas-developer-edition.na5.force.com/examples/flex_slider_example?id=a0H70000002Klmx" target="_blank"><strong>run this example</strong></a><strong> on my Developer Site.</strong></p>
<p><a href="http://jeffdouglas-developer-edition.na5.force.com/examples/flex_slider_example?id=a0H70000002Klmx"><img class="alignnone size-full wp-image-1553" title="FlexSlider" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/10/flexslider.png" alt="FlexSlider" width="544" height="162" /></a></p>
<p>The Flex component is simply a wrapper around the standard HSlider control. It expects some setup values to be passed into it and then when the users moves the slider, it makes a callback to a JavaScript function in the Visualforce page to update the value in the record. It&#8217;s loosely coupled so that you can pass in the values, the name of the JavaScript function to call and the ID of the DOM property to update.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&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;absolute&quot; alpha=&quot;1.0&quot; backgroundGradientAlphas=&quot;[0,0,0,0]&quot;
	creationComplete=&quot;init()&quot;&gt;
&nbsp;
&lt;mx:Script&gt;
	&lt;![CDATA[
		import flash.external.ExternalInterface;
		import mx.events.SliderEvent;
&nbsp;
		// bind the variables so that can be notified of value updates
        [Bindable] private var slideInterval:int;
        [Bindable] private var minSliderValue:int;
        [Bindable] private var maxSliderValue:int;
        [Bindable] private var sliderLabels:Array = new Array();
        [Bindable] private var sliderTickValues:Array = new Array();
        [Bindable] private var callbackFunction:String;
        private var startSliderValue:int;
        private var boundDomId:String;
&nbsp;
		// method to be called immediately after component is created
		private function init():void {
&nbsp;
			// set some values passed in from the Visualforce page
			startSliderValue = this.parameters.startSliderValue;
			minSliderValue = this.parameters.minSliderValue;
			maxSliderValue = this.parameters.maxSliderValue;
			slideInterval = this.parameters.slideInterval;
			// add the min &amp; max as the slider labels
			sliderLabels.push(minSliderValue,maxSliderValue);
			// add the min &amp; max as the slider values
			sliderTickValues.push(minSliderValue,maxSliderValue);
&nbsp;
			// set name of the callback javascript function
			callbackFunction = this.parameters.callbackFunction;
			// set the id of the DOM element attached to the slider so we can reference it
			boundDomId = this.parameters.boundDomId;
&nbsp;
			// set the values initially for the component
			mySlider.tickValues = sliderTickValues;
			mySlider.labels = sliderLabels;
			mySlider.value = startSliderValue;
&nbsp;
			// set the background color of the flex component so it matches the page
			Application.application.setStyle(&quot;backgroundColor&quot;,this.parameters.bgColor ? this.parameters.bgColor : &quot;#F3F3EC&quot;);
&nbsp;
		}
&nbsp;
		// notify the external interface that the slider was changed
		public function handleSliderChange(evt:SliderEvent):void {
			ExternalInterface.call(this.callbackFunction,evt.currentTarget.value,this.boundDomId);
		}
	]]&gt;
&lt;/mx:Script&gt;
&nbsp;
&lt;mx:HSlider
	id=&quot;mySlider&quot;
	minimum=&quot;{minSliderValue}&quot;
	maximum=&quot;{maxSliderValue}&quot;
	snapInterval=&quot;{slideInterval}&quot;
	tickValues=&quot;{sliderTickValues}&quot;
	labels=&quot;{sliderLabels}&quot;
	allowTrackClick=&quot;false&quot;
	liveDragging=&quot;false&quot;
	change=&quot;handleSliderChange(event)&quot;/&gt;
&nbsp;
&lt;/mx:Application&gt;</pre></td></tr></table></div>

<p>So that I can reuse slider, I created a Visualforce component with it that can be embedded into other Visualforce pages. I&#8217;ve included a default JavaScript function but you can override it with your own in the embedded Visualforce page if needed. There are a number of attributes included which make for handy syntax coding in the browser and Eclipse.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&lt;apex:component &gt;
&nbsp;
    &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
        function updateHiddenValue(value, eId){
            var e = document.getElementById(eId);
            e.value = value;
        }
    &lt;/script&gt;
&nbsp;
    &lt;apex:attribute name=&quot;minSliderValue&quot; description=&quot;Minimum slider value&quot; type=&quot;Integer&quot; required=&quot;true&quot;/&gt;
    &lt;apex:attribute name=&quot;maxSliderValue&quot; description=&quot;Maximum slider value&quot; type=&quot;Integer&quot; required=&quot;true&quot;/&gt;
    &lt;apex:attribute name=&quot;startSliderValue&quot; description=&quot;Starting value of the slider&quot; type=&quot;Integer&quot; required=&quot;false&quot; /&gt;
    &lt;apex:attribute name=&quot;slideInterval&quot; description=&quot;The tick interval that the slider can be moved&quot; type=&quot;Integer&quot; default=&quot;1&quot; required=&quot;false&quot; /&gt;
    &lt;apex:attribute name=&quot;callbackFunction&quot; description=&quot;The name of the JavaScript function that is called by the Flex components and passes the bound value of the slider. By default the component uses updateHiddenField but you can override it with your own.&quot; type=&quot;String&quot; default=&quot;updateHiddenValue&quot; required=&quot;false&quot; /&gt;
    &lt;apex:attribute name=&quot;boundDomId&quot; description=&quot;The $Component id of the DOM element bound to the slider value's. The slider's change event passes the value of boundDomId back to the JavaScript function.&quot; type=&quot;String&quot; required=&quot;false&quot;/&gt;
    &lt;apex:attribute name=&quot;height&quot; description=&quot;The height of the slider&quot; type=&quot;Integer&quot; default=&quot;50&quot; required=&quot;false&quot; /&gt;
    &lt;apex:attribute name=&quot;width&quot; description=&quot;The width of the slider&quot; type=&quot;Integer&quot; default=&quot;200&quot; required=&quot;false&quot; /&gt;
    &lt;apex:attribute name=&quot;bgColor&quot; description=&quot;The background color of the flex component so it matches the page. Defaults to Salesforce gray.&quot; type=&quot;String&quot; default=&quot;#F3F3EC&quot; required=&quot;false&quot; /&gt;
&nbsp;
    &lt;apex:flash src=&quot;{!$Resource.FlexSlider}&quot;
        height=&quot;{!height}&quot;
        width=&quot;{!width}&quot;
        flashVars=&quot;minSliderValue={!minSliderValue}&amp;maxSliderValue={!maxSliderValue}
                &amp;startSliderValue={!startSliderValue}&amp;slideInterval={!slideInterval}
                &amp;callbackFunction={!callbackFunction}&amp;boundDomId={!boundDomId}&amp;bgColor={!bgColor}&quot; /&gt;
&nbsp;
&lt;/apex:component&gt;</pre></td></tr></table></div>

<p>So now that you have your Flex slider built and uploaded as a Static Resource you can build your Visualforce page using your new component. If you want to pass more parameters into the component from your Visualforce page, you add them to the FlexSliderComponent attributes based up what is available from the component itself.</p>
<p>So now when you move the slider in the Flex component, it makes a callback to your Visualforce page to a JavaScript function which updates the value of the &#8220;geek factor&#8221; field in the record. When you save the record, that value is update.</p>
<p>When using the demo link above, after submitting the form you will see a white page. This is because I am lazy. You&#8217;ll have to go back and reload the form to see the value change.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&lt;apex:page standardController=&quot;Person__c&quot;&gt;
&nbsp;
  &lt;apex:sectionHeader title=&quot;{!Person__c.First_Name__c} {!Person__c.Last_Name__c}&quot; subtitle=&quot;Flex Slider Example&quot;/&gt;
&nbsp;
  &lt;apex:form id=&quot;myForm&quot;&gt;
        &lt;apex:pageBlock title=&quot;Geek Rating&quot; id=&quot;myBlock&quot; mode=&quot;edit&quot;&gt;
            &lt;apex:pageBlockButtons &gt;
                &lt;apex:commandButton value=&quot;Save&quot; action=&quot;{!save}&quot;/&gt;
                &lt;apex:commandButton value=&quot;Cancel&quot; action=&quot;{!cancel}&quot; /&gt;
            &lt;/apex:pageBlockButtons&gt;
            &lt;apex:pageMessages /&gt;
&nbsp;
            &lt;apex:pageBlockSection id=&quot;ratings&quot; showHeader=&quot;true&quot; title=&quot;Contact Info&quot; columns=&quot;2&quot;&gt;
&nbsp;
                &lt;apex:inputField value=&quot;{!Person__c.First_Name__c}&quot;/&gt;
                &lt;apex:pageBlockSectionItem &gt;
                    &lt;apex:outputLabel value=&quot;Geek Factor Slider&quot;/&gt;
                    &lt;c:FlexSliderComponent minSliderValue=&quot;0&quot; maxSliderValue=&quot;10&quot;
                                      startSliderValue=&quot;{!Person__c.Geek_Factor__c}&quot;
                                      boundDomId=&quot;{!$Component.ratings.geekfactor}&quot; /&gt;
                &lt;/apex:pageBlockSectionItem&gt;
&nbsp;
                &lt;apex:inputField value=&quot;{!Person__c.Last_Name__c}&quot;/&gt;
                &lt;apex:inputField id=&quot;geekfactor&quot; value=&quot;{!Person__c.Geek_Factor__c}&quot; /&gt;
&nbsp;
            &lt;/apex:pageBlockSection&gt;
        &lt;/apex:pageBlock&gt;
  &lt;/apex:form&gt;
&nbsp;
&lt;/apex:page&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/10/29/embed-a-flex-slider-in-a-visualforce-page/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Developer Preview of the Adobe® Flash® Builder™ for Force.com</title>
		<link>http://blog.jeffdouglas.com/2009/10/27/developer-preview-adobe-flash-builder-for-force/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=developer-preview-adobe-flash-builder-for-force</link>
		<comments>http://blog.jeffdouglas.com/2009/10/27/developer-preview-adobe-flash-builder-for-force/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 13:32:53 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Appirio]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1544</guid>
		<description><![CDATA[Cross-posted at the Appirio Technology Blog Yesterday Salesforce.com released a developer preview of the Adobe® Flash® Builder™ for Force.com allowing developers to create powerful, engaging offline applications running on the Force.com platform. I had a chance to download the software, build a sample application and really go through all of the documentation. The product, codename Stratus, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F10%2F27%2Fdeveloper-preview-adobe-flash-builder-for-force%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F10%2F27%2Fdeveloper-preview-adobe-flash-builder-for-force%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Cross-posted at the <a href="http://techblog.appirio.com/2009/10/developer-preview-of-adobe-flash.html" target="_blank">Appirio Technology Blog</a></p>
<p>Yesterday Salesforce.com <a href="http://developer.force.com/flashbuilder">released a developer preview</a> of the Adobe® Flash® Builder™ for Force.com allowing developers to create powerful, engaging offline applications running on the Force.com platform. I had a chance to download the software, build a sample application and really go through all of the documentation.</p>
<p>The product, codename Stratus, is a jointly developed Eclipse-based IDE that combines the Force.com IDE, Flex 4 Builder beta, Flash 4 beta and LiveCycle Data Services and is tightly integrated with Force.com Connect Offline. It also includes a SQLite database embedded within the Adobe AIR runtime that provides the offline data cache of Salesforce.com data. There is no pricing available yet and Salesforce.com expects final delivery in the first half of 2010.</p>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/10/fig01.jpg" rel="lightbox[1544]"><img class="alignnone size-full wp-image-1548" title="Adobe Flash Builder for Force.com" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/10/fig01.jpg" alt="Adobe Flash Builder for Force.com" width="544" height="198" /></a></p>
<p>Salesforce.com states that you can create both Flex and Air applications with the new offering but it is apparent from their marketing materials, documentation and tutorials that it is squarely aimed for developing offline Air applications. I emailed Dave Carroll and he confirmed that the <a href="http://developer.force.com/flextoolkit">Force.com Toolkit for Adobe AIR and Flex</a> is part of Stratus so you can use the same tool to build offline applications as well as applications that run inside the browser.</p>
<p>Stratus is a new data access and synchronization framework that ships with the offering. Stratus builds on the client-side data management included in Adobe LiveCycle Data Services, but does not include the LCDS server-side data management functionality. A LCDS license is included for Force.com but if you would like to connect to other backend system you&#8217;ll have to contact Adobe for additional pricing. Stratus provides login functionality, network detection and online and offline data synchronization, a conflict resolution service, and UI components that look and act just like data input fields on Salesforce.com.</p>
<p>The framework includes:</p>
<ul>
<li>Login functionality including a UI and error messages.</li>
<li>An API for making multiple, asynchronous, web service requests to the Force.com cloud to retrieve, save, or delete records.</li>
<li>UI components and data classes for displaying, editing, and managing local data changes.</li>
<li>The automatic creation and management of a local data store of salesforce.com data for offline support. When importing the Salesforce.com Enterprise WSDL, Stratus generates ActionScript classes for your objects on the Force.com platform.</li>
<li>An API for saving changes to both the local store and the Force.com cloud.</li>
<li>Automatic periodic synchronization of data between the local data store and the Force.com cloud.</li>
<li>Online and offline data synchronization and management.</li>
<li>Support for &#8220;select *&#8221; SOQL queries.</li>
</ul>
<p>Dave Carroll has built a <a href="http://wiki.developerforce.com/index.php/Video_building_flash_builder_app">great video</a> on installing, setting up a briefcase for offline data access and creating your first Adobe® Flash® Builder™ for Force.com application.</p>
<p>Adobe has created a <a href="http://www.adobe.com/devnet/salesforce/">developer site</a> with links to relevant info as well as a tutorial <a href="http://www.adobe.com/devnet/salesforce/articles/salesforce_desktop_quickstart.html">Quick start: Create your first Force.com Flex desktop application</a>. If you are interested in the architectural aspects of the offering, you should look at <a href="http://www.adobe.com/devnet/salesforce/articles/salesforce_architecture_overview.html">Understanding data management in applications built with Adobe Flash Builder for Force.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/10/27/developer-preview-adobe-flash-builder-for-force/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Code at Lunch Webinar – Flex &amp; Salesforce</title>
		<link>http://blog.jeffdouglas.com/2009/09/25/cool-code-at-lunch-webinar-flex-salesforce/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cool-code-at-lunch-webinar-flex-salesforce</link>
		<comments>http://blog.jeffdouglas.com/2009/09/25/cool-code-at-lunch-webinar-flex-salesforce/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 19:57:31 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Appirio]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Visualforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1366</guid>
		<description><![CDATA[I was the guest speaker on our &#8220;Cool Code at Lunch&#8221; webinar yesterday where I showed the basics of developing, upload and running a Flex application on Salesforce with the Force.com Toolkit for Adobe AIR and Flex. The example app was a simple DataGrid populated with Contacts. The application turned out to be a really [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F09%2F25%2Fcool-code-at-lunch-webinar-flex-salesforce%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F09%2F25%2Fcool-code-at-lunch-webinar-flex-salesforce%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I was the guest speaker on our &#8220;Cool Code at Lunch&#8221; webinar yesterday where I showed the basics of developing, upload and running a Flex application on Salesforce with the Force.com Toolkit for Adobe AIR and Flex. The example app was a simple DataGrid populated with Contacts.</p>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/09/coolcode-flex.png" rel="lightbox[1366]"><img class="alignnone size-full wp-image-1372" title="CoolCode-Flex" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/09/coolcode-flex.png" alt="CoolCode-Flex" width="544" height="290" /></a></p>
<p>The application turned out to be a really good starting point for most Flex applications so I thought I&#8217;d post it and see if it helps anyone out. I has methods for querying, creating and deleting data.</p>
<p>You&#8217;ll need to download the Force.com Toolkit for Adobe AIR and Flex toolkit <a href="http://developer.force.com/flextoolkit" target="_blank">here</a> to run this example.</p>
<p><strong>Flex Application &#8211; main.mxml</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&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;absolute&quot; width=&quot;600&quot; height=&quot;300&quot;
    backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#FFFFFF, #FFFFFF]&quot; creationComplete=&quot;init()&quot;&gt;
&nbsp;
	&lt;mx:Script&gt;
		&lt;![CDATA[
&nbsp;
        import mx.collections.ArrayCollection;
        import mx.controls.Alert;
        import com.salesforce.*;
        import com.salesforce.objects.*;
        import com.salesforce.results.*;
&nbsp;
        [Bindable] private var sfdc:Connection = new Connection();
        [Bindable] private var isLoggedIn:Boolean = false;
        [Bindable] private var contacts:ArrayCollection = new ArrayCollection();
        [Bindable] private var userId:String;
&nbsp;
        private function init():void {
			login();
			if (Application.application.parameters.userId == null) {
			    userId = &quot;005600000000000&quot;;
			} else {
			    userId = Application.application.parameters.userId;
			}
        }
&nbsp;
        private function getContacts():void
        {
&nbsp;
            sfdc.query(&quot;select id, name, email from contact&quot;,
                 new AsyncResponder(
                    function (qr:QueryResult):void {
                       if (qr.size &gt; 0) {
                            for (var i:int=0;i&lt;qr.size;i++) {
&nbsp;
                            	// create a new object to hold the data
                            	var c:Contact = new Contact();
                            	c.email = qr.records[i].Email;
                            	c.id = qr.records[i].Id;
                            	c.name = qr.records[i].Name;
&nbsp;
                            	// add the object to the array collection
                            	contacts.addItem(c);
&nbsp;
                            }
                        }
                    },sfdcFailure
                )
            );
&nbsp;
        }
&nbsp;
		private function createContact(c:Contact):void {
&nbsp;
			// create an array to send to sfdc
			var aSo:Array = new Array();
&nbsp;
			// create a new contact sObject to populate with data
			var so:SObject = new SObject(&quot;Contact&quot;);
			so.FirstName = c.first;
			so.LastName = c.last;
			so.Email = c.email;
&nbsp;
			// add the sObject to the array
			aSo.push(so);
&nbsp;
			sfdc.create(aSo,
				new AsyncResponder(
					function createResults(obj:Object):void {
						if (obj[0].success == false) {
							Alert.show(obj[0].errors[0].message.toString(),&quot;Error creating new contact&quot;);
						} else {
							// do something like update the collection
						}
					}, sfdcFailure
				)
			);
&nbsp;
		}
&nbsp;
		public function updateContact(c:Contact):void {
&nbsp;
			// create an array to send to sfdc
			var aSo:Array = new Array();
&nbsp;
			// create a new contact sObject to populate with data
			var so:SObject = new SObject(&quot;Contact&quot;);
			so.Id = c.id;
			so.FirstName = c.first;
			so.LastName = c.last;
			so.Email = c.email;
&nbsp;
			// add the sObject to the array
			aSo.push(so);
&nbsp;
			sfdc.update(aSo,
				new AsyncResponder(
					function updateResults(obj:Object):void {
						if (obj[0].success == false) {
							mx.controls.Alert.show(obj[0].errors[0].message.toString(),&quot;Error updating contact&quot;);
						} else {
							// do something like update the collection
						}
					}, sfdcFailure
				)
			);
		}
&nbsp;
        private function login():void {
&nbsp;
            var lr:LoginRequest = new LoginRequest();
&nbsp;
            // hard code values for dev/local
            if (this.parameters.server_url == null) {
&nbsp;
            	//sfdc.protocol = &quot;http&quot;;
	            sfdc.serverUrl = &quot;http://na5.salesforce.com/services/Soap/u/14.0&quot;;
	            lr.username = &quot;YOUR_USERNAME&quot;;
	            lr.password = &quot;YOUR_PASSWORD&amp;YOUR_TOKEN&quot;;
&nbsp;
            } else {
&nbsp;
                lr.server_url = this.parameters.server_url;
                lr.session_id = this.parameters.session_id;
            }
&nbsp;
            lr.callback = new AsyncResponder(loginSuccess, loginFault);
            sfdc.login(lr);
&nbsp;
        }
&nbsp;
        private function loginSuccess(result:Object):void {
            isLoggedIn = true;
            // start calling methods...
            getContacts();
        }
&nbsp;
        private function loginFault(fault:Object):void {
            mx.controls.Alert.show(&quot;Could not log into SFDC: &quot;+fault.fault.faultString,&quot;Login Error&quot;);
        }
&nbsp;
        private function sfdcFailure(fault:Object):void {
            Alert.show(fault.toString());
        }
		]]&gt;
	&lt;/mx:Script&gt;
&nbsp;
	&lt;mx:DataGrid left=&quot;5&quot; right=&quot;5&quot; top=&quot;5&quot; bottom=&quot;5&quot; id=&quot;dg&quot; dataProvider=&quot;{contacts}&quot;&gt;
		&lt;mx:columns&gt;
			&lt;mx:DataGridColumn headerText=&quot;Id&quot; dataField=&quot;id&quot;/&gt;
			&lt;mx:DataGridColumn headerText=&quot;Name&quot; dataField=&quot;name&quot;/&gt;
			&lt;mx:DataGridColumn headerText=&quot;Email&quot; dataField=&quot;email&quot;/&gt;
		&lt;/mx:columns&gt;
	&lt;/mx:DataGrid&gt;
&nbsp;
&lt;/mx:Application&gt;</pre></td></tr></table></div>

<p><strong> Contact Value Object &#8211; Contact.as</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package
{
	public class Contact
	{
		public var id:String;
		public var first:String;
		public var last:String;
		public var name:String;
		public var email:String
&nbsp;
	}
}</pre></td></tr></table></div>

<p><strong> Visualforce page &#8211; MyPage.page</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&lt;apex:page &gt;
    &lt;apex:flash src=&quot;{!$Resource.CoolCode}&quot;
        width=&quot;600&quot; height=&quot;300&quot;
        flashvars=&quot;userId={!$User.Id}&amp;session_id={!$Api.Session_ID}&amp;server_url={!$Api.Partner_Server_URL_130}&quot; /&gt;
&lt;/apex:page&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/09/25/cool-code-at-lunch-webinar-flex-salesforce/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Developing Flex Applications for Force.com Sites</title>
		<link>http://blog.jeffdouglas.com/2009/09/07/developing-flex-applications-for-focescom-sites/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=developing-flex-applications-for-focescom-sites</link>
		<comments>http://blog.jeffdouglas.com/2009/09/07/developing-flex-applications-for-focescom-sites/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 16:19:14 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Visualforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1214</guid>
		<description><![CDATA[Developing Flex applications for a Force.com Site is a little different than developing Flex applications that run inside the standard Salesforce.com UI. Since visitors are not required to log in to your Force.com Site there is no concept of an actual user. All visitors simply run as a specific profile under the Guest license. Since [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F09%2F07%2Fdeveloping-flex-applications-for-focescom-sites%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F09%2F07%2Fdeveloping-flex-applications-for-focescom-sites%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Developing Flex applications for a Force.com Site is a little different than developing Flex applications that run inside the standard Salesforce.com UI. Since visitors are not required to log in to your Force.com Site there is no concept of an actual user. All visitors simply run as a specific profile under the Guest license.</p>
<p>Since there is no named user for Sites, there is no associated session to pass to your Flex application. Therefore, you need to explicitly code a username and password to log into Salesforce.com in your Flex application. This is a similar concept to authenticating via web services to Salesforce.com.</p>
<p>Here&#8217;s a quick example of a Flex application running on my developer Site. <strong>You can </strong><a style="color:#80ae14;text-decoration:underline;margin:0;padding:0;" href="http://jeffdouglas-developer-edition.na5.force.com/examples/FlexValidation" target="_blank"><strong>run this demo</strong></a><strong> on my Developer Site.</strong></p>
<p>Here is the Visualforce page running in my developer Site.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&lt;apex:page&gt;
    &lt;apex:sectionHeader title=&quot;Required Field and Validation Example&quot;/&gt;
    &lt;apex:pageBlock &gt;
&nbsp;
	&lt;apex:flash src=&quot;{!$Resource.DisplayValidation}&quot;
		width=&quot;500&quot; height=&quot;300&quot;/&gt;
&nbsp;
	&lt;/apex:pageBlock&gt;
&lt;/apex:page&gt;</pre></td></tr></table></div>

<p>The Flex application specifying the username and password with which the application authenticates.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&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;
    backgroundGradientAlphas=&quot;[1.0, 1.0]&quot;
    backgroundGradientColors=&quot;[#F3F3EC, #F3F3EC]&quot;
    creationComplete=&quot;login()&quot;
    layout=&quot;vertical&quot;
    height=&quot;300&quot; width=&quot;500&quot;&gt;
&nbsp;
	&lt;mx:Script&gt;
    &lt;![CDATA[
        import com.salesforce.*;
        import com.salesforce.objects.*;
        import com.salesforce.results.*;
        import mx.controls.Alert;
&nbsp;
        [Bindable] public var sfdc:Connection = new Connection();
&nbsp;
        private function login():void {
&nbsp;
            var lr:LoginRequest = new LoginRequest();
            sfdc.protocol = &quot;http&quot;;
            sfdc.serverUrl = &quot;http://na5.salesforce.com/services/Soap/u/14.0&quot;;
            lr.username = &quot;YOUR_USERNAME&quot;;
            lr.password = &quot;YOUR_PASSWORD_AND_TOKEN&quot;;
            lr.callback = new AsyncResponder(loginSuccess, loginFault);
            sfdc.login(lr);
&nbsp;
        }
&nbsp;
		private function submitForm():void {
&nbsp;
			var aSo:Array = new Array();
			var so:SObject = new SObject(&quot;Contact&quot;);
			so.FirstName = firstName.text;
			so.LastName = lastName.text;
			so.Email = email.text;
&nbsp;
			aSo.push(so);
&nbsp;
			sfdc.create(aSo,
				new AsyncResponder(
					function (obj:Object):void {
						if (obj[0].success == true) {
							Alert.show(&quot;Created record: &quot;+obj[0].id);
						} else {
							Alert.show(obj[0].errors[0].message)
						}
					}, sfdcFailure
				)
			);
&nbsp;
		}
&nbsp;
		private function loginSuccess(result:Object):void {
			contactForm.enabled = true;
		}
&nbsp;
        private function sfdcFailure(fault:Object):void {
            Alert.show(fault.faultstring);
        }
&nbsp;
        private function loginFault(fault:Object):void
        {
            Alert.show(&quot;Could not log into SFDC: &quot;+fault.fault.faultString,&quot;Login Error&quot;);
        }
&nbsp;
    ]]&gt;
	&lt;/mx:Script&gt;
	&lt;mx:Text text=&quot;To create a new Contact, Last Name is required by Salesforce.com while Email is required via a custom validation rule. &amp;#xd;&amp;#xd;Submit the form with different combinations to view the resulting messages returned from Salesforce.com.&amp;#xd;&quot; width=&quot;449&quot;/&gt;
	&lt;mx:Form id=&quot;contactForm&quot; width=&quot;100%&quot; height=&quot;100%&quot; enabled=&quot;false&quot;&gt;
		&lt;mx:FormItem label=&quot;First Name&quot;&gt;
			&lt;mx:TextInput id=&quot;firstName&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Last Name&quot;&gt;
			&lt;mx:TextInput id=&quot;lastName&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Email&quot;&gt;
			&lt;mx:TextInput id=&quot;email&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem&gt;
			&lt;mx:Button label=&quot;Submit&quot; click=&quot;submitForm()&quot;/&gt;
		&lt;/mx:FormItem&gt;
	&lt;/mx:Form&gt;
&nbsp;
&lt;/mx:Application&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/09/07/developing-flex-applications-for-focescom-sites/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Rich Internet Applications Using Flex, Salesforce.com and Google App Engine</title>
		<link>http://blog.jeffdouglas.com/2009/08/20/rich-internet-applications-using-flex-salesforce-com-and-google-app-engine/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rich-internet-applications-using-flex-salesforce-com-and-google-app-engine</link>
		<comments>http://blog.jeffdouglas.com/2009/08/20/rich-internet-applications-using-flex-salesforce-com-and-google-app-engine/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:06:27 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[GAE/J]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1113</guid>
		<description><![CDATA[Cross-posted at the Appirio Technology Blog It’s fairly common these days to see Flex applications running inside Salesforce.com. But what if you&#8217;d like to run your Flex applications on another SaaS provider like Google App Engine or Amazon EC2. We are going to set up a simple Flex application that fetches Accounts and Opportunities from [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F08%2F20%2Frich-internet-applications-using-flex-salesforce-com-and-google-app-engine%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F08%2F20%2Frich-internet-applications-using-flex-salesforce-com-and-google-app-engine%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Cross-posted at the <a href="http://techblog.appirio.com/2009/08/rich-internet-applications-using-flex.html" target="_blank">Appirio Technology Blog</a></p>
<p>It’s fairly common these days to see Flex applications running inside Salesforce.com. But what if you&#8217;d like to run your Flex applications on another SaaS provider like Google App Engine or Amazon EC2. We are going to set up a simple Flex application that fetches Accounts and Opportunities from Salesforce.com using an open source remoting library that runs on Google App Engine. Here a quick peak at the final application:</p>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/08/flex-graniteds-screenshot.png" rel="lightbox[1113]"><img class="alignnone size-medium wp-image-1116" title="flex-graniteDS-screenshot" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/08/flex-graniteds-screenshot.png?w=300" alt="flex-graniteDS-screenshot" width="300" height="211" /></a></p>
<p><strong>You can run this demo at: </strong><a href="http://jeffdouglas-sfdc-graniteds.appspot.com/main.html" target="_blank"><strong>http://jeffdouglas-sfdc-graniteds.appspot.com/main.html</strong></a></p>
<p>Flex can communicate with a Java backend using HTTP, SOAP-based web services or Adobe’s proprietary AMF format. There are a number of open source AMF implementations including Aodobe BlazeDS, WebORB and GraniteDS.  These implementations allow you to communicate via JMS or Flex remoting and are more efficient and exponentially faster than using XML across the wire. For this application we are going to be utilizing <a href="http://sourceforge.net/projects/granite/" target="_blank">GraniteDS</a>. The GraniteDS remoting service is a high performance data transfer service that allows your Flex applications to directly invoke Java object methods on your application and consume the return values natively. The objects returned from the server-side methods are automatically deserialized into either dynamic or typed ActionScript objects.</p>
<p><strong>Setting Up Your Environment</strong></p>
<p>To get started you&#8217;ll need to <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flexbuilder3" target="_blank">download</a> the Adobe Flex 3.0 Builder 3 or Flex 3 Builder Plug-In. There’s a 60 day trial if you don’t already have a license. Installation is pretty straight-forward if you are familiar with the Eclipse installation process. The plug-in is a little easier and quicker to install.</p>
<p>If you don&#8217;t have a Google App Engine account, you can create one <a href="http://appengine.google.com" target="_blank">here</a>. You&#8217;ll also need to download and install the Google App Engine SDK and Eclipse plug-in. You can find details on this process <a href="http://code.google.com/appengine/downloads.html" target="_blank">here</a>.</p>
<p><strong>Creating Your Project</strong></p>
<p>Now that our environment is setup, create a new Web Application Project and uncheck “Use Google Web Toolkit”. Since we are going to be using Flex as the front end for our application you will want to add the Flex Project Nature to your project. Right click on the project name in the left panel and select Flex Project Nature -&gt; Add Flex Project Nature. Choose “Other” as the application server and click Next and then Finish. This will automatically create your Flex main.mxml file for you in the src directory.</p>
<p>After the file has been created you should see the following error message in the Eclipse Problems tab, &#8220;Cannot create HTML wrapper. Right-click here to recreate folder html-template.&#8221; To fix this simply right click on the error message and select “Recreate HTML Templates”.</p>
<p><strong>Adding Required Libraries</strong></p>
<p>There are a number of libraries that we are going to need for Salesforce.com and GraniteDS. Download the latest version of GraniteDS from <a href="http://sourceforge.net/projects/granite/files/" target="_blank">here</a>, unzip the files, find the granite.jar in the graniteds/build/ directory and place it into your project’s /WEB-INF/lib/ directory.</p>
<p>You’ll also need to get the latest version of Xalan-J from <a href="http://www.apache.org/dyn/closer.cgi/xml/xalan-j" target="_blank">here</a>. Unzip the files and copy serializer.jar and xalan.jar into your project’s /WEB-INF/lib directory.</p>
<p>There are two jar files you will need for the Salesforce.com integration. Download the Force.com Web Service Connector files from <a href="http://code.google.com/p/sfdc-wsc/downloads/list" target="_blank">here</a> and copy them to your project&#8217;s /WEB-INF/lib directory:</p>
<ul>
<li>partner-library.jar &#8211; the objects and methods from the Force.com partner WSDL</li>
<li>wsc-gae-16_0.jar &#8211; the Web Service parsing and transport for GAE-Java</li>
</ul>
<p>You&#8217;ll need to add these new jar files to your Java build path in Eclipse by right clicking on the project name and selecting Properties. Select Java Build Path -&gt; Libraries and add your jars from the lib directory.</p>
<p><strong>Server Configuration</strong></p>
<p>So now that we have all of requirements in place we can start configuring our application. Place the following code into your /WEB-INF/web-xml file between the  tags to tell App Engine which classes GraniteDS utilizes.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- GraniteDS --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.granite.config.GraniteConfigListener<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- handle AMF requests serialization and deserialization --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AMFMessageFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.granite.messaging.webapp.AMFMessageFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AMFMessageFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/graniteamf/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- processes AMF requests --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AMFMessageServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.granite.messaging.webapp.AMFMessageServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AMFMessageServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/graniteamf/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>You&#8217;ll also want to change the welcome-file to specify main.html instead of the generated index.html file.</p>
<p>GraniteDS communicates with the servlet container via a remoting destination. A Remoting destination exposes a Java class that your Flex application can invoke remotely. The destination id is the logical name that your Flex application uses to refer to the remote class. This eliminates the need to hardcode a reference to the fully qualified Java class name. This logical name is mapped to the Java class name as part of the destination configuration in services-config.xml. Create a new folder under /WEB-INF/ called “flex” and create the following services-config.xml file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span></span>
<span style="color: #009900;">               <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;granite-service&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.services.RemotingService&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">&quot;flex.messaging.messages.RemotingMessage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;Gateway&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;my-graniteamf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.appirio.Gateway<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destination<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;my-graniteamf&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;mx.messaging.channels.AMFChannel&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endpoint</span></span>
<span style="color: #009900;">                    <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;/graniteamf/amf&quot;</span></span>
<span style="color: #009900;">                    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.endpoints.AMFEndpoint&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channel-definition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Our remoting destination points to a class called Gateway that we will create shortly. Now we need to tell the Flex compiler where to find the services file that defines our remoting destination. Right click on the project name in the left panel and select Properties -&gt; Flex Compiler. Replace your compiler arguments with the following:</p>
<blockquote><p>-locale en_US -services ../war/WEB-INF/flex/services-config.xml</p></blockquote>
<p><strong>Client-Side Code</strong></p>
<p>Now that our server is configured we can start working on the Flex client. Our client is fairly simple and allows a user select an Account and view/create Opportunities for it. The Flex portion of the application is represented by a single MXML file. For larger applications you would typically break your application into an MVC model and possibly use some sort of Flex framework like Cairngorm, Mate or PureMVC. Since our application is so small there is really no need to implement any sort of framework.</p>
<p>One of the most important parts of this file is the RemoteObject tag at the top. The id of the tag (gateway) is used by the application to reference the object while the destination (Gateway) is same destination we set up in our services-config.xml file specifying our remoting destination of com.appirio.Gateway.</p>
<p>The individual methods specified by the RemoteObject tag map directly to methods in the Gateway class that we are about to define.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&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;absolute&quot;
	creationComplete=&quot;gateway.getAccounts()&quot;&gt;
&nbsp;
     &lt;mx:RemoteObject id=&quot;gateway&quot; destination=&quot;Gateway&quot; fault=&quot;Alert.show(event.fault.toString());&quot;&gt;
          &lt;mx:method name=&quot;getAccounts&quot; result=&quot;storeAccounts(event)&quot; fault=&quot;Alert.show(event.fault.faultString);&quot; /&gt;
          &lt;mx:method name=&quot;getOpportunities&quot; result=&quot;storeOpportunities(event)&quot; fault=&quot;Alert.show(event.fault.faultString);&quot; /&gt;
          &lt;mx:method name=&quot;createOpportunity&quot; result=&quot;fetchOpportunities(event)&quot; fault=&quot;Alert.show(event.fault.faultString);&quot; /&gt;
     &lt;/mx:RemoteObject&gt;
&nbsp;
	&lt;mx:Script&gt;
	&lt;![CDATA[
		import mx.controls.Alert;
		import mx.collections.ArrayCollection;
		import mx.rpc.events.ResultEvent;
&nbsp;
		[Bindable] private var accounts:ArrayCollection;
		[Bindable] private var opportunities:ArrayCollection;
		[Bindable] private var selectedAccount:Account;
&nbsp;
		// store the accounts returned from Salesforce.com, select the first account as
		// the currently selected one and then fetch its opportunities from Salesforce.com
		private function storeAccounts(event:ResultEvent):void {
			accounts = event.result as ArrayCollection;
			selectedAccount = accounts.getItemAt(0) as Account;
			gateway.getOpportunities(selectedAccount.id);
		}
&nbsp;
		// store the list of opportunities returned from Salesforce.com
		private function storeOpportunities(event:ResultEvent):void {
			opportunities = event.result as ArrayCollection;
		}
&nbsp;
		// fetch the opportunities from Salesforce.com after a new opportunities has been created
		// and returned from the createOpportunity() remote object method
		private function fetchOpportunities(event:ResultEvent):void {
			gateway.getOpportunities(selectedAccount.id);
		}
&nbsp;
		private function changeAccount():void {
			opportunities = null;
			selectedAccount = cbxAccount.selectedItem as Account;
			gateway.getOpportunities(selectedAccount.id);
		}
&nbsp;
		private function saveOpportunity():void {
&nbsp;
			var opp:Opportunity = new Opportunity();
			opp.accountId = selectedAccount.id;
			opp.probability = frmProbability.text;
			opp.stageName = frmStage.text;
			opp.amount = frmAmount.text;
			opp.closeDate = dateFormatter.format(frmCloseDate.selectedDate);
			opp.name = frmName.text;
			opp.orderNumber = frmOrder.text;
&nbsp;
			// create the opportunity
			gateway.createOpportunity(opp);
&nbsp;
			// reset the form
			frmProbability.selectedIndex = 0;
			frmStage.selectedIndex = 0;
			frmAmount.text = null;
			frmCloseDate.selectedDate = null;
			frmName.text = null;
			frmOrder.text = null;
&nbsp;
		}
&nbsp;
	]]&gt;
	&lt;/mx:Script&gt;
&nbsp;
	&lt;mx:DateFormatter id=&quot;dateFormatter&quot; formatString=&quot;MM/DD/YYYY&quot;/&gt;
&nbsp;
	&lt;mx:Label x=&quot;10&quot; y=&quot;14&quot; text=&quot;Telesales Demo with Salesforce.com, GraniteDS and Google App Engine&quot; fontSize=&quot;18&quot; color=&quot;#FFFFFF&quot;/&gt;
&nbsp;
	&lt;mx:VBox top=&quot;50&quot; bottom=&quot;10&quot; left=&quot;10&quot; right=&quot;10&quot;&gt;
		&lt;mx:HBox width=&quot;100%&quot; height=&quot;50%&quot;&gt;
			&lt;mx:Panel width=&quot;50%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; title=&quot;Account Display&quot;&gt;
				&lt;mx:Form width=&quot;100%&quot; height=&quot;100%&quot;&gt;
					&lt;mx:FormItem label=&quot;Account&quot;&gt;
						&lt;mx:ComboBox
							id=&quot;cbxAccount&quot;
							dataProvider=&quot;{accounts}&quot;
							labelField=&quot;name&quot;
							change=&quot;changeAccount()&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;City&quot;&gt;
						&lt;mx:Text text=&quot;{selectedAccount.city}&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;State&quot;&gt;
						&lt;mx:Text text=&quot;{selectedAccount.state}&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Phone&quot;&gt;
						&lt;mx:Text text=&quot;{selectedAccount.phone}&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Website&quot;&gt;
						&lt;mx:Text text=&quot;{selectedAccount.website}&quot;/&gt;
					&lt;/mx:FormItem&gt;
				&lt;/mx:Form&gt;
			&lt;/mx:Panel&gt;
			&lt;mx:Panel width=&quot;50%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; title=&quot;New Opportunity for {selectedAccount.name}&quot;&gt;
				&lt;mx:Form width=&quot;100%&quot; height=&quot;100%&quot;&gt;
					&lt;mx:FormItem label=&quot;Name&quot;&gt;
						&lt;mx:TextInput id=&quot;frmName&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Amount&quot;&gt;
						&lt;mx:TextInput id=&quot;frmAmount&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Stage&quot;&gt;
						&lt;mx:ComboBox id=&quot;frmStage&quot;&gt;
							&lt;mx:dataProvider&gt;
								&lt;mx:String&gt;Prospecting&lt;/mx:String&gt;
								&lt;mx:String&gt;Qualifications&lt;/mx:String&gt;
								&lt;mx:String&gt;Value Proposition&lt;/mx:String&gt;
							&lt;/mx:dataProvider&gt;
						&lt;/mx:ComboBox&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Probability&quot;&gt;
						&lt;mx:ComboBox id=&quot;frmProbability&quot;&gt;
							&lt;mx:dataProvider&gt;
								&lt;mx:String&gt;10&lt;/mx:String&gt;
								&lt;mx:String&gt;25&lt;/mx:String&gt;
								&lt;mx:String&gt;50&lt;/mx:String&gt;
								&lt;mx:String&gt;75&lt;/mx:String&gt;
							&lt;/mx:dataProvider&gt;
						&lt;/mx:ComboBox&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Close Date&quot;&gt;
						&lt;mx:DateField id=&quot;frmCloseDate&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem label=&quot;Order&quot;&gt;
						&lt;mx:TextInput id=&quot;frmOrder&quot;/&gt;
					&lt;/mx:FormItem&gt;
					&lt;mx:FormItem&gt;
						&lt;mx:Button label=&quot;Save Opportunity&quot; click=&quot;saveOpportunity()&quot;/&gt;
					&lt;/mx:FormItem&gt;
				&lt;/mx:Form&gt;
			&lt;/mx:Panel&gt;
		&lt;/mx:HBox&gt;
		&lt;mx:Panel width=&quot;100%&quot; height=&quot;50%&quot; layout=&quot;absolute&quot; title=&quot;Opportunities for {selectedAccount.name}&quot;&gt;
			&lt;mx:DataGrid width=&quot;100%&quot; height=&quot;100%&quot; id=&quot;dgOpps&quot; dataProvider=&quot;{opportunities}&quot;&gt;
				&lt;mx:columns&gt;
					&lt;mx:DataGridColumn headerText=&quot;Name&quot; dataField=&quot;name&quot;/&gt;
					&lt;mx:DataGridColumn headerText=&quot;Amount&quot; dataField=&quot;amount&quot;/&gt;
					&lt;mx:DataGridColumn headerText=&quot;Stage&quot; dataField=&quot;stageName&quot;/&gt;
					&lt;mx:DataGridColumn headerText=&quot;Probability&quot; dataField=&quot;probability&quot;/&gt;
					&lt;mx:DataGridColumn headerText=&quot;Close Date&quot; dataField=&quot;closeDate&quot;/&gt;
					&lt;mx:DataGridColumn headerText=&quot;Order&quot; dataField=&quot;orderNumber&quot;/&gt;
				&lt;/mx:columns&gt;
			&lt;/mx:DataGrid&gt;
		&lt;/mx:Panel&gt;
	&lt;/mx:VBox&gt;
&nbsp;
&lt;/mx:Application&gt;</pre></td></tr></table></div>

<p>One last thing we need for the front end are Account and Opportunity value objects. Right-click the src folder and select New -&gt; ActionScript Class. Enter the class name as and click Finish. Add the following code to these classes. Notice that the code uses the [RemoteClass(alias=" com.appirio.Account")] annotation to map the ActionScript version of the Account class (Account.as) to the Java version (Account.java). As a result, Account objects returned by methods of the Java object in the service layer that are deserialized into instances of the ActionScript Account class automatically for you.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package
{
	[Bindable]
	[RemoteClass(alias=&quot;com.appirio.Account&quot;)]
	public class Account
	{
&nbsp;
		public var id:String;
		public var name:String;
		public var city:String;
		public var state:String;
		public var phone:String;
		public var website:String;
&nbsp;
	}
}</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package
{
	[Bindable]
	[RemoteClass(alias=&quot;com.appirio.Opportunity&quot;)]
	public class Opportunity
	{
&nbsp;
		public var id:String;
		public var name:String;
		public var amount:String;
		public var stageName:String;
		public var probability:String;
		public var closeDate:String;
		public var orderNumber:String;
		public var accountId:String;
&nbsp;
	}
}</pre></td></tr></table></div>

<p><strong>Server-Side Code</strong></p>
<p>So now back to the server-side to finish up our application. We need to add the POJOs to model our Account and Opportunity object returned from Salesforce.com. These classes will consist of the same members as the ActionScript classes so that GraniteDS can translate them back and forth for us.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package com.appirio;
&nbsp;
public class Account {
&nbsp;
	private String id;
	private String name;
	private String city;
	private String state;
	private String phone;
	private String website;
&nbsp;
	public Account(String id, String name, String city, String state, String phone, String website) {
		this.id = id;
		this.name = name;
		this.city = city;
		this.state = state;
		this.phone = phone;
		this.website = website;
	}
&nbsp;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getWebsite() {
		return website;
	}
	public void setWebsite(String website) {
		this.website = website;
	}
}</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package com.appirio;
&nbsp;
public class Opportunity {
&nbsp;
	private String id;
	private String name;
	private String amount;
	private String stageName;
	private String probability;
	private String closeDate;
	private String orderNumber;
	private String accountId;
&nbsp;
	public Opportunity(String id, String name, String amount, String stageName, String probability, String closeDate, String orderNumber) {
		this.id = id;
		this.name = name;
		this.amount = amount;
		this.stageName = stageName;
		this.probability = probability;
		this.closeDate = closeDate;
		this.orderNumber = orderNumber;
	}
&nbsp;
	public String getId() {
		return id;
	}
&nbsp;
	public void setId(String id) {
		this.id = id;
	}
&nbsp;
	public String getName() {
		return name;
	}
&nbsp;
	public void setName(String name) {
		this.name = name;
	}
&nbsp;
	public String getAmount() {
		return amount;
	}
&nbsp;
	public void setAmount(String amount) {
		this.amount = amount;
	}
&nbsp;
	public String getStageName() {
		return stageName;
	}
&nbsp;
	public void setStageName(String stageName) {
		this.stageName = stageName;
	}
&nbsp;
	public String getProbability() {
		return probability;
	}
&nbsp;
	public void setProbability(String probability) {
		this.probability = probability;
	}
&nbsp;
	public String getCloseDate() {
		return closeDate;
	}
&nbsp;
	public void setCloseDate(String closeDate) {
		this.closeDate = closeDate;
	}
&nbsp;
	public String getOrderNumber() {
		return orderNumber;
	}
&nbsp;
	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}
&nbsp;
	public String getAccountId() {
		return accountId;
	}
&nbsp;
	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}
&nbsp;
}</pre></td></tr></table></div>

<p>The last part of our application is the Gateway class that GraniteDS uses as the remoting endpoint. This class contains the methods that our Flex front-end calls via the RemoveObject tag.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
package com.appirio;
&nbsp;
import java.text.DateFormat;
import java.util.logging.Logger;
import java.util.Date;
import java.util.Vector;
&nbsp;
import com.sforce.soap.partner.Connector;
import com.sforce.soap.partner.PartnerConnection;
import com.sforce.soap.partner.QueryResult;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.ConnectorConfig;
import com.sforce.soap.partner.sobject.SObject;
&nbsp;
public class Gateway {
&nbsp;
	private static final Logger log = Logger.getLogger(Gateway.class.getName());
	private String username = &quot;YOUR-SALESFORCE-USERNAME&quot;;
	private String password = &quot;YOUR-SALESFORCE-PASSWORD-AND-TOKEN&quot;;
	private PartnerConnection connection;
&nbsp;
	// query for 10 accounts in Salesforce.com
	public Vector&lt;account&gt; getAccounts() {
&nbsp;
		// get a new connection to Salesforce.com ising the Force.com Web Service Connector (WSC) toolkit
		getConnection();
&nbsp;
		QueryResult result = null;
		Vector&lt;account&gt; accounts = new Vector&lt;account&gt;();
&nbsp;
		try {
			result = connection.query(&quot;Select Id, Name, Phone, BillingCity, BillingState, website from Account LIMIT 10&quot;);
&nbsp;
			if (result.getSize() &gt; 0) {
&nbsp;
				for (SObject account : result.getRecords()) {
					Account a = new Account(
							(String)account.getField(&quot;Id&quot;),
							(String)account.getField(&quot;Name&quot;),
							(String)account.getField(&quot;BillingCity&quot;),
							(String)account.getField(&quot;BillingState&quot;),
							(String)account.getField(&quot;Phone&quot;),
							(String)account.getField(&quot;website&quot;)
						);
					accounts.add(a);
&nbsp;
				}
&nbsp;
			}
&nbsp;
		} catch (ConnectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
&nbsp;
		return accounts;
&nbsp;
	}
&nbsp;
	// query for all opportunities for an account
	public Vector&lt;opportunity&gt; getOpportunities(String accountId) {
&nbsp;
		// get a new connection to Salesforce.com ising the Force.com Web Service Connector (WSC) toolkit
		getConnection();
&nbsp;
		QueryResult result = null;
		Vector&lt;opportunity&gt; opportunities = new Vector&lt;opportunity&gt;();
&nbsp;
		try {
			result = connection.query(&quot;Select id, name, stagename, amount, closeDate, probability, ordernumber__c from Opportunity where AccountId = '&quot;+accountId+&quot;'&quot;);
&nbsp;
			if (result.getSize() &gt; 0) {
&nbsp;
				for (SObject opp : result.getRecords()) {
					Opportunity o = new Opportunity(
							(String)opp.getField(&quot;Id&quot;),
							(String)opp.getField(&quot;Name&quot;),
							(String)opp.getField(&quot;Amount&quot;),
							(String)opp.getField(&quot;StageName&quot;),
							(String)opp.getField(&quot;Probability&quot;),
							(String)opp.getField(&quot;CloseDate&quot;),
							(String)opp.getField(&quot;OrderNumber__c&quot;)
						);
					opportunities.add(o);
				}
&nbsp;
			}
&nbsp;
		} catch (ConnectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
&nbsp;
		return opportunities;
&nbsp;
	}
&nbsp;
	// create a new opportunity in Salesforce.com
	public Boolean createOpportunity(Opportunity o) {
&nbsp;
		// get a new connection to Salesforce.com ising the Force.com Web Service Connector (WSC) toolkit
		getConnection();
&nbsp;
		Boolean success = true;
		Date closeDate = new Date();
&nbsp;
		// try and parse the date
        try {
        	DateFormat df = DateFormat.getDateInstance(3);
        	closeDate = df.parse(o.getCloseDate());
        } catch(java.text.ParseException pe) {
            System.out.println(&quot;Exception &quot; + pe);
        }
&nbsp;
        // populate the new opportunity
        SObject opp = new SObject();
        opp.setType(&quot;Opportunity&quot;);
        opp.setField(&quot;Name&quot;, o.getName());
        opp.setField(&quot;Amount&quot;, new Double(o.getAmount()).doubleValue());
        opp.setField(&quot;StageName&quot;, o.getStageName());
        opp.setField(&quot;Probability&quot;, new Double(o.getProbability()).doubleValue());
        opp.setField(&quot;CloseDate&quot;, closeDate);
        opp.setField(&quot;OrderNumber__c&quot;, o.getOrderNumber());
        opp.setField(&quot;AccountId&quot;, o.getAccountId());
&nbsp;
        SObject[] opportunities = {opp};
&nbsp;
		try {
			connection.create(opportunities);
		} catch (ConnectionException e) {
			// TODO Auto-generated catch block
        	success = false;
			e.printStackTrace();
		}
&nbsp;
		return success;
&nbsp;
	}
&nbsp;
 	void getConnection() {
		try {
		   if ( connection == null ) {
			   log.info(&quot;Fetching new connection....&quot;);
			   // login to salesforce
			   ConnectorConfig config = new ConnectorConfig();
			   config.setUsername(username);
			   config.setPassword(password);
			   connection = Connector.newConnection(config);
		   } else {
			   log.info(&quot;Reusing existing connection....&quot;);
		   }
		} catch ( ConnectionException ce) {
			log.warning(&quot;ConnectionException &quot; +ce.getMessage());
		}
&nbsp;
	}
&nbsp;
}</pre></td></tr></table></div>

<p>Our last step before uploading our application to Google App Engine is to build and export for deployment. Right click on the project name in the left panel and select Export. Choose Flex Builder folder -&gt; Release Build -&gt; Next. In the Export to folder section browse to your war for the project. We want to build our Flex application to this folder so that the App Engine plug-in will deploy this code to App Engine along with our Java code.</p>
<p>Our last step it is to create a new App Engine application and upload our code to Google&#8217;s servers. There is detailed help for uploading with the Eclipse plug-in <a href="http://code.google.com/appengine/docs/java/tools/eclipse.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/08/20/rich-internet-applications-using-flex-salesforce-com-and-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Displaying Validation Messages with Flex and Salesforce.com</title>
		<link>http://blog.jeffdouglas.com/2009/08/02/displaying-validation-messages-with-flex-and-salesforce-com/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=displaying-validation-messages-with-flex-and-salesforce-com</link>
		<comments>http://blog.jeffdouglas.com/2009/08/02/displaying-validation-messages-with-flex-and-salesforce-com/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 03:47:41 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1079</guid>
		<description><![CDATA[I created a small Flex application that outlines how you can return messages (required fields, validation errors, etc) from Salesforce.com. The code is fairly basic and checks the return object&#8217;s success flag and display error message depending on the value of the flag. You can run this demo on my Developer Site. 1 2 3 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F08%2F02%2Fdisplaying-validation-messages-with-flex-and-salesforce-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F08%2F02%2Fdisplaying-validation-messages-with-flex-and-salesforce-com%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I created a small Flex application that outlines how you can return messages (required fields, validation errors, etc) from Salesforce.com. The code is fairly basic and checks the return object&#8217;s success flag and display error message depending on the value of the flag.</p>
<p><strong>You can </strong><a style="color:#80ae14;text-decoration:underline;margin:0;padding:0;" href="http://jeffdouglas-developer-edition.na5.force.com/examples/FlexValidation" target="_blank"><strong>run this demo</strong></a><strong> on my Developer Site.</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">&nbsp;
&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;
    backgroundGradientAlphas=&quot;[1.0, 1.0]&quot;
    backgroundGradientColors=&quot;[#F3F3EC, #F3F3EC]&quot;
    creationComplete=&quot;login()&quot;
    layout=&quot;vertical&quot;
    height=&quot;300&quot; width=&quot;500&quot;&gt;
&nbsp;
	&lt;mx:Script&gt;
    &lt;![CDATA[
        import com.salesforce.*;
        import com.salesforce.objects.*;
        import com.salesforce.results.*;
        import mx.controls.Alert;
&nbsp;
        [Bindable] public var sfdc:Connection = new Connection();
&nbsp;
        private function login():void {
&nbsp;
            var lr:LoginRequest = new LoginRequest();
            sfdc.protocol = &quot;http&quot;;
            sfdc.serverUrl = &quot;http://na5.salesforce.com/services/Soap/u/14.0&quot;;
            lr.username = &quot;YOUR_USERNAME&quot;;
            lr.password = &quot;YOUR_PASSWORD_AND_TOKEN&quot;;
            lr.callback = new AsyncResponder(loginSuccess, loginFault);
            sfdc.login(lr);
&nbsp;
        }
&nbsp;
		private function submitForm():void {
&nbsp;
			var aSo:Array = new Array();
			var so:SObject = new SObject(&quot;Contact&quot;);
			so.FirstName = firstName.text;
			so.LastName = lastName.text;
			so.Email = email.text;
&nbsp;
			aSo.push(so);
&nbsp;
			sfdc.create(aSo,
				new AsyncResponder(
					function (obj:Object):void {
						if (obj[0].success == true) {
							Alert.show(&quot;Created record: &quot;+obj[0].id);
						} else {
							Alert.show(obj[0].errors[0].message)
						}
					}, sfdcFailure
				)
			);
&nbsp;
		}
&nbsp;
		private function loginSuccess(result:Object):void {
			contactForm.enabled = true;
		}
&nbsp;
        private function sfdcFailure(fault:Object):void {
            Alert.show(fault.faultstring);
        }
&nbsp;
        private function loginFault(fault:Object):void
        {
            Alert.show(&quot;Could not log into SFDC: &quot;+fault.fault.faultString,&quot;Login Error&quot;);
        }
&nbsp;
    ]]&gt;
	&lt;/mx:Script&gt;
	&lt;mx:Text text=&quot;To create a new Contact, Last Name is required by Salesforce.com while Email is required via a custom validation rule. &amp;#xd;&amp;#xd;Submit the form with different combinations to view the resulting messages returned from Salesforce.com.&amp;#xd;&quot; width=&quot;449&quot;/&gt;
	&lt;mx:Form id=&quot;contactForm&quot; width=&quot;100%&quot; height=&quot;100%&quot; enabled=&quot;false&quot;&gt;
		&lt;mx:FormItem label=&quot;First Name&quot;&gt;
			&lt;mx:TextInput id=&quot;firstName&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Last Name&quot;&gt;
			&lt;mx:TextInput id=&quot;lastName&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Email&quot;&gt;
			&lt;mx:TextInput id=&quot;email&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem&gt;
			&lt;mx:Button label=&quot;Submit&quot; click=&quot;submitForm()&quot;/&gt;
		&lt;/mx:FormItem&gt;
	&lt;/mx:Form&gt;
&nbsp;
&lt;/mx:Application&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/08/02/displaying-validation-messages-with-flex-and-salesforce-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Big, Scalable Bucked of RIA Goodness</title>
		<link>http://blog.jeffdouglas.com/2009/06/23/a-big-scalable-bucked-of-ria-goodness/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-big-scalable-bucked-of-ria-goodness</link>
		<comments>http://blog.jeffdouglas.com/2009/06/23/a-big-scalable-bucked-of-ria-goodness/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 21:14:22 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=943</guid>
		<description><![CDATA[I was thinking about writing this tutorial but it looks like someone has already beat me to it. This is a really good example of using Flex, BlazeDS and Eclipse with Google App Engine for Java for a highly scalable interface. He even references the GAE/J hack for Adobe BlazeDS to run. Nice work!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F06%2F23%2Fa-big-scalable-bucked-of-ria-goodness%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F06%2F23%2Fa-big-scalable-bucked-of-ria-goodness%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I was thinking about <a href="http://jvalentino.blogspot.com/2009/06/flex-blazeds-google-app-engine-java.html" target="_blank">writing this tutorial</a> but it looks like someone has already beat me to it. This is a really good example of using Flex, BlazeDS and Eclipse with Google App Engine for Java for a highly scalable interface.</p>
<p>He even references the GAE/J <a href="http://martinzoldano.blogspot.com/2009/04/appengine-adobe-blazeds-fix.html" target="_blank">hack for Adobe BlazeDS</a> to run.</p>
<p>Nice work!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/06/23/a-big-scalable-bucked-of-ria-goodness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex and Force.com Toolkit Updates</title>
		<link>http://blog.jeffdouglas.com/2009/06/22/flex-and-force-com-toolkit-updates/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flex-and-force-com-toolkit-updates</link>
		<comments>http://blog.jeffdouglas.com/2009/06/22/flex-and-force-com-toolkit-updates/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:42:53 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=930</guid>
		<description><![CDATA[I&#8217;m a BIG fan of Flex and have been developing applications with it since the Flex 2 beta. Not only is it a great front-end for Java applications but you can create some stunning interfaces for Salesforce.com. We have a number of applications in Production using the Force.com Toolkit and Adobe BlazeDS. The Toolkit allows [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F06%2F22%2Fflex-and-force-com-toolkit-updates%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F06%2F22%2Fflex-and-force-com-toolkit-updates%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/06/contact-search.png" rel="lightbox[930]"><img class="alignleft size-medium wp-image-931" style="padding-right:10px;" title="contact-search" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/06/contact-search.png?w=300" alt="contact-search" width="300" height="224" /></a>I&#8217;m a BIG fan of Flex and have been developing applications with it since the <a href="http://labs.adobe.com/wiki/index.php/Showcase:Flex_Developer_Derby" target="_blank">Flex 2 beta</a>. Not only is it a great front-end for Java applications but you can create some stunning interfaces for Salesforce.com.</p>
<p>We have a number of applications in Production using the <a href="http://developer.force.com/flextoolkit" target="_blank">Force.com Toolkit</a> and <a href="http://blog.jeffdouglas.com/2009/03/26/tutorial-salesforcecom-with-flex-and-blazeds/" target="_blank">Adobe BlazeDS</a>. The Toolkit allows you to run SOQL queries, call web services and more. It&#8217;s amazing the interfaces and mashups you can develop using the Force.com platform.</p>
<p>Salesforce.com just released an update of the Toolkit which includes the latest version of the Force.com web services API, enhancements and bug fixes. Information on the Force.com Toolkit for Adobe AIR and Flex is <a href="http://developer.force.com/flextoolkit" target="_blank">available here</a>.</p>
<p>Today, James Ward, the RIA Cowboy (is he really a cowboy?), <a href="http://www.jamesward.com/blog/2009/06/22/flex-and-salesforce-force-com-updates/" target="_blank">announced an update</a> of the <a href="http://www.adobe.com/devnet/salesforce/" target="_blank">Adobe Developer Connection</a> site that includes contains new Salesforce.com related videos, articles, demos and tutorials.</p>
<p>Hop over to Adobe&#8217;s site and get started developing rich internet applications that will wow your users!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/06/22/flex-and-force-com-toolkit-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>15 Reasons for Java Programmers to Learn Flex, BlazeDS and Salesforce.com</title>
		<link>http://blog.jeffdouglas.com/2009/05/06/15-reasons-java-programmers-to-learn-flex-blazeds-salesforce/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=15-reasons-java-programmers-to-learn-flex-blazeds-salesforce</link>
		<comments>http://blog.jeffdouglas.com/2009/05/06/15-reasons-java-programmers-to-learn-flex-blazeds-salesforce/#comments</comments>
		<pubDate>Wed, 06 May 2009 14:58:35 +0000</pubDate>
		<dc:creator>Jeff Douglas</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=839</guid>
		<description><![CDATA[InfoQ has a really good article entitled, 13 Reasons for Java Programmers to Learn Flex and BlazeDS. I&#8217;ve been a big fan of Flex front ends for Java for a long time and have a couple of application running in production with Adobe BlazeDS. I have a tutorial to help you get up and running [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F05%2F06%2F15-reasons-java-programmers-to-learn-flex-blazeds-salesforce%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.jeffdouglas.com%2F2009%2F05%2F06%2F15-reasons-java-programmers-to-learn-flex-blazeds-salesforce%2F&amp;source=jeffdonthemic&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://blog.jeffdouglas.com/wp-content/uploads/2009/05/blazeds.jpg" rel="lightbox[839]"><img class="alignleft size-full wp-image-840" style="padding-right:10px;" title="blazeds" src="http://blog.jeffdouglas.com/wp-content/uploads/2009/05/blazeds.jpg" alt="blazeds" width="95" height="100" /></a>InfoQ has a really good article entitled, <a href="http://www.infoq.com/articles/java-flex-blazeds">13 Reasons for Java Programmers to Learn Flex and BlazeDS</a>. I&#8217;ve been a big fan of Flex front ends for Java for a long time and have a couple of application running in production with <a href="http://www.infoq.com/articles/java-flex-blazeds" target="_blank">Adobe BlazeDS</a>. I have a <a href="http://blog.jeffdouglas.com/2009/03/26/tutorial-salesforcecom-with-flex-and-blazeds/" target="_blank">tutorial</a> to help you get up and running with Flex, BlazeDS and Salesforce.com if you are interested.</p>
<p>The InfoQ article only has 13 reasons but I threw in two extra. Here are the reasons they state but you can check out the article for more detail on each one.</p>
<p>My favorite reason is #3, &#8220;You can have a job in another six months&#8221;. If you are out of work right now why not get started learning Flex and BlazeDS? Adobe is <a href="https://freeriatools.adobe.com/learnflex/?PID=1225267" target="_blank">offering unemployed developers free licenses of Flex Bulider</a> to help you get back in the game. You can also learn Salesforce.com and get into cloud computing. <a href="http://blog.jeffdouglas.com/2009/04/08/start-developing-with-salesforcecom-today/" target="_blank">Here&#8217;s how you can get started</a> for free.</p>
<p>Reasons why Java developers should learn Flex and BlazeDS:</p>
<ol>
<li>It&#8217;s open source</li>
<li>It has great community support</li>
<li>You can have a job in another six months</li>
<li>Higher business ROI</li>
<li>Flex was the first language designed for creating UIs</li>
<li>It has a programming model similar to Java</li>
<li>BlazeDS runs in any Java application server</li>
<li>You can use it with existing Java applications</li>
<li>You can extend BlazeDS and modify it with Java</li>
<li>You can call BlazeDS from HTML and JSP</li>
<li>Flex and BlazeDS data transfer outperform other Ajax solutions</li>
<li>You can call BlazeDS directly from Java clients</li>
<li>It works with Spring</li>
<li>It works with Google App Engine for Java.  <a href="http://martinzoldano.blogspot.com/2009/04/appengine-adobe-blazeds-fix.html" target="_blank">Here are the details</a> on the setup.</li>
<li>It works almost effortlessly with Salesforce.com</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffdouglas.com/2009/05/06/15-reasons-java-programmers-to-learn-flex-blazeds-salesforce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

