Package com.polarion.alm.ui.client
Class PublicJS
java.lang.Object
com.polarion.alm.ui.client.PublicJS
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 TypeMethodDescriptionstatic 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 inRichPageWidget
on a client to executeRichPageWidget.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
navigateFromFrame
(String urlHash) Navigates from the main Polarion portal area to a different part of Polarion or invokes a special action.
-
Method Details
-
createDocument
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 (notnull
).projectId
- The project id (notnull
).
-
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 (notnull
).projectId
- to preselect in dialog (notnull
).documentType
- to preselect in dialog (can benull
).- Since:
- 3.22.2
-
importDocument
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 (notnull
).projectId
- The project id (notnull
).
-
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 (notnull
).spaceId
- The space id (notnull
).projectId
- The project id (notnull
).revision
- The document revision (can benull
).
-
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 (notnull
).parentPath
- The path to the parent Plan to be preselected ornull
to not preselect anything.templatePath
- The path to the Plan template ornull
to allow the user to select one.templateLabel
- The label to use in the "Create New LABEL" dialog ornull
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 (notnull
).templateId
- The Test Run template id ornull
to allow the user to select one.id
- The new Test Run id ornull
(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 (notnull
).templateId
- The Test Run template id ornull
to allow the user to select one.id
- The new Test Run id ornull
(is ignored if "Generated Test Run IDs" are enabled).title
- The new Test Run title ornull
.
-
executeWidgetAction
public static void executeWidgetAction(@NotNull com.google.gwt.dom.client.Node referenceNode, boolean showPopupProgressIndicator, @Nullable String actionId) Can be used by JavaScript inRichPageWidget
on a client to executeRichPageWidget.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 theRichPageWidget.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 usingRichPageWidgetActionContext.actionId()
. Overrides the value of the data-action-id attribute if it is not an empty string.- Since:
- 3.9.2
-
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 aJavaScriptObject
:{ 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