Chapter 17: Introduction to ColdFusion Components


Instructions for Project Execution

This section describes the detailed instructions to execute the application code provided with this book.

Steps to Create the Database

Perform the following steps to create the database and tables:

  1. Choose Start, Programs, Microsoft SQL Server, Query Analyzer. The Connect to SQL Server dialog box appears.

  2. Provide the name of the SQL server. Provide the user authentication information and click OK.

  3. Ensure that you are connected to the Master database. If you are not connected to Master database, select it from the Database drop-down list.

  4. Chose File, Open.

  5. In the Open Query File dialog box, select Project4.sql. This script first creates the ElectricComp database and then creates the following tables: tblAnnualAppraisalResults, tblEmployees, tblLogins, tblPolicies, tblQtrlyAppraisalDetails, and tblQtrlyAppraisals. If the SQL server is installed in C:\, you do not need to modify the script. If the SQL server is installed in any other path, modify the database path in the script.

  6. Click the Execute button on the toolbar to execute the Project4.sql script. This creates the database and the tables in the database.

Perform the following steps to import the data from an Excel file to the tables:

  1. Start the SQL Server Enterprise Manager.

  2. Right-click the ElectricComp database in the Enterprise Manager.

  3. Select All Tasks, Import Data from the pop-up menu. This starts the Data Transformation Services Import/Export Wizard. Click the Next button to proceed to the next screen.

  4. The Choose a Data Source screen appears. Select Microsoft Excel 97-2000 from the Data Source drop-down list and choose the Excel file Project4Data.xls. Then click the Next button.

  5. The Choose the Destination screen appears. Click the Next button to continue.

  6. The Specify Table Copy or Query screen appears. This copies the tables in the Excel file to the ElectricComp database. Then click the Next button to continue.

  7. The Select Source Tables and Views screen appears. Select the tables to import and click the Next button to continue.

  8. The Save, Schedule, and Replicate Package screen appears. Select the Run Immediately option and then click the Next button to continue.

  9. Click the Finish button to close the wizard.

Steps to Test the Application in ColdFusion MX

Create the data source as follows:

  1. Start ColdFusion MX Administrator. This is usually located at http://localhost/CFIDE/Administrator/index.cfm, but the location can be different as per the setup.

  2. Provide the password. The main screen appears.

  3. Navigate to data sources under the Data and Services section.

  4. Create a data source named ElectricComp for SQL Server.

Test the application as follows:

  1. Create a directory named ProjectFour under the wwwroot directory on the Web server.

  2. Copy all the .cfm files in the ProjectFour directory.

  3. Start the browser and open the start.cfm page (http://hostname/Project-Four/start.cfm).

The application also assumes the Web server to be installed is in C:\.

Log on to the application as a reviewer and create targets for the employees under the reviewer. Then log on to the application as the employee for whom the targets are set.

ColdFusion MX includes many new features, such as ColdFusion Components (CFCs), that enable you to encapsulate and then reuse the code in applications. CFCs are the most important features of ColdFusion MX since the addition of custom tags in ColdFusion Server 5.0. Using CFCs, you can generate Web services or create Flash interfaces for your application. Web services allow you to publish and use remote application functions over the Internet using ColdFusion MX. You can allow remote users to access application functions to build them into their own applications.

This chapter introduces you to CFCs and discusses how to create and use them in ColdFusion applications. ColdFusion MX can handle Web services from CFCs automatically. Any other system supporting Web services, such as .NET or Java servers, can invoke CFCs on any platform or location. This chapter also discusses how to invoke a component in Web services in ColdFusion MX. In addition, the chapter explains how to use and publish Web services with CFCs in ColdFusion MX.




Macromedia ColdFusion MX. Professional Projects
ColdFusion MX Professional Projects
ISBN: 1592000126
EAN: 2147483647
Year: 2002
Pages: 200

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net