What does that funny URL do?… it bypasses the document hooks… huh?
Recently I came across a way to do this, sort of by accident whilst looking into how some of the new Portal on Device features worked and speaking with Dong Pan from SAP. I looked around but didn’t find much in the way of documentation on this, so I wanted to at least start off by sharing what I could.
What I’d like to do in this blog is show you what I mean in more detail and also explain why this is a useful feature and one that is used in Portal on Device. So by way of example I have written a very simple “Hello World” portal component that just writes out that age old text to the response body. I want to compare the markup that is returned when I call this component in the “normal” way vs. what is generated when called with the prtrw URL.
Here is the simple code:
Well I won’t be winning any awards for that 😆 … but bear with me here. I deployed this to my 7.3 Portal and created an iView in the PCD. When you run this component by calling the following URL:
you get this back:
and here is the source you can see in the browser if you view the source (quite a lot more stuff then I added):
Now for the interesting bit… if I call the same component but replace the /irj/servlet/prt/portal/prtroot/ in the URL… with /irj/servlet/prt/prtrw/prtroot… the output is significantly different:
And this time you get this when you view the source:
So now you might be asking…So why is this useful???… well one reason is that if you wanted to write a Portal Component that produced a JSON or XML or oData response you don’t want all that other markup getting in the way. This was the use case I saw in the Portal on Device example – Portal Components were used to generate JSON responses and were being called from the client using JQuery AJAX calls.
Anyway I hope you find this interesting. Perhaps you have come across this little trick before? I noticed in my research that Visual Composer seems to use it too, but mostly it seems to be a well kept secret 😯 . Thanks for taking the time to read this post. Let me know what you think below.