BASE Manager : Commands : Add Surface to Database : Using an Attribute Plugin
 

Using an Attribute Plugin

If you use an attribute plugin to import metadata while adding a surface to a database, you must do some preparation work first.

Set up the Environment Variable settings for the plug-in.

Update your catalogue prior to adding the surface.

Place the data (.csv) file in a location that can be found by the application.

For information on registering plug-ins, see the Register Attribute Plugins section in the CARIS BASE Editor Plugin Registration Guide. For information on how to create .csv files, see Creating a .csv file.

To set up the Environment Variables, do the following:

1. From the Start menu, select Settings > Control Panel.

The Control Panel window is displayed.

2. Select the System command.

3. The System Properties dialog box is displayed.

4. Select the Advanced tab.

The options and settings for the Advanced tab are displayed.

5. Click Environment Variables.

The Environment Variables dialog box is displayed. You must create a variable that will allow the plug-in to identify the .csv file to use. You must create a variable for each .csv file to use.

6. In User variables, click New.

The New System Variable dialog box is displayed.

The variable must include a name and the full path (file location and file name) value for the .csv file.

7. Type a unique Variable name.

8. Type a Variable value (<file_location>\<file_name>.csv).

9. Click OK.

The system variable for the .csv file to use is created.

10. [Optional] For each additional .csv file to use with the plug-in, repeat steps 6 to 9.

By default, the files for the catalogue, BathyServerPool.xml and BathyServerProfile.xml, are located in the following directory:

C:\Program Files\CARIS\BDB Server\<version>\system

If you are updating the catalogue for:

a new database, you must edit the BathyServerProfile file before you create the database.

an existing database, you must download the catalogue from the database, edit the BathyServerProfile file for the catalogue, and upload the catalogue back into the database.

To edit the BathyServerProfile file:

1. Open the file in a text editor.

2. Locate the following line:

<Object value="surfac">

All of the attribute acronyms specific to surfac objects are defined after this line. You must add plug-in information to the definition of each attribute that you wish to populate using the plug-in. This will cause the plug-in to look for a file of attribute values in a specific file format. For example, when using the Simple Attribute Plugin available for BASE Editor, the plug-in looks for a .csv file.

The following is an example of how the DRVAL1 attribute would be defined in the catalogue if using the Simple Attribute Plugin.

Locate the following line in the catalogue file:

<Attribute value="DRVAL1"/>

Change this to:

<Attribute value="DRVAL1">
<AssociatedControl value="CARISLibrary.Simple_AttributePlugin"/>
</Attribute>

The AssociatedControl value is assigned the identifier of the plug-in to be used. The example contains the ID for the Simple Attribute Plugin available for BASE Editor.

For enumerated and list type attributes, you also need to specify the permitted values. If the data for a surface does not match these entries and you have used the /st (strict validation) parameter, the surface will not be loaded.

The following is an example of the definition for the DUNITS attribute. Included in the example is the ID for the Simple Attribute Plugin and the permitted values:

Locate the following line in the catalogue file:

<Attribute value="DUNITS"/>

Change this to:

<Attribute subset="A" value="DUNITS">
<AssociatedControl value="CARISLibrary.Simple_AttributePlugin"/>
<PermittedValue value="1"/>
<PermittedValue value="2"/>
<PermittedValue value="3"/>
<PermittedValue value="4"/>
</Attribute>

The subset parameter defines the order in which attributes are displayed in the Attributes window when the surfac object is selected. When this value is assigned, the mandatory attributes will be displayed first and alphabetically according to the subset value. Non-mandatory attributes are next in the list, and also alphabetically according to their subset values, if present.

3. Add the additional lines as necessary and save your changes.

Once all of the necessary attributes have been updated, you must create or edit a .csv file to include values for the surface being added. See Importing with an Attribute Plugin for information on creating and editing .csv files.

4. Add the filename of the surface under the "filename" column in the .csv file and enter values for each of the attributes.

5. Place the .csv file in the same directory as the surface source file and name it to match the surface.

You are now ready to add the surface to the database with metadata information using the Simple Attribute Plugin available for BASE Editor.