Class TextTemplateResourceReference

    • Constructor Detail

      • TextTemplateResourceReference

        public TextTemplateResourceReference​(java.lang.Class<?> scope,
                                             java.lang.String fileName,
                                             IModel<java.util.Map<java.lang.String,​java.lang.Object>> variablesModel)
        Creates a resource reference to a PackageTextTemplate.
        Parameters:
        scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
        fileName - the file name
        variablesModel - the template variables as a model
      • TextTemplateResourceReference

        public TextTemplateResourceReference​(java.lang.Class<?> scope,
                                             java.lang.String fileName,
                                             java.lang.String contentType,
                                             IModel<java.util.Map<java.lang.String,​java.lang.Object>> variablesModel)
        Creates a resource reference to a PackageTextTemplate.
        Parameters:
        scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
        fileName - the file name
        contentType - the mime type of this resource, such as "image/jpeg" or " text/html"
        variablesModel - the template variables as a model
      • TextTemplateResourceReference

        public TextTemplateResourceReference​(java.lang.Class<?> scope,
                                             java.lang.String fileName,
                                             java.lang.String contentType,
                                             java.lang.String encoding,
                                             IModel<java.util.Map<java.lang.String,​java.lang.Object>> variablesModel)
        Creates a resource reference to a PackageTextTemplate.
        Parameters:
        scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
        fileName - the file name
        contentType - the mime type of this resource, such as "image/jpeg" or " text/html"
        encoding - the file's encoding, for example, "UTF-8"
        variablesModel - the template variables as a model
      • TextTemplateResourceReference

        public TextTemplateResourceReference​(java.lang.Class<?> scope,
                                             java.lang.String fileName,
                                             java.lang.String contentType,
                                             java.lang.String encoding,
                                             IModel<java.util.Map<java.lang.String,​java.lang.Object>> variablesModel,
                                             java.util.Locale locale,
                                             java.lang.String style,
                                             java.lang.String variation)
        Construct.
        Parameters:
        scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
        fileName - the file name
        contentType - the mime type of this resource, such as "image/jpeg" or " text/html"
        encoding - the file's encoding, for example, "UTF-8"
        variablesModel - the template variables as a model
        locale - Preferred locale for the resource
        style - Preferred style for the resource
        variation - Preferred variation for the resource
    • Method Detail

      • getResource

        public IResource getResource()
        Creates a new resource which returns the interpolated value of the text template.
        Specified by:
        getResource in class ResourceReference
        Returns:
        a new resource which returns the interpolated value of the text template