Getting Started

The Potomac framework is split into two parts:

  • The actionscript/mxml Flex code
  • A Flash Builder Plugin that provides extra Potomac capabilities to Flash Builder

This guide will walk you through the steps of installing the plugin and creating your first Potomac project.


Potomac requires Flex SDK 4.0 and Flash Builder 4.0.


Download Potomac
Download Potomac and unzip it somewhere on your PC.


Install the Potomac plugin
Depending on your version of Eclipse, your installation instructions will differ. If you do not know which version of Eclipse is underneath your Flash Builder installation just go to Help – About Eclipse SDK.

If you’re running Eclipse 3.4 or later, copy the Potomac plugin jar (com.elementriver.potomac.sdk_1.0.0_vXXXXXX.jar) into the “dropins” directory of your Flash Builder/Eclipse folder. You’ll need to restart Eclipse.

If you’re running Eclipse 3.3 or lower, copy the Potomac plugin jar (com.elementriver.potomac.sdk_1.0.0_vXXXXXX.jar) into the “plugins” directory of your Flash Builder/Eclipse folder. You’ll need to restart Eclipse.



Configure the Potomac Target Platform
The target platform contains the actual Potomac Flex code (About the Target Platform).

When you unzipped the Potomac zip file, you should have extracted a folder called “targetPlatform”. Go into Flash Builder, go to Preferences, within the Preferences dialog select Potomac. Now set the target platform options to the targetPlatform folder you extracted.

Now you’re ready to create your first Potomac project.



Create a Bundle
Potomac projects are composed of bundles (i.e. Potomac modules). Bundles are hosted within Flex Library Projects.

Create a new Flex Library Project.

Once the library project is created, you need to add the Potomac Bundle Nature to it.

Right-click on the project and select the new “Add Potomac Bundle Nature”.

When that is complete, you should notice that Potomac created a new file named “bundle.xml” in the project’s root folder.



Configure the Bundle
Now you’ll need to perform some standard configuration to the bundle. Open the bundle.xml file.

In the Bundle XML Editor, add the two Potomac bundles, potomac_core and potomac_ui, to the dependencies list. Click save.





Add a Sample Component
You’ll need to add at least on UI component to see anything on screen. Here’s a simple one you can cut-n-paste in called MyComponent.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
	<mx:Metadata>
		[Page(id="hellopage",title="Hello World")]
		[Part(id="hellopart",page="hellopage",
		      folder="default",title="Hello World")]		
	</mx:Metadata>
	<mx:Label x="10" y="10" text="Hello World"/>
</mx:Canvas>




Create an Application
A Potomac application is a normal Flex Project with the Potomac Application Nature. Create a Flex Project, then right-click on the project and select “Add Potomac Application Nature”.





Configure the Application
Open the newly created appManifest.xml. This file is used to configure your Potomac application.

Add potomac_ui, potomac_ui_templates_dark, and your newly created bundle to the manifest’s bundle list.

Set potomac_ui and potomac_ui_templates_dark to load as RSLs.

Now select the potomac_dark template (it became available after we included the potomac_ui_templates_dark bundle). Click save.

Lastly, you’ll need one Potomac stub to the application’s main mxml file. Simply add an instance of the PotomacInitializer like:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute" xmlns:derived="potomac.derived.*">
	<derived:PotomacInitializer/>
</mx:Application>




Run the Application
Now you’re ready to run the application




Importing the Sample Project

Potomac comes with a (hopefully) easy to follow sample project.

The sample project includes two bundles and one application.

To import the sample app into FlexBuilder, click on File – Import…

Select General – Existing Projects Into Workspace.

Select the “exampleApp” folder that was extracted from the potomac zip file for the root directory.

Check the “Copy projects into workspace” option.

Click Finish.

Once the projects import and rebuild, you should be able to run the sample appication.