Examples¶
Every example is a standalone project; download its source archive below. Each builds with npm install && npm run package into an upload-ready ZIP, and each page shows the full source with explanations. The first four teach the basics one step at a time; the other three show what you can build with them.
Learn the basics¶
Start here. Each example adds one capability to the previous one, from a page that only shows text to a view with its own server-side endpoints.
| Example | View type | Adds | Talks to |
|---|---|---|---|
| Hello Polarion | Form extension | The smallest possible application: a manifest, a page and the packaging | nothing |
| Application context | Form extension + sidebar + navigation topic | The SDK, and what the context contains in each placement, from one build | SDK |
| Selection sidebar | Sidebar | Following the selection with events; REST API queries; icons | SDK events, REST API (query) |
| Traceability with endpoints | Form extension + endpoints | Your own server-side endpoints: a link tree computed on the server, and a POST that writes | SDK, your own endpoints (GET, POST) |
What you can build¶
Larger applications that combine the basics into something a team would use.
| Example | View type | Shows | Talks to |
|---|---|---|---|
| Work item card | Form extension | Reading a work item and its links; renaming it, changing its status, adding a comment | SDK, REST API (GET, PATCH, POST) |
| Project dashboard | Navigation topic | A full page with a query box, tiles, charts by status, type and assignee, and a table | SDK, REST API (list, relationships) |
| Release checklist | Sidebar + endpoints | Validation of the selection by server-side rules; bulk assignment through a writing endpoint | SDK events, your own endpoints (POST, POST) |
Downloads¶
Each example is available as an application package (upload it as it is in Global Administration → Applications) and as the source project (unzip, npm install, npm run package).
| Example | Identifier | Version | Application package | Source project |
|---|---|---|---|---|
| Hello Polarion | com.example.hello | 0.2.0 | com.example.hello.zip | hello-polarion-source.zip |
| Application context | com.example.context | 0.2.0 | com.example.context.zip | application-context-source.zip |
| Selection sidebar | com.example.selectionsidebar | 0.1.1 | com.example.selectionsidebar.zip | selection-sidebar-source.zip |
| Traceability with endpoints | com.example.traceability | 0.2.2 | com.example.traceability.zip | traceability-source.zip |
| Work item card | com.example.workitemcard | 0.2.1 | com.example.workitemcard.zip | work-item-card-source.zip |
| Project dashboard | com.example.dashboard | 0.2.1 | com.example.dashboard.zip | project-dashboard-source.zip |
| Release checklist | com.example.releasechecklist | 0.2.2 | com.example.releasechecklist.zip | release-checklist-source.zip |
The packages are the ones used for the screenshots in this guide. The source archives exclude node_modules; the SDK is installed from the vendored tarball on npm install, or replace it with your server's URL (see Install the SDK).
Common structure¶
All examples share the layout from Set up the project: Vite + React + TypeScript, manifest.json at the root, scripts/package.mjs for the ZIP, in the examples that call Polarion a src/polarion.ts with restFetch for REST API calls or endpointFetch for calls to the application's own endpoints, and the SDK installed from a vendored tarball in examples/_sdk/.
- examples/
- _sdk/
- polarion-app-sdk-0.5.2-preview.tgz
- hello-polarion/
- application-context/
- work-item-card/
- selection-sidebar/
- project-dashboard/
- traceability/
- release-checklist/
- _sdk/
To use an example as the starting point of your own application:
- Copy the folder.
- Change
identifier,titleandpublisherNameinmanifest.json. - Replace the SDK dependency with the URL of your server:
npm install https://<host>/polarion/sdk/applications/polarion-app-sdk-0.5.2-preview.tgz. npm run package, upload, place the view.
Trying them on a test server¶
Upload all seven; they use different identifiers and do not interfere. Then:
- add
<applicationView id="com.example.hello.hello" label="Hello Polarion" height="320px"/>,<applicationView id="com.example.context.form" label="Application context" height="460px"/>,<applicationView id="com.example.workitemcard.card" label="Work item card" height="640px"/>and<applicationView id="com.example.traceability.tree" label="Traceability" height="480px"/>to the form layout of a work item type; - add
<applicationView id="com.example.dashboard.dashboard"/>and<applicationView id="com.example.context.topic"/>to the project's Topics configuration; - open the Work Items table and pick Application context, Selection inspector or Release checklist from Show Sidebar.