use of cbit.vcell.xml.XmlParseException in project vcell by virtualcell.
the class ClientDocumentManager method getBioModelFromDatabaseXML.
private BioModel getBioModelFromDatabaseXML(XMLHolder<BioModel> bioModelXMLHolder) throws DataAccessException {
try {
BioModel bm = bioModelXMLHolder.getDocument();
if (bm == null) {
bm = XmlHelper.XMLToBioModel(new XMLSource(bioModelXMLHolder.getXmlString()));
}
cacheSimulations(bm.getSimulations());
// bm.refreshDependencies();
return bm;
} catch (XmlParseException e) {
e.printStackTrace();
throw new DataAccessException(e.getMessage());
}
}
use of cbit.vcell.xml.XmlParseException in project vcell by virtualcell.
the class ClientDocumentManager method saveAsNew.
/**
* Insert the method's description here.
* Creation date: (1/19/01 11:27:52 AM)
*/
public MathModel saveAsNew(MathModel mathModel, java.lang.String newName, String[] independentSims) throws DataAccessException {
try {
String mathModelXML = null;
try {
mathModelXML = XmlHelper.mathModelToXML(mathModel);
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
// System.out.println(mathModelXML);
String savedMathModelXML = sessionManager.getUserMetaDbServer().saveMathModelAs(new BigString(mathModelXML), newName, independentSims).toString();
MathModel savedMathModel = getMathModelFromDatabaseXML(new XMLHolder<MathModel>(savedMathModelXML));
KeyValue savedKey = savedMathModel.getVersion().getVersionKey();
if (xmlHash.get(savedKey) == null) {
xmlHash.put(savedKey, savedMathModelXML);
}
MathModelInfo savedMathModelInfo = new MathModelInfo(savedMathModel.getVersion(), savedMathModel.getMathDescription().getKey(), savedMathModel.createMathModelChildSummary(), VCellSoftwareVersion.fromSystemProperty());
mathModelInfoHash.put(savedKey, savedMathModelInfo);
updateGeometryRelatedHashes(savedMathModel.getMathDescription().getGeometry());
fireDatabaseInsert(new DatabaseEvent(this, DatabaseEvent.INSERT, null, savedMathModelInfo));
return savedMathModel;
} catch (RemoteProxyException e) {
e.printStackTrace(System.out);
throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
}
}
use of cbit.vcell.xml.XmlParseException in project vcell by virtualcell.
the class ClientDocumentManager method save.
/**
* Insert the method's description here.
* Creation date: (10/28/00 12:08:30 AM)
*/
public MathModel save(MathModel mathModel, String[] independentSims) throws DataAccessException {
try {
String mathModelXML = null;
try {
mathModelXML = XmlHelper.mathModelToXML(mathModel);
if (LG.isInfoEnabled()) {
LG.info(XmlUtil.beautify(mathModelXML));
}
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
String savedMathModelXML = sessionManager.getUserMetaDbServer().saveMathModel(new BigString(mathModelXML), independentSims).toString();
MathModel savedMathModel = getMathModelFromDatabaseXML(new XMLHolder<MathModel>(savedMathModelXML));
if (LG.isInfoEnabled()) {
LG.info(XmlUtil.beautify(savedMathModelXML));
}
KeyValue savedKey = savedMathModel.getVersion().getVersionKey();
if (xmlHash.get(savedKey) == null) {
xmlHash.put(savedKey, savedMathModelXML);
}
MathModelInfo savedMathModelInfo = new MathModelInfo(savedMathModel.getVersion(), savedMathModel.getMathDescription().getKey(), savedMathModel.createMathModelChildSummary(), VCellSoftwareVersion.fromSystemProperty());
mathModelInfoHash.put(savedKey, savedMathModelInfo);
updateGeometryRelatedHashes(savedMathModel.getMathDescription().getGeometry());
fireDatabaseInsert(new DatabaseEvent(this, DatabaseEvent.INSERT, null, savedMathModelInfo));
return savedMathModel;
} catch (RemoteProxyException e) {
e.printStackTrace(System.out);
throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
}
}
use of cbit.vcell.xml.XmlParseException in project vcell by virtualcell.
the class ClientDocumentManager method saveAsNew.
/**
* Insert the method's description here.
* Creation date: (2/5/01 4:58:40 PM)
*/
public VCImage saveAsNew(VCImage vcImage, java.lang.String newName) throws DataAccessException {
try {
String vcImageXML = null;
try {
vcImageXML = XmlHelper.imageToXML(vcImage);
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
String savedVCImageXML = sessionManager.getUserMetaDbServer().saveVCImageAs(new BigString(vcImageXML), newName).toString();
VCImage savedVCImage = null;
try {
savedVCImage = XmlHelper.XMLToImage(savedVCImageXML);
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
savedVCImage.refreshDependencies();
KeyValue savedKey = savedVCImage.getVersion().getVersionKey();
if (xmlHash.get(savedKey) == null) {
xmlHash.put(savedKey, savedVCImageXML);
}
try {
ISize size = new ISize(savedVCImage.getNumX(), savedVCImage.getNumY(), savedVCImage.getNumZ());
GIFImage browseData = BrowseImage.makeBrowseGIFImage(savedVCImage);
VCImageInfo savedVCImageInfo = new VCImageInfo(savedVCImage.getVersion(), size, savedVCImage.getExtent(), browseData, VCellSoftwareVersion.fromSystemProperty());
imgInfoHash.put(savedKey, savedVCImageInfo);
fireDatabaseInsert(new DatabaseEvent(this, DatabaseEvent.INSERT, null, savedVCImageInfo));
} catch (Exception e) {
e.printStackTrace(System.out);
}
return savedVCImage;
} catch (RemoteProxyException e) {
e.printStackTrace(System.out);
throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
}
}
use of cbit.vcell.xml.XmlParseException in project vcell by virtualcell.
the class ClientDocumentManager method save.
/**
* Insert the method's description here.
* Creation date: (10/28/00 12:08:30 AM)
*/
public Geometry save(Geometry geometry) throws DataAccessException {
try {
String geometryXML = null;
try {
geometryXML = XmlHelper.geometryToXML(geometry);
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
String savedGeometryXML = sessionManager.getUserMetaDbServer().saveGeometry(new BigString(geometryXML)).toString();
Geometry savedGeometry = getGeometryFromDatabaseXML(savedGeometryXML);
KeyValue savedKey = savedGeometry.getVersion().getVersionKey();
if (xmlHash.get(savedKey) == null) {
xmlHash.put(savedKey, savedGeometryXML);
}
updateGeometryRelatedHashes(savedGeometry);
return savedGeometry;
} catch (RemoteProxyException e) {
e.printStackTrace(System.out);
throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
}
}
Aggregations