This section contains example scripts which provide enough information to carry out exchange of data between an external database and an InfoAsset Manager database using InfoAsset Manager Exchange.
Additional information about each section of the example script (shown below), can be found in the following sections.
To exchange data between InfoAsset Manager and an external database, an InfoAsset Manager database has to be open. This corresponds to selecting the database in the main application.
Use WSApplication.open to open an InfoAsset Manager database for import/export.
Either specify the filename for a standalone database or use the form "servername:port/dbname" (as appears in the recently used databases list) for a workgroup database:
db = WSApplication.open(<database>,<boolean>)
Where:
e.g.
db = WSApplication.open('C:\Mydatabase.icmm', false)
Once the database has been opened, the network within the database with which data is to be exchanged must be identified. This corresponds to clicking on the network object in the tree view in the main application.
Use the model_object_from_type_and_id to find the InfoAsset Manager network for import/export:
nw=db.model_object_from_type_and_id(<name>,<id>)
Where:
e.g.
nw=db.model_object_from_type_and_id('Collection Network',23)
Section describing the import and export options to be used. See the following topics for more information:
Used when importing to an InfoAsset Manager network.
Update the local copy of the network to the latest version and reserve the network so that no-one else can edit it.
e.g.
nw.reserve
Used when importing to an InfoAsset Manager network.
Commit changes to network and unreserve network when commit is finished.
nw.commit(<comment>)
Where:
e.g.
nw.commit('Imported data via csv import')
To commit changes and keep the network reserved, use commit_reserve
e.g.
nw.commit_reserve('Imported data via csv import')
Used when importing to an InfoAsset Manager network.
Remove reserve from the network if an error is encountered. Changes will not be committed.
e.g.
nw.unreserve if nw
This section contains a few functions that users may find useful when using InfoAsset Manager Exchange: