org.eaglei.search.provider.ncbi
Class NCBIEUtils

java.lang.Object
  extended by org.eaglei.search.provider.ncbi.NCBIEUtils

public final class NCBIEUtils
extends java.lang.Object

Contains logic for using NCBI EUtils.

Author:
rfrost

Nested Class Summary
static class NCBIEUtils.DocSummary
          Simple representation of a DocSum from an eSummary search
static class NCBIEUtils.ESearchResult
          Simple representation of an eSearch result
static class NCBIEUtils.Item
           
static class NCBIEUtils.ListItem
           
 
Field Summary
static java.lang.String ID
           
static java.lang.String IDLIST
           
 
Constructor Summary
NCBIEUtils()
           
 
Method Summary
static java.lang.String buildSearchURL(java.lang.String query, java.lang.String db, java.lang.String tool, int start, int max)
           
static java.lang.String buildSummaryURL(NCBIEUtils.ESearchResult result, java.lang.String db, java.lang.String tool)
           
static org.w3c.dom.Document executeNCBIRequest(java.lang.String url)
          Executes an NCBI request at the specified eUtils URL and returns the XML response as a DOM Document
static org.w3c.dom.Document parse(java.io.InputStream stream)
           
static NCBIEUtils.ESearchResult parseESearchResult(org.w3c.dom.Document doc)
          Parses an eSearch XML result and returns the IDs.
static java.util.List<NCBIEUtils.DocSummary> parseESummaryResult(org.w3c.dom.Document doc)
          Parses an eSummary XML result and returns the IDs.
static java.lang.String serializeDocument(org.w3c.dom.Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDLIST

public static final java.lang.String IDLIST
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

NCBIEUtils

public NCBIEUtils()
Method Detail

executeNCBIRequest

public static org.w3c.dom.Document executeNCBIRequest(java.lang.String url)
                                               throws java.io.IOException
Executes an NCBI request at the specified eUtils URL and returns the XML response as a DOM Document

Parameters:
url - eUtils URL with all params.
Returns:
Response as DOM Document.
Throws:
java.io.IOException - Thrown if there is an error.

serializeDocument

public static java.lang.String serializeDocument(org.w3c.dom.Document doc)

buildSearchURL

public static java.lang.String buildSearchURL(java.lang.String query,
                                              java.lang.String db,
                                              java.lang.String tool,
                                              int start,
                                              int max)

buildSummaryURL

public static java.lang.String buildSummaryURL(NCBIEUtils.ESearchResult result,
                                               java.lang.String db,
                                               java.lang.String tool)

parseESearchResult

public static NCBIEUtils.ESearchResult parseESearchResult(org.w3c.dom.Document doc)
                                                   throws java.io.IOException
Parses an eSearch XML result and returns the IDs.

Parameters:
doc - XML Document.
Returns:
List of IDs
Throws:
java.io.IOException

parseESummaryResult

public static java.util.List<NCBIEUtils.DocSummary> parseESummaryResult(org.w3c.dom.Document doc)
                                                                 throws java.io.IOException
Parses an eSummary XML result and returns the IDs.

Parameters:
doc - XML Document.
Returns:
List of IDs
Throws:
java.io.IOException

parse

public static org.w3c.dom.Document parse(java.io.InputStream stream)
                                  throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2009-2010 Eagle-I. All Rights Reserved.