use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class VirtualFrapWindowManager method startExport.
public void startExport(Component requester, OutputContext outContext, ExportSpecs exportSpecs) {
try {
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();
DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(), exportServiceImpl);
exportServiceImpl.addExportListener(new ExportListener() {
public void exportMessage(ExportEvent event) {
System.out.println(event.toString());
}
});
exportServiceImpl.makeRemoteFile(null, LocalWorkspace.getDefaultOwner(), dataServerImpl, exportSpecs);
} catch (DataAccessException e) {
e.printStackTrace(System.out);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of org.vcell.util.DataAccessException 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 org.vcell.util.DataAccessException in project vcell by virtualcell.
the class ClientDocumentManager method replacePreferences.
/**
* This method was created in VisualAge.
* @return void
* @param key KeyValue
* @exception org.vcell.util.DataAccessException The exception description.
* @exception RemoteProxyException The exception description.
*/
public void replacePreferences(Preference[] argPreferences) throws DataAccessException {
if (argPreferences == null) {
throw new IllegalArgumentException("preferences were null");
}
System.out.println("ClientDocumentManager.replacePreferences()");
if (!Compare.isEqual(argPreferences, getPreferences())) {
try {
sessionManager.getUserMetaDbServer().replacePreferences(argPreferences);
preferences = argPreferences;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
}
use of org.vcell.util.DataAccessException 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 org.vcell.util.DataAccessException in project vcell by virtualcell.
the class ClientDocumentManager method saveFieldData.
public ExternalDataIdentifier saveFieldData(FieldDataFileOperationSpec fdos, String fieldDataBaseName) throws DataAccessException {
FieldDataDBOperationResults fieldDataResults = fieldDataDBOperation(FieldDataDBOperationSpec.createGetExtDataIDsSpec(getUser()));
ExternalDataIdentifier[] existingExternalIDs = fieldDataResults.extDataIDArr;
// find available field data name (starting from init).
for (ExternalDataIdentifier externalID : existingExternalIDs) {
if (externalID.getName().equals(fieldDataBaseName)) {
fieldDataBaseName = TokenMangler.getNextEnumeratedToken(fieldDataBaseName);
}
}
FieldDataDBOperationSpec newExtDataIDSpec = FieldDataDBOperationSpec.createSaveNewExtDataIDSpec(getUser(), fieldDataBaseName, "");
ExternalDataIdentifier eid = fieldDataDBOperation(newExtDataIDSpec).extDataID;
fdos.specEDI = eid;
fdos.annotation = "";
try {
// Add to Server Disk
FieldDataFileOperationResults fdor = fieldDataFileOperation(fdos);
LG.debug(fdor);
} catch (DataAccessException e) {
try {
// try to cleanup new ExtDataID
fieldDataDBOperation(FieldDataDBOperationSpec.createDeleteExtDataIDSpec(fdos.specEDI));
} catch (Exception e2) {
// ignore
}
fdos.specEDI = null;
throw e;
}
return eid;
}
Aggregations