Secure call of jahia page from external application

173 Views Asked by At

I'd like to call a jahia web page from another application. The external application would render a jahia web page with some data. For example, we have a jahia page in which a node is defined. This node simply displays a name. Application A wants to render the jahia web page with some data, a name retrieved in application A.

I don't really know how I could do to complete this. I thought about calling a jahia action thanks to its url (containing .do) from application A and with the name in parameters. It could be with ajax request.

I also read the jahia documentation about Rest API (https://academy.jahia.com/documentation/techwiki/content/content-manipulation#Legacy_REST_API) but I can't find out how to do it properly.

1

There are 1 best solutions below

0
On

yes it's possible!

It's possible with REST API, but there is a simpler way (if I understand well what you want to do):

You can just call the normal page URL with a parameter (ex: GET parameter) like this:

http://hostname/sites/sitekey/home/mypage.html?myparam=value

And then you get the param and display it into your node rendering view: /jnt_myNode/html/myNode.jsp:

Value = ${param.myparam}

IMPORTANT: this will work directly in edit/preview mode, but if you want to see your param in Live mode, you need to manage a special cache configuration: you need to create a .properties file next to your JSP view file with the same name = /jnt_myNode/html/myNode.properties with content:

cache.requestParameters=myparam

Without this, your page will cache the first value sent; and then display it for following requests :/

Hope this will help you, for more sources: https://academy.jahia.com/files/live/sites/academy/files/documentation/training/TR7_Basic-Developer_EN_V1.5.pdf https://academy.jahia.com/files/live/sites/academy/files/documentation/training/Jahia%20Template%20Development%20Training.pdf and : https://academy.jahia.com/training-kb/knowledge-base/how-to-allow-end-user-sorting-a-list

Regards,