Thanks Cameron! Unfortunately, you cannot bind to a component using a mapping 
combined with the cfc format:

"Using bind expressions
To specify a bind expression, use one of the following formats:
    * cfc:componentPath.functionName(parameters)
      Note: The component path cannot use a mapping. The componentPath value 
must be a dot-delimited path from the web root or the directory that contains 
the current page.
"
per the documentation :-(

However, now that I'm reading up on that... I might be able to bind to a url.

: Since you are on CF8, you might get an advantage from dynamically
: setting the mappings.  I usually drop common components into a
: location below the wwwroot and refer to them using a CF mapping.  The
: technique below also allows you to move code server to server without
: managing any mappings in the CF Admin or worrying that the directory
: structures are the same.

: One potential directory structure might look like this:

: mytestappl/site1/Application.cfc
: mytestappl/site1/UseComponentToShowSiteNameOnSite1.cfm
: mytestappl/site2/Application.cfc
: mytestappl/site2/UseComponentToShowSiteNameOnSite2.cfm
: mytestappl/components/mycomponent.cfc

: Ultimately, you can call your component using a CF mapping to
: mytestappl.components.mycomponent.

: You can then dynamically create a mapping in the Applicaiton.cfc like
: below...  Note that getRootDirectory() will find the main application
: root dir.

: <cfcomponent output="false">

:     <cfscript>
:     // variables
:     this.dsn                            = 'mytesterappl';

:     // application settings
:     this.name                             = 'mytesterappl';
:     this.applicationtimeout                = createTimeSpan(0,0,0,1);
:     this.sessionManagement                = true;
:     this.sessionTimeout                    = createTimeSpan(0,0,1,0);

:     // mappings
:     this.mappings["/mytesterappl"]        = getRootDirectory() & '\';
:     </cfscript>

:     <!--- finds the root mytesterappl application directory --->
:     <cffunction name="getRootDirectory" returnType="string" output="false">
:         <cfscript>
:         var dir        = getDirectoryFromPath(expandPath('.'));
:         var pos        = findNoCase('mytesterappl',dir);
:         dir            = mid(dir,1,pos+11);
:         return dir;
:         </cfscript>
:     </cffunction>

: </cfcomponent>

: -Cameron

: On Tue, Mar 18, 2008 at 12:04 PM, Mischa Uppelschoten ext 10
: <[EMAIL PROTECTED]> wrote:
: > All,
: >  I'm running into an issue with CF8 and how components are bound to form
:  controls. Proper execution of one of my components depends on a value in the
:  session scope.
: >
: >  Site1\application.cfm  (-> this.name = "site1";)
: >  Site1\Components\MyComponent.cfm
: >  Site1\UseComponentToShowSiteNameOnSite1.cfm
: >
: >  Site2\application.cfm   (-> this.name = "site2";)
: >  Site2\Components   ... this is an IIS virtual directory that points to 
:  Site1\Components
: >  Site2\UseComponentToShowSiteNameOnSite2.cfm
: >
: >  The purpose of the above setup is to share a set of common cfc's between
:  the two sites. If an object is instantiated through CreateObject via the
:  UseComponentToShowSiteNameOnSite2.cfm template, the virtual directory is
:  honored and the application.cfm from site2 is used.
: >
: >  However, if I use CFGRID with a
:  bind="cfc:Site2.Components.MyComponent.TestFunction...   I can see that the
:  application.cfm from Site1 is used.
: >
: >  This breaks my application because the required session variables are not
:  available for the user in Site1.
: >
: >  Is there a better way to share common cfc's and have different
:  application.cfc's apply depending on how they are called?
: >
: >  (The above is a simplification, let me know if you need code).
: >  Thanks!
: >  Mischa.
: >
: >
: >
: >  -------------------------------------------------------------
: >  Annual Sponsor FigLeaf Software - http://www.figleaf.com
: >
: >  To unsubscribe from this list, manage your profile @
: >  http://www.acfug.org?falogin.edituserform
: >
: >  For more info, see http://www.acfug.org/mailinglists
: >  Archive @ http://www.mail-archive.com/discussion%40acfug.org/
: >  List hosted by http://www.fusionlink.com
: >  -------------------------------------------------------------
: >
: >
: >
: >



: -- 
: Cameron Childress
: Sumo Consulting Inc
: http://www.sumoc.com
: ---
: cell: 678.637.5072
: aim: cameroncf
: email: [EMAIL PROTECTED]


: -------------------------------------------------------------
: Annual Sponsor FigLeaf Software - http://www.figleaf.com

: To unsubscribe from this list, manage your profile @ 
: http://www.acfug.org?fa=login.edituserform

: For more info, see http://www.acfug.org/mailinglists
: Archive @ http://www.mail-archive.com/discussion%40acfug.org/
: List hosted by http://www.fusionlink.com
: -------------------------------------------------------------









Mischa Uppelschoten
The Banker's Exchange, LLC.
4200 Highlands Parkway SE
Suite A
Smyrna, GA 30082-5198

Phone:    (404) 605-0100 ext. 10
Fax:    (404) 355-7930
Web:    www.BankersX.com
Follow this link for Instant Web Chat:
http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN
---------- Original Message ----------

FROM:      "Cameron Childress" <[EMAIL PROTECTED]>
TO:        [email protected]
DATE:      Tue, 18 Mar 2008 13:36:23 -0400

SUBJECT:   Re: [ACFUG Discuss] Using components on different websites

Since you are on CF8, you might get an advantage from dynamically
setting the mappings.  I usually drop common components into a
location below the wwwroot and refer to them using a CF mapping.  The
technique below also allows you to move code server to server without
managing any mappings in the CF Admin or worrying that the directory
structures are the same.

One potential directory structure might look like this:

mytestappl/site1/Application.cfc
mytestappl/site1/UseComponentToShowSiteNameOnSite1.cfm
mytestappl/site2/Application.cfc
mytestappl/site2/UseComponentToShowSiteNameOnSite2.cfm
mytestappl/components/mycomponent.cfc

Ultimately, you can call your component using a CF mapping to
mytestappl.components.mycomponent.

You can then dynamically create a mapping in the Applicaiton.cfc like
below...  Note that getRootDirectory() will find the main application
root dir.

<cfcomponent output="false">

    <cfscript>
    // variables
    this.dsn                            = 'mytesterappl';

    // application settings
    this.name                             = 'mytesterappl';
    this.applicationtimeout                = createTimeSpan(0,0,0,1);
    this.sessionManagement                = true;
    this.sessionTimeout                    = createTimeSpan(0,0,1,0);

    // mappings
    this.mappings["/mytesterappl"]        = getRootDirectory() & '\';
    </cfscript>

    <!--- finds the root mytesterappl application directory --->
    <cffunction name="getRootDirectory" returnType="string" output="false">
        <cfscript>
        var dir        = getDirectoryFromPath(expandPath('.'));
        var pos        = findNoCase('mytesterappl',dir);
        dir            = mid(dir,1,pos+11);
        return dir;
        </cfscript>
    </cffunction>

</cfcomponent>

-Cameron

On Tue, Mar 18, 2008 at 12:04 PM, Mischa Uppelschoten ext 10
<[EMAIL PROTECTED]> wrote:
> All,
>  I'm running into an issue with CF8 and how components are bound to form 
> controls. Proper execution of one of my components depends on a value in the 
> session scope.
>
>  Site1\application.cfm  (-> this.name = "site1";)
>  Site1\Components\MyComponent.cfm
>  Site1\UseComponentToShowSiteNameOnSite1.cfm
>
>  Site2\application.cfm   (-> this.name = "site2";)
>  Site2\Components   ... this is an IIS virtual directory that points to  
> Site1\Components
>  Site2\UseComponentToShowSiteNameOnSite2.cfm
>
>  The purpose of the above setup is to share a set of common cfc's between the 
> two sites. If an object is instantiated through CreateObject via the 
> UseComponentToShowSiteNameOnSite2.cfm template, the virtual directory is 
> honored and the application.cfm from site2 is used.
>
>  However, if I use CFGRID with a 
> bind="cfc:Site2.Components.MyComponent.TestFunction...   I can see that the 
> application.cfm from Site1 is used.
>
>  This breaks my application because the required session variables are not 
> available for the user in Site1.
>
>  Is there a better way to share common cfc's and have different 
> application.cfc's apply depending on how they are called?
>
>  (The above is a simplification, let me know if you need code).
>  Thanks!
>  Mischa.
>
>
>
>  -------------------------------------------------------------
>  Annual Sponsor FigLeaf Software - http://www.figleaf.com
>
>  To unsubscribe from this list, manage your profile @
>  http://www.acfug.org?falogin.edituserform
>
>  For more info, see http://www.acfug.org/mailinglists
>  Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>  List hosted by http://www.fusionlink.com
>  -------------------------------------------------------------
>
>
>
>



-- 
Cameron Childress
Sumo Consulting Inc
http://www.sumoc.com
---
cell: 678.637.5072
aim: cameroncf
email: [EMAIL PROTECTED]


-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to