Class InputBuilderFactory

    • Method Detail

      • createUserEntry

        public SimpleInputBuilder<BigDecimal> createUserEntry​(String paramName)
        Creates new UserEntry BigDecimal input (context parameter).

        Side effect: During the Syntax Check mode, this function triggers creation of the input parameter.

        • When the user-entered number is a whole number (integer), the value returned is java.lang.Integer.
        • When the user-entered number is a decimal number, the value returned is java.math.BigDecimal.
        • If you always need the result as a BigDecimal, you can cast it, e.g. api.decimalUserEntry("number") as BigDecimal.
        Parameters:
        paramName - Name of the user input parameter. For the names use the "camel case" (no spaces and capital letters). This value is not meant as a label of the input field, but rather a name which should stay stable for a long time. Remember, the input fields are stored e.g. on every single Quote line item and are created only once when adding the new line. If you need to modify the label (or other properties) of the input parameter, you can use getParameter(String).
        Returns:
        User entry input builder.
        See Also:
        PublicGroovyAPI.userEntry(String), SimpleInputBuilder
      • createIntegerUserEntry

        public SimpleInputBuilder<Integer> createIntegerUserEntry​(String paramName)
        Creates new IntegerUserEntry Integer input (context parameter).

        Side effect: During the Syntax Check mode, this function triggers creation of the input parameter that lets the user enter an integer value. The input is rendered as a numeric field.

        Parameters:
        paramName - Name of the user input parameter. Use "camel case" for the names (no spaces and capital letters). This value is not meant as a label of the input field, but rather a name which should stay stable for a long time. Remember, the input fields are stored e.g. on every single Quote line item and are created only once, when adding the new line. If you need to modify the label (or other properties) of the input parameter, you can use getParameter(String).
        Returns:
        Integer user entry builder.
        See Also:
        PublicGroovyAPI.integerUserEntry(String), SimpleInputBuilder
      • createDateRangeUserEntry

        public DateRangeInputBuilder createDateRangeUserEntry​(String paramName)
        Creates new DateRangeUserEntry input (context parameter).Creates an input parameter Rendered as two date picker fields that let the user enter a date range (start and end date).

        Note: This is available in Unity UI only.

        Parameters:
        paramName - Name of the user entry parameter.
        Returns:
        Date range user entry builder.
        See Also:
        PublicGroovyAPI.dateRangeUserEntry(String), SimpleInputBuilder
      • createRadioEntry

        public OptionInputBuilder createRadioEntry​(String paramName)
        Creates new radio input (context parameter). User can select one value from many by clicking a radio button.
        Parameters:
        paramName - Name of the parameter.
        Returns:
        Radio user entry builder.
        See Also:
        InputType.RADIO, OptionInputBuilder
      • createButtonEntry

        public ButtonInputBuilder createButtonEntry​(String paramName)
        Creates new button input.
        Parameters:
        paramName - Name of the parameter.
        Returns:
        Button entry builder.
        See Also:
        ButtonInputBuilder
      • createOptionEntry

        public OptionInputBuilder createOptionEntry​(String paramName)
        Creates new OptionEntry InputType.OPTION input (context parameter). The input returns a value selected by the user from a list displayed in drop-down input parameter.

        Side effect: During the Syntax Check mode, this function triggers creation of a drop-down input parameter with the given list of options.

        Example:

                 api.inputBuilderFactory
                         .createOptionEntry("entryName")
                         .setLabel("Entry Label")
                         .addOption("name1")
                         .addOption("name2")
                         .setLabels(["name1": "Label1", "name2": "Label2"])
                         .buildContextParameter()
             
        Parameters:
        paramName - Name of the user entry parameter.
        Returns:
        Option input builder.
        See Also:
        PublicGroovyAPI.option(String, Object...), PublicGroovyAPI.option(String, List, Map), OptionInputBuilder
      • createOptionsEntry

        public OptionInputBuilder createOptionsEntry​(String paramName)
        Creates new OptionsEntry InputType.OPTIONS input (context parameter). The input parameter lets the user select multiple values from predefined options. It is rendered as a drop-down list of possible options. Each selected value appears at the top.

        Example:

                 api.inputBuilderFactory
                         .createOptionsEntry("entryName")
                         .setLabel("Entry Label")
                         .addOption("name1")
                         .addOption("name2")
                         .setLabels(["name1": "Label1", "name2": "Label2"])
                         .buildContextParameter()
             
        By default the options are sorted alphabetically by label. If your labels contain numbers which need to be sorted correctly, you can add blank spaces to influence the sorting. For example:
                label: '  ABC'
                label: '10k'
                Label: ' 5k'
                label: ' 2.5k'
             
        will result in this order in the UI: ABC, 2.5k, 5k, 10k.
        Parameters:
        paramName - Name of the user entry parameter.
        Returns:
        Option input builder.
        See Also:
        PublicGroovyAPI.options(String, Object...), PublicGroovyAPI.options(String, List, Map), OptionInputBuilder
      • createDmFilterBuilder

        public DmFilterBuilder createDmFilterBuilder​(String paramName,
                                                     String source)
        Creates a new DataMartFilterBuilderUserEntry InputType.DMFILTERBUILDER input (context parameter). This input parameter allows the user to build a filter for a given Datamart.

        The filter can be used in DatamartContext.Query.where(Filter...) of the PublicGroovyAPI.datamartQuery(Object...).

        It will render a FilterBuilder widget entry allowing to construct a filter object filtering on the specified Data Source.

        Example:

        Please note: The method returns a map, therefore the filterFromMap method must be used to convert the map object into the filter object (see the example below).
        Also, check the input value for null as the api.filterFromMap method does not accept the null value as an argument.

         if (api.isSyntaxCheck()) {
           return api.inputBuilderFactory()
               .createDmFilterBuilder("DataFilter", "datamart_transaction")
               .setLabel("Data Filter")
               .setRequired(false)
               .setNoRefresh(true)
               .getInput()
         }
        
         return input.DataFilter ? api.filterFromMap(input.DataFilter) : null
         

        Example 2:

         def filter1 = datamartFilterBuilderUserEntry("ProductGroup", "Transactions_DM")
        
         def dimFilterList = ["CustomerId", "ProductId"]
         def filter2 = datamartFilterBuilderUserEntry("ProductGroup", "Transactions_DM", dimFilterList)
        
         def dimFilterMap = ["CustomerId" : "CD-00155", "ProductId" : "MB-0005"]
         def filter3 = datamartFilterBuilderUserEntry("ProductGroup", "Transactions_DM", dimFilterMap, Filter.equal("Country", "DE"))
         
        Parameters:
        paramName - Name of the user entry parameter.
        source - Name of the source for which the filter is set. The resolution of the source is as follows:
        1. any Datamart - by typedId, sourceName, uniqueName or label (uniqueName and label for backwards compatibility)
        2. any FieldCollection - by typedId or sourceName
        Returns:
        Datamart filter builder.
        See Also:
        PublicGroovyAPI.datamartFilterBuilderUserEntry(String, String, Object...), DmFilterBuilder, PublicGroovyAPI.filterFromMap(Map)
      • createDmFilter

        public DmFilter createDmFilter​(String paramName,
                                       String fcTypedId,
                                       String field)
        Creates new DM dim filter input InputType.DMDIMFILTER
        Parameters:
        paramName - Name of the user entry parameter.
        fcTypedId - Name of the source for which the filter is set. The resolution of the source is as follows:
        1. any Datamart - by typedId, sourceName, uniqueName or label (uniqueName and label for backwards compatibility)
        2. any FieldCollection - by typedId or sourceName
        field - field name
        Returns:
        DmFilter
      • createMultiTierEntryInputBuilder

        public MultiTierInputBuilder createMultiTierEntryInputBuilder​(String paramName)
        Creates a new MultiTierInputBuilder
        Parameters:
        paramName - Name of the parameter.
        Returns:
        Multi Tier entry build
      • createDMField

        public DMFieldBuilder createDMField​(String paramName,
                                            String source)
        Creates a new DMField InputType.DMFIELD input field (a context parameter). This input parameter enables a user to select a Datamart field from the drop-down menu (only one option can be selected). The Datamart is specified by the source parameter.

        Example:

         def builder = api.inputBuilderFactory().createDMField("DMField","DM.datamart_transaction")
         return libs.InputLib.Input.inputParamBuilder(out,builder)
         
        Parameters:
        paramName - A name of the input field
        source - A name of the source Datamart to choose a field from
        Returns:
        DMField input builder
        Since:
        7.3 Bijou
        See Also:
        DMFieldBuilder, InputType.DMFIELD
      • createDMFields

        public DMFieldBuilder createDMFields​(String paramName,
                                             String source)
        Creates a new DMFields InputType.DMFIELDS input (a context parameter). This input parameter enables a user to select multiple Datamart fields from the multi-select drop-down menu. The Datamart is specified by the source parameter.

        Example:

         def builder = api.inputBuilderFactory().createDMFields("DMFields","DM.datamart_transaction")
         return libs.InputLib.Input.inputParamBuilder(out,builder)
         
        Parameters:
        paramName - A name of the input field
        source - A name of the source Datamart to choose fields from
        Returns:
        DMFields input builder
        Since:
        7.3 Bijou
        See Also:
        DMFieldBuilder, InputType.DMFIELDS
      • createParsableInputTypeFile

        public SimpleInputBuilder<Object> createParsableInputTypeFile​(String paramName)
        Creates a new ParsableInputFile InputType.PARSABLEINPUTFILE input (a context parameter). This input parameter enables a user to upload a file.

        Example:

         def builder = api.inputBuilderFactory().createParsableInputTypeFile("File")
         return libs.InputLib.Input.inputParamBuilder(out,builder)
         
        Parameters:
        paramName - A name of the input field
        Returns:
        ParsableInputFile input builder
        Since:
        7.3 Bijou
        See Also:
        SimpleInputBuilder, InputType.PARSABLEINPUTFILE
      • createRebateAgreement

        public SimpleInputBuilder<Object> createRebateAgreement​(String paramName)
        Creates a new RebateAgreement InputType.REBATEAGREEMENT input (a context parameter). This input parameter enables a user to choose/pick a rebate agreement from the drop-down menu and picker.

        Example:

         def builder = api.inputBuilderFactory().createRebateAgreement("RebateAgreement")
         return libs.InputLib.Input.inputParamBuilder(out,builder)
         
        Parameters:
        paramName - A name of the input field
        Returns:
        RebateAgreement input builder
        Since:
        7.3 Bijou
        See Also:
        SimpleInputBuilder, InputType.REBATEAGREEMENT
      • createDMSource

        public SimpleInputBuilder<Object> createDMSource​(String paramName)
        Creates a new DMDatamart InputType.DMSOURCE input (a context parameter). This input parameter enables a user to choose an existing Datamart from the drop-down menu.

        Example:

         def builder = api.inputBuilderFactory().createDMSource("DMSource")
         return libs.InputLib.Input.inputParamBuilder(out,builder)
         
        Parameters:
        paramName - A name of the input field
        Returns:
        DMDatamart input builder
        Since:
        7.3 Bijou
        See Also:
        SimpleInputBuilder, InputType.DMSOURCE
      • createRowLayout

        public RowInputBuilder<Object> createRowLayout​(String name)
        Creates a new InputType.ROW element that groups inputs and renders them on a row if possible, will wrap them on a new line otherwise.

        Example:

                 def inputBuilderFactory = api.inputBuilderFactory()
                 def builder = inputBuilderFactory
                      .createRowLayout("row")
                      .addInput(
                         inputBuilderFactory
                                 .createTextUserEntry("TextUserEntry1")
                                 .setFlex(2)
                                 .buildContextParameter()
                      )
                      .addInput(
                         inputBuilderFactory
                                 .createTextUserEntry("TextUserEntry2")
                                 .setFlex(1)
                                 .buildContextParameter()
                      )
        
                  return libs.InputLib.Input.inputParamBuilder(out,builder)
             
        Parameters:
        name -
        Returns:
        Row input builder
        Since:
        7.4 Bijou
        See Also:
        InputType.ROW
      • createCollapseLayout

        public CollapseInputBuilder<Object> createCollapseLayout​(String name)
        Creates a new InputType.COLLAPSE element that groups inputs and provides users with the option to collapse it. The grouped items can be regular inputs, or InputType.ROW elements or even another InputType.COLLAPSE elements.

        Example:

                 def inputBuilderFactory = api.inputBuilderFactory()
                  def builder = inputBuilderFactory
                      .createCollapseLayout("collapse")
                      .setCollapsed(false)
                      .addInput(
                         inputBuilderFactory.createRowLayout("row")
                                 .addInput(
                                         inputBuilderFactory
                                                 .createTextUserEntry("TextUserEntry1")
                                                 .setFlex(2)
                                                 .buildContextParameter()
                                 )
                                 .addInput(
                                         inputBuilderFactory
                                                 .createTextUserEntry("TextUserEntry2")
                                                 .setFlex(1)
                                                 .buildContextParameter()
                                 ).buildContextParameter()
        
                      )
        
                  return libs.InputLib.Input.inputParamBuilder(out,builder)
             
        Parameters:
        name -
        Returns:
        Collapse input builder
        Since:
        7.4 Bijou
        See Also:
        InputType.COLLAPSE