Re: Application.cfm/c

2013-09-25 Thread Russ Michaels

Well if they are not using any client, application or session vars or any
of the other features then I guess they do not need one.
In which case a non unique app name is not really needed either as there is
nothing in the application of any interest to anyone.

Altho a site that simple usually doesn't even need cf I have found and
there are usually not many pages even with any cfml in them, often just
.cfm for the sake of an include.
I have found such sites are better candidates for wordpress.

Russ Michaels
www.michaels.me.uk
cfmldeveloper.com
cflive.net
cfsearch.com
On 25 Sep 2013 04:39, Byron Mann byronos...@gmail.com wrote:


 Trying to wrap my head around any implications around not using an
 application file.

 Our admins are telling me that we run into issues with customers on our
 shared platform not having one. (they didn't specify the issues in the
 email).

 I can see how non-unique application names might be an issue, but I'm
 failing to see any pitfalls to not having one. If anything I would say it
 would improve performance, since you could not use application, session and
 client scope, thus using less memory utilization.

 Looking for any experience where this may have been an issue before I talk
 to them tomorrow.

 Byron Mann
 Lead Engineer  Architect
 HostMySite.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356833
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Nando

I would assume the specific issues would be the crux of the matter. Without
them, it is difficult to speculate.

In regards to performance, the scopes you mention are often used to
increase performance in well designed applications. If the server doesn't
have enough resources to accommodate their use, then yes, performance will
suffer, but the primary reason is a lack of server resources, not the use
of application, session and client scopes.


On Wed, Sep 25, 2013 at 5:39 AM, Byron Mann byronos...@gmail.com wrote:


 Trying to wrap my head around any implications around not using an
 application file.

 Our admins are telling me that we run into issues with customers on our
 shared platform not having one. (they didn't specify the issues in the
 email).

 I can see how non-unique application names might be an issue, but I'm
 failing to see any pitfalls to not having one. If anything I would say it
 would improve performance, since you could not use application, session and
 client scope, thus using less memory utilization.

 Looking for any experience where this may have been an issue before I talk
 to them tomorrow.

 Byron Mann
 Lead Engineer  Architect
 HostMySite.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Application.cfm/c

2013-09-25 Thread Mark A Kruger

Your admins might be referring to the idea that some OTHER application.cfm/c
is being called when none is in the root of the site. These are issues that
can generally be resolved but they have to be understood. I'd get more info.

-Original Message-
From: Byron Mann [mailto:byronos...@gmail.com] 
Sent: Tuesday, September 24, 2013 10:39 PM
To: cf-talk
Subject: Application.cfm/c


Trying to wrap my head around any implications around not using an
application file.

Our admins are telling me that we run into issues with customers on our
shared platform not having one. (they didn't specify the issues in the
email).

I can see how non-unique application names might be an issue, but I'm
failing to see any pitfalls to not having one. If anything I would say it
would improve performance, since you could not use application, session and
client scope, thus using less memory utilization.

Looking for any experience where this may have been an issue before I talk
to them tomorrow.

Byron Mann
Lead Engineer  Architect
HostMySite.com




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356835
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Byron Mann

They got back to me, I think I pretty much shot down their theories.

1- Application scopes are still present without an application.cf* file and
shared across all sites with no app file
2- Garbage Collection performs better when applications are defined
3- Poor structure which leads to more support calls, for things like server
settings that can be modified on a per-app basis

1 - False to best of my knowledge, unless there is a file further up the
directory structure, which there shouldn't be. Plus, I'm thinking the
sandboxes would prevent that file from loading anyhow.  I tested this
theory on 7/8/10 and was not able to produce the issue, except when I put
an app file in a higher directory.  Did not try with a sandbox enabled.
2 - I'm not a GC guru, but I would think having less in memory usage
(application, sessions) would result in just the opposite.
3 - We have many more poor coding practices to address for customers than
this.  Like requesting 10 day timeouts for session variables, etc.

Background is, they are pushing to upload a default application.cfc to the
webroot for new sites. I'm shooting it down with my thinking that
application.cfc takes precedence over application.cfm. Which a good number
of customer sites still use, and would result in many broken customer sites
out of the box.

I'm correct in thinking it just searches up the file system structure to
the system root right?  No CF mappings or any other craziness occurs?  I
think in 10 you can even set the server to stop looking up beyond the
webroot.


Byron Mann
Lead Engineer  Architect
HostMySite.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356836
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Nando

The question to ponder here is what an *empty* default Application.cfc file
is going to achieve? Not much, I believe.

You can set per application mappings in an Application.cf* file, (from CF9
I think?) which is *very* helpful on shared hosting, but an empty
Application.cfc file isn't going to do that.

On CF10, application and session scope seem to work without an
Application.cf* file in a parent directory on my quick tests. So it seems
all an Application.cf* file can do is alter server defaults and provide a
place to manage your application.


On Wed, Sep 25, 2013 at 5:00 PM, Byron Mann byronos...@gmail.com wrote:


 They got back to me, I think I pretty much shot down their theories.

 1- Application scopes are still present without an application.cf* file
 and
 shared across all sites with no app file
 2- Garbage Collection performs better when applications are defined
 3- Poor structure which leads to more support calls, for things like server
 settings that can be modified on a per-app basis

 1 - False to best of my knowledge, unless there is a file further up the
 directory structure, which there shouldn't be. Plus, I'm thinking the
 sandboxes would prevent that file from loading anyhow.  I tested this
 theory on 7/8/10 and was not able to produce the issue, except when I put
 an app file in a higher directory.  Did not try with a sandbox enabled.
 2 - I'm not a GC guru, but I would think having less in memory usage
 (application, sessions) would result in just the opposite.
 3 - We have many more poor coding practices to address for customers than
 this.  Like requesting 10 day timeouts for session variables, etc.

 Background is, they are pushing to upload a default application.cfc to the
 webroot for new sites. I'm shooting it down with my thinking that
 application.cfc takes precedence over application.cfm. Which a good number
 of customer sites still use, and would result in many broken customer sites
 out of the box.

 I'm correct in thinking it just searches up the file system structure to
 the system root right?  No CF mappings or any other craziness occurs?  I
 think in 10 you can even set the server to stop looking up beyond the
 webroot.


 Byron Mann
 Lead Engineer  Architect
 HostMySite.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356837
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Raymond Camden

On Wed, Sep 25, 2013 at 10:45 AM, Nando d.na...@gmail.com wrote:


 The question to ponder here is what an *empty* default Application.cfc file
 is going to achieve? Not much, I believe.


I've totally ignored the whole rest of the thread, so pardon me if this is
dumb. But an empty App.cfc *would* accomplish something. It would ensure
that an App.cfc higher up the food chain doesn't fire. You may want to
prevent aht.




 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356839
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Byron Mann

*On CF10, application and session scope seem to work without an
Application.cf* file in a parent directory*

I haven't been able to produce that. I can set session and application
variables, but it's not really a session or application, just a simple
structure.  Example below the timestamps keep changing, if sessions and
application variables were enabled, you would expect them to not change.

cfscript
param name=session.time default=now();
param name=application.time default=now();
writeDump(session);
writeDump(application);
/cfscript

Their thinking seems to be that requiring an application file is somehow
going to increase stability and performance of the server, and I'm just not
seeing that. Uploading a default is just going to result in it being
overwritten anyhow 75% of the time.

I had a meeting with them and set them straight.

Byron Mann
Lead Engineer  Architect
HostMySite.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356840
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Jochem van Dieten

On Wed, Sep 25, 2013 at 5:39 AM, Byron Mann wrote:

 Our admins are telling me that we run into issues with customers on our
 shared platform not having one. (they didn't specify the issues in the
 email).


It has been a while since I last set up a server for shared hosting, but I
used to put an Application.cfc in a parent folder which would display a
short message that an Application.cfc/m was required and then cfabort it.
It used to be just for logging (some logfiles will have the application
name with each logline), but with application specific settings available
you want people to make sure they have one so they can deal with their own
mappings.

Jochem


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm/c

2013-09-25 Thread Byron Mann

That is an excellent suggestion. I think we could probably do this for new
servers going forward.

Thanks
~Byron

Byron Mann
Lead Engineer  Architect
HostMySite.com


On Wed, Sep 25, 2013 at 4:13 PM, Jochem van Dieten joch...@gmail.comwrote:


 On Wed, Sep 25, 2013 at 5:39 AM, Byron Mann wrote:

  Our admins are telling me that we run into issues with customers on our
  shared platform not having one. (they didn't specify the issues in the
  email).
 

 It has been a while since I last set up a server for shared hosting, but I
 used to put an Application.cfc in a parent folder which would display a
 short message that an Application.cfc/m was required and then cfabort it.
 It used to be just for logging (some logfiles will have the application
 name with each logline), but with application specific settings available
 you want people to make sure they have one so they can deal with their own
 mappings.

 Jochem


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356842
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Application.cfm/c

2013-09-24 Thread Byron Mann

Trying to wrap my head around any implications around not using an
application file.

Our admins are telling me that we run into issues with customers on our
shared platform not having one. (they didn't specify the issues in the
email).

I can see how non-unique application names might be an issue, but I'm
failing to see any pitfalls to not having one. If anything I would say it
would improve performance, since you could not use application, session and
client scope, thus using less memory utilization.

Looking for any experience where this may have been an issue before I talk
to them tomorrow.

Byron Mann
Lead Engineer  Architect
HostMySite.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356832
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Nick Gleason

That was perfect Matt.  Thank you.
Nick


Return-Path: listmas...@houseoffusion.com
Received: from mail.houseoffusion.com [64.118.74.225] by 
mail67.safesecureweb.com with SMTP;
   Mon, 5 Nov 2012 15:25:03 -0500
To: cf-talk cf-talk@houseoffusion.com
Message-ID: 
CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
Subject: Re: Loss of variables after switch from application.cfm to 
application.cfc in FB 3 application
References: 355f13cb$34d4cb1f$54e8dc90$@com
Date: Mon, 5 Nov 2012 14:24:28 -0600
Precedence: bulk
Reply-To: cf-talk@houseoffusion.com
From: Matt Quackenbush quackfu...@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Rcpt-To: n.glea...@citysoft.com
X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
X-SmarterMail-TotalSpamWeight: 0 

Just a wild guess here: The file in question is being d and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.

On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get 
down
 the line in the code flow to displaying the page.  That is, when we go 
back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available 
when
 it is first called and set, but then has disappeared by the time the 
page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as 
persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353102
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Nick Gleason

Matt, others,
A quick follow up on this.  It seems that request variables have no problem 
persisting if called / set within an application.cfc.  Is that right?
Nick


Return-Path: listmas...@houseoffusion.com
Received: from mail.houseoffusion.com [64.118.74.225] by 
mail67.safesecureweb.com with SMTP;
   Mon, 5 Nov 2012 15:25:03 -0500
To: cf-talk cf-talk@houseoffusion.com
Message-ID: 
CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
Subject: Re: Loss of variables after switch from application.cfm to 
application.cfc in FB 3 application
References: 355f13cb$34d4cb1f$54e8dc90$@com
Date: Mon, 5 Nov 2012 14:24:28 -0600
Precedence: bulk
Reply-To: cf-talk@houseoffusion.com
From: Matt Quackenbush quackfu...@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Rcpt-To: n.glea...@citysoft.com
X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
X-SmarterMail-TotalSpamWeight: 0 

Just a wild guess here: The file in question is being d and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.

On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get 
down
 the line in the code flow to displaying the page.  That is, when we go 
back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available 
when
 it is first called and set, but then has disappeared by the time the 
page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as 
persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353103
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Matt Quackenbush

Depending upon where/how they're called/set, that is true. No problem at
all setting/calling request.foo within Application.cfc.


On Thu, Nov 8, 2012 at 7:55 PM, Nick Gleason n.glea...@citysoft.com wrote:


 Matt, others,
 A quick follow up on this.  It seems that request variables have no problem
 persisting if called / set within an application.cfc.  Is that right?
 Nick

 
 Return-Path: listmas...@houseoffusion.com
 Received: from mail.houseoffusion.com [64.118.74.225] by
 mail67.safesecureweb.com with SMTP;
Mon, 5 Nov 2012 15:25:03 -0500
 To: cf-talk cf-talk@houseoffusion.com
 Message-ID:
 CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
 Subject: Re: Loss of variables after switch from application.cfm to
 application.cfc in FB 3 application
 References: 355f13cb$34d4cb1f$54e8dc90$@com
 Date: Mon, 5 Nov 2012 14:24:28 -0600
 Precedence: bulk
 Reply-To: cf-talk@houseoffusion.com
 From: Matt Quackenbush quackfu...@gmail.com
 MIME-Version: 1.0
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 X-Rcpt-To: n.glea...@citysoft.com
 X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
 X-SmarterMail-TotalSpamWeight: 0

 Just a wild guess here: The file in question is being d and the
 variables it is setting are getting set into the Application.cfc's
 variables scope, and therefore unavailable elsewhere.

 On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:

 
  Hi folks,
  Bit of a head scratcher here which I'm hoping may be obvious to you all.
  We've got a Fusebox 3 application which we have recently converted from
  application.cfm to application.cfc.
  One puzzling result has been that during a single page request, an
  attributes variable that is set in a file called from application.cfc
  (and formerly from application.cfm) is no longer present once we get
 down
  the line in the code flow to displaying the page.  That is, when we go
 back
  to application.cfm, the variable is available down the line for the page
  display.  But, when application.cfc is used, the variable is available
 when
  it is first called and set, but then has disappeared by the time the
 page
  flow gets to the file where the page display is done.
  So, it seems that some variables in a single request are not as
 persistent
  with application.cfc, at least in a FB 3 context?  That seems surprising
  but I can't really come up with another explanation.  And, so far, we
  haven't been able to figure out exactly where or why the attributes
  variable is getting dropped.
  Any thoughts?
  Nick
 
 
 




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353104
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-05 Thread Nick Gleason

Hi folks,
Bit of a head scratcher here which I'm hoping may be obvious to you all.
We've got a Fusebox 3 application which we have recently converted from 
application.cfm to application.cfc.
One puzzling result has been that during a single page request, an 
attributes variable that is set in a file called from application.cfc 
(and formerly from application.cfm) is no longer present once we get down 
the line in the code flow to displaying the page.  That is, when we go back 
to application.cfm, the variable is available down the line for the page 
display.  But, when application.cfc is used, the variable is available when 
it is first called and set, but then has disappeared by the time the page 
flow gets to the file where the page display is done.
So, it seems that some variables in a single request are not as persistent 
with application.cfc, at least in a FB 3 context?  That seems surprising 
but I can't really come up with another explanation.  And, so far, we 
haven't been able to figure out exactly where or why the attributes 
variable is getting dropped.
Any thoughts?
Nick

 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353065
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-05 Thread Matt Quackenbush

Just a wild guess here: The file in question is being cfincluded and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.


On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason n.glea...@citysoft.com wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get down
 the line in the code flow to displaying the page.  That is, when we go back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available when
 it is first called and set, but then has disappeared by the time the page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353066
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Application.cfm default behaviors

2011-09-28 Thread Scott Stewart

Yeah, it said Application.cfm...

I'm working on a legacy app, (on CF 9) that uses an Application.cfm,
which I cant rebuild right now.
inside of the file, there is a custom structure set called CFA., it's
part of a home grown framework.

Would it automatically be dropped into the application scope, in v.9
ie: application.cfa.whatever. or is it living and dying by the
request, even though it's being set in Application.cfm



-- 
--
Scott Stewart
Adobe Certified Instructor, ColdFusion 8  9
Adobe Certified Expert, ColdFusion 8  9

Blog: http://www.sstwebworks.com
Email: webmas...@sstwebworks.com

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347764
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm default behaviors

2011-09-28 Thread John M Bliss

I'm pretty sure it's living and dying by the request.

In application.cfm:

cfset x = 1

...is:

cfset variables.x = 1

...and not:

cfset application.x = 1


On Wed, Sep 28, 2011 at 8:33 AM, Scott Stewart webmas...@sstwebworks.comwrote:


 Yeah, it said Application.cfm...

 I'm working on a legacy app, (on CF 9) that uses an Application.cfm,
 which I cant rebuild right now.
 inside of the file, there is a custom structure set called CFA., it's
 part of a home grown framework.

 Would it automatically be dropped into the application scope, in v.9
 ie: application.cfa.whatever. or is it living and dying by the
 request, even though it's being set in Application.cfm



 --
 --
 Scott Stewart
 Adobe Certified Instructor, ColdFusion 8  9
 Adobe Certified Expert, ColdFusion 8  9

 Blog: http://www.sstwebworks.com
 Email: webmas...@sstwebworks.com

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347765
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Application.cfm default behaviors

2011-09-28 Thread Dave Watts

 Yeah, it said Application.cfm...

 I'm working on a legacy app, (on CF 9) that uses an Application.cfm,
 which I cant rebuild right now.
 inside of the file, there is a custom structure set called CFA., it's
 part of a home grown framework.

 Would it automatically be dropped into the application scope, in v.9
 ie: application.cfa.whatever. or is it living and dying by the
 request, even though it's being set in Application.cfm

Unless it's specifically in the Application scope, it will be local to
the page running the request.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347766
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Claude Schnéegans

 That’s what cfthrow and cfrethrow are for.

No.
This is to trigger an execution error in the system.
This kind of errors are not to be reported to the user.

If all you want is to warn the user he has done something wrong, you just need 
to display some message in the returned page and that's it.
Ex : You entered an invalid date... then abort!

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345824
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-28 Thread Andrew Scott

Pfft, never ever heard that you display then use cfabort. Sorry but you not
going to ever convince me that cfabort is a good thing in any way shape or
form, except for debugging purposes. I can show you many ways to rewrite it
and be more efficient without using cfabort.


Regards,
Andrew Scott
http://www.andyscott.id.au/



 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Tuesday, 28 June 2011 11:02 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  That’s what cfthrow and cfrethrow are for.
 
 No.
 This is to trigger an execution error in the system.
 This kind of errors are not to be reported to the user.
 
 If all you want is to warn the user he has done something wrong, you just
 need to display some message in the returned page and that's it.
 Ex : You entered an invalid date... then abort!
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345830
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Dave Watts

 Pfft, never ever heard that you display then use cfabort. Sorry but you not
 going to ever convince me that cfabort is a good thing in any way shape or
 form, except for debugging purposes. I can show you many ways to rewrite it
 and be more efficient without using cfabort.

If you want to stop processing, and not generate an HTTP error,
there's nothing wrong with using CFABORT. In any case, I can't imagine
what metric you're using to measure efficiency.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345833
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-28 Thread Andrew Scott

What does efficiency have to do with it?

You will not change my mind on the use of cfabort, pure and simple. CFError
was introduced to capture errors, and it does a good job of it too. But my
question is if you are not using onRequestEnd.cfm what does it matter if you
use cfabort or not? Personally I would tentd to not use it, because there
might come a time when you need to use the onRequestEnd.cfm for other things
and you will end up scratching your head trying to work out why it is not
getting run.

Just the same as one has used a CFML template to deliver a PDF, that is an
actual cfml template again. Enough said..



Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Wednesday, 29 June 2011 12:52 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  Pfft, never ever heard that you display then use cfabort. Sorry but
  you not going to ever convince me that cfabort is a good thing in any
  way shape or form, except for debugging purposes. I can show you many
  ways to rewrite it and be more efficient without using cfabort.
 
 If you want to stop processing, and not generate an HTTP error, there's
 nothing wrong with using CFABORT. In any case, I can't imagine what metric
 you're using to measure efficiency.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345833
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Russ Michaels

not to mention the fact that your HTML will not get rendered correctly if
you simply abort a page, which may result in your friendly error message not
being displayed properly, if at all.
So i'd have to agree with Andrew that this really belongs in the realms of
debugging not on a production site or you are just asking for trouble. But
to each his own, you can also smoke cigarettes at a gas station if you want,
but I would really suggest not doing it :-)

Russ

On Tue, Jun 28, 2011 at 3:52 PM, Andrew Scott andr...@andyscott.id.auwrote:


 What does efficiency have to do with it?

 You will not change my mind on the use of cfabort, pure and simple. CFError
 was introduced to capture errors, and it does a good job of it too. But my
 question is if you are not using onRequestEnd.cfm what does it matter if
 you
 use cfabort or not? Personally I would tentd to not use it, because there
 might come a time when you need to use the onRequestEnd.cfm for other
 things
 and you will end up scratching your head trying to work out why it is not
 getting run.

 Just the same as one has used a CFML template to deliver a PDF, that is an
 actual cfml template again. Enough said..



 Regards,
 Andrew Scott
 http://www.andyscott.id.au/




  -Original Message-
  From: Dave Watts [mailto:dwa...@figleaf.com]
  Sent: Wednesday, 29 June 2011 12:52 AM
  To: cf-talk
  Subject: Re: application.cfm
 
 
   Pfft, never ever heard that you display then use cfabort. Sorry but
   you not going to ever convince me that cfabort is a good thing in any
   way shape or form, except for debugging purposes. I can show you many
   ways to rewrite it and be more efficient without using cfabort.
 
  If you want to stop processing, and not generate an HTTP error, there's
  nothing wrong with using CFABORT. In any case, I can't imagine what
 metric
  you're using to measure efficiency.
 
  Dave Watts, CTO, Fig Leaf Software
  http://www.figleaf.com/
  http://training.figleaf.com/
 
  Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
  Schedule, and provides the highest caliber vendor-authorized instruction
 at
  our training centers, online, or onsite.
 
  ~~
  ~~~|
  Order the Adobe Coldfusion Anthology now!
  http://www.amazon.com/Adobe-Coldfusion-
  Anthology/dp/1430272155/?tag=houseoffusion
  Archive: http://www.houseoffusion.com/groups/cf-
  talk/message.cfm/messageid:345833
  Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
  Unsubscribe: http://www.houseoffusion.com/groups/cf-
  talk/unsubscribe.cfm


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345836
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Dave Watts

 What does efficiency have to do with it?

You tell me:
 I can show you many ways to rewrite it and be more efficient without
using cfabort.

 You will not change my mind on the use of cfabort, pure and simple.

I'm not really interested in changing your mind. I am interested in
disagreeing with what I think are incorrect blanket statements like
never use CFABORT.

 CFError was introduced to capture errors, and it does a good job of it too.

That's very true, but I'm not sure how it's especially relevant here.
If you simply want to abort processing, CFABORT is perfectly good for
this. If you want to show the user a bit of text before you abort
processing, CFABORT still is perfectly good for this.

 But my question is if you are not using onRequestEnd.cfm what does it matter 
 if you
 use cfabort or not? Personally I would tentd to not use it ...

Yes, fine. The key word there is personally. But you seem to make
the jump from personal preference to defining that preference as a
best practice, and that's what I object to.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345838
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Claude Schnéegans

  your HTML will not get rendered correctly if
you simply abort a page, which may result in your friendly error message not
being displayed properly, if at all.

Yet another grtuitous statement...
Your HTML will not get rendered correctly if you do not write it correctly, 
period. ;-)

Ex: do not validate form fields after opening a table or a div, or close them 
before you CFEXIT, this is elementary.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Claude Schnéegans

  incorrect blanket statements

I think this is exactly what I was looking for when I wrote gratuitous 
statement, I hope this is correct too ;-)

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345847
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Russ Michaels

If your not going to cfabort until after the final HTML tag, than doesn't
that rather defeat the point.

On Tue, Jun 28, 2011 at 4:26 PM,  wrote:


   incorrect blanket statements

 I think this is exactly what I was looking for when I wrote gratuitous
 statement, I hope this is correct too ;-)

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345851
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-28 Thread Andrew Scott

No Dave, I look at what the next developer or I might be doing in 6-12months
time. I think that people should look at the problem at hand now and the
future, and foresee maybe things might change. Would it no be better to
write something properly now, rather than scratch your head and then rewrite
the code again later when you requirements change?

Have a think about that.

Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Wednesday, 29 June 2011 1:04 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 Yes, fine. The key word there is personally. But you seem to make the
 jump from personal preference to defining that preference as a best
 practice, and that's what I object to.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345852
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-28 Thread Dave Watts

 No Dave, I look at what the next developer or I might be doing in 6-12months
 time. I think that people should look at the problem at hand now and the
 future, and foresee maybe things might change. Would it no be better to
 write something properly now, rather than scratch your head and then rewrite
 the code again later when you requirements change?

You continue to assume that, because you prefer one way of doing
things, the other isn't proper. But that continued assumption
doesn't make it true. I can't imagine a developer having trouble
figuring out how CFABORT works. If such a developer exists, he would
be better suited to employment in another field.

Anyway, this will be my last response to this thread. You have done
something I didn't think possible - make me agree with Claude.
Clearly, this marks the beginning of the apocalypse.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345856
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-28 Thread Andrew Scott

Dave, I never said that neither way was improper. What I stated was that the
tag cfabort was introduced to satisfy the needs of developers who needed a
way to abort the page for debugging purposes.

I never talked about developers could not figure out what cfabort is for,
what I am saying is that when you begin to make changes to the application
one will end up scratching their heads as to why some snippet of code is not
working, only to find that a developer 2-10 years ago wrote dodgy code that
put a cfabort into a template when there is no need to do that.

It is all about letting the natural process continue for that exact reason,
and you wonder why ColdFusion gets a bad name. Anyone who picks up an
Application and then has to scratch their heads to figure out why something
is not working, has to waste time going through the code to figure out why,
and that to me screams bad decision making at the time that snippet of code
was written.
 
Dave, you can argue things that I have not actually said, or you can imply
what you think I mean. You will never change my mind that you should avoid
using cfabort, than what it was intended for and what 99.99% of people
actually do use it for. Sure there are many things in ColdFusion that one
could do it this way or that, and then we are right back to the dark ages of
spaghetti code, and people bagging the language because they believe the
work flow to be badly written.

The point is that Claude made it very clear that he is not using
onRequestEnd.cfm, he also made it very clear that he likes to output data
and then do a cfabort to make sure the page has ended, and I will ask for
what real benefit? Now, what if he decided to reuse this code in another
template only to find that he has to rewrite that code, because something
new needs to run that code, then fails to run he then has to find another
way to do his job. So why not write it as if you are intending to reuse the
code in the first place, and that there is a huge potential that one might
want to call this code from another template.

It doesn't take an Einstein to work out that if you are looking at exciting
the template there are more better and efficient ways of doing it, that is
my point and I will say it again, you will not change my mind on this. IF a
developer can't take the initiative to make their jobs easier, whether it be
now or 10 years from now, then I have no time for those people because they
are caught up in the moment, and not thinking about the what ifs when it
comes to their style of coding.

I mean we are hear discussing this, because bad code was written in the
first place. Sure you can do it the way Claude has done it, does it make it
work right, well it did then but not anymore. And that just makes my point
even stronger.


Regards,
Andrew Scott
http://www.andyscott.id.au/



 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Wednesday, 29 June 2011 1:44 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  No Dave, I look at what the next developer or I might be doing in
  6-12months time. I think that people should look at the problem at
  hand now and the future, and foresee maybe things might change. Would
  it no be better to write something properly now, rather than scratch
  your head and then rewrite the code again later when you requirements
 change?
 
 You continue to assume that, because you prefer one way of doing things,
 the other isn't proper. But that continued assumption doesn't make it
true.
 I can't imagine a developer having trouble figuring out how CFABORT works.
 If such a developer exists, he would be better suited to employment in
 another field.
 
 Anyway, this will be my last response to this thread. You have done
 something I didn't think possible - make me agree with Claude.
 Clearly, this marks the beginning of the apocalypse.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345856
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345861
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk

Re: application.cfm

2011-06-27 Thread Claude Schnéegans

 Or you may simply not want to waste time processing code that's
unnecessary for a specific request.

... and you might even use no onRequestEnd at all ;-)


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345753
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-27 Thread Claude Schnéegans

 Actually cfabort was introduced as a debugging tag.


Really?
Note that I use CFABORT because I was not sure CFCONTENT will cause processing 
to stop.
It is not specified in the docs, but it does, so I could remove the CFABORT tag 
after CFCONTENT

There is still a good reason for CFABORT: stop processing after displaying an 
error message in application.cfm.
This is not debugging, but HTTP request validation.
I have plenty of validation done in application.cfm.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345754
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-27 Thread Andrew Scott

That’s what cfthrow and cfrethrow are for.


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Monday, 27 June 2011 11:06 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  Actually cfabort was introduced as a debugging tag.
 
 
 Really?
 Note that I use CFABORT because I was not sure CFCONTENT will cause
 processing to stop.
 It is not specified in the docs, but it does, so I could remove the
CFABORT tag
 after CFCONTENT
 
 There is still a good reason for CFABORT: stop processing after displaying
an
 error message in application.cfm.
 This is not debugging, but HTTP request validation.
 I have plenty of validation done in application.cfm.
 
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345818
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Claude Schnéegans

 Yes you did but I also asked for the PDF in question so that I could run
some tests as well, maybe you missed that:-)

I didn't miss it. The content of the pdf has absolutely no interest.
I told you it hapened to contain somewhere a string cf, the rest making an 
invalid CF tag.
This is enough to cause an error if it is compiled by CF.
There is no need to look any further in this file.

 Anyway I have a couple of questions.

Now look, I've posted all details here, including the code, if you don't 
understand it, just forget it.
I was using a pdf under a .cfm extension just to force execution of an 
application.cfm.
Once this template is executed, the true pdf file is returned to the requester, 
there is no need to execute any other template, especialy a pdf file, then it 
aborts.

The customer asked to have times every document was requested to be traced.
I know there plenty of other ways to do it, the problem was that the CMS was 
already designed to generate direct links to the files using the true file name,
ie: A href=myFile.pdfTitle of the file/A.
I didn't want to change the code for A href=getDoc.cfm?id=#docId#Title of 
the file/Aeverywhere a document was called.
The way I did it, A href=myFile.pdf.cfmTitle of the file/A had the 
advantage to be compatible with
documents previously uploaded in the system, without having to change any thing 
in the database structure nor in the existing pages.
Only the new document would be counted.
I now know that there is rare cases it won't work, I'm rewriting the module 
differently,
and I need the help of nobody to do it, thanks anyway.

I was just asking a question here, not help.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345735
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Claude Schnéegans

 The alternative, though, would be
for the executing process to run your first program before compiling
the second, which sounds like it would be generally an inefficient
thing to do - the more times control has to be passed from one process
to another, the longer things generally take. And compilation
generally only happens once - the first time the file is requested.


Not really a big deal: the compiler is called again every time you CFINCLUDE 
some file anyway.
This may happen many times during execution of only one template.

Now if an included template is not compiled before it is indeed included, I 
don't why it could not be the same
for the HTTP requested template ie: not being compiled before application.cfm 
passes control to it.

It just happens it is not the way it works, but it is certainly not for any 
kind of logical or efficiency reason.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345736
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 I did Claude (But I stated a possible bug), because I still am struggling
 because you don't share the code, to how you are including or loading the
 PDF. In other words I think there is a solution but I would need to see the
 code and the offending PDF to help further.

No, he did post all the code, but you also have to put that together
with the fact that the code is invoked when a user directly requests
one of his PDFs:

http://claudes_server/somefile.pdf.cfm

So, the compiler attempts to compile somefile.pdf.cfm before running
the code he posted in Application.cfm.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345737
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 1) Why are you using application/octet-stream instead of the PDF one? Are
 you going to be using other file types here?

My guess is that his application doesn't keep track of the MIME types
for individual files.

 2) Why do you have cfabort in your code, this screams bad coding. Cfabort
 means that you no longer want ColdFusion to continue on any more processing.
 Personally I would rewrite the code in a manner that no longer uses the
 cfabort. I know this is not the problem, but that is not what I would
 consider good programming habits.

There is nothing wrong with using CFABORT.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345738
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-26 Thread Andrew Scott

Dave,

Really I didn't get that from his posts..

The part that I am struggling with is the actual PDF itself, regardless of
whether it is called via a cfml template or not. I strongly believe that if
you are using cfcontent to deliver a file with the extension of PDF then it
*SHOULD* not compile that file, only the template it is being called from.

I saw the code, I read the code but it was not very clear if the PDF in
question also had the cfm extension or not, and after re-reading everything
I still don't see that mentioned.


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Monday, 27 June 2011 1:39 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  I did Claude (But I stated a possible bug), because I still am
  struggling because you don't share the code, to how you are including
  or loading the PDF. In other words I think there is a solution but I
  would need to see the code and the offending PDF to help further.
 
 No, he did post all the code, but you also have to put that together with
the
 fact that the code is invoked when a user directly requests one of his
PDFs:
 
 http://claudes_server/somefile.pdf.cfm
 
 So, the compiler attempts to compile somefile.pdf.cfm before running the
 code he posted in Application.cfm.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345739
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-26 Thread Andrew Scott

No there isn't, just weird seeing cfabort rather than cfexit
method=exittemplate / which is better as you know that the application
will eventually fall down to onRequestEnd.cfm were as cfabort will not. 


Regards,
Andrew Scott
http://www.andyscott.id.au/



 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Monday, 27 June 2011 1:40 AM
 To: cf-talk
 Subject: Re: application.cfm

  2) Why do you have cfabort in your code, this screams bad coding.
  Cfabort means that you no longer want ColdFusion to continue on any
 more processing.
  Personally I would rewrite the code in a manner that no longer uses
  the cfabort. I know this is not the problem, but that is not what I
  would consider good programming habits.
 
 There is nothing wrong with using CFABORT.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345740
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Claude Schnéegans

  I strongly believe that if
you are using cfcontent to deliver a file with the extension of PDF then it
*SHOULD* not compile that file, only the template it is being called from.


What you don't understand is that the file somefile.pdf.cfm
IS the actual somefile.pdf file simply renamed somefile.pdf.cfm.
Then it is compiled BEFORE application.cfm is run and can CFCONTENT the file.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345741
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Claude Schnéegans

  just weird seeing cfabort rather than cfexit
method=exittemplate / which is better as you know that the application
will eventually fall down to onRequestEnd.cfm were as cfabort will not.


When you use CFCONTENT to deliver content, there is nothing else needed to be 
done, except terminate the process, which is CFABORT is intended for.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345742
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 The part that I am struggling with is the actual PDF itself, regardless of
 whether it is called via a cfml template or not. I strongly believe that if
 you are using cfcontent to deliver a file with the extension of PDF then it
 *SHOULD* not compile that file, only the template it is being called from.

That's what confused me as well. If you're using CFCONTENT to deliver
a file, that won't cause it to be compiled. But that's not all he's
doing, and I think he made that clear in subsequent posts.

 I saw the code, I read the code but it was not very clear if the PDF in
 question also had the cfm extension or not, and after re-reading everything
 I still don't see that mentioned.

I'm pretty sure I saw it mentioned in one of them, but I always have a
bit of trouble understanding Claude's posts - no fault on his part
there, just a bit of language barrier on my part I guess.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 No there isn't, just weird seeing cfabort rather than cfexit
 method=exittemplate / which is better as you know that the application
 will eventually fall down to onRequestEnd.cfm were as cfabort will not.

In many cases you might not want onRequestEnd.cfm to execute.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345744
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Russ Michaels

Andew, it has been said several times that the problem was caused by a user
link to the file directly, it is not caused by cfcontent, thus why it got
compiled.

On Sun, Jun 26, 2011 at 5:07 PM, Andrew Scott andr...@andyscott.id.auwrote:


 Dave,

 Really I didn't get that from his posts..

 The part that I am struggling with is the actual PDF itself, regardless of
 whether it is called via a cfml template or not. I strongly believe that if
 you are using cfcontent to deliver a file with the extension of PDF then it
 *SHOULD* not compile that file, only the template it is being called from.

 I saw the code, I read the code but it was not very clear if the PDF in
 question also had the cfm extension or not, and after re-reading everything
 I still don't see that mentioned.


 Regards,
 Andrew Scott
 http://www.andyscott.id.au/


  -Original Message-
  From: Dave Watts [mailto:dwa...@figleaf.com]
  Sent: Monday, 27 June 2011 1:39 AM
  To: cf-talk
  Subject: Re: application.cfm
 
 
   I did Claude (But I stated a possible bug), because I still am
   struggling because you don't share the code, to how you are including
   or loading the PDF. In other words I think there is a solution but I
   would need to see the code and the offending PDF to help further.
 
  No, he did post all the code, but you also have to put that together with
 the
  fact that the code is invoked when a user directly requests one of his
 PDFs:
 
  http://claudes_server/somefile.pdf.cfm
 
  So, the compiler attempts to compile somefile.pdf.cfm before running the
  code he posted in Application.cfm.
 
  Dave Watts, CTO, Fig Leaf Software
  http://www.figleaf.com/
  http://training.figleaf.com/
 
  Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
  Schedule, and provides the highest caliber vendor-authorized instruction
 at
  our training centers, online, or onsite.
 


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345745
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-26 Thread Andrew Scott

Actually I can't think of one.


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Monday, 27 June 2011 2:42 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  No there isn't, just weird seeing cfabort rather than cfexit
  method=exittemplate / which is better as you know that the
  application will eventually fall down to onRequestEnd.cfm were as
cfabort
 will not.
 
 In many cases you might not want onRequestEnd.cfm to execute.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345748
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-26 Thread Andrew Scott

Actually cfabort was introduced as a debugging tag.


Regards,
Andrew Scott
http://www.andyscott.id.au/



 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Monday, 27 June 2011 2:27 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
   just weird seeing cfabort rather than cfexit method=exittemplate /
 which is better as you know that the application will eventually fall down
to
 onRequestEnd.cfm were as cfabort will not.
 
 
 When you use CFCONTENT to deliver content, there is nothing else needed
 to be done, except terminate the process, which is CFABORT is intended
for.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345749
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-26 Thread Andrew Scott

Actually it wasn't that clear at all.

Look I am bowing out now, I will not be ridiculed by someone who found it
hard to comprehend that what he was doing was wrong and then gets defensive
about it when people are trying to actually understand what he is doing.

Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Russ Michaels [mailto:r...@michaels.me.uk]
 Sent: Monday, 27 June 2011 5:45 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
 Andew, it has been said several times that the problem was caused by a
user
 link to the file directly, it is not caused by cfcontent, thus why it got
compiled.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345750
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 Actually I can't think of one.

Well, I can think of a couple offhand. For example, you might have
some code that generates HTML output in onRequestEnd.cfm, and you
might have some scripts that generate something other than HTML. Or
you may simply not want to waste time processing code that's
unnecessary for a specific request.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345751
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-26 Thread Dave Watts

 Actually cfabort was introduced as a debugging tag.

No, it wasn't. It was introduced to allow the programmer to halt the
current program. While it can be useful for debugging, it's not
specific to debugging. I'm pretty sure that CFABORT has been around
since the very beginning of CFML.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345752
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Dave Watts

  In Claude's original question, it doesn't appear he's using CFCONTENT:

 Yes I am.
 Here is a summary of the code in application.cfm:
 You can see that the requested file is never executed nor intended to.
 The only purpose of the .cfm extension is to force the execution of the 
 application.cfm

Thus, as described in my previous response:

If you give a file a .cfm extension and invoke that file in an HTTP
request on a server configured to run CF, for all intents and purposes
that file is CFML, whether it contains any CFML tags or functions or
not. And CF will compile it, and this is not a bug, but the intended
behavior.

The fact that you're using CFCONTENT later on is a red herring - the
fact is, you have a .cfm file and you're requesting it via HTTP. That
file is therefore treated as a CF file. CF will attempt to compile it.
This is not a bug, but the intended behavior.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345677
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Dave Watts

  My guess is that the compiler takes lots of extra time and resources, so it 
  does all its work before getting into the execution process.

 May be, however it will also compile some files for nothing, ie: included 
 files actually not included at execution... which represents an extra 
 overhead.
 There is even a drawback that can even be condidered as a bug (don't know if 
 it is still there in CF 9) : duplicate functions defined in two diferent 
 includes although only one template is included at execution.

No optimization process is perfect. The alternative, though, would be
for the executing process to run your first program before compiling
the second, which sounds like it would be generally an inefficient
thing to do - the more times control has to be passed from one process
to another, the longer things generally take. And compilation
generally only happens once - the first time the file is requested.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345678
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Dave Watts

 Until we see the code that delivers the PDF, you have to look at what is
 causing the compile error. It has nothing to do with when one is compiled or
 not, or what order it is compiled in. ColdFusion will always compile
 application.cfm/application.cfc and then the template you are trying to run,
 and onRequestEnd.cfm if you have it. It can't do it any other way, because
 it has to know what variables might be defined in the application.cfm.

No, in fact it has everything to do with this. The user is requesting
a URL that looks like this:

http://claudes_crazy_server/somedir/somefile.pdf.cfm

That file will be compiled before the Application.cfm file runs. That
file is causing a compilation error before Application.cfm runs, in
this case.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345679
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Russ Michaels

hasn't this all been said several times already ?

On Sat, Jun 25, 2011 at 5:59 PM, Dave Watts dwa...@figleaf.com wrote:


  Until we see the code that delivers the PDF, you have to look at what is
  causing the compile error. It has nothing to do with when one is compiled
 or
  not, or what order it is compiled in. ColdFusion will always compile
  application.cfm/application.cfc and then the template you are trying to
 run,
  and onRequestEnd.cfm if you have it. It can't do it any other way,
 because
  it has to know what variables might be defined in the application.cfm.

 No, in fact it has everything to do with this. The user is requesting
 a URL that looks like this:

 http://claudes_crazy_server/somedir/somefile.pdf.cfm

 That file will be compiled before the Application.cfm file runs. That
 file is causing a compilation error before Application.cfm runs, in
 this case.

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

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345681
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Dave Watts

 hasn't this all been said several times already ?

It doesn't appear to have been said simply and clearly, no.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345683
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Claude Schnéegans

 CF will attempt to compile it.

My assumption was it was not compiled if not executed, but from my very first 
post I know it is not the case.
My question was is it possible to get around this.
I got about 50 answers to explain what I already knew, but none to my question.
So I conclude that there is probably no way to have CF work differently, this 
is a reasonable assumption.
I also conclude that no one knows a way to have CF work differently, and this 
is a certitude,

 This is not a bug, but the intended behavior.

No one said it was a bug.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345712
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Dave Watts

 My assumption was it was not compiled if not executed, but from my very first 
 post I know it is not the case.
 My question was is it possible to get around this.
 I got about 50 answers to explain what I already knew, but none to my 
 question.
 So I conclude that there is probably no way to have CF work differently, this 
 is a reasonable assumption.
 I also conclude that no one knows a way to have CF work differently, and this 
 is a certitude,

No, there is no way you can have CF conditionally compile programs.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345715
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-25 Thread Andrew Scott

I did Claude (But I stated a possible bug), because I still am struggling
because you don't share the code, to how you are including or loading the
PDF. In other words I think there is a solution but I would need to see the
code and the offending PDF to help further.


Regards,
Andrew Scott
http://www.andyscott.id.au/





 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Sunday, 26 June 2011 9:19 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  CF will attempt to compile it.
 
 My assumption was it was not compiled if not executed, but from my very
 first post I know it is not the case.
 My question was is it possible to get around this.
 I got about 50 answers to explain what I already knew, but none to my
 question.
 So I conclude that there is probably no way to have CF work differently,
this
 is a reasonable assumption.
 I also conclude that no one knows a way to have CF work differently, and
this
 is a certitude,
 
  This is not a bug, but the intended behavior.
 
 No one said it was a bug.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345717
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread James Holmes

No.

Happy now?

--
WSS4CF - WS-Security framework for CF
http://wss4cf.riaforge.org/



On 26 June 2011 07:19,   wrote:
 My question was is it possible to get around this.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345721
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-25 Thread Claude Schnéegans

 because you don't share the code

I did sent all the code, you probably missed it.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345724
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-25 Thread Andrew Scott

Yes you did but I also asked for the PDF in question so that I could run
some tests as well, maybe you missed that:-)

Anyway I have a couple of questions.

1) Why are you using application/octet-stream instead of the PDF one? Are
you going to be using other file types here?
2) Why do you have cfabort in your code, this screams bad coding. Cfabort
means that you no longer want ColdFusion to continue on any more processing.
Personally I would rewrite the code in a manner that no longer uses the
cfabort. I know this is not the problem, but that is not what I would
consider good programming habits.

As I stated if you want to send this to me off list I will be more than
happy to have a look at it for you.


Regards,
Andrew Scott
http://www.andyscott.id.au/



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345726
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Dave Watts

 CF should not be compiling anything that is not CFML, if it is this actually
 happening then it sounds like a bug in CF.

If you give a file a .cfm extension and invoke that file in an HTTP
request on a server configured to run CF, for all intents and purposes
that file is CFML, whether it contains any CFML tags or functions or
not. And CF will compile it, and this is not a bug, but the intended
behavior.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345556
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

Dave, I realise that. In this case he is claiming to use cfcontent, any
content that is used in this manner should not be compiled into the CFML
template.

That was my point.


Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Thursday, 23 June 2011 4:56 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  CF should not be compiling anything that is not CFML, if it is this
  actually happening then it sounds like a bug in CF.
 
 If you give a file a .cfm extension and invoke that file in an HTTP
request on a
 server configured to run CF, for all intents and purposes that file is
CFML,
 whether it contains any CFML tags or functions or not. And CF will compile
it,
 and this is not a bug, but the intended behavior.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345557
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Dave Watts

 Dave, I realise that. In this case he is claiming to use cfcontent, any
 content that is used in this manner should not be compiled into the CFML
 template.

 That was my point.

In Claude's original question, it doesn't appear he's using CFCONTENT:

I've noticed that application.cfm is indeed run before the template
called in the url, but the template itself is compiled BEFORE
application.cfm is called. I need to have the ability in
application.cfm to run some code and NOT compile the template.

If you're using CFCONTENT to fetch a file, that file isn't the
template called in the URL.

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

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345559
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

I think he admitted to it a bit later.


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Dave Watts [mailto:dwa...@figleaf.com]
 Sent: Thursday, 23 June 2011 6:26 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  Dave, I realise that. In this case he is claiming to use cfcontent,
  any content that is used in this manner should not be compiled into
  the CFML template.
 
  That was my point.
 
 In Claude's original question, it doesn't appear he's using CFCONTENT:
 
 I've noticed that application.cfm is indeed run before the template
called in
 the url, but the template itself is compiled BEFORE application.cfm is
called. I
 need to have the ability in application.cfm to run some code and NOT
 compile the template.
 
 If you're using CFCONTENT to fetch a file, that file isn't the template
called in
 the URL.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
 Schedule, and provides the highest caliber vendor-authorized instruction
at
 our training centers, online, or onsite.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345560
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Russ Michaels

yes of course, .htaccess files are otherwise hidden and cannot be viewed or
edited. So you would provide a tool within your admin panel to add/remove
users to the .htaccess

On Thu, Jun 23, 2011 at 5:49 AM, Andrew Scott andr...@andyscott.id.auwrote:


 Would that not be another risk, or do you mean secured login via an admin
 panel to edit ths?


 Regards,
 Andrew Scott
 http://www.andyscott.id.au/




  -Original Message-
  From: Russ Michaels [mailto:r...@michaels.me.uk]
  Sent: Thursday, 23 June 2011 5:15 AM
  To: cf-talk
  Subject: Re: application.cfm
 
 
  It is pretty simple.
 
  use CFFILE to read the .htaccess file
  add a new user
  use CFFILE to write the .htaccess file
 
  User logs in, when he is authenticated, his credentials are available in
 the CGI
  scope for you to use via CFML.
 
  As I said, on Apache this is native, on IIS you can use Helicon APE
 (which
  probably has an API as well).
 
 
  Russ
 


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345561
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Dominic Watson

Here's how I would approach this. First, if you are dead set on having
the link to the pdf appear as a regular 'pdf' link, create a url
rewrite rule (using either mod_rewrite in Apache, an IIS isapi
extension for IIS, or another mechanism if you are using some other
webserver). The mod_rewrite rule might look something like this (not
checked for accuracy):

RewriteEngine On
RewriteRule ^somefakedownloaddir/(.+?)\.pdf$ processPdfRequest.cfm?file=$1[L]

In other words, you can download the pdf by accessing:

http://myserver.com/processPdfRequest.cfm?file=/path/to/my.pdf (or a
more suitable URL should you be using a framework, etc.)

In your 'processPdfRequest.cfm' or somewhere in your request cycle,
you can check access rights and file existence. Then, if all is good,
serve the file using cfcontent (again, unverified code):

cfheader name=Content-Disposition value=attachment;
filename=fileNameThatTheUserSees.pdf /!--- if you want it to force
download ---
cfcontent type='application/pdf' file='/server/path/to/my.pdf' /

HTH

Dominic








On 22 June 2011 16:12,   wrote:

  The CFML must be compiled in order for Java to execute it

 Sure, but actually I don't want to execute the file, nor compile it.
 Yhe file is actually a pdf file under .cfm extension.
 This is to force execution of an application.cfm first in which I check if 
 the user is authorized to open the file.
 If yes, the application.cfm returns the document with the correct name and 
 headers,
 if not, it returns an error message.
 This way, documents cannot be opened directely.

 I've been using this trick for years, until this morning a user loaded some 
 document containing by chance characters cf... in its binary part.
 This causes a compilation error, this is how I figured out that the document 
 was compiled prior application.cfm was called.

 I'm affraid I'll have to completely redesign my document retreiving system.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345562
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 In Claude's original question, it doesn't appear he's using CFCONTENT:

Yes I am.
Here is a summary of the code in application.cfm:
You can see that the requested file is never executed nor intended to.
The only purpose of the .cfm extension is to force the execution of the 
application.cfm
Here, the code in application.cfm is only used to count the nb of times each 
document was requested.
The advantages of the method are 1. simplicity, 2. it is compatible with 
previous documents uploaded with true .pdf and .doc extension prior we 
implemented this counting scheme.
The only problem which we didn't figure out at the time is that the template is 
compiled BEFORE application.cfm is called.
It could have been AFTER as well and CF would still work the same.
In pure logic, there is no use to compile a template before it is certain it 
will be executed.
There are other cases templates are compiled for nothing, ie:
application.cfm verifies a user is logged, if not, it CFLOCATIONs the user 
toward the loggin script, then the template he called is never executed.
CF could have very well been designed so that templates are compiled only if 
executed.
Now I know it is not the case.

!--- Get the document file name ---
CFQUERY NAME=getDoc DATASOURCE=#application.applicationName#
   SELECT docId,
 fileName,
 localName
   FROM docs
   WHERE localName = '#listLast(cgi.script_name, /)#'
/CFQUERY
CFIF getDoc.recordCount GT 0
CFIF fileExists(#application.webRootDir#contentDocuments\#GetDoc.localName#)
!--- count nb of time document was opened ---
CFQUERY DATASOURCE=#application.applicationName#
   UPDATE docs
 SET nblu = nblu+1
   WHERE docId = #getDoc.docId#
/CFQUERY

!--- send document to the reader ---
CFHEADER NAME=Content-disposition 
VALUE='Attachment;filename=#getDoc.fileName#'
CFHEADER NAME=Content-Type VALUE=application/octet-stream
CFCONTENT TYPE=application/octet-stream 
FILE=#application.webRootDir#contentDocuments\#GetDoc.localName#
CFABORT
CFELSE
CFSET error = This file doesn't exist
/CFIF
CFELSE
CFSET error = This file doesn't exist
/CFIF
CFIF error NEQ 
CENTERIMG SRC=../images/header.png
 WIDTH=790 HEIGHT=135 BORDER=0 ALT=
CFOUTPUTH2#erreur#/H2/CENTER/CFOUTPUT
/CFIF
CFABORT

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345570
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

You keep talking about templates being compiled, if there is an error as you
have mentioned this will stop the compile of the template and it will look
like it is being complied before the other.

I will say this again, the problem is not when it gets compiled but how you
are doing it.

And I will be honest you have far too much going on in the Application.cfm,
why not put that in the cfml template that pulls up the PDF in the first
place?

I will ask another question, is this application.cfm in the directory of the
template in question, or are you relying on the one in the root of the
application? Not that it matters, but might explain why you are doing what
you are doing with the counting of each request of the PDF.

But you really need to work out why it is trying to compile the PDF as a
CFML template, that is what the problem is and until you fix that you need
to forget about when and how it compiles the CFML template, because and
error is not going to compile anything.


Regards,
Andrew Scott
http://www.andyscott.id.au/



 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 11:04 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  In Claude's original question, it doesn't appear he's using CFCONTENT:
 
 Yes I am.
 Here is a summary of the code in application.cfm:
 You can see that the requested file is never executed nor intended to.
 The only purpose of the .cfm extension is to force the execution of the
 application.cfm Here, the code in application.cfm is only used to count
the nb
 of times each document was requested.
 The advantages of the method are 1. simplicity, 2. it is compatible with
 previous documents uploaded with true .pdf and .doc extension prior we
 implemented this counting scheme.
 The only problem which we didn't figure out at the time is that the
template
 is compiled BEFORE application.cfm is called.
 It could have been AFTER as well and CF would still work the same.
 In pure logic, there is no use to compile a template before it is certain
it will
 be executed.
 There are other cases templates are compiled for nothing, ie:
 application.cfm verifies a user is logged, if not, it CFLOCATIONs the
user
 toward the loggin script, then the template he called is never executed.
 CF could have very well been designed so that templates are compiled only
if
 executed.
 Now I know it is not the case.
 
 !--- Get the document file name ---
 CFQUERY NAME=getDoc
 DATASOURCE=#application.applicationName#
SELECT docId,
  fileName,
  localName
FROM docs
WHERE localName = '#listLast(cgi.script_name, /)#'
 /CFQUERY
 CFIF getDoc.recordCount GT 0
 CFIF
 fileExists(#application.webRootDir#contentDocuments\#GetDoc.localName
 #)
 !--- count nb of time document was opened --- CFQUERY
 DATASOURCE=#application.applicationName#
UPDATE docs
  SET nblu = nblu+1
WHERE docId = #getDoc.docId#
 /CFQUERY
 
 !--- send document to the reader ---
 CFHEADER NAME=Content-disposition
 VALUE='Attachment;filename=#getDoc.fileName#'
 CFHEADER NAME=Content-Type VALUE=application/octet-stream
 CFCONTENT TYPE=application/octet-stream
 FILE=#application.webRootDir#contentDocuments\#GetDoc.localName#
 CFABORT
 CFELSE
 CFSET error = This file doesn't exist /CFIF CFELSE CFSET error =
 This file doesn't exist /CFIF CFIF error NEQ  CENTERIMG
 SRC=../images/header.png
  WIDTH=790 HEIGHT=135 BORDER=0 ALT=
 CFOUTPUTH2#erreur#/H2/CENTER/CFOUTPUT
 /CFIF
 CFABORT
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345570
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345572
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 You keep talking about templates being compiled, if there is an error as you
have mentioned this will stop the compile of the template and it will look
like it is being complied before the other.


This is what happens indeed. There a compile error because the pdf file happens 
to contain some bytes that look like a CF tag, then it causes a compile error 
and the application.cfm is not even executed.
This is the first time it happens in about 10 years I've bee using this method.
I thought the template would never be compiled because of CFABORT in 
application.cfm, now I see it is not the case.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345573
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

Right, that means that there is a problem with the way your are trying to
deliver the PDF and why it is throwing an error.

Now if you are 100% confident that your PDF is being delivered by the
cfcontent tag, then it sounds like you may have come across a bug.

Feel free to ping me off list with your application.cfm and the template in
question and the PDF and I will have a look at it for you. And tell me which
version of ColdFusion you are trying to run this against.


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 11:29 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  You keep talking about templates being compiled, if there is an error
as
 you have mentioned this will stop the compile of the template and it will
look
 like it is being complied before the other.
 
 
 This is what happens indeed. There a compile error because the pdf file
 happens to contain some bytes that look like a CF tag, then it causes a
 compile error and the application.cfm is not even executed.
 This is the first time it happens in about 10 years I've bee using this
method.
 I thought the template would never be compiled because of CFABORT in
 application.cfm, now I see it is not the case.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345574
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 I will ask another question, is this application.cfm in the directory of the
template in question,

Yes, of course, and it include higher lever application.cfm

 But you really need to work out why it is trying to compile the PDF as a
CFML template,

Again, since application.cfm is to be executed prior the template specified in 
the url, and since the code in the application.cfm could redirect the request 
to another template, or simply abort the request, I thought the requested 
template would be compiled only after application.cfm execution and only if it 
was to be actually executed.
This would have been logical after all, but it is not the way it works: both 
application.cfm AND the template are compiled first, THEN application.cfm is 
executed.
It could have been that application is compiled and executed FIRST, then the 
template is compiled and executed if application passes control to it.
Since my application.cfm always terminates on a CFABORT, the requested template 
is NEVER executed, and there is no reason it should be compiled.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345575
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 Now if you are 100% confident that your PDF is being delivered by the
cfcontent tag, then it sounds like you may have come across a bug.

No, the pdf is not delivered in case of an error, since it is a compile error, 
no code is executed.
For years I've been using this trick, and no file even contained any occurrence 
of the string CF.
Note that any file containing anything except CF will pass through the CF 
compiler with no problem. It was the case for years.

And it is not a bug in CF if this is what you mean, is is just the way it works.
As I said, it could have been
1. compile application.cfm
2. execute application.cfm... and eventually abort here.
3. compile the requested template
4. execute it

It is rather
1. compile application.cfm AND the requested template
2. execute application.cfm... and eventually abort here.
4. execute the requested template

There may be a good reason I don't know to do things in that order, but it is 
certaily not pure logic.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345577
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Roger Austin

 This is the first time it happens in about 10 years I've bee using this 
 method.
 I thought the template would never be compiled because of CFABORT in 
 application.cfm, now I see it is not the case.

Since the problem has happened once in 10 years, I would try to open the PDF in 
Acrobat Pro 
and do a Save As while reducing the size or updating some of the tags. See if 
you can get the 
cf to go away in this one file. That might get you through this one issue 
long enough to 
plan a different file strategy.

--
LinkedIn: http://www.linkedin.com/pub/roger-austin/8/a4/60
Twitter:  http://twitter.com/RogerTheGeek


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345580
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

I think you don't understand, CF will try to compile the templates before
execution, provided there are no compile time errors. If there is it will
abort compiling the templates. And I believe and although I am not 100% sure
you will find that all files in the execution of that request are removed,
which is why you might be thinking what you are thinking.

Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 11:41 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  I will ask another question, is this application.cfm in the directory
of the
 template in question,
 
 Yes, of course, and it include higher lever application.cfm
 
  But you really need to work out why it is trying to compile the PDF as
a
 CFML template,
 
 Again, since application.cfm is to be executed prior the template
specified in
 the url, and since the code in the application.cfm could redirect the
request
 to another template, or simply abort the request, I thought the requested
 template would be compiled only after application.cfm execution and only
if
 it was to be actually executed.
 This would have been logical after all, but it is not the way it works:
both
 application.cfm AND the template are compiled first, THEN application.cfm
is
 executed.
 It could have been that application is compiled and executed FIRST, then
the
 template is compiled and executed if application passes control to it.
 Since my application.cfm always terminates on a CFABORT, the requested
 template is NEVER executed, and there is no reason it should be compiled.
 
 
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345575
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345581
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

Sorry I am bowing out now, you have a pre-conceived notion that it is to do
with the compilation of the template. You are not taking into consideration
that the PDF is the cause of this error, by your own admission and it has
nothing to do with where you are thinking it is, until you look away from
what you are thinking and go with what everyone has told you, will you be
able to fix this.

Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 11:41 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  I will ask another question, is this application.cfm in the directory
of the
 template in question,
 
 Yes, of course, and it include higher lever application.cfm
 
  But you really need to work out why it is trying to compile the PDF as
a
 CFML template,
 
 Again, since application.cfm is to be executed prior the template
specified in
 the url, and since the code in the application.cfm could redirect the
request
 to another template, or simply abort the request, I thought the requested
 template would be compiled only after application.cfm execution and only
if
 it was to be actually executed.
 This would have been logical after all, but it is not the way it works:
both
 application.cfm AND the template are compiled first, THEN application.cfm
is
 executed.
 It could have been that application is compiled and executed FIRST, then
the
 template is compiled and executed if application passes control to it.
 Since my application.cfm always terminates on a CFABORT, the requested
 template is NEVER executed, and there is no reason it should be compiled.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345582
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread Andrew Scott

So what you are now saying is that your method will not work, and you have
been lucky to this date to not run into it.

Until we see the code that delivers the PDF, you have to look at what is
causing the compile error. It has nothing to do with when one is compiled or
not, or what order it is compiled in. ColdFusion will always compile
application.cfm/application.cfc and then the template you are trying to run,
and onRequestEnd.cfm if you have it. It can't do it any other way, because
it has to know what variables might be defined in the application.cfm.

The problem that you can't comprehend is that you are wrong.

Like I said in another post, I give up trying to help you now. You have been
told to look at what is causing the error, the error is the PDF. You have
admitted that another PDF will work fine, so what makes your template and
this PDF crash with an excpetion, and stop compiling the code?

Now I know for a fact that Application.cfc/Application.cfm is the first
thing in the chain, it has to be executed before the template you are
calling, because if it didn't you can't access those variables that you
define in there, now can you?


Regards,
Andrew Scott
http://www.andyscott.id.au/


 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 11:50 PM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  Now if you are 100% confident that your PDF is being delivered by the
 cfcontent tag, then it sounds like you may have come across a bug.
 
 No, the pdf is not delivered in case of an error, since it is a compile
error, no
 code is executed.
 For years I've been using this trick, and no file even contained any
occurrence
 of the string CF.
 Note that any file containing anything except CF will pass through the
CF
 compiler with no problem. It was the case for years.
 
 And it is not a bug in CF if this is what you mean, is is just the way it
works.
 As I said, it could have been
 1. compile application.cfm
 2. execute application.cfm... and eventually abort here.
 3. compile the requested template
 4. execute it
 
 It is rather
 1. compile application.cfm AND the requested template 2. execute
 application.cfm... and eventually abort here.
 4. execute the requested template
 
 There may be a good reason I don't know to do things in that order, but it
is
 certaily not pure logic.
 
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345577
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345583
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 I think you don't understand,

I think you don't understand that I perfectly understand what's hapening:
Although I assumed the template (pdf file) should not be compiled since never 
executed,
it IS compiled. This causes the syntax error and stops execution.

 You are not taking into consideration
that the PDF is the cause of this error

I know perfectly that the pdf is causing the error. I told you this is because 
it contains a string like CF...
This is because of the order in which CF is compiling and executing templates.
My error was to assume that a template which is never to be executed would 
never be compiled,
which is kind of logical after all.
I see and I understand perfectly that it is not the way it works, that's it.

My question was is it possible to have CF compile a template requested in the 
url only if it is executed, so far the answer is no.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345584
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-23 Thread DURETTE, STEVEN J (ATTASIAIT)

I believe you are correct that the answer is no and that process seems 
perfectly logical and correct.

Here is how I see the process running... By the way this is not actual 
knowledge of the process, but how I've always assumed that the process occurred.

1) Request is received by web server and is passed to cf.
2) CF sees which page it needs and checks to see if there is a compiled version 
of the template in memory or a class file on disk.
3) If there is, happily run the compiled byte code in the appropriate order. 
cfabort!
4) If not, compile the template. If that template references any other 
templates check each of those for compiled versions, if not then compile those 
as well.
5) Process the now compiled files in the appropriate order.

The compiler and the executor are two different processes in CF. My guess is 
that the compiler takes lots of extra time and resources, so it does all its 
work before getting into the execution process.

However like I said before I don't know any of this for sure, it's just how I 
understand the process.

All that being said, unless there is a real need to futz with extensions, all 
extensions should match their filetype. PDF should be .pdf, Excel should be 
.xls, etc. In general it makes life a lot easier.

Steve

snip
My question was is it possible to have CF compile a template requested in the 
url only if it is executed, so far the answer is no.
/snip

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345588
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Claude Schnéegans

 My guess is that the compiler takes lots of extra time and resources, so it 
 does all its work before getting into the execution process.

May be, however it will also compile some files for nothing, ie: included files 
actually not included at execution... which represents an extra overhead.
There is even a drawback that can even be condidered as a bug (don't know if it 
is still there in CF 9) : duplicate functions defined in two diferent includes 
although only one template is included at execution.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345590
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-23 Thread Russ Michaels

wow this has dragged on a bit.

I think perhaps the point is being missed, so let me have a go for you.

The pdf file is never normally  executed, so therefore you believe it should
never be compiled either, which is a correct assumption if you are just
delivering the file with with CFCONTENT, as it should never be touched with
the cfcompiler.
However i'm sure you said earlier that the reason for the problem was
because someone was directly trying to access the file, in which case CF
will of course try to compile and execute it as this is how cf works, and
this is the only reason you have not had this problem before is because
no-one has previously tried to link to the .pdf.cfm file.

As Andrew has explained to you, JRUN will try to compile all the files
within a request first before it executes anything, as it cannot execute
CFML, only class files, regardless of whether the application.cfm is
executed first or not.

So the only way to avoid this is to make sure the .pdf.cfm file cannot be
linked to directly, and you have been given several ways to achieve this.

Russ


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345592
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


application.cfm

2011-06-22 Thread Claude Schnéegans

Hi,

I've noticed that application.cfm is indeed run before the template called in 
the url, but the template itself is compiled BEFORE application.cfm is called.
I need to have the ability in application.cfm to run some code and NOT compile 
the template.

Is it possible ?
CF 9

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345522
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Russ Michaels

The CFML must be compiled in order for Java to execute it
You can however stop the class file being generated so that it is compiled
to memory only.

In the CFADMIN under caching settings - *Save class files*

Russ

On Wed, Jun 22, 2011 at 3:33 PM,  wrote:


 Hi,

 I've noticed that application.cfm is indeed run before the template called
 in the url, but the template itself is compiled BEFORE application.cfm is
 called.
 I need to have the ability in application.cfm to run some code and NOT
 compile the template.

 Is it possible ?
 CF 9

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345523
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Nathan Strutz

First, I will say that this is a strange request, and chances are, you're
doing something wrong. Compile errors mean that there was more than an
error, it's that the template has serious problems that the CFML compiler
couldn't parse. The fact that you still want one page to execute and another
to not compile is weird, strange, odd. I can't think of a logical case for
this, and would love to hear it if you have one.

That said, you should be able to do this with an Application.cfc file
instead of Application.cfm. Make an onRequest method, which will compile and
run that function, then from there you cfinclude the requested template,
which should be compiled only when execution reaches that include.

I always use Ray's Application.cfc reference, for reference:
http://www.coldfusionjedi.com/downloads/application.cfc.txt

nathan strutz
[www.dopefly.com] [hi.im/nathanstrutz] [about.me/nathanstrutz]


On Wed, Jun 22, 2011 at 7:33 AM,  wrote:


 Hi,

 I've noticed that application.cfm is indeed run before the template called
 in the url, but the template itself is compiled BEFORE application.cfm is
 called.
 I need to have the ability in application.cfm to run some code and NOT
 compile the template.

 Is it possible ?
 CF 9

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345524
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 The CFML must be compiled in order for Java to execute it

Sure, but actually I don't want to execute the file, nor compile it.
Yhe file is actually a pdf file under .cfm extension.
This is to force execution of an application.cfm first in which I check if the 
user is authorized to open the file.
If yes, the application.cfm returns the document with the correct name and 
headers,
if not, it returns an error message.
This way, documents cannot be opened directely.

I've been using this trick for years, until this morning a user loaded some 
document containing by chance characters cf... in its binary part.
This causes a compilation error, this is how I figured out that the document 
was compiled prior application.cfm was called.

I'm affraid I'll have to completely redesign my document retreiving system.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345525
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-22 Thread Andrew Scott

Do you mind me asking what need would require this? I am struggling to even
think of one.


Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 12:33 AM
 To: cf-talk
 Subject: application.cfm
 
 
 Hi,
 
 I've noticed that application.cfm is indeed run before the template called
in
 the url, but the template itself is compiled BEFORE application.cfm is
called.
 I need to have the ability in application.cfm to run some code and NOT
 compile the template.
 
 Is it possible ?
 CF 9
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345526
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 I can't think of a logical case for
this, and would love to hear it if you have one.

Please see my othe reply.
When an administrator uploads some document ie: myDoc.pdf, it is stored as 
myDoc.pdf.cfm
When a user tries to open directly myDoc.pdf.cfm in the url, the document is 
protected by some code in application.cfm
I never want to have the document compiled.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345527
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Russ Michaels

A better way to achieve what you want is to password protect certain folders
on your site so that the files cannot be access until a user has logged in.
Using CF to do this only works to secure cfm files, so if you want to secure
PDF's and the likes then simply use .htaccess files instead. This is native
to Apache and can be done on IIS using Helicon APE.
Once the user is authenticated via the .htaccess you can capture the
username to CF for further granular control.

Using only CF and not .htaccess the usual method to secure files is to store
them outside the webroot and use CFCONTENT to deliver them to authenticated
users. This however does have issues as it can easily result it hung native
java requests if the file fails to download for any reason or the user
closes his browser, which means CF needs restarting in order to free up that
hung request. Once you reach your max number of concurrent requests then CF
will stop processing.

HTH

Russ

On Wed, Jun 22, 2011 at 4:10 PM, Andrew Scott andr...@andyscott.id.auwrote:


 Do you mind me asking what need would require this? I am struggling to even
 think of one.


 Regards,
 Andrew Scott
 http://www.andyscott.id.au/




  -Original Message-
  From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
  8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
  1?Q?ue.com=3E?=]
  Sent: Thursday, 23 June 2011 12:33 AM
  To: cf-talk
  Subject: application.cfm
 
 
  Hi,
 
  I've noticed that application.cfm is indeed run before the template
 called
 in
  the url, but the template itself is compiled BEFORE application.cfm is
 called.
  I need to have the ability in application.cfm to run some code and NOT
  compile the template.
 
  Is it possible ?
  CF 9
 


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345528
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-22 Thread Andrew Scott

Actually I disagree with what you are saying here, first I would not be
putting the authentication in the Application.cfm and instead look at
securing it some other way. But that is not your issue.

The issue is that you are trying to run a template that will throw an error,
nothing that I can think of from the top of my head will ever get around
that.

Your best option would be to use the template in question with url
parameters with the name of the file. Then in that template check the
authentication and then pass the name of the PDF and use cfcontent to
actually load a PDF back to the browser. Your method is just asking for more
headaches like this.

But I am at a loss to explain how a PDF is going to throw a CF Exception
error, when using cfcontent to deliver the file it should not be trying to
compile that content.


Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 1:12 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  The CFML must be compiled in order for Java to execute it
 
 Sure, but actually I don't want to execute the file, nor compile it.
 Yhe file is actually a pdf file under .cfm extension.
 This is to force execution of an application.cfm first in which I check if
the
 user is authorized to open the file.
 If yes, the application.cfm returns the document with the correct name and
 headers, if not, it returns an error message.
 This way, documents cannot be opened directely.
 
 I've been using this trick for years, until this morning a user loaded
some
 document containing by chance characters cf... in its binary part.
 This causes a compilation error, this is how I figured out that the
document
 was compiled prior application.cfm was called.
 
 I'm affraid I'll have to completely redesign my document retreiving
system.
 
 ~~
 ~~~|
 Order the Adobe Coldfusion Anthology now!
 http://www.amazon.com/Adobe-Coldfusion-
 Anthology/dp/1430272155/?tag=houseoffusion
 Archive: http://www.houseoffusion.com/groups/cf-
 talk/message.cfm/messageid:345525
 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
 Unsubscribe: http://www.houseoffusion.com/groups/cf-
 talk/unsubscribe.cfm


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345529
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 But I am at a loss to explain how a PDF is going to throw a CF Exception
error, when using cfcontent to deliver the file it should not be trying to
compile that content.

The error is not thrown using cfcontent, but simply when CF compiles the file 
when the HTTP request is received, before even executing application.cfm
In my mind, application.cfm was called first, then the template compiled and 
run.
Apparently, both application.cfm and the template are compiled first, then 
executed.
This means that if application.cfm does not let the template to be executed, it 
is compiled for nothing.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345531
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 A better way to achieve what you want is to password protect certain folders
on your site

I never use authentication on the server.
Only through CF, since the administrators of my CMS can add/edit their own 
users, sometime 1000s of members.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345532
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-22 Thread DURETTE, STEVEN J (ATTASIAIT)

This is because you are actually saving a pdf file as a .cfm.  Maybe you should 
save it under a different extension, then have a page that serves it up using 
cfcontent.


-Original Message-
From: =?ISO-8859-1?Q?Claude_Schn=E9egans 
[mailto:schneegans@interneti=71?=.=?ISO-8859-1?Q?ue.com=3E?=] 
Sent: Wednesday, June 22, 2011 11:41 AM
To: cf-talk
Subject: Re: application.cfm


 But I am at a loss to explain how a PDF is going to throw a CF Exception
error, when using cfcontent to deliver the file it should not be trying to
compile that content.

The error is not thrown using cfcontent, but simply when CF compiles the file 
when the HTTP request is received, before even executing application.cfm
In my mind, application.cfm was called first, then the template compiled and 
run.
Apparently, both application.cfm and the template are compiled first, then 
executed.
This means that if application.cfm does not let the template to be executed, it 
is compiled for nothing.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345533
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Azadi Saryev

store your pdf files outside of web root so they are not directly 
accessible.
serve them via an intermediary .cfm page, passing it the name of the pdf 
file, which checks user's access rights to requested pdf and serves the 
file or shows an error.

Azadi

On 22/06/2011 22:33 , =?ISO-8859-1?Q?Claude_Schn=E9egans wrote:
 Hi,

 I've noticed that application.cfm is indeed run before the template called in 
 the url, but the template itself is compiled BEFORE application.cfm is called.
 I need to have the ability in application.cfm to run some code and NOT 
 compile the template.

 Is it possible ?
 CF 9

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345534
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Russ Michaels

The admin can still edit users, even 1000's



On Wed, Jun 22, 2011 at 4:43 PM,  wrote:


  A better way to achieve what you want is to password protect certain
 folders
 on your site

 I never use authentication on the server.
 Only through CF, since the administrators of my CMS can add/edit their own
 users, sometime 1000s of members.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345535
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Rex

Hi Claude,

I agree to both Steven and Azadi's solution.

Sorry Claude, but yes, you will have to rewrite your system.  The 
trick you are using is a security risk.  Someone can rename a CFM file 
to a PDF file and upload it.  Now that CFM code can be executed on the 
server.

It shouldn't be that hard to do, since you are already serving up the 
PDF via cfcontent anyway.  Just change where you store your files.

- Rex

On 6/22/2011 8:47 AM, Azadi Saryev wrote:
 store your pdf files outside of web root so they are not directly
 accessible.
 serve them via an intermediary .cfm page, passing it the name of the pdf
 file, which checks user's access rights to requested pdf and serves the
 file or shows an error.

 Azadi

 On 22/06/2011 22:33 , =?ISO-8859-1?Q?Claude_Schn=E9egans wrote:
 Hi,

 I've noticed that application.cfm is indeed run before the template called 
 in the url, but the template itself is compiled BEFORE application.cfm is 
 called.
 I need to have the ability in application.cfm to run some code and NOT 
 compile the template.

 Is it possible ?
 CF 9


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345536
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 The admin can still edit users, even 1000's

Which admin? Window's or CF?

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345540
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 I agree to both Steven and Azadi's solution.

Of course I know this solution. I thought I had a simpler one.

 Someone can rename a CFM file
to a PDF file and upload it.  Now that CFM code can be executed on the
server.

No way. Even if the pseudo pdf file actually contains CFML code, it cannot be 
executed.
At best, the file will be sent as a pdf file by CFCONTENT then application.cfm 
CFABORTs
Furthermore, only the customer, who has paid for his system, is able to upload 
files.
I doubt he ever attemps to sabotage his own system.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345541
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Russ Michaels

the admin of your CMS

On Wed, Jun 22, 2011 at 7:48 PM,  wrote:


  The admin can still edit users, even 1000's

 Which admin? Window's or CF?

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345542
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Claude Schnéegans

 the admin of your CMS

Of course, this is the way it works, but you were talking about password 
protect certain folders.
I don't see how this can be done by CF code when files other than .cfm or .cfc 
are requested by HTTP and the CF server is not even invoked.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345545
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: application.cfm

2011-06-22 Thread Russ Michaels

It is pretty simple.

use CFFILE to read the .htaccess file
add a new user
use CFFILE to write the .htaccess file

User logs in, when he is authenticated, his credentials are available in the
CGI scope for you to use via CFML.

As I said, on Apache this is native, on IIS you can use Helicon APE (which
probably has an API as well).


Russ


On Wed, Jun 22, 2011 at 8:08 PM,  wrote:


  the admin of your CMS

 Of course, this is the way it works, but you were talking about password
 protect certain folders.
 I don't see how this can be done by CF code when files other than .cfm or
 .cfc are requested by HTTP and the CF server is not even invoked.


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345547
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: application.cfm

2011-06-22 Thread Andrew Scott

CF should not be compiling anything that is not CFML, if it is this actually
happening then it sounds like a bug in CF.

Regards,
Andrew Scott
http://www.andyscott.id.au/




 -Original Message-
 From: Claude Schnéegans schneeg...@internetique.com [mailto:=?ISO-
 8859-1?Q?Claude_Schn=E9egans schneegans@interneti=71?= =?ISO-8859-
 1?Q?ue.com=3E?=]
 Sent: Thursday, 23 June 2011 1:41 AM
 To: cf-talk
 Subject: Re: application.cfm
 
 
  But I am at a loss to explain how a PDF is going to throw a CF
Exception
 error, when using cfcontent to deliver the file it should not be trying to
 compile that content.
 
 The error is not thrown using cfcontent, but simply when CF compiles the
file
 when the HTTP request is received, before even executing application.cfm
In
 my mind, application.cfm was called first, then the template compiled and
 run.
 Apparently, both application.cfm and the template are compiled first, then
 executed.
 This means that if application.cfm does not let the template to be
executed,
 it is compiled for nothing.
 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345552
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


  1   2   3   4   5   6   7   8   9   10   >