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.DeclarativeWebScript
This 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 String
CUSTOM_PARAM_NAME
protected static String
CUSTOM_PARAM_VALUE
protected SolrFacetService
facetService
protected static Pattern
FILTER_ID_PATTERN
protected org.alfresco.service.namespace.NamespaceService
namespaceService
protected static String
PARAM_CUSTOM_PROPERTIES
protected static String
PARAM_DISPLAY_CONTROL
protected static String
PARAM_DISPLAY_NAME
protected static String
PARAM_FACET_QNAME
protected static String
PARAM_FILTER_ID
protected static String
PARAM_HIT_THRESHOLD
protected static String
PARAM_INDEX
protected static String
PARAM_IS_ENABLED
protected static String
PARAM_MAX_FILTERS
protected static String
PARAM_MIN_FILTER_VALUE_LENGTH
protected static String
PARAM_SCOPE
protected static String
PARAM_SCOPED_SITES
protected static String
PARAM_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<SolrFacetProperties.CustomProperties>
getCustomProperties(org.json.JSONObject customPropsJsonObj)
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.protected Set<String>
getScopedSites(org.json.JSONArray scopedSitesJsonArray)
protected <T> T
getValue(Class<T> clazz, Object value, T defaultValue)
void
setFacetService(SolrFacetService facetService)
void
setNamespaceService(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 void
validateCurrentUser()
protected void
validateFilterID(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 SolrFacetService facetService
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceService
-
-
Method Detail
-
setFacetService
public void setFacetService(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:
executeImpl
in 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<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).
-
-