Using ActionsThe Basics of Using Tango ActionsA Tango application file is made up of a series of one or more actions. Each action performs a specific type of function and can have results, usually in the form of HTML1, associated with it. The applications you create may be used to input data to information systems, compose and display information from data sources, and many more interactions. When an application file is called, the actions in it are executed by Tango Server. When execution is complete, the HTML results are returned to the user's browser. These results can be from the user or from interaction with other servers, normally DBMSs. Several actions allow you to search, add, update and delete database records. There are also actions for executing manually entered database statements and controlling the flow of execution within an application file. You can also automatically create a sequence of actions using the builders. This chapter covers the following topics: ![]() About ActionsThe Actions bar shows all the available action types. It appears whenever an application file is active, or you choose Actions Bar from the View menu.
You add all Tango actions to an application file from the Actions bar. The following table lists each action, its function, and where in this User's Guide you can find more information. As well as actions, the Actions bar includes icons for the Search Builder and the New Record Builder. You add the builders to an application file in exactly the same way you add actions.
![]() Working With ActionsThe application file window shows the actions that you want Tango Server to execute. Generally speaking, actions are executed sequentially, from top to bottom, until a control action is encountered. Control actions make decisions and cause execution to jump to another action or action group. An icon indicates the type of action, and each action must have a name.
An action can also have attributes. Once assigned, action attribute icons appear beside the action name in the Attributes column indicating which actions have what attributes associated with them. Database operations in the application file operate on the data source each is assigned to. Adding an ActionTo add an action to an application file
In either method, a gray line indicates where the new action is to be placed. If the action has an editing window, it opens automatically.
Naming an ActionEach action in an application file must have a unique name. Tango Editor gives actions a unique name automatically. The default name for an action is its action type. When you add an action that already exists in the application file with its default name, Tango appends the default name with a numeric starting at "1", for example, "Search1"
To change the name of an action in an application file |
|||||||||||||
You can also right click the name, and from the menu that appears, click Rename. |
When you change the name of an action, Tango automatically updates any Branch actions in the same application file referring to the action. If you change the name of an action that is the destination for branches from other application files, the Branch actions in other application files are not updated. Tango does not automatically update action results references for renamed actions. Deleting an ActionTo delete an action from an application file |
||||||||||||
Editing an ActionAll of the actions--except Return, Group and Break actions--have associated attributes and parameters. You can set these parameters in the action's editing window. To edit an action in an application fileDouble click the action icon in the application file window. The action's editing window opens. If the action is associated with a data source, the Data Sources Workspace opens, listing the tables and columns for the data source. If Tango Editor has not loaded the data source yet, it is loaded first. Moving an ActionTango executes the actions in an application file sequentially, from top to bottom; however, you can use control actions to modify this sequence. If you want the actions to be performed in a different order, you can rearrange them. Move them to another location in the application file by dragging them to the position you want. To move an action to a new location
Actions are pasted after the currently selected action, or at the end of the file if no action is selected. Edit commands are available from the Tango Editor Edit menu and from the context-sensitive menu. When you move an action, Branch actions referring to it continue to branch to the action, even though its position has changed. Copying an ActionYou may want to create an action that performs a task similar to one performed by an existing action in another application file. Instead of having to recreate the action and specify all its parameters again, Tango Editor allows you to duplicate an action. To copy an action in the same application file
Edit commands are available from the Tango Editor Edit menu and from the context-sensitive menu. The copied action is given a new, unique name, which you should change to a more descriptive name. To copy an action into another application file
Edit commands are available from the Tango Editor Edit menu and from the context-sensitive menu. Be careful when copying database actions. For an action to work correctly in the new application file, the data source must be the same as in the original one. Alternatively, you may assign another data source to the action in the new application file. Context-Sensitive Action MenuWhen you right click an action icon in the application file window, or anywhere in the file window with an action selected, a context-sensitive menu of action commands appears. |
|||||||||||||
For more information on
using these commands, see:
|
Action PropertiesWhen you select an action and choose Properties from either the Edit menu or the context-sensitive menu, the Action Properties window for that action appears. This window displays current information about the selected action and the assigned data source. |
||||||||||||
Using this window, you can change some of the action's properties. ![]() Assigning Attributes to ActionsIn addition to the parameters specific to each action type, which are edited using the action's editing window, actions can also have the following attributes:
|
|||||||||||||
|
To assign any of these attributes to an action (or, for Debug Application File, to the application file), select or open the action editing window, then select an attribute from the Attributes menu or from the Attributes bar. Action attribute icons appear beside the action name in the Attributes column of the application file window to indicate which actions have any of these attributes associated with them. |
||||||||||||
You can switch between the Results HTML, No Results HTML and Error HTML associated with an action by clicking on the tabs at the bottom of the HTML editing window. Results HTML |
|||||||||||||
![]() |
Many actions in an application file can have HTML associated with them. This HTML is stored in the Results HTML attribute. If Results HTML contains any text, the Results HTML icon appears in the attributes column of the application file window; otherwise, it does not. As Tango Server executes the actions in a file, the Results HTML associated with each is accumulated. When execution of the file is complete, the HTML is returned. Results HTML can also contain Tango meta tags that Tango Server processes. While all the other text in Results HTML is interpreted by the user's browser and returned as is (via the Web server), Tango Server first substitutes meta tags with other values. |
||||||||||||
The <@COLUMN> meta tag causes a database value to be placed in the HTML. There are many others, including tags for referencing form field and search argument values, and conditional tags for displaying HTML only if the result of a given comparison is true. To edit the Results HTML for an action |
|||||||||||||
You can also right click the action and choose Results HTML from the context-sensitive menu that appears. |
|
||||||||||||
You can add column values (for Search actions only) and any HTML snippets you have defined to the Results HTML editing window from the Snippets Workspace. As well, you can add from the list of standard Tango snippets that allow for easy entry of many of the meta tags. To include any of these items in your Results HTML, select the snippet and either drag it, or copy and paste it into the desired location in your text. For HTML snippets that have placeholders for the current selection, select the text and drag the snippet over the selected text. The snippet is wrapped around the selection. For example, "Title" becomes "<H1>Title</H1>". |
|||||||||||||
For information on using the Insert Meta Tag dialog box, see "To insert common meta tags into your application file" . |
The Insert Meta Tag dialog box appears. No Results HTML |
||||||||||||
![]() |
You can associate No Results HTML text with Search, Direct DBMS, Script, and External actions. If the action execution does not return any data, this text is added to the application file's accumulated HTML instead of the Results HTML. This is useful when you want to display a special message to users when their queries do not return data.
After Tango Server processes the No Results HTML, execution of the application file continues normally to the next action. No Results HTML can contain any of the Tango meta tags used in Results HTML, except for those related to displaying result data items, such as <@ROWS>, <@COLUMN>, and <@COL>. Error HTML |
||||||||||||
![]() |
Error HTML allows you to specify your own error messages in HTML format, instead of having Tango Server produce them. The other alternative is to modify the Error.htx file; see "To specify your own custom default error message" . You can associate Error HTML with most actions. If an action fails for any reason, execution ends and the Error HTML for the action is returned immediately to the user. Error HTML can contain all the Tango meta tags used in Results HTML, except for those related to displaying result data items. |
||||||||||||
For more information, see "<@ERROR>" and "<@ERRORS></@ERRORS>" in the Meta Tags and Configuration Variables manual. |
There are also special Tango meta tags for displaying error information. If no Error HTML has been assigned to an action and an error occurs in that action, Tango returns a default error message using the following HTML: An error occurred while processing your
request:<p>
To specify your own custom default error message
|
||||||||||||
For more information, see "Configuring Tango Server" . |
The name and location of this file is determined by the defaultErrorFile configuration variable, which can be modified using the config.taf application file. The values when Tango is first started are given above. If you modify the path or name of the error file, place the file in the directory you specified instead. PushThe Push attribute causes the Results HTML accumulated so far to be sent back to the Web browser, when the action to which the Push attribute is assigned finishes executing. Execution then continues. Normally, Tango waits until all execution is finished before returning the results at one time. If you want the user to see some of the results while Tango continues with the rest of the execution, set the Push attribute of the action.
Debug Application FileFor more information, see "Debugging Application Files" ![]() Adding HTML (Results Action)The Results action adds HTML to an application file's results. |
||||||||||||
![]() |
When you drag the Results action icon from the Actions bar into an
application file, a blank HTML editing window appears.
Results HTML can contain special meta tags that Tango Server processes. While all the other text in Results HTML is returned as is to your Web browser (via the Web server), any meta tags are first substituted with other values by Tango Server. You can also associate Error HTML with the Results action. |
Tango does not restrict its content to only HTML format. Using other markup languages such as SGML, VRML, and XML instead of HTML is also possible.
2
Tango does not restrict its content to only HTML format. Using other markup languages such as SGML, VRML, and XML instead of HTML is also possible. If you use other content types, you are responsible for setting the HTTP header appropriately.
docs@pervasive.comCopyright © 1998, Pervasive Software Inc. All rights reserved.