new http();
results in: invalid component definition, can't find HTTP
I searched the wiki and Jira but couldn't find a ticket that seems to
match it, so two things I guess.
1. Is cfhttp implemented in cfscript yet?
2. If not, is there a Jira issue or should I add one?
Cheers,
Judah
/micha
2010/9/10, Judah McAuley <judah....@gmail.com>:
Judah
2010/9/11, Judah McAuley <judah....@gmail.com>:
FWIW, this was unanimously considered not core, not extended core by
the CFML Advisory Committee (even Adobe).
The most popular solution was:
http attr=val attr=val {
httpparam ...;
}
even tho' Adobe didn't implement that.
Railo has implemented that, however. And the Adobe-style CFC-based
solution will be in Railo soon.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
var myresult = '';
http name="myresult" url="http://google.com" {
q="Railo"
}
and that would do a GET search of google?
Cheers,
Judah
| Message | Missing [;] or [line feed] after expression |
| Stacktrace |
The Error Occurred in
C:\Dev\websites\testbed\www\index.cfm: line 21: <cfscript> |
The docs haven't caught up with the BER yet.
> var myresult = '';
> http name="myresult" url="http://google.com" {
> q="Railo"
> }
What is q="Railo" meant to be? Did you mean httpparam name="q"
value="Railo" or something similar?
Maybe, I don't know. That was the point, I'm not sure what the syntax
is :) I was guessing a set of name-value pairs but it looks like you
mean use the httpparam keyword with a name attribute and value
attribute. Makes sense, thanks.
Judah
Write it out in tags and then remove the "<cf" at the beginning of
each tag and the ">" at the end of each tag. It's meant to be very
consistent.
That consistency is why I was disappointed the CFML Advisory Committee
couldn't all agree on the approach. What we have in ACF9 is a mix of
all sorts of stuff. Some tags are like functions (with (parentheses
around attributes)), some are like 'tags' (without <cf and > but with
bare attributes and { } for the body), some are CFCs. It really is a
bit of a mess (and neither Adam nor Ben seemed to like it when it was
discussed on the committee - but Adobe were too far along in CF9 to
change direction, unfortunately).
<cfquery name="result" datasource="myDB">
select * from user where status =
<cfqueryparam cfsqltype="cf_sql_integer" value="#statusId#"/>
</cfquery>
becomes:
query name="result" datasource="myDB" {
writeOutput( 'select * from user where status = ' );
queryparam cfsqltype="cf_sql_integer" value="#statusId#";
}
(in Railo, at least)
A question though on the cfquery example, how do you specify multiple
params? Do you do some sort of variable replacement or do you have to
do some sort of string concatenation?
Cheers,
Judah
The simplicity of CFML has been taken over by these poor decisions at Adobe. writeOutput() here just seems very wrong to me.
/micha
2010/9/16, Sean Corfield <seanco...@gmail.com>:
@sean - Thanks for the explanation. While I hear you "Please don't
make me explain this one again :) ". If the past discussions from the
CAC were public maybe we would all be on the same page.
@everyone
I looked back over this thread but I could not tell who implemented
what syntax. But I want to comment once more on this writeOutput().
Here is the example give by someone higher up in the thread.
query name="result" datasource="myDB" {
writeOutput( 'select * from user where status = ' );
queryparam cfsqltype="cf_sql_integer" value="#statusId#";
writeOutput(' AND foo_id = ' );
queryparam cfsqltype="cf_sql_integer" value="#fooId#";
}
But writeOutput() should be reserved for output to the user (generated
content). There is no output to the user in this code above. What is
happening above is input to a method call. So it would have made more
sense to add some consistent method for handling these situations like
a new "function" queryText('select * form user where...'). Not that I
like that option but I would never be confused by this use of
writeOutput.
It seems to me that this is what should have happened.
query name="result" datasource="myDB" {
select * from user where status = queryparam
cfsqltype="cf_sql_integer" value="#statusId#";
AND foo_id = queryparam cfsqltype="cf_sql_integer"
value="#fooId#";
}
Don't get me started on that either :)
I asked for the archives to be open from day one... When the committee
broke down, I asked again...
> query name="result" datasource="myDB" {
> writeOutput( 'select * from user where status = ' );
> queryparam cfsqltype="cf_sql_integer" value="#statusId#";
> writeOutput(' AND foo_id = ' );
> queryparam cfsqltype="cf_sql_integer" value="#fooId#";
> }
>
> But writeOutput() should be reserved for output to the user (generated
> content). There is no output to the user in this code above.
No, look at the tag version again. Whatever is output in the body of
the tag is treated as the SQL. It's the same with <cfmail>
> happening above is input to a method call. So it would have made more
> sense to add some consistent method for handling these situations like
> a new "function" queryText('select * form user where...').
Would you want a separate function for every tag??
> It seems to me that this is what should have happened.
>
> query name="result" datasource="myDB" {
> select * from user where status = queryparam
> cfsqltype="cf_sql_integer" value="#statusId#";
> AND foo_id = queryparam cfsqltype="cf_sql_integer"
> value="#fooId#";
> }
That is not syntactically possible. You must have a way to tell SQL
from code - that a machine / compiler can do automatically. The
solution has to work for <cfmail> in script as well. There has to be a
single, consistent syntax.
Again, read my original email carefully to see why it's all about output.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
Note that there is a savecontent construct in cfscript:
savecontent variable="foo" {
writeOutput( 'This is output' );
this.is = 'code';
}
That works on ACF and Railo. foo contains 'This is output' (without
quotes). Again, it's all about output. In savecontent, in query, in
mail. Because that's how the <cf..> tags work.
But the CAC folks felt it was ugly and even tho' Adobe implemented
savecontent, they didn't do the same for query and mail - but they
took the same approach for lock, transaction and thread... just
remember those aren't about processing an output stream.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
Cool. I just wanted to check since you suggested queryText() and I
wondered if you had in mind mailText() etc.
> I have also been following along and I know that you wanted a more
> open approach to the CAC adventure. I am sorry that did not happen.
Me too :(
> I am sure you have noticed I am just frustrated with the way the whole
> CFML stuff has developed at Macromedia and now Adobe. I love CFML and
> I have paid my bills with it for the last 10 years.
Likewise (almost - I joined Macromedia in 2000 as Senior IT Architect
and started doing CFML in late 2001). My work since then has been
mostly CF-focused. Until other engines appeared, ColdFusion was a
"product" more than a "language / compiler" so the proprietary nature
didn't really matter so much - remember it was competing against ASP
in the Allaire days, another closed, proprietary "product".
> If time permitted I would get into the Railo source and begin to
> understand how all of the parts fit together.
Even I haven't had that luxury yet... :)
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/