Class DebugSearchComponent
- java.lang.Object
-
- org.ametys.web.frontoffice.search.requesttime.impl.DebugSearchComponent
-
- All Implemented Interfaces:
SearchComponent,Initializable,Configurable,Serviceable
public class DebugSearchComponent extends Object implements SearchComponent, Configurable, Serviceable, Initializable
SearchComponentfor debugging.
-
-
Field Summary
Fields Modifier and Type Field Description private static String__VALUE_TO_DISPLAY_FOR_HIDDEN_PARAMETERSprivate com.google.gson.Gson_gsonprivate int_partprivate AmetysObjectResolver_resolver-
Fields inherited from interface org.ametys.web.frontoffice.search.requesttime.SearchComponent
DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description DebugSearchComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_createGson()private static com.google.gson.ExclusionStrategy_exclusionStrategy()private void_executePart1(SearchComponentArguments args)private void_executePart2(SearchComponentArguments args)private boolean_mustSaxDebug(SearchComponentArguments args)private String_parameterValueToString(Object value, ModelItemType type)private String_prettifyJson(String input, org.slf4j.Logger logger)private static com.google.gson.GsonBuilder_registerTypeAdapters(com.google.gson.GsonBuilder gsonBuilder)private void_saxDebug(SearchComponentArguments args)private void_saxDebugMap(ContentHandler contentHandler, Optional<SearchResults<AmetysObject>> results)private void_saxSearchServiceInstance(ContentHandler contentHandler, SearchServiceInstance searchServiceInstance)private void_saxServiceParameters(org.slf4j.Logger logger, ContentHandler contentHandler, SearchService service, ModelAwareDataHolder serviceParameters)private void_saxUserCriteria(ContentHandler contentHandler, Map<String,Object> userCriteria)private boolean_seemsLikeJson(String input)private void_setSolrDebug(SearcherFactory.Searcher searcher)(package private) static StringappendDebugRequestParameters(String url, SearchComponentArguments args)voidconfigure(Configuration configuration)voidexecute(SearchComponentArguments args)Executes the component.voidinitialize()intpriority()Get the priority of the component.voidservice(ServiceManager manager)booleansupports(SearchComponentArguments args)Returnstrueif the component must beexecuted.
-
-
-
Field Detail
-
__VALUE_TO_DISPLAY_FOR_HIDDEN_PARAMETERS
private static final String __VALUE_TO_DISPLAY_FOR_HIDDEN_PARAMETERS
- See Also:
- Constant Field Values
-
_part
private int _part
-
_resolver
private AmetysObjectResolver _resolver
-
_gson
private com.google.gson.Gson _gson
-
-
Constructor Detail
-
DebugSearchComponent
public DebugSearchComponent()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
_createGson
private void _createGson()
-
_exclusionStrategy
private static com.google.gson.ExclusionStrategy _exclusionStrategy()
-
_registerTypeAdapters
private static com.google.gson.GsonBuilder _registerTypeAdapters(com.google.gson.GsonBuilder gsonBuilder)
-
priority
public int priority()
Description copied from interface:SearchComponentGet the priority of the component. The lowest one will be executed first, and so on.- Specified by:
priorityin interfaceSearchComponent- Returns:
- the priority of the component
-
supports
public boolean supports(SearchComponentArguments args)
Description copied from interface:SearchComponentReturnstrueif the component must beexecuted.- Specified by:
supportsin interfaceSearchComponent- Parameters:
args- the arguments- Returns:
trueif the component must beexecuted.
-
appendDebugRequestParameters
static String appendDebugRequestParameters(String url, SearchComponentArguments args)
-
execute
public void execute(SearchComponentArguments args) throws Exception
Description copied from interface:SearchComponentExecutes the component.- Specified by:
executein interfaceSearchComponent- Parameters:
args- the arguments- Throws:
Exception- if an exception occurs. Other search components will be attempted to be executed
-
_executePart1
private void _executePart1(SearchComponentArguments args)
-
_executePart2
private void _executePart2(SearchComponentArguments args) throws Exception
- Throws:
Exception
-
_setSolrDebug
private void _setSolrDebug(SearcherFactory.Searcher searcher)
-
_mustSaxDebug
private boolean _mustSaxDebug(SearchComponentArguments args)
-
_saxDebug
private void _saxDebug(SearchComponentArguments args) throws Exception
- Throws:
Exception
-
_saxServiceParameters
private void _saxServiceParameters(org.slf4j.Logger logger, ContentHandler contentHandler, SearchService service, ModelAwareDataHolder serviceParameters) throws Exception
- Throws:
Exception
-
_parameterValueToString
private String _parameterValueToString(Object value, ModelItemType type)
-
_prettifyJson
private String _prettifyJson(String input, org.slf4j.Logger logger)
-
_seemsLikeJson
private boolean _seemsLikeJson(String input)
-
_saxSearchServiceInstance
private void _saxSearchServiceInstance(ContentHandler contentHandler, SearchServiceInstance searchServiceInstance) throws Exception
- Throws:
Exception
-
_saxUserCriteria
private void _saxUserCriteria(ContentHandler contentHandler, Map<String,Object> userCriteria) throws Exception
- Throws:
Exception
-
_saxDebugMap
private void _saxDebugMap(ContentHandler contentHandler, Optional<SearchResults<AmetysObject>> results) throws Exception
- Throws:
Exception
-
-