dragon.onlinedb.amazon
Class AmazonCatalogQuery

java.lang.Object
  |
  +--dragon.onlinedb.AbstractQuery
        |
        +--dragon.onlinedb.amazon.AmazonCatalogQuery
All Implemented Interfaces:
ArticleQuery, CollectionReader

public class AmazonCatalogQuery
extends AbstractQuery

Amazon catalog query

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  Article[] arrArticle
           
protected  java.lang.String browseUrl
           
protected  HttpUtil http
           
protected  java.lang.String queryKey
           
protected  java.lang.String searchUrl
           
protected  java.lang.String term
           
 
Fields inherited from class dragon.onlinedb.AbstractQuery
articleNum, curArticle, curArticleNo, curPageNo, curPageWidth, pageNum, pageWidth, parser
 
Constructor Summary
AmazonCatalogQuery()
           
AmazonCatalogQuery(java.lang.String productCatalog)
           
 
Method Summary
protected  Article getArticle(int articleNo)
           
 Article getArticleByKey(java.lang.String PMID)
          Reads out the article according to its key
static void getProductList(java.lang.String catalogNode, java.lang.String codeListFile, java.lang.String descriptionListFile)
           
 boolean initQuery()
          One should call this method before retrieval articles.
static void main(java.lang.String[] args)
           
 boolean moveToPage(int pageNo)
          Move to the given page and the pointer is set on the first article of the page.
 void setSearchTerm(java.lang.String productCatalog)
          Set the searching terms.
 boolean supportArticleKeyRetrieval()
          if the query supports this retrieval mode, one can get articles by calling getArticleByKey method.
 
Methods inherited from class dragon.onlinedb.AbstractQuery
close, getArticle, getArticleKey, getArticleParser, getCurPageNo, getCurPageWidth, getNextArticle, getPageNum, getPageWidth, getTotalArticleNum, loadCollection, moveToArticle, moveToNextArticle, moveToNextPage, restart, setArticleParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryKey

protected java.lang.String queryKey

term

protected java.lang.String term

searchUrl

protected java.lang.String searchUrl

browseUrl

protected java.lang.String browseUrl

arrArticle

protected Article[] arrArticle

http

protected HttpUtil http
Constructor Detail

AmazonCatalogQuery

public AmazonCatalogQuery(java.lang.String productCatalog)

AmazonCatalogQuery

public AmazonCatalogQuery()
Method Detail

main

public static void main(java.lang.String[] args)

getProductList

public static void getProductList(java.lang.String catalogNode,
                                  java.lang.String codeListFile,
                                  java.lang.String descriptionListFile)

supportArticleKeyRetrieval

public boolean supportArticleKeyRetrieval()
Description copied from interface: CollectionReader
if the query supports this retrieval mode, one can get articles by calling getArticleByKey method.

Returns:
true if the query support the article retrieval by key.

setSearchTerm

public void setSearchTerm(java.lang.String productCatalog)
Description copied from interface: ArticleQuery
Set the searching terms. How to interpret the terms specified in the string is subject to the implementations.


initQuery

public boolean initQuery()
Description copied from interface: ArticleQuery
One should call this method before retrieval articles. After initialization, number of pages and number of papers are available.

Returns:
a boolean value to indicate the operation is successful or failed.

moveToPage

public boolean moveToPage(int pageNo)
Description copied from interface: ArticleQuery
Move to the given page and the pointer is set on the first article of the page.

Parameters:
pageNo - the page #
Returns:
true if the given page exists.

getArticleByKey

public Article getArticleByKey(java.lang.String PMID)
Description copied from interface: CollectionReader
Reads out the article according to its key

Parameters:
PMID - the unique entry number of the article
Returns:
an article if exists

getArticle

protected Article getArticle(int articleNo)
Specified by:
getArticle in class AbstractQuery