Cfs_mancvrpg_live.Fh9 10/1/01 12:37 pm page 1 composite c m y cm my cy cmy k macromedia ® using coldfusion 5 studio coldfusion ® 5 studio macromedia ® ®.
Copyright notice copyright 2001 macromedia, inc. All rights reserved. Macromedia, the macromedia logo, coldfusion, dreamweaver, dreamweaver ultradev, flash, homesite, jrun, quick tag editor, roundtrip, and what the web can be are trademarks or registered trademarks of macromedia, inc. Which may be r...
Contents about this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xi intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xii developer resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Iv contents connecting to servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 enabling secure ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 managing servers . . . . . . . . . . . . . . . . . . . . ....
Contents v chapter 5 writing code and web content . . . . . . . . . 53 inserting code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 inserting tags from the quickbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Vi contents editing code in the tag inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 setting the display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 creating and editing event handler script blocks . ....
Contents vii chapter 8 accessing data sources . . . . . . . . . . . . . . 109 introduction to database tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 working with data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Viii contents displaying the source control toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 sharing project files in visual sourcesafe . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 administering multiuser projects in vss . . . . . . . . . . . . . . . . . . . . . . ....
Contents ix defining attribute categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 building tag editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 defining controls . . . . . . . . . . . . . . . . ....
X contents application object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 methods . . . . . . . . . . . . . . ....
About this book using coldfusion studio is designed to familiarize you with the product’s user interface and productivity tools that you can use to quickly develop high-quality applications and web content. Contents • intended audience ...................................................................
Xii about this book intended audience this book is intended for professional web developers who have a working knowledge of html and web server environments. It introduces you to the coldfusion studio user interface and development tools, and provides instructions for installing, configuring, and us...
Developer resources xiii coldfusion web resources these are just a few of the many sites dedicated to cfml development: • cf advisor online at www.Cfadvisor.Com/api-shl/engine.Cfm . • haznet’s fallout shelter, a cf portal, at www.Hudziak.Com/haznet/cfml.Html . • coldfusion developer’s journal, an on...
Xiv about this book about the documentation the documentation is designed to provide support for the complete spectrum of participants. The print and online versions are organized to allow you to quickly locate the information that you need. The online documentation is provided in html and adobe acr...
About the documentation xv viewing online documentation you can view help for a specific tag, help topics in html format, or online documentation in adobe acrobat (pdf) format. To view help for a tag: • position the cursor in a tag and press f1. Help for the selected tag appears, including syntax an...
Xvi about this book printing online documentation you can print one help topic at a time in the html help, or print as many pages of the help as you need from the adobe acrobat (pdf) format of the help. To print a single help topic in the html help: 1 display the help topic you need to print. For in...
Getting answers xvii getting answers one of the best ways to solve particular programming problems is to tap into the vast expertise of the coldfusion studio developer communities on the coldfusion forum. On the macromedia web site. Other developers on the forum can help you figure out how to do jus...
Xviii about this book.
Chapter 1 setting up the product this chapter contains instructions for installing or upgrading coldfusion studio and configuring it. Contents • system requirements ................................................................................................. 2 • installing or upgrading.............
2 chapter 1 setting up the product system requirements following are the minimum installation requirements: • pentium-compatible processor (pentium ii or higher recommended) • windows ® 98, me, nt 4, 2000, xp • internet explorer 4.5 or higher • 128 mb available ram • 256-color monitor capable of 800...
Completing setup 3 5 follow the instructions in the installation wizard. 6 once the program files are copied to your system, select the option to restart your machine and click finish to complete the installation. The upgrade is completed. Completing setup this section explains how to initially set ...
4 chapter 1 setting up the product setting up for the first time this section explains how to complete the initial configuration wizard (icw) if you installed coldfusion studio for the first time, or if you uninstalled and installed it. To complete the icw after a first-time installation: 1 the icw ...
Completing setup 5 • if the previous version contained customizations such as shortcuts, snippets, code templates, and modifications to tag completion and tag insight, then the upgrade feature customizations dialog box appears. Select every customization that you want to carry over to the current ve...
6 chapter 1 setting up the product monitoring system resources coldfusion studio’s extensive use of gdi and user resources under windows 98/me has consistently caused problems for users on these platforms. This section describes the problem and how to mitigate it. For more information, also see know...
Monitoring system resources 7 using the resource level monitor this section explains how to respond to warnings and how to configure the monitor. Responding to warnings the following graphic is an example of the warning dialog box that appears if you have the default warning threshold for gdi resour...
8 chapter 1 setting up the product.
Chapter 2 configuring browsers and servers this chapter contains instructions for setting up browsers and servers. Contents • configuring the internal browser ............................................................................ 10 • configuring external browsers ................................
10 chapter 2 configuring browsers and servers configuring the internal browser the following sections describe the choices available for browsing documents and application pages from within studio. Setting the internal browser options you can use the internal browser to view documents in a web brows...
Configuring external browsers 11 configuring external browsers as part of the installation process, the program compiles a list of the web browsers it detects on your system. You can view, add, edit, and delete browsers; you can change the default browser ; and you can set the browsers’ file saving ...
12 chapter 2 configuring browsers and servers to delete a browser from the list: 1 select options > configure external browsers to open the external browsers dialog box, if it is not already open. 2 click the browser to remove from the list and click delete. 3 click yes in the message that appears t...
Working with files on remote servers 13 working with files on remote servers working with directories and files on remote servers is virtually identical to working with them on local or network drives. For example, when you save files, changes are saved to the remote server . The primary difference ...
14 chapter 2 configuring browsers and servers 2 select the appropriate compatibility option: • allaire homesite/studio 4.5.2 enables the remote server functionality in both this version and in previous versions and changes the name of the sne node to “allaire ftp & rds.” • macromedia homesite/studio...
Working with files on remote servers 15 to connect to an ftp server: 1 open the drive list at the top of the files tab and select macromedia ftp & rds. You can also access this feature from windows explorer. 2 right-click macromedia ftp & rds and select add ftp server to open the configure ftp serve...
16 chapter 2 configuring browsers and servers 4 click ok to complete the configuration. You can now work with files on the server. To view and edit the configuration for a remote server: 1 right-click the server in the macromedia ftp & rds list and select properties from the popup menu. 2 make the n...
Working with files on remote servers 17 to enable ssl for an ftp connection: 1 open the properties dialog box and select the secure (ssl) option. 2 click the configure ssl button and make the appropriate certificate entries. Click the help button for information on these settings. 3 click ok. This t...
18 chapter 2 configuring browsers and servers connecting to an rds server complete the following configuration procedure for each coldfusion server that you want to access. To connect to an rds server: 1 in coldfusion studio, click the files tab at the bottom of the resources window. 2. Open the dri...
Working with files on remote servers 19 adding server mappings a development mapping is essential for working with files via remote development services ( rds ). Mappings serve two purposes: • to enable server-based processing of pages from within coldfusion studio • to enable debugging of applicati...
20 chapter 2 configuring browsers and servers anwer these questions in the rds dialog box: • studio path how does coldfusion studio see the directory? • coldfusion path how does the web server /coldfusion server see the directory? • browser path how does the browser see the directory? Note an error ...
Working with files on remote servers 21 for example, a user might have a remote drive x:\ mapped to a network shared directory \\myserver\webprojects\ where webprojects is the name of the shared directory in the network server myserver. In such a scenario, a file that appears to studio as x:\app1\in...
22 chapter 2 configuring browsers and servers using remote development services when developing outside local area networks, you access files on a coldfusion server across the internet using remote development services (rds). In such a scenario, a file that appears to studio as rds://my_rds_server/c...
Working with files on remote servers 23 to edit a mapping: 1 select a mapping from the list. 2 make changes as necessary and click update. To change to a different mapping: • select the mapping to switch to in mappings list. To set a mapping as the default: 1 select options > settings and click brow...
24 chapter 2 configuring browsers and servers.
Chapter 3 exploring the workspace this chapter acquaints you with the main areas of the interface. It also gives you some pointers on customizing the workspace to make all of your development work as productive as possible. Contents • the workspace areas ................................................
26 chapter 3 exploring the workspace the workspace areas the term workspace describes the user interface that you see when you first load the program. The workspace has four principal areas: • command area at the top of the workspace is the title bar, which displays the file path of the current docu...
Working in the resources window 27 setting workspace options selecting options > settings (f8) opens the control center for user preferences. By navigating the feature tree in the left pane, you can view and change options for file management, coding, and testing applications and web content. Workin...
28 chapter 3 exploring the workspace • snippets tab provides a convenient place to store code blocks and content for reuse. Snippets can also be shared with other users. • help tab contains product documentation and other online resources. You can customize the help by adding help files and editing ...
Creating and browsing files in the document window 29 creating and browsing files in the document window the document window is the center for code and content development. It has tabs for working in edit and browse mode, and to view help. You can press f12 to switch from the help to edit tab, and p...
30 chapter 3 exploring the workspace help tab this tab displays tag-specific help and pages from the help references. This tab becomes visible in the workspace when you first open it. To open the help tab, do one of the following: • press f1 in a tag editor • select a tag in tag chooser and press f1...
Customizing the workspace 31 customizing the workspace there are many ways to customize the look and functionality of your workspace, including setting the display and positioning of toolbars and resource window tabs; assigning shortcut keys for commands, code snippets, and scripts; and creating cus...
32 chapter 3 exploring the workspace to hide or show a toolbar: 1 in the customize dialog box, in the visible toolbars box, clear the checkbox next to the toolbar you want to hide. 2 to show a toolbar, select the checkbox next to the toolbar in this same list. Tip to reset the default settings for w...
Customizing the workspace 33 3 in the toolbuttons box, click the vertical scrollbar and drag it down until you see the button you want to add. 4 click the button in the toolbutton box and drag it to a free space in the toolbar shown under toolbar view. The button is added to the toolbar. 5 click clo...
34 chapter 3 exploring the workspace 3 on the toolbar shown under toolbar view, drag each button you want to move to its new location. The buttons are rearranged in your toolbar as you make changes. 4 click close to return to working in the product. To remove a button from a toolbar: 1 select option...
Getting the most from the help system 35 getting the most from the help system the online help system encompasses a variety of features: • pop-up help for basic tag syntax (f2) • comprehensive context-sensitive tag help (f1) • embedded help in tag editors, tag chooser, and expression builder (f1 and...
36 chapter 3 exploring the workspace bookmarking help topics you can quickly access your favorite help documents by bookmarking them. You can assign bookmarks to documents in the help tree, the file system, or the internet. To bookmark a document in the help tree: • if the help document is closed, r...
Getting the most from the help system 37 searching help references you can access a book’s online index in the help reference tree, or you can search the entire set of help references using simple to complex search criteria. Using an online index with the exception of language references, each book ...
38 chapter 3 exploring the workspace 5 click the search button to display the search results in the help references pane. 6 double-click a document in the results list to open it. The results list is saved until a new search is run, so you can return to the document list by clicking the search resul...
Getting the most from the help system 39 members of the macromedia documentation group then attempt to correct errors and clarify points directly on the comments page. Larger documentation issues are targeted to the next product release. And, in general, they use your feedback to assess the effectiv...
40 chapter 3 exploring the workspace to add documents to the help tree, do one of the following: • write an html help file and save it to a folder in the help directory • use standard windows commands to paste a file into a help folder • display the document to add in a web browser and then choose t...
Getting the most from the help system 41 adding media content you have considerable flexibility in adding supporting files (such as graphics, animations, video, and sound) to help documents. There are two ways to do this: • create a file structure in the help tree that conforms to the media file ref...
42 chapter 3 exploring the workspace.
Chapter 4 managing files this chapter describes how to perform file management tasks such as opening, closing, saving, and automatically backing up files. This chapter also describes how to work with unicode and dbcs (double-byte character support) files. The tasks described in this chapter do not r...
44 chapter 4 managing files about the files tabs the files tabs in the resources window give you access to servers, drives, directories, and files without having to go to windows explorer. Having two files tabs reduces the amount of file system navigation needed to work across multiple directories a...
About file encoding 45 the files tabs use these rules to determine which directory is the current directory: • when browsing to a file in a tag editor , the current directory is the folder that the current document is in. Options > settings > general > display current folder in file dialogs must be ...
46 chapter 4 managing files working with files you can use the following procedures to work with files, regardless of their location (local drive, network drive, or remote server ). Opening and saving files refer to the current directory. For information about how coldfusion studio determines the cu...
Working with files 47 to open an encoded file: • before opening the file, make sure you have unicode formatting enabled. If you do not, enable it. For instructions, see “about file encoding” on page 45 . If you attempt to open a unicode file without having selected the enable non-ansi file encoding ...
48 chapter 4 managing files use the save commands from the file menu or the standard toolbar icons to save and close files. Open the settings dialog box (f8) and use the file settings pane to specify a format for saved files. The default is pc, but unix and macintosh formats are available. You can s...
Working with files 49 how auto-backup works following are the steps that the product takes in order to back up your files: 1 a default autobackup folder is created below the product directory during installation. You can change the location to a different local or network directory as needed. 2 a co...
50 chapter 4 managing files to recover unsaved files after the application closes abnormally: 1 open coldfusion studio again. 2 if you have set options for timed auto-backup, the timed auto-backup recover dialog box automatically appears. Recover each lost file by selecting it and clicking ok. 3 oth...
Working with files 51 building a favorite folders list you can build a list of favorite folders to make accessing their files easier. To add a folder to the favorites list: 1 select the folder in the directory list. 2 in the file list, right-click and select favorite folders > add current folder to ...
52 chapter 4 managing files to copy web page content do one of the following: • to select a block of text on a web page and insert it into a document, use windows copy and paste commands. Note that page formatting is not preserved. • to copy the code behind a web page, use the browser’s command to v...
Chapter 5 writing code and web content coldfusion studio manages many different web development tasks, from writing simple html pages to designing, testing, and deploying complex, dynamic sites. This chapter describes basic techniques for creating web content and application code. Contents • inserti...
54 chapter 5 writing code and web content inserting code coldfusion studio coding tools support a range of writing styles, from typing to point-and-click, and you can set the level of support you want: for repetitive tasks, you can use its productivity tools to enter repeated code blocks and require...
Inserting code 55 selecting tags from the tag chooser the tag chooser provides access to the tag set in all supported languages. For details, see “about language support” on page 84 . To use the tag chooser: 1 in the editor, right-click and select insert tag. The left pane in the tag chooser display...
56 chapter 5 writing code and web content completing tags with tag editors you can use a tag editor to add a lot of content within an existing tag, for example in the body tag. To complete the details for a tag: 1 in the editor, position the cursor in the tag to complete. 2 right-click, and select e...
Using inline tools to enter code 57 using inline tools to enter code you have a number of tools to help you easily insert new code and to edit existing code as you type. Each of these tools supports a distinct language element, such as tags, objects, and functions. You can set the options for these ...
58 chapter 5 writing code and web content • to change an attribute: delete the attribute and add a new attribute. • to add a value: press the spacebar after the attribute to display a drop-down list of known values for the attribute. Select a value and press enter. • to change a value: delete the va...
Using inline tools to enter code 59 auto completion auto completion completes a code block by inserting the appropriate code when you type the opening code fragment (trigger string). You can set options for this feature in the options > settings > editor > auto completion pane. Only a few strings ar...
60 chapter 5 writing code and web content extended and special characters to enter special characters and latin-1 extended characters, you can either type the ascii code or select the character from the list available in view > extended and special characters. If you need to change the character to ...
Adding document content 61 adding document content the default template contains just the code required for a valid html document. This default template is stored as \wizards\html\default template.Htm below your root directory. You can edit this file and save it to change its content. To open a new ...
62 chapter 5 writing code and web content to add content in a visual wysiwyg editor: 1 select view > open in macromedia ultradev. • if no ultradev menu command or button appears, select options > settings > dreamweaver/ultradev > enable dreamweaver/ultradev integration. • if the menu command does no...
Using keyboard shortcuts 63 using keyboard shortcuts keyboard shortcuts are active for many file management, editing, and debugging commands. To see the current keyboard assignments: 1 select options > customize from the menu. 2 click the keyboard shortcuts tab. To print the list of shortcut keys: 1...
64 chapter 5 writing code and web content saving code blocks as snippets with code snippets, you can easily store code blocks and content for reuse. Comment your snippets just as you would any code block. To create a code snippet: 1 before adding a snippet, you must create a folder. To do so, click ...
Saving code blocks as snippets 65 sharing snippets you can share code snippets with other developers by giving them access to a shared folder on your machine or on another network machine. To create a shared snippets folder: 1 open options > settings > locations. 2 in the shared snippets box, use th...
66 chapter 5 writing code and web content making web sites accessible to visually impaired visitors the w3c web accessibility initiative at http://www.W3.Org/wai/ provides a great deal of practical information about designing applications and interfaces for the broadest range of users. Macromedia su...
Tips for visually impaired users 67 tips for visually impaired users macromedia is committed to enabling a high level of accessibility in our products. Coldfusion studio includes support for customizable keyboard shortcuts and browser-based html online documentation, including alt text for all image...
68 chapter 5 writing code and web content using shortcut keys for common tasks here are a few handy shortcuts: • press f11 opens the current document in the default external browser, then use alt+tab to move between the applications. • f9 toggles the resources window display. • shift+f9 changes the ...
Chapter 6 editing pages a wealth of interface options and tools for updating code and content make editing chores easier. Contents • setting editor options .............................................................................................. 70 • selecting code and text blocks.................
70 chapter 6 editing pages setting editor options the flexible editing environment gives you control of all aspects of this critical feature. Using the editor toolbar the column between the document window and the resources window contains the editor toolbar. These toolbuttons give you quick access ...
Setting editor options 71 to set a bookmark at the insertion point, select edit > toggle bookmark. The bookmark symbol appears in the gutter. Bookmarks are not saved when you close the file. Using the settings dialog box open options > settings > editor to configure the editor display options. Expan...
72 chapter 6 editing pages selecting code and text blocks you can use the mouse and standard windows keyboard commands to highlight sections of a document, or use the following shortcuts to quickly select and edit tag blocks: • to select an entire code block, press shift+ctrl and double-click in eit...
Collapsing text 73 collapsing text when editing long documents or complex applications, you can hide text and code blocks so that you can focus on just a portion of the content. A customizable marker displays the first few characters of the collapsed selection. Setting options to set any of the foll...
74 chapter 6 editing pages editing referenced files you can edit image files and included files from coldfusion studio. Editing image files if macromedia fireworks® is installed on your computer, you can open your gif , jpg , and png image files for editing in fireworks. You can also preview an imag...
Editing referenced files 75 3 edit the image in fireworks. 4 when you are done, save your changes and close fireworks. Editing included files you can edit included files in certain tags. To open an included file for editing: 1 in the editor, right-click in one of these tags: • • • • • • • • •.
76 chapter 6 editing pages using tag editors tag editors are tag-specific dialog boxes that contain the attributes and values of the selected tag. Online help is available in each tag editor. Tag editors fully support coldfusion server 5. About vtml tag editors you can choose from two different tag ...
Navigating a document structure in the tag tree 77 navigating a document structure in the tag tree the tag tree is located in the top pane of the tag inspector tab of the resources window. It is helpful for inspecting and navigating a document’s structure. You can easily configure it to display just...
78 chapter 6 editing pages tip if you prefer to work in a graphical user interface, display the tag inspector resource tab and click the configure outline profiles toolbutton in the top pane. The outline profile editor dialog box appears, in which you can create and edit outline profiles. Configurin...
Editing code in the tag inspector 79 to work with imported dtd information: 1 open the tag inspector. 2 select dtd elements and entities from the drop-down list at the top of the tag tree pane. 3 open a document that adheres to a dtd that you have imported. If you have imported multiple dtds, the co...
80 chapter 6 editing pages creating and editing event handler script blocks adding and modifying script blocks for events such as onclick is easy from the tag inspector. You can edit an event if it is supported as an attribute of the selected tag or edit the event directly. To add an event handler s...
Formatting pages with cascading style sheets 81 formatting pages with cascading style sheets cascading style sheets ( css ) can be added at any point in a site’s development process, but ideally the design specification for a site will be implemented via style sheets, eliminating the need to code an...
82 chapter 6 editing pages.
Chapter 7 using web development languages this chapter describes language support in coldfusion studio, and provides specific information for setting language-specific options and color coding schemes, coding in xhtml , validating against different language specifications., and working with tag defi...
84 chapter 7 using web development languages about language support this section describes what languages are supported, how to get around limitations, and provides an overview of how coldfusion studio detects and handles a language. What languages are supported coldfusion studio has a significant a...
About language support 85 how a language is detected on a document level, coldfusion studio determines the language based on the document’s doctype declaration. If there is no declaration, the program treats the document content as html. In the case of xhtml , when you enable options > set document ...
86 chapter 7 using web development languages setting options for markup languages this section provides instructions for setting language-specific options. For setting specific options for xhtml , also see “setting options for xhtml” on page 88 . To set language options: 1 open the options > setting...
Setting options for markup languages 87 3 in the insert special characters as box, select how characters should be represented in the code when you insert them from the view > extended and special characters palette . Following is an example for each option: • character entities insert the ampersand...
88 chapter 7 using web development languages 9 if you process documents as activescript, add the execute current document as activescript toolbutton to a toolbar. 10 when you are done, click close. Coding in xhtml coldfusion studio makes it easy to code in xhtml. You can set xhtml-specific options, ...
Coding in xhtml 89 4 under the markup languages pane, in the html/xhtml pane, select compatibility mode for older browsers (e.G., space before “/>”). This ensures that your code displays properly in older browsers, for example by inserting a space before minimized empty tags ( instead of ). 5 select...
90 chapter 7 using web development languages 3 if you do not want the dialog box to display again and you will always use the same doctype declaration, then select always replace with this dtd. 4 if you do not want to display this dialog box, and you never want to replace or insert a doctype declara...
Using regular expressions 91 special characters because special characters are the operators in regular expressions, in order to represent a special character as an ordinary one, you need to precede it with a backslash. To represent a backslash, for instance, use a double backslash (\\). Single-char...
92 chapter 7 using web development languages character classes you can specify a character by using a posix character class . You enclose the character class name inside two square brackets, as in this replace example: "macromedia’s web site","[[:space:]]","*","all") this code replaces all the space...
94 chapter 7 using web development languages expression examples the following table shows some regular expressions and describes what they match: expression description [\?&]value= a url parameter value in a url [a-z]:(\\[a-z0-9_]+)+ an uppercase dos/windows full path that is not the root of a driv...
Using color coding schemes 95 using color coding schemes language color coding helps you to identify code blocks in large documents and to distinguish between language types. The default color coding scheme is for html, but you can use any of these color coding schemes for your documents: • activese...
96 chapter 7 using web development languages setting the tag display it is easy to implement a custom code scheme by changing the default colors and font styles. To change a color scheme: 1 open color coding under options > settings > editor. 2 select the scheme you want to change. 3 click the edit ...
Preserving code formats with codesweepers 97 preserving code formats with codesweepers the codesweeper feature automates the task of getting your code properly formatted. It can be useful in a number of situations: • you can enforce coding styles for multiple developers by having them set the same c...
98 chapter 7 using web development languages running a codesweeper select tools > codesweeper, then select a codesweeper from the dropdown list. To set the default codesweeper: 1 open options > settings > codesweeper. 2 highlight a codesweeper entry in the list and click the set as default button. 3...
Preserving code formats with codesweepers 99 5 create a custom profile for it, following the steps in the next procedure for editing a codesweeper. 6 when you are done, click apply. To edit a codesweeper: 1 select options > settings > codesweeper. 2 highlight a codesweeper in the list and click the ...
100 chapter 7 using web development languages macromedia codesweepers treat the colon character (:) in tag names as a normal character, allowing the processing of xml namespaces in tags such as name="foo"/> . Tag-specific options a wide range of options is available for the individual tags contained...
Preserving code formats with codesweepers 101 setting html tidy options following are brief instructions for adding or editing an html tidy profile. For more information, please see the html tidy web site at www.W3.Org/people/raggett/ tidy/. You can access this web site from the html tidy settings p...
102 chapter 7 using web development languages validating code you can use the coldfusion studio validator, or integrate the cse html validator to work within coldfusion studio. Using the default validator you can use the coldfusion studio validator to check and report syntax errors in html (includin...
Validating code 103 5 if you need to validate something beyond the scope of the specifications selected in the options > settings validation pane, use the other tabs in this dialog box. Following is a description of what you can do on each tab: • tags require a tag, specify if a tag is case-sensitiv...
104 chapter 7 using web development languages example: validating against the html 4.0 specification 1 in the options > settings > validation pane, select html 4.0. 2 click validator settings. 3 in the validator configuration dialog box, on the options tab, in the report box, select every type of er...
Validating code 105 to validate the contents of a single tag, do one of the following: • manually validate a tag by positioning the cursor inside the tag and selecting tools > validate current tag from the menu. • validate each tag as you type by opening the options > settings > validation pane, sel...
106 chapter 7 using web development languages working with tag definitions tag definitions are the source of information for tag editors, tag insight, and tag inspector in coldfusion studio. These are the namespaces for which tag definitions are installed: xhtml, html, cfml, vtml, jsp, java, jrun, w...
Working with tag definitions 107 3 if you want the current document’s type to receive the highest priority regardless of the precedence set in this pane, select current document’s namespace receives highest priority. For information about how a document’s namespace is determined, see “how a language...
108 chapter 7 using web development languages.
Chapter 8 accessing data sources this chapter describes how to use the visual tools in coldfusion studio to accelerate development of data-driven coldfusion applications. Contents • introduction to database tools ............................................................................. 110 • wor...
110 chapter 8 accessing data sources introduction to database tools visual database tools support application development that uses local, network, and remote data sources. When you configure a server , access to data sources becomes transparent. The coldfusion studio database tools support: • devel...
Working with data sources 111 connecting to data sources data sources that are registered in the coldfusion administrator are automatically accessible from the database tab in coldfusion studio. To access remote data sources, you can add remote coldfusion servers ( rds servers). To add a remote serv...
112 chapter 8 accessing data sources using sql builder for database queries sql builder is a powerful visual tool that you can use to build, test, and save sql statements for use in application data queries. You can copy a sql code block directly into your application or insert it into a cfquery tag...
Using sql builder for database queries 113 the sql builder user interface the following graphic shows the sql builder user interface: the sql builder is divided into these sections: • toolbar contains buttons for sql keywords and commands • table pane provides a view of the tables in a query and let...
114 chapter 8 accessing data sources to change the type of sql statement: 1 open sql builder. For instructions, see the opening sql builder procedure earlier in this section. 2 select a statement type from the sql builder toolbar. Building a select statement sql select statements let you specify dat...
Using sql builder for database queries 115 note coldfusion studio does not update the properties and table panes when you make changes in the sql pane. If you edit a sql statement in the sql pane and save it, and then modify the table pane or change any values in the properties pane, a new sql state...
116 chapter 8 accessing data sources testing and editing queries you can refine sql statements after constructing them. Testing queries before inserting a query into an application, we recommend that you test it in sql builder. The following procedure explains how to run a query for testing. Caution...
Chapter 9 debugging application code for debugging simple pages, using debugging information that is reported from the application server is adequate, but complex development tasks require a more powerful and immediate debugging interface. The interactive debugger runs against dynamic pages on the c...
118 chapter 9 debugging application code overview of the interactive debugger you can run the debugger against your application pages to find errors in your code, when remote development services ( rds ) is enabled and a server mapping is defined. Debugging is not supported on windows 98. The debugg...
Setting up a debugging session 119 the remote development settings dialog box appears: 3 if coldfusion server is installed on the same computer as coldfusionstudio, select the server in the debug on rds server box, on the debug start tab. 4 if coldfusion server is not installed on the same computer ...
120 chapter 9 debugging application code b in the remote host box, enter the rds server description, host name , and port. (optional) select the use secure sockets layer (ssl) option. C in the coldfusion rds security box: if coldfusion rds security is implemented on your system, enter a username and...
Using the interactive debugger 121 8 for each debugging mapping, repeat the previous step. 9 click ok. The remote development settings dialog box closes you can begin debugging in the editor. Using the interactive debugger running the interactive debugger helps you find problems in code by tracing h...
122 chapter 9 debugging application code 3 in the debug toolbar, click the start/continue tool. The remote development settings dialog box displays the default local server. 4 enter the start url, which is the page url. Click ok. The list box displays the pages that are open in coldfusion studio. En...
Using the interactive debugger 123 debugging across multiple pages the debugger is active after a page is loaded, until you click end on the debug toolbar or select debug > end. This lets you debug applications across multiple html and cfml pages. For example, you can test the submittal of an html f...
124 chapter 9 debugging application code 4 to add an expression in the evaluator list box to the list of watched expressions, select watch. The watch area shows the values of watched expressions and any error messages in resolving these parameters. 5 to continue debugging, click the start/continue b...
Chapter 10 managing a web site with projects this chapter describes how to use a coldfusion studio project to manage the files in a web site. Contents • understanding projects .......................................................................................... 126 • creating a project ...........
126 chapter 10 managing a web site with projects understanding projects this section explains what a project is, the benefits of organizing your work in projects, the different type of project folders you can use, and the project (.Apf ) file. What is a project? A project is a collection of files th...
Understanding projects 127 the location of a manual-inclusive folder cannot be changed. • auto-inclusive folders include every file in the mapped directory by definition. You can specify which file types you would like to include (for example, all the html files) but you cannot specify individual fi...
128 chapter 10 managing a web site with projects creating a project when you create a project , you must specify a folder to hold the project file. This folder must already exist somewhere on your computer. If the existing folder has files and subfolders, you can add them to the project. After creat...
Creating a project 129 to create a project: 1 create a folder on your computer to hold the new project, if the folder does not already exist. 2 select project > new project from the menu. The new project dialog box appears. 3 complete the new project dialog box as follows: • project name type a desc...
130 chapter 10 managing a web site with projects to add a physical folder: 1 right-click the parent for the new manual-inclusive folder (either the project root or any other folder) and select add folder from the popup menu. The add a project folder dialog box appears. 2 type a folder name in the fo...
Creating a project 131 adding files the methods for working with a file in a project can vary slightly, depending on the type of folder that contains the file. You can perform standard drag and drop operations to move files from the projects file list in the bottom pane of the projects tab into proj...
132 chapter 10 managing a web site with projects 3 click ok. The list of included files is filtered according to the extensions you specified. Working with a project within a project you can run all the standard file management and maintenance operations that you perform on individual files. You can...
Working with a project 133 3 change or specify project properties as necessary, and click ok. The following table shows the properties you can set at each of the project levels: to delete a project: 1 select project > delete project from the menu, or right-click the project and select delete project...
134 chapter 10 managing a web site with projects 3 select individual resources in the resource name column. 4 if necessary, add a resource: a click the add button to display the add project resource dialog box. B type a name for the resource in the resource name box. C in the resource filter box, ty...
Managing a project with a source control system 135 perform other project-level tasks you can perform other project-level tasks that are described in other sections of this documentation. The following table lists these tasks and their related sections. Managing a project with a source control syste...
136 chapter 10 managing a web site with projects coldfusion studio automatically generates a list of source control applications detected on your system when you first select the choose source control provider command for a project. You can then select the appropriate provider from the list. The use...
Managing a project with a source control system 137 6 right-click the project root and select source control > map project to source control. You might be required to login to vss at this point. 7 in vss, select file > add files and add the contents of your coldfusion studio project directory to the...
138 chapter 10 managing a web site with projects sharing project files in visual sourcesafe knowledge base article 14856 covers the steps required to set up multiple user access to project files in source control. Administering multiuser projects in vss if you are responsible for setting up visual s...
Chapter 11 deploying files deployment is the process of copying all of the files in your project to one or more host servers. You can specify a deployment path for the entire project or for individual folders and files. This chapter describes how to specify options and deploy files to a server . Con...
140 chapter 11 deploying files setting default deployment options optionally, you can specify options to apply for every deployment by default. To set other project deployment options: 1 select options > settings > projects > deployment from the menu. 2 specify logging options: • if you do not want ...
Deploying singles files and folders 141 deploying singles files and folders this section provides instructions for deploying a single folder or file to one or more servers. To deploy to a single location: 1 on the projects tab, right-click a file and select deploy file from the popup menu, or right-...
142 chapter 11 deploying files performing custom deployments this section describes the advanced method of deployment that offers maximum flexibility and functionality. This method involves building an absolute path for the product to deploy the files. This absolute path is comprised of three parts:...
Performing custom deployments 143 setting folder level deployment the folder level of deployment allows you more flexibility, but requires more steps. To set deployment for a folder: 1 right-click the folder and select properties. The edit folder properties dialog box appears. 2 click the deployment...
144 chapter 11 deploying files absolute deployment path option you use the absolute deployment path option to specify the exact path and server to which the product deploys the file or folder. Note that you cannot use this option to deploy to more than one server. Do not deploy option the do not dep...
Performing custom deployments 145 to edit properties for a deployment server: 1 expand the deployment servers node in the top pane of the projects tab. 2 right-click the server whose properties you want to change and select properties from the popup menu. 3 make changes in the configure ftp server o...
146 chapter 11 deploying files 4 specify options for deploying to local host or to one or more remote servers: • to deploy to local host, select local/network deployment, set file handling options, and click next. • to deploy to one or more remote servers, click remote rds/ftp deployment and click n...
Performing custom deployments 147 5 select either vbscript or jscript from the script language options. 6 a path name based on the project name is automatically entered for the script in the save script to file box. You can change it by entering a new path name or clicking the browse button to use t...
148 chapter 11 deploying files to remove a deployment script: 1 in the top pane of the projects tab, expand the deployment scripts node. 2 right-click the script to remove and select remove script from the popup menu. 3 click yes to confirm that you want to remove the script. The script is removed f...
Chapter 12 testing and maintaining web pages as your web site develops, you will need to make changes and test its accuracy, completeness, and efficiency. Coldfusion studio provides a full set of tools to accomplish these necessary tasks. Contents • working in the results window .......................
150 chapter 12 testing and maintaining web pages working in the results window the results window is a section of the user interface that you can display if you want, but otherwise it only appears when you need it—when you need to see the results of an operation such as an extended search or link ve...
Working in the results window 151 to manually open the results window: 1 select view > results from the menu. 2 to close the window, right-click in the results window and select close results. You can also press shift +ctrl+l to alternate between opening and closing the results window. To open speci...
152 chapter 12 testing and maintaining web pages searching documents coldfusion studio provides basic and extended search capabilities. These enable you to find and replace alphanumeric strings—including regular expressions—across folders and projects, filter the files to search by file type, select...
Searching documents 153 to use a saved search string in an extended search: 1 in the extended find or extended replace dialog box, click the arrow button next to the find what box and select open find text from the popup menu. 2 in the open find text dialog box, select the search string to use and c...
154 chapter 12 testing and maintaining web pages using extended search commands you can use the extended find and extended replace commands to perform more complex search operations across multiple documents. Extended search and extended replace operations include untitled, unsaved documents. They a...
Searching documents 155 • skip tags while searching to search only the page content, not the tags themselves—especially useful when searching for words like width or value. This option is not available when regular expressions is selected. • exlude binary files to skip over binary files such as exe,...
156 chapter 12 testing and maintaining web pages • in project replaces text in the documents of a project. You can select a project from the drop-down box, type a full path, or browse to the project. If you want to limit your search and replace operation to files of certain types, select a filter fr...
Searching documents 157 to edit a document for a match: 1 double-click a match in the results list. This opens the document in the editor if it is not already open, and highlights the match in the document. 2 edit the file as necessary, and then save and close it. To edit documents for more than one...
158 chapter 12 testing and maintaining web pages searching with regular expressions you can use regular expressions (or regexp) to match patterns in character strings during extended find and extended replace operations. To search with regular expressions: 1 select search > extended search or search...
Checking spelling 159 checking spelling you can check the spelling of your document content and, optionally, code syntax. This section provides instructions for configuring and using the spell checker. Configuring the spell checker this section describes how to configure your spell checker to best m...
160 chapter 12 testing and maintaining web pages 3 in the user dictionary box, accept the default entry or specify an alternate location and text file to supplement the main dictionaries. For more information, see “about the user dictionary” on page 160 . 4 in the options box, select every option th...
Checking spelling 161 about spell checker options this table describes the options that you can select to customize the spell checker: option result when selected example case sensitive checking treats different capitalizations of the same word as different words state is different from state ignore...
162 chapter 12 testing and maintaining web pages using the spell checker you can mark spelling errors in the current document, run the spell checker against the current document, or run the spell checker against all open documents. To spell check, do any of the following: • to mark mispellings in th...
Verifying links 163 verifying links coldfusion studio simplifies the job of maintaining sites by testing each link in a selection and reporting any problems it finds. You can verify links to local html files, graphics and other media files and other web sites. By default, coldfusion studio checks al...
164 chapter 12 testing and maintaining web pages to verify links in the current document: 1 select tools > verify links from the menu to open the links tab on the results window. 2 the link list shows the following information for each link in the document: then, coldfusion studio checks each link i...
Verifying links 165 to verify links in a project: 1 in the resources window, on the projects tab, right-click a project name and select verify links. 2 in the verify links in project dialog box, select a root url option for project files. 3 (optional) set a timeout value for the processing of each l...
166 chapter 12 testing and maintaining web pages using site view to check page links site view provides a graphic representation of each link , beginning in the current document. You can view the links in a tree or chart format. Each link is identified by a file type icon (internal, web, image, mail...
Testing page download times 167 testing page download times a document’s weight, that is, the time it takes for the page to download, is a good metric for testing a site’s design and effectiveness. Public sites and intranets with remote users must achieve a balance between attractive content and tol...
168 chapter 12 testing and maintaining web pages to set the root url for an ftp server: 1 in the resources window, click a files tab. 2 in the drive list, select macromedia ftp & rds. 3 right-click a server name and select properties. 4 in the configure ftp server dialog box, complete the root url f...
Chapter 13 customizing the development environment this chapter introduces the visual tools markup language (vtml) and the wizard markup language (wizml), tag-based languages that are used internally by homesite, coldfusion studio, and jrun studio. You can use vtml to generate tag-specific dialog bo...
170 chapter 13 customizing the development environment the visual tools markup language (vtml) you can change the content and layout of tag editors by editing vtml files directly in the visual tools. This makes it easy to update tag syntax or change embedded help text. You can also create your own e...
Customizing the tag chooser 171 customizing the tag chooser the tag chooser contains all supported tag sets and is the primary interface for tag selection. The screen shot shows the tag chooser with an html tag highlighted and the embedded help for that tag displayed. Pressing the select button open...
172 chapter 13 customizing the development environment the content and the behavior of these tools is controlled by two templates: markuptags.Vtm and expressionelements.Vtm. Both are located in the \extensions\ subdirectory of your visual tools installation directory. Two vtml tags, cat and e , let ...
Dialog definition files 173 dialog definition files the structure of the included files referenced in markuptag.Vtm and in expressionelements.Vtm is very simple. They contain a set of category and element tags. Category tags can contain any number of elements or other nested category tags. The follo...
174 chapter 13 customizing the development environment creating tag definitions interfaces such as tag insight and tag inspector require tag-specific information to operate properly. For instance, the tag inspector needs to know the attributes of the tag being entered, the type of each of those attr...
Creating tag definitions 175 you can create the definition file in three ways: • write it manually. • create it from an existing tag definition file. • use the tag definitions library dialog box to add a tag and edit the generated file. Defining attributes the attributes block defines attributes ins...
176 chapter 13 customizing the development environment building tag editors defining a tag editor is composed of three tasks: 1 layout the dialog box controls. 2 specify how to populate the controls with tag attributes. 3 define the tag generation template. Open the \extensions\tagdefs\mytag.Vtm fil...
Building tag editors 177 populating dialog boxes with tag data once the layout of controls is completed, you need to define the way in which the editor controls are populated when you are editing an existing tag. This is done in the attributes block of the main tag editor template. The attributes bl...
178 chapter 13 customizing the development environment variables passed to the layout template the value of each control of the tag editor is passed to the template using a variable with the same name, for example, a colorpicker control named colorbgcolor will pass its value in a colorbgcolor variab...
Building tag editors 179 using optionlinearlayout here is a version of the mytag layout template that responds to user preferences for single line or indented layout: "$${spacer}size="$${txtsize}"> the template would generate a tag based on the following user layout preference: linear: nonlinear: fa...
180 chapter 13 customizing the development environment adding tag help you can associate an html-based help document with a tag by embedding the help text inside the tagdescription block. Here is an example of a tagdescription block and the result in a tag editor: cfapplication defines scoping for a...
Container/control examples 181 container/control examples this section contains example code for vtml containers and controls. Tabdialog height=maximum> ... Embedded controls height=maximum> ... Embedded controls ... Embedded controls tabpage height=maximum> ... Embedded controls height=maximum> ......
182 chapter 13 customizing the development environment height=maximum label right=10 width=50/> right=10 width=50/> anchor="lblsource" corner="ne" width="maximum"/> dropdown type="label" caption="align:" anchor="lblsource" corner="sw" down=11 width=50/> type="dropdown" anchor="lblalign" corner="ne" ...
Container/control examples 183 corner="sw" down=11 width=50/> corner="ne" width="maximum"/> checkbox anchor="numwidth" corner="ne" down=4 right=20 width=maximum/> radiogroup type="radiogroup" caption="radio one" anchor="lblaccept" corner="sw" down=35 height=maximum width=maximum will not be saved an...
184 chapter 13 customizing the development environment anchor="lbldatasource" corner="ne" width=130/> anchor="txtqueryname" corner="ne" down=0 right=10 width=70/> anchor="txtdatasource" corner="ne" down=0 right=10 width=70/> corner="ne" width=30/> corner="ne" width=30/> info" anchor="numtimeout" cor...
Building custom wizards 185 building custom wizards this section describes how to give users an easy way to enter information that can then be published on the web or used to drive coldfusion applications. Wizards are an integral part of many software products today because they enable users to perf...
186 chapter 13 customizing the development environment creating wizard definition pages the first step in building a custom wizard is to write a vtml file to define the interface and output parameters. This section describes the vtml tags used in this part of the process and presents an example defi...
Creating wizard definition pages 187 caption="html document attributes" image="..\\images\\main.Bmp"> down="10" right="10" width="90" caption="document type:" /> editable="no" anchor="lbldoctype" corner="ne" width="maximum" down="-5"> anchor="lbldoctype" corner="sw" down="20" width="90" caption="tit...
188 chapter 13 customizing the development environment "please enter a document title" or some equivalent message> caption="meta keywords" image="..\\images\\main.Bmp"> caption="add meta keywords:" down="15" right="10" width="maximum"/> anchor="chkmetakeywords" corner="sw" down="10" height="maximum"...
Creating wizard output templates 189 creating wizard output templates the wizard markup language (wizml) enables the customization of files produced by the wizards. Wizml is used inside the templates to dynamically create files based on the data provided by the wizard. For example, if a wizard gener...
190 chapter 13 customizing the development environment for syntax and usage information, see expressions and functions in the vtml reference. Wiz tags the behavior of wizard output templates is controlled by the use of wiz tags in the template. These tags are like coldfusion tags except that they ar...
Wizard definition page library 191 wizard definition page library a set of seven page definition files is available in coldfusion studio and jrun studio. The library can be used to quickly build data access capabilities into wizards. This section is included for homesite users who may want to upgrad...
192 chapter 13 customizing the development environment selecttables image="..\\images\\selecttable.Bmp"> value="please specify the tables which will be involved in this application. This should include any tables against which you would like to search or tables containing data that will be displayed...
Wizard definition page library 193 selectfields search page" image="..\\images\\searchcriteria.Bmp"> value="choose all fields that should be included as search criteria on the search page. Press ctrl or shift together with the mouse click in order to select more than one field."> validationmsg="you ...
194 chapter 13 customizing the development environment.
Chapter 14 scripting the visual tools object model the term visual toolsrefers to the macromedia products homesite, coldfusion studio, and jrun studio. Using the visual tools object model, developers can extend their work in two broad categories: • power users can script recurring tasks. • applicati...
196 chapter 14 scripting the visual tools object model writing and executing scripts in visual tools the visual tools expose an object model, enabling developers to manipulate program functionality from external applications. In addition, power users can create scripts to automate tasks using jscrip...
Writing and executing scripts in visual tools 197 to automate visual tools tasks, you must familiarize yourself with the visual tools object model (vtom). The main object is the application object. The application object contains two important child objects, the activedocument object and the documen...
198 chapter 14 scripting the visual tools object model creating a custom toolbutton and toolbar after you write a script, you can create a custom toolbutton to execute the script from within the program. If you intend to write multiple scripts, you can create a toolbar for them. You can rearrange th...
Application object 199 application object you can script the application object’s child objects to perform common tasks and to create toolbars dynamically. Properties activedocument syntax activedocument: object (read-only) description the active document. For details, see “activedocument object” on...
200 chapter 14 scripting the visual tools object model } default: { smessage = ’an unknown application type’; } }messagebox(’you are enjoying ’ + smessage + ’.’, ’application type’, 0); } apppath syntax apppath: olestring (read-only) description path to application executable. Example function main(...
Application object 201 sample currentview script //**********************************************************// // this script switches the views inside the application //*********************************************************// function main () { var smessage; with (application) { currentview = 1...
202 chapter 14 scripting the visual tools object model documentcount syntax documentcount: integer (read-only) description number of open documents. Example function main() { var smessage; with (application){ smessage = "there are "; smessage = smessage + sdocumentcount + " open."; // get the numb...
Application object 203 height syntax height: integer description height in pixels of main window. Example function main() { var smessage; with (application){ smessage = "top-left corner of your window has the following coordinates: "; smessage = smessage + "top: " + top + ""; // get top smessage...
204 chapter 14 scripting the visual tools object model left syntax left: integer description left (x-coordinate) of main window. Example function main() { var smessage; with (application){ smessage = "top-left corner of your window has the following coordinates: "; smessage = smessage + "top: " + ...
Application object 205 top syntax top: integer description top (y-coordinate) of main window. Example function main() { var smessage; with (application){ smessage = "top-left corner of your window has the following coordinates: "; smessage = smessage + "top: " + top + ""; // get top smessage = s...
206 chapter 14 scripting the visual tools object model width syntax width: integer description width in pixels of the main application window. Use this property with the height property to return the size of the main window as well as to resize the window. Windowstate syntax windowstate: integer des...
Application object 207 browsetext syntax browsetext(stext, basehref: olevariant); description displays the passed text in the internal browser. Use the basehref parameter to interpret relative paths. For local files, basehref is the folder that contains the file. Example function main() { var smessa...
208 chapter 14 scripting the visual tools object model extractfilename syntax extractfilename(const wsfile: widestring): widestring; description returns only the file portion of the passed file name. Example function main() { var sfullfilepath; var sfilename; sfullfilepath = "c:/temp/myscript.Js" wi...
Application object 209 activedocument.Inserttext(’’, false); } } } getimageheight syntax getimageheight(const wsimagename: widestring): integer; description returns the height in pixels of the passed image. Returns 0 on error. Example /* tests getimageheight, getimagewidth looks for first gif image ...
210 chapter 14 scripting the visual tools object model getimagesize syntax getimagesize(const wsimagefile: widestring; var nheight, nwidth: integer): wordbool; description boolean. Retrieves the size of the passed image. Returns false on error. Example function main() { var sfullimagepath; var heigh...
Application object 211 getrelativepath syntax getrelativepath(const wsbaseurl, wsfolderurl: widestring): widestring; description returns the relative path of a folder given a base url. For example, getrelativepath ("http://www.Macromedia.Com/", "http:// www.Macromedia.Com/software/") returns "produc...
212 chapter 14 scripting the visual tools object model geturl syntax geturl(const wsurl: widestring): widestring; description retrieves a url and returns its contents. Example function main() { var surl; var scontents; surl = "http://www.Macromedia.Com/"; with (application){ scontents = geturl(surl)...
Application object 213 geturlstatus syntax geturlstatus(const wsurl: widestring; var vresponse: olevariant): integer; description returns the http status code for the passed url. The text of the server response is returned in the second parameter. Geturlstatuscode syntax geturlstatuscode(const wsurl...
214 chapter 14 scripting the visual tools object model } } } htmlgetattribute syntax htmlgetattribute(const wsintag, wsattr: widestring): widestring; description returns the value for a particular attribute of a tag. For example, htmlgetattribute("", "width"); returns 100. Example function main(){ v...
Application object 215 with (application) { sinput = inputbox(versiontext, "what is your name?", "alex"); soutput = "i know you, your name is " + sinput + "."; messagebox (soutput, versiontext, 0); } } isfileopen syntax isfileopen(sfile: olevariant): wordbool; description boolean. Returns true if th...
216 chapter 14 scripting the visual tools object model example function main(){ with (application){ installparserscript(’d:\\download\\xhtml_2.Scc’, ’xhtml’); } } logmemorystatus syntax logmemorystatus(const wslogfile, wsdescrip: widestring); description writes the current memory status to a log fil...
Application object 217 example function main() { var sinput; var soutput; with (application) { sinput = inputbox(versiontext, "what is your name?", "alex"); soutput = "i know you, your name is " + sinput + "."; messagebox (soutput, versiontext, 0); } } newdocument syntax newdocument(wbusedefaulttemp...
218 chapter 14 scripting the visual tools object model nextdoc syntax nextdoc(); description moves to the next document in the document tab. If the last document is showing, wraps to the first. Example function main() { var smessage; smessage = "hello world!"; with (application) { newdocument(false)...
Application object 219 } } runcodesweeper syntax runcodesweeper(); description runs the codesweeper on the active document using the active codesweeper. To change the active codesweeper, use setactivecodesweeper . Example function main() { with (application) { runcodesweeper (); } } saveall syntax s...
220 chapter 14 scripting the visual tools object model setactivecodesweeper syntax setactivecodesweeper(const wsfilename: widestring): wordbool; description changes the active codesweeper format file. Example function main(){ var scs_file = ’c:\\program files\\macromedia\\coldfusion studio 5\\extens...
Application object 221 example function main(){ var sfolder1 = ’c:\\program files\\bradbury\topstyle2’; var sfolder2 = ’c:\\inetpub\\wwwroot’; with (application) { setfiletabfolder(1, sfolder1); setfiletabfolder(2, sfolder2); } } setprogress syntax setprogress(nprogress: integer); description sets t...
222 chapter 14 scripting the visual tools object model shelltoappandwait syntax shelltoappandwait(const wsappfilename: widestring); description boolean. Same as shelltoapp but waits for the external program to close before returning. The application is locked until shelltoappandwait returns, so use ...
Application object 223 example function main(){ with (application){ if (activedocument.Modified){ statuserror(’current document is modified’); } } } statuswarning syntax statuswarning(const wsmsg: widestring); description displays a warning message in the status bar. Message appears on a blue backgr...
224 chapter 14 scripting the visual tools object model wait syntax wait(nmilliseconds: integer); description pauses for given number of milliseconds. Use wait to enable scripts to execute loops yet still allow access to the ui. Without the call to wait in the loop, the application appears locked and...
Application object 225 addscripttoolbutton syntax addscripttoolbutton(wstoolbarname, wsscriptfile, wshint, wscaption, wsimagefile: widestring): wordbool; description boolean. Adds a script toolbutton (executes passed jscript or vbscript file when clicked) to the passed toolbar. Fails if toolbar does...
226 chapter 14 scripting the visual tools object model with (application){ addvtmtoolbutton(’common’, svtm_file, ’block quote’, ’bq’, ’’); } } createtoolbar syntax createtoolbar(wstoolbarname: widestring): wordbool; description boolean. Creates a new, undocked toolbar of the passed name. Fails if th...
Application object 227 settoolbardockpos syntax settoolbardockpos(wstoolbarname: widestring; ndockpos: integer): word- bool; description boolean. Sets the docking position of the toolbar. Fails if the toolbar does not exist. The following values for ndockpos are allowed : 1 = top 2 = bottom 3 = left...
228 chapter 14 scripting the visual tools object model sample toolbar script 1 //******************************************************// // this script creates a toolbar named apps if one does not exist, // then adds two custom toolbuttons to it. The first toolbutton // launches windows explorer, t...
Application object 229 sample toolbar script 2 //*************************************************************// // this script creates a toolbar which is capable of executing // all of the scripts contained in the document cache //*************************************************************// func...
230 chapter 14 scripting the visual tools object model activedocument object use the activedocument object to refer to the document currently displayed in the editor. To access an open document that is not active, use the application.Documentcache object. Properties canredo syntax canredo: wordbool ...
Activedocument object 231 caretposx syntax caretposx: integer (read-only) description the x-axis caret position. Example function main(){ with (application){ if (activedocument.Caretposx > 1){ activedocument.Cursorlinestart(false); } } } caretposy syntax caretposy: integer (read-only) description th...
232 chapter 14 scripting the visual tools object model linecount syntax linecount: integer (read-only description number of lines in the active document. Example function main() { var smessage; smessage = "your file line count is: "; with (application) { smessage = smessage + activedocument.Linecoun...
Activedocument object 233 messagebox(smessage, versiontext, 0); } } readonly syntax readonly: wordbool (read-only) description boolean. Returns true if the active document is read-only. Example function main(){ with (application){ if (activedocument.Readonly){ messagebox(’current document is read-on...
234 chapter 14 scripting the visual tools object model seltext syntax seltext: olestring description gets and sets the text in the current selection. Example function main() { var smessage; smessage = "the length of the selected text of your document is "; with (application) { smessage = smessage + ...
Activedocument object 235 clear syntax clear(); description clears all text from the active document. Close syntax close(wbprompttosave: wordbool): wordbool; description boolean. Closes the active document. If wbprompttosave is true , the user is prompted to save any changes. Returns true if the doc...
236 chapter 14 scripting the visual tools object model } finally{ activedocument.Endupdate(); } messagebox(’total tags: ’ + itags, ’tag count’, 0); } } getcaretpos syntax getcaretpos(var x, y: integer); description returns the caret pos (x=column, y=line). Getcurrentchar syntax getcurrentchar(): ole...
Activedocument object 237 gotonextendtag syntax gotonextendtag(wbselect: wordbool): wordbool; description boolean. Moves the next end tag, and selects it if wbselect is true . Returns false if no tag found. Gotonextstarttag syntax gotonextstarttag(wbselect: wordbool): wordbool; description boolean. ...
238 chapter 14 scripting the visual tools object model inserttag syntax inserttag(sstarttag, sendtag: olevariant; wboverwriteselection: wordbool); description boolean. Inserts the passed tag pair at the current cursor position, overwriting the selection if wboverwriteselection is true . The cursor i...
Activedocument object 239 reload syntax reload(wbprompttosave: wordbool); description boolean. Reloads the active document. If wbprompttosave is true, prompts the user to save changes. Replaceall syntax replaceall(strsearch, strreplace: olevariant; bmatchcase: wordbool): integer; description boolean...
240 chapter 14 scripting the visual tools object model selectall syntax selectall(); description selects all the text in the active document. Selectcurrentline syntax selectcurrentline(); description highlights the current line. Selectline syntax selectline(index: integer); description highlights th...
Documentcache object 241 documentcache object it is very important to understand the documentcache object when using the vtom. Although the visual tools enable you to open dozens of files at once, only the active document stays in memory. When a document becomes inactive, that is, when the user swit...
242 chapter 14 scripting the visual tools object model example function main() { var smessage; smessage = "your file name is: "; with (application) { smessage = smessage + documentcache (0).Filename; } } modified syntax modified: wordbool (read-only) description boolean. Returns true if the cached d...
Documentcache object 243 text syntax text: olestring (read-only) description file contents of the cached document. Example function main() { var smessage; smessage = "your document contains the following text: "; with (application) { smessage = smessage + documentcache (0).Text; } }.
244 chapter 14 scripting the visual tools object model project object the project object provides a basic set of propeties and methods for scripting project maintenance tasks. The projectmanager and deploymentmanager objects extend the capabilities of the project object. For more information, see “p...
Project object 245 showlastprojecterror syntax showlastprojecterror(); description displays an error message for the last project-related error. Uploadprojectdlg syntax uploadprojectdlg(): wordbool; description boolean. Displays the upload project dialog box for the active project. Uploadproject syn...
246 chapter 14 scripting the visual tools object model projectmanager object the projectmanager object provides extensive and granular scripting capabilities. This section groups the propertymanager methods by function. Filecount syntax filecount: integer (read-only) description the number of files ...
Projectmanager object 247 addfolder syntax addfolder(folder: olevariant; foldertype: tfoldertype; folderpath: ole- variant; parent: olevariant); description adds a new folder to the project root. To add a subfolder to an existing folder, use a folder-level method. Checkedin syntax checkedin: wordboo...
248 chapter 14 scripting the visual tools object model removefolder syntax removefolder(foldername: olevariant); description removes a folder from the project. Save syntax save; description saves the current project to disk in wddx format. Selectfile syntax selectfile(filename: olevariant); descript...
Projectmanager object 249 folderdeploytarget syntax folderdeploytarget(folder: olevariant; out foldertype: integer; out foldertarget: olevariant); description gets the folder deployment target and type. Folderfilecount syntax folderfilecount(folder: olevariant): integer; description counts the numbe...
250 chapter 14 scripting the visual tools object model deployment methods deploymentscriptadd syntax deploymentscriptname: olevariant; description adds a deployment script to the project. Deploymentscriptcount syntax deploymentscriptcount: integer; description returns the number of scripts. Deployme...
Projectmanager object 251 deploymentserverremove syntax deploymentserverremove(servername: olevariant); description removes a deployment server from a project..
252 chapter 14 scripting the visual tools object model deploymentmanager object the deploymentmanager object is a scriptable interface to the project deployment engine. The deploymentmanager object provides a collection of methods and properties that enable you to write highly customized scripts to ...
Deploymentmanager object 253 servercount syntax servercount: integer (read-only) description counts the deployment servers associated with the current open project, including any new servers that were added temporarily using the addserver method. Uploadonlyifnewer syntax uploadonlyifnewer: wordbool ...
254 chapter 14 scripting the visual tools object model copyfile syntax copyfile(const sourcefile: widestring; const targetfile: widestring): integer; description copies the source file to the target file location. Copyfileextended syntax copyfileextended(const sourcefile: widestring; const targetfil...
Deploymentmanager object 255 such as "rds://localhost/d:/main/images/testimage.Jpg" which you can pass as the second argument to the uploadfile method. Getfolderdeploypath syntax getfolderdeploypath(const wsfoldername:string): widestring; description returns the deployment path of the passed folder ...
256 chapter 14 scripting the visual tools object model getlasterrormessage syntax getlasterrormessage(): widestring; description tests the result of an uploadfile call by returning last associated rds error message. Isfolderdeployable syntax isfolderdeployable(const wsfoldername:widestring): wordboo...
Deploymentmanager object 257 uploadfile syntax uploadfile(const wsfile:widestring, stargetfile: widestring); description uploads an individual file to the server. The first olestring represents the fully qualified path of an individual file to upload. The second olestring represents the fully qualif...
258 chapter 14 scripting the visual tools object model // =================================================================== // server list: // // local deployment // =================================================================== function main() { var app = application; var deploymentmanager =...
Deploymentmanager object 259 // =========================================================== // iterate through project folders //=========================================================== for (j=0; j sfoldername = deploymentmanager.Getfoldername(j); sdeploypath = deploymentmanager.Getfolderdeploypa...
260 chapter 14 scripting the visual tools object model httpprovider object the httpprovider object is a general purpose http protocol object. You can use it in vtom scripts for low-level http operations. The httpprovider object is an alternative to simplified http-related methods, such as the geturl...
Httpprovider object 261 cookie syntax cookie: olevariant description sets and gets the cookie header element. Use this property to send a set of client cookies to the server along the http request. Example sample cookie script function main () { var app = application; var httppro = app.Httpprovider;...
262 chapter 14 scripting the visual tools object model multithreaded syntax multithreaded: wordbool description boolean. Sets and gets whether the httpprovider uses multithreading when executing http requests. Nocache syntax nocache: wordbool description boolean. Sets and gets the nocache request-he...
Httpprovider object 263 rcvdcount syntax rcvdcount: integer (read-only) description the size of the content stream received from the server. Use this property to display progress during asynchronous get operations. Use the contentlength property value extracted from the document header to get the to...
264 chapter 14 scripting the visual tools object model reference syntax reference: olevariant description sets and gets the referer request-header field. This field allows the client to specify, for the server’s benefit, the address (uri) of the resource from which the request-uri was obtained. This...
Httpprovider object 265 statuscode syntax statuscode: integer (read-only) description the http request status-code element. This is a 3-digit integer result code of the attempt to understand and satisfy the request. Url syntax url: olevariant description sets and getss the url location of the resour...
266 chapter 14 scripting the visual tools object model httppro.Url = "http://www.Macromedia.Com"; httppro.Get(); app.Messagebox( httppro.Receivedheaderasstring ,"received http header", hsokinfo); app.Messagebox( "url=’ "+ httppro.Url + "‘" + "proxyusername=’" + httppro.Username + "‘" + "proxypas...
Httpprovider object 267 headasync syntax headasync(); description performs an http head method request asynchronously. Post syntax post(); description performs an http post method request. Example sample post script //*******************************************// // this script illustrates a post me...
268 chapter 14 scripting the visual tools object model the following error messages are predefined. Check for the error strings to detect these error cases: • file already exits—returned when file specified in filepath exists and boverwrite is set to false . • path does not exist—returned when the p...
Httpprovider object 269 sample httpprovider script //**********************************************// // activescripting example (jscript) //**********************************************// // this script contacts the site specified by the user url, // copies its source code and displays the page in...
270 chapter 14 scripting the visual tools object model zipprovider object the zipprovider object is the general purpose pkzip services object used by the visual tools for zip file composition and extraction. You can use this object in your vtom scripts for low-level pkzip operations from within the ...
Zipprovider object 271 zipcomment syntax zipcomment: olevariant description sets and gets the comment for the archive file. Use this property to read a comment of an existing archive file, or set the comment for a new archive file that you created. Zipfile syntax zipfile: olevariant description sets...
272 chapter 14 scripting the visual tools object model breaks. The function returns a status code that can be investigated to determine the success of the operation. Example sample add script function main () { var hsokinfo = 64; var app = application; var zippro = app.Zipprovider; //identify the fi...
Zipprovider object 273 else if (nstatuscode == 410){smessage = "errormultidisk";} else if (nstatuscode == 420){smessage = "errorwrongdisk";} else if (nstatuscode == 430){smessage = "errormultidiskbadcall";} else if (nstatuscode == 440){smessage = "errorcantopenbinary";} else if (nstatuscode == 450){...
274 chapter 14 scripting the visual tools object model fileisreadonly syntax fileisreadonly(nindex: integer): wordbool; description boolean. Use this function to determine whether a specific element in an archive is read-only. The index value can be from 0 to filecount-1 . Fileishidden syntax fileis...
Zipprovider object 275 // loop through the contents of the zip file for ( x = 0; x < zippro.Filecount; x++ ) { if ( zippro.Filename(x) == ’cfabort.Vtm’ ) { app.Messagebox( "file found in the archive.","zipprovider", hsokinfo); } } } filesize syntax filesize(nindex: integer): double; description retu...
276 chapter 14 scripting the visual tools object model activescripting examples jscript //*****************************************************// // activescripting example (jscript) //*****************************************************// // generates a table of the filenames of all open documents...
Activescripting examples 277 //is this document modified? If (documentcache (count).Modified) stable = stable + ’ else stable = stable + ’ //is this document read-only? If (documentcache (count).Readonly) stable = stable + ’ else stable = stable + ’ // close row. Stable = stable + ’ count ++; // inc...
278 chapter 14 scripting the visual tools object model vbscript //********************************************************// // displays a table containing file information //********************************************************// sub main dim app dim idx dim stable dim newline, fname, br, tab di...
Activescripting examples 279 ‘ is this document modified? If app.Documentcache(idx).Modified then stable = stable + "yes" stable = stable + " ‘ is this document read-only? If app.Documentcache(idx).Readonly then stable = stable + "yes" ‘ close row stable = stable + " next stable = stable + newline +...
280 chapter 14 scripting the visual tools object model third-party add-ins scripting support offers many possibilities for third-party developers. For the latest news on third-party add-ins, visit the vtom scripts section of the macromedia developer exchange at http://www.Macromedia.Com/go/fp_cfstud...
Third-party add-ins 281 ’ add script toolbutton app.Addscripttoolbutton tb_name, app.Apppath + "test.Bas" , "script toolbutton", "sc", "" ’ add vtm toolbutton app.Addvtmtoolbutton tb_name, app.Apppath + "extensions\tagdefs\html\div.Vtm" , "vtm toolbutton", "vt", "" end sub.
282 chapter 14 scripting the visual tools object model table of commandid values the following table lists the set of currently exposed commands. For backward compatibility, these values will not change, but some value might become obsolete and be removed from the set. Command id value cmdid_cmdnone...
Table of commandid values 283 cmdid_cmdcursordocstart 32 cmdid_cmdcursordocend 33 cmdid_cmdcursorlinestart 34 cmdid_cmdcursorlineend 35 cmdid_cmdeditbackspace 36 cmdid_cmdeditcut 37 cmdid_cmdeditcopy 38 cmdid_cmdeditpaste 39 cmdid_cmdeditundo 40 cmdid_cmdeditredo 41 cmdid_cmdeditrepeatlasttag 42 cmd...
284 chapter 14 scripting the visual tools object model cmdid_cmdselectionaddbr 67 cmdid_cmdselectionstriptags 68 cmdid_cmdselectionucase 69 cmdid_cmdselectionlcase 70 cmdid_cmdsearchfind 71 cmdid_cmdsearchreplace 72 cmdid_cmdsearchagain 73 cmdid_cmdsearchfindex 74 cmdid_cmdsearchreplaceex 75 cmdid_c...
Table of commandid values 285 cmdid_cmdvieweditsource 102 cmdid_cmdviewtoggleeditpreview 103 cmdid_cmdviewtoggleeditdesign 104 cmdid_cmdviewtoggletaginspectorfocus 105 cmdid_cmdviewtogglespecialchar 106 cmdid_cmdviewtaginsight 107 cmdid_cmdviewtagtip 108 cmdid_cmdvieweditortoolbar 109 cmdid_cmdviewe...
286 chapter 14 scripting the visual tools object model table of settingid values the following table lists currently exposed setting ids. For backward compatibility, these values will not change, but some might become obsolete and be removed from the set. Setting id value description set_flag_readon...
Table of settingid values 287 set_msie_auto_refresh 19 automatically refresh msie after navigating (needed for ie3.X) set_anchordlg_names 20 show named links in anchor dialog box set_use_short_tempfile_name 21 use short filename for tempfiles when shelling to external browser set_restore_files 22 re...
288 chapter 14 scripting the visual tools object model set_use_cse_validator 41 use cse validator for full-page validation.Never change the key for this setting, because alsoft may update it during the cse install set_show_editortoolbar 42 show editor toolbar set_show_editortab 43 show the tabset be...
Table of settingid values 289 set_show_skipped_files _in_search 66 see dxsearchresults.Addskipitem set_lowercase_links 67 lowercase img, a, and other dropped links set_allow_multiple_instances 79 only for debugging. Multiple instances use same reg settings and would conflict set_close_para_tags 80 a...
290 chapter 14 scripting the visual tools object model set_use_vtm_image_dialog 107 use vtml image dialog set_use_vtm_anchor_dialog 108 use vtml anchor dialog set_use_vtm_body_dialog 109 use vtml body dialog set_tempfile_prefix 110 prefix to use for tempfiles set_filelist_cols_active 120 set local c...
Table of settingid values 291 set_dir_wizards 159 set location of wizard root directory set_dir_custom_templates 160 set location of custom templates directory set_dir_old_templates 161 set location of old templates directory set_dir_old_tageditors 162 set location of old tag editors directory set_d...
292 chapter 14 scripting the visual tools object model set_quickbar_data_file 207 set location of file containing data about what toolbars are in the quickbar set_insight_taglist_file 208 set location of tag insight file set_style_edit_exe 209 set location of styleedit executable set_codetemplate_fi...
Table of settingid values 293 set_editor_autoclose_asp 314 add %> when set_editor_autocomment 315 add --> when.
294 chapter 14 scripting the visual tools object model set_autoformat_show_prompt 602 show prompt when user clicks toolbutton set_cfs_help_server cfstudio only 61 server to map to in dxwebbrowser.Domsienewwi ndow when user browses snippets set_cfs_adjust_help_examples cfstudio only 62 if false , the...
Glossary this section contains brief definitions of terms that you might encounter while learning to use coldfusion studio. Application server see server. Ascii american standard code for information interchange, developed by the american national standards institute (ansi). System of representing a...
296 glossary a posix character class is a code that represents a set of characters; for example alpha represents all alphabetic characters ([a-za-z]). Client a computer that is requesting something from a server; for example, a computer that is asking for the results of a database query. Code templa...
Glossary 297 dtd document type definition. Specification that defines the rules of a standard generalized markup language (sgml) language; for example, its tags and required attributes and allowed values for its tags. A dtd complies to the rules of sgml, and enables an sgml compiler to correctly han...
298 glossary ip address internet protocol address, also known as an ip. A 32-bit number that identifies each sender or receiver of information across the internet. Enables a computer to participate in the internet. Isp internet service provider. Examples: america on-line (aol), global on-line (gol)....
Glossary 299 www.Macromedia.Com; ip addresses, such as 132.96.219.3; and localhost to signify the computer that you are currently using. Png portable network graphics. Type of image file (.Png) that has a small file size but less detail than the jpg file. Png files are perfect for images that need t...
300 glossary enterprise javabeans, and so on. An application server can also act as a web server, but most developers use a specialized web server like apache to get extra features. Server mapping see mapping. Sgml standard general markup language. The “mother” of markup languages—all other markup l...
Glossary 301 w3c world wide web consortium. Creates specifications, guidelines, software, and tools to achieve its vision for the web—that all users would equally experience the web regardless of their browsers, operating systems, or physical disabilities; and that the web would be a free flow of in...
302 glossary.
Index a absolute paths, deploying to 144 accessibility 66 accessing data sources 109 help 35 project files from vss 136 activedocument object in vtom 230 activescript 88 activescripting examples in vtom 276 activex 87 administering multiuser projects in vss 138 advanced search operators 38 anchoring...
304 index completing setup 3 tags 56 configuring after first-time installation 4 after upgrade 4 browsers 9, 10 cse html validator 105 debugging sessions 118 deployment servers 144 external browsers 11 from previous version 4 function insight 58 iis for server mappings 22 internal browsers 10 mozill...
Index 305 document window, creating files in 29 documentation about xiv accessing 35 adding tag help with vtml 180 adding to 40 changing 35 commenting online 38 conventions in xiv editing help 35 extending help 39 for tags xv in tag chooser 35 in tag editors 35 intended audience xii opening favorite...
306 index html tidy about 97 editing profiles 101 installing newer version of 97 options 101 removing profiles 101 html tidy profiles editing 101 http 297 httpprovider object in vtom 260 hyperlinks. See links i icw. See initial configuration wizard image map editor 60 image maps, editing 60 image th...
Index 307 mozilla 10 multi-character regular expressions 92 n namespace precedence 106 namespaces, setting priority of 106 native database drivers 110 navigating document structure 77 netscape 10 network neighborhood 21 non-ansi file encoding 45, 48 o ole-db drivers 110 opening data sources 111 enco...
308 index q queries editing 116 inserting new 115 inserting saved 115 quickbar customizing 54 inserting tags from 54 moving tabs in 32 organizing tabs in 31 quotes, setting in codesweeper 99 r rds 299 file mapping examples 20 mappings 19 security settings for debugger 122 servers, connecting to 18 s...
Index 309 source control about 135 opening from product 137 toolbar for 137 special characters adding 60 options for 91 replacing 157 spectra accessing data sources 110 viewing database schemas in 110 spectra, training resources xiii spell checker about 162 configuring 159 options for 161 running 15...
310 index variables debugging 122 in sql where clauses 114 vbscript, color coding for 95 verifying links 163 links in document 164 links in project 165 version source control 135 viewing data sources 111 favorite folders 51 integrated browsers 11 links in site view 166 online help xv pages in extern...