Showing posts with label flex 3. Show all posts
Showing posts with label flex 3. Show all posts

Friday, September 11, 2009

Proxy Debuggers and Flex NetConnection Debugger

With AS2, setting up a NetConnection between a Flash Player and a server running Flash Remoting could be streamlined using the Flex NetConnection Debugger. It was included with Flex 1.0 ca. 2005 and only required two short steps to enable. Many developers included it in their remoting utilities shortlist.

Now that we're living in a CS4 age, the playing field has changed. All the functionality of the NetConnection Debugger has been integrated into the Flash library. This means that instead of launching separate apps for debugging, you can simply mock up a routine using calls to available library components.

Good enough, but if you prefer a dedicated debugging app, NetConnection Debugger is out, and some other options are in its place.

Midnight Coders App Puncher

Much has been said about Midnight Coders' contributions to RIA development. Their middleware tier is arguably the best muscle around and can be a real time-saver. I'm speaking of WebORB, but particular to debugging, have a look at another of their products, the RIA App Puncher.

Charles Web Debugging Proxy

Link to Charles.

ServiceCapture

Link to ServiceCapture.

Friday, September 4, 2009

RemoteObject Endpoints in Django

A few quick assumptions about your project:
  • It's built with a lightweight proxy server such as nginx or lighttpd
  • It utilizes the Django web framework
  • It remotes data using some form of ORM
  • It is presented via Flash/Flex
If this is the case, the simplest and most straightforward way to configure your gateway is by setting it at the root URL:

#my /etc/nginx/sites-enabled/mysite.conf
server {
listen 50.5.5.50:80;
server_name myurl.com www.myurl.com;
if ($host = 'www.myurl.com' ) {
rewrite ^/(.*)$ http://myurl.com/$1 permanent;
}

location / {
proxy_pass http://127.0.0.1:80/;
include /etc/nginx/proxy.conf;
}

location /media/ {
root /home/django/domains/myurl.com/public_html/;
}
}


Thus all web traffic that doesn't match '/media/' is passed to the urls.py for further processing. This is however at odds with your remoting requirements for Flash/Flex. To wit, you need a static file called crossdomain.xml to be available at your site's web root in order to meet the Flash client's security needs.

I looked for a good answer to this and found the Django-Flashpolicies by James Bennett effective and QUICK for this very purpose.

All you will need to do, essentially, is this:
easy_install django-flashpolicies

...and this...


url(r^'crossdomain.xml$',
'flashpolicies.views.simple',
{'domains': ['media.example.com', 'api.example.com']}),

...and you're good to go. Works better than a savage karate chop to the nose, most of the time anyway.

Hope that allows you to move forward quickly.

Thursday, July 16, 2009

Version Control with Subversion

Setting up version control for, among other things, Flex code repositories, is not too hard to set up with Mediatemple (dv) accounts. SVN is already ready to run from SSH.

I followed these steps to get it up and going. What's more, it works.
  • Svn on mediatemple knowledgebase article is here
  • Great overview on bit-101.com
Good luck with your own implementations.

Update: I set up a SVN repository server on my account and it is simple to use in Eclipse projects. Once your repository is configured, whenever you start a new project, simply right click it in Eclipse, then choose Team > Share Project... All you have to do is enter your username and password, and the IDE will take care of starting a new svn repos. The dark master will be pleased...

Friday, June 26, 2009

Eclipse Galileo Drops!

Version 3.5 of the Eclipse Integrated Development Environment application has officially been released.

What is Eclipse? A free open-source software development platform you can install on mac, win or linux.

What does it run? Eclipse was originally written to support Java, but now it has language packs for over a dozen languages.

What is Galileo? For several years now the Eclipse Foundation, an organization of open source Eclipse developers, have released a new iterative version of Eclipse late June of each year. Galileo, code name for the latest Eclipse version, officially dropped a couple of days ago. It's version 3.5 of the venerable platform.

What do you use Eclipse for? Currently, I code Actionscript in Eclipse using the Flex SDK plug in. It streamlines all the complexities of developing RIAs, and it also incorporates Subversion, an open-source version control app.

What's next? Now that Galileo is officially released, is it worth upgrading to? Turns out, lots of applications are not ready to support it yet. I've found several blogs documenting attempted upgrades in Linux, Windows and OSX that ended in grief, and not just regarding the Flex Builder plug-in. Be sure to research compatibility before getting too deep into a new version of Eclipse.

Tuesday, May 19, 2009

A Good ImageCache for Flex Lists

A while back I brought to life a dream custom component I had wanted for a long time. It's basically a horizontal scrolling thumbnail image holder, the ubiquitous kind that's in everything from YouTube to Flickr. Mine is a little different in that it combines the following:
  • Hover side-scrolling
  • Accurate shuttle indicator below images
  • Accu-sizes to any display object container width
  • and finally...it caches the images for no lag
Pretty much does the job for me. I'll post it soon, happy to share and hear feedback on it. And on that note, I ran across a legacy of cache issue explorations and solutions by other flex scripters. The earlier one, which I noted but haven't tried out, is Ely's SuperImage from a couple of years back. It touches on the all-important performance issue of non-caching assets in Flex components.

The follow-up, which I'm stoked to note is lean, lithe and easy to plug in, is thanksMister's ImageCache. There's even a sample app using the Flickr API. Tested and hereby endorsed. Hope you get some use out of it.

Monday, May 11, 2009

Flex talking to Flash

Here's another good refresher on getting a Flex app synched up with Flash swf resources, this time at giantflyingsaucer.com. I'll post a link to a tutorial on Flex with Flash-compiled swcs as soon as I come across one. Any favorites out there?

Accessing swf vars from Flex

Ever need your memory jogged on the topic of putting swf vars into your Flex app? Here's just the thing for that:

Flash cs3 as3 file "click.swf"

ActionScript Code:
click_mc.addEventListener(MouseEvent.CLICK, reportClick);
var output:String = new String();

function reportClick(evt:MouseEvent):void
{
for(var i:int = 0; i<5; i++) {
output += "I have been clicked. i = " + i + "\n";
}
}

MXML Flex 2.0
ActionScript Code:
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
<![CDATA[
private function updateTextField():void
{
output_txt.text += swf.content["output"];
}
]]>
</mx:Script>

<mx:SWFLoader x="10" y="10" source="click.swf" scaleContent="false" id="swf" click="updateTextField()"/>

<mx:TextArea x="10" y="518" width="550" height="211" id="output_txt"/>

</mx:Application>

Made for Flex 2 but perfectly applicable to 3, 4 and perhaps beyond... Thanks to the forums at actionscript.org for this one.

Thursday, May 7, 2009

Beginnings of an RIA ECommerce solution

Another round of tests and some interesting results. I have successfully stubbed the mySQL database into Flex via .Net procedures created by WebORB. Also, I have added fields to the mySQL tables of interest without any unique key violations in the Miva CMS. I had to add primary keys to several tables in the database, but as stated, no adverse affects, meaning the db queries in miva's cms are fairly fast and loose. In this case that is a good thing.

Still working on the details, but so far it seems possible to do the following:
  • Use Miva Merchant 5.5 as a backend solution for a rich ecommerce (web) application
  • Use Flex 3 as a client frontend with RPC enabled products arriving from Miva
  • Add custom fields as needed to elaborate on the data the Miva CMS typically allows
That's a good start. The test verifies an architecture consisting of Miva -> MySQL -> .NET -> Flex on the incoming side.

Now I'm looking into solutions for the Flex -> Google Checkout -> Miva on the shopping cart transaction side. For now, going to checkout will out of necessity pop out of the RIA window and open another. It's a small price to pay, especially considering there are virtually no single-state checkouts anywhere on the web. It hasn't hit the production line yet.

Since Miva is stable with additional fields in its DB but cannot administer the extra fields, my wishlist of useful add-ons now includes a secure Flex-based CRUD-enabled CMS to manage the custom fields added to Miva DB tables. It would be great to be able to post images and data through a form in Flex, and very possible time-permitting. For now, the method is direct DB data injection and FTP posting. Not good for a client admin, but fine for a developer at this point.

And the point is, it works!

Wednesday, May 6, 2009

More Miva Merchant

There have been some interesting revelations here. What I've found can be summarized thus:
  • Miva Merchant up to vers 4 uses a proprietary form of SQL called MIVA SQL. While it uses Structured Query Language, it does not share compatibility with MS SQL. Thus it is locked in its own fishbowl.
  • Miva Merchant 5 and on to current 5.5 gives resellers the option of configuring their product to reposit with MySQL instead of MIVA SQL, which provides a substantial performance boost. My webhost of choice for this project opted for the MySQL configuration. This is good.
  • Miva Merchant offers a range of export options for financials, including .dat files and the like. They do not currently offer any RESTful services of any kind. Thus the question of whether to REST or RPC for Miva is conclusively RPC or bust.
Contacting both HostMySite and Miva Tech Support in CA has confirmed the above. They recommend using Miva forums, but there is but scant info on this topic that I have found. The webhost tech department has been very cool and receptive to my questions and has custom configured my Miva-driven MySQL DB to allow me to connect and read data directly from it. This means there is finally a way to export data from the CMS portion of Miva and feed it to my custom Flex front end.

Now then.

The question remains, how will WebORB interpret the schema of this Miva-built DB? I hope well. Hand-coding RPC is out of the budget and timeline for this project. I am relying on the savvy of WebORB to translate the schema into useful server and client side code libraries such that, if all goes well, I can pull the inventory on the fly from Miva to my Flex application.

Between this and a lack of experience working with a MySQL .NET hybrid, I'm hoping it will go smoothly. I'm now creating the DSN to allow ODBC between the weborbconsole and MySQL, so I'll let you know what happens.

Monday, May 4, 2009

More Bugs In App Development

Encountered a scenario recently that underscores the difficulty of working in a multi-tier web app architecture. Recent project was SQL to .NET CMS and a Flex client side, spanned by Weborb.

Problem came about when I updated the .NET CMS, suddenly the front end flex app started throwing the application error, ____, stating a method in my weborb-generated code was coming up null. This was strangely the case not only for my code, but for the autogenerated testdrive as well.

I chalked it up to a misnamed package on either the server or client side, later to find that troubleshooting it was not helpful. I replaced the service locator xml files from my base install, which also did nothing to help.

Finally I built a test case and slowly bridged it from working to nonworking case, using varying test cases similar to the nonworking build. After lots of wasted time, I found what is either a memory leak, or an Eclipse bug.

Either way, I had to work around it and ultimately create a new build that is identical - as far as I can tell - to the nonworking version. Only it works.

The tier problem I speak of is the many levels of unknown in the overall architecture. It is difficult and time consuming to isolate layers one at a time to find the culprit. It would suggest that rich media apps require a team of specialized workers. Takes too long.

Wednesday, April 29, 2009

Bug in Weborb 3.6 for .NET prevents WDMF from generating server code

Here's an issue that could cost you lots of troubleshooting time to fix. While weborb is a stellar product IMO it is lacking in thorough support docs. Probably that is fine since a commercial client can purchase phone support, but I digress. The problem aka bug aka omission I refer to in weborb 3.6.0.3 results in:

Code Generation Failed

This is the result of an attempt to generate the all-important client-server serialization classes that weborb builds. The client classes are downloaded from the weborbconsole while the server classes are written to the bin directory assuming your permissions are properly set to allow this.

Permissions are easily set via Windows IIS or your webhost control panel. Permissions are also easily reviewed from your website of interest thanks to the diagnostics.aspx page provided. Potential issues are even coded red. Easy enough.

Problem is essentially the result of a wishlist item added to Weborb 3.6 and released 12/02/08, Visual Studio templates. I didn't even expect to find them, but did so and began enjoying the ease of deployment templates offer. Only problem is, they won't work unless you add the XSLT files in the ODBC directory from the original full vers of weborb30.

I tried other stuff for a while to fix the prob, then finally read the error text logs on my deployment and discovered the omission. As stated before, Weborb is the Barry Bonds of remoting, a real slugger for joining up RIAs for web and I can't say this enough. The fact that I could rely on the framework tools to hunt down the error and fix it is one reason why. Now, has anyone else had this problem? If so, I hope this helped.

Fig 1. Diagnostics aspx page for weborb









Fig 2. Creating a weborb-enabled website in Visual Studio 2008 using the weborb-provided template











Fig 3. The missing odbc folder, where it should be









Fig 4. What you should see if all goes well in the weborbconsole WDMF

Wednesday, April 8, 2009

SQL & LINQ for n-tier applications

As I've blogged a lot lately, WebORB bridges back end and presentation servers for AMF and DB CRUD functionality. Furthermore, once WebORB is configured properly, it deploys server and client code in an automated fashion, allowing this to happen. If you manage to rig it properly, it binds your data via method calls to the DB.

In developing an n-tier application, it's crucial to plan in advance how the tiers will provide for one another in the overall application chain. Justin J. Moses' blog of March 19th outlines the strength of utilizing SQL with LINQ in such a way. I especially enjoyed his definitions of generalized data transfer strategies as being either safety, hungry, greedy, or thrifty. Well done!

Since his description is more than adequate I won't go into it here, but seeing as it's a likely fit for my current project, I may post some notes later on data across the pipe with RIA.

Friday, April 3, 2009

WebORB Synopsis Pt. 1


WebORB by themidnightcoders, aka Dallas-based Mark Pillar and company, is a software application designed to facilitate and ease RIA remoting. Over its livespan, WebORB has grown to its current ambitious version (3.6) to become a sophisticated multi-tool of sorts, providing a broad range of services for a pastiche of server types.

How does a product such as WebORB come to be? Weborb is in fact one among a stable of solutions (amfphp, swx, BlazeDS, RubyAMF, LiveCylceDS et al) initiated to bridge the expanse between server side and client side in rich applications. The options in this lineup range from Open source and free to commercial and costly, from single protocol to advanced suite. WebORB among them could be said to toss the biggest lasso.

WebORB marries server technologies .NET, PHP, Rails and Java to presentation server clients Flex, Flash, AJAX and Silverlight. It allows the server side to do what it does best - provide a data bank and administration, while allowing the client to benefit from a live data source. There's a lot more on offer than simple connectivity, however.

WebORB can be deployed in modular fashion to an existing web application. Once integrated, it includes a proprietary console GUI to demo its many capabilities. As is explained in the console, WebORB offers three broad categories of connection services:
  1. Remoting (AMF3)
  2. Data Management (WDMF)
  3. Real-time Messaging
Among these, it is fitting to begin with remoting, as remoting was the initial goal of applications like WebORB. In its maturity as a service, invocation of remoting is bidirectional, fully interoperable, reflexive and essentially transparent. In addition to basic transfer of assets, WebORB remoting includes class mapping, secure channels of invocation, tree control with remote data, server-side exception handling, logins and security, and supports ARP, an open source framework for Flash and Flex initially authored by Aral Balkan.

WebORB effectively encapsulates the full capabilities of Flex Remoting, and in so doing, it lays bare the limitations of Remoting. Namely, that shuttling large serialized datatypes between environments is crude. It results in a loss of organizational nuance, such as hierarchies, relationships, dependencies. Put another way, the schema is not transferred with the data, and thus the sorting abilities that are the inherent value of a data system are lost. Data Management can be viewed as a means of addressing this limitation.

Data Management, aka WebORB Data Management for Flex or WDMF, is a means of preserving the relationships surrounding remote data between server and client sides. In a nutshell, WebORB imports table relationships directly from the server database and utilizes its own innovative analytical methods to create all the necessary interoperability through scripts it generates for both sides. In this way, WebORB enables explicit relationships to exist through a generative act of surrogation. In short, it analyzes, it marries, it step back into the shadows. Not bad, Midnightcoders, not bad. An invaluable utility and a tremendous time saver, Data Management also includes full CRUD, enabling the rich client to act as CMS if desired.

Real-time Messaging is another facet of WebORB to be explored later. Feel free to visit themidnightcoders site to learn more.

Adios for now.

Thursday, March 26, 2009

Deploying WebORB for .NET

To deploy WebORB into an existing ASP.NET application, follow the steps below:

1. Copy the following files/folders from the default Weborb installation directory to the corresponding folders in the target virtual directory:

/weborb.config
/bin/weborb.dll
/bin/MySql.Data.dll
/bin/Mono.Security.dll
/bin/Npgsql.dll
/diagnostics.aspx
/WEB-INF
/weborb.js (required only for the AJAX clients)

2. Add the following XML configuration to web.config in the target virtual directory:

<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="weborb.aspx" type="Weborb.ORBHttpHandler"/>
<add verb="*" path="codegen.aspx" type= "Weborb.Management.CodeGen.CodegeneratorHttpHandler"/>
</httpHandlers>
</system.web>
</configuration>
(Thanks to formatmysourcecode.blogspot.com for code formatting)


3. (Optional) To deploy console, example and code generator, copy the following folders with all files and subdirectories:

/weborbconsole.html
/console
/examples
/weborbassets
/all mdb files from the root

4. (Optional) Create /logs folder as the place where WebORB stores its log files

5. Grant Write permission to the user account ASP.NET uses for the following files and directories:

/weborb.config (required only if making configuration changes from the console)
/logs (required only if logging is enabled)
/weborbassets/codegen (required only if codegen is used in the console)
/weborbassets/uploads
/*.mdb (required only if writing data back on the server in some examples)

Additional steps may be required to configure logging and code generation features when deploying WebORB into another application. Generally the user account used by ASP.NET needs to have Write permission to the following files and folders:

/weborb.config
/logs
/weborbassets/codegen

Please direct any questions or comments to http://groups.yahoo.com/group/flashorb/.

Original document.

Tuesday, December 16, 2008

Now using email settings

Publishing by email today. For some new content, you could visit Adobe Site of the Day.

ToolTips in Flex 3

Tooltips. They pop up to provide contextual expansion. They enhance your workspace. They gratify you with sleek utility. They're an integral Flex component. You will probably be customizing them.

Flex Docs is a good starter on custom and standard tooltips:
http://www.adobe.com/devnet/flex/quickstart/using_tooltips/

Adobe docs are not so great when it comes to positioning custom tooltips, but fear not, it's simple once you know how :).

Just be sure to utilize both the toolTipCreate AND toolTipShow methods of the mx.events.ToolTipEvent class and you'll be golden.

Another plus, tooltips are a great use of MVC and you can encapsulate calls to events via event.toolTip.

Another good tutorial resource:
http://blog.flexmonkeypatches.com/2008/09/10/flex-custom-tooltip-speech-bubble/

Happy tooltipping.