Class PublicJS

java.lang.Object
com.polarion.alm.ui.client.PublicJS

public final class PublicJS extends Object
This class lists all public JavaScript functions that can be used on Live Report pages, Plans, Test Runs, Documents and Classic Wiki pages. See the individual functions for usage examples.
Since:
3.9.2
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    branchDocuments(com.google.gwt.core.client.JavaScriptObject branchConfiguration)
    Opens the "Branch Documents" dialog with the given configuration data filled in.
    static void
    createChildPlan(String projectId, String parentPath, String templatePath, String templateLabel)
    Opens the "Create New Plan" dialog in the given project.
    static void
    createDocument(String spaceId, String projectId)
    Opens the "Create New Document" dialog in the given project and space.
    static void
    createDocument(String spaceId, String projectId, String documentType)
    Opens the "Create New Document" dialog in the given project and space.
    static void
    createTestRun(String projectId, String templateId, String id)
    Opens the "Create Test Run" dialog in the given project with the given Test Run id filled in and the given Test Run template selected.
    static void
    createTestRunWithTitle(String projectId, String templateId, String id, String title)
    Opens the "Create Test Run" dialog in the given project with the given Test Run id and title filled in and the given Test Run template selected.
    static void
    duplicateDocument(String name, String spaceId, String projectId, String revision)
    Opens the "Reuse Document" dialog for the given document.
    static void
    executeWidgetAction(com.google.gwt.dom.client.Node referenceNode, boolean showPopupProgressIndicator, String actionId)
    Can be used by JavaScript in RichPageWidget on a client to execute RichPageWidget.executeAction(RichPageWidgetActionContext) on the server.
    static String
    Can be used by JavaScript to obtain the Rest API Token required to construct a valid Rest API request within an existing authentication context.
    static void
    importDocument(String spaceId, String projectId)
    Opens the "Import Document" dialog in the given project and space.
    static void
    Navigates from the main Polarion portal area to a different part of Polarion or invokes a special action.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createDocument

      public static void createDocument(@NotNull String spaceId, @NotNull String projectId)
      Opens the "Create New Document" dialog in the given project and space.

      Live Report page usage example:

       <button onclick="javascript:top.createDocument('$page.reference.spaceReference.spacePath',
        '$page.reference.projectId');">Create New Document</button>
       
      Parameters:
      spaceId - The space id (not null).
      projectId - The project id (not null).
    • createDocument

      public static void createDocument(@NotNull String spaceId, @NotNull String projectId, @Nullable String documentType)
      Opens the "Create New Document" dialog in the given project and space.

      Live Report page usage example:

       <button onclick="javascript:top.createDocument('$page.reference.spaceReference.spacePath',
        '$page.reference.projectId', 'req_specification');">Create New Document</button>
       
      Parameters:
      spaceId - to preselect in dialog (not null).
      projectId - to preselect in dialog (not null).
      documentType - to preselect in dialog (can be null).
      Since:
      3.22.2
    • importDocument

      public static void importDocument(@NotNull String spaceId, @NotNull String projectId)
      Opens the "Import Document" dialog in the given project and space.

      Live Report page usage example:

       <button onclick="javascript:top.importDocument('$page.reference.spaceReference.spacePath', '$page.reference.projectId');">Import Document</button>
       
      Parameters:
      spaceId - The space id (not null).
      projectId - The project id (not null).
    • duplicateDocument

      public static void duplicateDocument(@NotNull String name, @NotNull String spaceId, @NotNull String projectId, @Nullable String revision)
      Opens the "Reuse Document" dialog for the given document.

      Live Report page usage example:

       <button onclick="javascript:top.duplicateDocument('MasterDocument', '$page.reference.spaceReference.spacePath', '$page.reference.projectId', '$page.reference.requestedRevision');">Reuse Document</button>
       
      Parameters:
      name - The document name (not null).
      spaceId - The space id (not null).
      projectId - The project id (not null).
      revision - The document revision (can be null).
    • createChildPlan

      public static void createChildPlan(@NotNull String projectId, @Nullable String parentPath, @Nullable String templatePath, @Nullable String templateLabel)
      Opens the "Create New Plan" dialog in the given project.

      Live Report page usage example:

       <button onclick="javascript:top.createChildPlan('$page.reference.projectId', null, '${page.reference.projectId}/release', 'Release');">Create Release Plan</button>
       
      Parameters:
      projectId - The project id (not null).
      parentPath - The path to the parent Plan to be preselected or null to not preselect anything.
      templatePath - The path to the Plan template or null to allow the user to select one.
      templateLabel - The label to use in the "Create New LABEL" dialog or null for the default "Plan".
    • createTestRun

      public static void createTestRun(@NotNull String projectId, @Nullable String templateId, @Nullable String id)
      Opens the "Create Test Run" dialog in the given project with the given Test Run id filled in and the given Test Run template selected.

      If "Generated Test Run IDs" are enabled and the Test Run template is given, then a new Test Run will be immediately created.

      Test Run template usage example:

       <button onclick="javascript:top.createTestRun('$testRun.projectId', '$testRun.id', null);">Create Test Run</button>
       
      Parameters:
      projectId - The project id (not null).
      templateId - The Test Run template id or null to allow the user to select one.
      id - The new Test Run id or null (is ignored if "Generated Test Run IDs" are enabled).
    • createTestRunWithTitle

      public static void createTestRunWithTitle(@NotNull String projectId, @Nullable String templateId, @Nullable String id, @Nullable String title)
      Opens the "Create Test Run" dialog in the given project with the given Test Run id and title filled in and the given Test Run template selected.

      If "Generated Test Run IDs" are enabled and a Test Run template is given, then a new Test Run will be immediately created.

      The Template title is used when title is null.

      Test Run template usage example:

       <button onclick="javascript:top.createTestRunWithTitle('$testRun.projectId', '$testRun.id', null, null);">Create Test Run</button>
       
      Parameters:
      projectId - The project id (not null).
      templateId - The Test Run template id or null to allow the user to select one.
      id - The new Test Run id or null (is ignored if "Generated Test Run IDs" are enabled).
      title - The new Test Run title or null.
    • executeWidgetAction

      public static void executeWidgetAction(@NotNull com.google.gwt.dom.client.Node referenceNode, boolean showPopupProgressIndicator, @Nullable String actionId)
      Can be used by JavaScript in RichPageWidget on a client to execute RichPageWidget.executeAction(RichPageWidgetActionContext) on the server.
      Parameters:
      referenceNode - - Used to identify which widget this action belongs to. Can be any node inside the widget or the main widget element. (The one with the data-widget attribute.)

      If the node is element and contains any of the attributes mentioned in the RichPageWidget.executeAction(RichPageWidgetActionContext) javadoc, then these attributes are processed in the same way that is described in the executeAction method javadoc. (Even the data-action-id attribute.)

      showPopupProgressIndicator - - Whether the popup progress indicator should be shown.

      actionId - - The optional id of the action that will be accessible using RichPageWidgetActionContext.actionId(). Overrides the value of the data-action-id attribute if it is not an empty string.
      Since:
      3.9.2
    • getRestApiToken

      @Nullable public static String getRestApiToken()
      Can be used by JavaScript to obtain the Rest API Token required to construct a valid Rest API request within an existing authentication context.

      The token is expected in the X-Polarion-REST-Token header.

      Returns:
      a token used to construct a valid REST API request within an existing authentication context or null.
      Since:
      3.22.2
    • branchDocuments

      public static void branchDocuments(@Nullable com.google.gwt.core.client.JavaScriptObject branchConfiguration)
      Opens the "Branch Documents" dialog with the given configuration data filled in. This function accepts a JavaScriptObject:
       {
            documentConfigurations: [   // JsArray containing the specific configuration for a given Document.
                {
                    sourceDocument: 'drivepilot/Design/Software Requirement Specification', //Required property
                    sourceRevision: '1',
                    targetProjectId: 'elibrary',
                    targetSpaceId: 'Specification',
                    targetDocumentName: 'Software_Requirement_Specification_v2',
                    targetDocumentTitle: 'Software Requirement Specification v2',
                    updateTitleHeading: true,
                    query: 'type:requirement',
                    copyWorkflowStatusAndSignatures: false,
                    overwriteWorkItems: true,
                    initializedFields: ['initialEstimate', 'severity']
                },
                ...
            ],
            targetProjectId: 'elibrary',
            targetSpaceId: 'Specification',
            query: 'type:requirement',
            suffix: '_branched',
            updateTitleHeading: true,
            copyWorkflowStatusAndSignatures: false,
            overwriteWorkItems: true,
            initializedFields: ['initialEstimate', 'severity']
       }
       

      Live Report page usage example:

       <button onclick="javascript:top.branchDocuments( {
          documentConfigurations: [
            { sourceDocument: 'drivepilot/Design/Software Requirement Specification' },
            { sourceDocument: 'drivepilot/Design/Software Test Case Specification' }
          ]
       } )">Branch Documents</button>
       
      Parameters:
      branchConfiguration - - The branch configuration. It includes the list of configurations for specific Documents.
      Since:
      3.23.10