Hi people....

I am soon to release a new article for FarCry (still need to talk to the
Daemon guys to decide how best to do this - seeing as I dont have that
community site up yet as I was talking about).....

An issue we have been addressing here since moving to FarCry is "How best
to integrate Legacy and External systems into the FarCry framework".

Most of you will know that we have basically handled it by using lots of
includedObj files (and I still have some code to release to Daemon to
"upgrade" some of that functionality).

However, in a few instances I have been playing with rules (on the ABN
AMRO Morgans site, the Aspect Huntley news is generated through a hacked
about XML Feed rule).

While this has been very kewl, it is only a basic "hook" into the FarCry
framework.  The "execute" method of the rule simply calls the appropriate
webservice and formats up some HTML that it returns for the container to
deploy.

Ideally, what I have really wanted, was a way to be more "integral" with
the FarCry Framework and return a "collection" (array) of the items that
need to be displayed and then create a display method to execute against
each item in the collection.  This is how it works with dmType derived
objects like dmNews, dmFacts, dmEvents, etc.

So - I hear you say - "Why not just create a new dmType-derived object?". 
There are a lot of reasons for NOT doing this for legacy/external data.

1. The data has no storage requirement in the FarCry system and I would
not want to polute the schema (we have LOTS of this stuff)
2. Because of number 1, you don't want/need to "deploy" the type in the
FarCry Administrator
3. I don't want non-deployed dmType objects hanging around - it's messy
4. My data doesn't necessarily use an "objectid" as a key (it could be a
string, or a number, or some complex key)

So - I now hear you saying - "Is there an answer?".  YES - there is.

I wont go into a lot of the "how to" detail yet, but basically have
created a base custom type class - called ctExternalType (the ct standards
for Custom Type) - and have placed this into the packages/custom folder of
my FarCry application.  This class "implements" enough of the dmType
interface so that it can appear to a container as being a dmType-derived
object (oh for a <CFINTERFACE> tag and a implements="" attribute for
<CFCOMPONENT>).  There is one tiny change to the method prototype in that
objectID has been changed from being type="UUID" to type="ANY" (for
reasons explained below).

To provide access to your own data (wherever it may be) you simply derive
from ctExternalType and override the "getData" method (which is passed the
"objectID" and "dsn" - just as it would be in dmType) and then race off
into the wild blue yonder, find some data, fill in a structure, and return
it.

The base class will then appropriately set up the stObj structure (with
the data you returned) and call the nominated display method.

After that, you simply create your rule as you would in FarCry and ensure
that when you create the invocations array in your execute method that you
tell it to create one of your derived types (as well as an appropriate
display method) and the container.cfc will do the rest.  With the change
of the objectID type from UUID to ANY this allows me to supply any
arbitrary key mechanism back when I create the invocations entries (the
"key" could even be an XML packet that IS the data itself - your derived
class just has to know how this information is structured).

The display methods for one of these derived classes lives in the webskin
under the name of the new class - just as any dmType dervived object
would.  This allows you to use the internal navajo/farcry routines to
extract suitable display methods in your update method that helps populate
the metadata for the container.


So, if I have aroused your interest with this, I hope to pull the article
together and get it up on the FarCry site soon.


And much of this work is going to go towards the community site that I
have been conceptualising.  It will go a long way into building the "plug
in" functionality that will provide a "portal" style interface that can be
tailored by a visitor (as it will allow access to some external services -
similar to the XML Feed rule - but more integrated into the FarCry
framework).


NOTE: the code for this extension is written, tested and working - and the
article has a bunch of notes - I just need to pull it all together.




Gary Menzel
Web Development Manager
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828  FX:  07 3834 0828


If this communication is not intended for you and you are not an authorised recipient 
of this email you are prohibited by law from dealing with or relying on the email or 
any file attachments. This prohibition includes reading, printing, copying, 
re-transmitting, disseminating, storing or in any other way dealing or acting in 
reliance on the information.  If you have received this email in error, we request you 
contact ABN AMRO Morgans Limited immediately by returning the email to [EMAIL 
PROTECTED] and destroy the original. We will refund any reasonable costs associated 
with notifying ABN AMRO Morgans. This email is confidential and may contain privileged 
client information. ABN AMRO Morgans has taken reasonable steps to ensure the accuracy 
and integrity of all its communications, including electronic communications, but 
accepts no liability for materials transmitted. Materials may also be transmitted 
without the knowledge of ABN AMRO Morgans.  ABN AMRO Morgans Limited its directors and 
employees do not accept liability for the results of any actions taken or not on the 
basis of the information in this report. ABN AMRO Morgans Limited and its associates 
hold or may hold securities in the companies/trusts mentioned herein.  Any 
recommendation is made on the basis of our research of the investment and may not suit 
the specific requirements of clients.  Assessments of suitability to an individual?s 
portfolio can only be made after an examination of the particular client?s 
investments, financial circumstances and requirements.
ABN AMRO Morgans Limited (ABN 49 010 669 726 AFSL 235410) A Participant of ASX Group


---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to