How site reports work

  1. Reports are accessible through the Site > Reports command. When it is selected, this command displays a dialog box from which the user selects reports to run on a choice of targets.
  2. The user selects which files to run the selected reports on using the Report On: pop-up menu. This menu contains 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.
  3. The user can customize reports that have parameters by clicking the Settings button and entering values for the 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 handler, Adobe Dreamweaver prevents the user from performing any other file activity while this report is being run.

    At this point, Adobe Dreamweaver clears all items from the Site Reports tab of the Results panel. Adobe Dreamweaver calls the beginReporting() function in each report before the reporting process begins. If a report returns a false value 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 processFile() function. If the report needs to include information about this file in the results list, it should call the dw.resultsPalette.siteReports.addResultItem() function. This process continues until all files that pertain to the user's selection are processed or the user clicks the Stop button in the bottom of the window. Adobe Dreamweaver displays the name of each file being processed and the number of files that remain to be processed.

    Adobe Dreamweaver calls the endReporting() function in each report after all the files have been processed and the 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:

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 Adobe Dreamweaver.