Tango Editor BasicsAn Explanation of the Tango Editor Interface and Some Common OperationsThis chapter helps you orient yourself to the Tango Editor interface and some of the common operations available to you. The topics covered in this chapter include:
![]() Tango Editor Window Components |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
To start Tango Editor, do either of the following:
The main Tango Editor window appears. The main title bar displays the Tango Editor name and the name of the current (front most) application file or the SQL Query window. The menu bar contains pull-down menus for Tango Editor commands. Click a menu title to open it, then click a command to select it. Commands appearing in gray do not apply to the operations you are trying to perform. The main window area displays one or more application file windows, action editing windows, attribute editing windows, or the SQL Query window. The Status Bar displays messages about the Tango Editor environment, such as when connecting to a data source, the currently connected data source, or when passing the cursor over a toolbar icon to display its name/function. It also shows if Caps Lock, Num Lock, and Scroll Lock on the keyboard are switched on. The Workspace includes tabs for Data Sources, Snippets, and Projects, if any exist. You switch among the three workspaces by clicking the corresponding tab. Click icons on the Actions Bar and drag them into an open application file to add them to the file. Click icons on the Attributes Bar to assign attributes to selected actions. Click icons on the toolbar to select the main Tango Editor commands. For example, to save an application file, you can either choose Save from the File menu, or click the Save icon on the toolbar. Viewing Interface ObjectsYou can choose to show or hide the Workspace window or any of the toolbars by enabling the object's name from the View menu. A checkmark beside the name indicates the object is visible in the interface. Uncheck the name to hide the object. To hide the Workspace window, you can also right click it and click Hide from its context-sensitive menu. Floating and Docking Interface ObjectsThe Workspace window and toolbars are, by default, docked to the Tango Editor interface. You can drag them from the interface to undock, or float, them anywhere on your desktop. You can also dock them again. To float an object on your desktop, simply click the undocking bars and drag the object to the desktop. If you want, you can then resize the object. Position the cursor over the object's border, and when the cursor changes to the resize arrow, click and drag its border. To dock the object to the interface again, drag it to anywhere in the toolbar area. Floating and Docking the Workspace WindowYou can float the Workspace window in the Tango Editor main window or anywhere on your desktop, or dock it to the interface. To do this, you enable (checkmarked) or disable (unchecked) commands appearing in the Workspace window's context sensitive menu. To float the Workspace window only in the Tango Editor main window, right click the Workspace window and click Float in Main Window. A checkmark appears beside the command indicating the option is enabled. This prevents you from dragging the Workspace window beyond the borders of Tango Editor. If you want to drag the Workspace window to anywhere on your desktop, disable Float in Main Window and drag the Workspace window to another position. To dock the Workspace window to the interface, drag the Workspace window to the toolbar area.
To avoid inadvertently docking the Workspace window to the interface, right click the Workspace window and disable Allow Docking. ![]() Using Context-Sensitive MenusIn most Tango Editor windows and dialog boxes, you can position the cursor on a particular area of the screen and click the right mouse button to display a context-sensitive menu of commands. The commands that appear relate to the object you clicked. Commands that appear grayed out are not applicable to the current object. For example, another way to hide the Workspace window is to right-click it and select Hide from the context-sensitive menu. ![]() Properties WindowThe Properties window allows you to view information about and add comments to a selected object. Selectable Tango objects include data sources (including tables and columns), application files, and actions. In general, the Properties window changes to show the properties of the currently selected object. The following is an example of an Action Properties window for a Search action. To open any Properties windowThe Properties window can be left open. Clicking an object with properties updates the window to show information about that object's properties. ![]() HTML Editing WindowEach action in an application file can have HTML associated with it. Whenever you open the assigned attribute of an action, the corresponding HTML editing window appears. You can create or edit any assigned HTML using this window. An example of an HTML editing window is as follows. The title of the window follows the form: <Document> : <Action> : <HTML> This example shows the HTML editing window for the Results HTML of a Search action named "RecordList" within the Sample.taf application file. Tango Editor supports the standard editing commands. The Edit menu displays the following editing commands when an HTML editing window is open. You can also right click the HTML editing window to display a context sensitive menu at the cursor position in the window. The following table lists the commands available in the menu.
Closing the editing window automatically saves any changes you make. To cancel any changes, you can choose Undo, or close the file without saving. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information, see "Setting Preferences". |
To make editing of your files easier and clearer, you can color code many of the HTML and text components that may appear--HTML, meta tags, attributes, default text, and comments. You can also position text using tab characters. Tabs are stored as tab characters and are not converted to spaces. Tabs have no effect on the display of HTML in the Web browser; they are used to make the HTML that you enter more readable. You specify the number of space characters that equal one tab character in the Preferences dialog box. You can also specify whether you want Tango to insert tab characters to start a new line at the same indent level as the previous line. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information on converting former query documents to Tango application files, see the Getting Started Guide. |
You can enter any amount of text in an HTML editing window. You can also drag and drop text from elsewhere, for example, from other editing windows.
Selecting lines of text in an editing window is easy. You simply use the selection strip next to the line to select the entire line. When you select a line, it is highlighted. The following describes the operations you can perform using the selection strip.
To indent selected lines, press the Tab key. All selected lines are indented the number of characters equal to one tab character. Press the Tab key again to indent the selected lines farther; press the Shift+Tab keys to reduce the indention. You set the number of characters equal to a tab character in the Preferences dialog box. See "Text".
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.
The HTML editing window is common for any of the HTML attributes that may be assigned to an action--Results HTML, No Results HTML, and Error HTML. Only the applicable attribute tabs for the selected action appear at the bottom of the window. You switch among the HTML editing windows by clicking the appropriate tab. Only the applicable page or response HTML tabs appear at the bottom of the window. You can also open the attribute HTML associated with an action by doing one of the following: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information on customizing page and response HTML for the Search Builder, see "Configuring the Search Builder" . |
The Search Builder also uses HTML editing windows so you can customize page HTML (Header and Footer) and response HTML (Update Response, Delete Response, and No Results) for the Search, Record List, and Record Detail pages. For example, the following HTML editing window shows the Header HTML for the Search Builder's Record Detail page in the Sample.taf application file. In addition to editing an action's or Search Builder's associated HTML, you can also use Tango's editing capabilities to create and edit HTML and text files. The editing capabilities and window settings described for HTML action attributes apply equally to HTML and text files opened for editing with Tango Editor. To create a new HTML or text fileFrom the File menu, choose New, then HTML or Text File from the submenu. The default window name is "Untitled1", until you save it as another name. Subsequent new windows are named "Untitledn", where n is the next number in the series, that is, the second window opened is "Untitled2", and so on. To save a new HTML or text file
To open an HTML or text file
You can also split the editing window into two or more panes. This allows you to see text from different locations in the same HTML or text file at the same time. This example shows text in adjacent panes from two different places in the same Readme.txt file. This is useful if you want to see text from different places in the same file at the same time, or if you want to cut, copy, or paste text between the open panes.
To split the editing window into multiple panes
![]() Word WrapThe Word Wrap command in the View menu is available for certain text windows. When the command is available, selecting it enables or disables word wrap. A checkmark indicates word wrap is enabled. If word wrap is disabled, a horizontal scroll bar is available to view text outside the boundaries of the text window. Word wrap is available in the Direct DBMS action window, Script action window, and File action window, among others.
![]() The SQL Query Window |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information, see "Performing a SQL Query". |
The SQL Query window gives you a convenient way of performing simple SQL queries within Tango Editor, for example, to test your Direct DBMS actions or to check database values. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Setting Up a SQL QueryThe components and functions of the SQL Query window are as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information on SQL COMMIT and ROLLBACK operations, consult your SQL documentation. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can specify a different default font for text appearing in the SQL query text and results areas in the Preferences dialog box; see "Setting Preferences". For more information, see "Dragging Actions into SQL Query Text". |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dragging Actions into SQL Query TextYou can drag any database action, except a Transaction action, which does not generate SQL, from an application file into the SQL Query window. When you do this, some SQL Query window attributes are set based on the contents of the action. The following attributes are automatically set:
Performing a SQL QueryTo perform a SQL query |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can also choose the SQL Query command from a context-sensitive menu. Right click the application file window or an open action window. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The results of the SQL query, if any, appear in the Results area. ![]() Using Tango Application FilesA Tango application file provides a powerful and flexible means for you to construct dynamic applications that run on your Web server and that interact with databases, other applications, and users running Web browsers. They are like programs or scripts in that they determine what operations Tango Server performs. Tango Server provides the brains, but it does nothing without the specific instructions you provide in the form of application files. You add actions to an application file. When Tango Server runs the application file, it generates the HTML that is used by the browser to display the forms required to allow interaction with databases and other applications. You can use the Search Builder and New Record Builder to have Tango Editor build search and insert record applications for you. An application file is a file containing a series of Tango actions that when executed by Tango Server generates HTML and controls interaction with databases and other applications. Application File WindowIn Tango Editor, whenever you open an application file, the application file window shows you the following information:
The application file window also includes icons for attributes and data sources. Creating an Application FileTo create a new application file |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
From the File menu, choose New, or in the toolbar click the New icon. An untitled application file opens. Dragging ColumnsWhen creating or modifying a Tango application file and actions, you must specify which database columns to use in various places. To do this, you drag the columns from the Data Sources workspace to the appropriate place in the file.
To see the Data Sources workspace, click the Data Sources tab. A workspace appears containing information about data sources, such as the currently defined data sources and all tables and columns. If no data sources are set up yet, only the data source types appear. Saving an Application File |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To save an application file
Saving an Application File as Run-OnlyRun-only application files can be executed by Tango Server, but they cannot be opened by Tango Editor. Saving an application file as run-only allows you to create and distribute packaged Tango solutions while preventing users from editing the actual application file. Run-only application files are executed and referenced by Tango Server in the same way as editable application files. Saving an application file as run-only does not make its execution any faster.
To make an application file run-only
Debugging Application FilesSetting the debug mode in Tango Editor lets you see useful information about your application file execution in your Web browser application. To set the debug mode
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
When you execute the application file, debugging information appears at the bottom of the results returned. The debugging information shows information such as: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information, see "Configuring Tango Server". |
You can force debugging for all application files by changing the debugMode system configuration variable using the application file that allows you to set system configuration (config.taf). Executing Application FilesApplication files are executed in the same way HTML files are viewed--simply by specifying the name of the file in a URL. For example: http://www.yourserver.com/shop/additem.taf This example executes an application file called additem.taf located in the shop folder on the server www.yourserver.com.
You can pass parameters to the application file by using search arguments. These are name-value pairs appearing after a question mark in the URL. For example: http://www.yourserver.com/shop/additem.taf?item_num=8580 In this example, the item_num search argument has a value of "8580". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There are other ways of passing values to Tango application files. Form fields (post arguments) and cookies are two examples. ![]() Finding and Replacing Text |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For more information, see "Using Regular Expressions". |
In Tango Editor, you can perform operations to find, or to find and replace text in application files. Tango Editor can perform both normal searches and searches using regular expressions. Performing Find OperationsFor the purpose of this discussion, the term string refers to both character strings (that is, text) and regular expressions. You specify that the search is to treat the string in the Find field as a regular expression by selecting the Regular expression option in the Find or Replace dialog box. If you want to find a certain string, you specify that string in the Find dialog box. If you want to find a certain string and replace it with another string, you do that in the Replace dialog box. You can find any string that can be entered in any non-modal Tango Editor window. This includes values in criteria lists, action parameters you have entered--such as for the Limit to field in a Search action's Results window, custom SQL, If action conditions, External action parameters, custom column definitions, and HTML. Tango Editor cannot find a string you did not explicitly enter, for example, data source names, user names or passwords entered by users, column names in Select lists, and join information. You can perform find, and find and replace operations in open application files, action editing windows, HTML editing windows and projects. Unless specified otherwise, Tango Editor begins searching at the insertion point indicated by the cursor and continues to the end of the search range specified in the Find in section of the dialog box. To find, or find and replace a string
Using Regular ExpressionsA regular expression is formed by one or more special characters that represent a string of text.
To find any single characterA period (.) finds any character except a newline character.
To repeat expressionsRepeat expressions with an asterisk (*) or a plus sign (+). A regular expression followed by an asterisk finds zero or more occurrences of the regular expression. If there is any choice, Tango Editor chooses the longest, left-most matching string in a line. A regular expression followed by a plus sign finds one or more occurrences of the one-character regular expression. If there is any choice, Tango Editor chooses the longest left-most matching string in a line.
To group expressionsIf an expression is enclosed in parentheses, ( ), Tango Editor treats it as one expression and applies an asterisk or plus sign to the whole expression.
To choose any character from manyA string of characters enclosed in square brackets, [ ], finds any one character in that string. If the first character in the brackets is a caret (^), it finds any character except those in the string
A minus sign (-) within square brackets indicates a range of consecutive ASCII characters. For example, [0-9] is the same as [0123456789]. The minus sign loses its special meaning if it is the first character (after an initial caret, if any) or last character in the string. If a right square bracket is immediately after a left square bracket, it does not terminate the string; however, it is considered to be one of the characters to match. If any special character--such as the backslash (\), asterisk (*), or plus sign (+)--is immediately after the left square bracket, it does not have its special meaning and is considered to be one of the characters to match.
To find the beginning or end of a LineYou can specify that a regular expression find only the beginning or end of the line. If a caret (^) is at the beginning of the entire regular expression, it finds the beginning of the line. If a dollar sign ($) is at the end of the entire expression, it finds the end of the line. If an entire expression is enclosed by a caret and dollar sign (for example, ^the end$), it finds an entire line.
To re-use a regular expression in the Replace fieldTango extends the regular expression functionality and allows you to remember and recall a part of a regular expression. Enclose the part to remember with parentheses. To recall it, use \n, where n is a digit that specifies which expression in parentheses to recall. Determine n by counting occurrences of ( from the left. You can only use this feature in the Replace field of the dialog box.
![]() Working With Multi-column Column ListsMany Tango actions include multi-column lists for entering parameters--the criteria list in the Search action, for example. This section describes basic techniques for working with these lists. To select an entire rowTo move a rowSelect the row and drag it to the desired location. A flashing grey line indicates where the row is inserted when the mouse button is released. Drop-down MenusVarious columns have drop-down menus in each cell. Place the cursor in the cell and click the mouse. A downward direction arrow appears. Click the arrow and the drop-down menu appears. From a cell's drop-down menu, you can select from preset values (like "and/or" and "true/false"). To resize a columnClick at the edge of the column in the list's header, and drag. To resize a column to fit the data in it, double click its right edge in the header. To delete a row
![]() Keyboard ShortcutsThe keyboard shortcuts, as they appear in Tango Editor menus, are as follows:
When working in the Project, Data Sources,
and Snippets Workspaces, or in the application file window, you can
expand and collapse any parent object by one level using the left and
right keyboard cursor keys. A parent object is any object
denoted in the view by the plus sign ( |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can also use keyboard shortcut keys in an open application file window to expand and collapse the parent object through all levels at one time. |
Copyright © 1998, Pervasive Software Inc. All rights reserved.