Resource Management

Database Explorer View

This view presents in a tree-like fashion the database connections configured in Preferences -> Data Sources. You can connect to a database simply by expanding the connection node. The database structure can be expanded up to column level. <oXygen/> supports multiple simultaneous database connections and the connections tree provides an easy way to browse them.

Some of the basic components employed by the XML:DB API are collections and resources, and they appear in the tree sorted in alphabetical order.

A collection is a hierarchical container for resources and further sub-collections.

There are two types of resources: XML resource and non XML resource . An XML resource represents an xml document or a document fragment, selected by a previously executed XPath query.

Figure 12.17. The Database Explorer View

The Database Explorer View

Below you can find a description of the contextual menu actions available on the Database Explorer levels (explained for each connection). Please note that you can open in the editor a resource or a schema component by double-clicking it.

Berkeley DB XML Connection
Actions available at connection level
  • Refresh - performs a refresh of the selected node's subtree.

  • Configure Database Sources - opens the Data Sources preferences page where you can configure both data sources and connections.

  • Add container - allows adding a new container.

    Figure 12.18. Add Container Dialog

    Add Container Dialog


    Name

    The name of the new container.

    Container type

    At creation time, every container must have a type defined for it. This container type identifies how XML documents are stored in the container. As such, the container type can only be determined at container creation time; you cannot change it on subsequent container opens.

    Containers can have one of the following types specified for them:

    Node container

    Xml documents are stored as individual nodes in the container. That is, each record in the underlying database contains a single leaf node, its attributes and attribute values if any, and its text nodes, if any. BDB XML also keeps the information it needs to reassemble the document from the individual nodes stored in the underlying databases. This is the default, and preferred, container type.

    Whole document container

    The container contains entire documents; the documents are stored without any manipulation of line breaks or whitespace.

    Allow validation

    If checked it causes documents to be validated when they are loaded into the container. The default behavior is to not validate documents.

    Index nodes

    If checked it causes indices for the container to return nodes rather than documents. The default is to index at the document level. This property has no meaning if the container type is whole document container.

Actions available at container level
  • Refresh - performs a refresh of the selected node's subtree.

  • Add Resource - adds a new XML resource to the selected container.

  • Rename - allows you to specify a new name for the selected container.

  • Delete - removes the selected container from the database tree.

  • Edit indices - allows you to edit the indices for the selected container.

    Figure 12.19. Container indices

    Container indices


    • Specifying the granularity:

      • Document granularity is good for retrieving large documents

      • Node granularity is good for retrieving nodes from within documents

    • Adding/editing indices:

      Figure 12.20. Adding/editing indices

      Adding/editing indices


      • Node - the node name

      • Namespace - the index namespace

      • Index strategy:

        • Index type:

          • Uniqueness - indicates whether the indexed value must be unique within the container

          • Path type:

            • node - indicates that you want to index a single node in the path

            • edge - indicates that you want to index the portion of the path where two nodes meet

          • Node type:

            • element - an element node in the document content

            • attribute - an attribute node in the document content

            • metadata - a node found only in a document's metadata content.

          • Key type:

            • equality - improves the performances of tests that look for nodes with a specific value

            • presence - improves the performances of tests that look for the existence of a node regardless of its value

            • substring - improves the performance of tests that look for a node whose value contains a given substring

        • Syntax types - the syntax describes what sort of data the index will contain and is mostly used to determine how indexed values are compared

Actions available at resource level
  • Refresh - performs a refresh of the selected resource.

  • Open - opens the selected resource in the editor.

  • Rename - allows you to change the name of the selected resource.

  • Move - allows you to move the selected resource in a different container in the database tree.

  • Delete - removes the selected resource from the container.

  • Copy location - allows you to copy to clipboard an application specific URL for the resource which can then be used for various actions like opening or transforming the resources.

eXist Connection
Actions available at connection level
  • Refresh - performs a refresh of the selected node's subtree.

  • Configure Database Sources - opens the Data Sources preferences page where you can configure both data sources and connections.

Actions available at container level
  • Refresh - performs a refresh of the selected node's subtree.

  • Add Resource - adds a new XML resource to the selected container.

  • Add Container - creates a new collection in the selected one.

  • Delete - removes the selected collection.

  • Rename - allows you to change the name of the selected collection.

  • Move - allows you to move the selected collection in a different location in the database tree.

Actions available at resource level
  • Refresh - performs a refresh of the selected resource.

  • Open - opens the selected resource in the editor.

  • Rename - allows you to change the name of the selected resource.

  • Move - allows you to move the selected resource in a different collection in the database tree.

  • Delete - removes the selected resource from the collection.

  • Copy location - allows you to copy to clipboard an application specific URL for the resource which can then be used for various actions like opening or transforming the resources.

  • Properties - allows the user to view various useful properties associated with the resource.

  • Save As - allows you to save the name of the selected binary resource as a file on disk.