Search in sources :

Example 21 with Version

use of org.vcell.util.document.Version in project vcell by virtualcell.

the class ImageTable method getInfo.

/**
 * This method was created in VisualAge.
 * @return VCImage
 * @param rset ResultSet
 * @param log SessionLog
 */
public VersionInfo getInfo(ResultSet rset, Connection con, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
    GIFImage gifImage = null;
    try {
        // gifImage = new GIFImage(rset.getBytes(BrowseImageDataTable.table.data.toString()));
        byte[] gifData = (byte[]) DbDriver.getLOB(rset, BrowseImageDataTable.table.data, dbSyntax);
        gifImage = new GIFImage(gifData);
    // 
    } catch (GifParsingException e) {
        throw new DataAccessException("Error Parsing browseImage");
    }
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    int x = rset.getInt(ImageTable.table.numX.toString());
    int y = rset.getInt(ImageTable.table.numY.toString());
    int z = rset.getInt(ImageTable.table.numZ.toString());
    org.vcell.util.ISize size = new org.vcell.util.ISize(x, y, z);
    double extentX = rset.getBigDecimal(ExtentTable.table.extentX.toString()).doubleValue();
    double extentY = rset.getBigDecimal(ExtentTable.table.extentY.toString()).doubleValue();
    double extentZ = rset.getBigDecimal(ExtentTable.table.extentZ.toString()).doubleValue();
    org.vcell.util.Extent extent = new org.vcell.util.Extent(extentX, extentY, extentZ);
    String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
    return new VCImageInfo(version, size, extent, gifImage, VCellSoftwareVersion.fromString(softwareVersion));
}
Also used : GifParsingException(cbit.image.GifParsingException) GIFImage(cbit.image.GIFImage) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version) DataAccessException(org.vcell.util.DataAccessException) VCImageInfo(cbit.image.VCImageInfo)

Example 22 with Version

use of org.vcell.util.document.Version in project vcell by virtualcell.

the class MathDescriptionDbDriver method updateVersionable.

/**
 * This method was created in VisualAge.
 * @return cbit.image.VCImage
 * @param user cbit.vcell.server.User
 * @param image cbit.image.VCImage
 */
public KeyValue updateVersionable(InsertHashtable hash, Connection con, User user, MathDescription mathDescription, KeyValue updatedGeometryKey, boolean bVersion) throws DataAccessException, SQLException, RecordChangedException {
    Version newVersion = null;
    try {
        newVersion = updateVersionableInit(hash, con, user, mathDescription, bVersion);
        insertMathDescriptionSQL(hash, con, user, mathDescription, updatedGeometryKey, newVersion, bVersion);
    } catch (MathException e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("MathException: " + e.getMessage());
    }
    return newVersion.getVersionKey();
}
Also used : Version(org.vcell.util.document.Version) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException)

Example 23 with Version

use of org.vcell.util.document.Version in project vcell by virtualcell.

the class MathModelDbDriver method insertVersionable.

/**
 * This method was created in VisualAge.
 * @return cbit.sql.KeyValue
 * @param versionable cbit.sql.Versionable
 * @param pRef cbit.sql.KeyValue
 * @param bCommit boolean
 */
public KeyValue insertVersionable(InsertHashtable hash, Connection con, User user, MathModelMetaData mathModelMetaData, MathModelChildSummary mmcs, String name, boolean bVersion) throws DataAccessException, SQLException, RecordChangedException {
    Version newVersion = insertVersionableInit(hash, con, user, mathModelMetaData, name, mathModelMetaData.getDescription(), bVersion);
    insertMathModelMetaData(con, user, mathModelMetaData, mmcs, newVersion);
    return newVersion.getVersionKey();
}
Also used : Version(org.vcell.util.document.Version)

Example 24 with Version

use of org.vcell.util.document.Version in project vcell by virtualcell.

the class MathModelTable method getMathModelMetaData.

/**
 * This method was created in VisualAge.
 * @return cbit.vcell.math.MathDescription
 * @param user cbit.vcell.server.User
 * @param rset java.sql.ResultSet
 */
public MathModelMetaData getMathModelMetaData(ResultSet rset, Connection con, KeyValue[] simulationKeys, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
    // 
    // Get Version
    // 
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version mathModelVersion = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    KeyValue mathDescrRef = new KeyValue(rset.getBigDecimal(table.mathRef.toString()));
    // MathModelMetaData mathModelMetaData = new MathModelMetaData(version,mathRef,simulationKeys);
    MathModelMetaData mathModelMetaData = populateOutputFunctions(con, mathDescrRef, mathModelVersion, simulationKeys, dbSyntax);
    return mathModelMetaData;
}
Also used : KeyValue(org.vcell.util.document.KeyValue) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version) MathModelMetaData(cbit.vcell.mathmodel.MathModelMetaData)

Example 25 with Version

use of org.vcell.util.document.Version in project vcell by virtualcell.

the class MathModelTable method getInfo.

/**
 * This method was created in VisualAge.
 * @return cbit.vcell.geometry.GeometryInfo
 * @param rset java.sql.ResultSet
 * @param log cbit.vcell.server.SessionLog
 */
public VersionInfo getInfo(ResultSet rset, Connection con, DatabaseSyntax dbSyntax) throws SQLException, org.vcell.util.DataAccessException {
    KeyValue mathRef = new KeyValue(rset.getBigDecimal(table.mathRef.toString()));
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    String serialDbChildSummary = DbDriver.varchar2_CLOB_get(rset, MathModelTable.table.childSummarySmall, MathModelTable.table.childSummaryLarge, dbSyntax);
    String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
    return new MathModelInfo(version, mathRef, serialDbChildSummary, VCellSoftwareVersion.fromString(softwareVersion));
}
Also used : KeyValue(org.vcell.util.document.KeyValue) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version) MathModelInfo(org.vcell.util.document.MathModelInfo)

Aggregations

Version (org.vcell.util.document.Version)74 VCellSoftwareVersion (org.vcell.util.document.VCellSoftwareVersion)27 DataAccessException (org.vcell.util.DataAccessException)24 KeyValue (org.vcell.util.document.KeyValue)22 BigDecimal (java.math.BigDecimal)17 Geometry (cbit.vcell.geometry.Geometry)13 SimulationVersion (org.vcell.util.document.SimulationVersion)12 PropertyVetoException (java.beans.PropertyVetoException)10 User (org.vcell.util.document.User)10 VersionableTypeVersion (org.vcell.util.document.VersionableTypeVersion)10 Element (org.jdom.Element)9 MathDescription (cbit.vcell.math.MathDescription)8 RedistributionVersion (cbit.vcell.solvers.mb.MovingBoundarySolverOptions.RedistributionVersion)8 SimulationContext (cbit.vcell.mapping.SimulationContext)7 ResultSet (java.sql.ResultSet)7 Statement (java.sql.Statement)7 ImageException (cbit.image.ImageException)6 Simulation (cbit.vcell.solver.Simulation)6 VersionFlag (org.vcell.util.document.VersionFlag)6 Model (cbit.vcell.model.Model)5