Package org.mcisb.beacon.pierre

Examples of org.mcisb.beacon.pierre.BeaconDatabaseOperations


  public ExperimentSummaryProvider(org.mcisb.beacon.pierre.StatementExecutor s, String query, BeaconDatabaseOperations d) {
    ArrayList tempTuples = new ArrayList();
    String queryString = query;
    org.mcisb.beacon.pierre.StatementExecutor statementExecutor = s;
    BeaconDatabaseOperations databaseOperations = d;
   
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    try {
      DocumentBuilder db = dbf.newDocumentBuilder();
      String queryResults[] = statementExecutor.getResults(queryString.toString());

      for (int j=0; j<queryResults.length;j++) {
        InputSource inStream = new InputSource();
        inStream.setCharacterStream(new StringReader(queryResults[j]));
        Document queryResult = db.parse(inStream);
        StringBuffer linkText = new StringBuffer();
        linkText.append("http://tdb.mc.manchester.ac.uk/tamino/beacon_XML/experiments/Experiment/@");
        String titleID=databaseOperations.getValue(queryResult,"titleID");
        ExperimentDescription newDescription = new ExperimentDescription(titleID);
        StringBuffer person = new StringBuffer();
        person.append(databaseOperations.getValue(queryResult,"firstName"));
        person.append(" ");
        if (databaseOperations.getValue(queryResult,"midInitials").length()>0){
          person.append(databaseOperations.getValue(queryResult,"midInitials"));
          person.append(". ");
        }
        person.append(databaseOperations.getValue(queryResult,"lastName"));
        linkText.append(databaseOperations.getValue(queryResult,"docID"));
        newDescription.setLink(linkText.toString());
        newDescription.setPerson(person.toString());
        newDescription.setStartDate(databaseOperations.getValue(queryResult,"start_date"));
        tempTuples.add(newDescription.getTuple());
      }

    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.mcisb.beacon.pierre.BeaconDatabaseOperations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.