Package org.opencms.main
Class OpenCmsSolrHandler
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.opencms.main.OpenCmsSolrHandler
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Collection<java.lang.String>
DEFAULT_ALLOWED_WRITE_TO_VALUES
The default allowed wt parameter valuesprotected static java.lang.String
HEADER_REFERER_KEY
A constant for the HTTP 'referer'.java.util.Collection<java.lang.String>
m_allowedWriteTo
The allowed wt parameter valuesstatic java.lang.String
PARAM_BASE_URI
A constant for the optional 'baseUri' parameter.static java.lang.String
PARAM_CORE
A constant for the optional 'core' parameter.static java.lang.String
PARAM_INDEX
A constant for the optional 'index' parameter.
-
Constructor Summary
Constructors Constructor Description OpenCmsSolrHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.java.lang.String[]
getHandlerNames()
Returns the handler name.void
handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.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
initParameters(CmsParameterConfiguration params)
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 Detail
-
PARAM_BASE_URI
public static final java.lang.String PARAM_BASE_URI
A constant for the optional 'baseUri' parameter.- See Also:
- Constant Field Values
-
PARAM_CORE
public static final java.lang.String PARAM_CORE
A constant for the optional 'core' parameter.- See Also:
- Constant Field Values
-
PARAM_INDEX
public static final java.lang.String PARAM_INDEX
A constant for the optional 'index' parameter.- See Also:
- Constant Field Values
-
HEADER_REFERER_KEY
protected static final java.lang.String HEADER_REFERER_KEY
A constant for the HTTP 'referer'.- See Also:
- Constant Field Values
-
DEFAULT_ALLOWED_WRITE_TO_VALUES
public static final java.util.Collection<java.lang.String> DEFAULT_ALLOWED_WRITE_TO_VALUES
The default allowed wt parameter values
-
m_allowedWriteTo
public java.util.Collection<java.lang.String> m_allowedWriteTo
The allowed wt parameter values
-
-
Constructor Detail
-
OpenCmsSolrHandler
public OpenCmsSolrHandler()
-
-
Method Detail
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException
OpenCms servlet main request handling method.- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
java.io.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 java.io.IOException
OpenCms servlet POST request handling method, will just calldoGet(HttpServletRequest, HttpServletResponse)
.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
java.io.IOException
- See Also:
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
getHandlerNames
public java.lang.String[] getHandlerNames()
Description copied from interface:I_CmsRequestHandler
Returns the handler name.- Specified by:
getHandlerNames
in interfaceI_CmsRequestHandler
- Returns:
- the handler name
- See Also:
I_CmsRequestHandler.getHandlerNames()
-
handle
public void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String name) throws java.io.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:
java.io.IOException
- in case an error occurs- See Also:
I_CmsRequestHandler.handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
-
initParameters
public void initParameters(CmsParameterConfiguration params)
Description copied from interface:I_CmsRequestHandler
Initializes parameters.- Specified by:
initParameters
in interfaceI_CmsRequestHandler
- Parameters:
params
- the map of parameters- See Also:
I_CmsRequestHandler.initParameters(org.opencms.configuration.CmsParameterConfiguration)
-
getCmsObject
protected CmsObject getCmsObject(javax.servlet.http.HttpServletRequest req) throws CmsException
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, java.lang.Exception, CmsSearchException, java.io.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 wrongjava.lang.Exception
- if something goes wrongCmsSearchException
- if something goes wrongjava.io.IOException
- if something goes wrong
-
-