|
Regain 1.7.7-STABLE API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.regain.search.SearchToolkit
public class SearchToolkit
A toolkit for the search JSPs containing helper methods.
| Field Summary | |
|---|---|
private static String |
FIELD_PREFIX
The prefix for request parameters that contain additional field values. |
private static String |
FIELD_PREFIX_NOSTRING
The prefix for request parameters that contain additional field values that is not a string. |
private static String |
INDEX_CONFIG_CONTEXT_ARRAY_ATTR_NAME
The name of the page context attribute that holds the IndexConfig array. |
private static SearchConfig |
mConfig
The configuration of the search mask. |
private static HashMap |
mMimeTypeHash
Holds for an extension the mime type. |
private static String |
SEARCH_QUERY_CONTEXT_ATTR_NAME
The name of the page context attribute that holds the search query. |
private static String |
SEARCH_RESULTS_ATTR_NAME
The name of the page context attribute that holds the SearchResults. |
| Constructor Summary | |
|---|---|
SearchToolkit()
|
|
| Method Summary | |
|---|---|
static boolean |
allowFileAccess(PageRequest request,
String fileUrl)
Decides whether the remote access to a file should be allowed. |
static String |
extractFileUrl(String requestPath,
String encoding)
Extracts the file URL from a request path. |
static IndexConfig[] |
getAllIndexConfigArr(PageRequest request)
Gets the IndexConfig array from the configurationn. |
static IndexConfig[] |
getIndexConfigArr(PageRequest request)
Gets the IndexConfig array from the PageContext. |
static IndexConfig[] |
getIndexConfigArrWithParent(PageRequest request)
Gets the IndexConfig array from the PageContext. |
static String |
getSearchQuery(PageRequest request)
Gets the search query. |
static SearchResults |
getSearchResults(PageRequest request)
Gets the SearchResults from the PageContext. |
private static void |
loadConfiguration(PageRequest request)
Loads the configuration of the search mask. |
static void |
sendFile(PageRequest request,
PageResponse response,
File file)
Sends a file to the client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String SEARCH_QUERY_CONTEXT_ATTR_NAME
private static final String SEARCH_RESULTS_ATTR_NAME
private static final String INDEX_CONFIG_CONTEXT_ARRAY_ATTR_NAME
private static final String FIELD_PREFIX
private static final String FIELD_PREFIX_NOSTRING
private static SearchConfig mConfig
private static HashMap mMimeTypeHash
| Constructor Detail |
|---|
public SearchToolkit()
| Method Detail |
|---|
public static IndexConfig[] getIndexConfigArr(PageRequest request)
throws RegainException
If there is no IndexConfig array in the PageContext it is put in the PageContext, so the next call will find it.
request - The page request where the IndexConfig array will be taken
from or put to.
RegainException - If there is no IndexConfig for the specified index.
public static IndexConfig[] getIndexConfigArrWithParent(PageRequest request)
throws RegainException
If there is no IndexConfig array in the PageContext it is put in the PageContext, so the next call will find it.
request - The page request where the IndexConfig array will be taken
from or put to.
RegainException - If there is no IndexConfig for the specified index.
public static IndexConfig[] getAllIndexConfigArr(PageRequest request)
throws RegainException
RegainException - If there is no IndexConfig for the specified index.
public static String getSearchQuery(PageRequest request)
throws RegainException
request - The request to get the query from.
RegainException - If getting the query failed.
public static SearchResults getSearchResults(PageRequest request)
throws RegainException
If there is no SearchResults in the PageContext it is created and put in the PageContext, so the next call will find it.
request - The page request where the SearchResults will be taken
from or put to.
RegainException - If the SearchResults could not be created.SearchResults
public static String extractFileUrl(String requestPath,
String encoding)
throws RegainException
requestPath - The request path to extract the file URL from.encoding - The encoding to use for the URL-docoding of the requestPath.
RegainException - If extracting the file URL failed.LinkTag
public static boolean allowFileAccess(PageRequest request,
String fileUrl)
throws RegainException
The access is granted if the file is in the index. The access is never granted for indexes that have an access controller.
request - The request that holds the used index.fileUrl - The URL to file to check.
RegainException - If checking the file failed.
public static void sendFile(PageRequest request,
PageResponse response,
File file)
throws RegainException
request - The request.response - The response.file - The file to send.
RegainException - If sending the file failed.
private static void loadConfiguration(PageRequest request)
throws RegainException
If the configuration is already loaded, nothing is done.
request - The page request. Used to get the "configFile" init
parameter, which holds the name of the configuration file.
RegainException - If loading failed.
|
Regain 1.7.7-STABLE API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||