atg.search.routing.command.search
Class Document

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      extended by atg.search.routing.command.search.Document
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CategoryDocument, ViewedDocument

public class Document
extends atg.search.routing.command.SearchXMLObject
implements java.io.Serializable

The result document.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
Document()
           
 
Method Summary
 boolean equals(java.lang.Object pObject)
           
 java.lang.String getAddress()
          Returns the document's address
protected  void getAttributeXML(java.lang.StringBuilder sb)
           
protected  void getBodyXML(java.lang.StringBuilder sb)
           
 java.lang.String getContentId()
          gets content id for the document
 java.lang.String getContextInfo()
          Returns View context information
 java.lang.String getDocset()
          Returns the physical document set of this document
 java.lang.String getEscapedUrl()
          Returns a URL with double-escaped backslashes if backslashes are present
 java.lang.String getFileName()
          Returns the document's file name
 int getGoto()
          Returns the Jump-to offset of this result in the document text
 int getGotoLink()
          This is the same function as #getGoto - it's provided for backward compatibility
 int getHdoc()
          Returns the internal document id
 atg.search.routing.utils.Language getLanguage()
          Returns the language of document
 java.lang.String getPaAnswerText()
          Returns the answer text if this document is a preferred answer
 java.lang.String getPaQuestionText()
          Returns the question text if this document is a preferred answer
 java.util.Map getProperties()
          Returns a String-to-String or String-to-List Map depending on the enclosing response's SearchResponse.isAllowListProperties()
 java.util.List<RelatedDocset> getRelatedDocsets()
          Returns the List of related docsets
 java.lang.String getRequestTag()
          Gets the xml element tag used in the request
 long getSizeBytes()
          Returns the size of source of document in bytes
 java.lang.String getSummary()
          Returns the summary of the document
 long getTimestamp()
          Returns the modified date of document's file
 java.lang.String getTitle()
          Returns the title of the document
 atg.search.routing.command.search.DocumentFormat getType()
          Returns the major format of document
 java.lang.String getUrl()
          See getEscapedUrl()
 boolean isListPropertiesAllowed()
          If this is true, getProperties() returns a map of Strings to Lists.
 void setAddress(java.lang.String pAddress)
          Sets the document's address
 void setContentId(java.lang.String contentId)
          sets content id for the document.
 void setContextInfo(java.lang.String contextInfo)
          Sets View context information
 void setDocset(java.lang.String docset)
          Sets the physical document set of this document
 void setFileName(java.lang.String pFileName)
          Sets the document's file name
 void setGoto(int pGoto)
          Sets the Jump-to offset of this result in the document text
 void setHdoc(int hdoc)
          Sets the internal document id
 void setLanguage(atg.search.routing.utils.Language language)
          Sets the language of document
 void setListPropertiesAllowed(boolean listPropertiesAllowed)
          If this is true, getProperties() returns a map of Strings to Lists.
 void setPaAnswerText(java.lang.String paAnswerText)
          Sets the answer text if this document is a preferred answer
 void setPaQuestionText(java.lang.String paQuestionText)
          Sets the question text if this document is a preferred answer
 void setProperties(java.util.Map properties)
          Sets the properties
 void setRelatedDocsets(java.util.List<RelatedDocset> relatedDocsets)
          Sets the list of related docsets
 void setSizeBytes(long sizeBytes)
          Sets the size of source of document
 void setSummary(java.lang.String summary)
          Sets the summary of the document
 void setTimestamp(long timestamp)
          Sets the modified date of document's file
 void setTitle(java.lang.String title)
          Sets the title of the document
 void setType(atg.search.routing.command.search.DocumentFormat type)
          Sets the major format of document
 void setUrl(java.lang.String pUrl)
          Sets the url
 
Methods inherited from class atg.search.routing.command.SearchXMLObject
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendOptionalValue, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllAttributeXML, getAllBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, isPrintedFirstChild, setParentXMLObject, setPrintedFirstChild, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

Document

public Document()
Method Detail

equals

public boolean equals(java.lang.Object pObject)
Overrides:
equals in class java.lang.Object

isListPropertiesAllowed

public boolean isListPropertiesAllowed()
If this is true, getProperties() returns a map of Strings to Lists. If false, Strings to Strings.

Returns:
true if list properties are allowed

setListPropertiesAllowed

public void setListPropertiesAllowed(boolean listPropertiesAllowed)
If this is true, getProperties() returns a map of Strings to Lists. If false, Strings to Strings.

Parameters:
listPropertiesAllowed - whether list properties should be allowed

getContentId

public java.lang.String getContentId()
gets content id for the document

Returns:
content id for the document

setContentId

public void setContentId(java.lang.String contentId)
sets content id for the document. depending on the doc type, this may or may not be available in the document xml, but it must always be set in here

Parameters:
contentId - content id for the document

getContextInfo

public java.lang.String getContextInfo()
Returns View context information

Returns:
View context information

setContextInfo

public void setContextInfo(java.lang.String contextInfo)
Sets View context information

Parameters:
contextInfo - View context information

getHdoc

public int getHdoc()
Returns the internal document id

Returns:
document id

setHdoc

public void setHdoc(int hdoc)
Sets the internal document id

Parameters:
hdoc - document id

getGotoLink

public int getGotoLink()
This is the same function as #getGoto - it's provided for backward compatibility

Returns:
Jump-to offset of this result in the document text

getGoto

public int getGoto()
Returns the Jump-to offset of this result in the document text

Returns:
Jump-to offset of this result in the document text

setGoto

public void setGoto(int pGoto)
Sets the Jump-to offset of this result in the document text

Parameters:
pGoto - Jump-to offset of this result in the document text

getSizeBytes

public long getSizeBytes()
Returns the size of source of document in bytes

Returns:
Size of source of document in bytes

setSizeBytes

public void setSizeBytes(long sizeBytes)
Sets the size of source of document

Parameters:
sizeBytes - Size of source of document

getDocset

public java.lang.String getDocset()
Returns the physical document set of this document

Returns:
Physical document set of this document

setDocset

public void setDocset(java.lang.String docset)
Sets the physical document set of this document

Parameters:
docset - Physical document set of this document

getType

public atg.search.routing.command.search.DocumentFormat getType()
Returns the major format of document

Returns:
Major format of document

setType

public void setType(atg.search.routing.command.search.DocumentFormat type)
Sets the major format of document

Parameters:
type - Major format of document

getLanguage

public atg.search.routing.utils.Language getLanguage()
Returns the language of document

Returns:
Language of document

setLanguage

public void setLanguage(atg.search.routing.utils.Language language)
Sets the language of document

Parameters:
language - Language of document

getTitle

public java.lang.String getTitle()
Returns the title of the document

Returns:
Title of the document

setTitle

public void setTitle(java.lang.String title)
Sets the title of the document

Parameters:
title - Title of the document

getSummary

public java.lang.String getSummary()
Returns the summary of the document

Returns:
Summary of the document

setSummary

public void setSummary(java.lang.String summary)
Sets the summary of the document

Parameters:
summary - Summary of the document

getUrl

public java.lang.String getUrl()
See getEscapedUrl()

Returns:
url of the document

getEscapedUrl

public java.lang.String getEscapedUrl()
Returns a URL with double-escaped backslashes if backslashes are present

Returns:
a URL with double-escaped backslashes if backslashes are present

setUrl

public void setUrl(java.lang.String pUrl)
Sets the url

Parameters:
pURL - URL of the document

getTimestamp

public long getTimestamp()
Returns the modified date of document's file

Returns:
Modified date of document's file

setTimestamp

public void setTimestamp(long timestamp)
Sets the modified date of document's file

Parameters:
timestamp - Modified date of document file

getPaQuestionText

public java.lang.String getPaQuestionText()
Returns the question text if this document is a preferred answer

Returns:
Question text if this document is a preferred answer

setPaQuestionText

public void setPaQuestionText(java.lang.String paQuestionText)
Sets the question text if this document is a preferred answer

Parameters:
paQuestionText - Question text if this document is a preferred answer

getPaAnswerText

public java.lang.String getPaAnswerText()
Returns the answer text if this document is a preferred answer

Returns:
Answer text if this document is a preferred answer

setPaAnswerText

public void setPaAnswerText(java.lang.String paAnswerText)
Sets the answer text if this document is a preferred answer

Parameters:
paAnswerText - Answer text if this document is a preferred answer

getProperties

public java.util.Map getProperties()
Returns a String-to-String or String-to-List Map depending on the enclosing response's SearchResponse.isAllowListProperties()

Returns:
a String-to-String or String-to-List Map depending on the enclosing response's SearchResponse.isAllowListProperties()

setProperties

public void setProperties(java.util.Map properties)
Sets the properties

Parameters:
properties - String to String map or String to List map

getRelatedDocsets

public java.util.List<RelatedDocset> getRelatedDocsets()
Returns the List of related docsets

Returns:
List of related docsets

setRelatedDocsets

public void setRelatedDocsets(java.util.List<RelatedDocset> relatedDocsets)
Sets the list of related docsets

Parameters:
relatedDocsets - List of RelatedDocset objects

setFileName

public void setFileName(java.lang.String pFileName)
Sets the document's file name

Parameters:
pFileName -

getFileName

public java.lang.String getFileName()
Returns the document's file name

Returns:
the document's file name

getAddress

public java.lang.String getAddress()
Returns the document's address

Returns:
the document's address

setAddress

public void setAddress(java.lang.String pAddress)
Sets the document's address

Parameters:
pAddress -

getRequestTag

public java.lang.String getRequestTag()
Gets the xml element tag used in the request

Specified by:
getRequestTag in class atg.search.routing.command.SearchXMLObject
Returns:
xml element tag

getAttributeXML

protected void getAttributeXML(java.lang.StringBuilder sb)
                        throws atg.search.routing.command.IncompleteCommandException
Overrides:
getAttributeXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

getBodyXML

protected void getBodyXML(java.lang.StringBuilder sb)
                   throws atg.search.routing.command.IncompleteCommandException
Overrides:
getBodyXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException