Generating links to documents

We can generate links our documents in the report output with the following steps.

Add special fields

Add the following fields, depending on whether you wish to use Share or the alfresco web client:
"alfresco-download-url" and "alfresco-show-detail-url"
or
"share-download-url" and "share-show-detail-url"

Add special parameters

Add the following parameters (do not add values, they are filled in at runtime): ALF_PROTOCOL, ALF_HOST, ALF_PORT y ALF_CONTEXT

Add the hyperlink to the field

Click on the field, then add and edit the hyperlink. Next, change the hyperlink type to Remote.

Add a hyperlink reference expression

To create a download url:
$P{ALF_PROTOCOL}+"://"+$P{ALF_HOST}+":"+$P{ALF_PORT}+"/"+$P{ALF_CONTEXT}+$F{alfresco-download-url}"/"+$P{ALF_CONTEXT}+$F{alfresco-download-url}

 

To create a detail url:

$P{ALF_PROTOCOL}+"://"+$P{ALF_HOST}+":"+$P{ALF_PORT}+"/"+$P{ALF_CONTEXT}+$F{alfresco-show-detail-url}"/"+$P{ALF_CONTEXT}+$F{alfresco-show-detail-url}

 

Important: Substitute "share" for "alfresco" if you wish to use Share.