Menu

Vendor_specific_extension_hook Log in to Edit

x3p (3)
Dr. Schorsch

The [X3p] data format is an ideal base for vendor specific data formats. An easy way to create a new format based on x3p is the vendor specific extension hook.

Benefits

Using x3p as the base format allows you to create a format that is natively compatible and readable by all applications supporting x3p, while still being able to keep your vendor specific secrets. That means there is no need for an additional export or import format for data exchange.

How to do it

There are several methods to create a data format based on x3p. All are based on two functions provided in the ANSI-C interface of the x3p-library. The first one does add a file to the x3p container:

void ogps_AppendVendorSpecific (const OGPS_ISO5436_2Handle handle,
                                const OGPS_Character *vendorURI,
                                const OGPS_Character *filePath)

The second one retrieves a file from the x3p container and writes it to a specified path:

OGPS_Boolean
ogps_GetVendorSpecific         (const OGPS_ISO5436_2Handle handle,
                                const OGPS_Character *vendorURI,
                                const OGPS_Character *fileName,
                                const OGPS_Character *targetPath)

Both methods rely on a vendorURI. This must be a world wide unique URI to identify your specific extension. It does not need to be valid but it must be universally unique! By using a domain name you own, this is guaranteed at least for the lifetime of your domain. A simple example could look like this:

http://www.example-inc.com/myformat/2014

By appending some sub-path to your URI you can define multiple x3p derived formats or distinguish different versions of it.

The quick Way

The quickest and easiest way - so not the most efficient one - to create a compatible format based on x3p would be to write your profile data to an x3p file and the put the same data to a file in your current private data format. You can then easily pack your private file using the vendor specific extension hook into the x3p container. As stated before this is not very efficient and creates some redundancy, but you need only minimal changes in your software to get an x3p compatible format with all its benefits.

The smart Way

The smarter way is, to put all feasible data into the standard x3p format. Additional data can be stored in appropriate file formats that have to be added file by file to the container. As an example the intensity or quality channel provided by many optical profilometers could be stored in a PNG, TIFF or -- with some loss -- even in a JPEG image. Other structured information like the parameters of your system or information related to the sample could be stored in an xml file that you design to your needs.

Privacy

How can you keep the privacy of your company or system specific data when storing it in x3p? A rather safe way is to encrypt all files using a key as it is common in today's cryptographic software like PGP. You have to create a private key that should be safely hidden in your software and that is used to encrypt and decrypt all files added to the x3p container. This is safer than most companies method of defining an undocumented binary data format.

Cryptographic methods can also be used to guarantee the integrity of a dataset by providing an electronic fingerprint of it. This is already implemented for x3p using md5 checksums.


Related

Wiki: Iso5436_2.xsd
Wiki: Main_Page
Wiki: X3p

Discussion

Anonymous
Anonymous

Add attachments
Cancel