Class StatsGet
java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.DeclarativeWebScript
org.alfresco.repo.web.scripts.solr.StatsGet
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
public class StatsGet
extends org.springframework.extensions.webscripts.DeclarativeWebScript
Retrieves statistics using solr. For a list of potential facets call it with /api/solr/stats?listFacets=true You can pass one of these facets in eg. facet=content.creator . The facet name can be used as a I18n resource bundle key, it also has a predefined structure: group.property[.type] eg. content.created.datetime. The [.type] is optional, the default is String.
- Author:
- Gethin James
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAllows you to add a facet to the list of available facets for Solr Statisticsprotected StringbuildQuery(SiteInfo siteInfo, String facetKey, Pair<org.joda.time.LocalDate, org.joda.time.LocalDate> startEndDate) executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache) static Pair<org.joda.time.LocalDate,org.joda.time.LocalDate> getStartAndEndDates(String start, String end) Parses ISO8601 formatted Date Strings.voidvoidsetPostProcessors(Map<String, ? extends StatsProcessor> postProcessors) voidsetSiteService(SiteService siteService) voidsetStats(StatsService stats) voidsetStatsField(String statsField) Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplateMethods 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 Details
-
DATE_TIME_SUFFIX
- See Also:
-
-
Constructor Details
-
StatsGet
public StatsGet()
-
-
Method Details
-
setFacets
-
setStatsField
-
setStats
-
setSiteService
-
setPostProcessors
-
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
-
buildQuery
-
getStartAndEndDates
public static Pair<org.joda.time.LocalDate,org.joda.time.LocalDate> getStartAndEndDates(String start, String end) Parses ISO8601 formatted Date Strings.- Parameters:
start- If start is null then defaults to 1 monthend- If end is null then it defaults to now();
-
addFacet
Allows you to add a facet to the list of available facets for Solr Statistics- Parameters:
facetKey- e.g. content.mimetypefacetType- e.g. {http://www.alfresco.org/model/content/1.0}content.mimetype
-