Products Downloads


French version


 

This function returns an alphanumeric string representing a URI.

The information describing the URI is stored in a Hash object, with the following attributes:

  • "scheme": alphanumeric string representing the name of the URI scheme. This attribute is optional: if it is not present, "https" is taken as the scheme,
  • "host": alphanumeric string representing the domain (host name or IP address). This attribute is mandatory,
  • "path": alphanumeric string representing the path (segment sequence - similar to directories - and separated by slashes (/)). This attribute is mandatory,
  • "port": URI port number. This attribute is optional,
  • "queryparams": Hash object representing the URI parameters. An attribute represents the parameter name and its value represents the parameter value.


Several Hash objects can be passed to this function as a parameter.

In this case, the objects are merged to produce a single URI description Hash object.

This object will contain attribute/value pairs which come from a Hash object passed as a parameter.

If several Hash objects contain the same attribute, the chosen value is that of the first Hash object passed as a parameter which has this attribute.

 

Parameters

Hash

uriDescription

Hash object containing part or all of a URI description

Mandatory

Hash

uriPart?

One or more Hash objects each containing part of the URI description

Optional

 


For example

<#assign imageWidth = 200, imageHeight = 300 />
<#assign uriFirstPart = {"scheme": "https",
"host": "picsum.photos"} />
<#assign uriSecondPart = {"path": imageWidth + "/" + imageHeight,
	"queryparams": {"gravity": "east"}} /> 


<#-- Display image from URI https://picsum.photos/200/300/?gravity=east -->
<fo:external-graphic src="${ hardisCore.uriBuilder(uriFirstPart, uriSecondPart)?esc}" /> 


↑ Top of page