| |
|
| java.lang.Object com.sun.portal.search.demo.Search com.sun.portal.search.providers.SearchContext
SearchContext | public class SearchContext extends Search (Code) | | This class provides convenient methods to handle advanced search and
also evolved from the frontend application requirements.
See Also: com.sun.portal.search.demo.Search |
Method Summary | |
public void | execute() Executes the query
Calls the parent doQuery() method after doing some preprocessing to the
query string. | public String | getCategory() Gets the value of category
The category value is used to create the scope value in the
execute() method.
The scope and the category are combined together based
on the type of request. | public int | getPage() | public int | getTotalPages() Gets the total pages
Calculated based on the hitCount and viewHits. | public static String | htmlEncode(String s) | public void | setCategory(String bc) Sets the category value. | public void | setPage(int p) Sets the current page value. | public void | setScope(ArrayList c) Sets the list of criteria for the scope. | public void | setSearchAllCategories(boolean all) Sets the searchAllCategories property. |
ALL | final public static String ALL(Code) | | corresponds to <ALL> string operation
|
ANY | final public static String ANY(Code) | | corresponds to <OR> operation
|
CONTAIN | final public static String CONTAIN(Code) | | corresponds to <CONTAINS> operation
|
EQUAL | final public static String EQUAL(Code) | | corresponds to '=' operation used to compare number type
|
EXACT | final public static String EXACT(Code) | | corresponds to <EXACT> string operation
|
GREATER | final public static String GREATER(Code) | | corresponds to '>' operation used to compare number type
|
LESS | final public static String LESS(Code) | | corresponds to '<' operation used to compare number type
|
NOT | final public static String NOT(Code) | | corresponds to <NOT> operation
|
NOTCONTAIN | final public static String NOTCONTAIN(Code) | | corresponds to <NOT> <CONTAINS> operation
|
NOTEQUAL | final public static String NOTEQUAL(Code) | | corresponds to 'not equal to' operation used to compare number type
|
OPERATION | final public static String OPERATION(Code) | | The operation in a list element
|
PASSAGE | final public static String PASSAGE(Code) | | corresponds to <PASSAGE> string operation
|
VALUE | final public static String VALUE(Code) | | The right operand in a list element
|
SearchContext | public SearchContext()(Code) | | Public Constructor
calls super()
|
execute | public void execute() throws Exception(Code) | | Executes the query
Calls the parent doQuery() method after doing some preprocessing to the
query string. Merges category, searchAllCategories, scope string into a final scope
string.
exception: Exception - is thrown if any of the input parameters are not specified or if the resultset is null or if connection to the search server failed |
getCategory | public String getCategory()(Code) | | Gets the value of category
The category value is used to create the scope value in the
execute() method.
The scope and the category are combined together based
on the type of request. taxonomy-request v/s rd-request
The current category value See Also: SearchContext.setSearchAllCategories(boolean) |
getPage | public int getPage()(Code) | | Gets the current page value
the current page value |
getTotalPages | public int getTotalPages()(Code) | | Gets the total pages
Calculated based on the hitCount and viewHits.
totalPages has no value if called before calling
execute() first
total pages |
htmlEncode | public static String htmlEncode(String s)(Code) | | Encodes > <, ", & characters
Parameters: s - string that needs to be html encoded |
setPage | public void setPage(int p)(Code) | | Sets the current page value.
firstHit for searches is calculated based on the current
page and viewHits.
Parameters: page - is the current page value |
setScope | public void setScope(ArrayList c)(Code) | | Sets the list of criteria for the scope.
Advanced search related methods.The list should have specific operands,
operations and values. The list is then internally converted to a String
query as per the search engine query language.
Parameters: c - criteria list for the search query |
setSearchAllCategories | public void setSearchAllCategories(boolean all)(Code) | | Sets the searchAllCategories property.
This property value is used in the execute() to create the scope
Parameters: all - true implies that search should be in all the cateogories and false means that search should be within a specific category |
|
|
|