use of org.vcell.util.document.BioModelInfo 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.BioModelInfo 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.BioModelInfo 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 BioModelInfo removeUserFromGroup(BioModelInfo bioModelInfo, String userToRemove) throws DataAccessException {
try {
//
// publish from database
//
BioModelInfo newBioModelInfo = (BioModelInfo) removeUserFromGroup0(bioModelInfo, VersionableType.BioModelMetaData, bioModelInfoHash, userToRemove);
//
// delete BioModelMetaData from cache
//
xmlHash.remove(bioModelInfo.getVersion().getVersionKey());
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, bioModelInfo, newBioModelInfo));
return newBioModelInfo;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
use of org.vcell.util.document.BioModelInfo in project vcell by virtualcell.
the class ClientDocumentManager method addUserToGroup.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
public BioModelInfo addUserToGroup(BioModelInfo bioModelInfo, String userToAdd) throws DataAccessException {
try {
//
// publish from database
//
BioModelInfo newBioModelInfo = (BioModelInfo) addUserToGroup0(bioModelInfo, VersionableType.BioModelMetaData, bioModelInfoHash, userToAdd);
//
// delete BioModelMetaData from cache
//
xmlHash.remove(bioModelInfo.getVersion().getVersionKey());
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, bioModelInfo, newBioModelInfo));
return newBioModelInfo;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
use of org.vcell.util.document.BioModelInfo in project vcell by virtualcell.
the class ClientDocumentManager method curate.
/**
* Insert the method's description here.
* Creation date: (5/23/2006 9:23:34 AM)
*/
public void curate(CurateSpec curateSpec) throws DataAccessException {
try {
VCDocumentInfo newVCDocumentInfo = getSessionManager().getUserMetaDbServer().curate(curateSpec);
xmlHash.remove(curateSpec.getVCDocumentInfo().getVersion().getVersionKey());
if (curateSpec.getVCDocumentInfo() instanceof MathModelInfo) {
mathModelInfoHash.remove(curateSpec.getVCDocumentInfo().getVersion().getVersionKey());
mathModelInfoHash.put(newVCDocumentInfo.getVersion().getVersionKey(), (MathModelInfo) newVCDocumentInfo);
} else if (curateSpec.getVCDocumentInfo() instanceof BioModelInfo) {
bioModelInfoHash.remove(curateSpec.getVCDocumentInfo().getVersion().getVersionKey());
bioModelInfoHash.put(newVCDocumentInfo.getVersion().getVersionKey(), (BioModelInfo) newVCDocumentInfo);
}
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, curateSpec.getVCDocumentInfo(), newVCDocumentInfo));
} catch (Exception e) {
e.printStackTrace();
throw new DataAccessException(e.getClass().getName() + " " + e.getMessage());
}
}
Aggregations