TaackUiService (taack-ui 0.5.7-SNAPSHOT API)
Package: taack.render

[Groovy] Class TaackUiService

    • taack.render.TaackUiService
    • All Implemented Interfaces and Traits:
      grails.web.api.WebAttributes, grails.artefact.controller.support.ResponseRenderer, grails.web.databinding.DataBinder


      @grails.compiler.GrailsCompileStatic
      final class TaackUiService
      extends java.lang.Object
      implements grails.web.api.WebAttributes, grails.artefact.controller.support.ResponseRenderer, grails.web.databinding.DataBinder

      Service responsible for rendering a web page or producing ajax parts of a web page.

      taackUiSimpleService.show(new UiBlockSpecifier() {
            modal {
                ajaxBlock "showUser", {
                    show "${u.username", crewUiService.buildUserShow(u), BlockSpec.Width.MAX
                }
            }
        })}
      Author:
      Adrien Guichard
      Version:
      0.1
      Since:
      taack-ui 0.1

      • Nested Class Summary

      • Constructor Summary

      • Methods Summary

          Methods 
          Type Params Return Type Name and description
          <T extends GormEntity> final T ajaxBind(java.lang.Class<T> aClass)
          Parameters:
          aClass
          final void ajaxReload()
          Allow to reload the current page
          final void cleanForm()
          Clear all params elements not mandatory
          final java.lang.Object closeModal(java.lang.Long id, java.lang.String text)
          Shortcut method that call the show(UiBlockSpecifier) underneath.
          final java.lang.Object closeModal(java.lang.String id, java.lang.String text)
          Shortcut method that call the show(UiBlockSpecifier) underneath.
          final java.lang.Object downloadCsv(UiTableSpecifier tableSpecifier, java.lang.String fileNamePrefix)
          Allow to upload a CSV version of a table to the client browser
          final java.lang.Object downloadDiagram(UiDiagramSpecifier diagramSpecifier, java.lang.String fileName, DiagramBase diagramBase)
          Allow to upload the diagram to the client browser
          final java.lang.Object downloadPdf(UiPrintableSpecifier printableSpecifier, java.lang.String fileNamePrefix, java.lang.Boolean isHtml)
          Allow to upload the PDF to the client browser
          final java.lang.String dumpAsset(java.lang.String assetName)
          Dump a Grails asset, typically an SVG file, in a text.
          final byte[] dumpAssetBin(java.lang.String assetName)
          Dump a binary Grails asset, typically an image.
          final java.lang.String dumpMailHtml(UiBlockSpecifier blockSpecifier, java.util.Locale locale)
          Dump a block in Mail HTML version.
          static final java.lang.String getDateFileName()
          void init()
          final boolean isProcessingForm()
          Return true if the action is called from a form
          final java.lang.Object show(UiBlockSpecifier block, UiMenuSpecifier menu, java.lang.String[] paramsToKeep)
          Render the block to the browser.
          final java.lang.Object show(java.lang.String html, UiMenuSpecifier menu)
          Render the block to the browser.
          final java.lang.Object showModal(UiFormSpecifier formSpecifier)
          Build a modal from a form and shows it.
          final java.lang.String streamPdf(UiPrintableSpecifier printableSpecifier, java.io.OutputStream outputStream, java.util.Locale locale)
          Allow to get the HTML version of the PDF, also, render the PDF in the outputStream parameter.
          static final java.lang.String tr(java.lang.String code, java.util.Locale locale, java.lang.String[] args)
          static final java.lang.String tr(FieldInfo fieldInfo, java.util.Locale locale, java.lang.String[] args)
          java.lang.String visit(UiBlockSpecifier blockSpecifier, java.lang.String[] paramsToKeep)
          Allows to retrieve the content of a block without rendering it.
          static java.lang.String visitMenu(UiMenuSpecifier menuSpecifier)
          Allows to retrieve the content of a menu without rendering it.
          static java.lang.String visitTable(UiTableSpecifier tableSpecifier)
          Allows to retrieve the content of a table without rendering it.
      • Inherited Methods Summary

          Inherited Methods 
          Methods inherited from class Name
          class java.lang.Object java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
      • Property Detail

        • @org.springframework.beans.factory.annotation.Autowired org.grails.core.io.ResourceLocator assetResourceLocator

        • @org.springframework.beans.factory.annotation.Value(value: ${bootstrap.css.tag}) java.lang.String bootstrapCssTag

        • @org.springframework.beans.factory.annotation.Value(value: ${bootstrap.js.tag}) java.lang.String bootstrapJsTag

        • @org.springframework.beans.factory.annotation.Value(value: ${client.js.path}) java.lang.String clientJsPath

        • @org.springframework.beans.factory.annotation.Autowired grails.gsp.PageRenderer g

        • static java.lang.Object lazyInit

        • @org.springframework.beans.factory.annotation.Autowired org.springframework.context.MessageSource messageSource

        • @org.springframework.beans.factory.annotation.Autowired TaackUiConfiguration taackUiPluginConfiguration

      • Constructor Detail

        • TaackUiService()

      • Method Detail

        • <T extends GormEntity> final T ajaxBind(java.lang.Class<T> aClass)

          Parameters:
          aClass
          Returns:
          objectClass initialized

        • final void ajaxReload()

          Allow to reload the current page

        • final void cleanForm()

          Clear all params elements not mandatory

        • final java.lang.Object closeModal(java.lang.Long id, java.lang.String text)

          Shortcut method that call the show(UiBlockSpecifier) underneath.

          Allow to return the selection to the parent form from a table in a many to many relationship..

          Calling this method close the current modal, that contains usually a table. @return

          Parameters:
          id - id of the object selected
          text - label of the object

        • final java.lang.Object closeModal(java.lang.String id, java.lang.String text)

          Shortcut method that call the show(UiBlockSpecifier) underneath.

          Allow to return the selection to the parent form from a table in a many to many relationship..

          Calling this method close the current modal, that contains usually a table. @return

          Parameters:
          id - id of the object selected
          text - label of the object

        • final java.lang.Object downloadCsv(UiTableSpecifier tableSpecifier, java.lang.String fileNamePrefix)

          Allow to upload a CSV version of a table to the client browser @return

          Parameters:
          tableSpecifier - table descriptor
          fileNamePrefix - part of the filename before ".csv"

        • final java.lang.Object downloadDiagram(UiDiagramSpecifier diagramSpecifier, java.lang.String fileName, DiagramBase diagramBase)

          Allow to upload the diagram to the client browser @return

          Parameters:
          diagramSpecifier - diagram descriptor
          fileName
          isSvg

        • final java.lang.Object downloadPdf(UiPrintableSpecifier printableSpecifier, java.lang.String fileNamePrefix, java.lang.Boolean isHtml)

          Allow to upload the PDF to the client browser @return

          Parameters:
          printableSpecifier - PDF descriptor
          fileName
          isHtml
          brutHtml

        • final java.lang.String dumpAsset(java.lang.String assetName)

          Dump a Grails asset, typically an SVG file, in a text.

          Parameters:
          assetName
          Returns:
          the asset file content

        • final byte[] dumpAssetBin(java.lang.String assetName)

          Dump a binary Grails asset, typically an image.

          Parameters:
          assetName
          Returns:
          binary content of the file

        • final java.lang.String dumpMailHtml(UiBlockSpecifier blockSpecifier, java.util.Locale locale)

          Dump a block in Mail HTML version.

          Parameters:
          blockSpecifier - block descriptor
          locale - language
          Returns:
          HTML content

        • static final java.lang.String getDateFileName()

        • @javax.annotation.PostConstruct void init()

        • final boolean isProcessingForm()

          Return true if the action is called from a form @return

        • final java.lang.Object show(UiBlockSpecifier block, UiMenuSpecifier menu, java.lang.String[] paramsToKeep)

          Render the block to the browser. Either the page is updated with the block content, either the full page is rendered if 'isAjax' params is true. @return

          Parameters:
          block - page descriptor
          menu - menu descriptor

        • final java.lang.Object show(java.lang.String html, UiMenuSpecifier menu)

          Render the block to the browser. Either the page is updated with the block content, either the full page is rendered if 'isAjax' params is true. @return

          Parameters:
          html - inline to render
          menu - menu descriptor

        • final java.lang.Object showModal(UiFormSpecifier formSpecifier)

          Build a modal from a form and shows it. @return

          Parameters:
          formSpecifier - form descriptor
          i18n - title of the form

        • final java.lang.String streamPdf(UiPrintableSpecifier printableSpecifier, java.io.OutputStream outputStream, java.util.Locale locale)

          Allow to get the HTML version of the PDF, also, render the PDF in the outputStream parameter.

          Parameters:
          printableSpecifier - PDF descriptor
          outputStream - connection to the client browser
          locale - the language the PDF must be rendered
          Returns:
          the HTML version of the PDF

        • static final java.lang.String tr(java.lang.String code, java.util.Locale locale, java.lang.String[] args)

        • static final java.lang.String tr(FieldInfo fieldInfo, java.util.Locale locale, java.lang.String[] args)

        • java.lang.String visit(UiBlockSpecifier blockSpecifier, java.lang.String[] paramsToKeep)

          Allows to retrieve the content of a block without rendering it.

          Parameters:
          blockSpecifier - block descriptor
          Returns:
          String that contains the HTML snippet

        • static java.lang.String visitMenu(UiMenuSpecifier menuSpecifier)

          Allows to retrieve the content of a menu without rendering it.

          Parameters:
          menuSpecifier - menu descriptor
          Returns:
          String the contains the HTML snippet

        • static java.lang.String visitTable(UiTableSpecifier tableSpecifier)

          Allows to retrieve the content of a table without rendering it.

          Parameters:
          tableSpecifier - table descriptor
          Returns:
          String the contains the HTML snippet