Hi everyone,
Thanks for all the info in the mailing list, it has saved me heaps of trouble already!

I have a problem that I have not been able to find in the mailing list or get anywhere with...

I am trying to determine all the functions in a reactor record (this one is Customer record) so I can automatically populate it's fields, however the extra methods that I have added to my "
database agnostic custom Record object for the Customer object" model.data.Record.CustomerRecord are not visible and so I can't access them....

Bellow I have included a summary of the metadata and the complete model.data.Record.CustomerRecord CFC.

This is the collapsed dump from the GetMetaData() on my object, as you can see there are no functions...
NAME     WEB-INF.cftags.component
PATH     C:\CFusionMX7\wwwroot\WEB-INF\cftags\component.cfc
TYPE     component

    FUNCTIONS    Many functions...
    HINT           I am the base object used for all reactor stuff. I may be one step of overkill, but I'm sure you can deal with it.
    NAME         reactor.base.abstractObject
    PATH         C:\CFusionMX7\wwwroot\reactor\base\abstractObject.cfc
    TYPE         component
   
        FUNCTIONS    Many functions...
        HINT          I am an abstract record. I am used primarly to allow type definitions for return values. I also loosely define an interface for a record objects and some core methods.
        NAME         reactor.base.abstractRecord
        PATH         C:\CFusionMX7\wwwroot\reactor\base\abstractRecord.cfc
        TYPE         component
       
            FUNCTIONS    Many functions...
            HINT         I am the base record representing the Customer object. I am generated. DO NOT EDIT ME (but feel free to delete me).
            NAME         reactor.project.ainsvoip.Record.CustomerRecord
            PATH         C:\CFusionMX7\wwwroot\reactor\project\ainsvoip\Record\CustomerRecord.cfc
            TYPE         component
           
                There are no functions here, but there should be!
                HINT         I am the database agnostic custom Record object for the Customer object. I am generated, but not overwritten if I exist. You are safe to edit me.
                NAME         model.data.Record.CustomerRecord
                PATH         C:\CFusionMX7\wwwroot\model\data\Record\CustomerRecord.cfc
                TYPE         component
               
                There are no functions here (just as it should be).
                HINT         I am the mssql custom Record object for the Customer object. I am generated, but not overwritten if I exist. You are safe to edit me.
                NAME         model.data.Record.CustomerRecordmssql
                PATH        C:\CFusionMX7\wwwroot\model\data\Record\CustomerRecordmssql.cfc
                TYPE         component


My editable Customer reactor record (
C:\CFusionMX7\wwwroot\model\data\Record\CustomerRecord.cfc) looks like:
<cfcomponent hint="I am the database agnostic custom Record object for the Customer object.  I am generated, but not overwritten if I exist.  You are safe to edit me."
    extends="reactor.project.ainsvoip.Record.CustomerRecord" >
    <!--- Place custom code here, it will not be overwritten --->
   
    <!--- methods --->
    <cffunction name="isInvalid" access="public" hint="I validate this record and indicate if there were any errors.">
        <cfset validate() />
        <cfreturn hasErrors() />
    </cffunction>
   
    <!--- accessors --->
    <cffunction name="getFirstName" access="public" returntype="string" hint="I return the value of firstName." output="false" >
        <cfset var instanceData = getNameParts() />
       
        <cfreturn instanceData.firstName />
    </cffunction>
   
    <cffunction name="getLastName" access="public" returntype="string" hint="I return the value of lastName." output="false" >
        <cfset var instanceData = getNameParts() />
               
        <cfreturn instanceData.lastName />
    </cffunction>   
   
    <cffunction name="getNameParts" access="private" returntype="struct" hint="I return the struct with first, last, and whole name parts from the underlying record." output="false" >
        <cfset var instanceData = StructNew() />
        <cfset instanceData.name = getName() />
       
        <!--- defaults --->
        <cfset instanceData.firstName = "" />
        <cfset instanceData.lastName = "" />
       
        <cfif Left(instanceData.name, 1) EQ " ">
            <!--- must be a last name only --->
            <cfset instanceData.firstName = "" />
            <cfset instanceData.lastName = Trim(instanceData.name) />
           
        <cfelseif ListLen(instanceData.name, " ") EQ 1 >
            <!--- must be a first name only --->
            <cfset instanceData.firstName = Trim(instanceData.name) />
            <cfset instanceData.lastName = ""/>
           
        <cfelseif ListLen(instanceData.name, " ") GTE 2 >
            <!--- must be a whole name --->
            <cfset instanceData.firstName = Trim(ListFirst(instanceData.name, " ")) />
            <cfset instanceData.lastName = Trim(ListRest(instanceData.name, " ")) />
           
        </cfif>
       
        <cfreturn instanceData />
    </cffunction>
   
    <!--- mutators --->
    <cffunction name="setFirstName" access="public" returntype="void" hint="I allow the value of firstName to be set." output="false" >
        <cfargument name="firstName" required="yes" type="string" hint="I am the new value for firstName" />
       
        <cfset var instanceData = StructNew() />
        <cfset instanceData.nameParts = getNameParts() />
        <cfset instanceData.newName = arguments.firstName & " " & instanceData.nameParts.lastName />
        <cfset setName(instanceData.newName) />
       
        <cfreturn />
    </cffunction>
   
   
    <cffunction name="setLastName" access="public" returntype="void" hint="I allow the value of lastName to be set." output="false" >
        <cfargument name="lastName" required="yes" type="string" hint="I am the new value for lastName" />
       
        <cfset var instanceData = StructNew() />
        <cfset instanceData.nameParts = getNameParts() />
        <cfset instanceData.newName = instanceData.nameParts.firstName & " " & arguments.firstName />
        <cfset setName(instanceData.newName) />
       
        <cfreturn />
    </cffunction>
       
   
</cfcomponent>

Any help would be great and hugely appreciated, thanks in advance!
Bart Lea



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

Reply via email to