Flex App Basics: And Finally - Source Code Download
Enough waffle Jake, just give us the code. Ok, I've been teasing you long enough. Here's the download of both the Flex source code and the Notes database for the Contact Manager app we've been looking at.
Download the Zip file and extract the NSF to your server and the Zip within the Zip to your PC somewhere. Then, from within Flex Builder, go to File -> Import and browse to this Zip. This will import all the code as a ready-to-compile project.
Before you run it - once it's imported - open the Constants.as file from the root "/src" folder and then change the default path to wherever you put the NSF. Save the file and hit the compile/run/play button (green triangle). It should compile and run. You can then start adding documents to the backend database in Notes. Et voila.
As a recap, here are the ten posts I've made over the last month or so, which describe various aspects of the code:
- Building Your Views Remotely
- Extending Basic View Behaviour
- Using Components To Simplify Your Code
- Opening Documents From a View
- Managing Document Attachments
- Multiple File Uploads (note: read the comments to this post if you plan on using it!)
- Alert Is To Flex as MessageBox Is To LotusScript
- Display Column Values As Icons
- Creating an Icon Library
- The Form Container
What it's not is a step-by-step guide that let's a beginner get to grips with Flex development. If you're looking for a more in-depth guide to learning Flex basics then you could try this comprehensive series of screencasts.
What it is is an ill-thought-out series of ramblings with very little coercion. By making it a numbered series I may well have given the wrong impression. Sorry. While each of the ten posts has its own merits there's little point reading them in order, really. Although, if you're going to pick apart the Flex app itself it might be worth doing so.
Even if you have no use of a Contact Manager (heck, if you needed a contact manager then this probably isn't of much use anyway) the Flex app represents a conglomeration of as many of my current "best practices" as I could squeeze in. The code contains a lot of the goodness that I've learnt over the past year or more of my love affair with Flex. Primarily it demonstrates the ever-important concept of using re-usable components wherever possible.
Enjoy. If you have any questions, let me know...
>Hear that? Silence! Be the first to talk. Use the form below...
can't talk - looking at code...
Reply
Hi Casper,
Assuming you're the same Casper I spoke to a while back about your name, you might be pleased to know there'll be a Casper Howlett arriving any day now (I gave in under pressure and am starting to like the name now ;-). Then again there's a 50% chance it might not be a Casper...
Reply
Show the rest of this thread
The only way you get ahead in development is by stealing the work done by others. The customers/clients don't know this of course, so it makes us look good at what we do.
But in the blogging world we all know who to steal off. The ones who blaze the trails for others to follow. Which is the reason everybody comes and visits this site. We steal from the best.
Once again, you've proved you're ahead of the curve. On behalf of me and all the other little thieves, a huge Thank You.
Reply
Thanks Dragon. Flattery is always welcome here!
Reply
A round of applause for Jack Howlett.
Reply
Never mind Jack! What about me?
Reply
Show the rest of this thread
All rise , Mr Jake Howlett has enter the room
Reply
Hi Jake,
Once again. Thank you very much !
Alejandro ;)
Reply
Hi Jake,
I feel this application covers all the flex basics that are required to develop any flex application integrating with domino :) ...
Thanks for all your effort in this... :)
Reply
That's something I meant to talk about above but forgot to. Although it's called "contact manager" and has views/forms for contacts and companies what I was trying to show was a way to build a re-usable framework for porting Domino apps to Flex.
The views are controlled from the server, so all you have to do is quickly knock up a form based on the Form.mxml component, tie it to the view and you're away.
Obviously it's not as simple as just pointing the Flex app at an NSF and letting it do the rest. While it is (in theory) possible to control every aspect from teh server and use the same Flex app for all (simple) databases I just feel the idea of a one size fits all framework is never going to work in practice.
Glad you could see the usefulness of the "architecture" though.
Reply
Show the rest of this thread
Thanks jake for inspiring in Flex development..
Reply
Don't sell yourself short Jake - you've done a great job as usual and have inspired many of us. Big thanks & hope everything goes will with the birth of your new arrival.
Reply
Yes... "We steal from the best".
(Or "Jake Howlett what else?!")
Thank you so much Jake
Reply
Hi Jake,
Great posts - as ever, a real help to a fledgling flex developer.
One thing that has come up for me - I have a flex app sitting on a hosted shared server and the hosting company is more than somewhat reluctant to allow me to add the DominoDisableFileUploadChecks=1 to the ini.
Any ideas how I might be able to get around this?
Eddie
Reply
Move host? Every other solution is a hack.
Reply
Thanks! Great work!
But i can't understand how to run it localy? I've changed defaukt path but it didn't work...
Reply
Hi Jake,
I am running this application locally.
But when i try to upload a file, it's giving IO Error.
Could you please let me know, why the error is coming?
Anonymous has editor access to the database.
I need to have file upload functionality in my flex and domino project.
Reply
Hi Jake,
In the log i am getting the following exception.
HTTP Web Server: File Upload Not Allowed Exception [/contacts.nsf/0/64B24509D51EE1EB6525774800169D73?SaveDocument]
I have added DominoDisableFileUploadChecks=1 in notes.ini
Reply
My guess would be that that INI setting doesn't work when developing locally.
Reply
Show the rest of this thread