Hi Dave

I had a bit of trouble getting meta data working myself. This is the syntax
I ended up using. The key was using xmlRoot.

<cfset obj = Reactor.createRecord("customerProfile") />
<cfset nameMaxLen =
obj._getDictionary().getValue("xmlRoot.customerprofile.firstname.maxlength")
/>

>From my understanding you pay the hit of generating the XML in
_getDictionary() once, but after that its cached in the object.

As for validate. When I get some spare time ill try to blog how I do
validations. The best way I found on learning how to do it was to read the
code in Model-Glue for GenericCommmit events. 


I spent some time myself trying to work out if I should use reactor or
transfer, but in the end the killer feature for me was this whole metadata
stuff and being able to get the maxlength from the database etc. without
having to code that into my config xml files. I understand in transfer you
have to create all this stuff yourself in the XML config.



Pat

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of David Phipps
Sent: Wednesday, 9 July 2008 2:50 AM
To: [email protected]
Subject: [Reactor for CF] Accessing the metadata

Hi,

I can't seem to workout how to access the metadata for an object? What  
I have is some textareas in a form that I need to know what the  
maxlength is so I can do some jquery to limit the input.

I noticed in the project_dateMetadata.cfc is the variable that I need:  
<cfset variables.metadata.fields[12]["length"] = "255" /> but how do I  
access it from the record object or do I need to create a metadata  
object on the project_data table? I have looked in abstractRecord and  
I can see a _getObjectMetadata method, but will this give me the right  
data and should I use it?

Also, does anyone have any links to an article/docs about using  
validate().

One final thing, which I know is mentioned quite a lot, is Reactor  
still being developed/complete/losing out to Transfer? Whenever, I  
look at Transfer it seems overly complicated - maybe I just haven't  
spent enough time reading about it, but I prefer Reactor and would  
hate to see it fade away.

Cheers,

Dave
_______________________________________________________________________
David Phipps
Director, Chapel Studios

T +44 (0)20 7100 6980   F +44 (0)20 7100 6981   M +44 (0)7765 240899
New Broad Street House, 35 New Broad Street, London, EC2M 1NH, UK

http://www.chapel-studios.co.uk
_______________________________________________________________________

The Chapel Studios group of companies are registered in England.   
'Chapel Studios' and the Chapel Studios logo are registered trademarks  
of Chapel Studios.  The information in this email is confidential,  
intended solely for the addressee, and may be legally privileged.  If  
you are not the addressee or authorized to receive this for the  
addressee, you must not use, copy, disclose or take any action based  
upon this message or any information herein.  If you have received  
this message in error, please advise the sender immediately by reply e- 
mail.



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --





-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to