Results window functions

 < Day Day Up > 

Results window functions let you create a stand-alone window that displays columns of formatted data, or you can interact with the built-in windows of the Results panel group.

Creating a Stand-alone Results window

These functions create custom windows that are similar to the output from the JavaScript Debugger window.

dreamweaver.createResultsWindow()

Availability

Dreamweaver 4.

Description

Creates a new Results window and returns a JavaScript object reference to the window.

Arguments

 strName, arrColumns 

  • The strName argument is the string to use for the window's title.

  • The arrColumns argument is an array of column names to use in the list control.

Returns

An object reference to the created window.

dreamweaver.showResults()

Availability

Dreamweaver MX 2004.

Description

Opens the specified results floating panel and selects the item.

NOTE

This function is supported only in the Validation, Target Browser Check, and Site Reports windows of the Results floating panel.


Arguments

 floaterName, floaterIndex 

  • The floaterName argument is a string that specifies the results floating panel to open. Valid values are 'validation', 'btc', or 'reports'.

  • The floaterIndex argument is a number or string. Use a number to specify the index of an item to select in the Results panel. Use a string to specify the URL of a document. If you specify a URL, the function selects the first visible item for that document.

Returns

Nothing.

Example

The following example checks for errors at the offset of the current selection in the document and, if there are errors, displays them in the specified window (floaterName) of the Results panel. Otherwise, it opens the Target Browser Check window of the Results panel and displays the first visible item for the document.

 var offset = dw.getDocumentDOM().source.getSelection()[0]; var errors =   dw.getDocumentDOM().source.getValidationErrorsForOffset(offset); if ( errors && errors.length > 0 )   dw.showResults( errors[0].floaterName, errors[0].floaterIndex ); else   dw.showResults('btc', dw.getDocumentDOM().URL); 

resWin.addItem()

Availability

Dreamweaver 4.

Description

Adds a new item to the Results window.

NOTE

Use only on stand-alone results windows created with dreamweaver.createResultsWindow(). resWin.addItem() cannot be used with the built-in results windows, including Validation, Browser Target Check, or Site Reports.


Arguments

 resultWindowObj, strIcon, strDesc, itemData, iStartSel, iEndSel, colNdata 

  • The resultWindowObj argument is the object that the createResultsWindow() function returns.

  • The strIcon argument is a string that specifies the path to the icon to use. To display a built-in icon, use a value "1" through "10" instead of the fully qualified path of the icon. Specify "0" (zero) for no icon. The following table shows the icons that correspond to the values of "1" through "10":

  • The strDesc argument is a detailed description of the item. Specify "0" if there is no description.

  • The itemData argument is a string you can use to store specific data about the item being added such as a document line number.

  • The iStartSel argument is the start of selection offset in the file. Specify the value null if you are not specifying an offset.

  • The iEndSel argument is the end of selection offset in the file. Specify the value null if you are not specifying an offset.

  • The colNdata argument is an array of strings that provide the data for each column (that is, if there are 3 columns, an array of 3 strings).

Returns

A Boolean value: true if the item was added successfully; false otherwise.

Example

The following example creates a Results window called resWin that has the column headings: Frodo, Sam, and Gollum. The call to the resWin.addItem() function adds a folder icon and then the three strings, msg1, msg2, and msg3 into the three columns defined for the window.

 var resWin = dw.createResultsWindow("Test Window", ["Frodo", "Sam", "Gollum"]); resWin.addItem(resWin, "3", "Description", null, null, null, ["msg1", "msg2", "msg3"]); 

resWin.addResultItem()

Availability

Dreamweaver 4.

Description

Adds a new results entry to the current Results window, based on the information in the file that the processfile() function processes.

NOTE

Use only on the built-in results window for Site Reports (dreamweaver.resultsPalette.siteReports). resWin.addResultItem() cannot be used with other built-in results windows or stand-alone results windows created with dreamweaver.createResultsWindow().


This function is only available in the processFile() callback of a site report. See "Reports" in Extending Dreamweaver for details on site reports.

Arguments

 strFilePath, strIcon, strDisplay, strDesc, {iLineNo}, {iStartSel}, {iEndSel} 

  • The strFilePath argument is a fully qualified URL path of the file to process.

  • The strIcon argument is the path to the icon to use. To display a built-in icon, use a value "1" through "10" instead of the fully qualified path for the icon (use "0" for no icon). The following table shows the icons that correspond to the values of "1" through "10":

  • The strDisplay argument is the string to display to the user in first column of the Results window (usually, the filename).

  • The strDesc argument is the description that goes with the entry.

  • The iLineNo argument is the number of lines in the file (optional).

  • The iStartSel argument is the start of offset into the file (optional, but if it is used, the iEndSel argument must also be used.).

  • The iEndSel argument is the end of offset into the file (required if iStartSel is used).

Returns

Nothing.

resWin.getItem()

Availability

Dreamweaver 4.

Description

Retrieves an array of items that include the name of the command that added the item and the same strings that were passed to the addItem() function.

Arguments

 itemIndex 

  • The itemIndex argument is the index of the item whose data is to be retrieved.

Returns

An array of strings. The first element in the array is the name of the command that added the item; the remaining elements are the same strings that were passed to the addItem() function.

resWin.getItemCount()

Availability

Dreamweaver 4.

Description

Retrieves the number of items in the list.

Arguments

None.

Returns

The number of items in the list.

resWin.getSelectedItem()

Availability

Dreamweaver 4.

Description

Retrieves the index of the selected item.

Arguments

None.

Returns

The index of the currently selected item.

resWin.setButtons()

Availability

Dreamweaver 4.

Description

Sets the buttons specified by the arrButtons argument.

Arguments

 cmdDoc, arrButtons 

  • The cmdDoc argument is a document object that represents the command that is calling the function. Commands should use the keyword this.

  • The arrButtons argument is an array of strings that correspond to the button text and the JavaScript code to execute when the button is clicked. This is similar to the way the commandButtons() function works for commands. Only two buttons can be set in the window.

Returns

Nothing.

resWin.setCallbackCommands()

Availability

Dreamweaver 4.

Description

Tells the Results window on which commands to call the processFile() method. If this function is not called, the command that created the Results window is called.

Arguments

 arrCmdNames 

  • The arrCmdNames argument is an array of command names on which to call the processFile() function.

Returns

Nothing.

resWin.setColumnWidths()

Availability

Dreamweaver 4.

Description

Sets the width of each column.

Arguments

 arrWidth 

  • The arrWidth argument is an array of integers that represents the widths to use for each column in the control.

Returns

Nothing.

resWin.setFileList()

Availability

Dreamweaver 4.

Description

Gives the Results window a list of files, folders, or both to call a set of commands to process.

Arguments

 arrFilePaths, bRecursive 

  • The arrFilePaths argument is an array of file or folder paths to iterate through.

  • The bRecursive argument is a Boolean value that indicates whether the iteration should be recursive (TRue) or not (false).

Returns

Nothing.

resWin.setSelectedItem()

Availability

Dreamweaver 4.

Description

Sets the selected item to the one specified by itemIndex.

Arguments

 itemIndex 

  • The index of the item in the list to select.

Returns

The index of the previously selected item

resWin.setTitle()

Availability

Dreamweaver 4.

Description

Sets the title of the window.

Arguments

 strTitle 

  • The strTitle argument is the new name of the floating panel.

Returns

Nothing.

resWin.startProcessing()

Availability

Dreamweaver 4.

Description

Starts processing the file.

Arguments

None.

Returns

Nothing.

resWin.stopProcessing()

Availability

Dreamweaver 4.

Description

Stops processing the file.

Arguments

None.

Returns

Nothing.

Working with the built-in Results panel group

These functions produce output in the Results panel group. The Results panel group displays tabbed reports on searches, source validation, sitewide reports, browser targets, console reports, FTP logging, and link checking.

Working with specific child panels

The following child panels are built-in Results windows that always exist in the Dreamweaver interface and can be accessed directly. Because these panels are Results windows, you can use the following methods that are defined for stand-alone Results windows:

  • dreamweaver.resultsPalette.siteReports

  • dreamweaver.resultsPalette.validator

  • dreamweaver.resultsPalette.btc (Target Browser Check panel)

For more information about using the resWin methods, see "Creating a Stand-alone Results window" on page 687.

Working with the active child panel

The following general API functions apply to whichever child panel is active. Some child panels might ignore some of these functions. If the active child panel does not support the function, calling it has no effect.

dreamweaver.resultsPalette.clear()

Availability

Dreamweaver MX.

Description

Clears the contents of the panel in focus.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canClear()" on page 1083.

dreamweaver.resultsPalette.Copy()

Availability

Dreamweaver MX.

Description

Sends a copied message to the window that is in focus (often used for the FTP logging window).

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canCopy()" on page 1084.

dreamweaver.resultsPalette.cut()

Availability

Dreamweaver MX.

Description

Sends a cut message to the window in focus (often used for the FTP logging window).

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canCut()" on page 1084.

dreamweaver.resultsPalette.Paste()

Availability

Dreamweaver MX.

Description

Sends a pasted message to the window in focus (often used for the FTP logging window).

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canPaste()" on page 1084.

dreamweaver.resultsPalette.openInBrowser

Availability

Dreamweaver MX.

Description

Sends a report (Site Reports, Browser Target Check, Validation, and Link Checker) to the default browser.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canOpenInBrowser()" on page 1085.

dreamweaver.resultsPalette.openInEditor()

Availability

Dreamweaver MX.

Description

Jumps to the selected line for specific reports (Site Reports, Browser Target Check, Validation, and Link Checker), and opens the document in the editor.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canOpenInEditor()" on page 1085.

dreamweaver.resultsPalette.save()

Availability

Dreamweaver MX.

Description

Opens the Save dialog box for a window that supports the Save function (Site Reports, Browser Target Check, Validation, and Link Checker).

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canSave()" on page 1085.

dreamweaver.resultsPalette.selectAll()

Availability

Dreamweaver MX.

Description

Sends a Select All command to the window in focus.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.resultsPalette.canSelectAll()" on page 1086.

Server debugging

Dreamweaver can request files from ColdFusion and display the response in its embedded browser. When the response returns from the server, Dreamweaver searches the response for a packet of XML that has a known signature. If Dreamweaver finds XML with that signature, it processes the XML and displays the contained information in a tree control. This tree displays information about the following items:

  • All templates, custom tags, and include files that are used to generate the rendered CFM page

  • Exceptions

  • SQL queries

  • Object queries

  • Variables

  • Trace trail

Additionally, the Server Debug panel can display debug data from other server models. To set up Dreamweaver to debug other server models, use the dreamweaver.resultsPalette.debugWindow.addDebugContextData() function.

dreamweaver.resultsPalette.debugWindow.addDebugContextData()

Availability

Dreamweaver MX.

Description

Interprets a customized XML file that returns from the server that is specified in the Site Definition dialog box. The contents of the XML file display as tree data in the Server Debug panel, so you can use the Server Debug panel to evaluate server-generated content from various server models.

Arguments

 treedata 

  • The treedata argument is the XML string that the server returns. The XML string should use the following formatting:

    server debug node

    Root node for the debug XML data

    debugnode

    Corresponds to every node

    context

    Name of item that appears in the context list

    icon

    Icon to use for tree node

    name

    Name to display

    value

    Value to display

    timestamp

    Only applicable to context node

    The following strings are optional:

    jumptoline

    Link to a specific line number

    template

    Name of the template file part of the URL

    path

    Path of the file from server point of view

    line number

    Line number within the file

    start position

    Opening character offset within the line

    end position

    Ending character offset within the line


For example:

<serverdebuginfo> <context> <template><![CDATA[/ooo/master.cfm]]></template> <path><![CDATA[C:\server\wwwroot\ooo\master.cfm]]></path> <timestamp><![CDATA[0:0:0.0]]></timestamp> </context> <debugnode> <name><![CDATA[CGI]]></name> <icon><![CDATA[ServerDebugOutput/ColdFusion/CGIVariables.gif]]></icon> <debugnode> <name><![CDATA[Pubs.name.sourceURL]]></name> <icon><![CDATA[ServerDebugOutput/ColdFusion/Variable.gif]]></icon> <value><![CDATA[jdbc:macromedia:sqlserver:// name.macromedia.com:1111;databaseName=Pubs]]></value> </debugnode> </debugnode> <debugnode> <name><![CDATA[Element Snippet is undefined in class coldfusion.compiler .TagInfoNotFoundException]]></name> <icon><![CDATA[ServerDebugOutput/ColdFusion/Exception.gif]]></icon> <jumptoline linenumber="3" startposition="2" endposition="20"> <template><![CDATA[/ooo/master.cfm]]></template> <path><![CDATA[C:\Neo\wwwroot\ooo\master.cfm]]></path> </jumptoline> </debugnode> </serverdebuginfo>

Returns

Nothing.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

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