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 java.lang.String
CUSTOM_PARAM_NAME
protected static java.lang.String
CUSTOM_PARAM_VALUE
protected org.alfresco.repo.search.impl.solr.facet.SolrFacetService
facetService
protected static java.util.regex.Pattern
FILTER_ID_PATTERN
protected org.alfresco.service.namespace.NamespaceService
namespaceService
protected static java.lang.String
PARAM_CUSTOM_PROPERTIES
protected static java.lang.String
PARAM_DISPLAY_CONTROL
protected static java.lang.String
PARAM_DISPLAY_NAME
protected static java.lang.String
PARAM_FACET_QNAME
protected static java.lang.String
PARAM_FILTER_ID
protected static java.lang.String
PARAM_HIT_THRESHOLD
protected static java.lang.String
PARAM_INDEX
protected static java.lang.String
PARAM_IS_ENABLED
protected static java.lang.String
PARAM_MAX_FILTERS
protected static java.lang.String
PARAM_MIN_FILTER_VALUE_LENGTH
protected static java.lang.String
PARAM_SCOPE
protected static java.lang.String
PARAM_SCOPED_SITES
protected static java.lang.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 java.util.Map<java.lang.String,java.lang.Object>
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
protected java.util.Set<org.alfresco.repo.search.impl.solr.facet.SolrFacetProperties.CustomProperties>
getCustomProperties(org.json.JSONObject customPropsJsonObj)
protected int
getNonNegativeIntParameter(org.springframework.extensions.webscripts.WebScriptRequest req, java.lang.String paramName, int defaultValue)
Retrieves the named parameter as an integer, if the parameter is not present the default value is returned.protected java.util.Set<java.lang.String>
getScopedSites(org.json.JSONArray scopedSitesJsonArray)
protected <T> T
getValue(java.lang.Class<T> clazz, java.lang.Object value, T defaultValue)
void
setFacetService(org.alfresco.repo.search.impl.solr.facet.SolrFacetService facetService)
void
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
protected abstract java.util.Map<java.lang.String,java.lang.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(java.lang.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 java.lang.String PARAM_FILTER_ID
- See Also:
- Constant Field Values
-
PARAM_FACET_QNAME
protected static final java.lang.String PARAM_FACET_QNAME
- See Also:
- Constant Field Values
-
PARAM_DISPLAY_NAME
protected static final java.lang.String PARAM_DISPLAY_NAME
- See Also:
- Constant Field Values
-
PARAM_DISPLAY_CONTROL
protected static final java.lang.String PARAM_DISPLAY_CONTROL
- See Also:
- Constant Field Values
-
PARAM_MAX_FILTERS
protected static final java.lang.String PARAM_MAX_FILTERS
- See Also:
- Constant Field Values
-
PARAM_HIT_THRESHOLD
protected static final java.lang.String PARAM_HIT_THRESHOLD
- See Also:
- Constant Field Values
-
PARAM_MIN_FILTER_VALUE_LENGTH
protected static final java.lang.String PARAM_MIN_FILTER_VALUE_LENGTH
- See Also:
- Constant Field Values
-
PARAM_SORT_BY
protected static final java.lang.String PARAM_SORT_BY
- See Also:
- Constant Field Values
-
PARAM_SCOPE
protected static final java.lang.String PARAM_SCOPE
- See Also:
- Constant Field Values
-
PARAM_SCOPED_SITES
protected static final java.lang.String PARAM_SCOPED_SITES
- See Also:
- Constant Field Values
-
PARAM_INDEX
protected static final java.lang.String PARAM_INDEX
- See Also:
- Constant Field Values
-
PARAM_IS_ENABLED
protected static final java.lang.String PARAM_IS_ENABLED
- See Also:
- Constant Field Values
-
PARAM_CUSTOM_PROPERTIES
protected static final java.lang.String PARAM_CUSTOM_PROPERTIES
- See Also:
- Constant Field Values
-
CUSTOM_PARAM_NAME
protected static final java.lang.String CUSTOM_PARAM_NAME
- See Also:
- Constant Field Values
-
CUSTOM_PARAM_VALUE
protected static final java.lang.String CUSTOM_PARAM_VALUE
- See Also:
- Constant Field Values
-
FILTER_ID_PATTERN
protected static final java.util.regex.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 java.util.Map<java.lang.String,java.lang.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(java.lang.Class<T> clazz, java.lang.Object value, T defaultValue) throws org.json.JSONException
- Throws:
org.json.JSONException
-
getCustomProperties
protected java.util.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 java.util.Set<java.lang.String> getScopedSites(org.json.JSONArray scopedSitesJsonArray) throws org.json.JSONException
- Throws:
org.json.JSONException
-
validateFilterID
protected void validateFilterID(java.lang.String filterID)
-
getNonNegativeIntParameter
protected int getNonNegativeIntParameter(org.springframework.extensions.webscripts.WebScriptRequest req, java.lang.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).
-
unprotectedExecuteImpl
protected abstract java.util.Map<java.lang.String,java.lang.Object> unprotectedExecuteImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
-
-