Warning |
---|
title | Deprecation Removal notice: |
---|
|
Please note that the the URL user and and URL user password parameters are deprecated and will be removed on March 31, 2022parameters were removed in 3.4.2 (see Deprecation notice: URL user and URL user password parameters). We recommend using using profiles to to access your external data from remote locations. |
Note |
---|
|
This article is not applicable for to the following macros: - Space graph
- Graph from table
|
...
Info |
---|
Before you begin:Before you enter the URL for a repository, ensure that it is a raw URL. A raw URL is defined as the part of the URL following the domain information and includes the query string, if present. For example, in the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx. Tip |
---|
title | How to identify if a file is valid for the macro? |
---|
| Paste the file link into your browser's address bar. If the actual code is displayed in the browser, it is considered to be invalid or in an incorrect format. If the file downloads to your system, the macro can process the file and its contents. |
- Know what is a complete URL.
- A typical path for the raw file on GitLab looks like:
/projects/:id/repository/files/:file_path/raw - Since the host address begins with:
https://gitlab.com/api/v4 - The complete URL, in this example, looks like:
https://gitlab.com/api/v4/projects/:id/repository/files/:file_path/raw?ref=master
For illustrative purposes, a public Bitbucket public repository is used. Use URLs to add to profiles and in macros as per your requirement and your instance. The process for adding a profile and using it in macros remains the same for other repositories and external sources. Note |
---|
title | For private Bitbucket repositories (from third party applications): |
---|
| Use the following URL path to connect to a private Bitbucket repository if logging in from third party applications such as Google: https://api.bitbucket.org/2.0/repositories/$workspace/$repo/src/$commit/$filepath
The path to be specified in the URL parameter of a profile looks like the following example: https://api.bitbucket.org/2.0/repositories/appfire/ac-app-dist/src/17f199444d1386c543ac642e9155b396aaeca403/sample.txt
|
|
...
You can work with URLs in two ways where you can:
Anchor |
---|
| md_URLProfile_absURL |
---|
| md_URLProfile_absURL |
---|
|
Use an absolute URL
...
- Add the Graphviz macro, or edit an existing macro on a page.
- Select the newly created profile, in this case BitURL, from the Profile drop-down, and click Save.
...
You can create a profile by providing a partial URL for the Graphviz content, and enter the relative path to the Graphviz file in the Graphviz macro Graphviz macro.
Navigate to CONFLUENCE ADMINISTRATION > Manage apps > BOB SWIFT CONFIGURATION > Graphviz > Profiles.
Click Add Profile.
- Enter a unique name for the profile in Profile name.
- Select URL from the options in Profile type.
Enter the base URL in the URL text box. A base URL is a part of the path that specifies the location that the macro must access.
Click Save profile to create a profile.
...
To use the profile in a Confluence page:
- Add the Graphviz macro Graphviz macro, or edit an existing macro on a page.
- Select the newly created profile in Profile in the macro editor.
- Enter the relative path of the Graphviz file in the URL to Graphviz file parameter. The relative URL is appended to the base URL specified in the profile to create an absolute path to the file to be rendered.
For example, consider:
Base URL given in the profile: https://api.bitbucket.org/2.0
Relative path given in the macro editor: /repositories/appfire/ac-app-dist/src/17f199444d1386c543ac642e9155b396aaeca403/sample.txt
The macro combines the two to refer to the absolute path to the required file as https://api.bitbucket.org/2.0/repositories/appfire/ac-app-dist/src/17f199444d1386c543ac642e9155b396aaeca403/sample.txt
. - Click Save.
Info |
---|
|
- Only raw URLs must be given in either, the URL parameter in profiles or the URL to Graphviz/Diagraph/Graph/PlantUML file parameter in the macro.
- It is recommended to specify absolute URLs to access files from public locations and to use profiles to access files from private sources. For example, a raw URL that can access an Graphviz file in a public Bitbucket repository is valid. But to render an Graphviz file located in a private repository, we recommend using a profile.
- Profiles are a means to access and retrieve contents from external applications such as Bitbucket, GitLab or GitHub. A profile already contains the base URL and the required credentials (user credentials or an access token) to access the relevant application.
- This method allows multiple users to access a profile across pages and instances of the macros.
|
Addition references