About Component Exchanges Hosted in VB Studio Projects

A VB Studio project can host a secure component exchange to store and distribute components only available to developers in the instance.

Each VB Studio project includes the component exchange 'compcatalog', which is the service used to access components stored in the project. The compcatalog service is provisioned by default with each project. Any project can be used to host an exchange if storage is enabled for the VB Studio instance. Component developers can use the service's APIs to publish components to the exchange.

To integrate a private exchange in a VB Studio project with a Visual Builder instance, an administrator specifies the URL for the project's compcatalog service and the credentials for a user that can access the project. The credentials used to connect to the exchange must be an owner or member of the VB Studio project hosting the exchange. All developers in the tenant use these credentials to connect to the exchange to get the components and application templates they want to use in their projects.

The URL for the project's compcatalog service has the following form: https://<hostname>/<org_id>/s/<project_id>/compcatalog/0.2.0/

In the URL, "compcatalog" is the exchange service and "0.2.0" is the API version of the service.

To determine the URL for the compcatalog service, you need to know the following details about the VB Studio project:

  • <hostname>. This is the VB Studio server where the project is hosted.
  • <org_id>. This is the organization (tenant) name.
  • <project_id>. This is a project identifier unique to the tenant. This is not the same as the project display name entered by the project owner and is not displayed in the VB Studio UI.

If you do not know the <project_id> for the project hosting the exchange, you can get it from the Git or Maven configuration, or by using the VB Studio Projects API. The following table describes how to get the <project_id>.

Method Steps
From a Git or Maven configuration
  1. In VB Studio, open the project and locate the Repositories tab on the project's Home Page.
  2. Expand the the Git or Maven section and copy the repository URL.

The Git repository URL will be similar to the following: https://{user_id}@{hostname}/{org_id}/s/my-org_testproject_5/scm/my-repo.git

The Maven repository URL will be similar to the following: http://{hostname}/{org_id}/s/my-org_testproject_5/maven/

In these examples, "my-org_testproject_5" is the project identifier. In this case, the URL for the 'compcatalog' service will be similar to https://{hostname}/my-org/s/my-org_testproject_5/compcatalog/0.2.0/

Using VB Studio Projects API

If you know the name of the project sharing your exchange instance, you can get the project metadata using a REST call to the VB Studio API.

For example, you can use cURL to send a REST call similar to the following:

curl -X GET -u '{username}:{password}'https://{hostname}/{org_id}/api/v2/projects/info/name:TestProject

The return should be similar to the following:

[
  {
    "organization":"my-org",
    "identifier":"my-org_testproject_5",
    "name":"TestProject",
    "urlId":"testproject",
    "description":null,
    "accessibility":"PRIVATE",
    "template":false,
    "state":"READY",
    "locked":false,
    "relation":{"membership":"OWNER","favorite":false}
  }
]

In this example, the identifier property in the return is the project identifier that is needed for the "compcatalog" service URL.