Adobe 38040334 - Dreamweaver CS3 User Manual page 195

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

Advertisement

How site reports work
Reports are accessible through the Site > Reports command. When it is selected, this command displays a dialog
1
box from which the user selects reports to run on a choice of targets.
The user selects which files to run the selected reports on using the Report On: pop-up menu. This menu contains
2
the Current Document, Entire Current Local Site, Selected Files In Site, and Folder commands. When the user
selects the Folder command, a Browse button and text field appear, so the user can select a folder.
The user can customize reports that have parameters by clicking the Settings button and entering values for the
3
parameters. To let a user set report parameters, a report must contain a Settings dialog box. This dialog box is
optional; not every report requires the user to set the report's parameters. If a report does not have a Settings dialog
box, the Settings button is dimmed when a user selects the report in the list.
4
After selecting the reports and specifying the settings, the user clicks the Run button.
Note: If a report has the
preventFileActivity
file activity while this report is being run.
At this point, Dreamweaver clears all items from the Site Reports tab of the Results panel. Dreamweaver calls the
function in each report before the reporting process begins. If a report returns a
beginReporting()
from this function, it is removed from the report run.
5
Each file is passed to each report that was selected in the Reports dialog box using the
If the report needs to include information about this file in the results list, it should call the
dw.resultsPalette.siteReports.addResultItem()
to the user's selection are processed or the user clicks the Stop button in the bottom of the window. Dreamweaver
displays the name of each file being processed and the number of files that remain to be processed.
6
Dreamweaver calls the
endReporting()
reporting process completes.
A simple site report example
The simple extension example lists all the images referenced in a particular file, an entire site, selected files, or a
folder and displays the report in the Results window under the Site Results tab.
You create this extension by performing the following steps:
• "Creating the report definition" on page 189
• "Writing the JavaScript code" on page 190
This example creates two files in the HTML Reports folder: List images.htm, which contains the report definition,
and List Images.js, which contains the JavaScript code specific to this report. In addition, you reference the Reports.js
file, which is included with Dreamweaver.
Creating the report definition
The report definition specifies the name of the report as it appears in the Reports dialog box, calls any JavaScript files
required, and defines the user interface of the Settings dialog box, if needed.
To create the report definition:
Create the file Configuration/Reports/HTML Reports/List images.htm.
1
Add the following to specify the name of the report that you want to appear in the Reports dialog box in the title
2
of the HTML page.
handler, Dreamweaver prevents the user from performing any other
function. This process continues until all files that pertain
function in each report after all the files have been processed and the
DREAMWEAVER CS3
Extending Dreamweaver
value
false
function.
processFile()
189

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents