Class InputMatrixInputBuilder


public class InputMatrixInputBuilder extends AbstractInputBuilder<InputMatrixInputBuilder,Object>
Builder class for input type InputMatrix InputType.INPUTMATRIX
  • Constructor Details

  • Method Details

    • setColumns

      public InputMatrixInputBuilder setColumns(List<?> columns)
      Method can be used to set column's name by List or by List of Maps.

      List of Map argument allow to add columns with name, label and type.

      The column's Map structure is predefined:

      Keys allowed: 'columnName' (mandatory), 'columnLabel' (optional) and 'columnType' (optional).

      There is no additional validation for 'columnType'. Keys are case-sensitive (ie. 'columnName' is not the same as 'columnNAME' and the second one will not be qualified).

      Values allowed: no limitations, nulls and empty also allowed.

      If 'columnName' is massing in the Map, the InputBuilderExceptions.MissingMandatoryColumnException is thrown

      If other than 'columnLabel' or 'columnType' key is passed in the Map, the InputBuilderExceptions.ColumnStructureException is thrown.

      If null or empty collection is passed as the method's argument, the InputBuilderExceptions.NullOrEmptyColumnsException is thrown

      Example:

      
       def inputMatrix = api.inputBuilderFactory()
            .createInputMatrix('The Matrix')
            .setColumns([[columnName: 'Desc',  columnLabel: 'Description',   columnType: 'TEXT'],
                         [columnName: 'Value', columnLabel: 'Numeric Value', columnType: 'NUMERIC']])
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(inputMatrix)
      
       return inputMatrix
       
      When List of Strings is passed as the argument only columns names are set.

      Example:

      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      columns - as List of Maps (for column's names, labels and types definition) or as List of Strings (for column's name definition)
      Returns:
      The same instance of this class.
      Since:
      12.1 - Clover Club
    • setRequiredColumns

      public InputMatrixInputBuilder setRequiredColumns(List<String> requiredColumns)
      Sets columns as required. Example:
      
       def inputMatrix = api.inputBuilderFactory()
            .createInputMatrix('The Matrix')
            .setColumnsWithNameLabelType([[columnName: 'Desc',  columnType: 'TEXT'],
                                          [columnName: 'Value', columnType: 'NUMERIC']])
            .setRequiredColumns(['Value'])
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(inputMatrix)
      
       return inputMatrix
       
      Parameters:
      requiredColumns - column's names collection, which need to be a part of the columns collection
      Returns:
      The same instance of this class.
      Since:
      12.1 - Clover Club
    • setDisableRowSelection

      public InputMatrixInputBuilder setDisableRowSelection(boolean disableRowSelection)
      Manage the row selection visibility

      Example:

      
       def inputMatrix = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setDisableRowSelection(false)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(inputMatrix)
      
       return inputMatrix
       
      Parameters:
      disableRowSelection - true for disabling the row selection (hide the check-box).
      Returns:
      The same instance of this class.
      Since:
      12.0 - Clover Club
    • setReadOnlyColumns

      public InputMatrixInputBuilder setReadOnlyColumns(List<String> readOnlyColumns)

      Marks specified columns as read-only. A user will not be able to change values in these columns.

      Example – sets "column2" as read only:
      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setReadOnlyColumns(["column2"])
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      readOnlyColumns - A list of strings that specifies columns to be marked as read-only.
      Returns:
      self
    • setFitFieldWidths

      public InputMatrixInputBuilder setFitFieldWidths(boolean value)

      Sets whether fields (table cells) should autofit widths to title texts or the content.

      Example:
      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setFitFieldWidths(true)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      value - true to enable, false to disable fit field width
      Returns:
      self
      Since:
      12.0 - Clover Club
    • setDefaultHeight

      public InputMatrixInputBuilder setDefaultHeight(int value)

      Sets the maximum input matrix table height. If there are more entries than the defined default height the scroll bar appears.

      Example:
      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setDefaultHeight(300)
            .setFixTableHeight(true)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      value - The maximum default height of the input matrix table.
      Returns:
      self
      See Also:
    • setColumnValueOptions

      public InputMatrixInputBuilder setColumnValueOptions(Map value)

      Sets column value options. Allows a user to select one of the specified value only.

      Example – defines "option1" and "option2" as the only available values the user can select from:
      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setColumnValueOptions([column1: ["option1", "option2"], column2: ["option1", "option2"]])
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      value - The list of options for each column (a map of columnName:list of options).
      Returns:
      self
    • setCanModifyRows

      public InputMatrixInputBuilder setCanModifyRows(boolean value)

      When set to false a user will not be able to add or remove rows in the input matrix table.

      Example:
      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setCanModifyRows(false)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      value - true to enable, false to disable rows modification. Default = true.
      Returns:
      self
    • setNoCellRefresh

      public InputMatrixInputBuilder setNoCellRefresh(boolean value)
      Set to true to display the Apply button within the input matrix. A user can manually apply changes performed in the input matrix by clicking this button.

      Example:

      
       def im = api.inputBuilderFactory()
            .createInputMatrix("The Matrix")
            .setColumns(["column1", "column2"])
            .setNoCellRefresh(true)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
      
       return im
       
      Parameters:
      value - true to disable, false to enable refreshing cells automatically. Default = false.
      Returns:
      self
    • setFixTableHeight

      public InputMatrixInputBuilder setFixTableHeight(boolean value)

      Set to true to limit the input matrix table height by the DefaultHeight. The scroll bar appears within the input matrix when DefaultHeight is exceeded.

      Example:
      
       def im = api.inputBuilderFactory()
                .createInputMatrix("The Matrix")
                .setColumns(["column1", "column2"])
                .setDefaultHeight(150)
                .setFixTableHeight(false)
                .buildMap()
      
       quoteProcessor.addOrUpdateInput(im)
       return im
       
      Parameters:
      value - true to enable, false to disable fix table height. Default = true.
      Returns:
      self
      See Also:
    • setHiddenColumns

      public InputMatrixInputBuilder setHiddenColumns(List<String> columnsToHide)
      Allow for particular columns to be hidden in the input matrix table.

      If columns-to-be-hidden are not valid InputMatrix-config-options-column's name then nothing is set

      Example:

      
               if (api.isInputGenerationExecution()) return
      
               def inputMatrix1 = api.inputBuilderFactory()
                   .createInputMatrix('Input matrix')
                   .setColumns(['Key_1', 'Key_2', 'Key_3'])
                   .setHiddenColumns(['Key_2'])
                   .buildContextParameter()
      
               // Column with name 'Key_2' will be hidden in the InputMatrix table
      
               def inputMatrix2 = api.inputBuilderFactory()
                   .createInputMatrix('Input matrix')
                   .setColumns(['Key_1', 'Key_2', 'Key_3'])
                   .setHiddenColumns(['Key_4'])
                   .buildContextParameter()
      
               // Column with name 'Key_4' does not exist in the InputMatrix table, thus nothing be hidden or set
      
       
      Parameters:
      columnsToHide - List of columns' name to be hidden
      Returns:
      self
      Since:
      12.0 - Clover Club
    • setHideAddButton

      public InputMatrixInputBuilder setHideAddButton(boolean value)
      Hides the "Add" button.

      Set to true to hide the "Add" button.

      Example – adds the input matrix and hides its "Add" button:
      
           return api.inputBuilderFactory()
                   .createInputMatrix("InputMatrix")
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOption)
                   .setHideAddButton(true)
                   .getInput()
       
      Parameters:
      value - true to hide, false to show the button.
      Returns:
      self
      Since:
      11.2.0 - Paper Plane
    • setHideDeleteButton

      @Deprecated public InputMatrixInputBuilder setHideDeleteButton(boolean value)
      Deprecated.

      Set to true to hide the "Delete" button.

      Example – adds the input matrix:
      
           return api.inputBuilderFactory()
                   .createInputMatrix("InputMatrix")
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOption)
                   .setHideAddButton(true)
                   .setHideDeleteButton(true)
                   .getInput()
       
      Returns:
      self
    • setHideRemoveButton

      public InputMatrixInputBuilder setHideRemoveButton(boolean value)
      Hides the "Remove" button.

      Set to true to hide the "Remove" button.

      Example – adds the input matrix and hides its "Remove" button:
      
           return api.inputBuilderFactory()
                   .createInputMatrix("InputMatrix")
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOption)
                   .setHideRemoveButton(true)
                   .getInput()
       
      Parameters:
      value - true to hide, false to show the button.
      Returns:
      self
      Since:
      11.2.0 - Paper Plane
    • withEnableClientFilter

      public InputMatrixInputBuilder withEnableClientFilter(boolean enableClientFilter)
      Allows a user to filter the table by row values.
      Default = true (the filtering is enabled).

      Example:

      
           return api.inputBuilderFactory()
                   .createInputMatrix('InputMatrix')
                   .setColumns(columns)
                   .withEnableClientFilter(false)
                   .buildContextParameter()
       
      Parameters:
      enableClientFilter - Set to false to disable filtering.
      Returns:
      the current instance of InputMatrixInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • setEnableClientFilter

      public InputMatrixInputBuilder setEnableClientFilter(boolean enableClientFilter)
      Allows a user to filter the table by row values.
      Default = true (the filtering is enabled).

      Example:

      
           return api.inputBuilderFactory()
                   .createInputMatrix('InputMatrix')
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOption)
                   .setEnableClientFilter(false)
                   .buildContextParameter()
       
      Parameters:
      enableClientFilter - Set to false to disable filtering.
      Returns:
      the current instance of InputMatrixInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • withEnableAdvancedFilter

      public InputMatrixInputBuilder withEnableAdvancedFilter(boolean enableAdvancedFilter)
      Enabling the advanced filter functionality. Default = true (the filtering is enabled).

      Example:

      
           return api.inputBuilderFactory()
                   .createInputMatrix("InputMatrix")
                   .setColumns(columns)
                   .withEnableAdvancedFilter(false)
                   .buildContextParameter()
       
      Parameters:
      enableAdvancedFilter - Set to false to disable filtering.
      Returns:
      the current instance of InputMatrixInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • setEnableAdvancedFilter

      public InputMatrixInputBuilder setEnableAdvancedFilter(boolean enableAdvancedFilter)
      Enabling the advanced filter functionality. Default = true (the filtering is enabled).

      Example:

      
           return api.inputBuilderFactory()
                   .createInputMatrix('InputMatrix')
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOption)
                   .setEnableAdvancedFilter(false)
                   .buildContextParameter()
       
      Parameters:
      enableAdvancedFilter - Set to false to disable filtering.
      Returns:
      the current instance of InputMatrixInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • withPreferenceName

      public InputMatrixInputBuilder withPreferenceName(String preferenceName)
      Defines the preference name (whitespace and non-alphanumeric will be dropped).

      Example:

      
       def contextParameter = api.inputBuilderFactory()
              .createInputMatrix('matrix')
              .withPreferenceName('someName')
              .buildContextParameter()
      
       contextParameter.getPreferenceName == 'someName'
       
      Parameters:
      preferenceName - name of the preference, cannot be whitespace or non-alphanumeric.
      Returns:
      the current instance of InputMatrixInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • _getInput

      protected Object _getInput()
      Specified by:
      _getInput in class AbstractInputBuilder<InputMatrixInputBuilder,Object>