602SQL Documentation Index  

Interactive Document Access Definition (DAD) Designer

The interactive visual designer can create and edit schematic DAD objects stored in the database.

The DAD is represented as a tree in the editor. The first item contains the global items concerning the entire DAD. The second and the last item represent the element that will be at the top level of the XML file. Other items are nested under this element and describe the XML file structure (nested elements, attributes, text). These items may contain references to columns and tables from the database or to variables or constants.

Create a New DAD

The DAD is stored in an application under transports. A new DAD is created using the wizard for a new transport by selecting the XML files option. You must specify the data source for the DAD on the next page and also the DAD type. If you choose a table, an analytic DAD will be created, if you choose a SQL query, a synthetic DAD will be created. This setting may be changed at anytime by editing the DAD.

Editing a DAD

The editor can be open by selecting the desired DAD on the control panel and executing the Edit command.

You may open a dialog for each item on the DAD tree. Each element in the tree is represented with two items (begin and end tag). The dialog is opened by pressing Enter on the selected item, clicking the mouse button or from the context menu (right-click) using the Edit command.

New items are generally added inside the edited item on a lower level (the menu commands Insert Sub-element of Element <name>, Insert Attribute of Element <name> and Insert Text of Element <name>). If you want to insert an element on the same level as the edited element, use the menu command Insert Element Before this Element. Item ordering inside each element is respected: attributes first, then text and finally elements on a lower level.

Items can be moved in the tree using drag-and-drop or by the clipboard (you must first cut an item to the clipboard and then paste it to the new position). You may cut an item using the context menu or use the keyboard shortcut CTRL+X. You may paste an item using the context menu or use the keyboard shortcut CTRL+V. All elements nested in the element you are moving will be moved as well.

An item may be deleted using a command from the context menu or by using the Delete key. You will be prompted to delete all nested subelements when deleting an element. Nested attributes will be deleted as well.

You may save the design, exit the designer, or check the syntax of the design. The design can also be used for data import and export.

Inserting Multiple Table Columns

The Insert sub-elements for all columns menu command is active for elements bound to a table. Creating elements that contain text bound to some column contents or deleting multiple unnecessary columns is much faster than inserting the columns one at a time.

Moving Items Using Drag-and-Drop

To move an element to another position in the tree structure, drag the begin tag of the element and drop in on the item that you wish to place the element ahead of.

If you need to move a group of subelements nested in element E one level up, drag the end tag of element E and drop it on the first element of this group.

If you need to move a group of elements positioned after element E inside of element E, drag the end tag of element E and drop it after the last element of this group.

Checking the DAD

There are several methods to check the syntax during DAD development:

The DAD design can be opened in the text editor using the Edit Source command in the control panel. The DAD structure is checked in a simple way when occurs in the text editor. The position where an error was found is highlighted directly in the editor.

If client variable references are used in the DAD design (in SQL commands and conditions or in XML data), temporary variables stored directly in the DAD design will be used for the check.

Working with Client Variables in the DAD Designer

In order to design and check DAD using client variables, the DAD designer allows you to describe the name, type and value of these variables. These client variables must be defined before they are used.

Client variables described in the DAD are only used when working in the designer. If you save the DAD to an external interface you will need to describe these variables (see the description for PHP here and for CDK here). Parameters used in the design will be ignored.

The Design / Parameters command displays a window with variable descriptions. You must set a name, type and value for each variable. You must set the length for character and binary strings. You may not specify the NUMERIC type here. A grid row (i.e. one variable) can be deleted by deleting the name of the variable and closing the dialog.

Server Variables

If server variables (i.e. declared in the SQL procedure in which the DAD is called) are used, is not possible to analyze the DAD and therefore the DAD designer cannot be open. In this case edit the DAD design in a text editor or add the variable declaration to the Module_globals.