Tango Editor BasicsIntroducing the Tango Editor Interface and Tango Application FilesThis chapter helps you orient yourself to the Tango Editor interface and some of the common operations available to you, and describes Tango application file operations. The topics covered in this chapter include:
Tango Editor Interface ComponentsWhen you double-click the Tango Editor icon, the main Tango interface components appear. The menu bar shows the menus and commands applicable to Tango. The Tango application file window is where you create and edit your Tango application files. The Workspace has tabs for Project, Data Sources, Objects, and Snippets. You switch among the four sections of the Workspace by clicking the corresponding tab. The four sections are called Project Workspace, Data Sources Workspace, Objects Workspace, and Snippets Workspace, respectively. Click icons on the Attributes palette to assign attributes to selected actions. Click icons on the Actions palette and drag them into an open application file to add them to the file. |
|||||||||||||||||||||||||||||||||||||||
You can choose to show or hide the Workspace window and any of the palettes by enabling the component's name from the Windows menu. A check mark beside the name indicates the component is visible in the interface. Uncheck the name to hide the component. Contextual MenusIn many Tango Editor interface components, you can position the cursor on a particular area and control+click the mouse to display a contextual menu of commands. The commands that appear relate to the item you click. Grayed-out commands are not applicable to the current item. Properties WindowThe Properties window allows you to view information about and add comments to a selected item. Selectable Tango items 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 item. To open any Properties windowThe Properties window can be left open. Clicking an item with properties updates the window to show information about that item. HTML Editing WindowMost actions in an application file can have HTML associated with them. Whenever you select an action and an attribute option, the HTML editing window appears. The title of the window follows the form: <Document> : <Action> : <HTML> Tango Editor supports the standard editing commands. The Edit menu displays the following commands: Contextual MenuYou can also control+click in the HTML editing window to display a similar menu at the cursor position in the window. The following table lists the commands in the contextual menu:
Closing the window automatically saves any changes you make. To cancel any changes, you can choose Undo from the Edit menu or the contextual menu, or close the file without saving it. Syntax Coloring |
|||||||||||||||||||||||||||||||||||||||
For more information, see"Setting Preferences". |
To make editing of your files easier and clearer, many of the HTML and text components that appear are color-coded--HTML, Tango meta tags, attributes, default text, and comments. You can change the specified colors. 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. Word WrapWord wrap is also available in the HTML editing window. From the Windows menu, choose Word Wrap to enable and disable it. A checkmark indicates that word wrap is enabled. Indenting and Selecting TextYou can 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 you enter more readable. |
||||||||||||||||||||||||||||||||||||||
For more information on the Preferences dialog box, see"Setting Preferences". |
You specify the number of space characters that equal one tab character in the Tab size field of 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 by enabling or disabling Auto-indent in the Preferences dialog box. HTML Editing Window and AttributesThe HTML editing window allows you to easily access any of the HTML attributes that may be assigned to an action: Results HTML, No Results HTML, and Error HTML. Not all attributes may be assigned to all actions: the applicable attribute tabs for the selected action appear enabled at the top of the window; unavailable tabs are grayed. Within the HTML editing window, you can switch between the different HTML attributes by clicking the appropriate tab. You can also open the attribute HTML associated with an action by doing one of the following: |
||||||||||||||||||||||||||||||||||||||
For information on new keyboard shortcuts, see "Keyboard Shortcuts". |
|||||||||||||||||||||||||||||||||||||||
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. Creating a New HTML or Text FileIn addition to editing the HTML associated with an action or a builder, you can use Tango's editing capabilities to create and edit HTML and text files. The editing capabilities and window settings described for HTML action attributes also apply to HTML and text files opened for editing with Tango Editor. To create a new HTML or text fileThe default window name is "untitled", until you save it under 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
<@INCLUDE> in HTML Editing WindowsHTML editing windows in Tango can contain <@INCLUDE> meta tags, which, when executed by Tango Server, return the contents of a specified file. When you edit text and HTML in the HTML editing window, you can open files referenced with <@INCLUDE> by selecting one of the commands Open Selected <@INCLUDE> or Open Selected <@INCLUDE> with.
Open Selected <@INCLUDE>Open Selected <@INCLUDE> causes Tango to open the file referenced by <@INCLUDE> according to the preferences you have set in the Preferences dialog box. For example, if you have set the Open text files using option to Tango Editor, the included file opens in Tango Editor. If you have set this option to Application used to create the file, the included file opens in the application with which it is associated. If you have set this option to Selected external editor, the included file opens in the application you have specified in the External editor field in the Preferences dialog box. To open an included file using Open Selected <@INCLUDE>Select the <@INCLUDE> tag that you want to open, and do one of the following: |
||||||||||||||||||||||||||||||||||||||
For more information, see "Setting Preferences". |
The included file opens in either Tango Editor or an external editor, depending on your preference settings. If there is more than one included file with the same name in the project, the Multiple Matching Files dialog box appears: Select the included file you want to open and click OK.
Open Selected <@INCLUDE> withOpen Selected <@INCLUDE> with causes Tango to automatically open the selected included file in the application you have specified in the External editor field of the Preferences dialog box. Even if you have your preferences set to open the file automatically in Tango Editor or the application used to create the file (that is, Tango Editor or Application used to create the file is selected in the Open text files using section of the Preferences dialog box), Tango still uses the application which appears in the External editor field to open the included file. You can open a selected <@INCLUDE> tag with this command in the same way as Open Selected <@INCLUDE>; see the previous section. 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. Pop-up MenusVarious columns have pop-up menus in each cell. Place the cursor in the cell and click the mouse. A downward-directional arrow appears. Click the arrow and the pop-up menu appears. From a cell's pop-up menu, you can select from preset values. To resize a columnClick 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 rowDragging 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. If word wrap is disabled, a horizontal scroll bar is available to view text outside the boundaries of the window. The SQL Query WindowThe 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. |
||||||||||||||||||||||||||||||||||||||
To perform a SQL query, see "Performing a SQL Query". |
The SQL Query window displays the following components: 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 "The SQL Query Window". |
|
||||||||||||||||||||||||||||||||||||||
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 Query |
|||||||||||||||||||||||||||||||||||||||
|
To perform a SQL query
Finding and Replacing Text
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.
For more information on regular expressions, see "Using Regular Expressions". Performing Find Operations
For 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 & Replace dialog box.
If you want to find or replace a certain string, you specify that string in the Find & 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-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
|
||||||||||||||||||||||||||||||||||||||
You can also choose Find Again from
the Edit menu or press
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 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.
Keyboard ShortcutsThe keyboard shortcuts, as they appear in Tango Editor menus, are as follows Windows Menu ShortcutsTo view the Workspace, Actions palette, or Attributes palette, use the Windows menu commands. For example, to view the Actions palette, either
choose Actions Palette from the Windows menu,
or press The Cycle Workspace command enables
you to move consecutively from one Workspace window to the next. For example,
if you are currently viewing the Project Workspace, pressing
Expanding and Collapsing Parent ObjectsWhen working in the Project, Data Sources, Snippets, or Object 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 disclosure triangles: expandable, and collapsible.
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. Using Tango Application FilesA Tango application file (or simply, 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 Web 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. (You can also create Tango class files, which are reusable software components that you can incorporate in Tango application files. For more information, see "Tango Class Files"..) XML FormatTango application files and Tango class files are stored in an Extensible Markup Language (XML) format, which means they are structured text based on a specific document type definition. This is a substantial change from the binary formats of files in previous versions of Tango. What is XML?XML is a text-based and widely-endorsed standard markup language, similar to HTML, but much more flexible and robust. It is a subset of SGML (Standard Generalized Markup Language), an ISO standard. Its goal is to enable generic SGML (that is, structured documents) to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML. |
|||||||||||||||||||||||||||||||||||||||
For details about the XML file format, see www.w3.org/xml/. |
Tango XML file formats give Tango users the following advantages:
SGML and XML specifications require a document type definition (DTD). The DTD defines the structure of the various elements that make up an XML document and ensures that all applications that read and write it do so in a consistent way. It is, in effect, the schema of the document. |
||||||||||||||||||||||||||||||||||||||
For more information about document type definitions and how to read them, see www.oasis-open.org/ cover/sgml-xml.html. |
The Tango DTD for Tango application files and Tango class files is specified by the file tango.dtd. This file is located in the XML folder inside the folder where Tango is installed (by default, this is in the Tango 2000 folder). Application File WindowIn Tango Editor, whenever you open an application file, the Tango application file window (or simply, application file window) shows you the following information:
The application file window also includes icons for attributes, objects, and data sources. The following diagram shows a typical application file window and its components:
Unsaved Changes IndicatorWhenever you change a Tango application file or class file, and the file has not been saved, an asterisk appears beside the file name in the title bar of the window and beside the filename in the window. This is called a dirty (unsaved changes) indicator. Once you save the application file, these indicators disappear. Creating an Application FileTo create a new application fileAn untitled application file opens. Saving an Application FileTo save an application file |
||||||||||||||||||||||||||||||||||||||
Saving a Tango Application File or Tango Class File as Run-Only
Run-only Tango application files and Tango class files can be executed by Tango Server, but they cannot be opened by Tango Editor.
Saving an application file or Tango class 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 and Tango class files are executed and referenced by Tango Server in the same way as editable files. Saving an application file or Tango class file as run-only does not make its execution any faster.
To make an application file or Tango class file run-only
Debugging Files
Setting the debug mode in Tango Editor lets you see useful information about your application file or Tango class file execution in your Web browser application. To set debug mode
A debug icon appears beside the application file icon when Debug File is checked. When you execute the application file, debugging information appears at the bottom of the results returned. The debugging information shows information such as: |
|||||||||||||||||||||||||||||||||||||||
You can force debugging for all application files and Tango class files by changing the debugMode system configuration variable using the Tango 2000 Configuration Manager (config.taf). See "Configuring Tango Server" for more details on configuring Tango Server. Executing Application FilesApplication files are executed in the same way HTML files are viewed--by specifying the name of the file in a URL. For example: http://www.example.com/shop/additem.taf This example executes an application file called additem.taf, located in the shop folder on the server www.example.com. If you are using the Tango CGI, you may need to include the Tango CGI in your URL, for example: http://www.example.com/Tango2000.acgi$/additem.taf 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.example.com/shop/additem.taf?item_num=80 In this example, the item_num search argument has a value of "80". |
|||||||||||||||||||||||||||||||||||||||
For more information, see "Assigning Variables With the Assign Action". |
There are other ways of passing values to Tango application files. Form fields (post arguments) and cookies are two examples. Converting to Tango 2000 FormatThe Tango 2000 Editor can open Tango application files created with version 3.x or earlier of Tango and converts them to Tango 2000 (XML) format. The file is not saved in XML format until you choose the Save command. |
||||||||||||||||||||||||||||||||||||||
Tango 2000 Server runs Tango 3.x and Tango 2000 application files, but does not run Tango 2.x query documents: they must be converted to Tango 2000 format.
|
|||||||||||||||||||||||||||||||||||||||
If you open a Tango 3.x project, all Tango 3.x application files in that project are automatically converted to Tango 2000 (XML) format. Opening Tango 3.x Application FilesIt is strongly recommended that you back up all your Tango 3.x application files before converting them to Tango 2000 (XML) format. If you attempt to open a Tango 3.x application file with Tango 2000 Editor, a warning dialog box appears. Clicking OK opens the file. The file is not saved in XML format until you choose the Save command. The Tango 2000 XML file has exactly the same structure and features as a Tango 3.x binary application file: no data is lost in the conversion. XML Conversion Drag-and-Drop UtilityA drag-and-drop utility, TAF Converter, that converts Tango 3.x (binary) application files to Tango 2000 XML files, is distributed with Tango 2000 to help you convert your application files without having to open them individually in Tango Editor. TAF Converter is located in the XML folder under your Tango2000 folder. |
|||||||||||||||||||||||||||||||||||||||
To convert Tango 3 format files to Tango 2000 application files
During conversion, a progress bar appears. Click Cancel on the progress bar to cancel the operation. A dialog box appears when conversion is successful. When conversion is successful, TAF Converter creates a Tango 2000 format file and appends the extension .old to the Tango 3 format application file. For example, converting Tango 3 application file example.taf produces a Tango 2000 application file, example.taf, and a back-up copy of the Tango 3 format file, example.taf.old. |
Copyright © 1999, Pervasive Software. All rights reserved.