Class DefaultReportViewConverterStrategy

    • Field Detail

      • VELOCITY_CTX_REPORTS

        public static final java.lang.String VELOCITY_CTX_REPORTS
        Key under which a Velocity context stores a collection with ReportView objects.
        See Also:
        Constant Field Values
      • VELOCITY_CTX_GENERATED_TIMESTAMP

        public static final java.lang.String VELOCITY_CTX_GENERATED_TIMESTAMP
        See Also:
        Constant Field Values
      • VELOCITY_CTX_GENERATED_BY

        public static final java.lang.String VELOCITY_CTX_GENERATED_BY
        See Also:
        Constant Field Values
      • VELOCITY_CTX_GENERATED_FOR

        public static final java.lang.String VELOCITY_CTX_GENERATED_FOR
        See Also:
        Constant Field Values
      • VELOCITY_CTX_REPORT_NAME

        public static final java.lang.String VELOCITY_CTX_REPORT_NAME
        See Also:
        Constant Field Values
      • VELOCITY_CTX_CONFIG_NAME

        public static final java.lang.String VELOCITY_CTX_CONFIG_NAME
        See Also:
        Constant Field Values
      • DEFAULT_FILE_NAME

        public static final java.lang.String DEFAULT_FILE_NAME
        See Also:
        Constant Field Values
      • TEMP_FILE_EXTENSION

        public static final java.lang.String TEMP_FILE_EXTENSION
        See Also:
        Constant Field Values
      • TEMP_FILE_PREFIX

        public static final java.lang.String TEMP_FILE_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultReportViewConverterStrategy

        public DefaultReportViewConverterStrategy()
    • Method Detail

      • createConversionContext

        protected java.util.Map<java.lang.String,​java.lang.Object> createConversionContext​(java.util.Map<java.lang.String,​java.lang.Object> context)
        Create context for conversion.
        Parameters:
        context - a map used to pass in additional jsonData needed by the strategy.
        Returns:
        context prepared to perform conversion
      • createConversionContext

        @Deprecated
        protected java.util.Map<java.lang.String,​java.lang.Object> createConversionContext​(java.util.List<ReportView> reports,
                                                                                                 java.util.Map<java.lang.String,​java.lang.Object> context)
        Deprecated.
        since 1811
        Create context for conversion.
        Parameters:
        reports - generated report view
        context - a map used to pass in additional jsonData needed by the strategy.
        Returns:
        context prepared to perform conversion
      • convertUsingTemplate

        protected ReportConversionData convertUsingTemplate​(RendererTemplateModel template,
                                                            java.util.Map<java.lang.String,​java.lang.Object> conversionContext)
        Converts the given reports to html format.
        Parameters:
        template - template used to convert the raw data into desired format.
        conversionContext - conversion context.
        Returns:
        an object representing a generated report file.
      • registerRequiredCustomDirectives

        protected void registerRequiredCustomDirectives()
      • prepareAdditionalContext

        protected java.util.Map<java.lang.String,​java.lang.Object> prepareAdditionalContext​(java.util.Map<java.lang.String,​java.lang.Object> context)
        Prepares a Velocity context.
        Parameters:
        context - original context passed to the AbstractTemplateViewConverterStrategy.convert(List, Map) method.
        Returns:
        VelocityContext containing the generation timestamp, report id, configuration name and user names (generated by and for).
      • getReportName

        public java.lang.String getReportName()
      • setReportName

        public void setReportName​(java.lang.String reportName)
        Sets a name of the report. By default the strategy uses DEFAULT_FILE_NAME.
        Parameters:
        reportName - the report name.
      • setTextConverterStrategy

        public void setTextConverterStrategy​(ReportViewConverterStrategy textConverterStrategy)
        Sets an implementation of the ReportViewConverterStrategy which generates text representation of the report.
        Parameters:
        textConverterStrategy - the strategy which produces text representation of the report.
      • setRendererService

        public void setRendererService​(RendererService rendererService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setI18NService

        public void setI18NService​(I18NService i18NService)
      • getCustomDirectives

        public java.util.Collection<org.apache.velocity.runtime.directive.Directive> getCustomDirectives()
      • setCustomDirectives

        public void setCustomDirectives​(java.util.Collection<org.apache.velocity.runtime.directive.Directive> customDirectives)