Tutorial 4 – DB Export Status

Requirements:
Tutorial 3 – Simple DB Export


In the previous tutorial, we showed how to create a simple DB export.

In this tutorial, we’ll extend the previous DB export program to handle export events, including how to determine when the export is complete and how to create an ‘.oml’ file. AxAuga provides an event mechanism. Let’s check it out:

Before starting the DB export, we set a callback with AxAuga’s TriggerSelected event handler. This event handler is called with frequent updates about the progress of the export.
The second argument to the callback is a _IAugaEvents_TriggerSelectedEvent, which includes the triggerURL property. The triggerURL property contains the event information, which looks like:

This is the piece of information we need to determine the progress of the export. It starts with the ‘exportprogress’ header and lists out these properties and their values:
guid: The ID of the Export.
start: The start time of the Export in number of 100-nanosecond intervals since January 1, 1601 (UTC) or Windows FileTime.
end: The start time of the Export in number of 100-nanosecond intervals since January 1, 1601 (UTC) or Windows FileTime.
label: The Export label which is in the form?
type: The Export type which will be ‘db’ for DB Exports.
state: An integer representing the state of the export, possible values include:
0 – The Export has not been initialized.
1 – The Export is in progress.
2 – The Export has finished.
3 – The Export has finished with errors, check the log.
4 – The Export has failed, check the log.
5 – The Export has been canceled.
progress: The Export completion percentage.
filelist: When the Export has finished, this is the list of places the Export was written to.

Given the format and properties above, let’s parse out the values:

The above code shows how to parse out the ‘exportprogress’ message. In our case, we just print out at each ‘state’ transition and provide status information as the export runs. The main part to note is the handling of the finished state EXPORT_STATE_DONE:

To complete the DB export we need to create an ‘.oml’ file that will be read by the Ocularis Client. The ‘.oml’ file is in XML and has the form:

Here’s a break down of the ‘.oml’ tags in use above:
exportdef: Parent tag of the DB export. Includes an ‘encrypted’ attribute to indicate whether the DB export contained is encrypted.
database: Tag to indicate the file name of the DB export.

Screenshots of the final program:
Series-5-Tutorial-4-1
Series-5-Tutorial-4-2

That’s about it. Now you can run a DB export until completion.


Next:
Tutorial 5 – Export DB with Audio