Search in sources :

Example 6 with BioModelInfo

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);
}
Also used : EditTestCriteriaOPMathModel(cbit.vcell.numericstest.EditTestCriteriaOPMathModel) TestCriteriaNewMathModel(cbit.vcell.numericstest.TestCriteriaNewMathModel) TestCriteriaNewBioModel(cbit.vcell.numericstest.TestCriteriaNewBioModel) EditTestCriteriaOP(cbit.vcell.numericstest.EditTestCriteriaOP) BioModelInfo(org.vcell.util.document.BioModelInfo) EditTestCriteriaOPBioModel(cbit.vcell.numericstest.EditTestCriteriaOPBioModel) MathModelInfo(org.vcell.util.document.MathModelInfo) RemoveTestResultsOP(cbit.vcell.numericstest.RemoveTestResultsOP) SimulationInfo(cbit.vcell.solver.SimulationInfo)

Example 7 with BioModelInfo

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));
    }
}
Also used : BioModelInfo(org.vcell.util.document.BioModelInfo) MathModelInfo(org.vcell.util.document.MathModelInfo) Vector(java.util.Vector)

Example 8 with BioModelInfo

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());
    }
}
Also used : BioModelInfo(org.vcell.util.document.BioModelInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 9 with BioModelInfo

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());
    }
}
Also used : BioModelInfo(org.vcell.util.document.BioModelInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 10 with BioModelInfo

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());
    }
}
Also used : VCDocumentInfo(org.vcell.util.document.VCDocumentInfo) BioModelInfo(org.vcell.util.document.BioModelInfo) MathModelInfo(org.vcell.util.document.MathModelInfo) PermissionException(org.vcell.util.PermissionException) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

BioModelInfo (org.vcell.util.document.BioModelInfo)79 DataAccessException (org.vcell.util.DataAccessException)38 MathModelInfo (org.vcell.util.document.MathModelInfo)37 BioModel (cbit.vcell.biomodel.BioModel)25 GeometryInfo (cbit.vcell.geometry.GeometryInfo)22 KeyValue (org.vcell.util.document.KeyValue)18 SimulationContext (cbit.vcell.mapping.SimulationContext)17 VCDocumentInfo (org.vcell.util.document.VCDocumentInfo)15 BigString (org.vcell.util.BigString)14 User (org.vcell.util.document.User)14 Vector (java.util.Vector)13 Simulation (cbit.vcell.solver.Simulation)12 XmlParseException (cbit.vcell.xml.XmlParseException)12 SQLException (java.sql.SQLException)12 XMLSource (cbit.vcell.xml.XMLSource)10 MathModel (cbit.vcell.mathmodel.MathModel)9 Hashtable (java.util.Hashtable)9 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)9 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)8 Geometry (cbit.vcell.geometry.Geometry)7