MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER Instrukcja Obsługi

Przeglądaj online lub pobierz Instrukcja Obsługi dla Serwery MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER. MACROMEDIA COLDFUSION 5 - INSTALING AND CONFIGURING SERVER Programming instructions Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 154
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1

Getting Started Building ColdFusion MX Applications

Strona 2

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

Strona 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

Strona 4

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 9

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

Strona 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

Strona 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

Strona 12

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 17

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 22

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

Strona 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

Strona 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

Strona 26 - Understanding CFML elements

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 33

118 Lesson 4 Validating Data to Enforce Business Rules

Strona 34 - String operator

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

Strona 35

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

Strona 36 - Processing form data

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

Strona 37

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

Strona 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

Strona 39 - Database Fundamentals

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

Strona 40 - Understanding database basics

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

Strona 41

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

Strona 42 - About SQL

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

Strona 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

Strona 44

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

Strona 45 - Environment

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

Strona 46

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

Strona 47

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

Strona 48

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

Strona 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

Strona 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

Strona 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

Strona 52

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

Strona 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

Strona 54

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

Strona 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

Strona 56

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

Strona 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

Strona 58

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

Strona 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

Strona 60

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

Strona 61

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

Strona 62

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

Strona 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

Strona 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

Strona 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

Strona 66

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

Strona 67

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

Strona 68

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

Strona 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

Strona 70

12 Chapter 1 Introducing ColdFusion MX

Strona 71

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

Strona 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

Strona 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

Strona 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

Strona 75

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

Strona 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

Strona 77

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

Strona 78

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

Strona 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

Strona 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

Strona 81

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

Strona 82

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

Strona 83

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

Strona 84

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

Strona 85

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

Strona 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

Strona 87

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

Strona 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

Strona 89

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

Strona 90

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

Strona 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

Strona 92

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

Strona 93

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

Strona 94

34 Chapter 3 Database Fundamentals

Strona 95

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

Strona 96

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

Strona 97

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

Strona 98

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

Strona 99

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

Strona 100

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

Strona 101

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

Strona 102

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

Strona 103

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

Strona 104

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

Strona 105 - Reviewing the code

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

Strona 106

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

Strona 107

46 Chapter 4 Configuring Your Development Environment

Strona 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

Strona 110

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

Strona 111

vi Contents

Strona 112

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

Strona 113

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

Strona 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

Strona 115

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

Strona 116

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

Strona 117

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

Strona 118

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

Strona 119

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

Strona 120

58 Lesson 1 Preparing to Build the Sample Application

Strona 121

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

Strona 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

Strona 123

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

Strona 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

Strona 125

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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,

Strona 132

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

Strona 133

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

Strona 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

Strona 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

Strona 136

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

Strona 137

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

Strona 138

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

Strona 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 &

Strona 140

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

Strona 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

Strona 142

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

Strona 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

Strona 144

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

Strona 145

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

Strona 146

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

Strona 147

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

Strona 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

Strona 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

Strona 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

Strona 151 - Updating multiple records

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

Strona 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

Strona 153

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

Strona 154

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

Komentarze do niniejszej Instrukcji

Brak uwag