Modification of the Structure

In Docusnap, you can extend the existing table structures as needed. For this purpose, open Docusnap Management and click the Manage Tables button.

Docusnap-Tools-Manage-Tables

This tab contains all descriptions of the Docusnap database structure. On the upper left pane the details of the below selected table are listed. The corresponding settings for the columns of the selected table can be made in the right pane.

Docusnap-Tools-Manage-Fields

In principle, there are three different types of tables in Docusnap:

TypeDescription
TableTables are the physical Docusnap database tables described in this manual. All table names begin with a lowercase “t” prefix.
ViewViews are tables that were generated by an SQL SELECT statement. Views may contain data from multiple tables. It is possible to add placeholders (e.g. FilterID) to the SQL statements. Docusnap will populate them with the current values at runtime. All view names begin with a lowercase “v” prefix.
VirtualVirtual tables are used to format the tables that are used, for example, in the Docusnap wizards. In addition, they are used in the tree view in order to display data from various database tables in a single table. All virtual table names begin with a lowercase “i” prefix.

General Table Properties

When defining a table, you need to set several properties. The number of properties depends on the table type. The following properties apply to all tables, i.e. they are mandatory:

PropertyDescription
Table NameUnique name of the table
Depending on the selected table type, one of the “i”, “v” or “t” prefixes is used. Names of user-defined tables are additionally prefixed with an “x” (e.g. xtSLA).
NamespaceWhen creating a new table, a namespace can be entered in the combo box or an existing namespace can be selected. The namespace can be used to define which tables are to be exported when exporting user-defined tables.
Primary KeyA field (i.e. column) in the table that uniquely identifies each record. Within Docusnap, these fields are usually auto-increment fields of the LONG data type.
Foreign KeyThe field that represents the relation to another table further up in the hierarchy.
Display FieldThe field in the table that is used to display the desired text output in the tree views (e.g. Inventory, IT Security, etc.).
Comparison FieldFor data comparison, a field is required that can be used to identify two records when comparing two snapshots. For this purpose, it might be a good idea to use, for example, a serial number or a computer name.
English Name, German NameName of the table in that language.

Properties for Views

Views are tables that are built on the basis of an SQL SELECT statement. Docusnap supports this with a number of variables that will be replaced with actual data during the execution of the SELECT statement.

Basically, the SELECT statement has the following syntax:

SELECT [DISTINCT] SelectionList FROM Source [WHERE WhereClause]
[GROUP BY (GroupByAttribute)+
[HAVING HavingClause]]
[ORDER BY (SortAttribute [ASC|DESC])+];

In principle, all valid variants are possible that comply with the SQL standard.

Docusnap provides the following variables for use in statements. Make sure to always enclose the variable in braces, like this: {Variable}.

VariableDescription
{FilterID}The FilterID variable is always replaced with the primary key of the parent object.

Example:
In Docusnap, the following statement:
select * from thosts where domainid = {FilterID} order by hostname

will for example result in the following when the statement is executed:
select * from thosts where domainid = 1 order by hostname
{LANGUAGEID}This variable is replaced with the integer value for the respective language:
German = 0
Englisch = 1
{Feldname}Using this construct, you can access each data field in a parent data object.
Note: This will only work for the Data object type, but not for the Caption object type.

Enter the respective SQL statement directly into the SQL statement field where you can enter or edit the statement.

Since an SQL SELECT statement may be used to link multiple tables, Docusnap does not know which table the primary key refers to when you delete this object in the tree view. In the Primary Table field, you can specify the table in which the record should be deleted. If you leave this field blank, it will not be possible to delete meta objects that depend on this table.

SNMP Statements

In addition to SQL statements for the output of tables, Docusnap provides special statements for the output of SNMP tables. When performing an SNMP inventory scan, Docusnap uses MIBs. To program the output, enter the following into the SQL Statement field: First, the text *SNMP:, *then, in parentheses, the MIB and, separated by a comma, its name. To separate the MIBs, enter a semi-colon.

This results in the following syntax:

SNMP:(1.3.6.1.2.1.4.20.1.1,IPAddress;1.3.6.1.2.1.4.20.1.3,SubnetMask;1.3.6.1.2.1.4.20.1.2,InterfaceID)

To ensure the output of values that exist only once for each SNMP device, precede the statement with SNMP-Single.

Use the following syntax:

SNMP-Single: (1.3.6.1.2.1.43.8.2.1.14.1.1,Manufacturer;1.3.6.1.2.1.43.5.1.1.17.1,SerialNumber)

If you need to divide the value of one column by that of another column, e.g. to determine the toner level, separate the MIBs of the two columns using a slash. When the statement is executed, the quotient will be output in this column.

The statement has the following syntax:

SNMP-Single: (1.3.6.1.2.1.43.11.1.1.9.1.1/1.3.6.1.2.1.43.11.1.1.8.1.1,TonerBlack)

Then, create the fields (columns) of this table. As the field name, use the name you entered in the statement for this MIB.

IT Asset Statements

It is possible to display IT assets anywhere in the tree, for example, below a contact, which they were assigned to. For that a view with an SQL statement needs to be created that lists all necessary ObjectIDs. The name is matched with the name of the property and the value with the primary key of the parent object. Since the column ObjectValue has the type text the {FilterID} must be specified as text with ‘’. Use the AccountID in the query to filtered the data, so that only IT assets for the respective company are displayed. Only the ObjectID must be included in SQL statement and the ObjectID must be created as a column. Subsequently, this view can be selected for a meta object to display the IT assets. The following SQL statement can be used as the basis for the IT Asset statement.

select tGOValue.ObjectID
from tGODirectory, tGO, tGOValue, tGOProperty
where tGODirectory.DirectoryID = tGO.DirectoryID and
tGO.ObjectID = tGOValue.ObjectID and
tGOValue.PropertyID = tGOProperty.PropertyID
and tGOProperty.PropertyName = 'Name of the Property' and
tGOValue.ObjectValue = '{FilterID}' and
tGODirectory.AccountID = {AccountID}

Data Fields

Data fields represent the various columns of a table. Each field is assigned a data type in Docusnap. The meta description of each field also includes its English or German name.

PropertyDescription
Field NameIn this field, you can specify a unique field name. Key fields should always have the “ID” ending, so that they can be identified more easily.
User-defined fields will automatically be assigned an “x” prefix to avoid naming collisions.
DatatypeThis field indicates the data type of the field.

Blob: Binary field that stores binary data, such as attachments

Boolean: Yes or No value

Byte: Numeric field that holds integer values between 0 and 255.

Date: Date field

Decimal: Decimal field for floating point numbers

GUID: GUID Value

Combination: Field that combines multiple fields. Field names are identified by ampersand “@” symbols, literal text is surrounded by single quotes (‘Text’). The values can be concatenated using the “+” operator.
Strings in angle brackets “<>” are only displayed if they are followed by more text.

Example: @Lastname + '<, >' + @Firstname

Output:
Smith, John
or, if no first name exists,
Smith

The Combination type should only be used for display fields.

Int: Integer

BigInt: The BigInt data type is determined for cases where an integer value exceeds the range supported by the Int data type.

Memo: Text box containing an unlimited string of characters

String: Text

SID: Convert a SID into the associated ADS name. The conversion is only possible if the table or view is included at a location where the node for the company is located somewhere in the parent structure.

Version: Versions are usually in a string field and would therefore be in alphabetical order. To display version 12 after Version 4, the data type Version is used.

Time: The data type Time is used to output a time when the value is inventoried in ticks.
ReferenceBy means of the Reference field, an ID can be converted into a meaningful (plain text) name. For this purpose, enter a reference to a table [TableName] or a reference to a reference value {ValueName}.
If you have specified a value in the Reference field, Docusnap uses the numeric content of the entry and performs a query on the specified table or in the reference values, filtering on the respective primary key. The output will be the value that was defined as the display field in the target table.

Example:
Field: DomainID, Reference: [tdomains]
Instead of the DomainID “1”, the output will be “test.local”.
Name, Description (German, English)Field name in the respective language. This value will be shown later in lists as a column heading.
Sort OrderThe field order in lists is not alphabetical, but rather determined by this value.
Display SizeHere, you can specify the column width (in pixels) for the display in lists. If you do not specify a value, Docusnap uses a default value of 80 pixels.
Field LengthThis value can only be defined for the String data type. It is used to enter the maximum number of characters that may be entered in the respective field.
Import LookupThis field defines reference fields that must be compared and matched for data import. Basically, these are references such as comment types, passwords types, etc.
FactorIn this field, you can set a divisor for converting numeric values. This field is only enabled for numeric data types.
For example, a factor of 1024 would convert a byte value into kilobytes.
Number FormatUsing this field, you can define the formatting of numeric values according to standard conventions.
Valid placeholders include the hash symbol “#” for any numeric value and “0” for numeric values that should be padded with leading zeroes if they are too small for the field.
The thousands separator is a comma, and the period is used as the decimal separator.

Examples:
#,##0.00 MB
00 h
IconUsing the Icon property, you can store a specific icon for each field. This is only necessary if the meta object that refers to the table has a vertical alignment.
NamespaceIf columns are added to tables of the vendor, then the namespace can be selected for the created column or a new one can be entered. When exporting a customizing, the namespaces can be used to define which columns are to be taken into account. The namespace of the column cannot be changed after saving.
Field Visible in ListIf you tick this checkbox, this field will be visible in lists.
Field Visible in WebclientIf this option is enabled, the field will be displayed in the lists in the web client. If a table has no columns selected for the web client, Docusnap sets this option for the first three columns according to the sort order. This selection can be edited afterwards.
Do Not CompareBy enabling this checkbox, you can prevent the field from being used in data comparisons. This is useful, e.g., for a field that reflects the available storage space on a hard disk, since this value is ever-changing.
No Display if NULLIf the meta object for which the table will be shown has a Vertical alignment, this flag determines whether the column will be displayed at all if the database value is NULL.

Display ADS Properties

The values of Active Directory properties are stored in the tables tADSObjectValue (only one value per AD object) and in the table tADSObjectMultiValue (multiple values per AD object possible). Some of these values need to be formatted differently for display. In both the tables there is the column ADSPropertyID, the value of this column is used by Docusnap to display the AD properties in ADSObjectValue column correctly. If a table or a view contains an ADSObject Value column, a ADSPropertyID column is always expected .

When a view is created, which contains more than one column with special AD properties, the formatting can not be defined using the ADSPropertyID column. For this, a reference is created for every respective column. With AD_PROP_ is defined that it is a reference for AD properties. For example, for the property whenCreated (create date of the AD object) {AD_PROP_whenCreated} is entered in the Reference field. The column that contains the value must not be called ADSObjectValue, but will be renamed in the SQL statement with AS.

Export and Import of the Database

If the data from user-defined tables should be taken into account during database import or export, these tables must be included in the import tree.