Package org.opencms.main
Class OpenCmsSolrHandler
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.opencms.main.OpenCmsSolrHandler
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,I_CmsRequestHandler
public class OpenCmsSolrHandler
extends javax.servlet.http.HttpServlet
implements I_CmsRequestHandler
The OpenCms Solr handler.
Reachable under: "/opencms/opencms/handleSolrSelect".
Usage example:
http://localhost:8080/opencms/opencms/handleSolrSelect?fq=parent-folders:/sites/+type=v8article&fl=path&rows=10&sort=path%20asc
- Since:
- 8.5.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Collection<String>
The default allowed wt parameter valuesprotected static final String
A constant for the HTTP 'referer'.The allowed wt parameter valuesstatic final String
A constant for the optional 'baseUri' parameter.static final String
A constant for the optional 'core' parameter.static final String
A constant for the optional 'index' parameter. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doGet
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) OpenCms servlet main request handling method.void
doPost
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) OpenCms servlet POST request handling method, will just calldoGet(HttpServletRequest, HttpServletResponse)
.protected CmsObject
getCmsObject
(javax.servlet.http.HttpServletRequest req) Returns the CMS object.String[]
Returns the handler name.void
handle
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String name) Handles an OpenCms request.protected org.opencms.main.OpenCmsSolrHandler.Context
initializeRequest
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Initialized the search request and sets the local parameter.void
Initializes parameters.Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.main.I_CmsRequestHandler
getConfiguration
-
Field Details
-
PARAM_BASE_URI
A constant for the optional 'baseUri' parameter.- See Also:
-
PARAM_CORE
A constant for the optional 'core' parameter.- See Also:
-
PARAM_INDEX
A constant for the optional 'index' parameter.- See Also:
-
HEADER_REFERER_KEY
A constant for the HTTP 'referer'.- See Also:
-
DEFAULT_ALLOWED_WRITE_TO_VALUES
The default allowed wt parameter values -
m_allowedWriteTo
The allowed wt parameter values
-
-
Constructor Details
-
OpenCmsSolrHandler
public OpenCmsSolrHandler()
-
-
Method Details
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException OpenCms servlet main request handling method.- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
IOException
- See Also:
-
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException OpenCms servlet POST request handling method, will just calldoGet(HttpServletRequest, HttpServletResponse)
.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
IOException
- See Also:
-
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
getHandlerNames
Description copied from interface:I_CmsRequestHandler
Returns the handler name.- Specified by:
getHandlerNames
in interfaceI_CmsRequestHandler
- Returns:
- the handler name
- See Also:
-
handle
public void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String name) throws IOException Description copied from interface:I_CmsRequestHandler
Handles an OpenCms request.- Specified by:
handle
in interfaceI_CmsRequestHandler
- Parameters:
req
- the current requestres
- the current responsename
- the handler name to invoke- Throws:
IOException
- in case an error occurs- See Also:
-
initParameters
Description copied from interface:I_CmsRequestHandler
Initializes parameters.- Specified by:
initParameters
in interfaceI_CmsRequestHandler
- Parameters:
params
- the map of parameters- See Also:
-
getCmsObject
Returns the CMS object.- Parameters:
req
- the request- Returns:
- the CMS object
- Throws:
CmsException
- if something goes wrong
-
initializeRequest
protected org.opencms.main.OpenCmsSolrHandler.Context initializeRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsException, Exception, CmsSearchException, IOException Initialized the search request and sets the local parameter.- Parameters:
req
- the servlet requestres
- the servlet response- Returns:
- the generated context
- Throws:
CmsException
- if something goes wrongException
- if something goes wrongCmsSearchException
- if something goes wrongIOException
- if something goes wrong
-