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
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATE_TIME_SUFFIX
-
Constructor Summary
Constructors Constructor Description StatsGet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFacet(String facetKey, String facetType)
Allows you to add a facet to the list of available facets for Solr Statisticsprotected String
buildQuery(SiteInfo siteInfo, String facetKey, Pair<org.joda.time.LocalDate,org.joda.time.LocalDate> startEndDate)
protected Map<String,Object>
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.void
setFacets(Map<String,String> facets)
void
setPostProcessors(Map<String,? extends StatsProcessor> postProcessors)
void
setSiteService(SiteService siteService)
void
setStats(StatsService stats)
void
setStatsField(String statsField)
-
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
-
DATE_TIME_SUFFIX
public static final String DATE_TIME_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
setStatsField
public void setStatsField(String statsField)
-
setStats
public void setStats(StatsService stats)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setPostProcessors
public void setPostProcessors(Map<String,? extends StatsProcessor> postProcessors)
-
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
-
buildQuery
protected String buildQuery(SiteInfo siteInfo, String facetKey, Pair<org.joda.time.LocalDate,org.joda.time.LocalDate> startEndDate)
-
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();
-
-