summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
20e7f08)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@458
be28352e-c001-0410-b1a7-
c7978e42abec
*/
protected SimpleClient(UserHandle user, ClientHandle client, VamsasSession sess, File importingArchive) throws Exception {
this(user, client, sess);
*/
protected SimpleClient(UserHandle user, ClientHandle client, VamsasSession sess, File importingArchive) throws Exception {
this(user, client, sess);
+ if (log.isDebugEnabled())
+ {
+ log.debug("Attempting to create a new session from file: "+importingArchive);
+ }
+ initSessionDocFromFile(importingArchive);
+ // TODO: write provenance entry for new session indicating the import.
+ }
+
+ private void initSessionDocFromFile(File importingArchive) throws Exception {
VamsasArchive sessdoc = _session.getVamsasDocument();
try {
VamsasArchiveReader odoc = new VamsasArchiveReader(importingArchive);
VamsasArchive sessdoc = _session.getVamsasDocument();
try {
VamsasArchiveReader odoc = new VamsasArchiveReader(importingArchive);
sessdoc.putVamsasDocument(doc, sdoc.vorba);
sessdoc.closeArchive();
log.debug("Imported new vamsas data from "+importingArchive);
sessdoc.putVamsasDocument(doc, sdoc.vorba);
sessdoc.closeArchive();
log.debug("Imported new vamsas data from "+importingArchive);
} catch (Exception e) {
sessdoc.cancelArchive();
} catch (Exception e) {
sessdoc.cancelArchive();
- // write a dummy iohandler
+ // TODO: check that new session is really writeable if the imported document was invalid ? or is removed
_session.slog.info("Exception when importing document data from "+importingArchive);
log.warn("While importing session data from existing archive in "+importingArchive, e);
throw new Exception("Failed to import data from "+importingArchive, e);
}
}
_session.slog.info("Exception when importing document data from "+importingArchive);
log.warn("While importing session data from existing archive in "+importingArchive, e);
throw new Exception("Failed to import data from "+importingArchive, e);
}
}
/*
* (non-Javadoc)
* LATER: check that build substitution variables are correct
/*
* (non-Javadoc)
* LATER: check that build substitution variables are correct