use of org.vcell.pub.Publication in project vcell by virtualcell.
the class PublicationTable method getInfo.
/**
* This method was created in VisualAge.
* @return cbit.vcell.geometry.GeometryInfo
* @param rset java.sql.ResultSet
* @param log cbit.vcell.server.SessionLog
* @throws MalformedURLException
*/
public Publication getInfo(ResultSet rset, Connection con) throws SQLException, DataAccessException, MalformedURLException {
KeyValue key = new KeyValue(rset.getBigDecimal(PublicationTable.table.id.toString()));
String title = rset.getString(PublicationTable.table.title.toString());
String authorsString = rset.getString(PublicationTable.table.authors.toString());
String[] authors = authorsString.split(";");
String citation = rset.getString(PublicationTable.table.citation.toString());
String pubmedid = rset.getString(PublicationTable.table.pubmedid.toString());
String doi = rset.getString(PublicationTable.table.doi.toString());
String url = rset.getString(PublicationTable.table.url.toString());
return new Publication(key, title, authors, citation, pubmedid, doi, url);
}
use of org.vcell.pub.Publication in project vcell by virtualcell.
the class DbDriver method addPublicationInfos.
public static void addPublicationInfos(Connection con, Statement stmt, Vector<VersionInfo> mm_and_bm_VersionInfos) throws SQLException, DataAccessException {
TreeMap<Long, VersionInfo> mapModelIdToVersionInfo = new TreeMap<>(new Comparator<Long>() {
@Override
public int compare(Long o1, Long o2) {
return o1.compareTo(o2);
}
});
for (int i = 0; i < mm_and_bm_VersionInfos.size(); i++) {
mapModelIdToVersionInfo.put(Long.parseLong(mm_and_bm_VersionInfos.get(i).getVersion().getVersionKey().toString()), mm_and_bm_VersionInfos.get(i));
}
//
// PublicationInfos
//
final String DOCTYPE_COL = "doctype";
final String DOCID_COL = "docid";
String sql = new String("select vc_publication.*,'bm' " + DOCTYPE_COL + ",vc_biomodel.id " + DOCID_COL + ",vc_biomodel.ownerref,vc_userinfo.userid" + " from vc_publication,vc_publicationmodellink,vc_biomodel,vc_userinfo" + " where" + " vc_biomodel.id=vc_publicationmodellink.biomodelref and vc_userinfo.id=vc_biomodel.ownerref" + " and vc_publication.id=vc_publicationmodellink.pubref and vc_publicationmodellink.pubref is not null" + " and vc_publicationmodellink.biomodelref is not null" + " UNION ALL" + " select vc_publication.*,'mm' " + DOCTYPE_COL + ",vc_mathmodel.id " + DOCID_COL + ",vc_mathmodel.ownerref,vc_userinfo.userid" + " from vc_publication,vc_publicationmodellink,vc_mathmodel,vc_userinfo" + " where" + " vc_mathmodel.id=vc_publicationmodellink.mathmodelref and vc_userinfo.id=vc_mathmodel.ownerref" + " and vc_publication.id=vc_publicationmodellink.pubref and vc_publicationmodellink.pubref is not null" + " and vc_publicationmodellink.mathmodelref is not null");
System.out.println(sql);
ResultSet rset = null;
try {
rset = stmt.executeQuery(sql);
while (rset.next()) {
Publication publication = PublicationTable.table.getInfo(rset, con);
String docType = rset.getString(DOCTYPE_COL);
BigDecimal modelVersionID = rset.getBigDecimal(DOCID_COL);
KeyValue versionKey = new KeyValue(modelVersionID);
Timestamp timestamp = rset.getTimestamp("pubdate");
PublicationInfo publicationInfo = new PublicationInfo(publication.key, versionKey, publication.title, publication.authors, publication.citation, publication.pubmedid, publication.doi, publication.url, (docType.equals("bm") ? VCDocumentType.BIOMODEL_DOC : VCDocumentType.MATHMODEL_DOC), new User(rset.getString(UserTable.table.userid.getUnqualifiedColName()), new KeyValue(rset.getBigDecimal("ownerref").toString())), timestamp);
if (mapModelIdToVersionInfo.containsKey(modelVersionID.longValue()) && mapModelIdToVersionInfo.get(modelVersionID.longValue()) instanceof VCDocumentInfo) {
((VCDocumentInfo) mapModelIdToVersionInfo.get(modelVersionID.longValue())).addPublicationInfo(publicationInfo);
}
// publicationInfoArr.add(publicationInfo);
}
} catch (Exception e) {
e.printStackTrace();
throw new DataAccessException(DbDriver.class.getName() + ".getPublicationInfo(...) Error -" + e.getMessage(), e);
} finally {
if (rset != null) {
rset.close();
}
}
// return publicationInfoArr.toArray(new PublicationInfo[0]);
}
use of org.vcell.pub.Publication in project vcell by virtualcell.
the class PublicationTable method getInfo.
/**
* This method was created in VisualAge.
* @return cbit.vcell.geometry.GeometryInfo
* @param rset java.sql.ResultSet
* @param log cbit.vcell.server.SessionLog
* @throws MalformedURLException
*/
public Publication getInfo(ResultSet rset, Connection con, SessionLog log) throws SQLException, DataAccessException, MalformedURLException {
KeyValue key = new KeyValue(rset.getBigDecimal(PublicationTable.table.id.toString()));
String title = rset.getString(PublicationTable.table.title.toString());
String authorsString = rset.getString(PublicationTable.table.authors.toString());
String[] authors = authorsString.split(";");
String citation = rset.getString(PublicationTable.table.citation.toString());
String pubmedid = rset.getString(PublicationTable.table.pubmedid.toString());
String doi = rset.getString(PublicationTable.table.doi.toString());
String url = rset.getString(PublicationTable.table.url.toString());
return new Publication(key, title, authors, citation, pubmedid, doi, url);
}
Aggregations