All Known Subinterfaces:
DashboardApi, ResultMatrix
All Known Implementing Classes:
AbstractChartBuilder, AbstractPortletDto, BarLineChart, BoxplotChart, BubbleChart, ConfiguratorEntry, ConfiguratorEntryArray, DashboardController, DataTableChart, DetailedTimeSeriesChart, HeatmapChart, HistogramChart, PieChart, ResultFlexChart, ResultGauge, ResultHighchart, ResultHighmap, ScatterChart, TimeSeriesChart, TimeSeriesScatterChart, WaterfallChart, WaterfallComparisonChart

public interface Portlet
Common interface for the portlet behavior. Note: These settings done on Portlet are inherited for embedded dashboard which contains this Portlet. From embedded dashboard point of view, you can override these settings via DashboardApi
  • Field Details

  • Method Details

    • withWidth

      Portlet withWidth(int width)
      Builder style method for setting the width in pixels.
      Parameters:
      width - specify the width of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      Since:
      9.0 - Hurricane
      See Also:
    • withHeight

      Portlet withHeight(int height)
      Builder style method for setting the height in pixels.
      Parameters:
      height - specify the height of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      Since:
      9.0 - Hurricane
      See Also:
    • withLayout

      Portlet withLayout(int width, int height)
      Builder style method for setting width and height in pixels.
      Parameters:
      width - specify the width of the portlet (in pixels)
      height - specify the height of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      Since:
      9.0 - Hurricane
      See Also:
    • withDragDrop

      Portlet withDragDrop(boolean enabled)
      Enables or disables the drag&drop feature for portlets. Set to false to disable the drag&drop option. Default state is ENABLED.

      Example - disables the drag&drop of the Result Matrix portlet:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withDragDrop(false)
      
       return matrix
       
      Parameters:
      enabled - on/off switch. Default = true.
      Returns:
      this Portlet instance
    • withResizing

      Portlet withResizing(boolean enabled)
      Enables or disables the resizing feature for portlets. Set to false to disable the resizing of the portlet. Default state is ENABLED.

      Example - disables the resizing option of the Result Matrix portlet:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withResizing(false)
      
       return matrix
       
      Parameters:
      enabled - on/off switch. Default = true.
      Returns:
      this Portlet instance
    • withWidth

      Portlet withWidth(int width, String unit)
      Builder style method for setting the width in supported units.

      Example – setting the width using the 12-column system (grid):

      
       portlet.withWidth(12, "grid")
       
      Example – setting the width using pixels:
      
       portlet.withWidth(400, "px") // == portlet.withWidth(400)
       
      Parameters:
      width - Specifies the width of the portlet (in unit).
      unit - Specifies the unit of the width (grid, px). If the unit is not specified then px is used as default.
      Returns:
      The current portlet object of the specified size.
      Since:
      12.0 - Clover Club
      See Also:
    • withHeight

      Portlet withHeight(int height, String unit)
      Builder style method for setting the height in supported units.

      Example – setting the height using the 12-column system (grid):

      
       portlet.withHeight(12, "grid")
       
      Example – setting the height using pixels:
      
       portlet.withHeight(800, "px") // == portlet.withHeight(800)
       
      Parameters:
      height - Specifies the height of the portlet (in unit).
      unit - Specifies the unit of the height (grid, px). If the unit is not specified then px is used as default.
      Returns:
      The current portlet object of the specified size.
      Since:
      12.0 - Clover Club
      See Also:
    • withLayout

      Portlet withLayout(int width, int height, String unit)
      Builder style method for setting width and height in specified units.

      Example - sets the portlet size to the specified grid size:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withLayout(3, 3, "grid")
      
       return matrix
       
      Parameters:
      width - Specifies the width of the portlet.
      height - Specifies the height of the portlet.
      unit - Specifies a unit of the layout (grid, px).
      Returns:
      The current portlet object of the specified size.
      Since:
      12.0 - Clover Club
      See Also:
    • withInfo

      Portlet withInfo(String code, String userMsg, String techMsg)
      Adds an info message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withInfo("101", "Chart data may be outdated", "Bubble Chart data is outdated, because of ...")
       
      Parameters:
      code - Info code allows to pinpoint the place of the related issue in code.
      userMsg - Info message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withWarning

      Portlet withWarning(String code, String userMsg, String techMsg)
      Adds a warning message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withWarning("102", "Chart data is missing", "Bubble Chart data is missing, because of ...")
       
      Parameters:
      code - Warning code allows to pinpoint the place where the warning is thrown in code.
      userMsg - Warning message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withError

      Portlet withError(String code, String userMsg, String techMsg)
      Adds an error message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withError("103", "Chart was not found", "Bubble Chart could not be found, because of ...")
       
      Parameters:
      code - Error code allows to pinpoint the place where the error is thrown in code.
      userMsg - Error message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withTab

      Portlet withTab(String tabName)
      Assigns the portlet to a specific tab in a multitab dashboard.

      Tabs must be defined in the Model Class (MC) definition under the dashboardTabs list for the corresponding step.
      If the tab name is not found in the MC definition, the portlet falls back to the default tab and a warning is logged to the console.

      Example:

      
           return api.inputBuilderFactory().createInputMatrix("MatrixEntry")
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOptions)
                   .setValue([
                       [col1: "a1", col2: "b1"],
                       [col1: "a2", col2: "b2"]
                   ])
                   .setLabel("MatrixEntry")
                   .setTab("multitab_dashboard_inputs_and_portlets")
                   .getInput()
       
      Parameters:
      tabName - Name of the tab as defined in dashboardTabs in the Model Class JSON
      Returns:
      the current portlet instance
      Since:
      15.0 - Southside
      See Also: