Structure View

This view shows the structure selected in the Structures View as a simple tree.

Structure

The root of the tree is a dummy node that allows access to actions that are appropriate to the base structure. These are:

  • RefreshView - allows the view to be reset if for any reason it becomes confused . This options is also available from the view toolbar.
  • Exapand All Children - the default opening position for the view is to open all elements down to 4 levels. This option opens all the children so that they can all be seen within the view.
  • Hide Children - this collapses the tree to show just the Structure node.
  • Add Child Element - if the Structure does not have any content a new XML root element may be added to the structure.
  • Add Namespace Declaration - XML files require Namespaces. CAM needs to know about these. This option allows new ones to be declared. The option opens a dialog box that requires the new namespaces to be input using the format prefix=uri. This option is also available from the View toolbar.
  • Include File - if the Structure does not have any content the content may be included from a file. The CAM template will keep a reference to the included filename. The CAM editor will allow the included contents to be shown in the Structure view.
  • The Structure is shown with the following Icon:

Elements

  • Elements are shown with the following icon:

The context menu for elements is as follows:

  • Edit Text - if the element does not have any child elements (CAM does not support mixed mode XML) its text can be edited. This might be to either remove the % (percentage) symbols which will make the contents fixed content, i.e. the same as using the rule setValue(x ), or to change the example content.
  • Expand All Children - expands all the children so they may be seen in the tree. This is recursive i.e. it opens all elements below the selected element.
  • Hide Children - hides all the elements current children
  • View Rules - this causes any rules for this element to be listed in the ItemRules View. This is the same as selecting the element. Elements with rules are shown with the following icon.
  • Add New Rule - bring up the Add New Rule Wizard. Another name for a rule is constraint. This wizard is described in more details in Add New Rule .
  • Add New Context - brings up the Add New Context wizard to allow a new context to be added.
  • Add Child Element - enables a new child to be added as a child of the current element. If the element currently has text this will be removed. The new element name is entered through a simple dialog. The name of the element should contain any namespace prefix should one be required. The content of the new element will be set to '%%'.
  • Add Child Attrubute - enables a new attribute to be added to the currently selected element. The name is entered through a simple dialog. The name may be qualified with a namespace prefix. The content of the new attribute will be set to '%%'.
  • Delete Item - this will remove the current element and any children from the structure.
  • Include File - Allows a file to be selected using teh file dialog and then this file is included into the structure as a child of the current element. For details of included files see included elements .
  • Add Parameter - this creates a new parameter named after the current element, with a default value of the element current contents if any and an xpath that points to the current element. The parameter can be seen in the parameter view .
  • Edit Annotations - This enable structure based annotations to be added to the current element. This is a CAM extension and not supported as part of the default CAM specification. For details of the annotations editor see annotations . An element with an annotation is shown with the following icon.
  • Delete Annotations - if the current element has annotations this action will remove them.
  • Elements with both annotations and rules are shown with the following icon:

Attributes

  • Attributes are shown by the following icon:

The context menu for attributes is as follows:

  • The menu options have the same meaning as for elements. See Context Menu .

Included Elements

When a file is included the source CAM template will contain a simple link to the included file. But in order to manage rules against the included elements the CAM editor will include the items in the structure tree. Included elements are shown by using magenta icons. The root node of the included file will also be annotated with the string that will be included in the CAM source. The following is the context menu for teh root element of an included file:

Most of the menu items are the same as above. The extra ones are :

  • Edit Include Filename - this allows the filename that is to be included in the resulting CAM template to be edited. The main reason for doing this is that when a file is originally included the full path of the file will be used. By editing the filename correctly it is possible to use a relative path and thus make the CAM template and included files portable.
  • Remove Include - this removes the include from the template. Any rules created will remain.
  • Open in XML View - it is sometimes useful to be able to edit the included XML structure. To make sure that the user understands that the included file is just included into the template the editing is not allowed to take place within the Structure View. After editing using the XML view, shoudl teh user make changes and then save the required file, the Structure View will be updated to reflect the changes.

Normal included elements and attributes have a cut down context menu as follows:

The actions are the same as above. See Context Menu .