Search in sources :

Example 31 with DataAccessException

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();
    }
}
Also used : DataServerImpl(cbit.vcell.simdata.DataServerImpl) ExportEvent(cbit.rmi.event.ExportEvent) FileNotFoundException(java.io.FileNotFoundException) ExportListener(cbit.rmi.event.ExportListener) ExportServiceImpl(cbit.vcell.export.server.ExportServiceImpl) DataAccessException(org.vcell.util.DataAccessException)

Example 32 with DataAccessException

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());
    }
}
Also used : BioModel(cbit.vcell.biomodel.BioModel) XmlParseException(cbit.vcell.xml.XmlParseException) XMLSource(cbit.vcell.xml.XMLSource) DataAccessException(org.vcell.util.DataAccessException)

Example 33 with DataAccessException

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

Example 34 with DataAccessException

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());
    }
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) KeyValue(org.vcell.util.document.KeyValue) BigString(org.vcell.util.BigString) XmlParseException(cbit.vcell.xml.XmlParseException) MathModelInfo(org.vcell.util.document.MathModelInfo) BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 35 with DataAccessException

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;
}
Also used : FieldDataFileOperationResults(cbit.vcell.field.io.FieldDataFileOperationResults) ExternalDataIdentifier(org.vcell.util.document.ExternalDataIdentifier) FieldDataDBOperationResults(cbit.vcell.field.FieldDataDBOperationResults) FieldDataDBOperationSpec(cbit.vcell.field.FieldDataDBOperationSpec) DataAccessException(org.vcell.util.DataAccessException) 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)

Aggregations

DataAccessException (org.vcell.util.DataAccessException)345 KeyValue (org.vcell.util.document.KeyValue)82 XmlParseException (cbit.vcell.xml.XmlParseException)80 ExpressionException (cbit.vcell.parser.ExpressionException)78 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)71 SQLException (java.sql.SQLException)67 IOException (java.io.IOException)60 MathException (cbit.vcell.math.MathException)59 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)46 BigString (org.vcell.util.BigString)45 User (org.vcell.util.document.User)42 FileNotFoundException (java.io.FileNotFoundException)38 ResultSet (java.sql.ResultSet)38 PropertyVetoException (java.beans.PropertyVetoException)37 File (java.io.File)34 PermissionException (org.vcell.util.PermissionException)34 Statement (java.sql.Statement)33 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)32 BioModelInfo (org.vcell.util.document.BioModelInfo)29 Vector (java.util.Vector)26