- Created by Robert Reiner, last modified on 25. Aug 2017
projectdoc Toolbox
Transclude HTML content from a remote server.
- Categories
- Tags
- Type
- Extension
- Since
- 1.1
Transcludes an HTML snippet from a resource on a server.
The intention is to fetch the HTML structure of widgets from a dashboard and render them on a wiki page. Note that the content is not indexed with Lucene.
Including unknown text snippets inside a web page is dangerous!
Please be very careful when transcluding information from external servers!
Usually you should only transclude pages or parts of pages, if you also are in control of the contents. Transcluding arbitrary information my result in executing scripts on your server. A malicious attacker may steal other user's authentication cookie or do other harmful things!
In contrast to the System Transclusion Macro, the HTML Snippet Macro allows to specify the link to the resource directly and therefore does not provide system identifiers to define a space-wide base URL.
Properties
URL
The URL to the resource to transclude.
Selector
The selector is required to specify an HTML element.
Introduce the selector with '#' to specify the unique identifier of an HTML element.
Use jsoup's Selector Syntax to specify queries. The first element in the result set is transcluded content.
Transclude whole File?
The selector is mandatory. If you want to transclude the whole page, consider using the Text Snippet Macro.
Encoding
The encoding of the file. Defaults to the character type announced by the response.
Plain
If unchecked, the snippet is rendered within the Code Block Macro (only then do the following code attributes apply). Otherwise it is rendered as plain text fragment.
Code Language
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
The value "Default Language" refers to the value provided by the space property "Code Language".
Code Title
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
Code Theme
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
Code Line Numbers
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
Code First Line
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
Code Collapse
If the snippet is rendered not in plain text, this value is passed to the Code Block Macro.
Details
Error Messages
If the macro cannot find the HTML element to transclude, an error message is displayed.
If you encounter a 200: OK message, the file has been found on the remote server, but the HTML element to transclude cannot be located. Please check the selector syntax.
If the result is a 404, the specified file cannot be found to transclude from.
Authentication
Since version 1.4 of the Information Systems Extension the autoconverter service and transclusion macros (System Transclusion Macro, Text Snippet Macro, and HTML Snippet Macro) use the Application Links configured in Confluence to access remote resources.
The following authentication methods are supported:
- Impersonating OAuth (recommended)
- Basic Authentication (useful for non-Atlassian servers that do not provided OAuth)
Prior to version 1.4 the macro does not provided means to access resources that are protected by a password.
Transcluded Content
The whitespace formatting of the transcluded content is currently not preserved (see PDEXINFOSY-20 - Getting issue details... STATUS ).
Related macros
The following macros help with referencing resources on other information servers:
- Enterprise Architect Image Link Macro
- Renders an image generated from an Enterprise Architect diagram, transcluded from a server.
- Hudson Link Macro
- Render links to jobs and services on a Hudson server.
- Javadoc Link Macro
- Links API documentation pages for Java elements.
- Nexus Link Macro
- Renders a link to an artifact stored on a Nexus server.
- Site Link Macro
- Links to a resource on a versioned site.
- Sonar Link Macro
- Renders a link to a project on a Sonar service.
- Subversion Link Macro
- Renders a link to a resource on a Subversion (SVN) repository.
- Subversion Transclusion Macro
- Transcludes a snippet from a project on a Subversion (SVN) server.
- System Image Link Macro
- Renders an image transcluded from a remote server.
- System Link Macro
- Links to a resource on a server.
- System Transclusion Macro
- Transclude content from a resource from a remote system.
- Text Snippet Macro
- Transclude text content from a remote server.