atg.search.routing.command.search
Class CategorizeRequest

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      extended by atg.search.routing.command.SearchEngineRequestImpl
          extended by atg.search.routing.command.search.SearchRequest
              extended by atg.search.routing.command.search.CategorizeRequest
All Implemented Interfaces:
atg.search.routing.command.SearchEngineRequest, java.io.Serializable

public class CategorizeRequest
extends SearchRequest

The Categorize request contains text content to categorize using the same categorization algorithm as indexed content and queries. The content can be in several forms:

The reason why there is a separate question type is that there are differences in natural language processing of user queries and document-type content. Required: Input setInput(java.lang.String)

Optional: Everything else

See Also:
Serialized Form

Nested Class Summary
static class CategorizeRequest.CategorizeInputMode
          The mode value can be one of four values.
static class CategorizeRequest.Response
          Response type for CategorizeRequest
 
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
CategorizeRequest()
           
 
Method Summary
protected  SearchResponse doMerge(java.util.List<SearchResponse> pParsedResponses)
          merges the responses
protected static CategorizeRequest fromXml(atg.search.routing.utils.SearchMessageParser xml, SearchRequest compRequest)
          Constructs a new request given an initialized parser
protected  void getAttributeXML(java.lang.StringBuilder buf)
           
protected  void getBodyXML(java.lang.StringBuilder buf)
           
 DocumentSetConstraint getDocumentSetConstraints()
           
 java.lang.String getInput()
           
 CategorizeRequest.CategorizeInputMode getInputMode()
          Returns the input mode
 ParserOptions getParserOptions()
           
 java.lang.Boolean getPrune()
          Returns whether categorization pruning is performed
 DocumentSetConstraint getRefineConstraints()
           
 int getRequestId()
          This identifies the type of request, one of SearchRequest.QUERY, SearchRequest.BROWSE, etc.
protected  SearchResponse processSearchResponse(atg.search.routing.command.SearchEngineResponse response)
          Constructs a new response from the engine's response
 void setDocumentSetConstraints(DocumentSetConstraint documentSetConstraints)
           
 void setInput(java.lang.String input)
           
 void setInputMode(CategorizeRequest.CategorizeInputMode inputMode)
          Sets the input mode.
 void setParserOptions(ParserOptions parserOptions)
           
 void setPrune(java.lang.Boolean prune)
          Sets whether categorization pruning is performed
 void setRefineConstraints(DocumentSetConstraint pRefineConstraints)
           
static CategorizeRequest valueOf(java.lang.String pRequestXml)
          Constructs a new request from an xml string
static CategorizeRequest valueOf(java.lang.String pRequestXml, SearchRequest compRequest)
          Converts an xml string into a CategorizeRequest
 
Methods inherited from class atg.search.routing.command.search.SearchRequest
fillDynamicTargets, fillDynamicTargetSpecifier, fromXml, getAllAttributeXML, getAllBodyXML, getAssociatedRequestIdentifier, getContentLabels, getContentLabelsArray, getDebug, getDynamicTargetSpecifier, getExcludeLogicalPartitionNames, getLastResponse, getListableProperties, getListablePropertiesString, getLogicalPartitionNames, getLogicalPartitionsArray, getMaximumResults, getMergeSettings, getPreviousRequestChainToken, getRequestAttribute, getRequestAttributes, getRequestChainToken, getRequestIdentifier, getRequestTag, getRequestTime, getRespForm, getSearchEnvironmentName, getSearchTargetNames, getSiteConstraints, getSiteId, getSleepTimeMs, getTargetType, getTimeLimitMs, getUserAgent, getVersion, isCacheable, isDecodeOnly, isGeneratingXml, isKeepingXml, isListPropertyAllowed, isLocalMergeDebugEnabled, isLocalMergeDebugReady, isLocalMergeEnabled, isMultiPartitionSearch, isMultiSearchSession, isPagingRequest, isSaveRequest, merge, processResponse, setAssociatedRequestIdentifier, setCacheable, setContentLabels, setContentLabelsArray, setContentLabelsString, setDebug, setDynamicTargetSpecifier, setExcludeLogicalPartitionNames, setGeneratingXml, setKeepingXml, setLastResponse, setListableProperties, setListablePropertiesString, setListPropertyAllowed, setLocalMergeDebugEnabled, setLocalMergeDebugReady, setLocalMergeEnabled, setLogicalPartitionNames, setLogicalPartitionsArray, setMaximumResults, setMergeSettings, setMultiPartitionSearch, setMultiSearchSession, setPagingRequest, setPhysicalPartitionId, setPreviousRequestChainToken, setRequestAttribute, setRequestAttributes, setRequestChainToken, setRequestIdentifier, setRequestTime, setRespForm, setSaveRequest, setSearchEnvironmentName, setSiteConstraints, setSiteId, setSleepTimeMs, setTargetType, setTimeLimitMs, setUserAgent, setVersion
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CategorizeRequest

public CategorizeRequest()
Method Detail

getInput

public java.lang.String getInput()
Returns:
Input to categorization, depending on the mode. A question mode means the input is a simple query text. A document mode means the input is a file pathname. A xhtml mode means the input is a XHTML structured document text. And a text mode means that the input is simple text.

setInput

public void setInput(java.lang.String input)
Parameters:
input - Input to categorization, depending on the mode. A question mode means the input is a simple query text. A document mode means the input is a file pathname. A xhtml mode means the input is a XHTML structured document text. And a text mode means that the input is simple text.

getParserOptions

public ParserOptions getParserOptions()
Returns:
text processing options

setParserOptions

public void setParserOptions(ParserOptions parserOptions)
Parameters:
parserOptions - text processing options

getDocumentSetConstraints

public DocumentSetConstraint getDocumentSetConstraints()
Returns:
document set constraints

setDocumentSetConstraints

public void setDocumentSetConstraints(DocumentSetConstraint documentSetConstraints)
Parameters:
documentSetConstraints - document set constraints

getRefineConstraints

public DocumentSetConstraint getRefineConstraints()
Returns:
document set constraints

setRefineConstraints

public void setRefineConstraints(DocumentSetConstraint pRefineConstraints)
Parameters:
pRefineConstraints - document set constraints

getInputMode

public CategorizeRequest.CategorizeInputMode getInputMode()
Returns the input mode

Returns:
input mode

setInputMode

public void setInputMode(CategorizeRequest.CategorizeInputMode inputMode)
Sets the input mode.

Parameters:
inputMode - the mode

getPrune

public java.lang.Boolean getPrune()
Returns whether categorization pruning is performed

Returns:
Whether categorization pruning is performed

setPrune

public void setPrune(java.lang.Boolean prune)
Sets whether categorization pruning is performed

Parameters:
prune - Whether categorization pruning is performed

getAttributeXML

protected void getAttributeXML(java.lang.StringBuilder buf)
                        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 buf)
                   throws atg.search.routing.command.IncompleteCommandException
Overrides:
getBodyXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

getRequestId

public int getRequestId()
Description copied from class: SearchRequest
This identifies the type of request, one of SearchRequest.QUERY, SearchRequest.BROWSE, etc.

Specified by:
getRequestId in class SearchRequest
Returns:
id for this request

processSearchResponse

protected SearchResponse processSearchResponse(atg.search.routing.command.SearchEngineResponse response)
                                        throws atg.search.routing.command.RoutingCommandException
Constructs a new response from the engine's response

Overrides:
processSearchResponse in class SearchRequest
Parameters:
response - engine response
Returns:
and new response
Throws:
atg.search.routing.command.RoutingCommandException
See Also:
SearchRequest.processResponse(atg.search.routing.command.SearchEngineResponse)

doMerge

protected SearchResponse doMerge(java.util.List<SearchResponse> pParsedResponses)
                          throws atg.search.routing.MergeException
merges the responses

Overrides:
doMerge in class SearchRequest
Parameters:
pParsedResponses -
Returns:
merged response
Throws:
atg.search.routing.MergeException

valueOf

public static CategorizeRequest valueOf(java.lang.String pRequestXml)
Constructs a new request from an xml string

Parameters:
pRequestXml - categorization request xml
Returns:
a new CategorizeRequest instance

valueOf

public static CategorizeRequest valueOf(java.lang.String pRequestXml,
                                        SearchRequest compRequest)
Converts an xml string into a CategorizeRequest

Parameters:
pRequestXml - categorize xml
compRequest - an existing (categorize) request object to combine with the provide xml, typically initalized as a nucleus component
Returns:
a categorize request, or null if the string is empty

fromXml

protected static CategorizeRequest fromXml(atg.search.routing.utils.SearchMessageParser xml,
                                           SearchRequest compRequest)
Constructs a new request given an initialized parser

Parameters:
xml -
Returns: