Support

Expand all | Collapse all

Velocity - Extracting URLs

  • 1.  Velocity - Extracting URLs

    Posted 29 days ago
    Hi,

    I'm trying to include URL links of all documents in $documentList in my Velocity report to be displayed as hyperlinks/strings in the word report.

    I tried using the following assuming the link to be displayed as a paragraph content, but it didn't work.

    #foreach($vDoc in $documentList)
    <p>$vDoc.document.documentUrl</p>
    #end
    ​​
    I also tried using documentUrlDao like below:

    #set ($test = $applicationContext.getBean("documentUrlDao"))
    #foreach($vDoc in $documentList)
    <p>$test.getDocumentURLs($vDoc.document.id)</p>
    #end

    how to get the url of documents?

    Kind Regards,
    Ahmed

    ------------------------------
    Ahmed Ali

    ------------------------------


  • 2.  RE: Velocity - Extracting URLs

    Posted 6 days ago
    Hi,

    Could you please help me on this issue.

    Regards,

    ------------------------------
    Ahmed Ali
    Nanosonics
    ------------------------------



  • 3.  RE: Velocity - Extracting URLs

    Posted 5 days ago
    Hi,

    I'm still struggling to find a solution for this issue.

    ------------------------------
    Ahmed Ali
    Nanosonics
    ------------------------------



  • 4.  RE: Velocity - Extracting URLs

    Posted 5 days ago
    Hi,

    why don't you build the URL on your own? Look at the URL for a given Item in the Single Item View.
    The variable parts are :
    • base URL -> use $project.getOrganization().getBaseUrl()
    • item ID ->  use $vDoc.document.id
    • project ID -> use $project.id
    I hope it helps ...

    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
    ------------------------------



  • 5.  RE: Velocity - Extracting URLs

    Posted 5 days ago
    Thanks Alessandro, very helpful.

    Yes, you would have to build it manually. There's a built in variable called $baseUrl you can use and append the document id and project id to that (you will have to use the url for a document from your system as a model). You can use the .concat() for adding to the string.

    Ahmed, sorry for the delay in getting back to you! thanks for reaching back out.

    Best,




    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------