Chapter 6. Import/Export data

There are several ways of importing RDF data to SCAM. One way is to use the Administer EJB which defines a method add(String id, Model model). This method simply dumps the data contained in model to the manifest identified by id. Please note that no validation of the data is performed, but it is the quickest way of inserting RDF.

The Manifest EJB has a method insert(String id, Model model) which also can be used to add RDF. This method validates the data to comply with IMS Content Packaging (where applicable), ensures that no duplicates exists and verifies other SCAM data requirements. This method is recommended to use when you import smaller data amounts or when the manifest already contains data.

Another way is to use the Adminster.restore(String id, Date date) method. This approach has the advantage of being able to import files as well as RDF. See Chapter 7, Backup/Restore data.

Exporting data is done in a similar fashion as discussed above. To extract all data contained in a manifest, simply use the Administer.get(String id) method, or use Administer.backup(String id) to write all data (including files) to a backup folder defined in scam.properties. This folder can be copied to a new location/server and then "imported" by calling Administer.restore(String id, Date date).