On Monday 20 Oct 2008, Rick Faircloth wrote:
First, what variables need to be used in the cfset var someVar = code
and why is it important to do this?
Everything that is local to the method.
So cfquery names, the loop variables in cfloop, the cfhttp return scope etc.
etc. etc.
Yes, it does
Article: Developers Rank Best Application Servers: Cold Fusion, Apache
Geronimo Top List
http://www.cio.com/article/print/455845
-Mike Chabot
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Interesting. That was reported by an IDG publication. They put out InfoWorld
which is part of my daily read. They also put out ComputerWorld which
published the infamous CF is dead article.
G
On Wed, Oct 22, 2008 at 8:54 AM, Mike Chabot [EMAIL PROTECTED] wrote:
Article: Developers Rank Best
-Original Message-
From: Tom Chiverton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 5:38 AM
To: cf-talk
Subject: Re: How can I make this code better?
On Monday 20 Oct 2008, Rick Faircloth wrote:
First, what variables need to be used in the cfset var someVar =
Thanks for the feedback, Jim and Tom!
Rick
Jim Davis wrote:
-Original Message-
From: Tom Chiverton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 5:38 AM
To: cf-talk
Subject: Re: How can I make this code better?
On Monday 20 Oct 2008, Rick Faircloth wrote:
Hi, all... still trying to get a handle on using CFC's.
Here's an update method I wrote and I'd like to know
what can be changed to make it better. Such as,
why not use the form scope in the query? And, why
not just use the application scope for the dsn, instead
of converting it to the
I created a random record generator for pulling current news items. I am using
an access database for the back end and would like to know if anyone has a
better solution. This code works, but I think I'm missing something. Thank you
in advance Keith.
Step 1: Pull the current records and get a
Keith McGee wrote:
I am using an access database for the back end
and would like to know if anyone has a better solution.
*snip*
1. Use MySQL.
2. Order by Rand()
3. ???
4. Profit
~|
Adobe® ColdFusion® 8 software 8 is the
*snip*
1. Use MySQL.
2. Order by Rand()
3. ???
4. Profit
this is not the only program or site running off of access database, we do have
oracle and I know I could use where rownum = #randomID#, but I am looking for
an access solution.
Even though it works, it is not a normal practice for the guts of a
component to know what is going on outside.
Alghouth it's a reach, it is possible that your update_product method
could accept URL variables, rather than form variables. If this were
true, then you would have to modify your
We have one old ColdFusion 5 server that has been humming along nicely for
years now. But yesterday all of the graphs stopped functioning completely. Any
page call with a graph on it just runs forever and never returns. I checked the
log files and noticed 86 errors like this going back to
Couple others suggestions...
You need to VAR your query:
In your cffunction tag right after the cfargument tag, add:
cfset var qUpdateProduct =
Also, Lose the and # characters:
cfset variables.product_id = arguments.product_id
(However, you don't really need to set this variable unless
I generally make my CFCs as generic as possible. You are updating a
product and looking in the form scope for everything. It'll work,
sure. But, what if in the future you get an entire cart. Then you
won't be looking in the form scope, you'll be looking at something in
the session or
MS SQl server lets you order by newid()
ie.
select * from My_Table
order by newid()
I have no clue if this works in Access or not.
Wil Genovese
One man with courage makes a majority.
-Andrew Jackson
A fine is a tax for doing wrong. A tax is a fine for doing well.
On Oct 22, 2008, at 9:17
Well, Access isn't a database.
If you gave several sites, why not just make them in oracle?
I mean, why use access at all?
Keith McGee wrote:
*snip*
1. Use MySQL.
2. Order by Rand()
3. ???
4. Profit
this is not the only program or site running off of access database, we do
have
Thanks for both of those thoughts. It seems whenever you use type=line the line
goes along the X-axis no matter what though.
I have been looking in the chart editor (and your jedi blog at the great chart
examples) but haven't seen anything that lets you go vertical with a line
chart. I saw a
Thanks for the suggestion, but I tried that and I didn't work.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 10:10 AM
To: cf-talk
Subject: How can this CFC be improved?
Hi, all... still trying to get a handle on using CFC's.
Here's an update method I wrote and I'd like to know
what can
Any thoughts on this would really be appreciated, folks.
Thanks.
I have a 2-part form, grid and edit pane. The grid is populated from a
query and shows only enough of the record to make it recognizable. The
user selects a record, which then populates the edit pane. Everything
works fine
Thanks for the feedback, Mike.
Even though it works, it is not a normal practice for the guts of a
component to know what is going on outside.
What's the difference, ultimately, in referring to the form variables
in cfset myObj.update_product(form, product_id) and just referring
to them
what about a floating bar chart, where you could set the width of the bar to
something small? I haven't tried it, but I looked a bit at the bar charts
last night, and thought it might be a possibility for you Andrew.
Rob
On Wed, Oct 22, 2008 at 10:45 AM, Andrew Tegenkamp [EMAIL PROTECTED]wrote:
the lifetime of the component's instance
Such as, if the variable is going to be used in other methods
before returning data to the calling page?
Dawson, Michael wrote:
Couple others suggestions...
You need to VAR your query:
In your cffunction tag right after the cfargument tag, add:
But by referring to the form directly, your CFC already knows about the
outside. I am just learning about CFCs and OO myself, but I thought the
point of them was to make them independent of what was going on the
outside, and to just pass them the information that they needed regardless
of the
Thanks for the feedback, Jake.
All that reassigning of variables is a lot more typing. (But, can I
get around
reassigning each form variable individually by using the
argumentCollection
attribute when calling the method?)
I think I see what you're saying, however.
By translating the type of
Technically, they both will work.
However, what if you have a different process of calling the same
function that doesn't use the form scope?
What if you want to call the same method as a web service?
Your current system will fail at that time.
realitycheck
Of course, if you fully control your
Correct.
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 10:19 AM
To: cf-talk
Subject: Re: How can this CFC be improved?
the lifetime of the component's instance
Such as, if the variable is going to be used in other methods
Hello:
I am able to call the reports from coldfusion using cfhttp.Pass the username
and password since cfhttp works with Windows Basic Authentication.
Need,therefore, to change the IIS virtual mapping to ReportServer to use also
Basic Authentication (we use https in an intranet environment).We
I think I'm beginning to understand your reasoning.
It's just taking some time for me to get to the best practices of CFC
usage.
Trying to get anything to work at first keeps my projects moving, while
beginning to employ different coding techniques. I'm basically trying to
learn by writing code
Good...maybe I'll catch on before the next decade rolls around...
Jake Churchill wrote:
Right!.
Your call (if you are using the form scope) would look like this:
object.update_product(argumentCollection=form);
or
object.update_product(duplicate(form));
Same thing if you are looking at
I'm running a query to get featured products.
For the call, I'm using:
cfinvokecomponent =components.products
method =select_featured_products
returnVariable=featured_products/
and the cffunction is:
cffunction
Using CFCs as function collections like you are doing is the easy part.
Wait till you start creating a true OO backend. I'm working on my first
right now and I thought I was really good at CFCs until I started
this... No pain no gain though, right?
Rick Faircloth wrote:
Good...maybe I'll
the problem isn't the empty query. an empty query is still a query. the
problem is you're returning featured_products but your query is named
get_featured_products. you're returning an empty variable.
change this line:
cfset var featured_products = /
to:
cfset var get_featured_products = /
Right!.
Your call (if you are using the form scope) would look like this:
object.update_product(argumentCollection=form);
or
object.update_product(duplicate(form));
Same thing if you are looking at something in the session:
object.update_product(argumentCollection=session.key);
Rick Faircloth
AFter the query do this...
cfif NOT get_featured_products.recordcount
cfset get_featured_products = QueryNew('id')
/cfif
That should fix the problem.
Rick Faircloth wrote:
I'm running a query to get featured products.
For the call, I'm using:
cfinvokecomponent =
Gotcha... thanks.
Charlie Griefer wrote:
even if you're a solo developer, creating components that are truly
black-boxed (e.g. they know nothing of the world outside them), you're
creating components that you can potentially reuse yourself. Also, by
passing in the information explicitly
No pain no gain though, right?
As long as whatever is causing the pain doesn't kill you! :o)
Rick
Using CFCs as function collections like you are doing is the easy part.
Wait till you start creating a true OO backend. I'm working on my first
right now and I thought I was really good
but, but, but... I thought I saw CFC examples where the cfreturn variable
didn't match the query name. (It didn't make much sense, but then, again,
not a lot of the CFC stuff does, right now)
The change made it work, however.
Now I know. The cfreturn variable has to match the query name.
even if you're a solo developer, creating components that are truly
black-boxed (e.g. they know nothing of the world outside them), you're
creating components that you can potentially reuse yourself. Also, by
passing in the information explicitly (rather than referring to outside
scopes from
the return variable has to match whatever it is you want to return. in
*this* case, it's the query.
let's say you just wanted to return a recordcount... then the return
variable wouldn't match the query name. it'd match a variable name:
cffunction name=getNumberOfUsers output=false
Interesting. That was reported by an IDG publication. They put out
InfoWorld which is part of my daily read. They also put out ComputerWorld
which published the infamous CF is dead article.
Ha! I somehow missed the ComputerWorld article. :)
--
s. isaac dealey ^ new epoch
isn't it time
Rick Faircloth wrote:
Now I know. The cfreturn variable has to match the query name.
Well, no. It has to match what you want to return. Sure there are lots
of examples where the return does not match the query name because the
query is not what is necessarily returned. But if your function
Keith,
You can pull a random record from Access by using the Rnd() function. So your
query would look like this:
cfquery name=get_news datasource=#dsn#
select fld_page_ID, fld_title, fld_body, fld_attach_ID, fld_url,
fld_active_date, fld_inactive_date
from tbl_marketing_pages
where
All cleared up... thanks, Charlie.
Rick
Charlie Griefer wrote:
the return variable has to match whatever it is you want to return. in
*this* case, it's the query.
let's say you just wanted to return a recordcount... then the return
variable wouldn't match the query name. it'd match a
Got it. Thanks, Ian.
Rick
Ian Skinner wrote:
Rick Faircloth wrote:
Now I know. The cfreturn variable has to match the query name.
Well, no. It has to match what you want to return. Sure there are lots
of examples where the return does not match the query name because the
I've been tasked with managing an upgrade of over 60 different client sites
form CF6.1 to CF8 environment.
Our current environment is a plague of not so great code, written by not so
great developers. Heavy lifting of the code just can't happen as this
upgrade is seen as an non-utilized effort.
All fine point there Gerald, thank you. I've looked at Illudium in the
past and plan on doing so again for this project. Right now though I'm
trying to map out all my classes in UML to make sure that I have it
together conceptually, then move to the actual coding part. The
database already exists
Thanks for this advice Mike. I'd forgotten about the cfcdev mailing
list, I'll go sign up for that now. Fortunately for me, this site is
not a high traffic site. These are back end business process tools, so
I'm really refactoring to increase the sensibility and maintainability
of the code. I will
I'm planning on using one of the MVC frameworks (probably MG, but I'll
look at Mach ii and OO Fusebox again as well) for a seperate project
that can be built from the ground up. This project has enough quirks
(like an existing url rewriter scheme) that I'd prefer not to try and
shoehorn in a whole
Rick, imagine how it would be if (as is fairly common) you have
business objects (beans) handling single items, and DAO cfcs handling
all the database interaction back and forth.This is the scenario i
drew in the tutorials I wrote ...
So in the application scope you have a DAO - just one .
ORDER BY Rnd(fld_page_ID)
This command keeps pulling the same order, even if I close the browser. If they
go back to the main page I would like possibility of having a different news
item appear.
~|
Adobe® ColdFusion® 8
On a recent project, I built the entire codebase using linear code
(non-OOP). It was faster for me to see what data I actually needed that
way.
I considered this my prototype.
Then, once I was satisfied with the project, I started to refactor my
code. I put all queries into a single CFC. I
Just to make sure you're aware of its existence, I would suggest taking a
look at ColdBox as well.
http://www.coldboxframework.com/
http://www.12robots.com/index.cfm/2008/9/21/Building-an-Application-with-ColdBox-and-ColdSpring--Part-1
On Wed, Oct 22, 2008 at 12:02 PM, Judah McAuley wrote:
I understand you want to stay with access for whatever reason. But
consider how much trouble this is for you.. Are you sure you aren't able
to use a different database (or convince your client that he should move
up)? I mean, access can only handle 1 user at a time anyway.. That alone
should
One thing I would watch out for is concept overload. I think the single most
difficult thing for me was sifting the VAST amounts of information. One of
the problems I ran into was finding tutes and examples that did *one thing
only* and not mixing concepts like using MachII and ColdSpring
Agreed, this is something I ran into before and is definitely
something that often haunts me into indecision. That is one of the
reasons I'm not doing a framework right now. I figure if I can
abstract out my functionality into a set of classes and get those
classes implemented as cfc's, I'll have
I am trying to use ColdFusion to consume a web service and I am having issuses.
I really don't know much about web services so please bear with me.
Here is what I have been trying to do:
cfsavecontent variable=soap
?xml version=1.0 encoding=utf-8?
soap:Envelope
ORDER BY Rnd(fld_page_ID)
This command keeps pulling the same order, even if I close the browser.
If they go back to the main page I would like possibility of having a
different news item appear.
Keith,
This is a ColdFusion caching issue. If you run the query directly in Access,
you
Thanks for the overview, Mike.
I see what everyone's saying about the encapsulation. I'm just trying to
make all the pieces of the puzzle fit. Your tutorial was helpful. It
was a little
advanced in some respects. I just needed to approach the CFC's a little
more carefully, until I could
Sounds like a good approach.
I'm about to duplicate much of the work I've done on a recent project
for another client and I plan to use CFC's instead of putting the
code into my .cfm's. (I wouldn't call what I'm going to do OOP... :oP)
But since I've already written the code procedurally once,
For now I probably wouldn't worry about DAOs and other related concepts.
Build a strong foundation by encapsulating the CFC methods so that they
don't rely on any external variables. That'd be a good start.
Once you recoil in terror at seeing a CFC method reference application or
session or form
Hi!
We're currently in the process of migrating our ColdFusion MX 6.1 (32-bit)
servers to ColdFusion 8 (64-bit). When testing our websites without load on the
server, everything is working fine. As soon as we switch to production mode and
let the users surf the sites, the proxy service denies
I think I can handle that approach and stay sane! :o)
Charlie Griefer wrote:
For now I probably wouldn't worry about DAOs and other related concepts.
Build a strong foundation by encapsulating the CFC methods so that they
don't rely on any external variables. That'd be a good start.
Once
Joshua,
I don't have time to address all these concerns, unfortunately, but I can speak
a bit to the performance issue, at least based on what little you've shared.
Client vars are an excellent storage facility, with some great benefits over
session, but also some downsides vs session. In and
Oh, and VAR your variables!!!
If you don't, Ray Camden will be knocking at your door.
Mike
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2008 1:26 PM
To: cf-talk
Subject: Re: How can this CFC be improved?
I think I can handle that
Now *that* would be scary this close to Halloween! :oP
Dawson, Michael wrote:
Oh, and VAR your variables!!!
If you don't, Ray Camden will be knocking at your door.
Mike
~|
Adobe® ColdFusion® 8 software 8 is the most
Developers rank best application servers
The 'user's choice' for application servers ranked Adobe ColdFusion, the
open-source Apache Geronimo, and Oracle WebLogic Server among their
favorites
Can CF return and handle a ListObject from a web service call?
Thanks,
Dave Bosky | Information Services | HTC | direct: 843-369-8613 | fax:
843-369-7178 | [EMAIL PROTECTED]
**
HTC Disclaimer: The information contained in
When I use the code below to try to see information about both
Datasource1 and Datasource2, it always ONLY shows me info on the FIRST
data source in the list (Datasource1). Is this a looping logic problem,
or something to do with running cfdbinfo too quickly over and over?
Even if I reverse
Ok I changed this to every 30 seconds and it still is sending mail from
the spooler at about 1 every 3 - 5 seconds.
-Original Message-
From: Mike Chabot [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2008 2:51 PM
To: cf-talk
Subject: Re: Mail Spooler
In my opinion having the
Good Afternoon-
Normally, when CFDocument decides to be weird (which is about the only
consistent thing about it) someone here at the office can find a
workaround. Got a strange one though. We've got a tool that's using
CFDocument to generate 3 of 9 barcodes on a document. It's currently
Dan,
Did you try rebooting the server? Sometimes there is a memory leek
in the web server or database server.. r
At 10:37 AM 10/22/2008, you wrote:
We have one old ColdFusion 5 server that has been humming along
nicely for years now. But yesterday all of the graphs stopped
functioning
We have not rebooted it yet, but are going to tonight after business hours. I
am hoping that will fix it.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
The cfdocument tag saw a number of important revisions in CF8, so it
doesn't surprise me that the code needs to be updated.
Most likely the problem relates to CF scaling the content to fit
within the available space. Make sure the margins are big enough to
contain all the content or things will
I ran your code with a couple of DSNs of my own on CF8.0 and it displayed
the table info for each of the different databases.
The first dump output is repeated though.
Adrian
Building a database of ColdFusion errors at http://cferror.org/
-Original Message-
From: Dan LeGate
Sent: 22
I've been trying to figure out how to use a CFC for validating form
data, but I can't find any info on how the code should be constructed.
I've been using the CFC and the form variables in the code, but I'm
trying to get away from accessing data directly in the CFC.
The invocation I'm using:
the keys in the struct that comprises the argumentCollection are received by
the method as individual cfarguments.
so if your form struct has keys 'firstName' and 'lastName', and the form was
passed in as an argumentCollection, you'd have arguments.firstName and
arguments.lastName.
also you need
76 matches
Mail list logo