Extended DB Viewer

Using the Extended DB Viewer bundle, you can view the content of custom DBs, created with the DB Bundle. The DB Viewer bundle provides a set of console commands for viewing and modifying if needed database content.

Contents:


Bundle Information

Bundle JAR

The JAR file of the Extended DB Viewer bundle is dbviewer.jar, and is located in the bundles folder.

Import

The Extended DB Viewer bundle imports the following packages:

Package Exporter Description
com.prosyst.util.pcommands ProSyst Util Bundle/
ProSyst Util Full Bundle
Contains the API for plugging text commands.
com.prosyst.mbs.services.db DB Bundle Delivers means for persistent storage of data in databases.
org.osgi.util.tracker OSGi Library Bundle Provides a utility, defined by the OSGi Service Tracker Specification, which simplifies using services from the framework's service registry.

Pluggable Commands

The Extended DB Viewer bundle registers pluggable commands under a com.prosyst.util.pcommands.PluggableCommands service for viewing the content of the database handled by the DB Bundle. For more information, about the mechanism of processing console commands, refer to the "Parser Service" document.

These commands are registered under a command group. The command group of the Extended DB Viewer bundle is db. The paragraph below provides a detailed description of the commands.

Console Commands

Command Description
value <node_path> Displays the value of the specified node. The default path separator is space.
store <node_value> <node_path> Sets the specified String value to the specified node. Use space as path separator.
list <node_path> Lists immediate children of the specified node. Use space as path separator.
listvalues <node_path> For the specified node, displays the immediate children and their values. Use space as path separator.
tree <node_path> Displays the subtree for the specified node.
treevalues <node_path> For the specified node, displays its subtree and the value of each node.
showType <node_path> Displays the value type of the specified node. Use space as path separator.
separator Changes the path separator (the default path separator is space.)
custom {<db_alias>| -f <db_root_path>}
Switches to the custom DB with the specified alias (when called without option) or root directory (when called with the -f option). If the command has no argument specified, it will print the name of the DB currently in use.

Note:Take in mind the that the mbs.dbmanager.singleDB system property (see the "DB Bundle" document) is true by default. To have support for separate storage of custom databases, set it to false.

Tip: To get the parameters and descriptions of db commands, type help. The help command is standard and is added for all pluggable commands groups. To get the options supported by these commands, use help -db. To view detailed help for a single command, for example the custom command, type custom?.

The sequence of commands, listed below, represents, an example of using the DB group commands. To access a command, you have to enter in the db group, or you can type the command preceded by the group name and a dot. Here is used the phonebook database (see "DB Example" from the DB Bundle description), which is a custom database with alias and root directory.

fw>$cd db
db>$custom -f mydb_root

Using custom DB mydb_root
db>$tree

        Phonebook
                A
                        Mr. R. Armstrong
                B
                        Mr. A. Been
                C
                        Mr. P. Cage
                        Mrs. L. Coldwell
                J
                        Mrs. A. Johnes
                        Mr. B. Johnes
                        Mrs. T. Johnson
                L
                        Mrs. D. Lopez
                        Mr. M. Lopez
                S
                        Mr. B. Simpson
db>$value Phonebook J "Mrs. T. Johnson"

Name:   Phonebook J Mrs. T. Johnson      Value: 8765 4321

References


Utility Bundles