Search in sources :

Example 66 with Version

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

the class ImageTable method getImage.

/**
 * This method was created in VisualAge.
 * @return VCImage
 * @param rset ResultSet
 * @param log SessionLog
 */
public VCImageCompressed getImage(ResultSet rset, Connection con, ImageDataTable imageDataTable, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
    byte[] data = imageDataTable.getData(rset, dbSyntax);
    int nx = rset.getInt(numX.toString());
    int ny = rset.getInt(numY.toString());
    int nz = rset.getInt(numZ.toString());
    double ex = rset.getBigDecimal(ExtentTable.table.extentX.toString()).doubleValue();
    double ey = rset.getBigDecimal(ExtentTable.table.extentY.toString()).doubleValue();
    double ez = rset.getBigDecimal(ExtentTable.table.extentZ.toString()).doubleValue();
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    try {
        org.vcell.util.Extent extent = new org.vcell.util.Extent(ex, ey, ez);
        VCImageCompressed vcImage = new VCImageCompressed(version, data, extent, nx, ny, nz);
        return vcImage;
    } catch (ImageException e) {
        lg.error(e.getMessage());
        throw new DataAccessException(e.getMessage());
    }
}
Also used : ImageException(cbit.image.ImageException) VCImageCompressed(cbit.image.VCImageCompressed) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version) DataAccessException(org.vcell.util.DataAccessException)

Example 67 with Version

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

the class MathDescTable 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) throws SQLException, org.vcell.util.DataAccessException {
    KeyValue geomRef = new KeyValue(rset.getBigDecimal(MathDescTable.table.geometryRef.toString()));
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
    return new cbit.vcell.math.MathInfo(geomRef, version, VCellSoftwareVersion.fromString(softwareVersion));
}
Also used : KeyValue(org.vcell.util.document.KeyValue) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version)

Example 68 with Version

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

the class MathDescTable method getMathDescription.

/**
 * This method was created in VisualAge.
 * @return cbit.vcell.math.MathDescription
 * @param user cbit.vcell.server.User
 * @param rset java.sql.ResultSet
 */
public MathDescription getMathDescription(ResultSet rset, Connection con, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
    // 
    // Get Version
    // 
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    // 
    // get MathDescription Data (language) (MUST BE READ FIRST)
    // 
    /*
	byte[] mathDescriptionData = null;
	try {
		mathDescriptionData = rset.getBytes(MathDescTable.table.language.toString());
	}catch (SQLException e){
	System.out.println("SQLException error_code = "+e.getErrorCode()+", localized Message = "+e.getLocalizedMessage());
		log.exception(e);
		try {
			rset.close();
		}catch (SQLException e2){
			log.exception(e2);
		}
		throw e;
	}
	if (rset.wasNull() || mathDescriptionData==null || mathDescriptionData.length==0){
		throw new DataAccessException("no data stored for MathDescription");
	}
	String mathDescriptionDataString = new String(mathDescriptionData);
	*/
    // 
    String mathDescriptionDataString = (String) DbDriver.getLOB(rset, MathDescTable.table.language, dbSyntax);
    if (mathDescriptionDataString == null || mathDescriptionDataString.length() == 0) {
        throw new DataAccessException("no data stored for MathDescription");
    }
    // 
    // System.out.println("mathDescriptionDataString '"+mathDescriptionDataString+"'");
    MathDescription mathDescription = new MathDescription(version);
    // 
    // setGeometry is done in calling parent
    // 
    // mathDescription.setGeometry(geom);
    CommentStringTokenizer tokens = new CommentStringTokenizer(mathDescriptionDataString);
    try {
        mathDescription.read_database(tokens);
    } catch (Exception e) {
        e.printStackTrace(System.out);
        throw new org.vcell.util.DataAccessException(e.getMessage(), e);
    }
    // 
    return mathDescription;
}
Also used : VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) Version(org.vcell.util.document.Version) MathDescription(cbit.vcell.math.MathDescription) CommentStringTokenizer(org.vcell.util.CommentStringTokenizer) DataAccessException(org.vcell.util.DataAccessException) DataAccessException(org.vcell.util.DataAccessException) DataAccessException(org.vcell.util.DataAccessException) SQLException(java.sql.SQLException)

Example 69 with Version

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

the class MathModelDbDriver 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, MathModelMetaData mathModelMetaData, MathModelChildSummary mmcs, boolean bVersion) throws DataAccessException, SQLException, RecordChangedException {
    Version newVersion = updateVersionableInit(hash, con, user, mathModelMetaData, bVersion);
    insertMathModelMetaData(con, user, mathModelMetaData, mmcs, newVersion);
    return newVersion.getVersionKey();
}
Also used : Version(org.vcell.util.document.Version)

Example 70 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, MathModelDbDriver mathModelDbDriver, Connection con, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
    // 
    // Get Version
    // 
    java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
    Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
    KeyValue mathModelKey = version.getVersionKey();
    KeyValue mathRef = new KeyValue(rset.getBigDecimal(table.mathRef.toString()));
    // 
    // get Simulation Keys for bioModelKey
    // 
    KeyValue[] simKeys = mathModelDbDriver.getSimulationEntriesFromMathModel(con, mathModelKey);
    // MathModelMetaData mathModelMetaData = new MathModelMetaData(version,mathRef,simKeys);
    MathModelMetaData mathModelMetaData = populateOutputFunctions(con, mathRef, version, simKeys, 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)

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