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
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 Statistics
    protected 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>
    Parses ISO8601 formatted Date Strings.
    void
     
    void
    setPostProcessors(Map<String,? extends StatsProcessor> postProcessors)
     
    void
     
    void
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • StatsGet

      public StatsGet()
  • Method Details

    • setFacets

      public void setFacets(Map<String,String> facets)
    • 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 class org.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 month
      end - If end is null then it defaults to now();
    • addFacet

      public void addFacet(String facetKey, String facetType)
      Allows you to add a facet to the list of available facets for Solr Statistics
      Parameters:
      facetKey - e.g. content.mimetype
      facetType - e.g. {http://www.alfresco.org/model/content/1.0}content.mimetype