beautypg.com

Create or delete a cfc in dreamweaver, View cfcs in dreamweaver – Adobe Dreamweaver CC 2015 User Manual

Page 682

background image

675

Building applications visually

Last updated 6/3/2015

Note: The Components panel is available only when viewing a ColdFusion page in Dreamweaver.

Create or delete a CFC in Dreamweaver

You can use Dreamweaver to visually define a CFC and its functions. Dreamweaver creates a .cfc file and inserts the
necessary CFML tags for you.

Note: Depending on the component, you may have to complete some code by hand.

1

Open a ColdFusion page in Dreamweaver.

2

In the Components panel (Window > Components), select CF Components from the pop-up menu.

3

Click the Plus (+) button, and complete the Create Components dialog box, and click OK.

a.In the Components section, enter the details about the component. Here is a partial list:

Name

Specifies the filename of the component. The name must contain only alphanumeric characters and

underscores (_). Don’t specify the .cfc file extension when entering the name.

Component Directory

Specifies where the component is saved. Select the web application’s root folder (such as

\Inetpub\wwwroot\myapp\) or any of its subfolders.

b.To define one or more functions for the component, select Functions from the Section list, click the Plus (+)
button, and enter the details of the new function.

Ensure that you specify the type of the value returned by the function in the Return Type option.

If you select remote from the Access menu, the function becomes available as a web service.

c.To define one or more arguments for a function, select Arguments from the Section list, select the function from
the pop-up menu, click the Plus (+) button, and enter the details of the new argument on the right.

4

If you use a remote development server, upload the CFC file and any dependent files (such as those used to
implement a function or include files) to the remote server.

Uploading the files ensures that Dreamweaver features such as Live view and Preview In Browser work properly.

Dreamweaver writes a CFC file and saves it in the folder you specified. The new component also appears in the
Components panel (after clicking Refresh).

5

If you use a remote development server, upload the CFC file and any dependent files (such as those used to
implement a function or include files) to the remote server.

View CFCs in Dreamweaver

Dreamweaver provides a way to visually examine the ColdFusion components (CFCs) located in your site folder or on
the server as a whole. Dreamweaver reads the CFC files and displays information about them in an easy-to-navigate
tree view in the Components panel.

Dreamweaver looks for the components on your testing server (see

Connecting to the database in Dreamweaver

). If

you create CFCs or make changes to existing CFCs, make sure to upload the CFC files to the testing server so they are
accurately reflected in the Components panel.

To view components located on another server, change the testing server settings.

You can view any of the following information about your CF components:

• List all of the ColdFusion components defined on the server.