Class Context


  • public class Context
    extends java.lang.Object
    This class represents the context for creating a report.
    • Constructor Detail

      • Context

        public Context​(SlingRepository repository,
                       QueryBuilder queryBuilder,
                       ComponentProvider componentService,
                       java.util.ResourceBundle resourceBundle,
                       PathResolvingCache cache,
                       Session reportSession)
        Creates a new context for creating a report.
        Parameters:
        repository - The repository
        queryBuilder - The query builder
        componentService - The provider for report components
        resourceBundle - The CQ resource bundle for text retrieval
        cache - The resolver cache to use
        reportSession - The preconfigured session to use
      • Context

        public Context​(SlingRepository repository,
                       QueryBuilder queryBuilder,
                       ComponentProvider componentService,
                       java.util.ResourceBundle resourceBundle,
                       PathResolvingCache cache,
                       java.lang.String reportUserId)
        Creates a new context for creating a report.
        Parameters:
        repository - The repository
        queryBuilder - The query builder
        componentService - The provider for report components
        resourceBundle - The CQ resource bundle for text retrieval
        cache - The resolver cache to use
        reportUserId - The ID of the user to be used for accessing the repository
    • Method Detail

      • getRepository

        public SlingRepository getRepository()
        Gets the repository.
        Returns:
        The repository
      • getQueryBuilder

        public QueryBuilder getQueryBuilder()
        Gets the query builder.
        Returns:
        The query builder
      • getComponentService

        public ComponentProvider getComponentService()
        Gets a provider for report components.
        Returns:
        The provider for report components
      • getResourceBundle

        public java.util.ResourceBundle getResourceBundle()
        Gets the resource bundle for text retrieval.
        Returns:
        The resource bundle
      • getCache

        public PathResolvingCache getCache()
        Gets the resolver cache to be used for creating the report.

        Returns:
        The resolver cache to be used
      • getAggregateManager

        public AggregateManager getAggregateManager()
        Gets the aggregate manager to be used.
        Returns:
        The aggregate manager
      • getReportSession

        public Session getReportSession()
        Gets the Session to execute the report.
        Returns:
        The Session; null if a separate session with the user specified by getReportUserId() should be used
      • getReportUserId

        public java.lang.String getReportUserId()
        Gets the user that has to be used to execute the report.
        Returns:
        The ID of the user; null if the "preconfigured" session provided by getReportSession() should be used
      • getOverriddenSortColumn

        public Column getOverriddenSortColumn()
        Gets the overridden sort column of the report.
        Returns:
        The overridden sort colummn of the report; null to keep the report's original sorting column(s)
      • setOverriddenSortColumn

        public void setOverriddenSortColumn​(Column overriddenSortColumn)
        Sets the overridden sort column of the report.
        Parameters:
        overriddenSortColumn - The overridden sort colummn of the report; null to keep the report's original sorting column(s)
      • getOverriddenSortDir

        public Sorting.Direction getOverriddenSortDir()
        Gets the overridden sort direction of the report.
        Returns:
        The overridden sort direction of the report; null to keep the report's original sorting direction
      • setOverriddenSortDir

        public void setOverriddenSortDir​(Sorting.Direction overriddenSortDir)
        Sets the overridden sort direction of the report.
        Parameters:
        overriddenSortDir - The overridden direction of the report; null to keep the report's original sorting direction