|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.autonomy.aci.businessobjects.AciBusinessObject
com.autonomy.aci.businessobjects.Document
com.autonomy.aci.businessobjects.ResultDocument
A document as served up by IDOL in response to a query. The fields of a ResultDocument
are populated using the information contained within the corresponding 'autn:hit' element
for the document in the IDOL response.
All elements within the 'autn:hit' elements that start with 'autn:' and contain CDATA as
opposed to XML are as mapped to AutnFields on the result document object. All of these fields
can be read using the getAutnFieldValue
methods. However, the most common ones
are also available through methods such are getTitle
, getSummary
etc.
Content fields (available through getContentFields
and getContentFieldValue
)
are defined as the value of the XML entities contained within the hit structure's <DOCUMENT>
element (if this element is structured XML rather than in flat IDX format, the result object
should be of class XMLResultDocument
rather than ResultDocument
).
Field Summary | |
static java.lang.String |
CONTENT_AUTN_FIELD_NAME
|
static java.lang.String |
DATABASE_AUTN_FIELD_NAME
|
static java.lang.String |
ID_AUTN_FIELD_NAME
|
static java.lang.String |
LINKS_AUTN_FIELD_NAME
|
static java.lang.String |
REFERENCE_AUTN_FIELD_NAME
|
static java.lang.String |
SECTION_AUTN_FIELD_NAME
|
static java.lang.String |
SUMMARY_AUTN_FIELD_NAME
|
static java.lang.String |
TITLE_AUTN_FIELD_NAME
|
static java.lang.String |
URL_AUTN_FIELD_NAME
|
static java.lang.String |
WEIGHT_AUTN_FIELD_NAME
|
Constructor Summary | |
ResultDocument()
Create a ResultDocument with no properties set. |
|
ResultDocument(java.lang.String sDocRef)
Create a ResultDocument with the given document reference. |
Method Summary | |
void |
addAutnField(java.lang.String sFieldName,
java.lang.String sFieldValue)
Add an AutnField for this document. |
void |
addContentField(java.lang.String sFieldName,
java.lang.String sFieldValue)
Add a content field for this document. |
void |
addLink(java.lang.String sLink)
Add a link or matching term to the ones already set for this result. |
void |
clearAutnFields()
Remove all AutnFields for this document. |
void |
clearContentFields()
Remove all content fields for this document. |
void |
clearLinks()
Removes all links set for this result document. |
java.util.HashMap |
getAutnFields()
Gives a mapping between all the document's AutnFields and their values. |
java.lang.String |
getAutnFieldValue(java.lang.String sFieldName)
Read the value of a given document's AutnField. |
java.lang.String |
getAutnFieldValue(java.lang.String sFieldName,
java.lang.String sDefaultValue)
Read the value of a given document's AutnField. |
java.util.HashMap |
getContentFields()
Gives a mapping between all the document's content fields and their values. |
java.lang.String |
getContentFieldValue(java.lang.String sFieldName)
Read the value of a given document's content field. |
java.lang.String |
getContentFieldValue(java.lang.String sFieldName,
java.lang.String sDefaultValue)
Read the value of a given document's content field. |
java.lang.String |
getDatabase()
Read database in which this document is stored (the value of its autn:database property). |
java.lang.String |
getDocReference()
Read the reference for this document (the value of its autn:reference property). |
java.util.ArrayList |
getLinks()
Read the weight or relevence of this document with respect to the query that generated the response containing this document. |
java.lang.String |
getSummary()
Read the summary of this document as given by the 'autn:summary' element. |
java.lang.String |
getTitle()
Read the title for this document (the value of its autn:title property). |
float |
getWeight()
Read the weight or relevence of this document with respect to the query that generated the response containing this document. |
void |
removeAutnField(java.lang.String sFieldName)
Remove an AutnField for this document. |
void |
removeContentField(java.lang.String sFieldName)
Remove a content field for this document. |
void |
removeLink(java.lang.String sLink)
Remove a link or matching term from the links set for this result. |
void |
setAutnFields(java.util.Map autnFieldsMap)
Set all the AutnFields for this document. |
void |
setContentFields(java.util.Map contentFieldsMap)
Set all the content fields for this document. |
void |
setDatabase(java.lang.String sDatabase)
Set the database this document is stored in. |
void |
setDocReference(java.lang.String sDocRef)
Set the unique reference for this document. |
void |
setLinks(java.util.ArrayList alLinks)
Set the links or matching terms for this result. |
void |
setSummary(java.lang.String sSummary)
Set the value of the summary generated at query time. |
void |
setTitle(java.lang.String sTitle)
Set the title of this document. |
void |
setWeight(float fWeight)
Set the value of this document's weight or relevence vis-a-vis the query that generated it. |
java.lang.String |
toString()
Creates a string detailing all this document's properties. |
Methods inherited from class com.autonomy.aci.businessobjects.Document |
equals |
Methods inherited from class com.autonomy.aci.businessobjects.AciBusinessObject |
getUID, setUID |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String REFERENCE_AUTN_FIELD_NAME
public static final java.lang.String URL_AUTN_FIELD_NAME
public static final java.lang.String ID_AUTN_FIELD_NAME
public static final java.lang.String SECTION_AUTN_FIELD_NAME
public static final java.lang.String WEIGHT_AUTN_FIELD_NAME
public static final java.lang.String LINKS_AUTN_FIELD_NAME
public static final java.lang.String DATABASE_AUTN_FIELD_NAME
public static final java.lang.String TITLE_AUTN_FIELD_NAME
public static final java.lang.String SUMMARY_AUTN_FIELD_NAME
public static final java.lang.String CONTENT_AUTN_FIELD_NAME
Constructor Detail |
public ResultDocument()
ResultDocument
with no properties set.
public ResultDocument(java.lang.String sDocRef)
ResultDocument
with the given document reference.
sDocRef
- the reference by which the document is uniquely identified within IDOL
(the value of its DREREFERENCE or autn:reference).Method Detail |
public void setDocReference(java.lang.String sDocRef)
setDocReference
in class Document
sDocRef
- the document's reference. Must not be null.public void setTitle(java.lang.String sTitle)
setTitle
in class Document
sTitle
- the document title. Must not be null.public void setDatabase(java.lang.String sDatabase)
setDatabase
in class Document
sDatabase
- the document's database. Must not be null.public void setWeight(float fWeight)
fWeight
- the weight of the document. This must be greater than or equal to 0.public void setLinks(java.util.ArrayList alLinks)
alLinks
- an ArrayList
of String
s giving the result document links.public void addLink(java.lang.String sLink)
sLink
- the result document link to add.public void removeLink(java.lang.String sLink)
sLink
- the result document link to remove.public void clearLinks()
public void setSummary(java.lang.String sSummary)
sSummary
- the query-time generated summary.public java.lang.String getDocReference()
getDocReference
in class Document
public java.lang.String getTitle()
getTitle
in class Document
public java.lang.String getDatabase()
getDatabase
in class Document
public void setContentFields(java.util.Map contentFieldsMap)
contentFieldsMap
- a mapping between all the documents content fields and their values.public void addContentField(java.lang.String sFieldName, java.lang.String sFieldValue)
sFieldName
- the name of this content field.sFieldValue
- the name of this content field.public void removeContentField(java.lang.String sFieldName)
sFieldName
- the name of the content field to remove.public void clearContentFields()
public void setAutnFields(java.util.Map autnFieldsMap)
autnFieldsMap
- a mapping between all the documents AutnFields and their values.public void addAutnField(java.lang.String sFieldName, java.lang.String sFieldValue)
sFieldName
- the name of this AutnField.sFieldValue
- the name of this AutnField.public void removeAutnField(java.lang.String sFieldName)
sFieldName
- the name of the content field to remove.public void clearAutnFields()
public float getWeight()
public java.util.ArrayList getLinks()
public java.lang.String getSummary()
public java.util.HashMap getContentFields()
String
s.public java.lang.String getContentFieldValue(java.lang.String sFieldName, java.lang.String sDefaultValue)
sFieldName
- the name of the content field.sDefaultValue
- the value to return if the field does not exist for this document or
has no value set.
public java.lang.String getContentFieldValue(java.lang.String sFieldName)
sFieldName
- the name of the content field.
null
if the field does not exist or
is empty.public java.util.HashMap getAutnFields()
String
s.public java.lang.String getAutnFieldValue(java.lang.String sFieldName, java.lang.String sDefaultValue)
sFieldName
- the name of the AutnField.sDefaultValue
- the value to return if the field does not exist for this document or
has no value set.
public java.lang.String getAutnFieldValue(java.lang.String sFieldName)
sFieldName
- the name of the AutnField.
null
if the field does not exist or
is empty.public java.lang.String toString()
toString
in class Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |