use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class TestingFrameworkWindowManager method updateTestCriteria.
/**
* Insert the method's description here.
* Creation date: (4/9/2003 1:31:08 PM)
* @return cbit.vcell.numericstestingframework.TestSuiteInfo
*/
public void updateTestCriteria(TestCriteriaNew origTestCriteria, TestCriteriaNew newTestCriteria) throws DataAccessException {
EditTestCriteriaOP testCriteriaOP = null;
if (newTestCriteria instanceof TestCriteriaNewMathModel) {
MathModelInfo regrMMInfo = ((TestCriteriaNewMathModel) newTestCriteria).getRegressionMathModelInfo();
SimulationInfo regrsimInfo = ((TestCriteriaNewMathModel) newTestCriteria).getRegressionSimInfo();
testCriteriaOP = new EditTestCriteriaOPMathModel(origTestCriteria.getTCritKey(), (regrMMInfo != null ? regrMMInfo.getVersion().getVersionKey() : null), (regrsimInfo != null ? regrsimInfo.getVersion().getVersionKey() : null), newTestCriteria.getMaxAbsError(), newTestCriteria.getMaxRelError());
} else if (newTestCriteria instanceof TestCriteriaNewBioModel) {
BioModelInfo regrBMInfo = ((TestCriteriaNewBioModel) newTestCriteria).getRegressionBioModelInfo();
SimulationInfo regrsimInfo = ((TestCriteriaNewBioModel) newTestCriteria).getRegressionSimInfo();
testCriteriaOP = new EditTestCriteriaOPBioModel(origTestCriteria.getTCritKey(), (regrBMInfo != null ? regrBMInfo.getVersion().getVersionKey() : null), (regrsimInfo != null ? regrsimInfo.getVersion().getVersionKey() : null), newTestCriteria.getMaxAbsError(), newTestCriteria.getMaxRelError());
}
getRequestManager().getDocumentManager().doTestSuiteOP(testCriteriaOP);
RemoveTestResultsOP removeTestResults = new RemoveTestResultsOP(new BigDecimal[] { origTestCriteria.getTCritKey() });
getRequestManager().getDocumentManager().doTestSuiteOP(removeTestResults);
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class TopLevelWindowManager method selectOpenModelsFromDesktop.
public static OpenModelInfoHolder selectOpenModelsFromDesktop(Container requester, RequestManager requestManager, boolean bIncludeSimulations, String title, boolean bExcludeCompartmental) throws UserCancelException, DataAccessException {
try {
BeanUtils.setCursorThroughout(requester, Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
OpenModelInfoHolder[] simInfoHolders = requestManager.getOpenDesktopDocumentInfos(bIncludeSimulations);
if (simInfoHolders == null || simInfoHolders.length == 0) {
return null;
}
String[] colNames = null;
if (bIncludeSimulations) {
colNames = new String[] { "Simulation", "Scan Index", "Model", "Type", "Application", "Owner", "Date" };
} else {
colNames = new String[] { "Model", "Type", "Application", "Owner", "Date" };
}
Vector<String[]> rowsV = new Vector<String[]>();
Vector<OpenModelInfoHolder> simInfoHolderV = new Vector<OpenModelInfoHolder>();
for (int i = 0; i < simInfoHolders.length; i += 1) {
if (bExcludeCompartmental && simInfoHolders[i].isCompartmental) {
continue;
}
String[] rows = new String[colNames.length];
int colIndex = 0;
if (simInfoHolders[i] instanceof FDSimMathModelInfo) {
MathModelInfo mmInfo = null;
if (((FDSimMathModelInfo) simInfoHolders[i]).getMathModelVersion() != null) {
mmInfo = requestManager.getDocumentManager().getMathModelInfo(((FDSimMathModelInfo) simInfoHolders[i]).getMathModelVersion().getVersionKey());
}
if (bIncludeSimulations) {
rows[colIndex++] = simInfoHolders[i].getSimName();
rows[colIndex++] = simInfoHolders[i].jobIndex + "";
}
rows[colIndex++] = (mmInfo == null ? "New Document" : mmInfo.getVersion().getName());
rows[colIndex++] = "MathModel";
rows[colIndex++] = "";
rows[colIndex++] = (simInfoHolders[i].simInfo == null ? "never saved" : simInfoHolders[i].simInfo.getOwner().getName());
rows[colIndex++] = (mmInfo == null ? "never saved" : mmInfo.getVersion().getDate().toString());
} else if (simInfoHolders[i] instanceof FDSimBioModelInfo) {
BioModelInfo bmInfo = null;
if (((FDSimBioModelInfo) simInfoHolders[i]).getBioModelVersion() != null) {
bmInfo = requestManager.getDocumentManager().getBioModelInfo(((FDSimBioModelInfo) simInfoHolders[i]).getBioModelVersion().getVersionKey());
}
if (bIncludeSimulations) {
rows[colIndex++] = simInfoHolders[i].getSimName();
rows[colIndex++] = simInfoHolders[i].jobIndex + "";
}
rows[colIndex++] = (bmInfo == null ? "New Document" : bmInfo.getVersion().getName());
rows[colIndex++] = "BioModel";
rows[colIndex++] = ((FDSimBioModelInfo) simInfoHolders[i]).getSimulationContext().getName();
rows[colIndex++] = (simInfoHolders[i].simInfo == null ? "never saved" : simInfoHolders[i].simInfo.getOwner().getName());
rows[colIndex++] = (bmInfo == null ? "never saved" : bmInfo.getVersion().getDate().toString());
}
rowsV.add(rows);
simInfoHolderV.add(simInfoHolders[i]);
}
if (rowsV.size() == 0) {
return null;
}
String[][] rows = new String[rowsV.size()][];
rowsV.copyInto(rows);
BeanUtils.setCursorThroughout(requester, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
int[] selectionIndexArr = PopupGenerator.showComponentOKCancelTableList(requester, title, colNames, rows, ListSelectionModel.SINGLE_SELECTION);
if (selectionIndexArr != null && selectionIndexArr.length > 0) {
// simInfoHolders[selectionIndexArr[0]];
return simInfoHolderV.elementAt(selectionIndexArr[0]);
}
throw UserCancelException.CANCEL_GENERIC;
} finally {
BeanUtils.setCursorThroughout(requester, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
use of org.vcell.util.document.MathModelInfo 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.document.MathModelInfo 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 org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class ClientDocumentManager method removeUserFromGroup.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
public MathModelInfo removeUserFromGroup(MathModelInfo mathModelInfo, String userToRemove) throws DataAccessException {
try {
//
// publish from database
//
MathModelInfo newMathModelInfo = (MathModelInfo) removeUserFromGroup0(mathModelInfo, VersionableType.MathModelMetaData, mathModelInfoHash, userToRemove);
//
// delete MathModelMetaData from cache
//
xmlHash.remove(mathModelInfo.getVersion().getVersionKey());
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, mathModelInfo, newMathModelInfo));
return newMathModelInfo;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
Aggregations