Cold Fusion CS-422
Cold Fusion • Core Technologies – Proprietary, tag based, embedded scripting language – Javascript, Java
• Platforms – NT, LINUX, Solaris – Apache, Netscape/iPlanet, IIS
• Databases – Access, MS SQL Server (NT W/2000 Only) – Sybase, Oracle, DB2 – MySQL (requires MYODBC driver)
Cold Fusion Architecture HTML Web Server
JavaScript Java ODBC JDBC
ColdFusion Server
Native
Database
Cold Fusion • How it works – Web server receives request for .cfm file and passes the request to the CF server. CF Server parses the file returning all non- CF tags to the requesting browser and resolving the CF tags into their resolved text/values
• Benefits – Multi-platform – Easy to learn • tag based (looks like HTML, gives web community comfort that its just some additional tags)
– much support available via the web, wide following in the web community
• Problems – OEM pricing (current price of $5K/server)
Cold Fusion Server • •
Installs as either an NSAPI or ISAPI plug-in to your web server Web based administration client – Data source definition (ODBC and Native for Oracle, Sybase and DB2) – connection to a mail server via the CFMAIL tag – provides state maintenance via client and session variabled (kept in Registry or in database) – Java and C++ interface for interfacing user defined tags – interface for OLEDB – Verity indexing interface for generation search collections – task scheduler for running CF batch jobs – advanced security features based on Netegrity SiteMinder
Cold Fusion Studio •
Desktop client used to develop and deploy Cold Fusion applications – Text based editor, with built in CF help environment and text coloring for CF tags – connects to ColdFusion server via FTP or proprietary RDS (Remote Development Server) – live connection to all data sources defined on the CF server for easy table browsing and debugging – built in debugger – allows check-in/check-out of files to facilitate group development –
Alternatives to Studio for Development •
And FTP client or file share on to Web server’s document tree – WS/FTP, Netscape, Hummingbird, HomeSite
•
A text editor – Notepad, Wordpad, EMACS
•
A good book on Cold Fusion ( Ben Forta’s are the best, he wrote the language)
Cold Fusion Applications •
Collection of .cfm pages consisting of – – – – –
HTML Cold Fusion Tags (like HTML but all start with letters “CF”) SQL JavaScript ColdFusion function calls (a very rich library of function to aid in the processing of user inputs and creation of dynamically generated HTML and text
Application.cfm •
Each application may have an Application.cfm file – this file is included ahead of each page of the application and is primarily used for initialization – whenever a .cfm page is requested from the web server, the CF server will first load the Application.cfm file and then the requested file; processing will start at the first line of the application
• Application.cfm is optional
• • • •
Syntax: Server includes the specified file in line with the current file; similar to web server “server-side includes” allows modularization of CF code if many s are used, each should start off with some debug code to identify the file name so that in the event of a failure, you can figure out which file the failure was in. Sample of CFINCLUDE
• •
used to define Cold Fuaion variables SYNTAX:
CFSET user_ip = CGI.REMOTE_ADR>
•
•
SYNTAX: …….. – query_name:(optional) name of CFQUERY to associate with – max_rows_of_output : (optional) – group: (optional) for grouping to eliminate duplicates – starting_row: (optional) the query row to start with whatever is created between and is sent to the requesting browser
Ex. without an associated query
Today is #DayOfWeekAsString(“#DayOfWeek(“#Now()#”)#”)#
Today is
• •
used to pass a SQL query statement to a data source Syntax: ….. – many other attributes, those shown are required SELECT PARKNAME , REGION , STATE FROM Parks ORDERBY ParkName , State #ParkName# | #Region# | #State# |