trully bizarre... a description of the issue is on my blog here:
http://www.turnkey.to/ontap/blog/?20040119
Any suggestions greatly appreciated.
The cfc code is here (sorry for the line breaks):
<cfcomponent displayname="ontap" author="isaac dealey"
email="[EMAIL PROTECTED]"
hint="this is the core CFC for the onTap framework. All other CFC's in
the ontap framework should ultimately extend this cfc for
introspection and other core architectural functionality">
<cfproperty name="abspath" type="string" required="true" hint="the
absolute path of the directory containing the current CFC">
<cfproperty name="watch" type="struct" required="false" hint="a
structure of arrays containing references to objects interrested in
the properties of this CFC">
<cfproperty name="extends" type="array" required="false" hint="an
array of CFC's from which the current component is extended using the
function mx_core/mx.cfcExtend">
<cffunction name="init" output="true"
hint="initializes the CFC with required properties, etc.">
<!--- this protected variable allows many of the other cfinclude
related functions to work propertly using the getRelative() method
--->
<cfset this.setValue("abspath",getdirectoryfrompath(getcurrenttempla
tepath()))>
<cfset this.setValue("watch",structnew())>
<cfreturn true>
</cffunction>
<cffunction name="getMetaFunctionsDefaults" returntype="boolean"
output="true" access="private"
hint="appends default values to the meta data of a function">
<cfargument name="mymethod" type="struct" required="true" hint="the
function metadata to append defaults">
<cfparam name="mymethod.returntype" type="string" default="">
<cfparam name="mymethod.output" type="boolean" default="true">
<cfparam name="mymethod.access" type="string" default="public">
<cfparam name="mymethod.hint" type="string" default="">
<cfparam name="mymethod.example" type="string" default="">
<cfparam name="mymethod.roles" type="string" default="">
<cfreturn true>
</cffunction>
<cffunction name="getMetaPropertiesDefaults" returntype="boolean"
output="true" access="private"
hint="appends default values to the meta data of a cfc property">
<cfargument name="property" type="struct" required="true" hint="the
property metadata to append defaults">
<cfparam name="property.required" type="boolean" default="false">
<cfparam name="property.type" type="string" default="Any">
<cfparam name="property.default" default="n/a">
<cfparam name="property.hint" default="">
<cfreturn true>
</cffunction>
<cffunction name="getMetaStruct" returntype="struct" output="true"
access="private"
hint="returns a structure containing all methods (including
inherited) from the current component with keys matching method
names">
<cfargument name="metatype" type="string" required="true"
hint="function|property = name of array to convert to structure with
ancestor information">
<cfargument name="myobject" type="struct"
default="#getMetaData(this)#" hint="a CFC metadata structure to search
-- defaults to the current CFC">
<cfset var mymeta = structnew()>
<cfset var objmeta = false>
<cfif structkeyexists(myobject,metatype)>
<cfset objmeta = myobject[metatype]>
<cfloop index="x" from="1" to="#arraylen(objmeta)#">
<cfparam name="myobject.library" type="string" default="core">
<cfset objmeta[x].cfcfile = myobject.path>
<cfset objmeta[x].cfcpath = myobject.name>
<cfset objmeta[x].cfcname = myobject.displayname>
<cfset objmeta[x].cfclibrary = myobject.library>
<cfset evaluate("getMeta#metatype#Defaults(objmeta[x])")>
<cfset mymeta[objmeta[x].name] = objmeta[x]>
</cfloop>
</cfif>
<cfif structkeyexists(myobject,"extends")
and isstruct(myobject.extends)
and structkeyexists(myobject.extends,"displayname")>
<cfset
structappend(mymeta,getMetaStruct(metatype,myobject.extends),false)>
</cfif>
<cfreturn mymeta>
</cffunction>
<cffunction name="tdoc" returntype="string" output="true"
access="public">
<cfargument name="xml" type="boolean" required="false"
default="false"
hint="toggles the returned string between html and SPEC formatted
xml content">
<cfset var mydocs = "">
<cfset var mydata = getMetaData(this)>
<cfset var methods = getMetaStruct("functions",mydata)>
<cfset var properties = getMetaStruct("properties",mydata)>
<cfset var mymethod = false>
<cfset var property = false>
<cfset var arglist = false>
<cfset var arg = false>
<cfset var authorxref = false>
<cfset var ancestor = mydata.extends>
<cfset var extends = false>
<cfset var libraries = false>
<cfset var library = false>
<cfset var x = false>
<cfset var y = false>
<cfset var z = false>
<cfparam name="mydata.hint" type="string" default="">
<cfparam name="mydata.example" type="string" default="">
<cfparam name="mydata.author" type="string" default="">
<cfparam name="mydata.email" type="string" default="">
<!--- get additional pseudo-inheritance data for CFC's extended with
mx_core/mx.cfcExtend --->
<cfset extends = this.getValue("extends")>
<cfif isarray(extends)>
<!--- <cfloop condition="structkeyexists(ancestor,'displayname')">
<cfset ancestor = ancestor.extends></cfloop> --->
<cfloop index="x" from="1" to="#arraylen(extends)#">
<cfset ancestor.extends = getMetaData(extends[x])>
<cfset ancestor = ancestor.extends></cfloop>
</cfif>
<!--- if the cfc only inherits via mx_core/mx.cfcExtend the first
object in the ancestor chain will be empty -- remove it here --->
<cfset ancestor = mydata.extends>
<cfif not structkeyexists(ancestor,"displayname")
and structkeyexists(ancestor,"extends")>
<cfset ancestor = ancestor.extends></cfif>
<cfoutput><cfif xml>
<cfset libraries = structnew()>
<cfloop item="x" collection="#methods#">
<cfset mymethod = methods[x]>
<cfif mymethod.cfcname is mydata.displayname>
<cfparam name="libraries.#mymethod.access#" type="struct"
default="#structnew()#">
<cfset libraries[mymethod.access][mymethod.name] = mymethod>
</cfif>
</cfloop>
<cfsavecontent variable="mydocs">
<spec>
<class name="#htmleditformat(mydata.displayname)#"
language="ColdFusion 6.0" <cfif
structkeyexists(mydata.extends,"displayname")>
extends="#htmleditformat(mydata.extends.displayname)#"</cfif>
author="#htmleditformat(mydata.author)#"
email="#htmleditformat(mydata.email)#">
<usage>#htmleditformat(mydata.hint)#</usage>
<cfif len(trim(mydata.example))>
<example>#htmleditformat(mydata.example)#</example></cfif>
<cfloop item="x" collection="#libraries#">
<cfset library = libraries[x]>
<library name="#htmleditformat(x)#">
<cfloop index="y"
list="#listsort(structkeylist(library),'textnocase')#">
<cfset mymethod = library[y]>
<cfset arglist = mymethod.parameters>
<function name="#htmleditformat(mymethod.name)#"
return="#htmleditformat(mymethod.returntype)#"
output="#yesnoformat(mymethod.output)#"
roles="#htmleditformat(mymethod.roles)#">
<usage>#htmleditformat(mymethod.hint)#</usage>
<cfif len(trim(mymethod.example))>
<example>#htmleditformat(mymethod.example)#</example></cfif>
<arguments>
<cfloop index="z" from="1" to="#arraylen(arglist)#">
<cfset arg = arglist[z]>
<cfparam name="arg.type" type="string" default="Any">
<cfparam name="arg.required" type="boolean"
default="false">
<cfparam name="arg.default" default="n/a">
<cfparam name="arg.hint" type="string" default="">
<arg name="#htmleditformat(arg.name)#"
required="#yesnoformat(arg.required)#"
type="#htmleditformat(lcase(arg.type))#"
default="#htmleditformat(arg.default)#">
#htmleditformat(arg.hint)#</arg>
</cfloop>
</arguments>
</function>
</cfloop>
</library>
</cfloop>
<variables>
<cfloop index="x"
list="#listsort(structkeylist(properties),'textnocase')#">
<cfset property = properties[x]>
<cfif property.cfcname is mydata.displayname>
<var name="#htmleditformat(property.name)#"
purpose="#htmleditformat(property.hint)#"
required="#yesnoformat(property.required)#"
type="#htmleditformat(property.type)#"
default="#htmleditformat(property.default)#">
</cfif>
</cfloop>
</variables>
</class>
</spec>
</cfsavecontent>
<cfelse>
<cfsavecontent variable="mydocs">
<a name="cfc_#mydata.displayname#"></a>
<table cellspacing="0" class="doc" width="100%"
style="font-family:verdana; font-size: 9pt; margin-top:
20px;"><body>
<tr style="font-size: 12pt; background-color: ##A0D0A0;">
<td colspan="6"
nowrap><b>#htmleditformat(mydata.displayname)# </b>
<cfif structkeyexists(ancestor,"displayname")>
extends <cfloop
condition="structkeyexists(ancestor,'displayname')">
<cfparam name="ancestor.library" type="string" default="core">
=> <cfif len(trim(ancestor.library))>
<a href="" &
ancestor.library & '&cfc=' &
ancestor.displayname,'docs')#">#ancestor.displayname#</a>
<cfelse>#ancestor.displayname#</cfif> <cfset ancestor =
ancestor.extends></cfloop></cfif> </td></tr>
<tr><td colspan="6" bgcolor="white"><b>Usage:</b>
#htmleditformat(mydata.hint)#</td></tr>
<cfif len(trim(mydata.example))>
<tr><td colspan="6" bgcolor="white"><b>Example:</b>
#htmleditformat(mydata.example)#</td></tr></cfif>
<cfif len(trim(mydata.author)) or len(trim(mydata.email))>
<cfif not len(trim(mydata.author))><cfset mydata.author =
mydata.email></cfif>
<cfif len(trim(mydata.email))>
<cfsavecontent variable="authorxref">
<a href=""> #htmleditformat(mydata.author)#</a>
</cfsavecontent>
<cfelse><cfset authorxref = mydata.author></cfif>
<tr><td colspan="6" bgcolor="white"><b>Author:</b>
#authorxref#</td></tr>
</cfif>
<tr style="font-weight: bold; background-color: ##A0D0A0">
<td>Properties</td><td>Required</td><td>Type</td><td>Default</td>
<td>CFC</td><td>Purpose</td></tr>
<cfloop index="x"
list="#listsort(structkeylist(properties),'textnocase')#">
<cfset property = properties[x]>
<tr valign="top" bgcolor="white">
<td nowrap>#property.name#</td>
<td nowrap>#yesnoformat(property.required)#</td>
<td nowrap>#property.type#</td>
<td nowrap><cfif issimplevalue(property.default)>
#htmleditformat(property.default)#<cfelse>
[#request.tapi.typeof(proeprty.default)#]</cfif></td>
<td nowrap>#property.cfcname#</td>
<td>#htmleditformat(property.hint)#</td>
</tr>
</cfloop>
<tr><td colspan="6" style="font-weight: bold; background-color:
##A0D0A0">Methods</td></tr>
<cfloop index="x"
list="#listsort(structkeylist(methods),'textnocase')#">
<cfset mymethod = methods[x]>
<cfset arglist = mymethod.parameters>
<tr style="font-size: 12pt; background-color:
lightsteelblue"><td colspan="6" nowrap>
<a href="" &
mymethod.cfclibrary & '&cfc=' & mymethod.cfcname,'docs')#">
#htmleditformat(mymethod.cfcname)#</a>.<b>#htmleditformat(mymeth
od.name)#</b>
(<cfloop index="x" from="1" to="#arraylen(arglist)#"><cfif x gt
1>, </cfif>#htmleditformat(arglist[x].name)#</cfloop>)
<cfif len(trim(mymethod.returntype))>return =
#htmleditformat(mymethod.returntype)#</cfif></td></tr>
<tr valign="top" bgcolor="white"><td colspan="6">
<b>Usage:</b> #htmleditformat(mymethod.hint)#</td></tr>
<cfif len(trim(mymethod.example))>
<tr valign="top" bgcolor="white"><td colspan="6">
<b>Example:</b>
#htmleditformat(mymethod.example)#</td></tr></cfif>
<tr bgcolor="white">
<td colspan="2"><b>Access:</b> #mymethod.access#</td>
<td colspan="2"><b>Output:</b> #mymethod.output#</td>
<td colspan="2"><b>Roles:</b> #mymethod.roles#</td>
</tr>
<cfif arraylen(arglist)>
<tr style="font-weight: bold; background-color: ##F0F0F0;">
<td style="text-transform:capitalize;">Arguments</td>
<td>Required</td><td>Type</td><td>Default</td><td
colspan="2">Purpose</td></tr>
<cfloop index="y" from="1" to="#arraylen(arglist)#">
<cfset arg = arglist[y]>
<cfparam name="arg.type" type="string" default="Any">
<cfparam name="arg.required" type="boolean" default="false">
<cfparam name="arg.default" default="n/a">
<cfparam name="arg.hint" type="string" default="">
<tr valign="top" bgcolor="white">
<td nowrap>#arg.name#</td>
<td nowrap>#yesnoformat(arg.required)#</td>
<td nowrap>#lcase(arg.type)#</td>
<td nowrap><cfif issimplevalue(arg.default)>
#htmleditformat(arg.default)#<cfelse>
[#request.tapi.typeof(arg.default)#]</cfif> </td>
<td colspan="2">#htmleditformat(arg.hint)# </td>
</tr>
</cfloop>
</cfif>
</cfloop>
</body></table>
</cfsavecontent>
</cfif></cfoutput>
<cfreturn trim(mydocs)>
</cffunction>
<cffunction name="tag" returntype="string" output="true"
access="private"
hint="replaces the library function cf_core/tag which will not work
within a CFC">
<cfargument name="tagname" type="string" required="true"
hint="path to the target custom tag relative to the custom tags
directory -- .cfm extension is not required">
<cfreturn
request.tapi.getrelative(rereplacenocase(tagname,"\.cfm$","") &
".cfm","CT",false,request.tapi.getPath("","CFC"))>
</cffunction>
<cffunction name="dba" returntype="string" output="true"
access="private"
hint="replaces the library function cf_dba/dba which will not work
within a CFC">
<cfargument name="tagname" type="string" required="true"
hint="path to the target query tag relative to the dba directory --
.cfm extension is not required">
<cfreturn variables.tag("dba/" & tagname)>
</cffunction>
<cffunction name="process" returntype="string" output="true"
access="private"
hint="replaces the library function cf_core/process which will not
work within a CFC">
<cfreturn tag("process")>
</cffunction>
<cffunction name="getProperty" returntype="any" access="private"
output="true"
hint="gets properties from the current object - all custom get
methods should set properties with this method - overwriting this
method (in addition to setProperty) allows you to change the location
of all properties stored for the component">
<cfargument name="propertyname" type="string" required="true">
<cfparam name="variables.local" type="struct"
default="#structnew()#">
<cfif structkeyexists(variables.local,propertyname)>
<cfreturn variables.local[propertyname]>
<cfelse><cfreturn ""></cfif>
</cffunction>
<cffunction name="setProperty" returntype="any" access="private"
output="true"
hint="sets properties in the current object - all custom set methods
should set properties with this method - overwriting this method (in
addition to getProperty) allows you to change the location of all
properties stored for the component">
<cfargument name="propertyname" type="string" required="true">
<cfargument name="propertyvalue" type="any" required="true">
<cfargument name="overwrite" type="boolean" default="true">
<cfset var temp = structnew()>
<cfset temp[propertyname] = propertyvalue>
<cfparam name="variables.local" type="struct"
default="#structnew()#">
<cfset structappend(variables.local,temp,overwrite)>
<cfreturn true>
</cffunction>
<cffunction name="getValue" returntype="any" access="public"
output="true"
hint="returns a property or variable from the component -- uses a
private method if it exists for any property">
<cfargument name="propertyname" type="string" required="true"
hint="the name of the property value to return">
<cfset var methodname = "getProperty">
<cfset var returnvalue = "">
<cfif structkeyexists(variables,"get_" & propertyname)
and iscustomfunction(variables["get_" & propertyname])>
<cfset variables.methodname = "get_" & propertyname></cfif>
<cfinvoke method="#methodname#" argumentcollection="#arguments#"
returnvariable="returnvalue">
<cfreturn returnvalue>
</cffunction>
<cffunction name="setValue" returntype="any" access="public"
output="true"
hint="sets a property or variable in the component -- uses a private
method if it exists for any property">
<cfargument name="propertyname" type="string" required="true"
hint="the name of the property to set">
<cfargument name="propertyvalue" type="any" required="true"
hint="the value to set for the property named">
<cfargument name="overwrite" type="boolean" default="true"
hint="determines if the provided value should overwrite an existing
property">
<cfset var methodname = "setProperty">
<cfset var attribs = structnew()>
<cfset var watch = this.getValue("watch")>
<cfset structappend(attribs,arguments,true)>
<cfset structappend(attribs,this,false)>
<cfif structkeyexists(variables,"set_" & propertyname)
and iscustomfunction(variables["set_" & propertyname])>
<cfset variables.methodname = "set_" & propertyname></cfif>
<cfinvoke method="#methodname#" argumentcollection="#arguments#">
<cfif isstruct(watch) and structkeyexists(watch,propertyname)>
<cfset watch = watch[propertyname]>
<cfloop index="x" from="1" to="#arraylen(watch)#">
<cfif issimplevalue(watch[x])>
<cfmodule template="#process()#"
netaction="#watch[x]#"
attributecollection="#attribs#">
<cfelseif isstruct(watch[x])>
<cfset structappend(attribs,watch[x],true)>
<cfmodule template="#process()#"
attributecollection="#attribs#">
<cfelseif isobject(watch[x])>
<cfinvoke component="#watch[x]#"
method="observe" argumentcollection="#attribs#">
</cfif>
</cfloop>
</cfif>
<cfreturn variables.getValue(propertyname)>
</cffunction>
<cffunction name="setproperties" output="true" access="public"
hint="sets all properties for a cfc simultaneously using the setValue
method to preserve custom setValue functions and observer
functionality">
<cfargument name="properties" type="struct" required="true">
<cfargument name="overwrite" type="boolean" default="true">
<cfset var x = "">
<cfloop item="x" collection="#properties#">
<cfset this.setValue(x,properties[x],overwrite)></cfloop>
</cffunction>
<cffunction name="getproperties" output="true" access="public"
hint="returns all properties from a cfc in a structure">
<cfset var returnstruct = structnew()>
<cfloop index="x" list="#variables.getpropertylist()#">
<cfset returnstruct[x] = variables.getValue(x)></cfloop>
<cfreturn returnstruct>
</cffunction>
<cffunction name="getpropertylist" output="true" access="private"
hint="returns the names of all properties from a cfc as a list">
<cfreturn structkeylist(variables.local)>
</cffunction>
<cffunction name="addWatch" returntype="boolean" output="true"
hint="adds a watch to the current CFC to alert another CFC or execute
a specified process when a property of the CFC is altered">
<cfargument name="property" type="string" required="true" hint="the
property to which interest should be registered">
<cfargument name="observer" type="any" required="true" hint="the
object or process interested in the property - may be a string
indicating process, a structure including netaction and other
attributes, or another CFC with a corresponding observe_[property]
method">
<cfset var watch = this.getValue("watch")>
<cfif not structkeyexists(watch,event)>
<cfset watch[event] = arraynew(1)></cfif>
<cfset arrayappend(watch[event],observer)>
<cfreturn true>
</cffunction>
<cffunction name="observe" output="true"
hint="handles events returned by watching another components
properties">
<cfargument name="propertyname" type="string" required="true">
<cfset var methodname = "observe_" & replace(event,"/","_","ALL")>
<cfif structkeyexists(variables,methodname) and
isCustomFunction(variables.methodname)>
<cfinvoke method="#methodname#" argumentcollection="#arguments#">
</cfif>
</cffunction>
</cfcomponent>
Thanks guys,
s. isaac dealey 214-823-9345
team macromedia volunteer http://www.macromedia.com/go/team
chief architect, tapestry cms http://products.turnkey.to
onTap is open source http://www.turnkey.to/ontap
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

