org.opencms.main
Class OpenCmsSolrHandler

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by 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
static java.lang.String HANDLER_NAME_SOLR_SELECT
          The Solr select handler.
protected static java.lang.String HEADER_REFERER_KEY
          A constant for the HTTP 'referer'.
static 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
OpenCmsSolrHandler()
           
 
Method Summary
 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 call doGet(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  void initializeRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Initialized the search request and sets the local parameter.
 
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
 

Field Detail

HANDLER_NAME_SOLR_SELECT

public static final java.lang.String HANDLER_NAME_SOLR_SELECT
The Solr select handler.

See Also:
Constant Field Values

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
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 class javax.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 call doGet(HttpServletRequest, HttpServletResponse).

Overrides:
doPost in class javax.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 interface I_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 interface I_CmsRequestHandler
Parameters:
req - the current request
res - the current response
name - 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)

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 void 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 request
res - the servlet response
Throws:
CmsException - if something goes wrong
java.lang.Exception - if something goes wrong
CmsSearchException - if something goes wrong
java.io.IOException - if something goes wrong