Exporting/Importing

From OSPDocs

Jump to: navigation, search

Overview

In the sharing section simulations can be packaged into XML. The open source project XStream is used to turn objects into XML for transport.

In preparing the XML file for the object, the following steps are take for each object:

  1. The 'transit_id' field is set to the object's id.
  2. The objects id is set to null
  3. The object is converted into XML
  4. Images and other media files associated with a simulation are converted into base64 for transit.

By following the steps above, we maintain the relationships in the existing model. (The transit ids hold the relationships.) But we avoid problems when we unpackage since each object will receive a new id on the receiving system - and hence not overwrite any existing objects with may happen to have the same original id.

Main Classes

org.usip.osp.networking.ObjectPackager