A Simple Data Source Example - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

Dreamweaver calls the
inspectDynamicDataRef()
in the user's document to an item in the tree. (This process is the reverse of what occurs when the
generateDynamicDataRef()
contains two elements, Dreamweaver shows with a visual cue which item in the tree is bound to the current selection.
Every time the user changes the selection, Dreamweaver calls the
8
determine whether the new selection is dynamic text or a tag with a dynamic attribute. If it is dynamic text,
Dreamweaver displays the bindings for the current selection in the Bindings panel.
Using the Dynamic Data or the Dynamic Text dialog box or the Bindings panel, it's possible to change the data
9
format for a dynamic text object or a dynamic attribute that the user has already added to the page. When the format
changes, Dreamweaver calls the
document and passes that string to the
page 304). The string that the

A simple data source example

This extension adds a custom data source to the Bindings panel for Macromedia ColdFusion documents. Users can
specify the variable they want from the new data source.
This example creates a data source called MyDatasource, which includes a MyDatasource.js JavaScript file, a
MyDatasource_DataRef.edml file, and MyDatasource Variable command files to implement a dialog box for users
to enter the name of a specific variable. The MyDatasource example is based on the implementation of the Cookie
Variable data source and the URL Variable data source. The files for these data sources reside in the
Configuration/DataSources/ColdFusion folder.
You create this data source by performing the following steps:
• "Creating the data source definition file" on page 288
• "Creating the EDML file" on page 289
• "Creating the JavaScript file that implements the Data Sources API functions" on page 289
• "Creating the supporting command files for user input" on page 292
• "Testing the new data source" on page 294
Creating the data source definition file
The data source definition file tells Dreamweaver the name of the data source as it will appear in the Bindings Plus
(+) menu and also tells Dreamweaver where to find the supporting JavaScript files for the data source implemen-
tation.
When a user clicks on the Bindings Plus (+) menu, Dreamweaver searches the DataSources folder for the current
server model to gather all available data sources defined in the folder's HTML (HTM) files. So, to make a new data
source available to the user, you need to create a data source definition file that simply provides the name of the data
source using the
tag and the location of all supporting JavaScript files using the
title
In addition, several supporting files are necessary for implementing this data source. In general, you might not need
to use the functions in these supporting files, but they are often useful (and necessary in this example). For example,
the dwscriptsServer.js file contains the
this data source. And, using the DataSourceClass.js file, you create an instance of the DataSource class to use as the
return value of the
findDynamicSources()
function to convert the dynamic data object back from the code
function is called.) If the
inspectDynamicDataRef()
generateDynamicDataRef()
formatDynamicDataRef()
formatDynamicDataRef()
dwscripts.stripCFOutputTags()
function.
inspectDynamicDataRef()
function to get the string to insert into the user's
function (see "formatDynamicDataRef()" on
function returns is inserted in the user's document.
function used in the implementation of
DREAMWEAVER CS3
Extending Dreamweaver
function returns an array that
function to
tag.
script
288

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents