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
SearchComponent
for debugging.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__VALUE_TO_DISPLAY_FOR_HIDDEN_PARAMETERS
private com.google.gson.Gson
_gson
private int
_part
private 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 String
appendDebugRequestParameters(String url, SearchComponentArguments args)
void
configure(Configuration configuration)
void
execute(SearchComponentArguments args)
Executes the component.void
initialize()
int
priority()
Get the priority of the component.void
service(ServiceManager manager)
boolean
supports(SearchComponentArguments args)
Returnstrue
if 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:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in 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:SearchComponent
Get the priority of the component. The lowest one will be executed first, and so on.- Specified by:
priority
in interfaceSearchComponent
- Returns:
- the priority of the component
-
supports
public boolean supports(SearchComponentArguments args)
Description copied from interface:SearchComponent
Returnstrue
if the component must beexecuted
.- Specified by:
supports
in interfaceSearchComponent
- Parameters:
args
- the arguments- Returns:
true
if the component must beexecuted
.
-
appendDebugRequestParameters
static String appendDebugRequestParameters(String url, SearchComponentArguments args)
-
execute
public void execute(SearchComponentArguments args) throws Exception
Description copied from interface:SearchComponent
Executes the component.- Specified by:
execute
in 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
-
-