MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER Manuale delle Istruzioni

Navigare online o scaricare Manuale delle Istruzioni per Server MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER. MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER Programming instructions Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 154
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti

Sommario

Pagina 1

Getting Started Building ColdFusion MX Applications

Pagina 2

x About This BookViewing online documentationAll ColdFusion documentation is available online in HTML and Adobe Acrobat Portable Document Format (

Pagina 3 - CONTENTS

90 Lesson 3 Creating a Main Application Page3 In the Trip Location drop-down list box, select Begins With and type the value C in the trip location

Pagina 4

Enhancing the Trip Maintenance application 91The following example uses the MOD function to alternate the background color of table rows:<cfoutput

Pagina 5

92 Lesson 3 Creating a Main Application Page2 To format the currency and date fields on the Trips Search Results page, open the tripsearchresult.cf

Pagina 6

Enhancing the Trip Maintenance application 935 In the Trip Search Result page, click the link for Riding the Rockies. The properly formatted Trip Deta

Pagina 7 - ABOUT THIS BOOK

94 Lesson 3 Creating a Main Application PageAdding navigation buttons to browse databaseThe drill-down search function developed in the last exerci

Pagina 8 - Developer resources

Enhancing the Trip Maintenance application 953 Save the file and view the updated tripdetail.cfm page in a browser.The Trip Search Results page appear

Pagina 9

96 Lesson 3 Creating a Main Application PageAdding database maintenance buttonsThe search and sequential navigation capabilities are features for l

Pagina 10 - Contacting Macromedia

Enhancing the Trip Maintenance application 973 Save the file and view the updated tripdetail.cfm page in a browser (http://localhost/CFDOCS/getting_st

Pagina 11 - Welcome to ColdFusion

98 Lesson 3 Creating a Main Application PageSummaryIn this lesson, you transformed the search facility you built in Lesson 2 into a drill-down faci

Pagina 12

99LESSON 4Validating Data to Enforce BusinessRulesIn this lesson, you will enhance the Compass Travel Trip Maintenance application. The exercises in t

Pagina 13 - Introducing ColdFusion MX

PART IWelcome to ColdFusionPart I provides an introduction to ColdFusion. It defines ColdFusion and provides an overview of the ColdFusion Markup Lang

Pagina 14 - The Internet

100 Lesson 4 Validating Data to Enforce Business RulesEnhancing the Trip Maintenance applicationIn this lesson and the next, you will create the co

Pagina 15 - Web pages

Using an HTML form to collect data 101Using an HTML form to collect dataBased on the data requirements determined in Lesson 1, the following figure sh

Pagina 16 - Web browsers

102 Lesson 4 Validating Data to Enforce Business Rules3 Save the file as tripedit.cfm to the my_app directory.4 View the tripedit.cfm in a browser

Pagina 17

Developing code to validate data and enforce business rules 103Developing code to validate data and enforce business rulesAs described in Lesson 1, it

Pagina 18 - What is ColdFusion MX?

104 Lesson 4 Validating Data to Enforce Business RulesValidating data using a server-side action pageThe first approach you will take to enforce Co

Pagina 19 - • Tags that begin with cf

Developing code to validate data and enforce business rules 105The cfset tag lets you manipulate the value of a variable. For example, the following p

Pagina 20 - • Application security

106 Lesson 4 Validating Data to Enforce Business Rules<!--- Price must be 20% greater than Base Cost ---><cfif Form.baseCost * 1.2 GT #Fo

Pagina 21

Developing code to validate data and enforce business rules 107the network and the server. If the data is validated on the client, then only valid dat

Pagina 22

108 Lesson 4 Validating Data to Enforce Business RulesClient-side validation approach using ColdFusion form tagThe following code is on the client:

Pagina 23 - CFML Basics

Developing code to validate data and enforce business rules 109Tip: For additional help, review the completed code in the tripedit2.cfm within the sol

Pagina 25

110 Lesson 4 Validating Data to Enforce Business Rules</body></html>7 View the tripedit.cfm page in a browser and test the client- and

Pagina 26 - Understanding CFML elements

Developing code to validate data and enforce business rules 111<!--- Field: eventType ---><tr><td valign="top">Type of Eve

Pagina 27 - Functions

112 Lesson 4 Validating Data to Enforce Business RulesUsing other client-side script to reduce edits on the serverIf you were interested in moving

Pagina 28 - Functions and pound signs

Developing code to validate data and enforce business rules 113var testdate = new Date(dateString.substring(6,10),dateString.substring(0,2)-1,dateStri

Pagina 29 - Variables

114 Lesson 4 Validating Data to Enforce Business RulesThe important point about the preceding JavaScript is that you can use two functions, isitFut

Pagina 30 - Displaying variable output

Developing code to validate data and enforce business rules 115Validating the existence of the trip photo file At this point, you have a more efficien

Pagina 31 - Working with CFML expressions

116 Lesson 4 Validating Data to Enforce Business RulesReviewing the codeThe following table describes the code used to verify whether a file exists

Pagina 32

Summary 1173 Save the page and test it by opening the tripedit.cfm page in your browser.Testing recommendations:a In the Trip Edit page entering valid

Pagina 33

118 Lesson 4 Validating Data to Enforce Business Rules

Pagina 34 - String operator

119LESSON 5Implementing the Browsing andMaintenance Database FunctionsIn this lesson, you will enhance the Compass Travel ColdFusion application by pr

Pagina 35

3CHAPTER 1Introducing ColdFusion MXThis chapter introduces the core technologies that are the foundation for Macromedia ColdFusion MX. It provides a b

Pagina 36 - Processing form data

120 Lesson 5 Implementing the Browsing and Maintenance Database FunctionsEnhancing the Trip Maintenance applicationIn this lesson, you will make en

Pagina 37

Enhancing the Trip Maintenance application 121Maintenance action pageThe maintenance action page processes a user’s maintenance request from the Trip

Pagina 38 - Commenting your code

122 Lesson 5 Implementing the Browsing and Maintenance Database FunctionsFor example, if the current tripID equals 6, the following table identifie

Pagina 39 - Database Fundamentals

Enhancing the Trip Maintenance application 123<cfelseif IsDefined("Form.btnLast.X")>ORDER BY tripID DESC</cfif></cfquery>&

Pagina 40 - Understanding database basics

124 Lesson 5 Implementing the Browsing and Maintenance Database FunctionsExercise: implement trip record browsing (navigation)Follow these steps to

Pagina 41

Enhancing the Trip Maintenance application 125<cfelseif IsDefined("Form.btnEdit")>...<cfelseif IsDefined("Form.btnAdd")&g

Pagina 42 - About SQL

126 Lesson 5 Implementing the Browsing and Maintenance Database FunctionsDELETE FROM trips WHERE tripID = #Form.RecordID#Exercise: handle search an

Pagina 43 - Using SQL with ColdFusion

Enhancing the Trip Maintenance application 1277In the Trip Search page, select begins with in the selection box for Trip Location. Then enter Imji in

Pagina 44

128 Lesson 5 Implementing the Browsing and Maintenance Database FunctionsSummaryIn this lesson, you converted the Trip Detail page from the search

Pagina 45 - Environment

129LESSON 6Adding and Updating SQL DataIn this lesson, you will complete the Compass Travel Trip Maintenance application. The exercises will guide you

Pagina 46

4 Chapter 1 Introducing ColdFusion MXThe Internet and related technologiesColdFusion MX is tightly integrated with the Internet and the World Wide

Pagina 47

130 Lesson 6 Adding and Updating SQL DataCompleting the Trip Maintenance applicationIn Lesson 5, you created the tripeditaction.cfm page to contain

Pagina 48

Completing the Trip Maintenance application 131After the following SQL statement executes:INSERT INTO ClientsVALUES ('Smith', 'Kaleigh&

Pagina 49

132 Lesson 6 Adding and Updating SQL DataTip: To save time, you can copy this code from the tripsinsertquery.txt file (for Windows users) or from t

Pagina 50 - Enabling debugging options

Completing the Trip Maintenance application 1334 In the tripedit.cfm page, fill in the fields with the values in the following figure, then click Save

Pagina 51 - To enable debugging options:

134 Lesson 6 Adding and Updating SQL Data7 Click Search. The TripResults page appears:8 Click the link to the NH White Mountains to display the det

Pagina 52

Completing the Trip Maintenance application 135Reviewing the codeThe following table describes the SQL INSERT and cfquery code used to add data:For mo

Pagina 53 - MX window

136 Lesson 6 Adding and Updating SQL DataThe cfinsert tag used in the previous code snippet uses the following attributes:Exercise: insert trip dat

Pagina 54

Completing the Trip Maintenance application 137<cfupdate datasource="CompassTravel" tablename="Trips"><cflocation url=&qu

Pagina 55

138 Lesson 6 Adding and Updating SQL DataFor more information about adding data to a database using the cfupdate tag, see Developing ColdFusion MX

Pagina 56

Completing the Trip Maintenance application 139<cfset eventTypeIdentifier = #TripQuery.eventType#><cfset tripLocation = ''><c

Pagina 57 - Application

The Internet and related technologies 5Intranet applicationsAn intranet is a private LAN (Local Area Network) or WAN (Wide Area Network) that lets you

Pagina 58

140 Lesson 6 Adding and Updating SQL Data3 Insert the following code just before the last line:<!--- EDIT BUTTON ---><cfelseif IsDefined(&

Pagina 59 - Preparing to Build the Sample

Completing the Trip Maintenance application 141After the following SQL statement executes:UPDATE Clients SET LastName = ’Pitt’WHERE ID = 3the table co

Pagina 60

142 Lesson 6 Adding and Updating SQL Data3 Add the following code:<!---Routine to increase trip price by 10% ---><cfquery name="TripQ

Pagina 61

143INDEXAaction page, defined 26application. See tutorialCcfform, defined 99cfif, defined 59cfinput, defined 99cfinsert, defined 129cflocation, define

Pagina 62

144 Indexsyntax 18URLEncodedFormat 81HHTML, defined 6IInternetapplications 4defined 4intranetapplication 5defined 5IsDefined function, defined 81JJava

Pagina 63 - Recognizing the data types

6 Chapter 1 Introducing ColdFusion MXWeb browsersA web browser is a software program residing on a computer that you use to view pages on and navig

Pagina 64

The Internet and related technologies 7URLsEvery piece of information on the World Wide Web has a unique address. This address is called a Uniform Res

Pagina 65 - How to proceed

8 Chapter 1 Introducing ColdFusion MXWeb application servers process code in a page that a browser and web server cannot interpret. The web server

Pagina 66

What is ColdFusion MX? 9The ColdFusion application serverThe ColdFusion application server is a software program that resides on the same computer as

Pagina 67

TrademarksAfterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware

Pagina 68

10 Chapter 1 Introducing ColdFusion MXDevelopment toolsWhile you can code your ColdFusion application with NotePad or any HTML editor, Macromedia r

Pagina 69 - Writing Your First ColdFusion

Using ColdFusion MX with Macromedia Flash MX 11Using ColdFusion MX with Macromedia Flash MXMacromedia Flash MX is designed to overcome the many limita

Pagina 70

12 Chapter 1 Introducing ColdFusion MX

Pagina 71

13CHAPTER 2CFML BasicsThis chapter introduces the basic elements of CFML, including how to create ColdFusion pages, and use variables, functions, cond

Pagina 72

14 Chapter 2 CFML BasicsWorking with ColdFusion pagesAs discussed in Chapter 1, ColdFusion pages are plain text files that you use to create web ap

Pagina 73

Working with ColdFusion pages 15To create a ColdFusion page:1 Open your editor and create a blank file.2 Enter the following code on the page:<html

Pagina 74 - Sorting the results

16 Chapter 2 CFML BasicsThe following figure shows the cfpage.cfm in the browser:2 Do the following tasks:a View the source code that was returned

Pagina 75

Understanding CFML elements 17Most often the end tag encloses the tag name in brackets and includes a slash (/), like this:</tagname>The informa

Pagina 76 - Creating a dynamic web page

18 Chapter 2 CFML BasicsThe DollarFormat function returns a value as a string and formats that value with two decimal places, thousand separator, a

Pagina 77

Understanding CFML elements 19If you did not include the pound signs around the DateFormat(Now(), "mm/ddyyy") function, the output for the p

Pagina 78

iiiCONTENTSABOUT THIS BOOK . . . . . . . . . . . . . . . . . . . . . . . . . . . VIIDeveloper resources . . . . . . . . . . . . . . . . . . . . . . .

Pagina 79

20 Chapter 2 CFML BasicsIn the next example, ColdFusion uses the values of the my_first_name and my_last_name variables to set the value for the my

Pagina 80 - • price greater than 1500

Working with CFML expressions 21One of the tags that ColdFusion provides to display output is the cfoutput tag. The cfoutput tag instructs ColdFusion

Pagina 81

22 Chapter 2 CFML BasicsAs mentioned, it is important that elements are identified properly in your expression so ColdFusion processes them as expe

Pagina 82

Working with CFML expressions 23Specifying quotation marks around valuesWhen assigning literal values to variables, you must surround the literal valu

Pagina 83

24 Chapter 2 CFML BasicsArithmetic operatorsThe following table lists the arithmetic operators that ColdFusion supports:String operatorThe followin

Pagina 84

Understanding conditional processing 25Understanding conditional processing To this point, all the coding examples shown are considered linear coding

Pagina 85

26 Chapter 2 CFML BasicsUsing cfelseif to evaluate multiple expressionsTo evaluate multiple expressions in a cfif statement, you can use cfelseif a

Pagina 86

Processing form data 27When a user submits a form, the form values are stored in form variables and sent to the action page for processing. The follow

Pagina 87

28 Chapter 2 CFML BasicsCommenting your codeAs in other programming languages, it is important to include comments in the code. You should comment

Pagina 88 - 3 To build the

29CHAPTER 3Database FundamentalsThis chapter provides a quick overview of relational database concepts and terms. It describes what a database is and

Pagina 89

iv Contents Processing form data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26Form

Pagina 90

30 Chapter 3 Database FundamentalsUnderstanding database basicsEven though you do not need a thorough understanding of database management systems

Pagina 91 - LESSON 3

Understanding database basics 31Understanding relational tablesIn a database, you can organize data in multiple tables. For example, if you manage a d

Pagina 92

32 Chapter 3 Database FundamentalsAbout SQLSQL Structured Query Language) is a language that lets you communicate with databases. For example, you

Pagina 93

Using SQL with ColdFusion 33Using SQL with ColdFusionColdFusion communicates with your data source through a database interface called JDBC. JDBC is a

Pagina 94

34 Chapter 3 Database Fundamentals

Pagina 95

35CHAPTER 4Configuring Your DevelopmentEnvironmentThis chapter describes how to set up your development environment for the tutorial in Part II of thi

Pagina 96

36 Chapter 4 Configuring Your Development EnvironmentVerifying the tutorial file structureBefore you being the tutorial, verify that the configurat

Pagina 97

Configuring database connection and debugging options 37The photos directory contains the required photo files for the tutorial application. The solut

Pagina 98

38 Chapter 4 Configuring Your Development Environment4 Specify the following:5 Click Show Advanced Settings and ensure that the settings for CLOB a

Pagina 99

Configuring database connection and debugging options 393 Click Add to configure the data source name and driver. The PointBase data source dialog box

Pagina 100

C o n t e n t s vLESSON 3 Creating a Main Application Page . . . . . . . . . . . . . . . . 81Enhancing the Trip Maintenance application. . . . .

Pagina 101

40 Chapter 4 Configuring Your Development Environment7 Click Verify All Connections to ensure that ColdFusion can access this file. OK appears in t

Pagina 102

Configuring database connection and debugging options 41The location of the debugging information or the type of debugging data shown varies, dependin

Pagina 103

42 Chapter 4 Configuring Your Development EnvironmentFor the purpose of the tutorial in Part II of this book, enable the following debugging option

Pagina 104

Macromedia development environment tools 43Macromedia development environment toolsMacromedia Dreamweaver MX is the preferred development environment

Pagina 105 - Reviewing the code

44 Chapter 4 Configuring Your Development EnvironmentThe Dreamweaver MX environmentAs a ColdFusion developer, you can build ColdFusion MX applicati

Pagina 106

Macromedia development environment tools 45Configuring Dreamweaver MX for ColdFusion developmentBefore you use Dreamweaver MX to create the sample app

Pagina 107

46 Chapter 4 Configuring Your Development Environment

Pagina 108 - In the next lesson

PART IIBuilding a ColdFusionApplicationPart II provides a tutorial that steps you through building a sample ColdFusion application. It consists of six

Pagina 110

49LESSON 1Preparing to Build the SampleApplicationIn this tutorial, you will build a simple ColdFusion web application for a fictitious travel company

Pagina 111

vi Contents

Pagina 112

50 Lesson 1 Preparing to Build the Sample ApplicationApplication development stepsMost software applications perform three major functions:• A user

Pagina 113

Determining the application functional requirements 51Determining the application functional requirementsBefore you can build the sample application,

Pagina 114 - in a cfif

52 Lesson 1 Preparing to Build the Sample ApplicationDetermining the data requirementsPrior to creating the application pages to capture trip infor

Pagina 115

Designing the database for your application 53Designing the database for your applicationAfter you identify the information to collect, you must consi

Pagina 116

54 Lesson 1 Preparing to Build the Sample ApplicationEstablishing a relationship between the two tablesWhen the user selects an event type from the

Pagina 117

Developing the sample application 55Developing the sample applicationGiven the application functional requirements and the database provided, you are

Pagina 118

56 Lesson 1 Preparing to Build the Sample ApplicationEach lesson guides you through a scenario to enhance the Compass Travel Trip Maintenance appli

Pagina 119

Developing the sample application 57RequirementsTo use this tutorial, you must have the following components installed:• ColdFusion Server For informa

Pagina 120

58 Lesson 1 Preparing to Build the Sample Application

Pagina 121

59LESSON 2Writing Your First ColdFusionApplicationIn this lesson, you begin the construction of a ColdFusion web application for the fictitious compan

Pagina 122

viiABOUT THIS BOOKGetting Started Building ColdFusion MX Applications is intended for anyone who wants to learn how to use ColdFusion MX to create web

Pagina 123

60 Lesson 2 Writing Your First ColdFusion ApplicationCreating your first ColdFusion applicationAs you recall from Lesson 3, two of the requirements

Pagina 124

Creating your first ColdFusion application 61• Trip Search Results page The purpose of the Trip Search Results page is to display the results of a tri

Pagina 125

62 Lesson 2 Writing Your First ColdFusion ApplicationUsing a web page to list tripsTo help Compass Travel agents take trip reservations by telephon

Pagina 126 - • For MS Windows systems:

Using a web page to list trips 63Consider a table named Clients to hold information about people with the following rows:To select the columns named L

Pagina 127

64 Lesson 2 Writing Your First ColdFusion ApplicationFor example, to select the columns named Last Name and First Name for Clients whose City is Bo

Pagina 128

Using a web page to list trips 65the Trip List page presented earlier in this lesson. In this example, you use cfquery to return all the trip names fo

Pagina 129 - LESSON 5

66 Lesson 2 Writing Your First ColdFusion ApplicationCreating a dynamic web pageIn the following exercises you will build a dynamic Trip Listing we

Pagina 130 - Navigation action page

Using a web page to list trips 67Reviewing the codeThe following table describes the code used to build the query:Exercise: enhancing the queryIn this

Pagina 131 - Application development steps

68 Lesson 2 Writing Your First ColdFusion Application3 Create the Budget Trip List report by doing the following:a Modify the SQL SELECT statement,

Pagina 132

Developing a search capability 69Developing a search capabilityThe dynamic listings developed in the previous exercise meet many of Compass Travel’s r

Pagina 133

viii About This BookDeveloper resourcesMacromedia, Inc. is committed to setting the standard for customer support in developer education, document

Pagina 134 - maintenance action page:

70 Lesson 2 Writing Your First ColdFusion Application• price• tripIDIn later exercises, you will reference these columns when you build the SQL SEL

Pagina 135 - SQL DELETE Statement

Developing a search capability 71Using SQL operators to create a search criteria pageA simple design for a search criteria page presents an operator l

Pagina 136

72 Lesson 2 Writing Your First ColdFusion Application<td><select name="departureOperator"><option value="EQUALS"

Pagina 137

Developing a search capability 73Building the Search Results page Based on the queryable columns identified earlier, the SQL query to display the sear

Pagina 138

74 Lesson 2 Writing Your First ColdFusion ApplicationBuilding a SQL WHERE clause in code is largely an exercise in string concatenation. The &

Pagina 139 - Adding and Updating SQL Data

Developing a search capability 75<!--- Create Where clause for query from data entered thru search form ---><cfset WhereClause = " 0=0 &

Pagina 140

76 Lesson 2 Writing Your First ColdFusion ApplicationReviewing the codeThe following table describes the code used to build the tripLocation WHERE

Pagina 141

Developing a search capability 77The Trip Results page displays several entries as follows:c Notice in the Trip Results page that only one trip has a

Pagina 142

78 Lesson 2 Writing Your First ColdFusion Application2 To build the departureDate WHERE subclause, enter the code in the following table immediatel

Pagina 143

Developing a search capability 794 Verify that the price and departureDate are now considered in the query, as in step 4 in the previous exercise:a Op

Pagina 144

About Macromedia ColdFusion MX documentation ixAbout Macromedia ColdFusion MX documentationThe ColdFusion documentation is designed to provide support

Pagina 145

80 Lesson 2 Writing Your First ColdFusion ApplicationSummaryThis lesson described how to access a relational database using ColdFusion. You used th

Pagina 146

81LESSON 3Creating a Main Application PageIn this lesson you will enhance the Compass Travel Trip Maintenance application. The exercises in this lesso

Pagina 147

82 Lesson 3 Creating a Main Application PageEnhancing the Trip Maintenance applicationIn this lesson you will enhance the Trip Maintenance applicat

Pagina 148

Enhancing the Trip Maintenance application 83• Enhanced Trip Search Results page. The original purpose of the Trip Search Results page in Lesson 2 was

Pagina 149

84 Lesson 3 Creating a Main Application PageThe primary users of these components will be the Compass Travel coordinators and agents, not the gener

Pagina 150 - SQL Update

Enhancing the Trip Maintenance application 85Exercise: building a Trip Detail pageFollow these steps to build a Trip Detail page.To build a Trip Detai

Pagina 151 - Updating multiple records

86 Lesson 3 Creating a Main Application Page<td>#returnDate#</td></tr><tr><td valign="top">Price:</td>

Pagina 152

Enhancing the Trip Maintenance application 878 The Rio Cahabon Rafting trip has an tripID of 24. To view the trip detail for the trip in your browser

Pagina 153

88 Lesson 3 Creating a Main Application PageReviewing the codeThe following table describes the ColdFusion code used to build the Trip Detail page:

Pagina 154

Enhancing the Trip Maintenance application 89Protecting your applicationTo ensure that your application is protected from such an attack, you can expl

Commenti su questo manuale

Nessun commento