### Codebeamer Localization Guide (Property File Example) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ This snippet shows an example of a `*.properties` file used for localizing Codebeamer. It demonstrates key-value pairs for translating UI elements and messages. ```properties # Example ApplicationResources.properties # English label.username=Username button.save=Save message.success=Operation completed successfully. # Example ApplicationResources_fr.properties # French label.username=Nom d'utilisateur button.save=Sauvegarder message.success=Opération terminée avec succès. ``` -------------------------------- ### Client-side .NET Example Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ An example of a REST API client built using .NET for interacting with CodeBeamer. This showcases basic client setup. ```.NET using System; using System.Net.Http; public class CodebeamerDotNetClient { private readonly HttpClient _httpClient; public CodebeamerDotNetClient(string baseUrl, string apiKey) { _httpClient = new HttpClient { BaseAddress = new Uri(baseUrl) }; _httpClient.DefaultRequestHeaders.Add("Authorization", $"ApiKey {apiKey}"); _httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); } // Add methods here to interact with specific API endpoints public void ExampleCall() { Console.WriteLine("Codebeamer .NET client initialized."); } } ``` -------------------------------- ### Get Baseline Set Import Steps (Java) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Provides information about the necessary steps to import specified baseline sets from DOORS. This guides the user through the import process. ```java /** * Get information about the necessary steps to import the specified baseline sets. */ public void getBaselineSetImportSteps(List baselineSetIds) { // Implementation details for fetching import steps } ``` -------------------------------- ### Codebeamer Wiki Plugin Development - Hello World Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ A foundational example for developing Codebeamer wiki plugins. This 'Hello World' tutorial guides users through setting up their IDE, implementing a basic plugin class, and compiling/deploying it. ```java package com.example.wikiplugin; import com.sks.wm.api.wiki.AbstractCodeBeamerWikiPlugin; import com.sks.wm.api.wiki.WikiPage; import com.sks.wm.api.wiki.WikiPageContext; public class HelloWorldWikiPlugin extends AbstractCodeBeamerWikiPlugin { @Override public String getPluginName() { return "HelloWorldPlugin"; } @Override public String getPluginVersion() { return "1.0"; } @Override public String execute(WikiPageContext context) { WikiPage page = context.getWikiPage(); String userName = context.getCurrentUser().getName(); StringBuilder html = new StringBuilder(); html.append("

Hello, ").append(userName).append("!

"); html.append("

This is your first Codebeamer Wiki Plugin.

"); html.append("

Current page title: ").append(page.getTitle()).append("

"); return html.toString(); } } ``` -------------------------------- ### Codebeamer xUnit Uploader Plugin Setup Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Instructions for setting up and installing the Codebeamer xUnit Uploader Plugin. This plugin is used to import test results into Codebeamer, facilitating test result analysis and reporting. ```bash # Steps to install the xUnit Uploader Plugin: # 1. Download the plugin JAR file from the Codebeamer marketplace or repository. # 2. Access your Codebeamer instance's administration panel. # 3. Navigate to 'System' -> 'Plugins' or 'Add-ons'. # 4. Click on 'Upload Plugin' or 'Install Plugin'. # 5. Select the downloaded xUnit Uploader plugin JAR file. # 6. Follow the on-screen prompts to complete the installation. # 7. Restart Codebeamer if prompted. # After installation, configure the plugin settings under 'Administration' -> 'Plugins' -> 'xUnit Uploader Plugin'. # You will typically need to specify paths to your xUnit XML test result files and map them to Codebeamer test case/result fields. ``` -------------------------------- ### Client-Side Implementations and Examples Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Provides guidance and code examples for client-side implementations, including Java, C#, and .NET. ```APIDOC ## Client-Side Implementations and Examples ### Description This section offers resources for developers looking to integrate with the CodeBeamer REST API from various client-side environments. It includes setup instructions, sample implementations, and examples for common operations. ### Resources #### Java Sample Implementation ##### Description Provides a sample Java implementation for interacting with the CodeBeamer REST API. #### Setup the REST API Connection ##### Description Instructions and code snippets for establishing a connection to the CodeBeamer REST API. #### Create a New Test Case ##### Description Example code demonstrating how to create a new test case using the API. #### Find Unresolved Test Cases by Category ##### Description Example code for finding unresolved test cases filtered by category. #### Find Test Cases Created by Ourselves Within the Last 10min ##### Description Example code to find test cases created by the current user in the last 10 minutes. #### Execute a State Transition on the New Test Case ##### Description Example code for executing a state transition on a newly created test case. #### Add a Reply to a Previous Comment on the Test Case ##### Description Example code for adding a reply to an existing comment on a test case. #### Update an Existing Comment on the Test Case ##### Description Example code for updating an existing comment on a test case. #### Download a File Attached to the Test Case ##### Description Example code for downloading a file attached to a test case. #### C# Sample Implementation ##### Description Provides a sample C# implementation for interacting with the CodeBeamer REST API. #### Other Sample Implementations ##### Description Links or references to other available sample implementations in different languages. #### Example Rest API Client based using .NET ##### Description An example of a REST API client implementation using the .NET framework. ``` -------------------------------- ### Start CodeBeamer Application with Docker Compose Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ This command initiates the CodeBeamer application using a Docker Compose setup. It assumes a `docker-compose.yml` file is present in the current directory, defining the necessary services (e.g., database, application server). ```bash docker-compose up -d ``` -------------------------------- ### IFrame Integration Client Library - Simple Example Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ A basic example demonstrating how to integrate Codebeamer content into an external application using an iframe and the client library. ```html ``` -------------------------------- ### CSV File Example and REST Client Examples Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Provides an example for CSV file handling and general REST client code examples. ```APIDOC ## CSV File Example and REST Client Examples ### Description This section includes an example for handling CSV files and provides general code examples for using the REST client interface. ### Resources #### CSV File Example ##### Description An example demonstrating how to work with CSV files using the CodeBeamer API. #### Rest Client Code Examples ##### Description General code examples for utilizing the CodeBeamer REST client. #### Basic Interfaces and Classes ##### Description An overview of the fundamental interfaces and classes used in the REST client. #### Examples to use CodeBeamerService Rest Interface ##### Description Specific examples illustrating how to use the `CodeBeamerService` REST interface for various operations. #### Create new Items ##### Description Code examples for creating new items via the REST API. #### Update existing Items ##### Description Code examples for updating existing items via the REST API. #### Upload attachments ##### Description Code examples for uploading attachments to items via the REST API. ``` -------------------------------- ### IFrame Integration Client Library - Example with Communication Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ An example showing how to establish communication between an iframe embedded Codebeamer content and its parent window using JavaScript. ```html Codebeamer IFrame Example ``` -------------------------------- ### Start Codebeamer Service (Linux/Unix) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Command to start the Codebeamer application service on Linux or Unix systems. This assumes the service has been properly installed and configured. ```bash /opt/codebeamer/bin/cbserver start ``` -------------------------------- ### Upgrade Codebeamer - Simple Process Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ A simplified process for upgrading Codebeamer from older versions, typically involving installing a new version, upgrading the database, and starting the service. ```bash # Step 1: Install NEW CB # Step 2: Database upgrade script execution # Step 3: Start upgrade script # Step 4: Get a new license # Step 5: Runtime Parameters configuration # Step 6: Start Codebeamer # Step 7: Clearing Browser Caches # Step 8: Starting Re-indexing # Step 9: Validate logs ``` -------------------------------- ### Swagger UI - Get Trackers in a Project Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Example API call using Swagger UI to retrieve a list of all trackers associated with a specific project. This requires the project ID. ```json { "method": "GET", "url": "/api/v3/projects/{projectId}/trackers" } ``` -------------------------------- ### Swagger UI - Get Project Information Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Example API call using Swagger UI to fetch detailed information about a specific project. This requires the project ID as a parameter. ```json { "method": "GET", "url": "/api/v3/projects/{projectId}" } ``` -------------------------------- ### Java IDE Setup for CodeBeamer Extensions (Java) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Provides guidance on setting up a Java IDE for developing CodeBeamer extensions, including necessary configurations and dependencies. ```java // Maven or Gradle configuration for CodeBeamer extension development com.example codebeamer-api 1.0 ``` -------------------------------- ### Swagger UI - Get Tracker Fields Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Example API call using Swagger UI to retrieve the fields associated with a specific tracker. This provides information about the data structure of the tracker. ```json { "method": "GET", "url": "/api/v3/trackers/{trackerId}/fields" } ``` -------------------------------- ### Swagger UI - Get Tracker Information Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Example API call using Swagger UI to fetch detailed information about a specific tracker within a project. This requires both the project ID and tracker ID. ```json { "method": "GET", "url": "/api/v3/projects/{projectId}/trackers/{trackerId}" } ``` -------------------------------- ### External Widget Configuration Example (extension.json) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ An example configuration file (extension.json) for setting up external dashboard widgets in Codebeamer. It specifies widget IDs, categories, and display locations. ```json { "id": "com.example.mywidget", "name": "My Custom Widget", "version": "1.0.0", "description": "A sample external widget.", "categories": [ "DASHBOARD" ], "dashboardWidgets": [ { "id": "myWidget", "name": "My Widget", "description": "Displays custom content.", "url": "/my-custom-widget/index.html", "icon": "/my-custom-widget/icon.png" } ] } ``` -------------------------------- ### Swagger UI - Get List of Available Projects Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Example API call using Swagger UI to retrieve a list of all available projects within Codebeamer. This demonstrates interaction with the Codebeamer REST API. ```json { "method": "GET", "url": "/api/v3/projects" } ``` -------------------------------- ### CSV File Example Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Demonstrates how to read a CSV file, likely for importing or exporting data related to CodeBeamer items or configurations. Includes basic file reading logic. ```Python import csv def read_csv_file(filepath): with open(filepath, 'r', newline='') as csvfile: reader = csv.reader(csvfile) for row in reader: print(row) # Example usage: # read_csv_file('data.csv') ``` -------------------------------- ### Manage Item Reviews Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ APIs for managing item reviews, including getting review schemas, starting new reviews, updating configurations, retrieving all reviews, and submitting votes. Supports detailed review workflows. ```API GET /items/{itemId}/reviews/schema POST /items/{itemId}/reviews PUT /items/{itemId}/reviews/{reviewId}/configuration GET /items/{itemId}/reviews GET /items/{itemId}/revisions/{revisionId}/reviews/summary GET /items/{itemId}/reviews/{reviewId}/reviewers/votes POST /items/{itemId}/revisions/{revisionId}/reviews/{reviewId}/vote GET /users/{userId}/reviews GET /users/{userId}/items/{itemId}/reviews GET /users/{userId}/items/{itemId}/revisions/{revisionId}/reviews/{reviewId}/vote/rating ``` -------------------------------- ### Set up Codebeamer SFTP Server Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Configuration details for setting up an SFTP server to allow access to the physical content of Codebeamer artifacts. This section covers both Linux and Windows setups. ```bash # Example for Linux (using OpenSSH server) # Ensure sshd is installed and running # Configure /etc/ssh/sshd_config: # Subsystem sftp internal-sftp # Match Group sftpusers # ChrootDirectory %h # ForceCommand internal-sftp # AllowTcpForwarding no # X11Forwarding no # Create SFTP user group and add users groupadd sftpusers usermod -aG sftpusers # Set directory permissions chown root:root /home/ chmod 755 /home/ chown :sftpusers /home//data chmod 755 /home//data ``` ```powershell # Example for Windows (using OpenSSH Server feature) # Enable OpenSSH Server feature in Windows Features # Configure sshd_config (usually in C:\ProgramData\ssh\sshd_config) # Add similar directives as the Linux example, adjusting paths as needed. # Create SFTP user and group (using PowerShell) Add-LocalGroup -Name "sftpusers" Add-LocalUser -Name "sftpuser" -PasswordNeverExpires -UserMayChangePassword $false Add-LocalUserToLocalGroup -User "sftpuser" -Group "sftpusers" # Set directory permissions (example) New-Item -Path "C:\SFTP\\data" -ItemType Directory # Use icacls or other methods to set appropriate NTFS permissions for the user and group. ``` -------------------------------- ### Get All Importable Baseline Sets Steps (Java) Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ Retrieves information on the steps required to import all importable baseline sets defined on a DOORS project or folder. This is useful for bulk import planning. ```java /** * Get information about the necessary steps to import all importable baseline sets defined on the specified DOORS project or folder. */ public void getAllImportableBaselineSetsSteps(String doorsProjectIdOrFolderId) { // Implementation details for fetching all importable baseline sets steps } ``` -------------------------------- ### Configure Google OpenID Server Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ This configuration guide details the setup for integrating Google OpenID as an authentication provider for CodeBeamer. It covers the necessary parameters and steps required on both the Google Cloud Console and within CodeBeamer's settings. ```text Google OpenID Server Configuration: 1. Create a new project in Google Cloud Console. 2. Enable the 'Identity Platform' API. 3. Create an OAuth 2.0 Client ID for a Web application. 4. Configure authorized redirect URIs with your CodeBeamer instance URL. 5. Obtain the Client ID and Client Secret. CodeBeamer Configuration: 1. Navigate to Administration > OpenID Connect. 2. Select 'Google' as the provider. 3. Enter the obtained Client ID and Client Secret. 4. Configure the discovery URL (e.g., https://accounts.google.com/.well-known/openid-configuration). 5. Save the settings. ``` -------------------------------- ### External Widget Configuration Example (extension.json) - Detailed Source: https://support.ptc.com/help/codebeamer/r2.1/en/index.html#page/codebeamer/developers_guide/index_page/codebeamer/developers_guide/20111411.html_ A more detailed example of an extension.json file for configuring external widgets, including specific enablement for different widget types like DashboardWidgets, ItemDetailsWidgets, and DocumentViewWidgets. ```json { "id": "com.example.detailedwidget", "name": "Detailed Custom Widget", "version": "1.0.0", "description": "A sample external widget with detailed configuration.", "categories": [ "DASHBOARD", "ITEM_DETAILS", "DOCUMENT_VIEW" ], "dashboardWidgets": [ { "id": "myDashboardWidget", "name": "My Dashboard Widget", "description": "A widget for dashboards.", "url": "/my-detailed-widget/dashboard.html", "icon": "/my-detailed-widget/dashboard_icon.png" } ], "itemDetailsWidgets": [ { "id": "myItemWidget", "name": "My Item Details Widget", "description": "A widget for item details.", "url": "/my-detailed-widget/itemdetails.html", "icon": "/my-detailed-widget/itemdetails_icon.png" } ], "documentViewWidgets": [ { "id": "myDocumentWidget", "name": "My Document View Widget", "description": "A widget for document view.", "url": "/my-detailed-widget/documentview.html", "icon": "/my-detailed-widget/documentview_icon.png" } ] } ```