Class HTMLResource


  • public class HTMLResource
    extends Resource
    Child class of Resource. A class representing a resource with HTML data for the Cloud Office Print server.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTMLResource​(java.lang.String HTML, java.lang.Boolean landscape)
      Constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHTML()  
      com.google.gson.JsonObject getJSONForSecondaryFile()
      Needs to be used to get the JSON of a resource for a secondary file (file to prepend, to append, to insert or subtemplate), because their JSON has a different format then for a template.
      com.google.gson.JsonObject getJSONForTemplate()
      Needs to be called to get the JSON of a resource for a template.
      java.lang.Boolean getLandscape()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTMLResource

        public HTMLResource​(java.lang.String HTML,
                            java.lang.Boolean landscape)
        Constructor for this class. Instantiates the HTML data to the HTML argument and the landscape option to landscape. Landscape option will be neglected for secondary files (not templates).
        Parameters:
        HTML - data for this resource.
        landscape - Whether the HTML should be rendered as landscape-oriented page (default :false)
    • Method Detail

      • getHTML

        public java.lang.String getHTML()
        Returns:
        HTML data of this resource.
      • getLandscape

        public java.lang.Boolean getLandscape()
        Returns:
        Whether the HTML should be rendered as landscape-oriented page.
      • getJSONForTemplate

        public com.google.gson.JsonObject getJSONForTemplate()
        Description copied from class: Resource
        Needs to be called to get the JSON of a resource for a template.
        Specified by:
        getJSONForTemplate in class Resource
        Returns:
        JSONObject with the tags for a HTML resource as template for the Cloud Office Print server ("html_template_content","template_type" and "orientation" if specified).
      • getJSONForSecondaryFile

        public com.google.gson.JsonObject getJSONForSecondaryFile()
        Description copied from class: Resource
        Needs to be used to get the JSON of a resource for a secondary file (file to prepend, to append, to insert or subtemplate), because their JSON has a different format then for a template.
        Specified by:
        getJSONForSecondaryFile in class Resource
        Returns:
        JSONObject with the tags ("mime_type","file_content","file_source") for an HTML resource as a secondary file (subtemplates, files to prepend, files to append and files to insert) for the Cloud Office Print server.