Package gorsat

Class FreemarkerQueryUtilities

java.lang.Object
gorsat.FreemarkerQueryUtilities

public class FreemarkerQueryUtilities
extends java.lang.Object
Helper functions to parse and create reports with the freemarker parsing engine.
  • Method Summary

    Modifier and Type Method Description
    static java.util.Optional<java.lang.String> requestQuery​(java.lang.String resource, org.gorpipe.gor.model.FileReader fileResolver, org.gorpipe.gor.model.QueryEvaluator queryEval, java.lang.String reportName, java.util.Map<java.lang.String,​java.lang.String> parameterMap, java.lang.String cacheDir)
    Returns a gor query from the input resource file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • requestQuery

      public static java.util.Optional<java.lang.String> requestQuery​(java.lang.String resource, org.gorpipe.gor.model.FileReader fileResolver, org.gorpipe.gor.model.QueryEvaluator queryEval, java.lang.String reportName, java.util.Map<java.lang.String,​java.lang.String> parameterMap, java.lang.String cacheDir) throws java.io.IOException, freemarker.template.TemplateException
      Returns a gor query from the input resource file. The gor query is fully resolved and freemarker placeholders are fully replaced by the input parameterMap.
      Parameters:
      resource - Path to freemarker yml file
      fileResolver - FileReader instance used for the current execution
      queryEval - Query evaluator based on the current session, for using gor queries within freemarker syntax
      reportName - Name of the report being generated
      parameterMap - Map og parameters and their corresponding values.
      cacheDir - Current cache directory
      Returns:
      Fully resolved gor query from the input yml file
      Throws:
      java.io.IOException - Yml file not found
      freemarker.template.TemplateException - Internal freemarker error