Re: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread James Holmes
You can't use cffile to read the config file?

On 7/27/07, Michael Dawson [EMAIL PROTECTED] wrote:
 For some reason, this post didn't make it through the mail system.

 I have structured my web site (CF8) so that my config settings are
 outside of the web root such as this:
 
 C:\Components
 C:\Config
 C:\CustomTags
 C:\WebSite
 
 I'm building the site at: http://acelinktest.evansville.edu/ and will
 publish it to http://acelink.evansville.edu/.
 
 With the exception of the C:\Config folder, all other folders will be
 published to the production site.  The contents of the C:\Config folder
 will contain site-specific information such as the site name
 AceLinkTest vs AceLink and different values for session and
 application timeouts.  (The test site will have shorter timeouts.)
 
 Now, I'm building the Application.cfc and can't figure out the best way
 to set the Application variables such as:
 
 this.name = #appName#;
 this.sessionTimeout = #sessionTimeout#;
 this.mappings[CustomTags] = #customTagsServerPath#;
 
 I want to use either an Include or Component (not wanting to argue which
 is better), but I can't include a config.cfm file if it's outside the
 web root since the mapping is not yet created.  I can't create the
 mapping because I can't read the config.cfm file that is outside the web
 root.
 
 I want to keep the web site as dynamic as possible, regarding server
 paths and URLs, and also keep a separate directory for my site
 configuration.  However, where do I get that first bit of information
 that ties it all together?

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284685
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Michael Dawson
I can use relative references, however, there appears to be a bug in CF8 that 
won't allow you include a file in the Application.cfc's constructor area.  
Well, that's not entirely correct.  You can include a file, however, you can't 
refer to any variables within that included file.  That makes it pretty useless.

What I want to do is very basic:

I want an Application.cfc that is exactly the same for development, testing and 
production.  I want that Application.cfc to get its settings from a Config file 
that is unique to each site (development, testing and production).

Here is a requirement:

I want to dynamically set the sessionTimeout and applicationTimeout variables 
in the THIS scope.  I want to pull these values from a config file located 
anywhere on the server (under the web root or outside of it).

Theoretically, it should work like this:

Config.cfm
--
cfset variables.constants.sessionTimeout = createTimeSpan(0,0,1,0)
cfset variables.constants.applicationTimeout = createTimeSpan(0,0,2,0)


Application.cfc
---
cfcomponent

cfinclude template=../Config/Config.cfm

cfset this.sessionTimeout = variables.constants.sessionTimeout
cfset this.applicationTimeout = variables.constants.applicationTimeout

/cfcomponent


When running this simple code, the CFINCLUDE tag does not throw an error, 
however, you can't refer to the variables set within the included file.

I would just like a solution to this simple problem.

Thanks
M!ke

 I have structured my web site (CF8) so that my config 

Use a relative reference to get to the parent directory or to siblings, etc.
Obviously, something will have to be hard-coded - the relative location of
the config file, or perhaps the name of the config file if you wanted to
mimic the behavior of CF when it's looking for Application.cfc/cfm.

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284689
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Brian Kotek
You could also place your config settings in an ANT properties file, and use
ANT to deploy the site. You can then tell ANT to substitue the specified
values into your code as part of the deployment.

On 7/26/07, Dave Watts [EMAIL PROTECTED] wrote:

  I have structured my web site (CF8) so that my config
  settings are outside of the web root such as this:
 
  C:\Components
  C:\Config
  C:\CustomTags
  C:\WebSite
 
  I'm building the site at: http://acelinktest.evansville.edu/
  and will publish it to http://acelink.evansville.edu/.
 
  With the exception of the C:\Config folder, all other folders
  will be published to the production site.  The contents of
  the C:\Config folder will contain site-specific information
  such as the site name AceLinkTest vs AceLink and
  different values for session and application timeouts.  (The
  test site will have shorter timeouts.)
 
  Now, I'm building the Application.cfc and can't figure out
  the best way to set the Application variables such as:
 
  this.name = #appName#;
  this.sessionTimeout = #sessionTimeout#;
  this.mappings[CustomTags] = #customTagsServerPath#;
 
  I want to use either an Include or Component (not wanting to
  argue which is better), but I can't include a config.cfm file
  if it's outside the web root since the mapping is not yet
  created.  I can't create the mapping because I can't read the
  config.cfm file that is outside the web root.
 
  I want to keep the web site as dynamic as possible, regarding
  server paths and URLs, and also keep a separate directory for
  my site configuration.  However, where do I get that first
  bit of information that ties it all together?

 Use a relative reference to get to the parent directory or to siblings,
 etc.
 Obviously, something will have to be hard-coded - the relative location of
 the config file, or perhaps the name of the config file if you wanted to
 mimic the behavior of CF when it's looking for Application.cfc/cfm.

 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/

 Fig Leaf Software provides the highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!

 This email has been processed by SmoothZap - www.smoothwall.net


 

~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284687
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Michael Dawson
I can use relative references, however, there appears to be a bug in CF8 that 
won't allow you include a file in the Application.cfc's constructor area.  
Well, that's not entirely correct.  You can include a file, however, you can't 
refer to any variables within that included file.  That makes it pretty useless.

What I want to do is very basic:

I want an Application.cfc that is exactly the same for development, testing and 
production.  I want that Application.cfc to get its settings from a Config file 
that is unique to each site (development, testing and production).

Here is a requirement:

I want to dynamically set the sessionTimeout and applicationTimeout variables 
in the THIS scope.  I want to pull these values from a config file located 
anywhere on the server (under the web root or outside of it).

Theoretically, it should work like this:

Config.cfm
--
cfset variables.constants.sessionTimeout = createTimeSpan(0,0,1,0)
cfset variables.constants.applicationTimeout = createTimeSpan(0,0,2,0)


Application.cfc
---
cfcomponent

cfinclude template=../Config/Config.cfm

cfset this.sessionTimeout = variables.constants.sessionTimeout
cfset this.applicationTimeout = variables.constants.applicationTimeout

/cfcomponent


When running this simple code, the CFINCLUDE tag does not throw an error, 
however, you can't refer to the variables set within the included file.

I would just like a solution to this simple problem.

Thanks
M!ke

 I have structured my web site (CF8) so that my config 

Use a relative reference to get to the parent directory or to siblings, etc.
Obviously, something will have to be hard-coded - the relative location of
the config file, or perhaps the name of the config file if you wanted to
mimic the behavior of CF when it's looking for Application.cfc/cfm.

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284690
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Brian Kotek
When I test this I can reference the variables in the included file as long
as the included file's variables don't specify the variables scope (which I
assume forces them to be local to the included template). So just do:

Config.cfm
--
cfset constants.sessionTimeout = createTimeSpan(0,0,1,0)
cfset constants.applicationTimeout = createTimeSpan(0,0,2,0)

And reference them as variables.constants.sessionTimeout in the
Application.cfc.


On 7/26/07, Michael Dawson [EMAIL PROTECTED] wrote:

 I can use relative references, however, there appears to be a bug in CF8
 that won't allow you include a file in the Application.cfc's constructor
 area.  Well, that's not entirely correct.  You can include a file, however,
 you can't refer to any variables within that included file.  That makes it
 pretty useless.

 What I want to do is very basic:

 I want an Application.cfc that is exactly the same for development,
 testing and production.  I want that Application.cfc to get its settings
 from a Config file that is unique to each site (development, testing and
 production).

 Here is a requirement:

 I want to dynamically set the sessionTimeout and applicationTimeout
 variables in the THIS scope.  I want to pull these values from a config file
 located anywhere on the server (under the web root or outside of it).

 Theoretically, it should work like this:

 Config.cfm
 --
 cfset variables.constants.sessionTimeout = createTimeSpan(0,0,1,0)
 cfset variables.constants.applicationTimeout = createTimeSpan(0,0,2,0)


 Application.cfc
 ---
 cfcomponent

 cfinclude template=../Config/Config.cfm

 cfset this.sessionTimeout = variables.constants.sessionTimeout
 cfset this.applicationTimeout =
 variables.constants.applicationTimeout

 /cfcomponent


 When running this simple code, the CFINCLUDE tag does not throw an error,
 however, you can't refer to the variables set within the included file.

 I would just like a solution to this simple problem.

 Thanks
 M!ke

  I have structured my web site (CF8) so that my config
 
 Use a relative reference to get to the parent directory or to siblings,
 etc.
 Obviously, something will have to be hard-coded - the relative location
 of
 the config file, or perhaps the name of the config file if you wanted to
 mimic the behavior of CF when it's looking for Application.cfc/cfm.

 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284695
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Dave Watts
 I can use relative references, however, there appears to be a 
 bug in CF8 that won't allow you include a file in the 
 Application.cfc's constructor area.  Well, that's not 
 entirely correct.  You can include a file, however, you can't 
 refer to any variables within that included file.  That makes 
 it pretty useless.

Can't you do this onApplicationStart? You shouldn't need the variables until
then anyway.

 Here is a requirement:
 
 I want to dynamically set the sessionTimeout and 
 applicationTimeout variables in the THIS scope.  I want to 
 pull these values from a config file located anywhere on the 
 server (under the web root or outside of it).

I haven't tried this, but I don't see why you can't set those from within
onApplicationStart.

 Theoretically, it should work like this:
 
 Config.cfm
 --
 cfset variables.constants.sessionTimeout = 
 createTimeSpan(0,0,1,0) cfset 
 variables.constants.applicationTimeout = createTimeSpan(0,0,2,0)
 
 
 Application.cfc
 ---
 cfcomponent
 
 cfinclude template=../Config/Config.cfm
 
 cfset this.sessionTimeout = variables.constants.sessionTimeout
 cfset this.applicationTimeout = 
 variables.constants.applicationTimeout
 
 /cfcomponent
 
 
 When running this simple code, the CFINCLUDE tag does not 
 throw an error, however, you can't refer to the variables set 
 within the included file.
 
 I would just like a solution to this simple problem.

How about if you omit variables.constants? If that doesn't work, how about
specifying the createTimeSpan arguments as variables within your include
file, then using them within createTimeSpan calls in your Application.cfc?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

This email has been processed by SmoothZap - www.smoothwall.net


~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284716
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Chicken or Egg? Config File to Set Application Variables

2007-07-27 Thread Dawson, Michael
Brian, good idea.  I'll give that a shot.  I assumed that putting them
in the VARIABLES scope would have ensured they were visible inside any
other page that included them.  App.cfc must not follow that rule.

M!ke 

-Original Message-
From: Brian Kotek [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 27, 2007 12:07 AM
To: CF-Talk
Subject: Re: Chicken or Egg? Config File to Set Application Variables

When I test this I can reference the variables in the included file as
long as the included file's variables don't specify the variables scope
(which I assume forces them to be local to the included template). So
just do:

Config.cfm
--
cfset constants.sessionTimeout = createTimeSpan(0,0,1,0) cfset
constants.applicationTimeout = createTimeSpan(0,0,2,0)

And reference them as variables.constants.sessionTimeout in the
Application.cfc.


On 7/26/07, Michael Dawson [EMAIL PROTECTED] wrote:

 I can use relative references, however, there appears to be a bug in 
 CF8 that won't allow you include a file in the Application.cfc's
constructor
 area.  Well, that's not entirely correct.  You can include a file, 
 however, you can't refer to any variables within that included file.  
 That makes it pretty useless.

 What I want to do is very basic:

 I want an Application.cfc that is exactly the same for development, 
 testing and production.  I want that Application.cfc to get its 
 settings from a Config file that is unique to each site (development, 
 testing and production).

 Here is a requirement:

 I want to dynamically set the sessionTimeout and applicationTimeout 
 variables in the THIS scope.  I want to pull these values from a 
 config file located anywhere on the server (under the web root or
outside of it).

 Theoretically, it should work like this:

 Config.cfm
 --
 cfset variables.constants.sessionTimeout = createTimeSpan(0,0,1,0) 
 cfset variables.constants.applicationTimeout = 
 createTimeSpan(0,0,2,0)


 Application.cfc
 ---
 cfcomponent

 cfinclude template=../Config/Config.cfm

 cfset this.sessionTimeout = variables.constants.sessionTimeout
 cfset this.applicationTimeout =
 variables.constants.applicationTimeout

 /cfcomponent


 When running this simple code, the CFINCLUDE tag does not throw an 
 error, however, you can't refer to the variables set within the
included file.

 I would just like a solution to this simple problem.

 Thanks
 M!ke

  I have structured my web site (CF8) so that my config
 
 Use a relative reference to get to the parent directory or to 
 siblings,
 etc.
 Obviously, something will have to be hard-coded - the relative 
 location
 of
 the config file, or perhaps the name of the config file if you wanted

 to mimic the behavior of CF when it's looking for
Application.cfc/cfm.

 



~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284723
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Chicken or Egg? Config File to Set Application Variables

2007-07-26 Thread Dave Watts
 I have structured my web site (CF8) so that my config 
 settings are outside of the web root such as this:
  
 C:\Components
 C:\Config
 C:\CustomTags
 C:\WebSite
  
 I'm building the site at: http://acelinktest.evansville.edu/ 
 and will publish it to http://acelink.evansville.edu/.
  
 With the exception of the C:\Config folder, all other folders 
 will be published to the production site.  The contents of 
 the C:\Config folder will contain site-specific information 
 such as the site name AceLinkTest vs AceLink and 
 different values for session and application timeouts.  (The 
 test site will have shorter timeouts.)
  
 Now, I'm building the Application.cfc and can't figure out 
 the best way to set the Application variables such as:
  
 this.name = #appName#;
 this.sessionTimeout = #sessionTimeout#;
 this.mappings[CustomTags] = #customTagsServerPath#;
  
 I want to use either an Include or Component (not wanting to 
 argue which is better), but I can't include a config.cfm file 
 if it's outside the web root since the mapping is not yet 
 created.  I can't create the mapping because I can't read the 
 config.cfm file that is outside the web root.
  
 I want to keep the web site as dynamic as possible, regarding 
 server paths and URLs, and also keep a separate directory for 
 my site configuration.  However, where do I get that first 
 bit of information that ties it all together?

Use a relative reference to get to the parent directory or to siblings, etc.
Obviously, something will have to be hard-coded - the relative location of
the config file, or perhaps the name of the config file if you wanted to
mimic the behavior of CF when it's looking for Application.cfc/cfm.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

This email has been processed by SmoothZap - www.smoothwall.net


~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284681
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-26 Thread Michael Dawson
For some reason, this post didn't make it through the mail system.

I have structured my web site (CF8) so that my config settings are
outside of the web root such as this:
 
C:\Components
C:\Config
C:\CustomTags
C:\WebSite
 
I'm building the site at: http://acelinktest.evansville.edu/ and will
publish it to http://acelink.evansville.edu/.
 
With the exception of the C:\Config folder, all other folders will be
published to the production site.  The contents of the C:\Config folder
will contain site-specific information such as the site name
AceLinkTest vs AceLink and different values for session and
application timeouts.  (The test site will have shorter timeouts.)
 
Now, I'm building the Application.cfc and can't figure out the best way
to set the Application variables such as:
 
this.name = #appName#;
this.sessionTimeout = #sessionTimeout#;
this.mappings[CustomTags] = #customTagsServerPath#;
 
I want to use either an Include or Component (not wanting to argue which
is better), but I can't include a config.cfm file if it's outside the
web root since the mapping is not yet created.  I can't create the
mapping because I can't read the config.cfm file that is outside the web
root.
 
I want to keep the web site as dynamic as possible, regarding server
paths and URLs, and also keep a separate directory for my site
configuration.  However, where do I get that first bit of information
that ties it all together?
 
Thanks

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284672
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Chicken or Egg? Config File to Set Application Variables

2007-07-26 Thread Michael Dawson
For some reason, this message isn't getting through the system.

Is anyone else seeing this post?

M!ke

I have structured my web site (CF8) so that my config settings are
outside of the web root such as this:
 
C:\Components
C:\Config
C:\CustomTags
C:\WebSite
 
I'm building the site at: http://acelinktest.evansville.edu/ and will
publish it to http://acelink.evansville.edu/.
 
With the exception of the C:\Config folder, all other folders will be
published to the production site.  The contents of the C:\Config folder
will contain site-specific information such as the site name
AceLinkTest vs AceLink and different values for session and
application timeouts.  (The test site will have shorter timeouts.)
 
Now, I'm building the Application.cfc and can't figure out the best way
to set the Application variables such as:
 
this.name = #appName#;
this.sessionTimeout = #sessionTimeout#;
this.mappings[CustomTags] = #customTagsServerPath#;
 
I want to use either an Include or Component (not wanting to argue which
is better), but I can't include a config.cfm file if it's outside the
web root since the mapping is not yet created.  I can't create the
mapping because I can't read the config.cfm file that is outside the web
root.
 
I want to keep the web site as dynamic as possible, regarding server
paths and URLs, and also keep a separate directory for my site
configuration.  However, where do I get that first bit of information
that ties it all together?
 
Thanks

~|
ColdFusion 8 beta - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284669
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4