com.ibm.openpages.api.questionnaire

## Interface IQuestionnaireFactory

-     public interface IQuestionnaireFactory

  This is an interface to create questionnaire objects in memory.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `IAttachment` | `createAttachment(Id questionId, Id attachmentId)` Creates an attachment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addAttachment(IAttachment)`.
    `IComment` | `createComment(Id questionId, java.lang.String text, boolean isRejection)` Deprecated. This method is deprecated as of release 7.3.0.1, use method `createComment(Id, String, CommentType)` instead.
    `IComment` | `createComment(Id questionId, java.lang.String text, boolean isRejection, boolean isAcceptance)` Deprecated. This method is deprecated as of release 7.3.0.1, use method `createComment(Id, String, CommentType)` instead.
    `IComment` | `createComment(Id questionId, java.lang.String text, CommentType commentType)` Creates a comment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addComment(IComment)` .
    `IQuestion` | `createQuestion(Id parentSubSectionId)` Creates a question object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addQuestion(IQuestion)`.
    `IQuestionDependency` | `createQuestionDependency()` Creates a question dependency object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setVisibilityDependency(IQuestionDependency)` .
    `IQuestionOption` | `createQuestionOption(java.lang.String label, int value, java.lang.String description, java.lang.Integer score, java.util.List<java.lang.String> requires)` Creates a question option object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setOptions(List)` .
    `IQuestionTableColumn` | `createQuestionTableColumn(java.lang.String label)` Creates a question table column object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setTableColumns(List)` .
    `ISection` | `createSection()` Creates a section object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addSection(ISection)`.
    `ISection` | `createSubSection(Id parentSectionId)` Creates a subsection object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addSection(ISection)`.

- - ### Method Detail

    - #### createSection

          ISection createSection()

      Creates a section object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addSection(ISection)`. Note that the new section will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Returns:
        new section object

    - #### createSubSection

          ISection createSubSection(Id parentSectionId)

      Creates a subsection object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addSection(ISection)`. Note that the new subsection will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Returns:
        new subsection object

    - #### createQuestion

          IQuestion createQuestion(Id parentSubSectionId)

      Creates a question object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addQuestion(IQuestion)`. Note that the new question will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Returns:
        new question object

    - #### createQuestionOption

          IQuestionOption createQuestionOption(java.lang.String label,
                                               int value,
                                               java.lang.String description,
                                               java.lang.Integer score,
                                               java.util.List<java.lang.String> requires)

      Creates a question option object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setOptions(List)` . Note that the new option will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Parameters:
        `label` - label of the option
        `value` - integer value of the option. It has to be unique among the options
        `description` - description of the option
        `score` - integer score of the option
        `requires` - the list of evidence types required for this option ( e.g. [ "comment", "attachment ] )
      Returns:
        new option object

    - #### createComment

          @Deprecated
          IComment createComment(Id questionId,
                                             java.lang.String text,
                                             boolean isRejection)

      Deprecated. This method is deprecated as of release 7.3.0.1, use method `createComment(Id, String, CommentType)` instead.
      Creates a comment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addComment(IComment)` . Note that the new comment will be persisted if it is added to assessment's IQuestionnaire object ( as opposed to template ).
      Parameters:
        `questionId` - ID of the question object
        `text` - comment text
        `isRejection` - a flag to indicate if this is a normal comment or a rejection comment
      Returns:
        new comment object

    - #### createComment

          @Deprecated
          IComment createComment(Id questionId,
                                             java.lang.String text,
                                             boolean isRejection,
                                             boolean isAcceptance)

      Deprecated. This method is deprecated as of release 7.3.0.1, use method `createComment(Id, String, CommentType)` instead.
      Creates a comment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addComment(IComment)` . Note that the new comment will be persisted if it is added to assessment's IQuestionnaire object ( as opposed to template ).
      Parameters:
        `questionId` - ID of the question object
        `text` - comment text
        `isRejection` - a flag to indicate if this is a rejection comment
        `isAcceptance` - a flag to indicate if this is an acceptance comment
      Returns:
        new comment object

    - #### createComment

          IComment createComment(Id questionId,
                                 java.lang.String text,
                                 CommentType commentType)

      Creates a comment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addComment(IComment)` . Note that the new comment will be persisted if it is added to assessment's IQuestionnaire object ( as opposed to template ).
      Parameters:
        `questionId` - ID of the question object
        `text` - comment text
        `commentType` - comment type
      Returns:
        new comment object

    - #### createAttachment

          IAttachment createAttachment(Id questionId,
                                       Id attachmentId)

      Creates an attachment object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestionnaire` by `IQuestionnaire.addAttachment(IAttachment)`. In order to add an attachment, a SOXDocument has to be persisted to the system up-front, then pass the id of the SOXDocument as the attachmentId to this API. Note that the new attachment will be persisted if it is added to assessment's IQuestionnaire object ( as opposed to template ).
      Parameters:
        `questionId` - ID of the question object
        `attachmentId` - ID of the SOXDocument object to be attached for this question
      Returns:
        new attachment object

    - #### createQuestionTableColumn

          IQuestionTableColumn createQuestionTableColumn(java.lang.String label)

      Creates a question table column object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setTableColumns(List)` . Note that the new table column will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Parameters:
        `label` - label of the table column
      Returns:
        new table column object

    - #### createQuestionDependency

          IQuestionDependency createQuestionDependency()

      Creates a question dependency object in memory, which is persisted via `IQuestionnaireService.saveQuestionnaire(IQuestionnaire)` after being added to `IQuestion` by `IQuestion.setVisibilityDependency(IQuestionDependency)` . Note that the new question dependency will be persisted if it is added to template's IQuestionnaire object ( as opposed to assessment ).
      Returns:
        new question dependency object

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2022. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.