JavaScript, DHTML, and CF 5 Integration Tips and
Download
Report
Transcript JavaScript, DHTML, and CF 5 Integration Tips and
CF 5 Review
Steve Drucker
CEO
Fig Leaf Software
Fig Leaf Software www.figleaf.com
•
•
•
•
Introduction
Industry/CF News
Job Announcements
Sign up for the listserv! http://chattyfig.figleaf.com
•
Today’s Schedule
Fig Leaf Software www.figleaf.com
Session Overview
•
•
•
•
New Language Features
New 3rd party integration
Database Support
CF Administrator enhancements
Fig Leaf Software www.figleaf.com
New Language Features
•
•
•
•
Query of Queries
User Defined Functions using <CFSCRIPT>
<CFSaveContent>
<CFFLUSH>
•
•
•
<CFLOG>
Enhancements to <CFFORM> objects
GetHTTPRequestData
Fig Leaf Software www.figleaf.com
Running “queries of queries”
•
•
•
CF5 allows you to run queries against recordsets stored in memory
from a <CFQUERY> tag
Join the results of two queries together in memory (simulating sql
stored procedure temp table functionality)
CF5 supports a minimal subset of the ANSI standard
•
•
•
•
•
•
Group By
Order By
Aggregate Functions (Count, Sum, Avg, Max, Min)
As
Boolean (Not, Like, IN, Between, AND, OR
DML (Outer Join syntax)
Fig Leaf Software www.figleaf.com
Running a query against a recordset
<CFQUERY NAME=“getemp” datasource=“foo”>
select lastname,firstname
from person
order by lastname
</CFQUERY>
<CFQUERY NAME=“getempbyfirstname” dbtype=“query”>
select *
from getemp
order by firstname
</CFQUERY>
Fig Leaf Software www.figleaf.com
User-Defined Functions using
<CFSCRIPT>
•
•
•
<CFSCRIPT> (introduced in CF 3.x) now gets javascript-like
function support
<CFSCRIPT> functions will perform better than calling CFML
custom tags
UDF’s can be recursive
Fig Leaf Software www.figleaf.com
User Defined Functions using
<CFSCRIPT>
<CFSCRIPT>
function addit(x,y) {
var total=x+y;
return total;
}
</CFSCRIPT>
<CFSET myval = addit(2,2)>
<CFOUTPUT>#myval#</CFOUTPUT>
Fig Leaf Software www.figleaf.com
<CFSAVECONTENT>
•
•
•
•
•
<CFSAVECONTENT> caches the HTML output of all CFML
constructs within the tags
Enables the caching of specified sections of a page for later
recall
Similar to <CFA_GeneratedContentCache> in Allaire Spectra
and other tags currently available on the Allaire Tag Gallery
Operates faster than the tags on the Gallery
NOTE: All output is suppressed within the tags
Fig Leaf Software www.figleaf.com
<CFSAVECONTENT>
<CFIF not isDefined("session.mycontent")>
<CFSAVECONTENT variable="session.mycontent">
<CFQUERY NAME="getemp" DATASOURCE="uikitdevsample">
select * from empemployees
</CFQUERY>
<CFOUTPUT QUERY="getemp">
#firstname# #lastname# <BR>
</CFOUTPUT>
</CFSAVECONTENT>
</CFIF>
<CFOUTPUT>#session.mycontent#</CFOUTPUT>
Fig Leaf Software www.figleaf.com
<CFFLUSH>
•
•
•
Flushes the current ColdFusion output buffer
Use it to start sending output to the web client before the
page has fully completed processing
After a <CFFLUSH> has executed, the following tags will
generate an exception:
•
CFCONTENT
•
CFCOOKIE
•
CFFORM
•
CFHEADER
•
CFHTMLHEAD
•
CFLOCATION
Fig Leaf Software www.figleaf.com
<CFFLUSH>
<CFQUERY NAME="getperson" DATASOURCE="careernotesdev">
select personfname,personlname
from person
</CFQUERY>
<CFFLUSH interval="100">
<CFOUTPUT QUERY="Getperson">
#personfname# #personlname#<BR>
</CFOUTPUT>
Fig Leaf Software www.figleaf.com
<CFLOG>
•
•
•
•
•
Programmatically create a log entry in any of the standard
log files (or create your own!)
Generate application-specific, scheduled task, and custom
logs
Limit logs by size and entries by age
Utilize the new CFADMIN log viewers to view logs
Writes out information comma-delimited
•
Type
•
Thread
•
Date
•
Time
•
Application
Fig Leaf Software www.figleaf.com
<CFLOG>
<CFLOG text=“Completed Process Successfully”
log=“Application”
Type=“Information”
Thread=“Yes”
Date=“Yes”
Time=“Yes”
Application=“Yes”>
Fig Leaf Software www.figleaf.com
Enhancements to <CFFORM>
•
•
•
•
The CFTextInput, CFSLIDER, CFTREE, and CFGRID tags were
completely rewritten
The controls run more consistently in JVM’s
The <CFFORM> tag now has a preservedata attribute that will
autoload information into a control if the page submits to
itself.
Users are prompted to install the Java 1.3 runtime from the
web
Fig Leaf Software www.figleaf.com
GetHTTPRequestData
•
•
Makes HTTP Request Headers available for potentially
capturing SOAP request data
Information is returned in a structure
Fig Leaf Software www.figleaf.com
<CFDUMP?>
•
•
Graphically dumps the contents of ANY CF variable
Available in Beta 3?
Fig Leaf Software www.figleaf.com
New 3rd Party Integration
•
•
•
•
Verity has been upgraded from Search ’97 to Verity VDK 2.6.1
Graphing will be available in Beta 3 using a subset of
Macromedia Generator, Developer Edition (<CFGRAPH> tag)
A new version of Netegrity Siteminder is being integrated (CF
Advanced Security)
Crystal Reports 8 reports are now supported
Fig Leaf Software www.figleaf.com
Database Support
•
•
•
Allaire has licensed a new set of MERANT database drivers
Some datasources will now be able to be set up “clientless”
•
Sybase
•
Informix 9
•
Oracle?
CF now supports DSNless Connections
Fig Leaf Software www.figleaf.com
DSNless Connections
•
You can specify a connection string for odbc datasources
<CFQUERY NAME="getpeople"
DATASOURCE="__DYNAMIC__"
DBTYPE="dynamic"
blockfactor="100"
connectstring="DRIVER={SQL SERVER};
SERVER=(local);
UID = sa;
PWD= ;
DATABASE=uikitdevsample">
select firstname,lastname
from empemployees
</CFQUERY>
Fig Leaf Software www.figleaf.com
Administration Enhancements
•
•
•
Revamped CF Administrator
SNMP Support
Application/Server Backup and Restore (Harvest)
Fig Leaf Software www.figleaf.com