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());
}
}
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));
}
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;
}
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();
}
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;
}
Aggregations