CF datediff to SQL datediff

2012-02-08 Thread Akos Fortagh

Wondering if anyone might be able to help with this.
I have products in the db that have offerStart and offerEnd dates and according 
to today's date they are on offer today or not, so the following works great 
when individually looking at the products and CF does the work:
cfset today = #DateFormat(Now(),'-mm-dd')#
cfif dateDiff(d, offerStart, today) GTE 0 AND dateDiff(d, today, offerEnd) 
GTE 0
cfset OnOffer = True
cfelse
cfset OnOffer = False
/cfif

but now I need to output ALL products in one huge list(well I'll break them 
down into pages) and show which one is on offer so I thought SQL should do the 
work.  How could I 'translate' the above CF into SQL?
Any help would be greatly appreciated. 

~|
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:349820
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Required folders under CFIDE

2012-02-08 Thread IT (Pradeep Viswanathan)

I am currently setting up a new server where my CFIDE is compeletely not 
exposed - it actually runs on a different web server/port.

I would want to copy the folders that are essential from the CFIDE folder to 
make the AJAX /others cftags to work, can someone please tell me what folders 
will be required.

I see that scripts folder is required?

Thx  rgds,
Pradeep Viswanathan R



DISCLAIMER:
This e-mail message including any of its attachments is intended solely for 
the addressee(s) and may contain privileged information. If you are not the 
addressee or you have received this email message in error, please notify the 
sender who will remove your details from its database. You are not authorized 
to read, copy, disseminate, distribute or use this e-mail message or any 
attachment to it in any manner and must delete the email and destroy any hard 
copies of it. 
This e-mail message does not contain financial instructions or commitments of 
any kind. Any views expressed in this message are those of the individual 
sender and do not necessarily reflect the views of Emirates NBD PJSC, or any 
other related subsidiaries, entities or persons.


~|
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:349821
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Required folders under CFIDE

2012-02-08 Thread Russ Michaels

just remove the administrator,serverManager, and adminapi folders

On Wed, Feb 8, 2012 at 3:04 PM, IT (Pradeep Viswanathan) 
prade...@emiratesnbd.com wrote:


 I am currently setting up a new server where my CFIDE is compeletely not
 exposed - it actually runs on a different web server/port.

 I would want to copy the folders that are essential from the CFIDE folder
 to make the AJAX /others cftags to work, can someone please tell me what
 folders will be required.

 I see that scripts folder is required?

 Thx  rgds,
 Pradeep Viswanathan R



 DISCLAIMER:
 This e-mail message including any of its attachments is intended solely
 for the addressee(s) and may contain privileged information. If you are not
 the addressee or you have received this email message in error, please
 notify the sender who will remove your details from its database. You are
 not authorized to read, copy, disseminate, distribute or use this e-mail
 message or any attachment to it in any manner and must delete the email and
 destroy any hard copies of it.
 This e-mail message does not contain financial instructions or commitments
 of any kind. Any views expressed in this message are those of the
 individual sender and do not necessarily reflect the views of Emirates NBD
 PJSC, or any other related subsidiaries, entities or persons.


 

~|
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:349822
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Required folders under CFIDE

2012-02-08 Thread IT (Pradeep Viswanathan)

Ok just browsed throw the folders, makes sense. Thanks russ

Thx  rgds,
Pradeep Viswanathan R 
Consultant - Group Applications | IT Enterprise Applications - Emirates NBD| 
Tel: +971 4 372 6858 | Mob: +971 55 3378256 


-Original Message-
From: Russ Michaels [mailto:r...@michaels.me.uk] 
Sent: Wednesday, February 08, 2012 7:11 PM
To: cf-talk
Subject: Re: Required folders under CFIDE


just remove the administrator,serverManager, and adminapi folders

On Wed, Feb 8, 2012 at 3:04 PM, IT (Pradeep Viswanathan) 
prade...@emiratesnbd.com wrote:


 I am currently setting up a new server where my CFIDE is compeletely not
 exposed - it actually runs on a different web server/port.

 I would want to copy the folders that are essential from the CFIDE folder
 to make the AJAX /others cftags to work, can someone please tell me what
 folders will be required.

 I see that scripts folder is required?

 Thx  rgds,
 Pradeep Viswanathan R



 DISCLAIMER:
 This e-mail message including any of its attachments is intended solely
 for the addressee(s) and may contain privileged information. If you are not
 the addressee or you have received this email message in error, please
 notify the sender who will remove your details from its database. You are
 not authorized to read, copy, disseminate, distribute or use this e-mail
 message or any attachment to it in any manner and must delete the email and
 destroy any hard copies of it.
 This e-mail message does not contain financial instructions or commitments
 of any kind. Any views expressed in this message are those of the
 individual sender and do not necessarily reflect the views of Emirates NBD
 PJSC, or any other related subsidiaries, entities or persons.


 



~|
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:349823
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: CF datediff to SQL datediff

2012-02-08 Thread Rick Faircloth

What database are you using?

-Original Message-
From: Akos Fortagh [mailto:akos.fort...@yahoo.com] 
Sent: Wednesday, February 08, 2012 9:52 AM
To: cf-talk
Subject: CF datediff to SQL datediff


Wondering if anyone might be able to help with this.
I have products in the db that have offerStart and offerEnd dates and
according to today's date they are on offer today or not, so the following
works great when individually looking at the products and CF does the work:
cfset today = #DateFormat(Now(),'-mm-dd')#
cfif dateDiff(d, offerStart, today) GTE 0 AND dateDiff(d, today,
offerEnd) GTE 0
cfset OnOffer = True
cfelse
cfset OnOffer = False
/cfif

but now I need to output ALL products in one huge list(well I'll break them
down into pages) and show which one is on offer so I thought SQL should do
the work.  How could I 'translate' the above CF into SQL?
Any help would be greatly appreciated. 



~|
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:349824
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CF datediff to SQL datediff

2012-02-08 Thread Akos Fortagh

thanks for the reply, I'm using mySQL 

~|
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:349825
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: [5] RE: cfspreadsheet issue when reads dates from spreadsheet

2012-02-08 Thread Hong Chen

I used  SpreadSheetRead to read the spreadsheet into memory and used
SpreadsheetFormatColumns to format the dob column, then used cfspreadsheet
to write a new spreadsheet, last step, I read the new spreadsheet into a
query to insert to DB. It was successful, but hope there is a simple way to
do it. Thanks.

-Original Message-
From: Leigh [mailto:cfsearch...@yahoo.com] 
Sent: Tuesday, February 07, 2012 9:11 PM
To: cf-talk
Subject: Re: [5] RE: cfspreadsheet issue when reads dates from spreadsheet


 If I manually format the column, it still reads yy. 


I am betting Excel is still registering the cell format as m/d/yy.  Try
using m/d/;@


 How can I programmatically format it before it reads the spreadsheet?
I do not think you can convert a spreadsheet object into a query directly.
If not, use SpreadSheetRead to load the spreadsheet into memory.  Format the
column. Then write it back to disk. 

 
-Lei



~|
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:349826
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CF datediff to SQL datediff

2012-02-08 Thread Leigh

MySQL does support dateDiff. But you could also use a simple date comparison 
instead. Return  one (1) if the item is on offer today, or zero (0) if it is 
not.

 
SELECT   
CASE WHEN offerStart = curDate() AND offerEnd = curDate() THEN 1 ELSE 0 END 
AS IsOnOffer


~|
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:349827
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: CF datediff to SQL datediff

2012-02-08 Thread Rick Faircloth

In MySQL you can use between for finding dates that are
after the first date and earlier than the second date.

If you've got the first date and second date in MySQL
columns you can use:

where currentDate between offerStartDate and offerEndDate

Try working something like that into your SQL...

Rick

-Original Message-
From: Akos Fortagh [mailto:akos.fort...@yahoo.com] 
Sent: Wednesday, February 08, 2012 11:05 AM
To: cf-talk
Subject: Re: CF datediff to SQL datediff


thanks for the reply, I'm using mySQL 



~|
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:349828
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: [5] RE: cfspreadsheet issue when reads dates from spreadsheet

2012-02-08 Thread Leigh

 It was successful, but hope there is a simple way to do it. 


Unfortunately, I think that is as simple as it gets. AFAIK, CF does not let you 
specify the formatting of query values. It always uses the cell format 
information.  

 
-Lei

~|
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:349829
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CF datediff to SQL datediff

2012-02-08 Thread Leigh

 where currentDate between offerStartDate and offerEndDate

Hm .. I may have misunderstood. If the goal is to retrieve *only* items that 
are on special, go with Rick's suggestion. 

 
-Leigh

~|
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:349830
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: [5] RE: cfspreadsheet issue when reads dates from spreadsheet

2012-02-08 Thread Hong Chen

I was thinking there were extra read and write action... Anyway my problem
resolved now. Thanks for your help. 

-Original Message-
From: Leigh [mailto:cfsearch...@yahoo.com] 
Sent: Wednesday, February 08, 2012 11:56 AM
To: cf-talk
Subject: Re: [5] RE: cfspreadsheet issue when reads dates from spreadsheet


 It was successful, but hope there is a simple way to do it. 


Unfortunately, I think that is as simple as it gets. AFAIK, CF does not let
you specify the formatting of query values. It always uses the cell format
information.  

 
-Lei



~|
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:349831
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: contentsubtype issue

2012-02-08 Thread Imperial, Bob

Well so much for that, apparently not related as I tested this same thing on a 
local box that didn't have the hotfix with the same result. These machines are 
all on the University Network so I suspect it's something that might have been 
pushed out via a policy somewhere. sigh Thanks for the tip though.

Bob 

-Original Message-
From: Russ Michaels [mailto:r...@michaels.me.uk] 
Sent: Tuesday, February 07, 2012 8:54 PM
To: cf-talk
Subject: Re: contentsubtype issue


it could be something to do with  commons-fileupload-1.2.jar which was updated 
in that hotfix.
you could try rolling this back to previous version and see if that helps.



~|
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:349832
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


PDF merge

2012-02-08 Thread Eric Roberts

We are getting an error with a pdf merge using cfx_pdf (java custom tag) on
CF7 (The error states that an array is out of bounds).  This is involving a
e-signature process where the vendor that handles the e-sigs got their PDFs
certified with Adobe and this broke our process.  Prior to the
certification, everything worked fine.  The only other difference is that
the server that this is broken on is a stand alone CF installation, while
the others, which are working, are multi-instance (I am not sure that this
can cause an issue or not).

 

We are out of ideas.any suggestions?

 

Thanks!

Eric



~|
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:349833
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CF datediff to SQL datediff

2012-02-08 Thread Akos Fortagh

thank you all for the suggestions, really helpful 

~|
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:349834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread daniel kessler

I added this to my component, but I'm getting an error while calling it from 
within the component.

cfcomponent hint=Replaces The Package PK_employer

cffunction name=cf_abort output=false returntype=void
 cfabort /
/cffunction

cffunction name=cf_dump output=false returntype=void
 cfargument name=objToDump type=any required=false default= /

 cfdump var=#arguments.objToDump# /
/cffunction


Then further down, I call the cf_dump, like 
cf_dump(dbResult);

How do I implement this correctly?

Thank you for your assistance.


~|
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:349835
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread daniel kessler

To clarify, I receive an error when these function calls are used and no error 
when they're commented out.
---
Invalid CFML construct found on line 78 at column 33.
ColdFusion was looking at the following text:

else

The CFML compiler was processing:

a script statement beginning with { on line 63, column 39.
a script statement beginning with if on line 63, column 17.
a cfscript tag beginning on line 52, column 18.
a cfscript tag beginning on line 52, column 18.

 
The error occurred in C:\localServer\beatch\cfc\emp.cfc: line 78

76 : //cf_dump(dbResult);
77 : cf_abort;
78 :else
79 :request.inStruct.beatch_id = ;

80 :

~|
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:349836
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread Matt Quackenbush

First off, this is a nearly 4 year old thread. It may or may not apply to
what you're working on now.

What CFML engine and version are you using?

What is the relevant code?


On Wed, Feb 8, 2012 at 1:24 PM, daniel kessler dani...@umd.edu wrote:


 To clarify, I receive an error when these function calls are used and no
 error when they're commented out.
 ---
 Invalid CFML construct found on line 78 at column 33.
 ColdFusion was looking at the following text:

 else

 The CFML compiler was processing:

a script statement beginning with { on line 63, column 39.
a script statement beginning with if on line 63, column 17.
a cfscript tag beginning on line 52, column 18.
a cfscript tag beginning on line 52, column 18.


 The error occurred in C:\localServer\beatch\cfc\emp.cfc: line 78

 76 : //cf_dump(dbResult);
 77 : cf_abort;
 78 :else
 79 :request.inStruct.beatch_id = ;
 80 :

 

~|
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:349837
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread daniel kessler

First off, this is a nearly 4 year old thread. It may or may not apply to
what you're working on now.

What CFML engine and version are you using?

What is the relevant code?


I didn't think reposting was a good idea, since there was a thread with a 
relevant history.
I'm using CF7.

I posted the relevant code: part of the component, the cfabort/dump code, and 
my call.  Is there more code that you would like? 

~|
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:349838
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread Matt Quackenbush

The error code mentions Line 63 as the start of an if () statement, and
Line 52 as the start of the cfscript tag. We'll need probably the entire
if () block at the least, as it would seem the issue lies in there.

Hard to speculate based solely upon the error message, as CF is notorious
for providing rather cryptic error messages which often send one off
chasing ghosts.

On Wed, Feb 8, 2012 at 1:37 PM, daniel kessler dani...@umd.edu wrote:


 First off, this is a nearly 4 year old thread. It may or may not apply to
 what you're working on now.
 
 What CFML engine and version are you using?
 
 What is the relevant code?


 I didn't think reposting was a good idea, since there was a thread with a
 relevant history.
 I'm using CF7.

 I posted the relevant code: part of the component, the cfabort/dump code,
 and my call.  Is there more code that you would like?

 

~|
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:349839
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread daniel kessler

The error code mentions Line 63 as the start of an if () statement, and
Line 52 as the start of the cfscript tag. We'll need probably the entire
if () block at the least, as it would seem the issue lies in there.

Hard to speculate based solely upon the error message, as CF is notorious
for providing rather cryptic error messages which often send one off
chasing ghosts.

In this case, it is reporting loosely.  If I comment out the cf_abort, there is 
no error.  So it has a problem with the cf_abort.  That being a problem, messes 
with the next line, the else.  Since the else is part of the IF, it complains 
about the whole IF.  Really, it's complaining about the cf_abort, like it 
doesn't know what it is.

However, the IF is several hundred lines long.  Here's the relevant part up to 
the 'else' that works fine with the cf_abort commented out:

if (len(arguments.inStruct.a_agent_first_name) gt 0 OR 
len(arguments.inStruct.a_agent_middle_initial) gt 0 OR 
len(arguments.inStruct.a_agent_last_name) gt 0 OR
   len(arguments.inStruct.a_agent_firm_ein) gt 
0 OR len(arguments.inStruct.a_agent_firm_name) gt 0 OR 
len(arguments.inStruct.a_agent_phone) gt 0 OR
   len(arguments.inStruct.a_agent_phone_ext) gt 
0 OR len(arguments.inStruct.a_agent_address_1) gt 0 OR 
len(arguments.inStruct.a_agent_address_2) gt 0 OR
   len(arguments.inStruct.a_agent_city) gt 0 OR 
len(arguments.inStruct.a_agent_state_id) gt 0 OR 
len(arguments.inStruct.a_agent_province) gt 0 OR
   len(arguments.inStruct.a_agent_country_id) 
gt 0 OR len(arguments.inStruct.a_agent_postal_code) gt 0 OR 
len(arguments.inStruct.a_agent_email) gt 0)
{
dbResult = 
request.oEmployer.Ins_Agent_Tbl(arguments.inStruct);
if (dbResult eq 0,)
request.inStruct.l_agent_id = 
listGetAt(dbResult,2);
else
request.inStruct.l_agent_id = 
;
}
 //cf_dump(dbResult);
   cf_abort;
else
request.inStruct.l_agent_id = ;   



~|
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:349840
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Accessing the Application Scope of another App

2012-02-08 Thread Brook Davies

Hi,

Can you guys tell me if this is bad practice or will lead to memory issues.
I have a CF app that has the main app and an admin module, each with their
own cfapplication, and application namepace. From within the admin app I
need to clear some application scoped data in the main app. 

I do something like this:

cffunction..

cfif application.applicationName is  COREAPP
cfset local.appScopeReference = application
cfelse
cfset local.appScopeReference =
createObject(java,coldfusion.runtime.ApplicationScopeTracker)
..getApplicationScope('COREAPP')
/cfif

cflock scope=application type=exclusive
  cfset structDelete(local.appScopeReference,'somekey')
/cflock

/cffunction

Is there gonna be an issues with dumping the app scope into a local variable
like this? Or something else?

Brook 




~|
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:349841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread Matt Quackenbush

Looks like the issue is that you have the cf_dump() and cf_abort() calls
outside of the curly braces.

if ( // all those items )
{
// stuff here
}
cf_dump(dbResult);
cf_abort();
else
// other stuff

You need to move those two items inside of the }.

HTH


On Wed, Feb 8, 2012 at 2:05 PM, daniel kessler dani...@umd.edu wrote:


 The error code mentions Line 63 as the start of an if () statement, and
 Line 52 as the start of the cfscript tag. We'll need probably the entire
 if () block at the least, as it would seem the issue lies in there.
 
 Hard to speculate based solely upon the error message, as CF is notorious
 for providing rather cryptic error messages which often send one off
 chasing ghosts.

 In this case, it is reporting loosely.  If I comment out the cf_abort,
 there is no error.  So it has a problem with the cf_abort.  That being a
 problem, messes with the next line, the else.  Since the else is part of
 the IF, it complains about the whole IF.  Really, it's complaining about
 the cf_abort, like it doesn't know what it is.

 However, the IF is several hundred lines long.  Here's the relevant part
 up to the 'else' that works fine with the cf_abort commented out:

 if (len(arguments.inStruct.a_agent_first_name) gt 0 OR
 len(arguments.inStruct.a_agent_middle_initial) gt 0 OR
 len(arguments.inStruct.a_agent_last_name) gt 0 OR
   len(arguments.inStruct.a_agent_firm_ein)
 gt 0 OR len(arguments.inStruct.a_agent_firm_name) gt 0 OR
 len(arguments.inStruct.a_agent_phone) gt 0 OR

 len(arguments.inStruct.a_agent_phone_ext) gt 0 OR
 len(arguments.inStruct.a_agent_address_1) gt 0 OR
 len(arguments.inStruct.a_agent_address_2) gt 0 OR
   len(arguments.inStruct.a_agent_city) gt
 0 OR len(arguments.inStruct.a_agent_state_id) gt 0 OR
 len(arguments.inStruct.a_agent_province) gt 0 OR

 len(arguments.inStruct.a_agent_country_id) gt 0 OR
 len(arguments.inStruct.a_agent_postal_code) gt 0 OR
 len(arguments.inStruct.a_agent_email) gt 0)
{
dbResult =
 request.oEmployer.Ins_Agent_Tbl(arguments.inStruct);
if (dbResult eq 0,)
request.inStruct.l_agent_id
 = listGetAt(dbResult,2);
else
request.inStruct.l_agent_id
 = ;
}
 //cf_dump(dbResult);
   cf_abort;
else
request.inStruct.l_agent_id = ;


 

~|
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:349842
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Accessing the Application Scope of another App

2012-02-08 Thread James Holmes

Did you know you can just write a new cfapplication tag to swap to the
other app, delete the key and then swap back again with a subsequent
cfapplication tag?

--
Shu Ha Ri: Agile and .NET blog
http://www.bifrost.com.au/


On 9 February 2012 04:13, Brook Davies cft...@logiforms.com wrote:


 Hi,

 Can you guys tell me if this is bad practice or will lead to memory issues.
 I have a CF app that has the main app and an admin module, each with their
 own cfapplication, and application namepace. From within the admin app I
 need to clear some application scoped data in the main app.



~|
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:349843
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: debugging in cfscript

2012-02-08 Thread Azadi Saryev

you have cf_abort in your code instead of cf_abort()

On Thu, Feb 9, 2012 at 04:20, Matt Quackenbush quackfu...@gmail.com wrote:

 Looks like the issue is that you have the cf_dump() and cf_abort() calls
 outside of the curly braces.

 if ( // all those items )
 {
    // stuff here
 }
    cf_dump(dbResult);
    cf_abort();
 else
    // other stuff

 You need to move those two items inside of the }.

 HTH


 On Wed, Feb 8, 2012 at 2:05 PM, daniel kessler dani...@umd.edu wrote:


 The error code mentions Line 63 as the start of an if () statement, and
 Line 52 as the start of the cfscript tag. We'll need probably the entire
 if () block at the least, as it would seem the issue lies in there.
 
 Hard to speculate based solely upon the error message, as CF is notorious
 for providing rather cryptic error messages which often send one off
 chasing ghosts.

 In this case, it is reporting loosely.  If I comment out the cf_abort,
 there is no error.  So it has a problem with the cf_abort.  That being a
 problem, messes with the next line, the else.  Since the else is part of
 the IF, it complains about the whole IF.  Really, it's complaining about
 the cf_abort, like it doesn't know what it is.

 However, the IF is several hundred lines long.  Here's the relevant part
 up to the 'else' that works fine with the cf_abort commented out:

 if (len(arguments.inStruct.a_agent_first_name) gt 0 OR
 len(arguments.inStruct.a_agent_middle_initial) gt 0 OR
 len(arguments.inStruct.a_agent_last_name) gt 0 OR
                                   len(arguments.inStruct.a_agent_firm_ein)
 gt 0 OR len(arguments.inStruct.a_agent_firm_name) gt 0 OR
 len(arguments.inStruct.a_agent_phone) gt 0 OR

 len(arguments.inStruct.a_agent_phone_ext) gt 0 OR
 len(arguments.inStruct.a_agent_address_1) gt 0 OR
 len(arguments.inStruct.a_agent_address_2) gt 0 OR
                                   len(arguments.inStruct.a_agent_city) gt
 0 OR len(arguments.inStruct.a_agent_state_id) gt 0 OR
 len(arguments.inStruct.a_agent_province) gt 0 OR

 len(arguments.inStruct.a_agent_country_id) gt 0 OR
 len(arguments.inStruct.a_agent_postal_code) gt 0 OR
 len(arguments.inStruct.a_agent_email) gt 0)
                                        {
                                        dbResult =
 request.oEmployer.Ins_Agent_Tbl(arguments.inStruct);
                                        if (dbResult eq 0,)
                                                request.inStruct.l_agent_id
 = listGetAt(dbResult,2);
                                        else
                                                request.inStruct.l_agent_id
 = ;
                                        }
                                         //cf_dump(dbResult);
                                           cf_abort;
                                else
                                        request.inStruct.l_agent_id = ;




 

~|
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:349844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm