org.ow2.weblab.portlet
Class AdvancedSearchPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.ow2.weblab.portlet.WebLabPortlet
          extended by org.ow2.weblab.portlet.AdvancedSearchPortlet
All Implemented Interfaces:
javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet

public class AdvancedSearchPortlet
extends WebLabPortlet

Portlet used to generate text requests. When request is submitted, a RequestEvent (request and service definition) is sent. Portlet allow modification by user of the searcher service URL to call.

Author:
emilien, nbureau

Field Summary
protected static AdvancedSearchConfigBean advanced_search_conf
           
protected static java.lang.String DEFAULT_SYNTAX_NAME
           
static java.lang.String DISPLAY_CHECKING_POPUP
           
protected static int distinct_submit_query
           
static java.lang.String ENABLE_ADVANCED_SEARCH
           
static java.lang.String ENABLE_GENERATE
           
static java.lang.String ENABLE_SAVE
           
static java.lang.String ESB_CONFIG_NAME
           
static java.lang.String LAST_SEARCH_SERVICE
           
static java.lang.String LAST_TEXT_KEYWORDS_INPUT
           
static java.lang.String NATIVE_SYNTAX
           
static java.lang.String NATIVE_SYNTAX_DISPLAYED
           
static java.lang.String QUERY_INPUT
           
static java.lang.String SEARCH_ERROR
           
static java.lang.String SEARCH_SERVICE
           
static java.lang.String SEARCH_SERVICES_MAP
           
protected static java.net.URL SEARCHER_WSDL_LOCATION
           
protected static java.util.Map<java.lang.String,org.ow2.weblab.core.services.Searcher> searchers
           
static java.lang.String SUBMIT_INPUT
           
static java.lang.String TEXT_KEYWORDS_INPUT
           
protected static java.util.Map<java.lang.String,org.ow2.weblab.core.services.Analyser> translators
           
protected static java.util.Map<java.lang.String,java.lang.String> usageContexts
           
protected static boolean USE_REDIRECTION
           
static java.lang.String USER_ESB_CONF
           
static java.lang.String USER_LAST_SEARCH
           
 
Fields inherited from class org.ow2.weblab.portlet.WebLabPortlet
PORTLET_ACTION_NAMESPACE, PORTLET_REACTION_NAMESPACE, PORTLET_REDIRECT_NAMESPACE
 
Constructor Summary
AdvancedSearchPortlet()
           
 
Method Summary
 void destroy()
           
 void doEdit(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res)
           
protected  void doSave(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res, org.ow2.weblab.core.model.StringQuery q)
          Send the received query in a "saveQuery" event.
protected  void doSearch(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res, org.ow2.weblab.core.model.StringQuery q)
          Sending query to search engine
 void doView(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res)
          Render HTML corresponding to the view mode
protected static java.lang.String generateQuery(java.lang.String textQuery, java.util.List<AdvancedSearchFieldBean> advancedSearchFieldList)
          To generate the query from a search field list
protected static java.util.List<AdvancedSearchFieldBean> getFieldListFromParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
          to get the search fields
 void init()
           
protected  org.ow2.weblab.core.services.searcher.SearchReturn launchQuery(javax.portlet.PortletRequest req, javax.portlet.PortletResponse res, org.ow2.weblab.core.services.searcher.SearchArgs args)
          Launch the query to the selected Searcher
 void processAction(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res)
           
 void processEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response)
           
 void serveResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
           
 
Methods inherited from class org.ow2.weblab.portlet.WebLabPortlet
addRedirection, deleteRedirection, getActionEventMap, getFile, getReaction, getReactionEventMap, getRedirectEventMap, getURL, modifyRedirection, sendEventForAction, sendEventForAction, sendEventForActionAndRedirect
 
Methods inherited from class javax.portlet.GenericPortlet
doDispatch, doHeaders, doHelp, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SYNTAX_NAME

protected static final java.lang.String DEFAULT_SYNTAX_NAME
See Also:
Constant Field Values

ENABLE_ADVANCED_SEARCH

public static java.lang.String ENABLE_ADVANCED_SEARCH

ENABLE_SAVE

public static java.lang.String ENABLE_SAVE

ENABLE_GENERATE

public static java.lang.String ENABLE_GENERATE

TEXT_KEYWORDS_INPUT

public static java.lang.String TEXT_KEYWORDS_INPUT

LAST_TEXT_KEYWORDS_INPUT

public static java.lang.String LAST_TEXT_KEYWORDS_INPUT

QUERY_INPUT

public static java.lang.String QUERY_INPUT

SUBMIT_INPUT

public static java.lang.String SUBMIT_INPUT

USER_LAST_SEARCH

public static java.lang.String USER_LAST_SEARCH

USER_ESB_CONF

public static java.lang.String USER_ESB_CONF

SEARCH_ERROR

public static java.lang.String SEARCH_ERROR

ESB_CONFIG_NAME

public static java.lang.String ESB_CONFIG_NAME

SEARCH_SERVICES_MAP

public static java.lang.String SEARCH_SERVICES_MAP

DISPLAY_CHECKING_POPUP

public static java.lang.String DISPLAY_CHECKING_POPUP

SEARCH_SERVICE

public static java.lang.String SEARCH_SERVICE

LAST_SEARCH_SERVICE

public static java.lang.String LAST_SEARCH_SERVICE

NATIVE_SYNTAX

public static java.lang.String NATIVE_SYNTAX

NATIVE_SYNTAX_DISPLAYED

public static java.lang.String NATIVE_SYNTAX_DISPLAYED

advanced_search_conf

protected static AdvancedSearchConfigBean advanced_search_conf

SEARCHER_WSDL_LOCATION

protected static java.net.URL SEARCHER_WSDL_LOCATION

searchers

protected static java.util.Map<java.lang.String,org.ow2.weblab.core.services.Searcher> searchers

translators

protected static java.util.Map<java.lang.String,org.ow2.weblab.core.services.Analyser> translators

usageContexts

protected static java.util.Map<java.lang.String,java.lang.String> usageContexts

distinct_submit_query

protected static int distinct_submit_query

USE_REDIRECTION

protected static boolean USE_REDIRECTION
Constructor Detail

AdvancedSearchPortlet

public AdvancedSearchPortlet()
Method Detail

init

public void init()
          throws javax.portlet.PortletException
Overrides:
init in class WebLabPortlet
Throws:
javax.portlet.PortletException

destroy

public void destroy()
Specified by:
destroy in interface javax.portlet.Portlet
Overrides:
destroy in class javax.portlet.GenericPortlet

doView

public void doView(javax.portlet.RenderRequest req,
                   javax.portlet.RenderResponse res)
            throws java.io.IOException,
                   javax.portlet.PortletException
Render HTML corresponding to the view mode

Overrides:
doView in class javax.portlet.GenericPortlet
Throws:
java.io.IOException
javax.portlet.PortletException

doEdit

public void doEdit(javax.portlet.RenderRequest req,
                   javax.portlet.RenderResponse res)
            throws javax.portlet.PortletException,
                   java.io.IOException
Overrides:
doEdit in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

processAction

public void processAction(javax.portlet.ActionRequest req,
                          javax.portlet.ActionResponse res)
                   throws java.io.IOException,
                          javax.portlet.PortletException
Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class javax.portlet.GenericPortlet
Throws:
java.io.IOException
javax.portlet.PortletException

serveResource

public void serveResource(javax.portlet.ResourceRequest request,
                          javax.portlet.ResourceResponse response)
                   throws javax.portlet.PortletException,
                          java.io.IOException
Specified by:
serveResource in interface javax.portlet.ResourceServingPortlet
Overrides:
serveResource in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

processEvent

public void processEvent(javax.portlet.EventRequest request,
                         javax.portlet.EventResponse response)
                  throws javax.portlet.PortletException,
                         java.io.IOException
Specified by:
processEvent in interface javax.portlet.EventPortlet
Overrides:
processEvent in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

doSave

protected void doSave(javax.portlet.ActionRequest req,
                      javax.portlet.ActionResponse res,
                      org.ow2.weblab.core.model.StringQuery q)
Send the received query in a "saveQuery" event.

Parameters:
req -
res -
q -

doSearch

protected void doSearch(javax.portlet.ActionRequest req,
                        javax.portlet.ActionResponse res,
                        org.ow2.weblab.core.model.StringQuery q)
Sending query to search engine

Parameters:
req -
res -
q -

launchQuery

protected org.ow2.weblab.core.services.searcher.SearchReturn launchQuery(javax.portlet.PortletRequest req,
                                                                         javax.portlet.PortletResponse res,
                                                                         org.ow2.weblab.core.services.searcher.SearchArgs args)
                                                                  throws javax.portlet.PortletException
Launch the query to the selected Searcher

Parameters:
req -
res -
q -
Throws:
javax.portlet.PortletException

getFieldListFromParameters

protected static java.util.List<AdvancedSearchFieldBean> getFieldListFromParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
to get the search fields


generateQuery

protected static java.lang.String generateQuery(java.lang.String textQuery,
                                                java.util.List<AdvancedSearchFieldBean> advancedSearchFieldList)
To generate the query from a search field list

Parameters:
textQuery -
advancedSearchFieldList -
Returns:


Copyright © 2004-2012. All Rights Reserved.