Search in sources :

Example 1 with Publication

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);
}
Also used : KeyValue(org.vcell.util.document.KeyValue) Publication(org.vcell.pub.Publication)

Example 2 with Publication

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]);
}
Also used : KeyValue(org.vcell.util.document.KeyValue) User(org.vcell.util.document.User) PublicationInfo(org.vcell.util.document.PublicationInfo) Publication(org.vcell.pub.Publication) TreeMap(java.util.TreeMap) Timestamp(java.sql.Timestamp) BigDecimal(java.math.BigDecimal) DependencyException(org.vcell.util.DependencyException) RecordChangedException(cbit.sql.RecordChangedException) PermissionException(org.vcell.util.PermissionException) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) SQLException(java.sql.SQLException) DataAccessException(org.vcell.util.DataAccessException) VersionInfo(org.vcell.util.document.VersionInfo) VCDocumentInfo(org.vcell.util.document.VCDocumentInfo) ResultSet(java.sql.ResultSet) DataAccessException(org.vcell.util.DataAccessException)

Example 3 with Publication

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);
}
Also used : KeyValue(org.vcell.util.document.KeyValue) Publication(org.vcell.pub.Publication)

Aggregations

Publication (org.vcell.pub.Publication)3 KeyValue (org.vcell.util.document.KeyValue)3 RecordChangedException (cbit.sql.RecordChangedException)1 BigDecimal (java.math.BigDecimal)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1 TreeMap (java.util.TreeMap)1 DataAccessException (org.vcell.util.DataAccessException)1 DependencyException (org.vcell.util.DependencyException)1 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)1 PermissionException (org.vcell.util.PermissionException)1 PublicationInfo (org.vcell.util.document.PublicationInfo)1 User (org.vcell.util.document.User)1 VCDocumentInfo (org.vcell.util.document.VCDocumentInfo)1 VersionInfo (org.vcell.util.document.VersionInfo)1