|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.search.routing.command.SearchXMLObject atg.search.routing.command.SearchEngineRequestImpl atg.search.routing.command.search.SearchRequest atg.search.routing.command.search.ViewDocumentRequest
public class ViewDocumentRequest
The ViewDocument request retrieves a document, document information, or a full item inspection using DocumentContextInfo String,
the doc's URL, or a property-value pair. In the case of item inspection (when return is set to
ViewDocumentRequest.Return.INSPECT
), the only populated properties
will be ViewDocumentRequest.Response.getItemInspect()
and
ViewDocumentRequest.Response.getReturn()
. Everything else
will be null.
Required: Document; one of DocContextId (set automatically when Document is provided with DocContextId)
setDocContextId(java.lang.String)
,
URL (set automatically when Document is provided with URL and doc context is null)
setURL(java.lang.String)
,
or Property and PropertyValue setProperty(java.lang.String)
and setPropertyValue(java.lang.String)
. Alternatively, you may call setURL(java.lang.String)
The DocContextId must come from a live result: Do not use this when the information is old, since it may be out of date; use
the URL instead.
Optional: everything else
Nested Class Summary | |
---|---|
static class |
ViewDocumentRequest.Response
Response type for the ViewDocumentRequest |
static class |
ViewDocumentRequest.Return
The Return type determines what the ViewDocument request returns. |
static class |
ViewDocumentRequest.Section
HTML section type enumeration. |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.search.routing.command.search.SearchRequest |
---|
BROWSE, CACHEABLE, CATEGORIZE, DEBUG, EMPTY_ARRAY, ENV, ID, INSPECT, LIST_PROPERTY_ALLOWED, LISTABLE_PROPERTIES, LOCAL_MERGE, LOCAL_MERGE_DEBUG, LOG_THIS_REQUEST, mDebug, mListableProperties, mListPropertyAllowed, mLocalMergeDebugEnabled, mLocalMergeDebugReady, mLocalMergeEnabled, mMergeSettings, mMultiPartitionSearch, mRequestIdentifier, MsInNs, mSleepTimeMs, mTargets, mTimeLimitMs, MULTI_PARTITION, MULTI_SEARCH_SESSION, mVersion, QUERY, RESP_FORM, SAVE_REQUEST, SIMILARDOCS, SITE_CONSTR, SITE_ID, SLEEP_TIME_MS, STRUCTQUERY, TAGS, TIME, TIME_LIMIT_MS, TREEQUERY, TYPEAHEAD, VERSION, VIC |
Constructor Summary | |
---|---|
ViewDocumentRequest()
|
Method Summary | |
---|---|
void |
addSection(ViewDocumentRequest.Section section)
Adds a section. |
protected static ViewDocumentRequest |
fromXml(atg.search.routing.utils.SearchMessageParser xml)
|
protected void |
getAttributeXML(java.lang.StringBuilder buf)
|
protected void |
getBodyXML(java.lang.StringBuilder buf)
|
java.lang.String |
getDocContextId()
Returns the document identifier plus highlight regions |
Document |
getDocument()
Returns the document that is to be viewed |
DocumentSetConstraint |
getDocumentSetConstraints()
Returns document set constraints |
java.lang.String |
getInput()
Returns the original user input |
ParserOptions |
getParserOptions()
Returns text processing options |
java.lang.String |
getProperty()
Returns the property half of the property-value pair used to retrieve a document |
java.lang.String |
getPropertyValue()
Returns the value half of the property-value pair used to retrieve a document |
DocumentSetConstraint |
getRefineConstraints()
Returns refinement constraints |
int |
getRequestId()
This identifies the type of request, one of SearchRequest.QUERY , SearchRequest.BROWSE , etc. |
ViewDocumentRequest.Return |
getReturn()
Returns the return type of the request |
java.util.List |
getSections()
Returns a list of ViewDocumentRequest.Section s |
java.lang.String |
getURL()
Returns the URL used to retrieve a document to view |
boolean |
isDecodeOnly()
Indicates whether the response from the request should only be decoded, not parsed. |
boolean |
isKeepingXml()
ViewDocument requests always preserve the XML. |
protected SearchResponse |
processSearchResponse(atg.search.routing.command.SearchEngineResponse response)
Override to provide search response processing (parsing, generally). |
void |
setDocContextId(java.lang.String docContextId)
Sets Document identifier plus highlight regions |
void |
setDocument(Document document)
This Document must come from the original response; it is required, and it must
have a contentId. |
void |
setDocumentSetConstraints(DocumentSetConstraint documentSetConstraints)
Sets document set constraints |
void |
setInput(java.lang.String input)
Sets the original user input |
void |
setKeepingXml(boolean pKeepingXml)
ViewDocument requests always preserve the XML. |
void |
setParserOptions(ParserOptions parserOptions)
Sets text processing options |
void |
setProperty(java.lang.String property)
Instead of a document identifier (contextID), a property-value pair can be used to retrieve a document to view. |
void |
setPropertyValue(java.lang.String propertyValue)
Sets the value of property to use for retrieval |
void |
setRefineConstraints(DocumentSetConstraint pRefineConstraints)
Sets refinement constraints |
void |
setReturn(ViewDocumentRequest.Return pReturn)
Besides returning the source content of an item (with the document type), the ViewDocument request can return the highlight information instead, for situations where the application is rendering the source content outside of ATG Search. |
void |
setSections(java.util.List sections)
Controls which HTML document sections are retrieved |
void |
setURL(java.lang.String URL)
Sets the URL used to retrieve a document to view. |
static ViewDocumentRequest |
valueOf(java.lang.String pRequestXml)
Constructs a new view request from xml. |
Methods inherited from class atg.search.routing.command.SearchEngineRequestImpl |
---|
encodeMapData, isFiringSearchEvents, isKeepingResponseData, isLoggingThisRequest, setFiringSearchEvents, setKeepingResponseData, setLoggingThisRequest |
Methods inherited from class atg.search.routing.command.SearchXMLObject |
---|
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendOptionalValue, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getDefaultXmlBytes, getParentXMLObject, getXmlPath, isPrintedFirstChild, setParentXMLObject, setPrintedFirstChild, toString, toXML, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface atg.search.routing.command.SearchEngineRequest |
---|
toXML |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ViewDocumentRequest()
Method Detail |
---|
public void setKeepingXml(boolean pKeepingXml)
setKeepingXml
in class SearchRequest
pKeepingXml
- ignoredSearchEngineCommandResponse.getSearchEngineResponse()
,
SearchEngineResponse.getXmlResponse()
,
SearchEngineResponse.getXmlResponseDecoded()
public boolean isKeepingXml()
isKeepingXml
in class SearchRequest
public Document getDocument()
public void setDocument(Document document)
Document
must come from the original response; it is required, and it must
have a contentId. If the Document has either DocContextId (getContextInfo) or URL and if the command's values (and property/propertyVal) are null,
the command will use them. This happens at xml-generation time, not when this method is called.
document
- the original document object, the one that is to be viewedDocument.getContentId()
,
Document.getUrl()
,
Document.getContextInfo()
public java.lang.String getInput()
public void setInput(java.lang.String input)
input
- original user inputpublic ParserOptions getParserOptions()
public java.lang.String getDocContextId()
public void setDocContextId(java.lang.String docContextId)
docContextId
- Document identifier plus highlight regionspublic java.lang.String getURL()
public void setURL(java.lang.String URL)
setDocContextId(java.lang.String)
), a simple
URL can be used to retrieve a document.
URL
- Instead of a document identifier (setDocContextId(java.lang.String)
), a simple URL can be used to retrieve a documentpublic java.lang.String getProperty()
public void setProperty(java.lang.String property)
property
- the propertysetPropertyValue(String)
public java.lang.String getPropertyValue()
public void setPropertyValue(java.lang.String propertyValue)
propertyValue
- Value of property to use for retrievalsetProperty(String)
public ViewDocumentRequest.Return getReturn()
public void setReturn(ViewDocumentRequest.Return pReturn)
ViewDocumentRequest.Return
for details.
pReturn
- the return typepublic java.util.List getSections()
ViewDocumentRequest.Section
s
ViewDocumentRequest.Section
public void setSections(java.util.List sections)
sections
- List of ViewDocumentRequest.Section
public void addSection(ViewDocumentRequest.Section section)
section
- a ViewDocumentRequest.Section
to add to the listsetSections(java.util.List)
public void setParserOptions(ParserOptions parserOptions)
parserOptions
- text processing optionspublic DocumentSetConstraint getDocumentSetConstraints()
public void setDocumentSetConstraints(DocumentSetConstraint documentSetConstraints)
documentSetConstraints
- document set constraintspublic DocumentSetConstraint getRefineConstraints()
public void setRefineConstraints(DocumentSetConstraint pRefineConstraints)
pRefineConstraints
- refinement constraintsprotected void getAttributeXML(java.lang.StringBuilder buf) throws atg.search.routing.command.IncompleteCommandException
getAttributeXML
in class atg.search.routing.command.SearchXMLObject
atg.search.routing.command.IncompleteCommandException
protected void getBodyXML(java.lang.StringBuilder buf) throws atg.search.routing.command.IncompleteCommandException
getBodyXML
in class atg.search.routing.command.SearchXMLObject
atg.search.routing.command.IncompleteCommandException
public int getRequestId()
SearchRequest
SearchRequest.QUERY
, SearchRequest.BROWSE
, etc.
getRequestId
in class SearchRequest
public boolean isDecodeOnly()
ViewDocumentRequest.Return.DOCUMENT
means the response should not be parsed. Document responses are usually crappy HTML.
isDecodeOnly
in class SearchRequest
protected SearchResponse processSearchResponse(atg.search.routing.command.SearchEngineResponse response) throws atg.search.routing.command.RoutingCommandException
SearchRequest
processSearchResponse
in class SearchRequest
response
- the engine response
atg.search.routing.command.RoutingCommandException
SearchRequest.processResponse(atg.search.routing.command.SearchEngineResponse)
public static ViewDocumentRequest valueOf(java.lang.String pRequestXml)
pRequestXml
- view request xml
protected static ViewDocumentRequest fromXml(atg.search.routing.utils.SearchMessageParser xml)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |