de.unidu.is.retrieval
Class AbstractRetrieverUIMetadata

java.lang.Object
  extended byde.unidu.is.retrieval.AbstractRetrieverUIMetadata
All Implemented Interfaces:
RetrieverUIMetadata
Direct Known Subclasses:
HyREXRetrieverUIMetadata

public abstract class AbstractRetrieverUIMetadata
extends java.lang.Object
implements RetrieverUIMetadata

An abstract class describing metadata for a MIND retriever which can be used by UIs for a reasonable handling of queries and documents. TODO: getAliases instead of getXPath? TODO: comments

Since:
2004-03-18
Version:
$Revision: 1.9 $, $Date: 2005/02/28 22:27:55 $
Author:
Henrik Nottelmann

Field Summary
protected  java.lang.String[] collections
           
protected  Retriever retriever
           
protected  Schema schema
           
protected  java.lang.String[] sortedAttributes
           
protected  java.lang.String[] sortedSearchAttributes
           
protected  java.lang.String[] sortModel
           
 
Constructor Summary
AbstractRetrieverUIMetadata(Retriever retriever)
           
 
Method Summary
 java.lang.String extract(org.w3c.dom.Document doc, java.lang.String attName)
          Extracts the content of the specified XML document given by the XPath expressions of the specified attribute.
 java.util.List extractList(org.w3c.dom.Document doc, java.lang.String attName)
          Extracts the content of the specified XML document given by the XPath expressions of the specified attribute.
 java.lang.String getCollectionFromDocID(java.lang.String docID)
          Returns the collection which is encoded in the specified doc ID.
 Retriever getRetriever()
          Returns the associated retriever.
 Schema getSchema()
          Returns the schema used by the retriever.
 java.lang.String[] getSortedAttributeNames()
          Returns the attributes names with could be used for displaying details.
 java.lang.String[] getSortedSearchAttributeNames()
          Returns the attributes names with could be used for searching.
 java.lang.String[] getSortModel()
          Returns the attributes names with could be used for sorting.
 java.lang.String toHuman(java.lang.String attName)
          Converts the specified attribute name into a human-readable label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.unidu.is.retrieval.RetrieverUIMetadata
getAuthorAttributeNames, getCollections, getTitleAttributeNames, getYearAttributeNames
 

Field Detail

retriever

protected Retriever retriever

schema

protected Schema schema

sortedSearchAttributes

protected java.lang.String[] sortedSearchAttributes

sortedAttributes

protected java.lang.String[] sortedAttributes

sortModel

protected java.lang.String[] sortModel

collections

protected java.lang.String[] collections
Constructor Detail

AbstractRetrieverUIMetadata

public AbstractRetrieverUIMetadata(Retriever retriever)
Method Detail

getRetriever

public Retriever getRetriever()
Returns the associated retriever.

Specified by:
getRetriever in interface RetrieverUIMetadata
Returns:
retriever
See Also:
RetrieverUIMetadata.getRetriever()

getSchema

public Schema getSchema()
Returns the schema used by the retriever.

Specified by:
getSchema in interface RetrieverUIMetadata
Returns:
schema used by the retriever

getSortedSearchAttributeNames

public java.lang.String[] getSortedSearchAttributeNames()
Returns the attributes names with could be used for searching.

This implementation returns all attributes with a search predicate in the order of appearence in the schema.

Specified by:
getSortedSearchAttributeNames in interface RetrieverUIMetadata
Returns:
attributes names with could be used for searching

getSortedAttributeNames

public java.lang.String[] getSortedAttributeNames()
Returns the attributes names with could be used for displaying details.

This implementation returns all attributes in the order of appearence in the schema.

Specified by:
getSortedAttributeNames in interface RetrieverUIMetadata
Returns:
attributes names with could be used for displaying details

getSortModel

public java.lang.String[] getSortModel()
Returns the attributes names with could be used for sorting.

This implementation returns all attributes with a search predicate (except "image") in the order of appearence in the schema.

Specified by:
getSortModel in interface RetrieverUIMetadata
Returns:
attributes names with could be used for sorting
See Also:
RetrieverUIMetadata.getSortModel()

toHuman

public java.lang.String toHuman(java.lang.String attName)
Converts the specified attribute name into a human-readable label.

This implementation converts the first character into upper-case, and replaces hyphens by spaces.

Specified by:
toHuman in interface RetrieverUIMetadata
Parameters:
attName - attribute name
Returns:
human-readable label

extract

public java.lang.String extract(org.w3c.dom.Document doc,
                                java.lang.String attName)
Extracts the content of the specified XML document given by the XPath expressions of the specified attribute. Multiple occurrences are concatenated (with "; " as separator).

Specified by:
extract in interface RetrieverUIMetadata
Parameters:
doc - XML docoument
attName - attribute name
Returns:
extracted content

extractList

public java.util.List extractList(org.w3c.dom.Document doc,
                                  java.lang.String attName)
Extracts the content of the specified XML document given by the XPath expressions of the specified attribute. Each list entry equals one occurrence in the document.

Specified by:
extractList in interface RetrieverUIMetadata
Parameters:
doc - XML docoument
attName - attribute name
Returns:
extracted content

getCollectionFromDocID

public java.lang.String getCollectionFromDocID(java.lang.String docID)
Returns the collection which is encoded in the specified doc ID.

Specified by:
getCollectionFromDocID in interface RetrieverUIMetadata
Parameters:
docID - document ID
Returns:
collection encoded in the doc ID, or null (no collection)