Flex

Getting started with Glare-DataServices

Glare-DataServices is a framework for building Flex Remoting services in VisualWorks Smalltalk. In this post, I will guide you through the steps for creating a small application that demonstrates the use of the framework. Install the bundle First, you have to connect to the Cincom Public Store Repository. Then open the list of Published Items and load the bundle GlareDataServices. It includes the Glare bundle and Glare-DataServices packages. The required dependencies AT MetaNumerics and Opentalk are automatically loaded if not present.

Getting started with Glare-DataServices

Glare-DataServices is a framework for building Flex Remoting services in VisualWorks Smalltalk. In this post, I will guide you through the steps for creating a small application that demonstrates the use of the framework. Install the bundle First, you have to connect to the Cincom Public Store Repository. Then open the list of Published Items and load the bundle GlareDataServices. It includes the Glare bundle and Glare-DataServices packages. The required dependencies AT MetaNumerics and Opentalk are automatically loaded if not present.

Flex Remoting ignores class mapping

if your application does not yet actually use that client Class. In my application, the result of a remote invocation kept returning a dynamic Object instead of the intended ValueObject class “Slot” although I specified the mapping and the RemoteClass metadata: weborb-config.xml [sourcecode language=“xml”] com.cae.planning.models.Slot Slot Slot Slot.as [sourcecode language=“java”] [Bindable] [RemoteClass(alias=“com.cae.planning.models.Slot”)] public class Slot { … } So merely including the “import com.cae.planning.models.Slot;” in my application does not instruct the compiler to actually include that Class and therefore knows about the class mapping.

Flex Remoting ignores class mapping

if your application does not yet actually use that client Class. In my application, the result of a remote invocation kept returning a dynamic Object instead of the intended ValueObject class “Slot” although I specified the mapping and the RemoteClass metadata: weborb-config.xml [sourcecode language=“xml”] com.cae.planning.models.Slot Slot Slot Slot.as [sourcecode language=“java”] [Bindable] [RemoteClass(alias=“com.cae.planning.models.Slot”)] public class Slot { … } So merely including the “import com.cae.planning.models.Slot;” in my application does not instruct the compiler to actually include that Class and therefore knows about the class mapping.

Tiny, single-purpose class: ResultToFunctionAdaptor

Every now and then I need a small piece of functionality that perfectly fits into a single, minimal-behavior thus single-purpose class. This time I am developping a Adobe Flex application that uses the RemoteObject facilities. Before invoking a method on a RemoteObject, you have to add two event handlers that will be called with a ResultEvent or a FaultEvent respectively. Typically in the “onResult(event:ResultEvent)” function, one takes the result of the event and calls another function or update a view.

Tiny, single-purpose class: ResultToFunctionAdaptor

Every now and then I need a small piece of functionality that perfectly fits into a single, minimal-behavior thus single-purpose class. This time I am developping a Adobe Flex application that uses the RemoteObject facilities. Before invoking a method on a RemoteObject, you have to add two event handlers that will be called with a ResultEvent or a FaultEvent respectively. Typically in the “onResult(event:ResultEvent)” function, one takes the result of the event and calls another function or update a view.

Sorting XMLListCollection by attribute

Just want to share the result of a small puzzle I had about sorting elements of an XMLListCollection by one of the attributes of such an element. At first, I tried sorting the elements of the XMLList I had, but the API does not provide any methods to do that. Bruce Phillips wrote a snippet that pointed me to right direction. So, here it is: var doc:XML = <root> <item name=“C”/>

Sorting XMLListCollection by attribute

Just want to share the result of a small puzzle I had about sorting elements of an XMLListCollection by one of the attributes of such an element. At first, I tried sorting the elements of the XMLList I had, but the API does not provide any methods to do that. Bruce Phillips wrote a snippet that pointed me to right direction. So, here it is: var doc:XML = <root> <item name=“C”/>

Flex Project version and buildnumber

I wanted to associate version and build information with every compilation of a Flex project. Such information is useful when deploying to different staging environments (e.g. are you sure you uploaded the correct SWF ?) and helps tracking feedback (e.g. bugs) from users using a particular build. First, I added a simple resource version.xml to store version and build info: <?xml version=‘1.0’ encoding=‘UTF-8’?> <version name=‘0.1’ build=‘124’/> Then I defined a component Version.

Flex Project version and buildnumber

I wanted to associate version and build information with every compilation of a Flex project. Such information is useful when deploying to different staging environments (e.g. are you sure you uploaded the correct SWF ?) and helps tracking feedback (e.g. bugs) from users using a particular build. First, I added a simple resource version.xml to store version and build info: <?xml version=‘1.0’ encoding=‘UTF-8’?> <version name=‘0.1’ build=‘124’/> Then I defined a component Version.

Deploying Flex using Capistrano

Capistrano is a deployment tool initially created to support the remote installation of Rails applications. One of the assumptions Capistrano makes is that the application (source) can be pulled out of a source code management system such as Subversion. In case of Adobe Flex applications, compiled sources (SWF,HTML,…) need to be deployed to the Web server. So instead of pulling sources from a repository, I needed to push compiled code to the server.

Flex Bindable Hash

For the Dunelox library, I needed a simplified Flex version of the Spring ApplicationContext which is a generic Hash object containing model objects accessed by a key (String). Visual components that are wired to these models objects need to be updated automatically using the standard event mechanism in Flex. So, I had a look at the standard ArrayCollection to find out how it notifies components that are wired to elements by index.

Flex Bindable Hash

For the Dunelox library, I needed a simplified Flex version of the Spring ApplicationContext which is a generic Hash object containing model objects accessed by a key (String). Visual components that are wired to these models objects need to be updated automatically using the standard event mechanism in Flex. So, I had a look at the standard ArrayCollection to find out how it notifies components that are wired to elements by index.