Class AbstractSolrFacetConfigAdminWebScript
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractWebScript
-
- org.springframework.extensions.webscripts.DeclarativeWebScript
-
- org.alfresco.repo.web.scripts.facet.AbstractSolrFacetConfigAdminWebScript
-
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
- Direct Known Subclasses:
FacetablePropertiesGet,SolrFacetConfigAdminDelete,SolrFacetConfigAdminGet,SolrFacetConfigAdminPost,SolrFacetConfigAdminPut
public abstract class AbstractSolrFacetConfigAdminWebScript extends org.springframework.extensions.webscripts.DeclarativeWebScriptThis class is an abstract base class for the various web script controllers in the SolrFacetService.- Author:
- Jamal Kaabi-Mofrad
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCUSTOM_PARAM_NAMEprotected static StringCUSTOM_PARAM_VALUEprotected org.alfresco.repo.search.impl.solr.facet.SolrFacetServicefacetServiceprotected static PatternFILTER_ID_PATTERNprotected org.alfresco.service.namespace.NamespaceServicenamespaceServiceprotected static StringPARAM_CUSTOM_PROPERTIESprotected static StringPARAM_DISPLAY_CONTROLprotected static StringPARAM_DISPLAY_NAMEprotected static StringPARAM_FACET_QNAMEprotected static StringPARAM_FILTER_IDprotected static StringPARAM_HIT_THRESHOLDprotected static StringPARAM_INDEXprotected static StringPARAM_IS_ENABLEDprotected static StringPARAM_MAX_FILTERSprotected static StringPARAM_MIN_FILTER_VALUE_LENGTHprotected static StringPARAM_SCOPEprotected static StringPARAM_SCOPED_SITESprotected static StringPARAM_SORT_BY
-
Constructor Summary
Constructors Constructor Description AbstractSolrFacetConfigAdminWebScript()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)protected Set<org.alfresco.repo.search.impl.solr.facet.SolrFacetProperties.CustomProperties>getCustomProperties(org.json.JSONObject customPropsJsonObj)protected intgetNonNegativeIntParameter(org.springframework.extensions.webscripts.WebScriptRequest req, String paramName, int defaultValue)Retrieves the named parameter as an integer, if the parameter is not present the default value is returned.protected Set<String>getScopedSites(org.json.JSONArray scopedSitesJsonArray)protected <T> TgetValue(Class<T> clazz, Object value, T defaultValue)voidsetFacetService(org.alfresco.repo.search.impl.solr.facet.SolrFacetService facetService)voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)protected abstract Map<String,Object>unprotectedExecuteImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)protected voidvalidateCurrentUser()protected voidvalidateFilterID(String filterID)-
Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
-
Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
-
-
-
Field Detail
-
PARAM_FILTER_ID
protected static final String PARAM_FILTER_ID
- See Also:
- Constant Field Values
-
PARAM_FACET_QNAME
protected static final String PARAM_FACET_QNAME
- See Also:
- Constant Field Values
-
PARAM_DISPLAY_NAME
protected static final String PARAM_DISPLAY_NAME
- See Also:
- Constant Field Values
-
PARAM_DISPLAY_CONTROL
protected static final String PARAM_DISPLAY_CONTROL
- See Also:
- Constant Field Values
-
PARAM_MAX_FILTERS
protected static final String PARAM_MAX_FILTERS
- See Also:
- Constant Field Values
-
PARAM_HIT_THRESHOLD
protected static final String PARAM_HIT_THRESHOLD
- See Also:
- Constant Field Values
-
PARAM_MIN_FILTER_VALUE_LENGTH
protected static final String PARAM_MIN_FILTER_VALUE_LENGTH
- See Also:
- Constant Field Values
-
PARAM_SORT_BY
protected static final String PARAM_SORT_BY
- See Also:
- Constant Field Values
-
PARAM_SCOPE
protected static final String PARAM_SCOPE
- See Also:
- Constant Field Values
-
PARAM_SCOPED_SITES
protected static final String PARAM_SCOPED_SITES
- See Also:
- Constant Field Values
-
PARAM_INDEX
protected static final String PARAM_INDEX
- See Also:
- Constant Field Values
-
PARAM_IS_ENABLED
protected static final String PARAM_IS_ENABLED
- See Also:
- Constant Field Values
-
PARAM_CUSTOM_PROPERTIES
protected static final String PARAM_CUSTOM_PROPERTIES
- See Also:
- Constant Field Values
-
CUSTOM_PARAM_NAME
protected static final String CUSTOM_PARAM_NAME
- See Also:
- Constant Field Values
-
CUSTOM_PARAM_VALUE
protected static final String CUSTOM_PARAM_VALUE
- See Also:
- Constant Field Values
-
FILTER_ID_PATTERN
protected static final Pattern FILTER_ID_PATTERN
-
facetService
protected org.alfresco.repo.search.impl.solr.facet.SolrFacetService facetService
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceService
-
-
Method Detail
-
setFacetService
public void setFacetService(org.alfresco.repo.search.impl.solr.facet.SolrFacetService facetService)
- Parameters:
facetService- the facetService to set
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
- Parameters:
namespaceService- the namespaceService to set
-
executeImpl
protected Map<String,Object> executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
- Overrides:
executeImplin classorg.springframework.extensions.webscripts.DeclarativeWebScript
-
validateCurrentUser
protected void validateCurrentUser()
-
getValue
protected <T> T getValue(Class<T> clazz, Object value, T defaultValue) throws org.json.JSONException
- Throws:
org.json.JSONException
-
getCustomProperties
protected Set<org.alfresco.repo.search.impl.solr.facet.SolrFacetProperties.CustomProperties> getCustomProperties(org.json.JSONObject customPropsJsonObj) throws org.json.JSONException
- Throws:
org.json.JSONException
-
getScopedSites
protected Set<String> getScopedSites(org.json.JSONArray scopedSitesJsonArray) throws org.json.JSONException
- Throws:
org.json.JSONException
-
validateFilterID
protected void validateFilterID(String filterID)
-
getNonNegativeIntParameter
protected int getNonNegativeIntParameter(org.springframework.extensions.webscripts.WebScriptRequest req, String paramName, int defaultValue)Retrieves the named parameter as an integer, if the parameter is not present the default value is returned.- Parameters:
req- The WebScript requestparamName- The name of parameter to look for.defaultValue- The default value that should be returned if parameter is not present in request or is negative.- Returns:
- The request parameter or default value
- Throws:
org.springframework.extensions.webscripts.WebScriptException- if the named parameter cannot be converted to int (HTTP rsp 400).
-
-