You don't have to write one for each component--you could set up a service that could handle this for you and would be generic enough to handle all CFCs.
I'm going to attach a couple of files--hopefully the list lets these through. One is a basic CFC (bean style), the other is a CFML page that gets the meta data, then grabs the functions and outputs all the functions and what they return. If you just do a getMetaData(someCFC) and dump the results you'll see how the meta data is structed. Then you can determined based on your specific CFC how you'd have to loop through the metadata to so what you need to do. Hope that helps. Matt On Thu, 3 Feb 2005 10:40:26 -0600, Knipp, Eric <[EMAIL PROTECTED]> wrote: > > Yeah, an instantiated CFC, and all its variables. How would I go about > using the metadata to build the XML packet? Is there some way I can write a > generic function that can accept any component and cycle through all of the > output methods to build a data-only XML packet? Then I could write a > function to go the other way, so all I'd have to do is read my text from the > database, and go from there. In fact I could even make an optional property > in the component's init() to take an XML string containing all the > information and parse it into the various properties of the component. That > would be pretty cool. Ideally, though, I'd like to be able to avoid having > to write a custom persistAsXML() function for every component. > > Eric > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Matt Woodward > Sent: Thursday, February 03, 2005 10:33 AM > To: [email protected] > Subject: Re: Syndicating Coldfusion Components into XML/WDDX > > By "component structure" do you mean a CFC and all its variables? > Just off the top of my head I would think you could do this using the > CFC's metadata and building your XML packet that way (although I'd use > plain ol' XML as opposed to WDDX unless you're on CF 5). Is that what > you'd be after? > > On Thu, 3 Feb 2005 10:26:54 -0600, Knipp, Eric <[EMAIL PROTECTED]> wrote: > > > > Hey all, > > > > CFWDDX doesn't seem to allow you to convert a component structure to a > WDDX > > XML packet. Is there another way to go about this? For some applications > > it would be useful to be able to take an instantiated component, turn it > > into XML, and shovel it into a long varchar field on a database. An > obvious > > solution would be to write a custom save function for each class but I am > > wondering if there's a quick and dirty method to persist everything in a > > component as text. The more I think about it, the more I realize this > > probably can't work because of the abstracted code being invisible to the > > conversion routine, but I was just wondering how others may have handled > > this. > > > > Thanks, > > > > Eric Knipp > > Web Applications Group > > Unitrin Specialty - Insurance for U > > > > ----------------------------------------- > > CONFIDENTIALITY NOTICE: The information contained in this e-mail and > > attached document(s) may contain confidential information that is intended > > only for the addressee(s). If you are not the intended recipient, you are > > hereby advised that any disclosure, copying, distribution or the taking of > > any action in reliance upon the information is prohibited. If you have > > received this e-mail in error, please immediately notify the sender and > > delete it from your system. > > > > ---------------------------------------------------------- > > To post, send email to [email protected] > > To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > > > -- > Matt Woodward > [EMAIL PROTECTED] > http://www.mattwoodward.com > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > ----------------------------------------- > CONFIDENTIALITY NOTICE: The information contained in this e-mail and > attached document(s) may contain confidential information that is intended > only for the addressee(s). If you are not the intended recipient, you are > hereby advised that any disclosure, copying, distribution or the taking of > any action in reliance upon the information is prohibited. If you have > received this e-mail in error, please immediately notify the sender and > delete it from your system. > > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > -- Matt Woodward [EMAIL PROTECTED] http://www.mattwoodward.com
MyCFC.cfc
Description: application/cfc
metaDataTest.cfm
Description: application/cfm
