Developing WWW Applications Using Cold Fusion™
By: Rachel Campbell and Linda Cingel February 12, 1998
What is a WWW Application?
It is a tool for performing a task, used through a World Wide Web browser s It should be distinguished from:
s
– –
Static informational web pages Desktop applications, which must be installed
s
Example: Acronym Application
Why WWW Applications-- and When?
Eliminates the need for installation support s Easily provides access to a distributed user base s Cross-platform delivery with fewer crossplatform programming problems s Works well with small applications that require little client-side processing.
s
Why Use Cold Fusion?
Easy to learn--even for “non-programmers” s Supports quick, easy “rapid application development” of WWW applications BUT... s You should Know When to Say NO!
s
–
–
Large applications become unmanageable, sometimes unusable, and difficult to maintain. Many applications should still be desktop applications!
Goals For This Presentation:
Provide general understanding of Cold Fusion’s architecture, development process and capabilities s Provide a specific tutorial for developing a basic Cold Fusion application s Provide additional resources and direction for moving on into more complex development
s
Agenda
Cold Fusion Application Architecture s What You Need to Get Started s Getting Started With Cold Fusion s Getting Down To Basics s Tips and Techniques s Advanced Features s Additional Resources
s
Cold Fusion Application Architecture
Cold Fusion Application Components
s
Server Applications:
– –
HTTP Server Cold Fusion Server Application .cfm Application Pages (Example 1) ODBC Data Source(s) and Database(s) (Optional) Other sources of data (File System, SMTP Server, COM objects, etc.)
s s
Your Code:
–
Data:
– –
How they Work Together
.cfm page
HTTP Request
2
DataBase Server
1
File System Web Server Cold Fusion Server Application
Internet or Intranet Web Browser
3
SMTP Server
5
Web page
Server
4
.html page
Other Applications and System Services
What You Need to Get Started
Server Software Developer Software Client Software
Server Software:
Microsoft NT Server/Solaris s Cold Fusion Application s HTTP Server (e.g., MS Information Server) s RDBMS (e.g., MS SQL Server)
s
Developer Software:
Cold Fusion Studio, or other HTML editor s Database Client software (e.g., SQL Enterprise Manager, or at least MS Query)
s
s
Note: Some Developer software is included w/server software.
Client Software:
WWW Browser (e.g., Netscape Navigator, MS Internet Explorer) s Recommend Testing on all Supported Browsers
s
s
Note: Cold Fusion works with any browser… it simply delivers standard HTML.
Getting Started With Cold Fusion
Step 1: Design Step 3: Debug Step 2: Build Application Pages
Step 1: Design
Employ a Rapid Application Development mindset: s Plan the Information Design As Well As you can…
s
– –
Task Analysis (Example 2) Naming Conventions (Example 3)
s
Then Quickly Move On, Relying on an Iterative Process
Step 2: Build Application Pages
s
Elements of a Cold Fusion Application Page
–
–
HTML, Cold Fusion, JavaScript, and more… (Example 4) Remember, Cold Fusion can be used with most other WWW technologies Use CF Studio, or a WISIWYG Editor Add Cold Fusion to the Page
s
Design the Interface
–
s
Make it Live
–
Step 3: Debug
Database: Is Your Query Correct? s CF Syntax/Logic: Is Your Cold Fusion Syntax Correct? s Other Technologies: What About JavaScript?
s
Getting Down to Basics:
Selecting/Displaying Information s Updating Information s Creating Dynamic Pages s Using CF Functions and Expressions s Creating Reports
s
Selecting/Displaying Information
Assume infrastructure is complete (i.e., software, database, ODBC data source, permissions all in place and correct) s Create a basic Cold Fusion template page:
s
– –
Define a Query Define Results Display
Define a Query
s
Using a
tag
Basic Syntax:
SQL statements
s
Using stored procedures
Basic Syntax:
{ call procedurename[([parameter][,parameter]]...)] }
Define how the Query’s results will be displayed:
s
s
tag provides the most flexible way to display query results Basic Syntax:
Literal text, HTML tags, and dynamic field references (e.g. #FieldName#)
s s
(Demo 1) (FYI) Other CF display features include CFTABLE, CFCONTENT, and CFFORM (See Documentation)
Updating Information
Inserts, Updates, and Deletes require two .cfm template pages: s A s
(Demo 2, 3)
The