> Don't use "this.f()".  Use f().  I don't think "this"
> means the same in CF as it does in the OO world.

Wow... That's... obscure... but it works... apparently the
only way to use a private function is to not scope it...
so... I guess if you have any inkling of a notion that a
function might at some point in the indeterminate distant
future become private you should avoid ever referencing
functions as this.functionname()... <sigh>... that's
frustrating...

> As for the cfmodule syntax, I'm not sure where you got
> that from.  I'd
> suspect what's happening there is that the cfmodule is
> actually
> instantiating the CFC, so it's actually making a call to a
> an object, not
> within the CFC (class).

No, there's no way for cfmodule to instantiate a CFC by
itself. The cfmodule syntax itself is standard cmodule
syntax for calling custom tags. It works inside <cffunction>
the same way it does anywhere else... except that the path
has to be relative to the template containing the cffunction
tag. But the problem I was having doesn't have anything to
do with the cfmodule tag... 'cause it's the same with the
hello world example in my last message where there isn't any
cfmodule call...

Thanks for the help tho, I do appreciate it. :)


s. isaac dealey                972-490-6624

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



> ----- Original Message -----
> From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Saturday, August 30, 2003 11:16 PM
> Subject: Re:_Re:_cfcomponent_cffunction_access="private"_-
> -_what_the_!!??


>> no... pretty sure the cfmodule tag isn't part of the
>> issue
>> 'cause it's just a local function call and if I change
>> the
>> access to public or package it's fine... same thing if I
>> leave out the cfmodule call and just do something like
>> this:
>>
>> <cfcomponent>
>> <cffunction name="f" access="private">
>>   <cfreturn "hello world">
>> </cffunction>
>>
>> <cffunction name="f2" access="public">
>>   <cfreturn this.f()>
>> </cffuntion>
>> </cfcomponent>
>>
>> > I noticed that you're using cfmodule.  Have you tried
>> > just
>> > using "tag('tapi')"?
>>
>> > ----- Original Message -----
>> > From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
>> > To: "CF-Talk" <[EMAIL PROTECTED]>
>> > Sent: Saturday, August 30, 2003 10:47 PM
>> > Subject:
>> > Re:_cfcomponent_cffunction_access="private"_--_wh
>> > at_the_!!??
>>
>>
>> >> > I think the docs mean that the private methods are
>> >> > accessible only within that CFC's (and those that
>> >> > extend it) code, not CFCs that instantiate it
>> >> > (that would make "private" pretty useless).
>> >>
>> >> Right -- but I can't get functions within _the_same_
>> >> CFC
>> >> to
>> >> access the method... that's afaik the definition of
>> >> private
>> >> in OO languages... it has to be instantiated in order
>> >> for
>> >> a
>> >> private method to be called (cfinvoke against an
>> >> uninstantiated CFC for instance afaik falls in the
>> >> category
>> >> of public access -- the method is being accessed from
>> >> an
>> >> outside cf template) -- but private methods can only
>> >> be
>> >> called from within the same instance of the class. The
>> >> same
>> >> object... but I can't get any of the other methods in
>> >> the
>> >> same object to access them. Which makes the private
>> >> methods
>> >> essentially non-existant except for the meta data --
>> >> which
>> >> is useless for execution of the method.
>> >>
>> >> > It does make sense that the metadata displays it.
>> >> > Just because something's declared private doesn't
>> >> > mean that it's not documented.
>> >>
>> >> I did think it was a little odd that they don't appear
>> >> in
>> >> <cfdump> ... for the same reason -- just because it's
>> >> private doesn't mean it's not there or shouldn't be
>> >> displayed necessarily...
>> >>
>> >> > ----- Original Message -----
>> >> > From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
>> >> > To: "CF-Talk" <[EMAIL PROTECTED]>
>> >> > Sent: Saturday, August 30, 2003 8:35 PM
>> >> > Subject:
>> >> > cfcomponent_cffunction_access="private"_--_what_the_
>> >> > !!?
>> >> > ?
>> >>
>> >>
>> >> >> ... this strikes me as somewhat odd and I'm hoping
>> >> >> someone
>> >> >> here has run into this already:
>> >> >>
>> >> >> ColdFusion MX 6.1 Stand Alone - internal web server
>> >> >> Windows 2000 Server SP4
>> >> >>
>> >> >> I have this CFC
>> >> >>
>> >> >> ontap.cfc
>> >> >> <cfcomponent displayname="ontap">
>> >> >>   <cffunction name="tag" access="private">
>> >> >>     blah blah
>> >> >>   </cffunction>
>> >> >>
>> >> >>   <cffunction name="getFunction" access="public">
>> >> >>     <cfmodule template="#this.tag('tapi')#" ...>
>> >> >>     <cfreturn true>
>> >> >>   </cffunction>
>> >> >> </cfcomponent>
>> >> >>
>> >> >> temp.cfm
>> >> >> <cfobject name="ontap" component="ontap">
>> >> >> <cfset temp = ontap.getFunction('blah')>
>> >> >>
>> >> >> I've removed everything but the pertinent bits from
>> >> >> these
>> >> >> cfc's for the sake of explaining the problem...
>> >> >> According
>> >> >> to
>> >> >> the documentation ( http://livedocs.macromedia.com
>> >> >> )
>> >> >> functions declared as private are supposed to be
>> >> >> accessible
>> >> >> to the CFC which declares the function and any
>> >> >> CFC's
>> >> >> that
>> >> >> extend it. Now, if I use getMetaData() to view the
>> >> >> metadata
>> >> >> for the CFC the private method shows up. However,
>> >> >> if I
>> >> >> call
>> >> >> the function ontap.getFunction() I get an error
>> >> >> saying
>> >> >> that
>> >> >> the CFC doesn't have a function called "tag" ...
>> >> >> which...
>> >> >> according to getMetaData it does. It also doesn't
>> >> >> show
>> >> >> up
>> >> >> if
>> >> >> I output the cfc as <cfdump var="#ontap#"> ...
>> >> >>
>> >> >> If I change the access level of the tag function to
>> >> >> package
>> >> >> or public, however, everything is hunky dory.
>> >> >>
>> >> >> It seems that for all intents and purposes,
>> >> >> specifying
>> >> >> access="private" essentially comments out the
>> >> >> function
>> >> >> so
>> >> >> that no code, no matter where it's placed or how
>> >> >> its
>> >> >> referenced can ever call the method. ??? ...
>> >> >> (except
>> >> >> it
>> >> >> still shows up in the meta data)
>> >> >>
>> >> >> I'm really confused. Is my server hozed. Has anyone
>> >> >> else
>> >> >> seen this?
>> >> >>
>> >> >> While I could live with them potentially being
>> >> >> access="package" or even public the nature of these
>> >> >> functions I'm working with is that they shouldn't
>> >> >> ever
>> >> >> be
>> >> >> called from anywhere other than the CFC that
>> >> >> declared
>> >> >> them
>> >> >> or a CFC that extends it (what the documentation
>> >> >> says
>> >> >> is
>> >> >> the
>> >> >> definition of private), so it'd be really nice to
>> >> >> be
>> >> >> able
>> >> >> to
>> >> >> use that.
>> >> >>
>> >> >> s. isaac dealey                972-490-6624
>> >> >>
>> >> >> 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
>> >> >>
>> >> >>
>> >> >>
>> >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> >> > ~~~
>> >> > ~~~
>> >> > ~~~~~~~~~~~|
>> >> > Archives:
>> >> > http://www.houseoffusion.com/lists.cfm?link=t:4
>> >> > Subscription:
>> >> > http://www.houseoffusion.com/lists.cfm?link=s:4
>> >> > Unsubscribe:
>> >> > http://www.houseoffusion.com/cf_lists/unsubsc
>> >> > ribe.cfm?user=633.558.4
>> >>
>> >> > Your ad could be here. Monies from ads go to support
>> >> > these
>> >> > lists and provide more resources for the community.
>> >> > http://www.fusionauthority.com/ads.cfm
>> >>
>> >>
>> >>
>> >> s. isaac dealey                972-490-6624
>> >>
>> >> 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
>> >>
>> >>
>> >>
>> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> > ~~~
>> > ~~~~~~~~~~~|
>> > Archives:
>> > http://www.houseoffusion.com/lists.cfm?link=t:4
>> > Subscription:
>> > http://www.houseoffusion.com/lists.cfm?link=s:4
>> > Unsubscribe:
>> > http://www.houseoffusion.com/cf_lists/unsubsc
>> > ribe.cfm?user=633.558.4
>>
>> > This list and all House of Fusion resources hosted by
>> > CFHosting.com. The place for dependable ColdFusion
>> > Hosting.
>> > http://www.cfhosting.com
>>
>>
>>
>> s. isaac dealey                972-490-6624
>>
>> 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
>>
>>
>>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
> Subscription:
> http://www.houseoffusion.com/lists.cfm?link=s:4
> Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubsc
> ribe.cfm?user=633.558.4

> This list and all House of Fusion resources hosted by
> CFHosting.com. The place for dependable ColdFusion
> Hosting.
> http://www.cfhosting.com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to