MACROMEDIA COLDFUSION STUDIO 4.5-USING COLDFUSION STUDIO Using Manual

Summary of COLDFUSION STUDIO 4.5-USING COLDFUSION STUDIO

  • Page 1

    Allaire corporation using coldfusion studio coldfusion studio 4.5 for windows ® 95/98/nt4/2000

  • Page 2: Copyright Notice

    Copyright notice © 1999 allaire corporation. All rights reserved. This manual, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this manual is furnished for informational use only, is subje...

  • Page 3: Contents

    Contents welcome to coldfusion studio . . . . . . . . . . . . . . . . . . . . . . . . . . Xi intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xii introduction to the coldfusion 4.5 web application server . . . . . . . . . . ....

  • Page 4: Chapter 2 Managing Files

    Iv contents chapter 2 managing files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 about the files tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 working with files . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 5

    Chapter v chapter 6 writing code and web content . . . . . . . . . . . . . . 53 inserting code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 inserting tags from the quickbar . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 6: Chapter 9 Editing Pages

    Vi contents data exchange across application servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 time zone processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 how wddx works . . . . . . . . . . . . . . . . . . . . ....

  • Page 7: . . . . . . .

    Chapter vii chapter 11 using projects for site management . . . . . . . 101 what is a project? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 creating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Page 8: . . . .

    Viii contents building tag editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 defining controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 populating dialog boxes with tag data . ....

  • Page 9: Contents

    Welcome to coldfusion studio coldfusion studio is a powerful and flexible tool for building, testing, and deploying dynamic web applications. It is also an easy to use tool to create and edit web content, with support for a variety of scripting languages. Contents • intended audience ..................

  • Page 10: Intended Audience

    X intended audience intended audience the principal audience for this user guide is professional web developers who have a working knowledge of html and web server environments. The focus is on introducing you to studio’s interface and development tools. Introduction to the coldfusion 4.5 web applic...

  • Page 11

    Welcome to coldfusion studio xi development features in coldfusion studio 4.5 a wide range of features are available in coldfusion 4.5 for application development and for creating web content. Allaire ftp & rds— manage all your files from a single interface that integrates access to the windows file...

  • Page 12: Documentation Updates

    Xii about coldfusion documentation about coldfusion documentation coldfusion documentation is designed to provide support for all components of the coldfusion development system. Both the print and online versions are organized to allow you to quickly locate the information you need. In addition to ...

  • Page 13

    Welcome to coldfusion studio xiii using coldfusion studio documents everything you need to know about using coldfusion studio, including features like projects, source control integration, as well as the studio workspace and interface. Quick reference to cfml a valuable quick reference to cfml tags,...

  • Page 14: Developer Resources

    Xiv developer resources developer resources this section is a brief listing of cfml resources. Allaire coldfusion developer center the developer center at http://www.Allaire.Com/developer/referencedesk/index.Cfm contains all the latest information on coldfusion and offers tutorials, technical articl...

  • Page 15: Contacting Allaire

    Welcome to coldfusion studio xv contacting allaire please contact allaire for sales and support information. Corporate headquarters allaire corporation 275 grove street newton, ma 02446 telephone: 617.219.2000 fax: 617.219.2001 http://www.Allaire.Com customer service contact allaire customer service...

  • Page 16

    Xvi contacting allaire.

  • Page 17: Exploring The Workspace

    C h a p t e r 1 exploring the workspace this chapter acquaints you with the main areas of the interface. It will also give you some pointers on customizing the workspace to make all your development work as productive as possible. Contents • the workspace areas .........................................

  • Page 18: The Workspace Areas

    18 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 document. Below that is the menu bar...

  • Page 19: Setting Workspace Options

    Exploring the workspace 19 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. Working in the...

  • Page 20: Edit Tab

    20 creating and browsing files in the document window the document window is where code and other content are entered and edited. Edit tab the editor has many productivity features for creating and editing code, content, and navigation structures. You can easily insert tags, generate code, and add c...

  • Page 21: Opening Dialog Box Help

    Exploring the workspace 21 tracking your work in the results window the results window presents the results of document operations in individual panels. It opens automatically when you run search, code validation, link verification, image thumbnails, or project deployment. You can also open it from ...

  • Page 22: Printing Help Topics

    22 printing help topics if you are using internet explorer as the internal browser, you can print a help topic by right-clicking the document in browse mode and selecting print. The default internal browser does not support printing. Bookmarking help topics you can get quick access to help documents...

  • Page 23: Extending The Help System

    Exploring the workspace 23 2. Enter a word or phrase in the enter the word(s) to find box. For information on using search operators, click the search tips button. 3. To limit the references searched, select the search only in selected references option and select the check box next to one or more r...

  • Page 24

    24 to create a new folder in the help tree: 1. Open the files panel in the resources window. 2. Navigate to the help folder of your installation. 3. Right-click in the files pane and select the create folder menu item to open a new folder box in the directory pane. 4. Type a folder name in the box a...

  • Page 25

    Exploring the workspace 25 adding help references to the booktree structure if you add a folder to the help directory, the folder appears at the bottom of the help references list. For most users, this is all you need. If, however, you want to control the display order of the help references, you ca...

  • Page 26: Adding Media Content

    26 adding media content you have considerable flexibility in adding supporting files (such as graphics, animations, video, and sound) to help documents. One approach is to create a file structure in the help tree that conforms to the media file references in your documents. Alternately, you can supp...

  • Page 27: Managing Files

    C h a p t e r 2 managing files this chapter shows you how to work with folders and files. Contents • about the files tab.................................................................................................... 28 • working with files...........................................................

  • Page 28: About The Files Tab

    28 about the files tab creating a project is the best way to organize files when developing a web site or web applications (see “using projects for site management” on page 91 ), but for general file management chores, you work in the files tab on the resources window. The files tab gives you access...

  • Page 29: Working With Files

    Managing files 29 working with files you can use the following procedures to work with files, regardless of their location (local drive, network drive, or remote server). Setting startup options open options > settings > startup to select which files and folders open when load the program. Setting t...

  • Page 30: Saving Files

    30 adding a link to an open file to create a link to a file: 1. Open the page you want to place the link in the editor window. 2. Drag the file you want to create a link to from the file list to the page in the editor window. Release the mouse button when the cursor is in the location where you want...

  • Page 31

    Managing files 31 changing the file list display you can arrange the file list to display exactly what you want. To filter the file list: 1. Right-click in the file list and choose filter from the menu. 2. From the filter submenu, choose the file type you want displayed: • web documents displays web...

  • Page 32

    32 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 choose favorite folders > add current folder to favorites. The fo...

  • Page 33

    Managing files 33 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. The primary difference is that you need to establish a connection to a remote server before you can work with its files....

  • Page 34: Downloading Web Pages

    34 downloading web pages you can download any html page and open it in the editor. These files cannot be saved back to the server. To open a page from a web site: 1. Choose file > open from web. 2. Enter the url for the page or select from your bookmarks or favorites list. 3. If the site is accessed...

  • Page 35: Configuring Web Browsers

    C h a p t e r 3 configuring web browsers this chapter contains the procedures for configuring web browsers for use by coldfusion studio. Contents • configuring the internal browser ............................................................................ 36 • configuring external browsers ..........

  • Page 36

    36 configuring the internal browser the following sections describe the choices available for browsing documents and processing pages from within coldfusion studio. Setting the internal browser options you can use the internal browser to view documents in a web browser within the program. Open the o...

  • Page 37

    Configuring web browsers 37 installing mozilla 1. Downloading the mozilla binaries. 2. Unzip the mozilla files into a new directory. 3. Add the mozilla bin directory to your path environment variable and reboot if necessary. If you are using win 95/98 you may have to specify the short name version o...

  • Page 38: Selecting A Save Option

    38 configuring external browsers as part of the installation process, coldfusion studio creates a list of web browsers that it detects on your system. You can manage the list by selecting the options > configure external browsers menu command. You can easily add, edit, and delete browsers using this...

  • Page 39: Connecting To Servers

    C h a p t e r 4 connecting to servers via ftp and http coldfusion studio provides ftp server access and secure http access via remote development services (rds). You can perform file transfers and other file management tasks using either ftp or rds. To access data sources and to run the debugger, an...

  • Page 40: Required Server Information

    40 required server information you will need specific information about a remote server to connect to it, such as host name and user access requirements. If you do not have this information, you need to get it from the owner of that server, whether it is your it group, an isp, or another provider. C...

  • Page 41

    Connecting to servers via ftp and http 41 3. Enter the following information for the server you want to connect to: • description — a descriptive name that will be displayed in the files tab and in windows explorer. • host name — the server’s domain name, such as allaire.Com, or an ip address. Serve...

  • Page 42

    42 overview of remote development services remote development services (rds) lets you communicate via http with coldfusion on the local machine and on any configured remote host. Rds features include: • secure server access • data source browsing and sql query building • remote file access • cfml de...

  • Page 43: Configuring An Rds Server

    Connecting to servers via ftp and http 43 configuring an rds server complete the following configuration procedure for each coldfusion server you want to access. To configure an rds server: 1. In coldfusion studio, click the files tab at the bottom of the resources window. 2. Open the drive list at ...

  • Page 44: Managing Servers

    44 managing servers you can easily change server configurations as needed. To view and edit the configuration for a server: 1. Right-click the server name in the allaire ftp & rds list and select properties from the menu. 2. Make any changes necessary in the configure server dialog box and click ok....

  • Page 45: Adding Server Mappings

    C h a p t e r 5 adding server mappings development mappings are essential for working with files via remote development services (rds). Contents • understanding development mappings................................................................. 46 • understanding rds mappings ........................

  • Page 46: Mapping For Page Processing

    46 understanding development mappings development mappings serve two purposes: • to enable server-based processing of pages from within coldfusion studio • to enable debugging of application code on a remote server via rds mapping for page processing by default, when you browse a document in the int...

  • Page 47: Understanding Rds Mappings

    Adding server mappings 47 understanding rds mappings file mappings ensure that coldfusion studio, the server, and your browser can properly resolve local paths into server paths and urls. • studio path — how does coldfusion studio see the directory? • coldfusion path — how does the web server/coldfu...

  • Page 48: Using Drive Mappings

    48 using drive mappings developers often debug against a remote server across an internal network. In many cases, they use a network drive mapping. For example, a user may have a remote drive x:\ mapped to a network shared directory \\myserver\webprojects\ where webprojects is the name of the shared...

  • Page 49

    Adding server mappings 49 coldfusion studio and the server need to understand how a file location appears to the parties involved. You therefore need to create a mapping for the app1 directory as follows: using remote development services when developing outside local area networks, you access files...

  • Page 50: Defining A Server Mapping

    50 defining a server mapping the debugger relies on these mappings to communicate the correct file paths of all files with breakpoints to the coldfusion server. You create these mappings in the mappings pane of the remote development settings dialog box. To define a server mapping: 1. Open the optio...

  • Page 51: Writing Code and Web Content

    C h a p t e r 6 writing code and web content coldfusion studio can handle many different web development tasks, from writing simple html pages to designing, testing, and deploying complex, dynamic sites. This chapter describes some basic techniques for creating web content and application code. Cont...

  • Page 52: Inserting Code

    52 inserting code the coding tools in coldfusion studio support the full range of writing styles, from typing to point-and-click, and you can set the level of support you want. For repetitive chores, you can use its productivity to quickly enter common code blocks and required text. If you’re workin...

  • Page 53

    Writing code and web content 53 selecting tags from the tag chooser the tag chooser contains tag sets for languages that are supported by tag editors, the tag inspector, tag insight, and tag tips. To use tag chooser: 1. Right-click in the editor and select insert tag, or press ctrl+e to open tag cho...

  • Page 54: Setting The Tag Display

    54 setting the supported file types for a scheme the color schemes for the supported languages are grouped by file extensions in the color coding pane. You can easily change the file types for a scheme. To modify file types for a scheme: 1. Open options > settings > editor > color coding. 2. Select ...

  • Page 55: Tag Insight

    Writing code and web content 55 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. Tag insight this interactive feature c...

  • Page 56: Tag Completion

    56 tag completion when this feature is turned on, the end tag is automatically inserted for the start tag that you type. Open options > settings > editor > tag completion to set the options. Auto completion auto completion completes a code block by inserting the appropriate code when the opening cod...

  • Page 57: Adding Document Content

    Writing code and web content 57 • use design mode to prototype page layouts and to quickly create html tables and forms and set font and image formatting. Open options > settings > design to display the design tab. • add hyperlinks to web images (gif, jpg) with the image map editor. To get started, ...

  • Page 58: Using Keyboard Shortcuts

    58 to copy text from a browser: 1. To strip the html formatting code from copied text, select the treat html dropped from external application as plain text option in options > settings > editor. 2. Select the text in the browser that you want to copy. 3. Use the windows copy and paste commands to e...

  • Page 59

    Writing code and web content 59 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. Click the snippets tab in the resources window. Before adding a snippet, you...

  • Page 60: Sharing Snippets

    60 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. Enter a folder path for shared snippets and click ok. The new f...

  • Page 61: Accessing Data Sources

    C h a p t e r 7 accessing data sources this chapter describes how to use studio’s visual tools to significantly accelerate development of data-driven coldfusion applications. Contents • introduction to database tools ............................................................................... 62 ...

  • Page 62: Registering Data Sources

    62 introduction to database tools studio’s visual database tools support application development using both local, network, and remote data sources. Access to data sources becomes transparent when a server is configured in studio. Studio's database tools support: • remote database development • data...

  • Page 63: Connecting To Data Sources

    Accessing data sources 63 connecting to data sources data sources registered in the coldfusion administrator are automatically accessible from studio’s database tab. You can also add remote coldfusion servers (rds) to connect to their data sources. To add a remote server: 1. Open the database tab an...

  • Page 64: Using Sql Builder

    64 using sql builder studio provides a powerful visual tool to build, test, and save sql statements for use in data queries. Select a query type from the sql builder toolbar or right-click in the table pane and choose from the query type list. To open sql builder choose one of these methods: • right...

  • Page 65: Writing Sql Statements

    Accessing data sources 65 the sql builder is divided into four sections: • toolbar — contains icons for sql keywords and commands. • table pane — provides a view of the tables in your query and allows you to create joins between tables. • properties pane — allows you to set the properties of the que...

  • Page 66: Building A Select Statement

    66 building a select statement sql select statements let you specify the data from which to build a recordset. This procedure begins with sql builder open. To optimize performance, tables are only retrieved on an as needed basis. To create a select statement: 1. Select the first table you want to qu...

  • Page 67: Testing A Query

    Accessing data sources 67 testing a query you can test your sql code in sql builder before inserting it in a page. To run a query in the sql builder: 1. Click the run query button. 2. You are prompted to enter values for any cfml variables in the query. Note when you click the run query button, the ...

  • Page 68: Inserting Sql Into A Page

    68 inserting sql into a page you can use any of the following methods to insert a query directly into a cfml page from the sql builder: • if you open the sql builder from the cfquery tag editor, it prompts you to insert the query when you close the editor. • if you open the sql builder from a cfml p...

  • Page 69: Exchanging Data Via Xml

    C h a p t e r 8 exchanging data via xml you can now move complex data structures across the web using web distributed data exchange (wddx). This new capability is based on xml 1.0 and can be used to exchange data between cfml applications and other applications. Additionally, server-to-browser and b...

  • Page 70: Wddx Components

    70 an overview of distributed data for the web web distributed data exchange (wddx) is an extensible markup language (xml) vocabulary for describing complex data structures such as arrays, associative arrays, and recordsets in a generic fashion so they can be moved between different application serv...

  • Page 71: Time Zone Processing

    Exchanging data via xml 71 versioning, allowing these and other enhancements to be folded into the specification as they become available without disrupting working applications. Working with application-level data the real strength of wddx is clear if the client and server are seen as a unified pla...

  • Page 72: How Wddx Works

    72 in the cfml implementation, usetimezoneinfo is a property of the cfwddx action=cfml2wddx tag. In the com implementation, usetimezoneinfo is a property of the iwddxserializer interface provided by the object wddx.Serializer.1 . In the js implementation usetimezoneinfo (note the case-sensitivity of...

  • Page 73

    Exchanging data via xml 73 converting cfml data to a javascript object the following example demonstrates the transfer of a cfquery result set from a cfml template executing on the server to a javascript object that is processed by the browser. The application consists of five principal sections: • ...

  • Page 74

    74 o += " for (i = 0; i { o += " } o += " for (row = 0; row { o += " for (i = 0; i { o += " } o += " } o += " // write the table to the html stream document.Write(o); } dumpwddxrecordset(q);.

  • Page 75

    Exchanging data via xml 75 transferring data from browser to server this example serializes form field data, posts it to the server, deserializes it, and outputs the data. For simplicity, only a small amount of data is collected. In applications where complex javascript data collections are generate...

  • Page 76

    76 last name: onclick="serializedata(personinfo, document.Personform.Wddxpacket)"> wddx packet display: wrap="virtual"> /textarea> wrap="virtual"> /textarea> server-side processing output="personinfo"> the submitted personal information is: person #currentrow#: #firstname# #lastname# the client did ...

  • Page 77: Editing Pages

    C h a p t e r 8 editing pages editing chores are made easier by a wealth of interface options and tools for updating code and content. Contents • setting options on the editor toolbar..................................................................... 70 • selecting code and text blocks...............

  • Page 78

    70 setting options on the editor toolbar the column between the document window and the resources window contains a set of handy toolbuttons for: • document handling • formatting • switching between open documents • toggling inline coding tools • displaying the document gutter for line numbers and b...

  • Page 79: Using Collapsing Text

    Editing pages 71 customizing clipboard commands the clipboard buttons can be added to custom toolbars using the options > customize menu command. The buttons are located in the edit toolbutton section. Keyboard shortcuts can be assigned to these features, as well. The shortcut descriptions are show ...

  • Page 80: Using Tag Editors

    72 to work with collapsed text: • double-click a collapsed text marker to expand the text. • to expand all collapsed text, right-click anywhere in a document and select expand all from the popup menu. • you can drag collapsed text just like regular text blocks. • collapsed text blocks can be nested ...

  • Page 81

    Editing pages 73 3. Click the refresh button to update the tag tree as you edit the document. You can click the collapse button on the tag tree toolbar to collapse the selected tag. Note that the tag body must be collapsed in the tag tree to collapse it in the document. The default set of profiles g...

  • Page 82: Setting The Display

    74 editing code in the tag inspector the tag inspector lets you edit code in a property sheet interface that will be familiar to visual basic and delphi programmers. Setting the display buttons at the top of the inspector pane control the way attributes and scripting events are displayed. • version-...

  • Page 83

    Editing pages 75 the best way to create a new tag definition file is modify an existing vtm file and save it with the tag’s name. You can also open \extensions\tagdefs\tagdeftemplate.Vtm to work with a skeleton definition file. Tip to add online help for the tag, create an html file containing the h...

  • Page 84: Selecting A Codesweeper

    76 preserving code formats with codesweepers the codesweeper feature automates the task of getting your code properly formatted. It can be very useful in a number of situations: • to enforce coding styles for multiple developers. • to clean up the formatting of existing code. • to apply formatting r...

  • Page 85: Running A Codesweeper

    Editing pages 77 running a codesweeper open the tools > codesweeper menu to select a codesweeper or click the codesweeper button on the tools toolbar to run the default on the current document. Click the down arrow button next to the codesweeper button to select from the list of available codesweepe...

  • Page 86: Managing Codesweepers

    78 managing codesweepers you can create new codesweepers, edit existing ones, and remove them as needed. To add a new codesweeper: 1. Click the new profile button in the allaire codesweepers panel. 2. Enter a name for the codesweeper and select its type: allaire or html tidy. 3. Click ok to add it t...

  • Page 87: Tag-Specific Settings

    Editing pages 79 tag-specific settings a wide range of options is available for the individual tags contained in an allaire codesweeper. These settings cover spacing and indenting and allow you to leave the selected tag unchanged when invoking the codesweeper. If you are encountering problems parsin...

  • Page 88: Html Tidy Settings

    80 html tidy settings adding a profile creating a custom html tidy profile is much like creating one for an allaire codesweeper. To create an html tidy profile: 1. Click the new profile button in the html tidy codesweeper dialog box. 2. Enter a profile name. 3. Select html tidy from the drop-down co...

  • Page 89: About The Style Editor

    Editing pages 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 and maintain formatting for individ...

  • Page 90

    82.

  • Page 91: Debugging Application Code

    C h a p t e r 9 debugging application code from coldfusion studio debugging information reported from the coldfusion application server is often adequate for simple templates, but complex development tasks require a more powerful and immediate debugging interface. Studio’s interactive debugger runs ...

  • Page 92

    84 interactive debugger overview you can run the debugger against the coldfusion application pages. The debugger lets you: • set breakpoints and watches • evaluate variables and expressions • step through lines of code • investigate the code stack • monitor recordsets • observe variables in all scop...

  • Page 93: Specifying Server Mappings

    Debugging application code from coldfusion studio 85 specifying server mappings the debugger relies on these mappings to communicate the correct file paths of all files with breakpoints to the coldfusion server. See “adding server mappings” on page 45 for a full discussion. You create these mappings...

  • Page 94: The Debugger Toolbar

    86 running the interactive debugger running the debugger helps you find problems in code by tracing the way coldfusion evaluates the page, step by step. You do this by placing breakpoints in the page to stop execution of the page, and then step through subsequent lines of code, checking the values o...

  • Page 95: Debug Windows

    Debugging application code from coldfusion studio 87 5. Enter a user name and password if necessary to access remote servers. The debugger starts, and it forwards your url to the browse view. When the coldfusion server encounters the breakpoint, a blue bar appears at the breakpoint in the edit view....

  • Page 96: Stepping Through Code

    88 debugging across multiple pages the debugger is active even after a page is loaded, and until you press the end button on the debug toolbar or choose debug > end. This enables you to debug applications across multiple html and cfml pages. For example, you can test the submittal of an html form an...

  • Page 97

    Debugging application code from coldfusion studio 89 3. Select evaluate to find the value of the expression at the next breakpoint or line where the debugger stops. The evaluator window shows the results of the evaluation at the current point in processing the page. 4. Select watch to add the expres...

  • Page 98: Debugger Shortcut Keys

    90 debugger shortcut keys here is a complete listing of keyboard shortcuts. Debugger keyboard commands command key start/continue ctrl + f5 end alt + f5 step into ctrl + f8 step over ctrl + f9 step out ctrl + f10 run to cursor ctrl + f11 variables alt + q watches alt + w recordsets alt + r stack alt...

  • Page 99: Using Projects For

    C h a p t e r 1 0 using projects for site management this chapter describes how to use the project tools in coldfusion studio to create and maintain web sites. Contents • what is a project? ...................................................................................................... 92 • cr...

  • Page 100: What Is A Project?

    92 what is a project? The project features allow you to create your own file system that contains only those files you need to develop your web site. The benefits of projects include the following: • projects make it possible to have all of the files you need to build your web site located in a cent...

  • Page 101: Configuring Project Options

    Using projects for site management 93 working in the project resources window click the projects tab at the bottom of the resources window to create new projects and to manage existing ones. The drop-down project list is at the top of the pane. The project toolbar is next to it. Below the projects l...

  • Page 102: The Project File

    94 manual-inclusive and auto-inclusive physical folders physical folders can be divided into auto-inclusive and manual-inclusive. • manual-inclusive folders require you to specify which files in the mapped directory should be included in the folder. For example, you might have a folder with ten file...

  • Page 103: Folder Types

    Using projects for site management 95 folder types the following table shows the icon for each folder type and a description of when you should use each folder type: managing project files all the standard file management and maintenance operations you perform on individual files can be run from wit...

  • Page 104: Working With Folders

    96 to delete a project: 1. Right-click the project and select delete project from the menu or select project > delete project. You are asked to confirm that you want the project deleted. 2. Click yes. The project is removed from the projects panel and the apf file is deleted from your computer. Note...

  • Page 105

    Using projects for site management 97 4. Enter the path for the directory to be referenced in the directory path box or click the browse button to locate the directory using the select directory dialog box. 5. Click ok. The folder is added to your project. In order to populate the folder with files,...

  • Page 106: Working With Files

    98 working with files you can now begin to work with files. The methods for working with a file can vary slightly, depending on the type of folder that contains the file. Standard drag operations can be performed to move files from the projects file list into project folders. Tip the project files l...

  • Page 107: Working With Resources

    Using projects for site management 99 files in auto-inclusive folders you control the files that are included in an auto-inclusive folder by specifying the files types that are allowed. You can change the file types at any time to alter the included files. To change the types of files allowed in an ...

  • Page 108: Additional Project Features

    100 to add a resource from the projects tree: 1. Right-click resources in the project folder pane and select add resource. 2. In the add resource folder dialog box, enter a name for the resource in the resource name box. 3. Enter the file extension(s) of resource types in the resource filter box, se...

  • Page 109: Why Use Source Control?

    Using projects for site management 101 working in a source control system an additional benefit of creating projects is that you can manage project files in a source control system. Why use source control? Version source control for web site content is an essential for coordinating team development ...

  • Page 110

    102 setting up a project in source control the following procedure takes you through the steps of creating microsoft visual sourcesafe project, and then adding coldfusion studio project files to source control. You can adapt this procedure to work in your particular development environment. Visual s...

  • Page 111: Deploying Projects

    C h a p t e r 1 1 deploying projects 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. This chapter describes how to specify options and to deploy a project. Contents ...

  • Page 112

    104 setting project level deployment you only need a path entry to set the deployment for a project. To specify a deployment path for the project: 1. Open the project in the projects panel. 2. Right-click the project root and select properties. The edit project properties dialog box appears. 3. Ente...

  • Page 113: Do Not Upload Option

    Deploying projects 105 • pathnames to remote servers use forward slashes. Ftp servers do not use drive letters. An ftp example looks like this, mydirectory/mysubdirectory. Typically, the pathname you enter does not include the server name for the host, so the program automatically appends the server...

  • Page 114: Deploying Directly

    106 when you deploy your project, you select servers from this list. Note when you deploy to multiple servers, the project files are copied to identical locations on each server, so make sure that those servers contain the same directory structure. Running the deployment wizard you can use the deplo...

  • Page 115: Using Deployment Scripts

    Deploying projects 107 using deployment scripts you can create a deployment script that you can run at any time. The most powerful benefit of scripts is that, once they have been generated, they can be modified with custom code and saved. Deployment scripts are based on the allaire visual tools obje...

  • Page 116: Saving Deployment Results

    108 managing deployment scripts expand the deployment scripts node and right-click a script to edit it, run it, see its properties, or remove it. Saving deployment results you can review the results of the last deployment by selecting view > results > deployment. Right-click in the deployment pane t...

  • Page 117: Testing and Maintaining

    C h a p t e r 1 2 testing and maintaining web pages as your web site develops, you will inevitably need to make changes and test its accuracy, completeness, and efficiency. Homesite provides a full set of tools to accomplish these necessary tasks. Contents • working in the results window ..............

  • Page 118: Saving Results

    110 working in the results window the results window is a tabbed interface that opens to view the results when you run any of the following commands: • extended find and replace • code validation • link verification • image thumbnails • project deployment you can use the tab and shift+tab keys to mo...

  • Page 119: Saving Search Text

    Testing and maintaining web pages 111 using the find and replace feature the search menu gives you access to basic and extended searches and to automated replacement of extended characters and double-spacing. The search tab in the results window displays the results of extended operations. Search te...

  • Page 120

    112 2. Enter the text in the find and replace boxes. 3. Set the match whole words and match case options. In addition to the up and down direction options, you can restrict the search to part of the document by highlighting a block of text in the editor and selecting selection. 4. You can do a selec...

  • Page 121: Special Characters

    Testing and maintaining web pages 113 replacing extended and special characters use the search > replace extended characters command to either replace extended characters with character entities, or replace character entities with the equivalent extended characters. This command works only in the cu...

  • Page 122: Character Classes

    114 single-character regular expressions this section describes the rules for creating regular expressions. You can use regular expressions in the search > extended find and replace commands to match complex string patterns. The following rules govern one-character regexp that match a single charact...

  • Page 123

    Testing and maintaining web pages 115 the following table shows supported posix character classes: multicharacter regular expressions you can use the following rules to build multicharacter regular expressions: • parentheses group parts of regular expressions together into grouped subexpressions tha...

  • Page 124: Using Back References

    116 using back references homesite supports back referencing, which allows you to match text in previously matched sets of parentheses. You can use a slash followed by a digit n () to refer to the n th parenthesized subexpression. One example of how you can use back references is searching for dou...

  • Page 125: Expression Examples

    Testing and maintaining web pages 117 expression examples the following examples show some regular expressions and describe what they match resources an excellent reference on regular expressions is mastering regular expressions by jeffrey e.F. Friedl, published by o'reilly & associates, inc. Expres...

  • Page 126: Checking Spelling

    118 checking spelling open options > settings > spelling to select a spell checker and to set options. To run the spell checker select one of these commands: • select tools > spell check to process the active document or tools > spell check all to process all open documents. • select tools > mark sp...

  • Page 127: Validating Code

    Testing and maintaining web pages 119 validating code you can use homesite code validation to check and report on syntax errors in html (including browser extensions), cfml, and smil. Double-click an error message to highlight it in the document. Using the default validator open options > settings >...

  • Page 128: Verifying Hyperlinks

    120 verifying hyperlinks homesite makes the job of maintaining sites easier 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, all links in a selection are checked, but you...

  • Page 129

    Testing and maintaining web pages 121 to verify links in a project: 1. Right-click a project name in the projects panel of the resource window and select verify links. 2. In the verify links in project dialog box, select a root url option for the project files. 3. (optional) set a timeout value for ...

  • Page 130

    122.

  • Page 131: Customizing The

    Customizing the development environment this chapter details the allaire visual tools markup language (vtml), a tag-based language that is used internally by the allaire visual tools — homesite, coldfusion studio, and jrun studio — to generate tag-specific dialogs for editing html, cfml, jsp, javasc...

  • Page 132

    140 the visual tools markup language (vtml) the phrase "customizing the development environment" means that you can change the content and layout of tag editors by editing vtml files directly in the allaire visual tools. This makes it easy to update tag syntax or change embedded help text. You can a...

  • Page 133

    141 two vtml tags, cat and e , let you customize the content of these dialog boxes:.

  • Page 134: Dialog Definition Files

    142 dialog definition files the structure of the markuptags.Vtm and expressionelements.Vtm files is very simple. They both contain a set of category and element tags. Category tags can contain any number of elements or other nested category tags. The following section explains how to create and upda...

  • Page 135: Element Tag

    143 element tag the e tag defines elements within a category. These elements populate the right pane in the tag chooser and the expression builder. The following table describes the e tag. Creating tag definitions interfaces such as tag insight and tag inspector require tag-specific information to o...

  • Page 136

    144 creating a tag definition file you can customize existing tag definitions and create new tag definition files. Every tag editor file contains the following markup structure: … defines tag attribute properties and behavior … defines logical grouping for tag attributes … defines the layout of a ta...

  • Page 137: Defining Attributes

    145 defining attributes the attributes block defines attributes inside the main tag block. The attributes block can only contain attrib tags. The following example demonstrates the definition of four tag attributes: value , title , alt , and align . In most cases, features such as tag insight requir...

  • Page 138: Defining Enumerated Values

    146 defining enumerated values enumerated values can be specified for attributes of type="enumerated." a subtag attriboption is used to specify such values: (iso)" /> (iso-visual)" /> the optional caption attribute specifies the form in which the option appears in the drop-down lists, while the valu...

  • Page 139

    147 the following table describes the enumerated values of the attriboption tag. Defining attribute categories use the attribcategories section to define attribute categories. The categories are used to organize the attributes when viewed in the tag inspector. The attribcategories block can only con...

  • Page 140: Building Tag Editors

    148 the following table describes the attribgroup tag building tag editors defining a tag editor is composed of three tasks: • layout of dialog box controls • definition of how to populate controls with tag attributes • definition of the tag generation template open the \extensions\tagdefs\mytag.Vtm...

  • Page 141: Defining Controls

    149 defining controls this section contains only two kinds of tags: control and container tags. Control and container tags represent graphical controls. The tags are identical in definition, with the exception that only container tags have the capability to contain control tags. A panel control is a...

  • Page 142

    150 the following table describes the control and container tags. Container/control attributes type available container types are: • tabdialog • tabpage • panel type of the control/container. Available control types are: • label • textbox • checkbox • radiogroup • dropdown • textarea • fontpicker • ...

  • Page 143

    151 populating dialog boxes with tag data once the layout of controls is completed one needs 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 block can contain attri...

  • Page 144: Generating A Tag

    152 you can have multiple attrib tags with the same name . This is common for more complex tag editor dialog boxes where a single attribute value may have to be filled into multiple controls. Special attrib tag variable names the following special variables can be used: $$tagbody — this special tag ...

  • Page 145: Special Variables

    153 special variables in addition to the control variables, a few other parameters get sent to the tag layout template: • optionlowercasetags — returns true or false. Specifies whether the tag should be generated using lowercase. • editortagindentstring — maintains indentation for tag attributes and...

  • Page 146

    154 "$${spacer}size="$${txtsize}"> the template would generate a tag based on the following layout preference: linear: nonlinear: face="arial" size="10"> using tagdataunknownattributes the tagdataunknownattributes tag contains the list of attributes that are contained in the original tag string but ...

  • Page 147: Adding Tag Help

    155 adding tag help you can associate an html-based help document with a tag by embedding the help text inside the tagdescription block. Tagdescription example here’s an example of a tag description block and the result in a tag editor: cfapplication defines scoping for a coldfusion application and ...

  • Page 148: Tabdialog Container

    156 vtml container/control reference this section contains the complete syntax, with examples, for vtml containers and controls. Tabdialog container the following table describes the tabdialog container. Tabdialog example height=maximum> tag"> ... Embedded controls height=maximum> tag"> ... Embedded...

  • Page 149: Tabpage Container

    157 tabpage container the following table describes the tab page container: tabpage example height=maximum> tag"> ... Embedded controls height=maximum> tag"> ... Embedded controls caption="content"> ... Embedded controls caption="content"> ... Embedded controls tabpage control is also special becaus...

  • Page 150: Panel Container

    158 panel container the following table describes the panel container. Panel example height=maximum> tag"> width="maximum" height=125> down=17 right=10 width=50/> corner="ne" width="maximum"/> anchor="lblsource" corner="sw" down=11 width=50/> type="dropdown" anchor="lblalign" corner="ne" width=100> ...

  • Page 151: Label Control

    159 anchor="panel1" corner="sw" down=5 width="maximum" height=maximum anchor="panel1" corner="sw" down=5 width="maximum" height=maximum caption="advanced"> caption="advanced"> label control the following table describes the label control: a label can serve as a caption for an input control and can d...

  • Page 152: Label Example

    160 label example width=50/> textbox control the following table describes the text box control. Transparent yes/no. Makes label transparent. Align left/center/right. Specifies the horizontal alignment of text in the label. Valign top/center/bottom. Specifies the vertical alignment of text in the la...

  • Page 153: Textbox Example

    161 textbox example width=50/> anchor="lblsource" corner="ne" width="maximum"/> dropdown control the following table describes the dropdown control. Charcase normal/upper\lower. Specifies whether entered text is automatically uppercase or lowercase. The default is normal, preserving the entered case...

  • Page 154: Dropdown Example

    162 dropdown example type="label" caption="align:" anchor="lblsource" corner="sw" down=11 width=50/> type="dropdown" anchor="lblalign" corner="ne" width=100> listbox control the following table describes the listbox control: fontpicker control the following table describes the fontpicker control: mu...

  • Page 155: Fontpicker Example

    163 fontpicker example width=50/> corner="ne" width="maximum"/> colorpicker control the following table describes the colorpicker control: colorpicker example corner="sw" down=11 width=50/> anchor="lblcolor" corner="ne" width="maximum"/> corner="sw" down=11 width=50/> anchor="lblcolor" corner="ne" w...

  • Page 156: Checkbox Control

    164 checkbox control the following table describes the checkbox control: a simple check box control. Returns ‘true’ or ‘false’. Caption caption displayed next to the check box. Checked yes/no. Specifies initial status..

  • Page 157: Checkbox Example

    165 checkbox example anchor="numwidth" corner="ne" down=4 right=20 width=maximum/ > radiogroup control the following table describes the radiogroup control: radiogroup example type="radiogroup" caption="radio one" anchor="lblaccept" corner="sw" down=35 height=maximum width=maximum will not be saved ...

  • Page 158: Textarea Control

    166 replaces the existing file if name conflict occurs." /> generates a unique filename for the upload." /> textarea control the following table describes the text area control: a simple multiline text entry control. Scrollbar none/horizontal/vertical/both. Specifies which scrollbars should be displ...

  • Page 159: Textarea Example

    167 textarea example down=5 right=5 width=maximum height=maximum maxwidthpadding=5 maxheightpadding=5/> sqltextarea control the following table describes the sqltextarea control: (coldfusion studio and jrun studio) a multi-line text entry control that allows the user to execute an sql statement. The...

  • Page 160: Sqltextarea Example

    168 sqltextarea example width="maximum" height=80> type="label" caption="query name:" down=17 right=10 width=80/> type="label" caption="data source:" anchor="lblqueryname" corner="sw" down=10 right=0 width=80/> anchor="lblqueryname" corner="ne" width=130/> anchor="lbldatasource" corner="ne" width=13...

  • Page 161: Filebrowser Control

    169 filebrowser control the following table describes the filebrowser control: a text box used to enter a file path. The control contains two toolbar buttons providing accessibility to local and remote file/directory browsing. Filter the file filter that should be used by the file/directory browsing...

  • Page 162: Filebrowser Example

    170 filebrowser example caption="source:" down=17 right=10 width=60/> anchor="lblsource" corner="ne" width="maximum" relative filter="*.Htm;*.Html;*.Cfml;*.Cfm;*.Asp" /> filenameonly yes/no. Specifies that only a file name should be entered into the text box when a file is specified in a local or re...

  • Page 163: Image Control

    171 image control the following table describes the image control: image example down=10 right=10 autosize="yes"/> the following table describes the image map control: styletextbox control the following table describes the styletextbox control: an image control capable of containing bmp images. File...

  • Page 164: Activex Control

    172 the following table describes the style text area control: activex control the following table describes the activex control: activex example progid="company.Gizmo"/> scrollbar none/horizontal/vertical/both. Specifies which scrollbars should be displayed. Wrap enables wrapping of text. Disabled ...

  • Page 165: Building Custom Wizards

    173 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 invite users to perform complex tasks in an ...

  • Page 166

    174 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 definition file. Vtml for wizards tag summary the follo...

  • Page 167

    175 the following table describes the param tag for the wizard tag. The following table describes the template tag. The following table describes the page tag. The following table describes the pagelayout tag. Attribute description name name of the parameter. Value initial value of the parameter. Re...

  • Page 168: Dynamic Expressions In Tags

    176 the following table describes the param tag for the page tag. The following table describes the input tag. The following table describes the nextpage tag. Dynamic expressions in tags any tag attribute may combine static, constant text with embedded dynamic expressions that reference parameters o...

  • Page 169: Bound Controls

    177 required="$${ parameterexists('customize') }"> or, to customize the outputfile attribute of the template tag using a name attribute entered by the user, you would use the following syntax: outputfile="$${name}admin.Cfm"> the expression syntax supported within the wizard configuration file is the...

  • Page 170

    178 anchor="lbldoctype" corner="sw" down="20" width="90" caption="title:" /> anchor="lbltitle" corner="ne" width="maximum" down="-5" /> caption="meta description" anchor="lbltitle" corner="sw" down="20" width="maximum" maxwidthpadding="10" height="80" lfheight="90"> caption="add meta description:" d...

  • Page 171

    179 height="maximum" width="maximum"/> name="custom.Wml" outputfile="myfile.Cfm" description="new html file"> name="custom.Wml" outputfile="myfile.Cfm" description="new html file">.

  • Page 172: Parameters

    180 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 generates a tag called with a single a...

  • Page 173: String Functions

    181 string functions • chr • compare • comparenocase • find • findnocase • ltrim • rtrim • trim • lcase • ucase • len • left • right • mid • repeatstring runtime functions • parameterexists • setvariable • evaluate the syntax and behavior of all of these functions is identical to the equivalent func...

  • Page 174: Special Considerations

    182 special considerations strings used within an output template tag attribute use the c-language convention (\) for escaping special characters. For example, the following attribute uses a newline character to split the value into two lines: caption="this is line onethis is line two" other speci...

  • Page 175

    183 the wizbreak and wizcontinue tags have no attributes, and can be placed anywhere within a wizloop tag to either exit the loop ( wizbreak ) or move on to the next loop iteration ( wizcontinue ). Wizif, wizelseif, and wizelse the wizif , wizelseif , and wizelse tags work identically to the corresp...

  • Page 176: Selectnameandlocation

    184 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 upgrade to use these additional featu...

  • Page 177: Selecttables

    185 removeparams — comma-delimited list of parameters that should be removed if user reselects the data source. Example image="..\\images\\selectdata.Bmp"> value="choose the data source from which you would like to display data.if your database is not registered as odbc data source, open the odb...

  • Page 178: Selecttable

    186 example 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 on either the result or detail pages.press ctrl or ...

  • Page 179: Selecttablejoins

    187 example image="..\\images\\selecttable.Bmp"> value="records from this table will be displayed in the record viewer."> value="table,viewfields,editfields, uniqueidentifier"> validationmsg="you didn't select the table. Please select one before proceeding."> image="..\\images\\selecttable.Bmp"> val...

  • Page 180: Selectfields

    188 selectfields this page displays all fields from the specified tables and lets the user select one or more of them. Exposes controls lstfields (dropdown) — the control lists fields in the tables specified in the tables parameter. The control exchanges with the bound parameter a comma-delimited li...

  • Page 181: Selectfield

    189 selectfield this page lets the user select one field from the list of fields. The list of fields contains all fields from the specified tables. Exposes controls cbfields (required) — the control lists fields in the tables specified in the tables parameter. The control exchanges with the bound pa...

  • Page 182

    190

  • Page 183: Scripting The

    Scripting the visual tools object model this chapter describes how to program the visual tools object model to call functionality for their applications and how to write scripts to control homesite, coldfusion studio, and jrun studio functions. Contents • writing and executing scripts in allaire vis...

  • Page 184: Writing Scripts

    192 writing and executing scripts in allaire visual tools the allaire visual tools — homesite, coldfusion studio, and jrun studio — expose an object model, enabling developers to manipulate program functionality from external applications. In addition, power users can create scripts using jscript or...

  • Page 185: Executing Scripts

    193 executing scripts once you have written a script, you can create a custom toolbutton to execute it from within the program. If you intend to write multiple scripts, you will want to create a toolbar for them. To create a toolbar for custom scripts: 1. Select the options > customize menu item. 2....

  • Page 186: Application Object

    194 application object you can script the application object’s child objects to perform common tasks and to create toolbars dynamically. General properties activedocument (object, read-only) the active document. See “activedocument object” on page 218 for details. Applicationtype (integer, read-only...

  • Page 187

    195 apppath (olestring, read-only) path to application executable. Currentfolder (olestring) path currently displayed in the local file list. Currentview (itcurrentviewtype) sets/gets the current view. Allowed values are: 1 - vweditsource 2 - vwpreview (browse) 3 - vwdesign documentcache (array of o...

  • Page 188: General Methods

    196 versiontext (olestring, read-only) application name and version. Width (integer) width in pixels of the main application window. You can use this property with the height property to investigate the size of the main window as well as to resize the window. Windowstate (integer) set/get widow stat...

  • Page 189

    197 extractfilepath function extractfilepath(const wsfile: widestring): widestring returns the path of the passed file (includes trailing ‘\’). Getapplicationsetting function getapplicationsetting(nsettingid: integer) retrieves a specific application setting based on a settingid. Getimagesize functi...

  • Page 190

    198 geturl function geturl(const wsurl: widestring): widestring retrieves a url and returns its contents. Geturlstatus function geturlstatus(const wsurl: widestring; var vresponse: olevariant): integer returns the http status code for the passed url. The text of the server response is returned in th...

  • Page 191

    199 installparserscript function installparserscript(const wsscriptfile, wsfileextassoc: widestring): wordbool installs a parser (color-coding) script and associates it with the passed list of semi-colon separated file extensions. If an existing parser is assigned to any of these extensions, they ar...

  • Page 192

    200 openfile function openfile(const wsfile: widestring): wordbool opens the passed file, returning true if successful. Return true if the file is already open. Passing an empty string to openfile will display the "open file" dialog box, enabling the user select the file(s) to open. When using this ...

  • Page 193

    201 setactiveresults procedure setactiveresults(restype: tcurrentresultstype) sets the active page in the results tab. Allowed values are: ressearch resvalidator reslinks resthumbnails setapplicationsetting procedure setapplicationsetting(nsettingid: integer ovsettingval: olevariant) sets a specific...

  • Page 194: Project Properties

    202 statuserror procedure statuserror(const wsmsg: widestring) displays an error message in the status bar - message will appear on a red background and display for at least 5 seconds. Statuswarning procedure statuswarning(const wsmsg: widestring) displays a warning message in the status bar - messa...

  • Page 195: Toolbar Methods

    203 closeproject function closeproject(wbcloseopenfiles: wordbool): wordbool closes the active project, if any. If wbcloseopenfiles is true, then all open files are closed. Openproject function openproject(const wsprojectfile: widestring): wordbool opens the passed project file, making it the active...

  • Page 196

    204 addscripttoolbutton function addscripttoolbutton(wstoolbarname, wsscriptfile, wshint, wscaption, wsimagefile: widestring): wordbool adds a script toolbutton (executes passed jscript or vbscript file when clicked) to the passed toolbar. Fails if toolbar doesn’t exist. Returns true if toolbutton a...

  • Page 197

    205 showtoolbar function showtoolbar(wstoolbarname: widestring): wordbool displays a toolbar if it’s not already showing. Fails if the toolbar doesn’t exist. The jscript example below creates a toolbar named "apps" if one doesn’t exist already, and then adds two custom toolbuttons to it. The first t...

  • Page 198: Table of Commandid Values

    206 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 0 cmdid_cmdfileopen 3 cmdid_cmdfileclose 4 cmdid_c...

  • Page 199

    207 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 cmdid_cmdeditcodeformat // co...

  • Page 200

    208 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_cmdsearchfindmatchingtag 76 cmdid_cmdsearchreplacedo...

  • Page 201

    209 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_cmdvieweditortab 110 cmdid_cmdview...

  • Page 202: Table Of Settingid Values

    210 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_readonly_files 0 flag read-only files in the file list se...

  • Page 203

    211 set_file_filter 23 file filter for file list set_remote_file_filter 24 file filter for remote file list set_tag_insight 26 use tag insight set_insight_showtaglist 27 use tag insight for tags (immediately after hit) set_tag_completion 28 toggle tag completion set_taghelp_delay 29 milliseconds to ...

  • Page 204

    212 set_proxy_port 51 set the proxy port for link verification and open from web set_connect_timeout_ms 52 timeout (in milliseconds) for link verification and open from web set_save_file_format 53 file format for saving (pc, unix, mac) set_web_document_extensions 54 configure the extensions list for...

  • Page 205

    213 set_check_update_timeout_short 102 timeout for update check at startup (milliseconds) set_check_update_timeout_long 103 timeout for update check initiated by user set_check_update_last_date 104 check date of last product update set_center_start_tag 105 start tag to use when align center toolbutt...

  • Page 206

    214 set_dir_toolbutton_images 156 set location of images directory for toolbars when no path specified in tbr file set_dir_parsers 157 set location of color coding parsers directory set_dir_startup 158 set location of startup directory set_dir_wizards 159 set location of wizard root directory set_di...

  • Page 207

    215 set_defaultautoformat_file 214 default formatting used by the codesweeper set_verity_help_search_helpfile 215 used to display search tips set_style_edit_wnd_class 216 used to dynamically invoke a style editor (styleed or topstyle) set_style_edit_ole_object 217 used to dynamically invoke a style ...

  • Page 208

    216 set_editor_charset 326 set editor character set set_editor_outlinecurrline 327 set outline on current line set_siteview_gradient 400 set gradient fill for site view set_siteview_showtitle 401 toggle site view title set_siteview_style 402 set tree or chart view set_siteview_autonav_to_link 403 na...

  • Page 209: Documentcache Object

    217 documentcache object it is very important to understand the documentcache object when using the visual tools object model. Although the visual tools enable you to open dozens of files at once, only the active document is kept in memory. When a document becomes inactive, that is, when the user sw...

  • Page 210: Activedocument Object

    218 activedocument object the activedocument object is used to refer to the document currently being displayed in the editor. To access an open document that isn’t active, use the application.Documentcache object. Properties canredo (wordbool, read-only) true if changes can be re-done. Canundo (word...

  • Page 211: Methods

    219 methods beginupdate procedure beginupdate() turns off screen updating for the active document. This is useful if your script needs to make several changes to the active document at once — turning off screen updating during the procedure might significantly speed up the process. To turn updating ...

  • Page 212

    220 gettagatcursor function gettagatcursor(wbselect: wordbool): widestring; returns the tag in which the cursor is currently located in the editor. If a tag cannot be identified, the method returns an empty string. If wbselect is true, the tag will be selected (highlighted) in the document. Example:...

  • Page 213

    221 inserttext procedure inserttext(insertstr: olevariant; wboverwriteselection: wordbool) inserts the passed string at the current cursor position, overwriting the selection if wboverwriteselection is true. Lastsaveddate function lastsaveddate() returns the datetime value for the last save of the a...

  • Page 214: Cursor Movement Procedures

    222 selectline procedure selectline(index: integer) highlights the passed line. Setcaretpos procedure setcaretpos(x, y: integer) sets the current column/line. Textpostoeditorpos function textpostoeditorpos() takes the passed cursor position and subtracts the number of linefeeds the text contains. Yo...

  • Page 215: Deploymentmanager Object

    223 deploymentmanager object the deploymentmanager vtom object is a scriptable interface into the allaire project deployment engine. It provides a collection of methods and properties to allow you to write highly customized vtom scripts to control the deployment process. Properties createfolder(word...

  • Page 216

    224 checkserverfolders procedure checkserverfolders(sservername: widestring); inserted in the generated vbscript/jscript deployment scripts at the appropriate points, it iterates through all of the assigned deployment folders for a project, verifying their existence on the target server ( sservernam...

  • Page 217

    225 getdeploystate procedure getdeploystate(sservername:widestring): wordbool queries a specific deployment server to determine if it is enabled for deployment. Getdeploystate is passed the server name as sservername and returns a wordbool true or false result. Getdeploytargetname function getdeploy...

  • Page 218

    226 getlasterrormessage function getlasterrormessage(): widestring tests the result of an uploadfile call by returning last associated rds error message. Isfolderdeployable function isfolderdeployable(const sfoldername:widestring): wordbool returns the deployment status of the passed folder name. Th...

  • Page 219

    227 uploadproject procedure uploadproject(const sprojectname: widestring) uploads an entire project based on the fully qualified project name passed as an ole string. This triggers the default deployment engine processing loop which iterates through each server assigned to the project, each folder w...

  • Page 220: Httpprovider Object

    228 httpprovider object the httpprovider object is a general purpose http protocol object. It can be used from vtom scripts for low-level http operations. The httpprovider was introduced as an alternative to simplified http-related methods such as geturl method of the main application object which i...

  • Page 221

    229 docname (olevariant; readonly) the document name segment from the requested url. Lastresponse (olevariant; readonly) the most recent response content block when content stream is sent from the server in multiple responses. Location (olevariant; readonly) the response-header field which defines t...

  • Page 222

    230 reasonphrase (olevariant; readonly) the reason-phrase element which is intended to give a short textual description of the status-code. The status-code is intended for use by automata and the reason-phrase is intended for the human user. The following are some of the status-code, reason-phrase p...

  • Page 223: Methods

    231 state (tallairehttpproviderstate; readonly) the state of the httpprovider object. The enumerated state values are: 0 - httpready 1 - httpnotconnected 2 - httpconnected (browse) 3 - httpdnslookup 4 - httpdnslookupdone 5 - httpwaitingheader 6 - httpwaitingbody 7 - httpaborting statuscode (integer;...

  • Page 224

    232 "proxyusername=’" + httppro.Username + "‘" + "proxypassword=’" + httppro.Password + "‘" + "proxy=’" + httppro.Proxy + "‘" + "proxyport=’" + httppro.Proxyport + "‘" + "proxyusername=’" + httppro.Proxyusername + "‘" + "proxypassword=’" + httppro.Proxypassword + "‘" + "sender=’" + httpp...

  • Page 225

    233 post procedure post() performs an http post method request. The following example illustrates a post method by which three form variables are submitted to a coldfusion page. Function main () { var app = application; var httppro = app.Httpprovider; httppro.Url = "http://127.0.0.1/httptest.Cfm"; v...

  • Page 226

    234 the following scripts illustrates a download of a zip file using savereceivedstreamtofile: function main () { var hsokinfo = 64; var app = application; var httppro = app.Httpprovider; httppro.Url = "http://127.0.0.1/test.Zip"; httppro.Get(); var boverwrite = false; var serrormsg = httppro.Savere...

  • Page 227: Zipprovider Object

    235 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 visual tools. Since allaire uses a licensed control...

  • Page 228: Methods

    236 the following example uses the zipfile property to extract a file (somefile.Exe) from another file (d:\\downloads\\test.Zip): function main () { var hsokinfo = 64; var app = application; var zippro = app.Zipprovider; zippro.Extractiondir = ‘d:\\extracthere\\’; zippro.Zipfile = ‘d:\\downloads\\te...

  • Page 229

    237 //interpret and display the return code var smessage = ‘’; if (nstatuscode == 0){smessage = "operation succesful";} else if (nstatuscode == 10){smessage = "general warning";} else if (nstatuscode == 0){smessage = "success";} else if (nstatuscode == 10){smessage = "warninggeneral";} else if (nsta...

  • Page 230

    238 delete function delete(files: olevariant): integer deletes files from an archive. The files parameter can be used to narrow down the group of files to delete. You can specify a single file, a set of files delimited by line breaks or an entire directory using wildcards. If left an empty string al...

  • Page 231

    239 filename function filename(nindex: integer): widestring returns the name of an existing archive file element (file/directory/volume) by index. The index value can be from 0 to filecount-1. The following code illustrates a loop over the content of the archive looking for a specific file name: fun...

  • Page 232: Activescripting Examples

    240 activescripting examples jscript // //===================================================================== // activescripting example (jscript) //===================================================================== // displays a table containing the filenames of all open documents, // whether ...

  • Page 233

    241 // is this document modified? If (app.Documentcache(idx).Modified) stable = stable + ‘yes’; stable = stable + ‘ // is this document read-only? If (app.Documentcache(idx).Readonly) stable = stable + ‘yes’; // close row stable = stable + ‘ } stable = stable + newline + ‘’; // add a new document (f...

  • Page 234: Vbscript

    242 vbscript //============================================================= // displays a table containing file information //============================================================ sub main dim app dim idx dim stable dim newline, fname, br, tab dim ncurrentidx newline = chr(13) + chr(10) br =...

  • Page 235

    243 ‘ 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 + "" ‘ add a new document ...

  • Page 236: Third-Party Add-Ins

    244 third-party add-ins at start-up, the program executes any scripts it finds listed in these windows registry keys: hkey_current_user\software\allaire\homesite45\runonce hkey_current_user\software\allaire\studio45\runonce hkey_current_user\software\allaire\jrstudio3\runonce if you want to distribu...