Introduction to ColdFusion

collectivemodernSoftware and s/w Development

Jun 30, 2012 (5 years and 2 months ago)

1,641 views



Introduction to
Introduction to
ColdFusion
ColdFusion
Ryan Stille
CF Web Tools
ryan@cfwebtools.com
http://ryan.cfwebtools.com
http://creativecommons.org/licenses/by-sa/3.0/us/



Agenda

What is ColdFusion

Who uses ColdFusion

Why would we want to use it / Features

What I didn't cover

The next version

Resources


What is ColdFusion?

Server side scripting language (CFML)

The Adobe ColdFusion CFML engine

The ColdFusion server is written in Java

The language is tag based

Runs on Windows, Linux, Unix, OSX



Union Pacific

Werner Trucking

Mutual of Omaha

NP Dodge

DTN

National Equity
Who Uses ColdFusion?

Swanson Russell &
associates

Grace University

Omaha Schools

Sergeants Pet Care

Elisa Ilana

Everyone

Some local companies include


Where did it come from?

Originally created by Allaire in 1995

Allaire was bought by Macromedia in 2001

Macromedia was bought by Adobe in 2005

First version was extremely basic, but the later
versions are very powerful

Version 6 (2002) was a complete rewrite – from
6.0 onward ColdFusion was written completely
in Java.

Now on version 7.02. Ver. 8 is due mid 2007.




Why Use ColdFusion?

Rapid Application Development


Why Use ColdFusion?

Rapid Application Development

Built in features

Charting Engine

Indexing and Searching

PDF Generation

Reporting Tool

XML and XSLT

Can talk to LDAP, POP, HTTP(s), FTP

Task scheduling


Why Use ColdFusion?

Built in features (cont.)

GUI widgets such as a data grid

Exception handling

Session management

Detailed debugging

Remote Development Service

Access to Java classes and methods

IDE Support

Can talk to any database that has a JDBC driver


ColdFusion Markup Language
<cfif
expression
>
<b>do stuff here</b>
<cfelse>
<i>else do this</i>
</cfif>


<cfscript
>
function isUpperCase(character) {
if (Asc(character) gte 65 and Asc(character) lte 90)

return true;
return false;
}
</cfscript>


<cfscript
>
// use Java to get hostname from an IP
function GetHostAddress(host) {

var iaddrClass = '';

var address = '';

iaddrClass = CreateObject("java", "java.net.InetAddress");

address = iaddrClass.getByName(host);

return address.getHostAddress();
}
</cfscript>


<cfquery name=”getUser” datasource=”MyDSN”>
SELECT fname, lname FROM users
WHERE userid =
#URL.userid#
</cfquery>
<cfoutput>
Hello #getUser.fname# #getUser.lname# !
</cfoutput>
Queries are easy and clean


<cfquery name=”getUser” datasource=”MyDSN”>
SELECT fname, lname FROM users
WHERE userid =
<cfqueryparam value=”#URL.userid#”
cfsqltype=”CF_SQL_INTEGER”>
</cfquery>
<cfoutput>
Hello #getUser.fname# #getUser.lname# !
</cfoutput>
Use cfqueryparam to prevent SQL injection




<cfquery name="qryScores" datasource="MyDSN">
SELECT Student_ID, FinalTotal FROM Scores
</cfquery>
<cfchart format="jpg" show3d=”Yes” chartheight="400"
chartwidth="600">
<cfchartseries query="qryScores" itemcolumn="Student_ID"
valuecolumn="FinalScore" type="bar">
</cfchart>
Charting


Charting - Result


Searching Capabilities

A version of the Verity K2 indexing/searching
server is bundled with ColdFusion

scalable search engine based on a TCP/IP client-
server architecture

Supports clustering

Can populate from database

File based indexing (spydering)

Lucene


<cfquery name="qryContent" datasource="MyDSN">
SELECT id, articleContent, articleTitle FROM articles
</cfquery>
<cfindex collection="articleSearch" action="refresh"
query="qryContent" type="custom" body="articleContent"
title="articleTitle" key="id">
Verity – populating a collection


<cfsearch

name = "searchResults" collection = "articleSearch"

type = "criteria" criteria = "#Form.searchstring#" >
<cfoutput query="searchResults">

Result #currentRow# -

<a href="getArticle.cfm?articleID=#key#">#title#</a>
</cfoutput>
Verity – searching a collection


<cfdocument src="http://www.google.com" format="pdf" />
PDF Generation


<cfdocument format="pdf" filename=”/tmp/myPdf.pdf”>
<b>html here!</b>
<img src=”and_images_too.jpg”>
</cfdocument>
PDF Generation


<!--- fetch an RSS feed --->
<cfhttp
url="http://www.fullasagoog.com/xml/ColdFusionMX.xml"
method="GET" />
<!--- make an XML object out of the returned text --->
<cfset xmlDoc = XmlParse(cfhttp.fileContent)>
<!--- and take a look at it --->
<cfdump var="#xmlDoc#">
XML Support



<cfldap>

<cfpop>

<cfhttp>

<cfftp>

<cfmail>
Other connectivity tags


<cfquery name=”qryUsers” datasource=”MyDSN”>
SELECT * FROM users
</cfquery>
<cfquery name=”QoQ” dbtype=”query”>
SELECT * FROM qryUsers WHERE state = 'NE'
</cfquery>
Query of a Query


<cfset OptData = StockData.getOptions(symbol = 'GE')>
<cfquery name=”QoQ” dbtype=”query”>
SELECT * FROM OptData WHERE
OptExpireDate =
'#OptData.OptExpireDate[OptData
.RecordCount]#'
AND LastPrice <
#OptData.StockPrice[OptData
.RecordCount]#
ORDER BY LastPrice
</cfquery>
Query of a Query


Session Management

ColdFusion has various variable scopes:

<cfset myVar = “foo”> places myVar into the
“variables” scope.

Other scopes:

Form

URL

Request

CGI

Cookie


Session Management

Persistent Scopes:

Session – these variables are placed into memory

Client – placed in the client variables database

Application – can be seen only by code using the
same application

Server – Can be seen by all applications on a
server


Task Scheduling

CF Administrator Demonstration


Debugging Features

Demo


Development in ColdFusion

Developer edition is free

IDEs

Dreamweaver has CFML syntax support

Homesite+

CFEclipse


Development in ColdFusion

MVC Code Frameworks

Fusebox

Model Glue

Mach II

ORM Frameworks (Object Relational Mapping)

Transfer

Reactor


Development in ColdFusion

Dependency Injection

ColdSpring

LiteWire

Unit Testing

CfUnit

CFCUnit


Development in ColdFusion

Remote Development Service

Allows you to connect to a ColdFusion server and
open/edit files on that machine

Supported in HomeSite and CFEclipse


What I didn't cover

OO (Components)

Application.cfc / .cfm

Flash/Flex Integration

Gateways

Reports

Flash Forms


Whats coming in ColdFusion 8

<cfimage> - image manipulation

Sharpen, blur, crop, resize, rotate, etc.

Also a full low-level drawing API that allows lines,
shapes, text, etc. to be overlaid on existing images.

Serialize and deserialize JSON

Ajax grids using <cfgrid>

More Eclipse integration, including a real time
log viewer

.NET Integration - CreatObject() can invoke
.NET objects. Even on non-windows platforms


Whats coming in ColdFusion 8

<cfexchangeconnection> - integration with MS
Exchange

<CFPDF> and <CFPDFForm>

gets PDFmetadata, merge pdfs, extract pages,
encrypt, create a thumbnail page, flatten pdfs,
protect, execute ddx instruction sets.

A lot of AJAX Stuff

AJAX proxy allows you to call ColdFusion objects
and functions from within JavaScript

AJAX data logging window


Whats coming in ColdFusion 8

A lot of AJAX Stuff (cont.)

Easy auto suggest:

Statically: <cfinput type="text" name="breed"
autosuggest="Bengal,Birman,British
Shorthair,Burmese,Egyptian Mau,Exotic
Shorthair,Persian" >

Ajaxified: <cfinput type="text" name="breed"
autosuggest="cfc:breeds.getList({cfautosuggestvalue})" >

On demand presentations

Scorpio is much faster than CF7


Whats coming in ColdFusion 8

Threading!

<cfthread action=” run | join | sleep | terminate” ...>

Can get thread metadata (elapsed time, error,
name, output, priority, starttime, status.)

New Server Monitoring/Administration tool

View/kill active threads

View executing pages, queries, etc. - sorted by
time, memory, etc.

Can monitor multiple servers on one screen

The API used for the server monitoring is public


Whats coming in ColdFusion 8

Run PHP/Ruby etc from within CF ????
<cfset who = "Sean" />
<cf_php>
<?php
echo "Hello ".$_COLDFUSION["who"]."<br />";
$_COLDFUSION["greeting"] = "wibble";
?>
</cf_php>
<cfoutput>greeting = #greeting#</cfoutput>


Whats coming in ColdFusion 8

How is this possible? ColdFusion 8 uses Java 6 which
provides access to the javax.script package and all the
J-language implementations available. Quercus is a
Java implementation of PHP and it is implemented as
a script engine.


Resources

Nebraska ColdFusion Users Group -
www.necfug.com
www.necfug.com

Meets the 4th Tues of every month

Many give-a-ways

Special Speakers from Adobe and other companies

ColdFusion Blog Aggregators

http://www.fullasagoog.com
http://www.fullasagoog.com



http://weblogs.macromedia.com/mxna/
http://weblogs.macromedia.com/mxna/



Mailing Lists

http://www.houseoffusion.com
http://www.houseoffusion.com

Many conferences around the country

Adobe Max, CF United, CF.Objective


Resources (cont.)

Podcasts

ColdFusion Weekly -
www.coldfusionweekly.com
www.coldfusionweekly.com


Out Loud -
www.helmsandpeters.com
www.helmsandpeters.com




The ColdFusion Podcast -
www.coldfusionpodcast.com
www.coldfusionpodcast.com


ColdFusion Muse -
www.coldfusionmuse.com
www.coldfusionmuse.com


Developer Edition is free -
www.adobe.com/coldfusion
www.adobe.com/coldfusion


ColdFusion 8 Beta -
http://labs.adobe.com/technologies/coldfusion8/
http://labs.adobe.com/technologies/coldfusion8/


Free CF8 Hosting -
http://www.hostmysite.com/cf8
http://www.hostmysite.com/cf8




THE END